[ntsc-1.2] Import libleo from Decompollaborate/n64dd (#2104)

* Create stack.h for STACK/STACK_TOP

* Import libleo from Decompollaborate/n64dd

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com>

* Use (unsigned) int when in mdebug

* Apply suggestions from code review

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* Use && in leocmdex.c

* Use proper names for character tables, revert sNonKanjiIndices

* Fix incorrect OSMesg casts

* Use LEO_ERROR_GOOD even where docs say 0

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* Remove "Presumably" comment

* Whitespace

* Remove redundant (debug-only) returns

---------

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com>
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
This commit is contained in:
cadmic
2024-09-03 12:30:14 -07:00
committed by GitHub
parent 6f396e7cc8
commit 2152d1df2d
56 changed files with 4363 additions and 22 deletions
+10
View File
@@ -0,0 +1,10 @@
#ifndef STACK_H
#define STACK_H
#define STACK(stack, size) \
u64 stack[ALIGN8(size) / sizeof(u64)]
#define STACK_TOP(stack) \
((u8*)(stack) + sizeof(stack))
#endif
+214
View File
@@ -0,0 +1,214 @@
#ifndef ULTRA64_LEO_H
#define ULTRA64_LEO_H
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include "pi.h"
#include "leoappli.h"
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
typedef u32 LEOError;
typedef u8 LEOSpdlMode;
typedef u8 LEOStatus;
typedef struct LEOVersion {
/* 0x0 */ u8 driver; // version of sw
/* 0x1 */ u8 drive; // version of hw
/* 0x2 */ u8 deviceType; // dev type, always 00
/* 0x3 */ u8 nDevices; // # of devices, always 01
} LEOVersion; // size = 0x4
typedef struct LEOCapacity {
/* 0x0 */ u32 startLBA;
/* 0x4 */ u32 endLBA;
/* 0x8 */ u32 nbytes;
} LEOCapacity; // size = 0xC
typedef struct LEODiskTime {
/* 0x0 */ u8 pad;
/* 0x1 */ u8 yearhi;
/* 0x2 */ u8 yearlo;
/* 0x3 */ u8 month;
/* 0x4 */ u8 day;
/* 0x5 */ u8 hour;
/* 0x6 */ u8 minute;
/* 0x7 */ u8 second;
} LEODiskTime; // size = 0x8
typedef struct LEOSerialNum {
/* 0x0 */ u64 lineNumber;
/* 0x8 */ LEODiskTime time;
} LEOSerialNum; // size = 0x10
typedef struct LEODiskID {
/* 0x0 */ u8 gameName[4];
/* 0x4 */ u8 gameVersion;
/* 0x5 */ u8 diskNumber;
/* 0x6 */ u8 ramUsage;
/* 0x7 */ u8 diskUsage;
/* 0x8 */ LEOSerialNum serialNumber;
/* 0x18 */ u8 company[2];
/* 0x1A */ u8 freeArea[6];
} LEODiskID; // size = 0x20
// Not attempting to number this struct until required since it's scary
typedef struct LEOCmd {
/* 0x00 */ LEOCmdHeader header;
union {
struct {
/* 0x0C */ u32 lba;
/* 0x10 */ u32 transferBlks;
/* 0x14 */ void* buffPtr;
/* 0x18 */ u32 rwBytes;
#ifdef _LONGCMD
/* 0x1C */ u32 size;
#endif
} readWrite;
struct {
/* 0x0C */ u32 lba;
} seek;
struct {
/* 0x0C */ void* bufferPointer;
} readdiskid;
/* 0x0C */ LEODiskTime time;
struct {
/* 0x0C */ u8 reserve1;
/* 0x0D */ u8 reserve2;
/* 0x0E */ u8 standbyTime;
/* 0x0F */ u8 sleepTime;
/* 0x10 */ u32 reserve3;
} modeSelect;
} data;
} LEOCmd; // size = 0x1C
#define _nbytes readwrite.rwBytes
#define _result header.status
#endif // defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
#define LEO_SW_VERSION 6 // This will be returned by LeoInquiry command
#define OS_PRIORITY_LEOMGR OS_PRIORITY_PIMGR
#define DDROM_FONT_START 0x000A0000
#define DDROM_WAVEDATA_START 0x00140000
/*
* Definition for osLeoSpdlMotor()
*/
#define ACTIVE 0
#define STANDBY 1
#define SLEEP 2
#define BRAKE 4
#define LEO_MOTOR_ACTIVE 0
#define LEO_MOTOR_STANDBY 1
#define LEO_MOTOR_SLEEP 2
#define LEO_MOTOR_BRAKE 4
#define NUM_LBAS 4292
#define BLK_SIZE_ZONE0 19720
#define BLK_SIZE_ZONE1 18360
#define BLK_SIZE_ZONE2 17680
#define BLK_SIZE_ZONE3 16320
#define BLK_SIZE_ZONE4 14960
#define BLK_SIZE_ZONE5 13600
#define BLK_SIZE_ZONE6 12240
#define BLK_SIZE_ZONE7 10880
#define BLK_SIZE_ZONE8 9520
#define MAX_BLK_SIZE BLK_SIZE_ZONE0
#define MIN_BLK_SIZE BLK_SIZE_ZONE8
#define LEO_ERROR_GOOD 0
#define LEO_ERROR_DRIVE_NOT_READY 1
#define LEO_ERROR_DIAGNOSTIC_FAILURE 2
#define LEO_ERROR_COMMAND_PHASE_ERROR 3
#define LEO_ERROR_DATA_PHASE_ERROR 4
#define LEO_ERROR_REAL_TIME_CLOCK_FAILURE 5
#define LEO_ERROR_BUSY 8
#define LEO_ERROR_INCOMPATIBLE_MEDIUM_INSTALLED 11
#define LEO_ERROR_UNKNOWN_FORMAT 11
#define LEO_ERROR_NO_SEEK_COMPLETE 21
#define LEO_ERROR_WRITE_FAULT 22
#define LEO_ERROR_UNRECOVERED_READ_ERROR 23
#define LEO_ERROR_NO_REFERENCE_POSITION_FOUND 24
#define LEO_ERROR_TRACK_FOLLOWING_ERROR 25
#define LEO_ERROR_TRACKING_OR_SPDL_SERVO_FAILURE 25
#define LEO_ERROR_INVALID_COMMAND_OPERATION_CODE 31
#define LEO_ERROR_LBA_OUT_OF_RANGE 32
#define LEO_ERROR_WRITE_PROTECT_ERROR 33
#define LEO_ERROR_COMMAND_CLEARED_BY_HOST 34
#define LEO_ERROR_COMMAND_TERMINATED 34
#define LEO_ERROR_QUEUE_FULL 35
#define LEO_ERROR_ILLEGAL_TIMER_VALUE 36
#define LEO_ERROR_WAITING_NMI 37
#define LEO_ERROR_DEVICE_COMMUNICATION_FAILURE 41
#define LEO_ERROR_MEDIUM_NOT_PRESENT 42
#define LEO_ERROR_POWERONRESET_DEVICERESET_OCCURED 43
#define LEO_ERROR_RAMPACK_NOT_CONNECTED 44
#define LEO_ERROR_MEDIUM_MAY_HAVE_CHANGED 47
#define LEO_ERROR_EJECTED_ILLEGALLY_RESUME 49
#define LEO_ERROR_NOT_BOOTED_DISK 45
#define LEO_ERROR_DIDNOT_CHANGED_DISK_AS_EXPECTED 46
#define LEO_ERROR_RTC_NOT_SET_CORRECTLY 48
#define LEO_ERROR_DIAGNOSTIC_FAILURE_RESET 50
#define LEO_ERROR_EJECTED_ILLEGALLY_RESET 51
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
#define GET_ERROR(x) ((x).header.sense)
extern LEODiskID leoBootID;
extern OSPiHandle* __osDiskHandle; // For exceptasm to get disk info
// Initialize routine
s32 LeoCreateLeoManager(OSPri comPri, OSPri intPri, OSMesg* cmdBuf, s32 cmdMsgCnt);
s32 LeoCJCreateLeoManager(OSPri comPri, OSPri intPri, OSMesg* cmdBuf, s32 cmdMsgCnt);
s32 LeoCACreateLeoManager(OSPri comPri, OSPri intPri, OSMesg* cmdBuf, s32 cmdMsgCnt);
u32 LeoDriveExist(void);
// Synchronous functions
s32 LeoClearQueue(void);
s32 LeoByteToLBA(s32 startlba, u32 nbytes, s32* lba);
s32 LeoLBAToByte(s32 startlba, u32 nlbas, s32* bytes);
s32 LeoReadCapacity(LEOCapacity* cap, s32 dir);
s32 LeoInquiry(LEOVersion* ver);
s32 LeoTestUnitReady(LEOStatus* status);
// Asynchronous functions
s32 LeoSpdlMotor(LEOCmd* cmdBlock, LEOSpdlMode mode, OSMesgQueue* mq);
s32 LeoSeek(LEOCmd* cmdBlock, u32 lba, OSMesgQueue* mq);
s32 LeoRezero(LEOCmd* cmdBlock, OSMesgQueue* mq);
s32 LeoReadWrite(LEOCmd* cmdBlock, s32 direction, u32 LBA, void* vAddr, u32 nLBAs, OSMesgQueue* mq);
s32 LeoReadDiskID(LEOCmd* cmdBlock, LEODiskID* vaddr, OSMesgQueue* mq);
s32 LeoSetRTC(LEOCmd* cmdBlock, LEODiskTime* RTCdata, OSMesgQueue* mq);
s32 LeoReadRTC(LEOCmd* cmdBlock, OSMesgQueue* mq);
s32 LeoModeSelectAsync(LEOCmd* cmdBlock, u32 standby, u32 sleep, OSMesgQueue* mq);
// Font routines
int LeoGetKAdr(int sjis);
int LeoGetAAdr(int code, int* dx, int* dy, int* cy);
int LeoGetAAdr2(u32 ccode, int* dx, int* dy, int* cy);
// Boot function
void LeoBootGame(void* entry);
#endif // defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif
+198
View File
@@ -0,0 +1,198 @@
#ifndef ULTRA64_LEOAPPLI_H
#define ULTRA64_LEOAPPLI_H
#include "thread.h"
#include "message.h"
#define LEO_DISK_TYPE_MIN 0
#define LEO_DISK_TYPE_MAX 6
#define LEO_LBA_MIN 0
#define LEO_LBA_MAX 4291
#define LEO_LBA_ROM_TOP LEO_LBA_MIN
#define LEO_LBA_ROM_END0 1417
#define LEO_LBA_ROM_END1 1965
#define LEO_LBA_ROM_END2 2513
#define LEO_LBA_ROM_END3 3061
#define LEO_LBA_ROM_END4 3609
#define LEO_LBA_ROM_END5 4087
#define LEO_LBA_ROM_END6 LEO_LBA_MAX
#define LEO_LBA_RAM_TOP0 (LEO_LBA_ROM_END0+1)
#define LEO_LBA_RAM_TOP1 (LEO_LBA_ROM_END1+1)
#define LEO_LBA_RAM_TOP2 (LEO_LBA_ROM_END2+1)
#define LEO_LBA_RAM_TOP3 (LEO_LBA_ROM_END3+1)
#define LEO_LBA_RAM_TOP4 (LEO_LBA_ROM_END4+1)
#define LEO_LBA_RAM_TOP5 (LEO_LBA_ROM_END5+1)
#define LEO_LBA_RAM_TOP6 (LEO_LBA_ROM_END6+1)
#define LEO_LBA_RAM_END6 LEO_LBA_MAX
void leoInitialize(OSPri compri, OSPri intpri, OSMesg* command_que_buf, u32 cmd_buff_size);
void leoCommand(void* cmd_blk_addr);
void LeoReset(void);
s32 LeoResetClear(void);
#define LEO_PRIORITY_WRK (OS_PRIORITY_PIMGR-1)
#define LEO_PRIORITY_INT OS_PRIORITY_PIMGR
#define LEO_COMMAND_CLEAR_QUE 0x01
#define LEO_COMMAND_INQUIRY 0x02
#define LEO_COMMAND_TEST_UNIT_READY 0x03
#define LEO_COMMAND_REZERO 0x04
#define LEO_COMMAND_READ 0x05
#define LEO_COMMAND_WRITE 0x06
#define LEO_COMMAND_SEEK 0x07
#define LEO_COMMAND_START_STOP 0x08
#define LEO_COMMAND_READ_CAPACITY 0x09
#define LEO_COMMAND_TRANSLATE 0x0A
#define LEO_COMMAND_MODE_SELECT 0x0B
#define LEO_COMMAND_READ_DISK_ID 0x0C
#define LEO_COMMAND_READ_TIMER 0x0D
#define LEO_COMMAND_SET_TIMER 0x0E
// should be
// #define LEO_COMMAND_CLEAR_RESET 0x0F
#define LEO_CONTROL_POST 0x80 // ENABLE POST QUEUE
#define LEO_CONTROL_START 0x01 // START COMMAND
#define LEO_CONTROL_STBY 0x02 // STAND-BY MODE(NOT SLEEP MODE)
#define LEO_CONTROL_WRT 0x01 // READ RE-WRITE-ABLE CAPACITY
#define LEO_CONTROL_TBL 0x01 // TRANSLATE BYTE TO LBA
#define LEO_CONTROL_BRAKE 0x04 // SLEEP MODE(BRAKE ON)
#define LEO_TEST_UNIT_MR 0x01 // MEDIUM REMOVED
#define LEO_TEST_UNIT_RE 0x02 // HEAD RETRACTED
#define LEO_TEST_UNIT_SS 0x04 // SPINDLE STOPPED
#define LEO_STATUS_GOOD 0x00
#define LEO_STATUS_CHECK_CONDITION 0x02
#define LEO_STATUS_BUSY 0x08
#define LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION 00
#define LEO_SENSE_DRIVE_NOT_READY 01
#define LEO_SENSE_DIAGNOSTIC_FAILURE 02
#define LEO_SENSE_COMMAND_PHASE_ERROR 03
#define LEO_SENSE_DATA_PHASE_ERROR 04
#define LEO_SENSE_REAL_TIME_CLOCK_FAILURE 05
#define LEO_SENSE_INCOMPATIBLE_MEDIUM_INSTALLED 11
#define LEO_SENSE_UNKNOWN_FORMAT 11
#define LEO_SENSE_NO_SEEK_COMPLETE 21
#define LEO_SENSE_WRITE_FAULT 22
#define LEO_SENSE_UNRECOVERED_READ_ERROR 23
#define LEO_SENSE_NO_REFERENCE_POSITION_FOUND 24
#define LEO_SENSE_TRACK_FOLLOWING_ERROR 25
#define LEO_SENSE_TRACKING_OR_SPDL_SERVO_FAILURE 25
#define LEO_SENSE_INVALID_COMMAND_OPERATION_CODE 31
#define LEO_SENSE_LBA_OUT_OF_RANGE 32
#define LEO_SENSE_WRITE_PROTECT_ERROR 33
#define LEO_SENSE_COMMAND_TERMINATED 34
#define LEO_SENSE_QUEUE_FULL 35
#define LEO_SENSE_ILLEGAL_TIMER_VALUE 36
#define LEO_SENSE_WAITING_NMI 37
#define LEO_SENSE_DEVICE_COMMUNICATION_FAILURE 41
#define LEO_SENSE_MEDIUM_NOT_PRESENT 42
#define LEO_SENSE_POWERONRESET_DEVICERESET_OCCURED 43
#define LEO_SENSE_MEDIUM_MAY_HAVE_CHANGED 47
#define LEO_SENSE_EJECTED_ILLEGALLY_RESUME 49
typedef struct LEOCmdHeader {
/* 0x0 */ u8 command;
/* 0x1 */ u8 reserve1;
/* 0x2 */ u8 control;
/* 0x3 */ u8 reserve3;
/* 0x4 */ u8 status;
/* 0x5 */ u8 sense;
/* 0x6 */ u8 reserve6;
/* 0x7 */ u8 reserve7;
/* 0x8 */ OSMesgQueue* post;
} LEOCmdHeader; // 0xC
typedef struct LEOCmdClearQueue {
/* 0x0 */ LEOCmdHeader header;
} LEOCmdClearQueue; // 0xC
typedef struct LEOCmdInquiry {
/* 0x00 */ LEOCmdHeader header;
/* 0x0C */ u8 devType;
/* 0x0D */ u8 version;
/* 0x0E */ u8 devNum;
/* 0x0F */ u8 leoBiosVer;
/* 0x10 */ u32 reserve5;
} LEOCmdInquiry; // size = 0x14
typedef struct LEOCmdTestUnitReady {
/* 0x0 */ LEOCmdHeader header;
/* 0xC */ u8 test;
/* 0xD */ u8 reserve2;
/* 0xE */ u8 reserve3;
/* 0xF */ u8 reserve4;
} LEOCmdTestUnitReady; // size = 0x10
typedef struct LEOCmdRezero {
/* 0x0 */ LEOCmdHeader header;
} LEOCmdRezero; // size = 0xC
typedef struct LEOCmdRead {
/* 0x00 */ LEOCmdHeader header;
/* 0x0C */ u32 lba;
/* 0x10 */ u32 transferBlks;
/* 0x14 */ void* buffPtr;
/* 0x18 */ u32 rwBytes;
} LEOCmdRead; // size = 0x1C
typedef LEOCmdRead LEOCmdWrite;
typedef struct LEOCmdSeek {
/* 0x0 */ LEOCmdHeader header;
/* 0xC */ u32 lba;
} LEOCmdSeek; // size = 0x10
typedef struct LEOCmdStartStop {
/* 0x0 */ LEOCmdHeader header;
} LEOCmdStartStop; // size = 0xC
typedef struct LEOCmdReadCapacity {
/* 0x00 */ LEOCmdHeader header;
/* 0x0C */ u32 startLba;
/* 0x10 */ u32 endLba;
/* 0x14 */ u32 capaBytes;
} LEOCmdReadCapacity; // size = 0x18
typedef struct LEOCmdTranslate {
/* 0x00 */ LEOCmdHeader header;
/* 0x0C */ u32 startLba;
/* 0x10 */ u32 inParam;
/* 0x14 */ u32 outParam;
} LEOCmdTranslate; // size = 0x18
typedef struct LEOCmdModeSelect {
/* 0x00 */ LEOCmdHeader header;
/* 0x0C */ u8 pageCode;
/* 0x0D */ u8 reserve1;
/* 0x0E */ u8 standbyTime;
/* 0x0F */ u8 sleepTime;
/* 0x10 */ u8 ledOnTime;
/* 0x11 */ u8 ledOffTime;
/* 0x12 */ u8 reserve18;
/* 0x13 */ u8 reserve19;
} LEOCmdModeSelect; // size = 0x14
typedef struct LEOCmdReadDiskId {
/* 0x0 */ LEOCmdHeader header;
/* 0xC */ void* bufferPointer;
} LEOCmdReadDiskId; // size = 0x10
typedef struct LEOCmdReadTimer {
/* 0x00 */ LEOCmdHeader header;
/* 0x0C */ u8 reserve12;
/* 0x0D */ u8 reserve13;
/* 0x0E */ u8 year;
/* 0x0F */ u8 month;
/* 0x10 */ u8 day;
/* 0x11 */ u8 hour;
/* 0x12 */ u8 minute;
/* 0x13 */ u8 second;
} LEOCmdReadTimer; // size = 0x14
typedef LEOCmdReadTimer LEOCmdSetTimer;
#endif
+147
View File
@@ -1,7 +1,14 @@
#ifndef ULTRA64_LEODRIVE_H
#define ULTRA64_LEODRIVE_H
#include "leo.h"
#include "leoappli.h"
#include "message.h"
#include "pi.h"
#include "rcp.h"
#include "stack.h"
#include "thread.h"
#include "ultratypes.h"
#define ASIC_BASE PI_DOM2_ADDR1
@@ -44,4 +51,144 @@
// ASIC_STATUS read bits
#define LEO_STATUS_MECHANIC_INTR 0x02000000 // Mechanic Interrupt Raised
typedef union {
/* 0x0 */ u8 u8_data[4];
/* 0x0 */ u16 u16_data[2];
/* 0x0 */ u32 u32_data;
} data_trans_form; // size = 0x4
typedef struct {
/* 0x00 */ u8* pntr;
/* 0x04 */ u8* c2buff_e;
/* 0x08 */ u8 err_pos[4];
/* 0x0C */ u8 err_num;
/* 0x0D */ u8 bytes;
/* 0x0E */ u16 blkbytes;
} block_param_form; // size = 0x10
typedef struct {
/* 0x0 */ u16 lba;
/* 0x2 */ u16 cylinder;
/* 0x4 */ u16 blk_bytes;
/* 0x6 */ u8 sec_bytes;
/* 0x7 */ u8 head;
/* 0x8 */ u8 zone;
/* 0x9 */ u8 rdwr_blocks;
/* 0xA */ u8 start_block;
} tgt_param_form; // size = 0xC
typedef union {
/* 0x00 */ struct {
/* 0x00 */ u32 country;
/* 0x04 */ u8 fmt_type;
/* 0x05 */ u8 disk_type;
/* 0x06 */ u16 ipl_load_len;
/* 0x08 */ u8 defect_num[20];
/* 0x1C */ void* loadptr;
/* 0x20 */ u8 defect_data[192];
/* 0xE0 */ u16 rom_end_lba;
/* 0xE2 */ u16 ram_start_lba;
/* 0xE4 */ u16 ram_end_lba;
} param;
/* 0x00 */ u64 u64_data[29];
} leo_sys_form; // size = 0xE8
void leomain(void* arg);
void leointerrupt(void* arg);
OSPiHandle* osLeoDiskInit(void);
s32 __osLeoInterrupt(void);
void leoClr_queue(void);
void leoInquiry(void);
void leoTest_unit_rdy(void);
void leoRezero(void);
void leoRead(void);
void leoWrite(void);
void leoSeek(void);
void leoStart_stop(void);
void leoRd_capacity(void);
void leoTranslate();
void leoMode_sel(void);
void leoReadDiskId(void);
void leoReadTimer(void);
void leoSetTimer(void);
void leoClr_reset(void);
u16 leoLba_to_phys(u32 lba);
u16 leoLba_to_vzone(u32 lba);
u8 leoAnalize_asic_status(void);
u8 leoChk_asic_ready(u32 asic_cmd);
u8 leoChk_done_status(u32 asic_cmd);
u8 leoSend_asic_cmd_i(u32 asic_cmd, u32 asic_data);
u8 leoWait_mecha_cmd_done(u32 asic_cmd);
u8 leoSend_asic_cmd_w(u32 asic_cmd, u32 asic_data);
u8 leoSend_asic_cmd_w_nochkDiskChange(u32 asic_cmd, u32 asic_data);
u8 leoDetect_index_w(void);
u8 leoRecal_i(void);
u8 leoRecal_w(void);
u8 leoSeek_i(u16 rwmode);
u8 leoSeek_w(void);
u8 leoRecv_event_mesg(s32 control);
u32 leoChk_err_retry(u32 sense);
u8 leoChk_cur_drvmode(void);
void leoDrive_reset(void);
u32 leoChkUnit_atten(void);
u32 leoRetUnit_atten(void);
void leoClrUA_RESET(void);
void leoClrUA_MEDIUM_CHANGED(void);
void leoSetUA_MEDIUM_CHANGED(void);
void leoInitUnit_atten(void);
s32 __leoSetReset(void);
void leoRead_common(unsigned int offset);
int leoC2_Correction(void);
void leoSet_mseq(u16 rwmode);
extern leo_sys_form LEO_sys_data;
extern OSThread LEOcommandThread;
extern OSThread LEOinterruptThread;
extern STACK(LEOcommandThreadStack, 0x400);
extern STACK(LEOinterruptThreadStack, 0x400);
extern OSMesgQueue LEOcommand_que;
extern OSMesgQueue LEOevent_que;
extern OSMesgQueue LEOcontrol_que;
extern OSMesgQueue LEOdma_que;
extern OSMesgQueue LEOblock_que;
extern OSMesg LEOevent_que_buf[1];
extern OSMesg LEOcontrol_que_buf[1];
extern OSMesg LEOdma_que_buf[2];
extern OSMesg LEOblock_que_buf[1];
extern u8* LEOwrite_pointer;
extern LEOCmd* LEOcur_command;
extern u32 LEOasic_bm_ctl_shadow;
extern u32 LEOasic_seq_ctl_shadow;
extern u8 LEOdrive_flag;
extern vu8 LEOclr_que_flag;
// needs to not be volatile in some files
// extern vu16 LEOrw_flags;
extern u8 LEOdisk_type;
extern tgt_param_form LEOtgt_param;
extern u32 LEO_country_code;
extern const char LEOfirmware_rev[];
extern const u8 LEOBYTE_TBL1[];
extern const u16 LEOBYTE_TBL2[];
extern const u16 LEOVZONE_TBL[][0x10];
extern const u16 LEOZONE_SCYL_TBL[];
extern const u8 LEOVZONE_PZONEHD_TBL[][0x10];
extern const u16 LEOZONE_OUTERCYL_TBL[];
extern const u16 LEORAM_START_LBA[];
extern const s32 LEORAM_BYTE[];
extern s32 __leoActive;
extern LEOVersion __leoVersion;
extern STACK(leoDiskStack, 0xFF0);
extern OSPiHandle* LEOPiInfo;
#endif
-6
View File
@@ -92,12 +92,6 @@
#define THREAD_ID_DMAMGR 18
#define THREAD_ID_IRQMGR 19
#define STACK(stack, size) \
u64 stack[ALIGN8(size) / sizeof(u64)]
#define STACK_TOP(stack) \
((u8*)(stack) + sizeof(stack))
typedef struct KaleidoMgrOverlay {
/* 0x00 */ void* loadedRamAddr;
/* 0x04 */ RomFile file;