Merge branch 'mariopartyrd:main' into main
This commit is contained in:
commit
9de862779f
197 changed files with 31800 additions and 2022 deletions
1235
include/REL/m432data.h
Normal file
1235
include/REL/m432data.h
Normal file
File diff suppressed because it is too large
Load diff
79
include/__ppc_eabi_linker.h
Normal file
79
include/__ppc_eabi_linker.h
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
#ifndef __PPC_EABI_LINKER
|
||||
#define __PPC_EABI_LINKER
|
||||
|
||||
#ifdef __MWERKS__
|
||||
#define DECL_SECTION(name) __declspec(section name)
|
||||
#else
|
||||
#define DECL_SECTION(name)
|
||||
#endif
|
||||
|
||||
DECL_SECTION(".init") extern char _stack_addr[];
|
||||
DECL_SECTION(".init") extern char _stack_end[];
|
||||
DECL_SECTION(".init") extern char _heap_addr[];
|
||||
DECL_SECTION(".init") extern char _heap_end[];
|
||||
DECL_SECTION(".init") extern const char _fextabindex_rom[];
|
||||
DECL_SECTION(".init") extern char _fextabindex[];
|
||||
DECL_SECTION(".init") extern char _eextabindex[];
|
||||
|
||||
DECL_SECTION(".init") extern char _SDA_BASE_[];
|
||||
|
||||
DECL_SECTION(".init") extern char _SDA2_BASE_[];
|
||||
|
||||
typedef struct __rom_copy_info {
|
||||
char* rom;
|
||||
char* addr;
|
||||
unsigned int size;
|
||||
} __rom_copy_info;
|
||||
|
||||
DECL_SECTION(".init") extern __rom_copy_info _rom_copy_info[];
|
||||
|
||||
typedef struct __bss_init_info {
|
||||
char* addr;
|
||||
unsigned int size;
|
||||
} __bss_init_info;
|
||||
|
||||
DECL_SECTION(".init") extern __bss_init_info _bss_init_info[];
|
||||
|
||||
typedef struct __eti_init_info {
|
||||
void* eti_start;
|
||||
void* eti_end;
|
||||
void* code_start;
|
||||
unsigned long code_size;
|
||||
} __eti_init_info;
|
||||
|
||||
DECL_SECTION(".init") extern __eti_init_info _eti_init_info[];
|
||||
DECL_SECTION(".init") extern const char _f_init_rom[];
|
||||
DECL_SECTION(".init") extern char _f_init[];
|
||||
DECL_SECTION(".init") extern char _e_init[];
|
||||
DECL_SECTION(".init") extern const char _f_text_rom[];
|
||||
DECL_SECTION(".init") extern char _f_text[];
|
||||
DECL_SECTION(".init") extern char _e_text[];
|
||||
DECL_SECTION(".init") extern const char _f_rodata_rom[];
|
||||
DECL_SECTION(".init") extern char _f_rodata[];
|
||||
DECL_SECTION(".init") extern char _e_rodata[];
|
||||
DECL_SECTION(".init") extern const char _fextab_rom[];
|
||||
DECL_SECTION(".init") extern char _fextab[];
|
||||
DECL_SECTION(".init") extern char _eextab[];
|
||||
DECL_SECTION(".init") extern const char _f_data_rom[];
|
||||
DECL_SECTION(".init") extern char _f_data[];
|
||||
DECL_SECTION(".init") extern char _e_data[];
|
||||
DECL_SECTION(".init") extern char _f_bss[];
|
||||
DECL_SECTION(".init") extern char _e_bss[];
|
||||
DECL_SECTION(".init") extern const char _f_sdata_rom[];
|
||||
DECL_SECTION(".init") extern char _f_sdata[];
|
||||
DECL_SECTION(".init") extern char _e_sdata[];
|
||||
DECL_SECTION(".init") extern char _f_sbss[];
|
||||
DECL_SECTION(".init") extern char _e_sbss[];
|
||||
DECL_SECTION(".init") extern const char _f_sdata2_rom[];
|
||||
DECL_SECTION(".init") extern char _f_sdata2[];
|
||||
DECL_SECTION(".init") extern char _e_sdata2[];
|
||||
DECL_SECTION(".init") extern char _f_sbss2[];
|
||||
DECL_SECTION(".init") extern char _e_sbss2[];
|
||||
DECL_SECTION(".init") extern const char _f_PPC_EMB_sdata0_rom[];
|
||||
DECL_SECTION(".init") extern char _f_PPC_EMB_sdata0[];
|
||||
DECL_SECTION(".init") extern char _e_PPC_EMB_sdata0[];
|
||||
DECL_SECTION(".init") extern char _f_PPC_EMB_sbss0[];
|
||||
DECL_SECTION(".init") extern char _e_PPC_EMB_sbss0[];
|
||||
|
||||
|
||||
#endif // __PPC_EABI_LINKER
|
||||
84
include/asm_types.h
Normal file
84
include/asm_types.h
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
#ifndef _ASM_TYPES
|
||||
#define _ASM_TYPES
|
||||
|
||||
// Special Purpose Registers (SPRs)
|
||||
#define XER 1
|
||||
#define LR 8
|
||||
#define CTR 9
|
||||
#define DSISR 18
|
||||
#define DAR 19
|
||||
#define DEC 22
|
||||
#define SDR1 25
|
||||
#define SRR0 26
|
||||
#define SRR1 27
|
||||
#define SPRG0 272
|
||||
#define SPRG1 273
|
||||
#define SPRG2 274
|
||||
#define SPRG3 275
|
||||
#define EAR 282
|
||||
#define PVR 287
|
||||
#define IBAT0U 528
|
||||
#define IBAT0L 529
|
||||
#define IBAT1U 530
|
||||
#define IBAT1L 531
|
||||
#define IBAT2U 532
|
||||
#define IBAT2L 533
|
||||
#define IBAT3U 534
|
||||
#define IBAT3L 535
|
||||
#define DBAT0U 536
|
||||
#define DBAT0L 537
|
||||
#define DBAT1U 538
|
||||
#define DBAT1L 539
|
||||
#define DBAT2U 540
|
||||
#define DBAT2L 541
|
||||
#define DBAT3U 542
|
||||
#define DBAT3L 543
|
||||
#define GQR0 912
|
||||
#define GQR1 913
|
||||
#define GQR2 914
|
||||
#define GQR3 915
|
||||
#define GQR4 916
|
||||
#define GQR5 917
|
||||
#define GQR6 918
|
||||
#define GQR7 919
|
||||
#define HID2 920
|
||||
#define WPAR 921
|
||||
#define DMA_U 922
|
||||
#define DMA_L 923
|
||||
#define UMMCR0 936
|
||||
#define UPMC1 937
|
||||
#define UPMC2 938
|
||||
#define USIA 939
|
||||
#define UMMCR1 940
|
||||
#define UPMC3 941
|
||||
#define UPMC4 942
|
||||
#define USDA 943
|
||||
#define MMCR0 952
|
||||
#define PMC1 953
|
||||
#define PMC2 954
|
||||
#define SIA 955
|
||||
#define MMCR1 956
|
||||
#define PMC3 957
|
||||
#define PMC4 958
|
||||
#define SDA 959
|
||||
#define HID0 1008
|
||||
#define HID1 1009
|
||||
#define IABR 1010
|
||||
#define DABR 1013
|
||||
#define L2CR 1017
|
||||
#define ICTC 1019
|
||||
#define THRM1 1020
|
||||
#define THRM2 1021
|
||||
#define THRM3 1022
|
||||
|
||||
// Condition Registers (CRs)
|
||||
#define cr0 0
|
||||
#define cr1 1
|
||||
#define cr2 2
|
||||
#define cr3 3
|
||||
#define cr4 4
|
||||
#define cr5 5
|
||||
#define cr6 6
|
||||
#define cr7 7
|
||||
|
||||
#endif // _ASM_TYPES
|
||||
|
|
@ -21,103 +21,149 @@ extern "C" {
|
|||
#define CARD_MAX_MOUNT_STEP (CARD_NUM_SYSTEM_BLOCK + 2)
|
||||
|
||||
typedef struct CARDDir {
|
||||
u8 gameName[4];
|
||||
u8 company[2];
|
||||
u8 _padding0;
|
||||
u8 bannerFormat;
|
||||
u8 fileName[CARD_FILENAME_MAX];
|
||||
u32 time; // seconds since 01/01/2000 midnight
|
||||
u8 gameName[4];
|
||||
u8 company[2];
|
||||
u8 _padding0;
|
||||
u8 bannerFormat;
|
||||
u8 fileName[CARD_FILENAME_MAX];
|
||||
u32 time; // seconds since 01/01/2000 midnight
|
||||
|
||||
u32 iconAddr; // 0xffffffff if not used
|
||||
u16 iconFormat;
|
||||
u16 iconSpeed;
|
||||
u32 iconAddr; // 0xffffffff if not used
|
||||
u16 iconFormat;
|
||||
u16 iconSpeed;
|
||||
|
||||
u8 permission;
|
||||
u8 copyTimes;
|
||||
u16 startBlock;
|
||||
u16 length;
|
||||
u8 _padding1[2];
|
||||
u8 permission;
|
||||
u8 copyTimes;
|
||||
u16 startBlock;
|
||||
u16 length;
|
||||
u8 _padding1[2];
|
||||
|
||||
u32 commentAddr; // 0xffffffff if not used
|
||||
u32 commentAddr; // 0xffffffff if not used
|
||||
} CARDDir;
|
||||
|
||||
typedef struct CARDDirCheck {
|
||||
u8 padding0[64 - 2 * 4];
|
||||
u16 padding1;
|
||||
s16 checkCode;
|
||||
u16 checkSum;
|
||||
u16 checkSumInv;
|
||||
u8 padding0[64 - 2 * 4];
|
||||
u16 padding1;
|
||||
s16 checkCode;
|
||||
u16 checkSum;
|
||||
u16 checkSumInv;
|
||||
} CARDDirCheck;
|
||||
|
||||
typedef struct CARDControl {
|
||||
BOOL attached;
|
||||
s32 result;
|
||||
u16 size;
|
||||
u16 pageSize;
|
||||
s32 sectorSize;
|
||||
u16 cBlock;
|
||||
u16 vendorID;
|
||||
s32 latency;
|
||||
u8 id[12];
|
||||
int mountStep;
|
||||
int formatStep;
|
||||
u32 scramble;
|
||||
DSPTaskInfo task;
|
||||
void* workArea;
|
||||
CARDDir* currentDir;
|
||||
u16* currentFat;
|
||||
OSThreadQueue threadQueue;
|
||||
u8 cmd[9];
|
||||
s32 cmdlen;
|
||||
vu32 mode;
|
||||
int retry;
|
||||
int repeat;
|
||||
u32 addr;
|
||||
void* buffer;
|
||||
s32 xferred;
|
||||
u16 freeNo;
|
||||
u16 startBlock;
|
||||
CARDFileInfo* fileInfo;
|
||||
CARDCallback extCallback;
|
||||
CARDCallback txCallback;
|
||||
CARDCallback exiCallback;
|
||||
CARDCallback apiCallback;
|
||||
CARDCallback xferCallback;
|
||||
CARDCallback eraseCallback;
|
||||
CARDCallback unlockCallback;
|
||||
OSAlarm alarm;
|
||||
u32 cid;
|
||||
const DVDDiskID* diskID;
|
||||
BOOL attached;
|
||||
s32 result;
|
||||
u16 size;
|
||||
u16 pageSize;
|
||||
s32 sectorSize;
|
||||
u16 cBlock;
|
||||
u16 vendorID;
|
||||
s32 latency;
|
||||
u8 id[12];
|
||||
int mountStep;
|
||||
int formatStep;
|
||||
u32 scramble;
|
||||
DSPTaskInfo task;
|
||||
void *workArea;
|
||||
CARDDir *currentDir;
|
||||
u16 *currentFat;
|
||||
OSThreadQueue threadQueue;
|
||||
u8 cmd[9];
|
||||
s32 cmdlen;
|
||||
vu32 mode;
|
||||
int retry;
|
||||
int repeat;
|
||||
u32 addr;
|
||||
void *buffer;
|
||||
s32 xferred;
|
||||
u16 freeNo;
|
||||
u16 startBlock;
|
||||
CARDFileInfo *fileInfo;
|
||||
CARDCallback extCallback;
|
||||
CARDCallback txCallback;
|
||||
CARDCallback exiCallback;
|
||||
CARDCallback apiCallback;
|
||||
CARDCallback xferCallback;
|
||||
CARDCallback eraseCallback;
|
||||
CARDCallback unlockCallback;
|
||||
OSAlarm alarm;
|
||||
u32 cid;
|
||||
const DVDDiskID *diskID;
|
||||
} CARDControl;
|
||||
|
||||
typedef struct CARDID {
|
||||
u8 serial[32]; // flashID[12] + timebase[8] + counterBias[4] + language[4] + XXX[4]
|
||||
u16 deviceID;
|
||||
u16 size;
|
||||
u16 encode; // character set -- 0: S-JIS, 1: ANSI
|
||||
u8 serial[32]; // flashID[12] + timebase[8] + counterBias[4] + language[4] + XXX[4]
|
||||
u16 deviceID;
|
||||
u16 size;
|
||||
u16 encode; // character set -- 0: S-JIS, 1: ANSI
|
||||
|
||||
u8 padding[512 - 32 - 5 * 2];
|
||||
u8 padding[512 - 32 - 5 * 2];
|
||||
|
||||
u16 checkSum;
|
||||
u16 checkSumInv;
|
||||
u16 checkSum;
|
||||
u16 checkSumInv;
|
||||
} CARDID;
|
||||
|
||||
void __CARDDefaultApiCallback(s32 chan, s32 result);
|
||||
s32 __CARDEraseSector(s32 chan, u32 addr, CARDCallback callback);
|
||||
s32 __CARDPutControlBlock(struct CARDControl *card, s32 result);
|
||||
void __CARDSyncCallback(s32 chan, s32 result);
|
||||
u16 *__CARDGetFatBlock(CARDControl *card);
|
||||
|
||||
#define CARDIsValidBlockNo(card, iBlock) \
|
||||
(CARD_NUM_SYSTEM_BLOCK <= (iBlock) && (iBlock) < (card)->cBlock)
|
||||
#define __CARDGetDirCheck(dir) ((CARDDirCheck*)&(dir)[CARD_MAX_FILE])
|
||||
/* CARDBios */
|
||||
void __CARDExtHandler(s32 chan, OSContext *context);
|
||||
void __CARDExiHandler(s32 chan, OSContext *context);
|
||||
void __CARDTxHandler(s32 chan, OSContext *context);
|
||||
void __CARDUnlockedHandler(s32 chan, OSContext *context);
|
||||
s32 __CARDEnableInterrupt(s32 chan, BOOL enable);
|
||||
s32 __CARDReadStatus(s32 chan, u8 *status);
|
||||
s32 __CARDReadVendorID(s32 chan, u16 *vendorId);
|
||||
s32 __CARDClearStatus(s32 chan);
|
||||
s32 __CARDStart(s32 chan, CARDCallback txCallback, CARDCallback exiCallback);
|
||||
s32 __CARDReadSegment(s32 chan, CARDCallback callback);
|
||||
s32 __CARDWritePage(s32 chan, CARDCallback callback);
|
||||
u16 __CARDGetFontEncode(void);
|
||||
void __CARDSetDiskID(const DVDDiskID *id);
|
||||
s32 __CARDGetControlBlock(s32 chan, struct CARDControl **pcard);
|
||||
s32 __CARDSync(s32 chan);
|
||||
|
||||
CARDDir* __CARDGetDirBlock(CARDControl* card);
|
||||
u16* __CARDGetFatBlock(CARDControl* card);
|
||||
s32 __CARDUpdateFatBlock(s32 chan, u16* fat, CARDCallback callback);
|
||||
void __CARDCheckSum(void* ptr, int length, u16* checkSum, u16* checkSumInv);
|
||||
u16 __CARDGetFontEncode();
|
||||
void __CARDExiHandler(s32 chan, OSContext* context);
|
||||
void __CARDExtHandler(s32 chan, OSContext* context);
|
||||
void __CARDUnlockedHandler(s32 chan, OSContext* context);
|
||||
s32 __CARDAccess(CARDControl* card, CARDDir* ent);
|
||||
BOOL __CARDIsWritable(CARDDir* ent);
|
||||
/* CARDBlock */
|
||||
s32 __CARDAllocBlock(s32 chan, u32 cBlock, CARDCallback callback);
|
||||
s32 __CARDFreeBlock(s32 chan, u16 nBlock, CARDCallback callback);
|
||||
s32 __CARDUpdateFatBlock(s32 chan, u16 *fat, CARDCallback callback);
|
||||
|
||||
/* CARDCheck */
|
||||
void __CARDCheckSum(void *ptr, int length, u16 *checksum, u16 *checksumInv);
|
||||
s32 __CARDVerify(CARDControl *card);
|
||||
|
||||
/* CARDDir */
|
||||
CARDDir *__CARDGetDirBlock(CARDControl *card);
|
||||
s32 __CARDUpdateDir(s32 chan, CARDCallback callback);
|
||||
|
||||
/* CARDFormat */
|
||||
s32 __CARDFormatRegionAsync(s32 chan, u16 encode, CARDCallback callback);
|
||||
|
||||
/* CARDMount */
|
||||
void __CARDMountCallback(s32 chan, s32 result);
|
||||
|
||||
/* CARDOpen */
|
||||
BOOL __CARDCompareFileName(CARDDir *ent, const char *fileName);
|
||||
s32 __CARDAccess(CARDControl *card, CARDDir *ent);
|
||||
BOOL __CARDIsPublic(CARDDir *ent);
|
||||
s32 __CARDIsReadable(CARDControl *card, CARDDir *ent);
|
||||
s32 __CARDGetFileNo(CARDControl *card, const char *fileName, s32 *pfileNo);
|
||||
BOOL __CARDIsOpened(CARDControl *card, s32 fileNo);
|
||||
|
||||
/* CARDRdwr */
|
||||
s32 __CARDRead(s32 chan, u32 addr, s32 length, void *dst, CARDCallback callback);
|
||||
s32 __CARDWrite(s32 chan, u32 addr, s32 length, void *dst, CARDCallback callback);
|
||||
|
||||
/* CARDRead */
|
||||
s32 __CARDSeek(CARDFileInfo *fileInfo, s32 length, s32 offset, CARDControl **pcard);
|
||||
|
||||
/* CARDUnlock */
|
||||
s32 __CARDUnlock(s32 chan, u8 flashID[12]);
|
||||
|
||||
#define CARDIsValidBlockNo(card, iBlock) (CARD_NUM_SYSTEM_BLOCK <= (iBlock) && (iBlock) < (card)->cBlock)
|
||||
#define __CARDGetDirCheck(dir) ((CARDDirCheck *)&(dir)[CARD_MAX_FILE])
|
||||
|
||||
#define TRUNC(n, a) (((u32)(n)) & ~((a)-1))
|
||||
#define OFFSET(n, a) (((u32)(n)) & ((a)-1))
|
||||
|
|
|
|||
|
|
@ -4,30 +4,33 @@
|
|||
#include <types.h>
|
||||
|
||||
typedef struct OSSram {
|
||||
u16 checkSum;
|
||||
u16 checkSumInv;
|
||||
u32 ead0;
|
||||
u32 ead1;
|
||||
u32 counterBias;
|
||||
s8 displayOffsetH;
|
||||
u8 ntd;
|
||||
u8 language;
|
||||
u8 flags;
|
||||
u16 checkSum;
|
||||
u16 checkSumInv;
|
||||
u32 ead0;
|
||||
u32 ead1;
|
||||
u32 counterBias;
|
||||
s8 displayOffsetH;
|
||||
u8 ntd;
|
||||
u8 language;
|
||||
u8 flags;
|
||||
} OSSram;
|
||||
|
||||
typedef struct OSSramEx {
|
||||
u8 flashID[2][12];
|
||||
u32 wirelessKeyboardID;
|
||||
u16 wirelessPadID[4];
|
||||
u8 dvdErrorCode;
|
||||
u8 _padding0;
|
||||
u8 flashIDCheckSum[2];
|
||||
u16 gbs;
|
||||
u8 _padding1[2];
|
||||
u8 flashID[2][12];
|
||||
u32 wirelessKeyboardID;
|
||||
u16 wirelessPadID[4];
|
||||
u8 dvdErrorCode;
|
||||
u8 _padding0;
|
||||
u8 flashIDCheckSum[2];
|
||||
u16 gbs;
|
||||
u8 _padding1[2];
|
||||
} OSSramEx;
|
||||
|
||||
OSSram* __OSLockSram();
|
||||
OSSramEx* __OSLockSramEx();
|
||||
void __OSInitSram();
|
||||
OSSram *__OSLockSram();
|
||||
BOOL __OSSyncSram();
|
||||
BOOL __OSUnlockSram(BOOL commit);
|
||||
OSSramEx *__OSLockSramEx();
|
||||
void OSSetWirelessID(s32 chan, u16 id);
|
||||
u16 OSGetWirelessID(s32 chan);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,12 @@ extern "C" {
|
|||
typedef void (*AISCallback)(u32 count);
|
||||
typedef void (*AIDCallback)();
|
||||
|
||||
#define AI_STREAM_START 1
|
||||
#define AI_STREAM_STOP 0
|
||||
|
||||
#define AI_SAMPLERATE_32KHZ 0
|
||||
#define AI_SAMPLERATE_48KHZ 1
|
||||
|
||||
AIDCallback AIRegisterDMACallback(AIDCallback callback);
|
||||
void AIInitDMA(u32 start_addr, u32 length);
|
||||
BOOL AIGetDMAEnableFlag();
|
||||
|
|
|
|||
72
include/dolphin/demo.h
Normal file
72
include/dolphin/demo.h
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
#ifndef _DOLPHIN_DEMO
|
||||
#define _DOLPHIN_DEMO
|
||||
|
||||
#include <dolphin/pad.h>
|
||||
#include <dolphin/gx.h>
|
||||
|
||||
struct STRUCT_MENU_ITEM {
|
||||
/* 0x00 */ char * name;
|
||||
/* 0x04 */ unsigned long flags;
|
||||
/* 0x08 */ void (* function)(struct STRUCT_MENU *, unsigned long, unsigned long *);
|
||||
/* 0x0C */ struct STRUCT_MENU * link;
|
||||
};
|
||||
|
||||
struct STRUCT_MENU {
|
||||
/* 0x00 */ char * title;
|
||||
/* 0x04 */ struct STRUCT_DEMOWIN * handle;
|
||||
/* 0x08 */ struct STRUCT_MENU_ITEM * items;
|
||||
/* 0x0C */ long max_display_items;
|
||||
/* 0x10 */ unsigned long flags;
|
||||
/* 0x14 */ void (* cb_open)(struct STRUCT_MENU *, unsigned long);
|
||||
/* 0x18 */ void (* cb_move)(struct STRUCT_MENU *, unsigned long);
|
||||
/* 0x1C */ void (* cb_select)(struct STRUCT_MENU *, unsigned long);
|
||||
/* 0x20 */ void (* cb_cancel)(struct STRUCT_MENU *, unsigned long);
|
||||
/* 0x24 */ long num_display_items;
|
||||
/* 0x28 */ long num_items;
|
||||
/* 0x2C */ unsigned long max_str_len;
|
||||
/* 0x30 */ long curr_pos;
|
||||
/* 0x34 */ long display_pos;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ struct PADStatus pads[4];
|
||||
/* 0x30 */ unsigned long button[4];
|
||||
/* 0x40 */ unsigned long old_button[4];
|
||||
/* 0x50 */ unsigned long changed_button[4];
|
||||
/* 0x60 */ unsigned long repeat_button[4];
|
||||
/* 0x70 */ unsigned long repeat_ctr[4];
|
||||
} DEMOWinPadInfo;
|
||||
|
||||
struct STRUCT_LISTBOX_ITEM {
|
||||
/* 0x00 */ char * name; // offset 0x0, size 0x4
|
||||
/* 0x04 */ unsigned long flags; // offset 0x4, size 0x4
|
||||
};
|
||||
|
||||
struct STRUCT_LISTBOX {
|
||||
/* 0x00 */ char * title; // offset 0x0, size 0x4
|
||||
/* 0x04 */ struct STRUCT_DEMOWIN * handle; // offset 0x4, size 0x4
|
||||
/* 0x08 */ struct STRUCT_LISTBOX_ITEM * items; // offset 0x8, size 0x4
|
||||
/* 0x0C */ long max_display_items; // offset 0xC, size 0x4
|
||||
/* 0x10 */ unsigned long flags; // offset 0x10, size 0x4
|
||||
/* 0x14 */ long num_display_items; // offset 0x14, size 0x4
|
||||
/* 0x18 */ long num_items; // offset 0x18, size 0x4
|
||||
/* 0x1C */ unsigned long max_str_len; // offset 0x1C, size 0x4
|
||||
/* 0x20 */ long curr_pos; // offset 0x20, size 0x4
|
||||
/* 0x24 */ long display_pos; // offset 0x24, size 0x4
|
||||
/* 0x28 */ int cursor_state; // offset 0x28, size 0x4
|
||||
};
|
||||
|
||||
extern unsigned long DEMOFontBitmap[768];
|
||||
|
||||
#include <dolphin/demo/DEMOInit.h>
|
||||
#include <dolphin/demo/DEMOPad.h>
|
||||
#include <dolphin/demo/DEMOPuts.h>
|
||||
#include <dolphin/demo/DEMOStats.h>
|
||||
#include <dolphin/demo/DEMOWin.h>
|
||||
|
||||
// unsorted externs
|
||||
extern void DEMOPrintf(s16 x, s16 y, s16 priority, char *str, ...);
|
||||
|
||||
extern struct _GXRenderModeObj *DEMOGetRenderModeObj();
|
||||
|
||||
#endif
|
||||
21
include/dolphin/demo/DEMOInit.h
Normal file
21
include/dolphin/demo/DEMOInit.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef _DOLPHIN_DEMOINIT
|
||||
#define _DOLPHIN_DEMOINIT
|
||||
|
||||
#include <dolphin/gx.h>
|
||||
|
||||
extern void *DemoFrameBuffer1;
|
||||
extern void *DemoFrameBuffer2;
|
||||
extern void *DemoCurrentBuffer;
|
||||
|
||||
void DEMOInit(struct _GXRenderModeObj *mode);
|
||||
void DEMOBeforeRender();
|
||||
void DEMODoneRender();
|
||||
void DEMOSwapBuffers();
|
||||
void DEMOSetTevColorIn(enum _GXTevStageID stage, enum _GXTevColorArg a, enum _GXTevColorArg b, enum _GXTevColorArg c, enum _GXTevColorArg d);
|
||||
void DEMOSetTevOp(enum _GXTevStageID id, enum _GXTevMode mode);
|
||||
struct _GXRenderModeObj *DEMOGetRenderModeObj();
|
||||
u32 DEMOGetCurrentBuffer(void);
|
||||
void DEMOEnableBypassWorkaround(unsigned long timeoutFrames);
|
||||
void DEMOReInit(struct _GXRenderModeObj *mode);
|
||||
|
||||
#endif
|
||||
26
include/dolphin/demo/DEMOPad.h
Normal file
26
include/dolphin/demo/DEMOPad.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef _DOLPHIN_DEMOPAD
|
||||
#define _DOLPHIN_DEMOPAD
|
||||
|
||||
#include <dolphin/pad.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ struct PADStatus pst;
|
||||
/* 0x0C */ u16 buttonDown;
|
||||
/* 0x0E */ u16 buttonUp;
|
||||
/* 0x10 */ u16 dirs;
|
||||
/* 0x12 */ u16 dirsNew;
|
||||
/* 0x14 */ u16 dirsReleased;
|
||||
/* 0x16 */ s16 stickDeltaX;
|
||||
/* 0x18 */ s16 stickDeltaY;
|
||||
/* 0x1A */ s16 substickDeltaX;
|
||||
/* 0x1C */ s16 substickDeltaY;
|
||||
} DEMODMPad;
|
||||
|
||||
extern DEMODMPad DemoPad[4];
|
||||
|
||||
extern u32 DemoNumValidPads;
|
||||
|
||||
void DEMOPadRead();
|
||||
void DEMOPadInit();
|
||||
|
||||
#endif
|
||||
27
include/dolphin/demo/DEMOPuts.h
Normal file
27
include/dolphin/demo/DEMOPuts.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef _DOLPHIN_DEMOPUTS
|
||||
#define _DOLPHIN_DEMOPUTS
|
||||
|
||||
#include <dolphin/gx.h>
|
||||
|
||||
typedef enum {
|
||||
DMTF_POINTSAMPLE,
|
||||
DMTF_BILERP,
|
||||
} DMTexFlt;
|
||||
|
||||
typedef enum { DM_FT_OPQ, DM_FT_RVS, DM_FT_XLU } DMFontType;
|
||||
|
||||
void DEMOSetFontType(DMFontType attr);
|
||||
void DEMOLoadFont(enum _GXTexMapID texMap, enum _GXTexMtx texMtx, DMTexFlt texFlt);
|
||||
void DEMOSetupScrnSpc(long width, long height, float depth);
|
||||
void DEMOInitCaption(long font_type, long width, long height);
|
||||
void DEMOPuts(s16 x, s16 y, s16 z, char *string);
|
||||
void DEMOPrintf(s16 x, s16 y, s16 z, char *fmt, ...);
|
||||
struct OSFontHeader *DEMOInitROMFont();
|
||||
void DEMOSetROMFontSize(s16 size, s16 space);
|
||||
int DEMORFPuts(s16 x, s16 y, s16 z, char *string);
|
||||
int DEMORFPutsEx(s16 x, s16 y, s16 z, char *string, s16 maxWidth, int length);
|
||||
int DEMORFPrintf(s16 x, s16 y, s16 z, char *fmt, ...);
|
||||
char *DEMODumpROMFont(char *string);
|
||||
int DEMOGetRFTextWidth(char *string);
|
||||
|
||||
#endif
|
||||
38
include/dolphin/demo/DEMOStats.h
Normal file
38
include/dolphin/demo/DEMOStats.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#ifndef _DOLPHIN_DEMOSTATS
|
||||
#define _DOLPHIN_DEMOSTATS
|
||||
|
||||
typedef enum DEMO_STAT_TYPE {
|
||||
DEMO_STAT_GP0 = 0,
|
||||
DEMO_STAT_GP1 = 1,
|
||||
DEMO_STAT_MEM = 2,
|
||||
DEMO_STAT_PIX = 3,
|
||||
DEMO_STAT_VC = 4,
|
||||
DEMO_STAT_FR = 5,
|
||||
DEMO_STAT_TBW = 6,
|
||||
DEMO_STAT_TBP = 7,
|
||||
DEMO_STAT_MYC = 8,
|
||||
DEMO_STAT_MYR = 9,
|
||||
} DEMO_STAT_TYPE;
|
||||
|
||||
typedef struct DemoStatData {
|
||||
char text[50];
|
||||
DEMO_STAT_TYPE stat_type;
|
||||
unsigned long stat;
|
||||
unsigned long count;
|
||||
} DemoStatData;
|
||||
|
||||
typedef enum {
|
||||
DEMO_STAT_TL = 0,
|
||||
DEMO_STAT_BL = 1,
|
||||
DEMO_STAT_TLD = 2,
|
||||
DEMO_STAT_BLD = 3,
|
||||
DEMO_STAT_IO = 4,
|
||||
} DEMO_STAT_DISP;
|
||||
|
||||
extern unsigned char DemoStatEnable;
|
||||
|
||||
void DEMOSetStats(DemoStatData * stat, unsigned long nstats, DEMO_STAT_DISP disp);
|
||||
void DEMOUpdateStats(unsigned char inc);
|
||||
void DEMOPrintStats(void);
|
||||
|
||||
#endif
|
||||
77
include/dolphin/demo/DEMOWin.h
Normal file
77
include/dolphin/demo/DEMOWin.h
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
#ifndef _DOLPHIN_DEMOWIN
|
||||
#define _DOLPHIN_DEMOWIN
|
||||
|
||||
#include <dolphin/demo.h>
|
||||
#include <dolphin/gx.h>
|
||||
|
||||
enum DEMOWinItem {
|
||||
DEMOWIN_ITEM_CAP,
|
||||
DEMOWIN_ITEM_BKGND,
|
||||
DEMOWIN_ITEM_BORDER,
|
||||
DEMOWIN_ITEM_DEFAULT
|
||||
};
|
||||
|
||||
// flags
|
||||
#define DEMOWIN_FLAGS_INIT (1 << 0)
|
||||
#define DEMOWIN_FLAGS_OPENED (1 << 1)
|
||||
|
||||
struct STRUCT_DEMOWIN {
|
||||
/* 0x00 */ long x1;
|
||||
/* 0x04 */ long y1;
|
||||
/* 0x08 */ long x2;
|
||||
/* 0x0C */ long y2;
|
||||
/* 0x10 */ unsigned long priority;
|
||||
/* 0x14 */ unsigned long flags;
|
||||
/* 0x18 */ unsigned short x_cal;
|
||||
/* 0x1A */ unsigned short y_cal;
|
||||
/* 0x1C */ unsigned short pixel_width;
|
||||
/* 0x1E */ unsigned short pixel_height;
|
||||
/* 0x20 */ unsigned short char_width;
|
||||
/* 0x22 */ unsigned short char_height;
|
||||
/* 0x24 */ unsigned short num_scroll_lines;
|
||||
/* 0x26 */ unsigned short total_lines;
|
||||
/* 0x28 */ unsigned short curr_output_line;
|
||||
/* 0x2A */ unsigned short curr_output_col;
|
||||
/* 0x2C */ unsigned short curr_view_line;
|
||||
/* 0x2E */ signed short cursor_line;
|
||||
/* 0x30 */ char * caption;
|
||||
/* 0x34 */ unsigned char * buffer;
|
||||
/* 0x38 */ GXColor bkgnd;
|
||||
/* 0x3C */ GXColor cap;
|
||||
/* 0x40 */ GXColor border;
|
||||
/* 0x44 */ void (* refresh)(struct STRUCT_DEMOWIN *);
|
||||
/* 0x48 */ struct STRUCT_DEMOWIN * next;
|
||||
/* 0x4C */ struct STRUCT_DEMOWIN * prev;
|
||||
/* 0x50 */ void * parent;
|
||||
};
|
||||
|
||||
// functions
|
||||
void DEMOWinInit();
|
||||
struct STRUCT_DEMOWIN * DEMOWinCreateWindow(s32 x1, s32 y1, s32 x2, s32 y2, char * caption, u16 scroll, void * func);
|
||||
void DEMOWinDestroyWindow(struct STRUCT_DEMOWIN * handle);
|
||||
void DEMOWinOpenWindow(struct STRUCT_DEMOWIN * handle);
|
||||
void DEMOWinCloseWindow(struct STRUCT_DEMOWIN * handle);
|
||||
void DEMOWinSetWindowColor(struct STRUCT_DEMOWIN * handle, enum DEMOWinItem item, u8 r, u8 g, u8 b, u8 a);
|
||||
void DEMOWinLogPrintf(struct STRUCT_DEMOWIN * handle, char * fmt, ...);
|
||||
void DEMOWinPrintfXY(struct STRUCT_DEMOWIN * handle, u16 col, u16 row, char * fmt, ...);
|
||||
void DEMOWinScrollWindow(struct STRUCT_DEMOWIN * handle, u32 dir);
|
||||
void DEMOWinBringToFront(struct STRUCT_DEMOWIN * handle);
|
||||
void DEMOWinSendToBack(struct STRUCT_DEMOWIN * handle);
|
||||
void DEMOWinClearRow(struct STRUCT_DEMOWIN * handle, u16 row);
|
||||
void DEMOWinClearWindow(struct STRUCT_DEMOWIN * handle);
|
||||
void DEMOWinClearBuffer(struct STRUCT_DEMOWIN * handle);
|
||||
void DEMOWinRefresh();
|
||||
struct STRUCT_MENU * DEMOWinCreateMenuWindow(struct STRUCT_MENU * menu, u16 x, u16 y);
|
||||
void DEMOWinDestroyMenuWindow(struct STRUCT_MENU * menu);
|
||||
u32 DEMOWinMenuChild(struct STRUCT_MENU * menu, int child_flag);
|
||||
void DEMOWinPadInit(DEMOWinPadInfo *p);
|
||||
void DEMOWinPadRead(DEMOWinPadInfo *p);
|
||||
void DEMOWinSetRepeat(unsigned long threshold, unsigned long rate);
|
||||
void DEMOWinResetRepeat();
|
||||
struct STRUCT_LISTBOX * DEMOWinCreateListWindow(struct STRUCT_LISTBOX * list, unsigned short x, unsigned short y);
|
||||
void DEMOWinDestroyListWindow(struct STRUCT_LISTBOX * list);
|
||||
void DEMOWinListSetCursor(struct STRUCT_LISTBOX * list, int x);
|
||||
long DEMOWinListScrollList(struct STRUCT_LISTBOX * list, unsigned long dir);
|
||||
long DEMOWinListMoveCursor(struct STRUCT_LISTBOX * list, unsigned long dir);
|
||||
|
||||
#endif
|
||||
11
include/dolphin/demoPriv.h
Normal file
11
include/dolphin/demoPriv.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef _DOLPHIN_DEMOPRIV
|
||||
#define _DOLPHIN_DEMOPRIV
|
||||
|
||||
#include <dolphin/demo.h>
|
||||
|
||||
extern struct STRUCT_DEMOWIN * __first_node;
|
||||
extern struct STRUCT_DEMOWIN * __last_node;
|
||||
extern struct STRUCT_DEMOWIN * __curr_node;
|
||||
extern struct _GXRenderModeObj * __rmp;
|
||||
|
||||
#endif
|
||||
|
|
@ -59,6 +59,7 @@ DSPTaskInfo* DSPAddTask(DSPTaskInfo* task);
|
|||
|
||||
void __DSP_exec_task(DSPTaskInfo* curr, DSPTaskInfo* next);
|
||||
void __DSP_boot_task(DSPTaskInfo* task);
|
||||
void __DSP_insert_task(DSPTaskInfo* task);
|
||||
void __DSP_remove_task(DSPTaskInfo* task);
|
||||
void __DSP_add_task(DSPTaskInfo* task);
|
||||
void __DSP_debug_printf(const char* fmt, ...);
|
||||
|
|
|
|||
27
include/dolphin/exi.h
Normal file
27
include/dolphin/exi.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef _DOLPHIN_EXI
|
||||
#define _DOLPHIN_EXI
|
||||
|
||||
#include <dolphin/os/OSContext.h>
|
||||
|
||||
typedef void (*EXICallback)(s32 chan, OSContext *context);
|
||||
|
||||
EXICallback EXISetExiCallback(s32 channel, EXICallback callback);
|
||||
|
||||
void EXIInit(void);
|
||||
BOOL EXILock(s32 channel, u32 device, EXICallback callback);
|
||||
BOOL EXIUnlock(s32 channel);
|
||||
BOOL EXISelect(s32 channel, u32 device, u32 frequency);
|
||||
BOOL EXIDeselect(s32 channel);
|
||||
BOOL EXIImm(s32 channel, void *buffer, s32 length, u32 type, EXICallback callback);
|
||||
BOOL EXIImmEx(s32 channel, void *buffer, s32 length, u32 type);
|
||||
BOOL EXIDma(s32 channel, void *buffer, s32 length, u32 type, EXICallback callback);
|
||||
BOOL EXISync(s32 channel);
|
||||
BOOL EXIProbe(s32 channel);
|
||||
s32 EXIProbeEx(s32 channel);
|
||||
BOOL EXIAttach(s32 channel, EXICallback callback);
|
||||
BOOL EXIDetach(s32 channel);
|
||||
u32 EXIGetState(s32 channel);
|
||||
s32 EXIGetID(s32 channel, u32 device, u32 *id);
|
||||
void EXIProbeReset(void);
|
||||
|
||||
#endif
|
||||
|
|
@ -23,26 +23,26 @@ extern "C" {
|
|||
#endif
|
||||
typedef s64 OSTime;
|
||||
typedef u32 OSTick;
|
||||
u32 __OSBusClock AT_ADDRESS(OS_BASE_CACHED | 0x00F8); // sync with OSLoMem.h
|
||||
u32 __OSBusClock AT_ADDRESS(OS_BASE_CACHED | 0x00F8); // sync with OSLoMem.h
|
||||
u32 __OSCoreClock AT_ADDRESS(OS_BASE_CACHED | 0x00FC); // sync with OSLoMem.h
|
||||
#define OS_BUS_CLOCK (u32)__OSBusClock
|
||||
#define OS_BUS_CLOCK (u32) __OSBusClock
|
||||
#define OS_CORE_CLOCK __OSCoreClock
|
||||
#define OS_TIMER_CLOCK (OS_BUS_CLOCK / 4)
|
||||
|
||||
#ifndef _DEBUG
|
||||
#define OSPhysicalToCached(paddr) ((void*)((u32)(paddr) + OS_BASE_CACHED))
|
||||
#define OSPhysicalToUncached(paddr) ((void*)((u32)(paddr) + OS_BASE_UNCACHED))
|
||||
#define OSCachedToPhysical(caddr) ((u32)((u8*)(caddr)-OS_BASE_CACHED))
|
||||
#define OSUncachedToPhysical(ucaddr) ((u32)((u8*)(ucaddr)-OS_BASE_UNCACHED))
|
||||
#define OSCachedToUncached(caddr) ((void*)((u8*)(caddr) + (OS_BASE_UNCACHED - OS_BASE_CACHED)))
|
||||
#define OSUncachedToCached(ucaddr) ((void*)((u8*)(ucaddr) - (OS_BASE_UNCACHED - OS_BASE_CACHED)))
|
||||
#define OSPhysicalToCached(paddr) ((void *)((u32)(paddr) + OS_BASE_CACHED))
|
||||
#define OSPhysicalToUncached(paddr) ((void *)((u32)(paddr) + OS_BASE_UNCACHED))
|
||||
#define OSCachedToPhysical(caddr) ((u32)((u8 *)(caddr)-OS_BASE_CACHED))
|
||||
#define OSUncachedToPhysical(ucaddr) ((u32)((u8 *)(ucaddr)-OS_BASE_UNCACHED))
|
||||
#define OSCachedToUncached(caddr) ((void *)((u8 *)(caddr) + (OS_BASE_UNCACHED - OS_BASE_CACHED)))
|
||||
#define OSUncachedToCached(ucaddr) ((void *)((u8 *)(ucaddr) - (OS_BASE_UNCACHED - OS_BASE_CACHED)))
|
||||
#else
|
||||
u32 OSPhysicalToCached(void* paddr);
|
||||
u32 OSPhysicalToUncached(void* paddr);
|
||||
u32 OSCachedToPhysical(void* caddr);
|
||||
u32 OSUncachedToPhysical(void* ucaddr);
|
||||
u32 OSCachedToUncached(void* caddr);
|
||||
u32 OSUncachedToCached(void* ucaddr);
|
||||
u32 OSPhysicalToCached(void *paddr);
|
||||
u32 OSPhysicalToUncached(void *paddr);
|
||||
u32 OSCachedToPhysical(void *caddr);
|
||||
u32 OSUncachedToPhysical(void *ucaddr);
|
||||
u32 OSCachedToUncached(void *caddr);
|
||||
u32 OSUncachedToCached(void *ucaddr);
|
||||
#endif
|
||||
|
||||
#define OSTicksToCycles(ticks) (((ticks) * ((OS_CORE_CLOCK * 2) / OS_TIMER_CLOCK)) / 2)
|
||||
|
|
@ -50,7 +50,7 @@ u32 OSUncachedToCached(void* ucaddr);
|
|||
#define OSTicksToMilliseconds(ticks) ((ticks) / (OS_TIMER_CLOCK / 1000))
|
||||
#define OSTicksToMicroseconds(ticks) (((ticks)*8) / (OS_TIMER_CLOCK / 125000))
|
||||
#define OSTicksToNanoseconds(ticks) (((ticks)*8000) / (OS_TIMER_CLOCK / 125000))
|
||||
#define OSSecondsToTicks(sec) ((sec)*OS_TIMER_CLOCK)
|
||||
#define OSSecondsToTicks(sec) ((sec)*OS_TIMER_CLOCK)
|
||||
#define OSMillisecondsToTicks(msec) ((msec) * (OS_TIMER_CLOCK / 1000))
|
||||
#define OSMicrosecondsToTicks(usec) (((usec) * (OS_TIMER_CLOCK / 125000)) / 8)
|
||||
#define OSNanosecondsToTicks(nsec) (((nsec) * (OS_TIMER_CLOCK / 125000)) / 8000)
|
||||
|
|
@ -60,52 +60,44 @@ u32 OSUncachedToCached(void* ucaddr);
|
|||
#define OSRoundUp32B(v) (((u32)(v + 31) & ~31))
|
||||
#define OSRoundDown32B(x) (((u32)(x)) & ~31)
|
||||
|
||||
void* OSGetArenaHi(void);
|
||||
void* OSGetArenaLo(void);
|
||||
void OSSetArenaHi(void* newHi);
|
||||
void OSSetArenaLo(void* newLo);
|
||||
|
||||
void* OSAllocFromArenaLo(u32 size, u32 align);
|
||||
void* OSAllocFromArenaHi(u32 size, u32 align);
|
||||
|
||||
void OSInit();
|
||||
|
||||
OSTime OSGetTime();
|
||||
OSTick OSGetTick();
|
||||
|
||||
typedef struct OSCalendarTime {
|
||||
int sec; // seconds after the minute [0, 61]
|
||||
int min; // minutes after the hour [0, 59]
|
||||
int hour; // hours since midnight [0, 23]
|
||||
int mday; // day of the month [1, 31]
|
||||
int mon; // month since January [0, 11]
|
||||
int year; // years in AD [1, ...]
|
||||
int wday; // days since Sunday [0, 6]
|
||||
int yday; // days since January 1 [0, 365]
|
||||
int sec; // seconds after the minute [0, 61]
|
||||
int min; // minutes after the hour [0, 59]
|
||||
int hour; // hours since midnight [0, 23]
|
||||
int mday; // day of the month [1, 31]
|
||||
int mon; // month since January [0, 11]
|
||||
int year; // years in AD [1, ...]
|
||||
int wday; // days since Sunday [0, 6]
|
||||
int yday; // days since January 1 [0, 365]
|
||||
|
||||
int msec; // milliseconds after the second [0,999]
|
||||
int usec; // microseconds after the millisecond [0,999]
|
||||
int msec; // milliseconds after the second [0,999]
|
||||
int usec; // microseconds after the millisecond [0,999]
|
||||
} OSCalendarTime;
|
||||
|
||||
OSTime OSCalendarTimeToTicks(OSCalendarTime* td);
|
||||
void OSTicksToCalendarTime(OSTime ticks, OSCalendarTime* td);
|
||||
OSTime OSCalendarTimeToTicks(OSCalendarTime *td);
|
||||
void OSTicksToCalendarTime(OSTime ticks, OSCalendarTime *td);
|
||||
|
||||
typedef struct OSStopwatch {
|
||||
char* name;
|
||||
OSTime total;
|
||||
u32 hits;
|
||||
OSTime min;
|
||||
OSTime max;
|
||||
OSTime last;
|
||||
BOOL running;
|
||||
char *name;
|
||||
OSTime total;
|
||||
u32 hits;
|
||||
OSTime min;
|
||||
OSTime max;
|
||||
OSTime last;
|
||||
BOOL running;
|
||||
} OSStopwatch;
|
||||
|
||||
void OSInitStopwatch(OSStopwatch* sw, char* name);
|
||||
void OSStartStopwatch(OSStopwatch* sw);
|
||||
void OSStopStopwatch(OSStopwatch* sw);
|
||||
OSTime OSCheckStopwatch(OSStopwatch* sw);
|
||||
void OSResetStopwatch(OSStopwatch* sw);
|
||||
void OSDumpStopwatch(OSStopwatch* sw);
|
||||
void OSInitStopwatch(OSStopwatch *sw, char *name);
|
||||
void OSStartStopwatch(OSStopwatch *sw);
|
||||
void OSStopStopwatch(OSStopwatch *sw);
|
||||
OSTime OSCheckStopwatch(OSStopwatch *sw);
|
||||
void OSResetStopwatch(OSStopwatch *sw);
|
||||
void OSDumpStopwatch(OSStopwatch *sw);
|
||||
|
||||
#define OS_CONSOLE_MASK 0xf0000000
|
||||
#define OS_CONSOLE_RETAIL 0x00000000
|
||||
|
|
@ -159,7 +151,7 @@ void OSSetLanguage(u8 language);
|
|||
u32 OSGetEuRgb60Mode(void);
|
||||
void OSSetEuRgb60Mode(u32 on);
|
||||
|
||||
void OSRegisterVersion(const char* id);
|
||||
void OSRegisterVersion(const char *id);
|
||||
|
||||
BOOL OSDisableInterrupts(void);
|
||||
BOOL OSEnableInterrupts(void);
|
||||
|
|
@ -174,8 +166,7 @@ BOOL OSRestoreInterrupts(BOOL level);
|
|||
#endif
|
||||
|
||||
#ifndef ASSERTMSG
|
||||
#if defined(__STDC_VERSION__) && (199901L <= __STDC_VERSION__) || defined(__MWERKS__) || \
|
||||
defined(__SN__)
|
||||
#if defined(__STDC_VERSION__) && (199901L <= __STDC_VERSION__) || defined(__MWERKS__) || defined(__SN__)
|
||||
#define ASSERTMSG(exp, ...) (void)((exp) || (OSPanic(__FILE__, __LINE__, __VA_ARGS__), 0))
|
||||
#else
|
||||
#define ASSERTMSG(exp, msg) (void)((exp) || (OSPanic(__FILE__, __LINE__, (msg)), 0))
|
||||
|
|
@ -183,23 +174,20 @@ BOOL OSRestoreInterrupts(BOOL level);
|
|||
#endif
|
||||
|
||||
#ifndef ASSERTMSG1
|
||||
#define ASSERTMSG1(exp, msg, param1) \
|
||||
(void)((exp) || (OSPanic(__FILE__, __LINE__, (msg), (param1)), 0))
|
||||
#define ASSERTMSG1(exp, msg, param1) (void)((exp) || (OSPanic(__FILE__, __LINE__, (msg), (param1)), 0))
|
||||
#endif
|
||||
|
||||
#ifndef ASSERTMSG2
|
||||
#define ASSERTMSG2(exp, msg, param1, param2) \
|
||||
(void)((exp) || (OSPanic(__FILE__, __LINE__, (msg), (param1), (param2)), 0))
|
||||
#define ASSERTMSG2(exp, msg, param1, param2) (void)((exp) || (OSPanic(__FILE__, __LINE__, (msg), (param1), (param2)), 0))
|
||||
#endif
|
||||
|
||||
#ifndef ASSERTMSG3
|
||||
#define ASSERTMSG3(exp, msg, param1, param2, param3) \
|
||||
(void)((exp) || (OSPanic(__FILE__, __LINE__, (msg), (param1), (param2), (param3)), 0))
|
||||
#define ASSERTMSG3(exp, msg, param1, param2, param3) (void)((exp) || (OSPanic(__FILE__, __LINE__, (msg), (param1), (param2), (param3)), 0))
|
||||
#endif
|
||||
|
||||
#ifndef ASSERTMSG4
|
||||
#define ASSERTMSG4(exp, msg, param1, param2, param3, param4) \
|
||||
(void)((exp) || (OSPanic(__FILE__, __LINE__, (msg), (param1), (param2), (param3), (param4)), 0))
|
||||
#define ASSERTMSG4(exp, msg, param1, param2, param3, param4) \
|
||||
(void)((exp) || (OSPanic(__FILE__, __LINE__, (msg), (param1), (param2), (param3), (param4)), 0))
|
||||
#endif
|
||||
|
||||
#else // _DEBUG
|
||||
|
|
@ -209,8 +197,7 @@ BOOL OSRestoreInterrupts(BOOL level);
|
|||
#endif
|
||||
|
||||
#ifndef ASSERTMSG
|
||||
#if defined(__STDC_VERSION__) && (199901L <= __STDC_VERSION__) || defined(__MWERKS__) || \
|
||||
defined(__SN__)
|
||||
#if defined(__STDC_VERSION__) && (199901L <= __STDC_VERSION__) || defined(__MWERKS__) || defined(__SN__)
|
||||
#define ASSERTMSG(exp, ...) ((void)0)
|
||||
#else
|
||||
#define ASSERTMSG(exp, msg) ((void)0)
|
||||
|
|
@ -232,9 +219,9 @@ BOOL OSRestoreInterrupts(BOOL level);
|
|||
|
||||
#endif // _DEBUG
|
||||
|
||||
void OSReport(const char* msg, ...);
|
||||
void OSPanic(const char* file, int line, const char* msg, ...);
|
||||
void OSFatal(GXColor fg, GXColor bg, const char* msg);
|
||||
void OSReport(const char *msg, ...);
|
||||
void OSPanic(const char *file, int line, const char *msg, ...);
|
||||
void OSFatal(GXColor fg, GXColor bg, const char *msg);
|
||||
|
||||
u32 OSGetPhysicalMemSize(void);
|
||||
u32 OSGetConsoleSimulatedMemSize(void);
|
||||
|
|
@ -253,6 +240,7 @@ u32 OSGetConsoleSimulatedMemSize(void);
|
|||
#include <dolphin/os/OSExpansion.h>
|
||||
#include <dolphin/os/OSFastCast.h>
|
||||
#include <dolphin/os/OSFont.h>
|
||||
#include <dolphin/os/OSIC.h>
|
||||
#include <dolphin/os/OSInterrupt.h>
|
||||
#include <dolphin/os/OSMemory.h>
|
||||
#include <dolphin/os/OSMessage.h>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _DOLPHIN_OSALARM
|
||||
#define _DOLPHIN_OSALARM
|
||||
|
||||
#include <dolphin/os.h>
|
||||
#include <dolphin/os/OSContext.h>
|
||||
#include <types.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,19 +7,18 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
typedef int OSHeapHandle;
|
||||
typedef void (*OSAllocVisitor)(void* obj, u32 size);
|
||||
void* OSInitAlloc(void* arenaStart, void* arenaEnd, int maxHeaps);
|
||||
OSHeapHandle OSCreateHeap(void* start, void* end);
|
||||
typedef void (*OSAllocVisitor)(void *obj, u32 size);
|
||||
void *OSInitAlloc(void *arenaStart, void *arenaEnd, int maxHeaps);
|
||||
OSHeapHandle OSCreateHeap(void *start, void *end);
|
||||
void OSDestroyHeap(OSHeapHandle heap);
|
||||
void OSAddToHeap(OSHeapHandle heap, void* start, void* end);
|
||||
void OSAddToHeap(OSHeapHandle heap, void *start, void *end);
|
||||
OSHeapHandle OSSetCurrentHeap(OSHeapHandle heap);
|
||||
void* OSAllocFromHeap(OSHeapHandle heap, u32 size);
|
||||
void* OSAllocFixed(void** rstart, void** rend);
|
||||
void OSFreeToHeap(OSHeapHandle heap, void* ptr);
|
||||
void *OSAllocFromHeap(OSHeapHandle heap, u32 size);
|
||||
void *OSAllocFixed(void **rstart, void **rend);
|
||||
void OSFreeToHeap(OSHeapHandle heap, void *ptr);
|
||||
long OSCheckHeap(OSHeapHandle heap);
|
||||
void OSDumpHeap(OSHeapHandle heap);
|
||||
void *OSAllocFixed(void **rstart, void **rend);
|
||||
u32 OSReferentSize(void* ptr);
|
||||
u32 OSReferentSize(void *ptr);
|
||||
void OSVisitAllocated(OSAllocVisitor visitor);
|
||||
extern volatile OSHeapHandle __OSCurrHeap;
|
||||
#define OSAlloc(size) OSAllocFromHeap(__OSCurrHeap, (size))
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "dolphin/DVDPriv.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
typedef struct OSBootInfo {
|
||||
typedef struct OSBootInfo_s {
|
||||
DVDDiskID DVDDiskID;
|
||||
u32 magic;
|
||||
u32 version;
|
||||
|
|
|
|||
|
|
@ -158,10 +158,16 @@ typedef struct OSContext {
|
|||
|
||||
} OSContext;
|
||||
|
||||
u32 OSGetStackPointer(void);
|
||||
void OSDumpContext(OSContext *context);
|
||||
u32 OSSaveContext(OSContext* context);
|
||||
void OSLoadContext(OSContext* context);
|
||||
void OSClearContext(OSContext* context);
|
||||
OSContext* OSGetCurrentContext();
|
||||
void OSSetCurrentContext(OSContext* context);
|
||||
void OSSaveFPUContext(OSContext *fpuContext);
|
||||
void OSInitContext(OSContext *context, u32 pc, u32 newsp);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,17 +9,44 @@ extern "C" {
|
|||
|
||||
#define OS_FONT_ENCODE_ANSI 0u
|
||||
#define OS_FONT_ENCODE_SJIS 1u
|
||||
#define OS_FONT_ENCODE_UTF8 3u // UTF-8 [RFC 3629]
|
||||
#define OS_FONT_ENCODE_UTF16 4u // UTF-16BE [RFC 2781]
|
||||
#define OS_FONT_ENCODE_UTF32 5u // UTF-32
|
||||
#define OS_FONT_ENCODE_MAX 5u
|
||||
#define OS_FONT_ENCODE_VOID 0xffffu
|
||||
#define OS_FONT_SIZE_ANSI (288 + 131072) // 9 sheets
|
||||
#define OS_FONT_SIZE_SJIS (3840 + 1179648) // 1 sheet
|
||||
#define OS_FONT_ROM_SIZE_ANSI 0x03000
|
||||
#define OS_FONT_ROM_SIZE_SJIS 0x4D000
|
||||
|
||||
#define OS_FONT_PROPORTIONAL FALSE
|
||||
#define OS_FONT_FIXED TRUE
|
||||
typedef struct OSFontHeader
|
||||
{
|
||||
/*0x00*/ u16 fontType;
|
||||
u16 firstChar;
|
||||
u16 lastChar;
|
||||
u16 invalChar;
|
||||
/*0x08*/ u16 ascent;
|
||||
u16 descent;
|
||||
u16 width;
|
||||
u16 leading;
|
||||
/*0x10*/ u16 cellWidth;
|
||||
u16 cellHeight;
|
||||
/*0x14*/ u32 sheetSize;
|
||||
/*0x18*/ u16 sheetFormat;
|
||||
u16 sheetColumn;
|
||||
u16 sheetRow;
|
||||
u16 sheetWidth;
|
||||
/*0x20*/ u16 sheetHeight;
|
||||
u16 widthTable;
|
||||
u32 sheetImage;
|
||||
u32 sheetFullSize;
|
||||
u8 c0;
|
||||
u8 c1;
|
||||
u8 c2;
|
||||
u8 c3;
|
||||
} OSFontHeader;
|
||||
|
||||
u16 OSGetFontEncode(void);
|
||||
u16 OSSetFontEncode(u16 encode);
|
||||
BOOL OSInitFont(OSFontHeader *fontData);
|
||||
u32 OSLoadFont(OSFontHeader *fontData, void *temp);
|
||||
char *OSGetFontTexture(char *string, void **image, s32 *x, s32 *y, s32 *width);
|
||||
char *OSGetFontWidth(char *string, s32 *width);
|
||||
char *OSGetFontTexel(char *string, void *image, s32 pos, s32 stride, s32 *width);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
20
include/dolphin/os/OSIC.h
Normal file
20
include/dolphin/os/OSIC.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef _DOLPHIN_OSIC
|
||||
#define _DOLPHIN_OSIC
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void ICFlashInvalidate(void);
|
||||
void ICEnable(void);
|
||||
void ICDisable(void);
|
||||
void ICFreeze(void);
|
||||
void ICUnfreeze(void);
|
||||
void ICBlockInvalidate(void *addr);
|
||||
void ICSync(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -105,8 +105,8 @@ BOOL OSUnlink(OSModuleInfo* oldModule);
|
|||
OSModuleInfo* OSSearchModule(void* ptr, u32* section, u32* offset);
|
||||
|
||||
// debugger notification
|
||||
void OSNotifyLink(OSModuleInfo* module);
|
||||
void OSNotifyUnlink(OSModuleInfo* module);
|
||||
void OSNotifyLink(void);
|
||||
void OSNotifyUnlink(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,42 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OFFSET(addr, align) (((u32)(addr) & ((align)-1)))
|
||||
|
||||
// OSAudioSystem.c
|
||||
void __OSInitAudioSystem(void);
|
||||
void __OSStopAudioSystem(void);
|
||||
|
||||
// OSCache.c
|
||||
void __OSCacheInit(void);
|
||||
|
||||
// OSContext.c
|
||||
void __OSContextInit(void);
|
||||
|
||||
// OSMutex.c
|
||||
void __OSUnlockAllMutex(struct OSThread *thread);
|
||||
|
||||
// OSInterrupt.c
|
||||
extern void __RAS_OSDisableInterrupts_begin(void);
|
||||
extern void __RAS_OSDisableInterrupts_end(void);
|
||||
void __OSInterruptInit(void);
|
||||
void __OSModuleInit(void);
|
||||
|
||||
void __OSInitSystemCall(void);
|
||||
|
||||
// OSThread.c
|
||||
void __OSThreadInit(void);
|
||||
void __OSReschedule(void);
|
||||
|
||||
typedef void (*OSExceptionHandler)(__OSException, OSContext*);
|
||||
OSExceptionHandler __OSSetExceptionHandler(__OSException exception, OSExceptionHandler handler);
|
||||
__OSExceptionHandler __OSGetExceptionHandler(__OSException exception);
|
||||
OSTime __OSGetSystemTime();
|
||||
OSTime __OSTimeToSystemTime(OSTime);
|
||||
|
||||
// OSReboot
|
||||
void __OSReboot(u32 resetCode, u32 bootDol);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ struct OSResetFunctionInfo {
|
|||
OSResetFunctionInfo* prev;
|
||||
};
|
||||
|
||||
void OSRegisterResetFunction(OSResetFunctionInfo *info);
|
||||
u32 OSGetResetCode(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -10,17 +10,19 @@
|
|||
#ifdef __MWERKS__
|
||||
extern inline float sqrtf(float x)
|
||||
{
|
||||
volatile float y;
|
||||
if(x > 0.0f)
|
||||
{
|
||||
double guess = __frsqrte((double)x); // returns an approximation to
|
||||
guess = 0.5*guess*(3.0 - guess*guess*x); // now have 12 sig bits
|
||||
guess = 0.5*guess*(3.0 - guess*guess*x); // now have 24 sig bits
|
||||
guess = 0.5*guess*(3.0 - guess*guess*x); // now have 32 sig bits
|
||||
y=(float)(x*guess);
|
||||
return y;
|
||||
}
|
||||
return x;
|
||||
static const double _half = .5;
|
||||
static const double _three = 3.0;
|
||||
volatile float y;
|
||||
if (x > 0.0f)
|
||||
{
|
||||
double guess = __frsqrte((double)x); // returns an approximation to
|
||||
guess = _half*guess*(_three - guess*guess*x); // now have 12 sig bits
|
||||
guess = _half*guess*(_three - guess*guess*x); // now have 24 sig bits
|
||||
guess = _half*guess*(_three - guess*guess*x); // now have 32 sig bits
|
||||
y = (float)(x*guess);
|
||||
return y ;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
float sqrtf(float x);
|
||||
|
|
|
|||
19
include/msm/msmfio.h
Normal file
19
include/msm/msmfio.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef MSMFIO_H
|
||||
#define MSMFIO_H
|
||||
|
||||
#include "dolphin.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "game/msm.h"
|
||||
|
||||
struct msmFio {
|
||||
MSM_OPEN open;
|
||||
MSM_READ read;
|
||||
MSM_CLOSE close;
|
||||
};
|
||||
|
||||
BOOL msmFioClose(DVDFileInfo *fileInfo);
|
||||
BOOL msmFioRead(DVDFileInfo *fileInfo, void *addr, s32 length, s32 offset);
|
||||
BOOL msmFioOpen(s32 entrynum, DVDFileInfo *fileInfo);
|
||||
void msmFioInit(MSM_OPEN open, MSM_READ read, MSM_CLOSE close);
|
||||
|
||||
#endif
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
void msmMemFree(void*);
|
||||
void* msmMemAlloc(s32);
|
||||
void msmMemInit(void*, u32);
|
||||
void msmMemFree(void *);
|
||||
void *msmMemAlloc(u32);
|
||||
void msmMemInit(void *, u32);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
10
include/msm/msmmus.h
Normal file
10
include/msm/msmmus.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef MSMMUS_H
|
||||
#define MSMMUS_H
|
||||
|
||||
#include "dolphin.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
s32 msmMusInit(s32 *, DVDFileInfo *);
|
||||
void msmMusPeriodicProc(void);
|
||||
|
||||
#endif
|
||||
10
include/msm/msmse.h
Normal file
10
include/msm/msmse.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef MSMSE_H
|
||||
#define MSMSE_H
|
||||
|
||||
#include "dolphin.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
s32 msmSeInit(s32 *, DVDFileInfo *);
|
||||
void msmSePeriodicProc(void);
|
||||
|
||||
#endif
|
||||
12
include/msm/msmstream.h
Normal file
12
include/msm/msmstream.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef MSMSTREAM_H
|
||||
#define MSMSTREAM_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
void msmStreamPeriodicProc(void);
|
||||
void msmStreamSetOutputMode(s8);
|
||||
void msmStreamAmemFree(void);
|
||||
s32 msmStreamAmemAlloc(void);
|
||||
s32 msmStreamInit(char *);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef _REL_SQRT_CONSTS
|
||||
#define _REL_SQRT_CONSTS
|
||||
|
||||
const double __fakeHalf = 0.5;
|
||||
const double __fakeThree = 3.0;
|
||||
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue