readcapacity.c
842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <ultra64.h>
#include "../org/include/leodefine.h"
#include "../org/include/leodrive.h"
#ifndef _LONGCMD
#include <leo.h>
#else
#include <leosp.h>
#endif
extern s32 __leoActive;
extern u16 LEORAM_START_LBA[DISK_TYPES];
extern u32 LEORAM_BYTE[DISK_TYPES];
extern u8 LEOdisk_type;
s32 LeoReadCapacity(LEOCapacity *cap, s32 dir)
{
/*
* Check for existence of Leo Manager
*/
if (!__leoActive) {
return(-1);
}
if (dir == OS_WRITE)
{
/* WRITE CAPACITY */
cap->startLBA = (u32)LEORAM_START_LBA[LEOdisk_type] - SYSTEM_LBAS;
cap->endLBA = MAX_L_LBA;
cap->nbytes = LEORAM_BYTE[LEOdisk_type];
}
else
{
/* READ CAPACITY */
cap->startLBA = (u32)0x00;
cap->endLBA = MAX_L_LBA;
cap->nbytes = RD_BYTES_PER_DRV;
}
return LEO_ERROR_GOOD;
} /* LeoReadCapacity */