mirror of
https://github.com/zeldaret/oot-gc.git
synced 2026-10-05 17:03:05 -04:00
d693726da8
* Use #include "..." rather than #include <...> * Remove unused dolphin headers * Go through dolphin/base.h * Remove __cplusplus guards * Go through dolphin/gx.h * Move dolphin OS headers to subdirectory * Go through dolphin/os.h * Go through the rest of dolphin headers * Split out si.h * Split up hw_regs.h * Change #include <> to #include "" in debug info * Create dolphin/thp.h * Go through variables.h * Create dolphin.h
147 lines
3.6 KiB
C
147 lines
3.6 KiB
C
#ifndef _SYSTEM_H
|
|
#define _SYSTEM_H
|
|
|
|
#include "cpu.h"
|
|
#include "dolphin.h"
|
|
#include "mips.h"
|
|
|
|
typedef s32 (*SystemCopyCallbackFunc)(void);
|
|
|
|
// __anon_0x394CD
|
|
typedef enum SystemMode {
|
|
SM_NONE = -1,
|
|
SM_RUNNING = 0,
|
|
SM_STOPPED = 1,
|
|
} SystemMode;
|
|
|
|
// __anon_0x370F1
|
|
typedef enum SystemRomType {
|
|
SRT_NONE = -1,
|
|
SRT_MARIO = 0,
|
|
SRT_WAVERACE = 1,
|
|
SRT_MARIOKART = 2,
|
|
SRT_STARFOX = 3,
|
|
SRT_ZELDA1 = 4,
|
|
SRT_ZELDA2 = 5,
|
|
SRT_1080 = 6,
|
|
SRT_PANEL = 7,
|
|
SRT_MARIOPARTY1 = 8,
|
|
SRT_MARIOPARTY2 = 9,
|
|
SRT_MARIOPARTY3 = 10,
|
|
SRT_DRMARIO = 11,
|
|
SRT_UNKNOWN = 12,
|
|
} SystemRomType;
|
|
|
|
// __anon_0x370F1
|
|
typedef enum SystemObjectType {
|
|
SOT_NONE = -1,
|
|
SOT_CPU = 0,
|
|
SOT_PIF = 1,
|
|
SOT_RAM = 2,
|
|
SOT_ROM = 3,
|
|
SOT_RSP = 4,
|
|
SOT_RDP = 5,
|
|
SOT_MIPS = 6,
|
|
SOT_DISK = 7,
|
|
SOT_FLASH = 8,
|
|
SOT_SRAM = 9,
|
|
SOT_AUDIO = 10,
|
|
SOT_VIDEO = 11,
|
|
SOT_SERIAL = 12,
|
|
SOT_LIBRARY = 13,
|
|
SOT_PERIPHERAL = 14,
|
|
SOT_RDB = 15,
|
|
SOT_COUNT = 16,
|
|
} SystemObjectType;
|
|
|
|
// __anon_0xA982
|
|
typedef enum SystemArgumentType {
|
|
SAT_NONE = -1,
|
|
SAT_NAME = 0,
|
|
SAT_PROGRESSIVE = 1,
|
|
SAT_VIBRATION = 2,
|
|
SAT_CONTROLLER = 3,
|
|
SAT_XTRA = 4,
|
|
SAT_MEMORYCARD = 5,
|
|
SAT_MOVIE = 6,
|
|
SAT_RESET = 7,
|
|
SAT_COUNT = 8
|
|
} SystemArgumentType;
|
|
|
|
// __anon_0x3979C
|
|
typedef enum SystemInterruptType {
|
|
SIT_NONE = -1,
|
|
SIT_SW0 = 0,
|
|
SIT_SW1 = 1,
|
|
SIT_CART = 2,
|
|
SIT_COUNTER = 3,
|
|
SIT_RDB = 4,
|
|
SIT_SP = 5,
|
|
SIT_SI = 6,
|
|
SIT_AI = 7,
|
|
SIT_VI = 8,
|
|
SIT_PI = 9,
|
|
SIT_DP = 10,
|
|
SIT_CPU_BREAK = 11,
|
|
SIT_SP_BREAK = 12,
|
|
SIT_FAULT = 13,
|
|
SIT_THREADSTATUS = 14,
|
|
SIT_PRENMI = 15,
|
|
SIT_COUNT = 16,
|
|
} SystemInterruptType;
|
|
|
|
// __anon_0x393FF
|
|
typedef struct SystemException {
|
|
/* 0x00 */ char* szType;
|
|
/* 0x04 */ u32 nMask;
|
|
/* 0x08 */ CpuExceptionCode eCode;
|
|
/* 0x0C */ SystemInterruptType eType;
|
|
/* 0x10 */ MipsInterruptType eTypeMips;
|
|
} SystemException; // size = 0x14
|
|
|
|
// __anon_0x37040
|
|
typedef struct SystemRomCopy {
|
|
/* 0x00 */ s32 nSize;
|
|
/* 0x04 */ s32 nOffsetRAM;
|
|
/* 0x08 */ s32 nOffsetROM;
|
|
/* 0x0C */ SystemCopyCallbackFunc pCallback;
|
|
} SystemRomCopy; // size = 0x10
|
|
|
|
// __anon_0x37240
|
|
typedef struct System {
|
|
/* 0x00 */ void* pFrame;
|
|
/* 0x04 */ void* pSound;
|
|
/* 0x08 */ s32 bException;
|
|
/* 0x0C */ SystemMode eMode;
|
|
/* 0x10 */ SystemRomCopy romCopy;
|
|
/* 0x20 */ SystemRomType eTypeROM;
|
|
/* 0x24 */ void* apObject[SOT_COUNT];
|
|
/* 0x68 */ u64 nAddressBreak;
|
|
/* 0x70 */ SystemObjectType storageDevice;
|
|
/* 0x74 */ u8 anException[16];
|
|
/* 0x84 */ s32 bJapaneseVersion;
|
|
} System; // size = 0x88
|
|
|
|
// __anon_0x3459E
|
|
typedef struct SystemRomConfig {
|
|
/* 0x0000 */ char rom[36];
|
|
/* 0x0024 */ s32 controllerConfiguration[4][20];
|
|
/* 0x0164 */ s32 rumbleConfiguration;
|
|
/* 0x0168 */ SystemObjectType storageDevice;
|
|
/* 0x016C */ s32 normalControllerConfig;
|
|
/* 0x0170 */ s32 currentControllerConfig;
|
|
} SystemRomConfig; // size = 0x174
|
|
|
|
s32 systemCopyROM(System* pSystem, s32 nOffsetRAM, s32 nOffsetROM, s32 nSize, SystemCopyCallbackFunc pCallback);
|
|
s32 systemSetMode(System* pSystem, SystemMode eMode);
|
|
s32 systemGetMode(System* pSystem, SystemMode* peMode);
|
|
s32 systemSetStorageDevice(System* pSystem, SystemObjectType eStorageDevice);
|
|
s32 systemGetStorageDevice(System* pSystem, SystemObjectType* pStorageDevice);
|
|
s32 systemReset(System* pSystem);
|
|
s32 systemExecute(System* pSystem, s32 nCount);
|
|
s32 systemCheckInterrupts(System* pSystem);
|
|
s32 systemExceptionPending(System* pSystem, SystemInterruptType nException);
|
|
s32 systemEvent(System* pSystem, s32 nEvent, void* pArgument);
|
|
|
|
#endif
|