diff --git a/include/PR/gbi.h b/include/PR/gbi.h index c6fcdc1e22..4747947b7a 100644 --- a/include/PR/gbi.h +++ b/include/PR/gbi.h @@ -5,6 +5,8 @@ #include "ultratypes.h" +/* Not original to libultra: Point Lights, DW, and Mtx intPart/FracPart union */ + /* To enable Fast3DEX grucode support, define F3DEX_GBI. */ /* Types */ diff --git a/include/PR/mbi.h b/include/PR/mbi.h index f72ad9acd3..acfe89084c 100644 --- a/include/PR/mbi.h +++ b/include/PR/mbi.h @@ -74,11 +74,14 @@ * **************************************************************************/ -#define M_GFXTASK 1 -#define M_AUDTASK 2 -#define M_VIDTASK 3 -#define M_HVQTASK 6 -#define M_HVQMTASK 7 +/* Not original to libultra: Some added task defines */ +#define M_NULTASK 0 +#define M_GFXTASK 1 +#define M_AUDTASK 2 +#define M_VIDTASK 3 +#define M_NJPEGTASK 4 +#define M_HVQTASK 6 +#define M_HVQMTASK 7 /************************************************************************** * diff --git a/include/PR/os_cont.h b/include/PR/os_cont.h index 6a63b89019..50febb0150 100644 --- a/include/PR/os_cont.h +++ b/include/PR/os_cont.h @@ -41,23 +41,38 @@ typedef struct { #define CONT_ADDR_CRC_ER 0x04 #define CONT_EEPROM_BUSY 0x80 -// TODO: use real libultra button defines instead of this +#define R_CBUTTONS 0x0001 +#define L_CBUTTONS 0x0002 +#define D_CBUTTONS 0x0004 +#define U_CBUTTONS 0x0008 +#define R_TRIG 0x0010 +#define L_TRIG 0x0020 +#define R_JPAD 0x0100 +#define L_JPAD 0x0200 +#define D_JPAD 0x0400 +#define U_JPAD 0x0800 +#define START_BUTTON 0x1000 +#define Z_TRIG 0x2000 +#define B_BUTTON 0x4000 +#define A_BUTTON 0x8000 + +/* Not original to libultra: button macros */ /* Buttons */ -#define BTN_CRIGHT 0x0001 -#define BTN_CLEFT 0x0002 -#define BTN_CDOWN 0x0004 -#define BTN_CUP 0x0008 -#define BTN_R 0x0010 -#define BTN_L 0x0020 -#define BTN_RESET 0x0080 -#define BTN_DRIGHT 0x0100 -#define BTN_DLEFT 0x0200 -#define BTN_DDOWN 0x0400 -#define BTN_DUP 0x0800 -#define BTN_START 0x1000 -#define BTN_Z 0x2000 -#define BTN_B 0x4000 -#define BTN_A 0x8000 +#define BTN_CRIGHT R_CBUTTONS +#define BTN_CLEFT L_CBUTTONS +#define BTN_CDOWN D_CBUTTONS +#define BTN_CUP U_CBUTTONS +#define BTN_R R_TRIG +#define BTN_L L_TRIG +#define BTN_RESET 0x0080 /* "neutral reset": Corresponds to holding L+R and pressing S */ +#define BTN_DRIGHT R_JPAD +#define BTN_DLEFT L_JPAD +#define BTN_DDOWN D_JPAD +#define BTN_DUP U_JPAD +#define BTN_START START_BUTTON +#define BTN_Z Z_TRIG +#define BTN_B B_BUTTON +#define BTN_A A_BUTTON #define CONT_ERR_NO_CONTROLLER PFS_ERR_NOPACK /* 1 */ #define CONT_ERR_CONTRFAIL CONT_OVERRUN_ERROR /* 4 */ diff --git a/include/PR/os_convert.h b/include/PR/os_convert.h index 468d77f9aa..e9d1f68a8c 100644 --- a/include/PR/os_convert.h +++ b/include/PR/os_convert.h @@ -18,9 +18,6 @@ #define OS_PHYSICAL_TO_K0(x) (void*)(((u32)(x)+0x80000000)) #define OS_PHYSICAL_TO_K1(x) (void*)(((u32)(x)+0xA0000000)) -#define OS_MSEC_TO_CYCLES(n) OS_USEC_TO_CYCLES((n) * 1000) -#define OS_SEC_TO_CYCLES(n) OS_MSEC_TO_CYCLES((n) * 1000) - /* Functions */ extern uintptr_t osVirtualToPhysical(void*); diff --git a/include/PR/os_voice.h b/include/PR/os_voice.h index 09cbc906e2..e3b1e995f6 100644 --- a/include/PR/os_voice.h +++ b/include/PR/os_voice.h @@ -13,18 +13,18 @@ typedef enum OsVoiceHandleMode { } OsVoiceHandleMode; typedef struct { - /* 0x0 */ OSMesgQueue* mq; - /* 0x4 */ s32 channel; // Controller port - /* 0x8 */ OsVoiceHandleMode mode; - /* 0xC */ u8 status; + /* 0x0 */ OSMesgQueue* __mq; + /* 0x4 */ s32 __channel; // Controller port + /* 0x8 */ s32 __mode; + /* 0xC */ u8 cmd_status; } OSVoiceHandle; // size = 0x10 typedef struct { /* 0x00 */ u16 warning; // Warning - /* 0x02 */ u16 answerNum; // Candidate number (0~5) - /* 0x04 */ u16 voiceLevel; // Voice input level - /* 0x06 */ u16 voiceRelLevel; // Relative voice level "voice_sn" - /* 0x08 */ u16 voiceTime; // Voice input time + /* 0x02 */ u16 answer_num; // Candidate number (0~5) + /* 0x04 */ u16 voice_level; // Voice input level + /* 0x06 */ u16 voice_sn; // Relative voice level + /* 0x08 */ u16 voice_time; // Voice input time /* 0x0A */ u16 answer[5]; // Candidate word number /* 0x14 */ u16 distance[5]; // Distance value } OSVoiceData; // size = 0x20 @@ -40,11 +40,6 @@ typedef struct { #define VOICE_WARN_NOT_FIT 0x4000 /* No words match recognition word (No. 1 Candidate Distance Value > 1600) */ #define VOICE_WARN_TOO_NOISY 0x8000 /* Too much ambient noise (Relative Voice Level =< 400) */ -typedef struct { - /* 0x000 */ u16 words[20][15]; // 20 words, each with up to 15 syllables - /* 0x258 */ u8 numWords; -} OSVoiceDictionary; // size = 0x25C - s32 osVoiceInit(OSMesgQueue* mq, OSVoiceHandle* hd, int channel); s32 osVoiceSetWord(OSVoiceHandle* hd, u8* word); s32 osVoiceCheckWord(u8* word); diff --git a/include/PR/sched.h b/include/PR/sched.h index 7db228a5df..778bd7d1c0 100644 --- a/include/PR/sched.h +++ b/include/PR/sched.h @@ -9,8 +9,10 @@ #define OS_SC_RETRACE_MSG 1 #define OS_SC_DONE_MSG 2 -#define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c +#define OS_SC_RDP_DONE_MSG 3 #define OS_SC_PRE_NMI_MSG 4 +#define OS_SC_LAST_MSG 4 /* this should have highest number */ +#define OS_SC_MAX_MESGS 8 #define OS_SC_NEEDS_RDP 0x0001 #define OS_SC_NEEDS_RSP 0x0002 @@ -22,11 +24,6 @@ #define OS_SC_RCP_MASK 0x0003 #define OS_SC_TYPE_MASK 0x0007 -#define OS_SC_DP 0x0001 -#define OS_SC_SP 0x0002 -#define OS_SC_YIELD 0x0010 -#define OS_SC_YIELDED 0x0020 - typedef struct OSScTask { /* 0x00 */ struct OSScTask* next; /* 0x04 */ u32 state; diff --git a/include/PR/sptask.h b/include/PR/sptask.h index 3ec4bf1bf6..cc29559b66 100644 --- a/include/PR/sptask.h +++ b/include/PR/sptask.h @@ -2,20 +2,7 @@ #define PR_SPTASK_H #include "PR/ultratypes.h" -#include "libc/stddef.h" -/* Task Types */ -#define M_NULTASK 0 -#define M_GFXTASK 1 -#define M_AUDTASK 2 -#define M_VIDTASK 3 -#define M_NJPEGTASK 4 -#define M_HVQTASK 6 -#define M_HVQMTASK 7 - -/* Task Flags */ -#define M_TASK_FLAG0 (1 << 0) -#define M_TASK_FLAG1 (1 << 1) /* Task Flag Fields */ #define OS_TASK_YIELDED (1 << 0) @@ -30,76 +17,30 @@ #define OS_YIELD_DATA_SIZE 0xC00 #define OS_YIELD_AUDIO_SIZE 0x400 -/* SpStatus */ - -/* Write */ -#define SPSTATUS_CLEAR_HALT (1 << 0) -#define SPSTATUS_SET_HALT (1 << 1) -#define SPSTATUS_CLEAR_BROKE (1 << 2) -#define SPSTATUS_CLEAR_INTR (1 << 3) -#define SPSTATUS_SET_INTR (1 << 4) -#define SPSTATUS_CLEAR_SSTEP (1 << 5) -#define SPSTATUS_SET_SSTEP (1 << 6) -#define SPSTATUS_CLEAR_INTR_ON_BREAK (1 << 7) -#define SPSTATUS_SET_INTR_ON_BREAK (1 << 8) -#define SPSTATUS_CLEAR_SIGNAL0 (1 << 9) -#define SPSTATUS_SET_SIGNAL0 (1 << 10) -#define SPSTATUS_CLEAR_SIGNAL1 (1 << 11) -#define SPSTATUS_SET_SIGNAL1 (1 << 12) -#define SPSTATUS_CLEAR_SIGNAL2 (1 << 13) -#define SPSTATUS_SET_SIGNAL2 (1 << 14) -#define SPSTATUS_CLEAR_SIGNAL3 (1 << 15) -#define SPSTATUS_SET_SIGNAL3 (1 << 16) -#define SPSTATUS_CLEAR_SIGNAL4 (1 << 17) -#define SPSTATUS_SET_SIGNAL4 (1 << 18) -#define SPSTATUS_CLEAR_SIGNAL5 (1 << 19) -#define SPSTATUS_SET_SIGNAL5 (1 << 20) -#define SPSTATUS_CLEAR_SIGNAL6 (1 << 21) -#define SPSTATUS_SET_SIGNAL6 (1 << 23) -#define SPSTATUS_CLEAR_SIGNAL7 (1 << 24) -#define SPSTATUS_SET_SIGNAL7 (1 << 25) - -/* Read */ -#define SPSTATUS_HALT (1 << 0) -#define SPSTATUS_BROKE (1 << 1) -#define SPSTATUS_DMA_BUSY (1 << 2) -#define SPSTATUS_DMA_FULL (1 << 3) -#define SPSTATUS_IO_FULL (1 << 4) -#define SPSTATUS_SINGLE_STEP (1 << 5) -#define SPSTATUS_INTERRUPT_ON_BREAK (1 << 6) -#define SPSTATUS_SIGNAL0_SET (1 << 7) -#define SPSTATUS_SIGNAL1_SET (1 << 8) -#define SPSTATUS_SIGNAL2_SET (1 << 9) -#define SPSTATUS_SIGNAL3_SET (1 << 10) -#define SPSTATUS_SIGNAL4_SET (1 << 11) -#define SPSTATUS_SIGNAL5_SET (1 << 12) -#define SPSTATUS_SIGNAL6_SET (1 << 13) -#define SPSTATUS_SIGNAL7_SET (1 << 14) - typedef struct { /* 0x00 */ u32 type; /* 0x04 */ u32 flags; - /* 0x08 */ u64* ucodeBoot; - /* 0x0C */ u32 ucodeBootSize; // ucode will load these sizes with lw, so need to be 32-bit + /* 0x08 */ u64* ucode_boot; + /* 0x0C */ u32 ucode_boot_size; // ucode will load these sizes with lw, so need to be 32-bit /* 0x10 */ u64* ucode; - /* 0x14 */ u32 ucodeSize; + /* 0x14 */ u32 ucode_size; - /* 0x18 */ u64* ucodeData; - /* 0x1C */ u32 ucodeDataSize; + /* 0x18 */ u64* ucode_data; + /* 0x1C */ u32 ucode_data_size; - /* 0x20 */ u64* dramStack; - /* 0x24 */ u32 dramStackSize; + /* 0x20 */ u64* dram_stack; + /* 0x24 */ u32 dram_stack_size; - /* 0x28 */ u64* outputBuff; - /* 0x2C */ u64* outputBuffSize; + /* 0x28 */ u64* output_buff; + /* 0x2C */ u64* output_buff_size; - /* 0x30 */ u64* dataPtr; - /* 0x34 */ u32 dataSize; + /* 0x30 */ u64* data_ptr; + /* 0x34 */ u32 data_size; - /* 0x38 */ u64* yieldDataPtr; - /* 0x3C */ u32 yieldDataSize; + /* 0x38 */ u64* yield_data_ptr; + /* 0x3C */ u32 yield_data_size; } OSTask_t; // size = 0x40 typedef union { diff --git a/include/fault.h b/include/fault.h index efdb2c513c..2dd4fdaa40 100644 --- a/include/fault.h +++ b/include/fault.h @@ -2,12 +2,14 @@ #define FAULT_H #include "ultra64.h" -#include "unk.h" + #include "libc/stdarg.h" #include "libc/stdint.h" #include "PR/controller.h" + #include "padmgr.h" #include "stack.h" +#include "unk.h" // These are the same as the 3-bit ansi color codes #define FAULT_COLOR_BLACK 0 diff --git a/include/scheduler.h b/include/scheduler.h index f8ee9c9a67..096f2e9b61 100644 --- a/include/scheduler.h +++ b/include/scheduler.h @@ -2,13 +2,18 @@ #define SCHEDULER_H #include "PR/ultratypes.h" -#include "PR/sched.h" #include "PR/os_vi.h" +#include "PR/sched.h" #include "PR/sptask.h" -#include "irqmgr.h" +#include "irqmgr.h" #include "unk.h" +#define OS_SC_RETRACE_MSG 1 +#define OS_SC_DONE_MSG 2 +#define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c +#define OS_SC_PRE_NMI_MSG 4 + #define TASK_FRAMEBUFFER(task) ((CfbInfo*)(task)->framebuffer) typedef struct { diff --git a/include/variables.h b/include/variables.h index 433ed0c761..ff10765bc9 100644 --- a/include/variables.h +++ b/include/variables.h @@ -6,85 +6,8 @@ #include "macros.h" // data -extern u8 sDropTable[DROP_TABLE_SIZE * DROP_TABLE_NUMBER]; -extern u8 sDropTableAmounts[DROP_TABLE_SIZE * DROP_TABLE_NUMBER]; -extern s32 D_801AE194[32]; -extern u8 D_801AE214[32]; - -// extern s32 sEntryIndex; -// extern u32 sCurrentBit; -// extern s32 sTimer; - extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; extern ActorId gMaxActorId; -extern BgCheckSceneSubdivisionEntry sSceneSubdivisionList[]; -extern BgSpecialSceneMaxObjects sCustomDynapolyMem[]; - -// extern UNK_TYPE4 D_801BDAC0; -// extern UNK_TYPE4 D_801BDAC4; -// extern UNK_TYPE4 D_801BDAC8; -// extern UNK_TYPE4 D_801BDACC; -// extern UNK_TYPE4 D_801BDAF0; -// extern UNK_TYPE4 D_801BDAF8; - -extern u8 kanfontOrdering[92]; -// extern actor_init_var_func sInitChainHandlers[11]; -// extern UNK_TYPE4 D_801BEAD4; -// extern UNK_TYPE4 D_801BEAD8; -// extern UNK_TYPE1 D_801BEAE0; -// extern UNK_TYPE4 D_801BEAF4; -// extern UNK_TYPE4 D_801BEAF8; -// extern UNK_TYPE4 D_801BEB04; -// extern UNK_TYPE4 D_801BEB08; -// extern UNK_TYPE4 D_801BEB14; -// extern UNK_TYPE4 D_801BEB18; -// extern UNK_TYPE4 D_801BEB24; -// extern UNK_TYPE4 D_801BEB28; -// extern UNK_TYPE1 D_801BEB38; -// extern UNK_TYPE4 D_801BEBB8; -// extern UNK_TYPE4 D_801BEBD8; -// extern UNK_TYPE2 D_801BEBF8; -// extern UNK_TYPE2 D_801BEBFA; -// extern UNK_TYPE2 D_801BEBFC; -// extern UNK_TYPE2 D_801BEC10; -extern UNK_PTR D_801BEC14; -// extern UNK_TYPE4 D_801BEC1C; -// extern UNK_TYPE4 D_801BEC20; -// extern UNK_TYPE1 D_801BEC24; -// extern UNK_TYPE1 D_801BEC2C; -// extern UNK_TYPE2 D_801BEC5C; -// extern UNK_TYPE2 D_801BEC5E; -// extern UNK_TYPE4 D_801BEC70; -// extern UNK_TYPE1 D_801BEC84; -// extern UNK_TYPE1 D_801BECA4; -// extern UNK_TYPE1 D_801BECC4; -// extern UNK_TYPE1 D_801BECE4; -// extern UNK_TYPE1 D_801BED00; -// extern UNK_TYPE2 D_801BED24; -// extern UNK_TYPE1 D_801BED3C; -// extern UNK_TYPE1 D_801BED40; -// extern UNK_TYPE1 D_801BED4C; -// extern UNK_TYPE1 D_801BED54; -// extern UNK_TYPE1 D_801BED55; -// extern UNK_TYPE1 D_801BED56; -// extern UNK_TYPE1 D_801BED88; -// extern UNK_TYPE1 D_801BEFC8; -// extern UNK_TYPE1 D_801BF15C; -// extern UNK_TYPE1 D_801BF170; -// extern UNK_TYPE1 D_801BF176; -// extern UNK_TYPE1 D_801BF177; -// extern UNK_TYPE1 D_801BF178; -// extern UNK_TYPE1 D_801BF3B4; -// extern UNK_TYPE2 D_801BF550; -// extern UNK_TYPE2 D_801BF554; -// extern UNK_TYPE2 D_801BF558; -// extern UNK_TYPE4 D_801BF55C; -// extern UNK_TYPE4 D_801BF580; -// extern UNK_TYPE4 D_801BF594; -// extern UNK_TYPE4 D_801BF5A4; -// extern UNK_TYPE2 D_801BF5B0; -extern UNK_PTR D_801BF5C0; -// extern UNK_TYPE1 D_801BF68C; extern FlexSkeletonHeader* gPlayerSkeletons[PLAYER_FORM_MAX]; extern PlayerModelIndices gPlayerModelTypes[]; @@ -114,25 +37,10 @@ extern ObjectId gObjectTableSize; extern RomFile gObjectTable[OBJECT_ID_MAX]; extern SceneTableEntry gSceneTable[SCENE_MAX]; -extern UNK_PTR D_801C5C50; -// extern UNK_TYPE1 D_801C5C9C; -extern UNK_PTR D_801C5CB0; - extern KaleidoMgrOverlay gKaleidoMgrOverlayTable[2]; -// extern UNK_TYPE1 D_801D0B8C; extern KaleidoMgrOverlay* gKaleidoMgrCurOvl; -// extern UNK_TYPE1 D_801D0C80; -// extern UNK_TYPE1 D_801D0CB0; -extern s32 gDbgCamEnabled; -// extern UNK_TYPE1 D_801D0D54; -// extern UNK_TYPE2 sQuakeIndex; -// extern UNK_TYPE2 sIsCameraUnderwater; -extern Input* D_801D0D60; -// extern UNK_TYPE2 sPlayerCsIdToCsCamId; -// extern UNK_TYPE1 D_801D0D7A; -extern u32 retryCount; -extern u32 cfbIdx[3]; +extern s32 gDbgCamEnabled; extern Vec3f gZeroVec3f; extern Vec3s gZeroVec3s; @@ -164,1271 +72,17 @@ extern u8 gAudioHeapResetState; extern AudioSpec gAudioSpecs[21]; // rodata -extern f32 D_801DBDF0; -extern f32 D_801DBE68; -extern f32 D_801DBE6C; -extern f32 D_801DBE70; -extern f32 D_801DBE74; -extern f32 D_801DBE78; -extern f32 D_801DBE7C; -extern f32 D_801DBE80; -extern f32 D_801DBE84; -extern f32 D_801DBE88; -extern f32 D_801DBE8C; -extern f32 D_801DBE90; -extern f32 D_801DBE94; -extern f32 D_801DBE98; -extern f32 D_801DBE9C; -extern f32 D_801DBEA0; -extern f32 D_801DBF10; -extern f32 D_801DBF14; -extern f32 D_801DBF18; -extern f32 D_801DBF1C; -extern f32 D_801DBF20; -extern f32 D_801DC068; -extern f32 D_801DC06C; -extern f32 D_801DC070; -extern f32 D_801DC074; -extern f32 D_801DC080; -extern f32 D_801DC084; -extern f32 D_801DC09C; -extern f32 D_801DC0A0; -extern f32 D_801DC0B0; -extern f32 D_801DC0B4; -extern f32 D_801DC0C0; -extern f32 D_801DC0C4; -extern f32 D_801DC0C8; -extern f32 D_801DC0CC; -extern f32 D_801DC0D0; -extern f32 D_801DC0D4; -extern f32 D_801DC100; -extern f32 D_801DC104; -extern f32 D_801DC108; -extern f32 D_801DC10C; -extern f32 D_801DC110; -extern f32 D_801DC114; -extern char D_801DC120[]; -extern char D_801DC134[]; -extern char D_801DC148[]; -extern char D_801DC15C[]; -extern char D_801DC170[]; -extern char D_801DC184[]; -extern char D_801DC198[]; -extern char D_801DC1AC[]; -extern char D_801DC1C0[]; -extern char D_801DC1D4[]; -extern char D_801DC1E8[]; -extern char D_801DC1FC[]; -extern char D_801DC210[]; -extern char D_801DC224[]; -extern char D_801DC238[]; -extern char D_801DC24C[]; -extern char D_801DC260[]; -extern char D_801DC274[]; -extern char D_801DC288[]; -extern char D_801DC29C[]; -extern char D_801DC2B0[]; -extern char D_801DC2C4[]; -extern char D_801DC2D8[]; -extern char D_801DC2EC[]; -extern char D_801DC300[]; -extern char D_801DC314[]; -extern char D_801DC328[]; -extern char D_801DC33C[]; -extern char D_801DC350[]; -extern char D_801DC364[]; -extern char D_801DC378[]; -extern char D_801DC38C[]; -extern char D_801DC3A0[]; -extern char D_801DC3B4[]; -extern char D_801DC3C8[]; -extern char D_801DC3DC[]; -extern char D_801DC3F0[]; -extern char D_801DC404[]; -extern char D_801DC418[]; -extern char D_801DC42C[]; -extern char D_801DC440[]; -extern char D_801DC454[]; -extern char D_801DC468[]; -extern char D_801DC47C[]; -extern char D_801DC490[]; -extern char D_801DC4A4[]; -extern char D_801DC4B8[]; -extern char D_801DC4CC[]; -extern char D_801DC4E0[]; -extern char D_801DC4F4[]; -extern char D_801DC508[]; -extern char D_801DC51C[]; -extern char D_801DC530[]; -extern char D_801DC544[]; -extern char D_801DC558[]; -extern char D_801DC56C[]; -extern char D_801DC580[]; -extern char D_801DC594[]; -extern char D_801DC5A8[]; -extern char D_801DC5BC[]; -extern char D_801DC5D0[]; -extern char D_801DC5E4[]; -extern char D_801DC5F8[]; -extern char D_801DC60C[]; -extern char D_801DC620[]; -extern char D_801DC634[]; -extern char D_801DC648[]; -extern char D_801DC65C[]; -extern char D_801DC670[]; -extern char D_801DC684[]; -extern char D_801DC698[]; -extern char D_801DC6AC[]; -extern char D_801DC6C0[]; -extern char D_801DC6D4[]; -extern char D_801DC6E8[]; -extern char D_801DC6FC[]; -extern char D_801DC710[]; -extern char D_801DC724[]; -extern char D_801DC738[]; -extern char D_801DC74C[]; -extern char D_801DC760[]; -extern char D_801DC774[]; -extern char D_801DC788[]; -extern char D_801DC79C[]; -extern char D_801DC7B0[]; -extern char D_801DC7C4[]; -extern char D_801DC7D8[]; -extern char D_801DC7EC[]; -extern char D_801DC800[]; -extern char D_801DC814[]; -extern char D_801DC828[]; -extern char D_801DC83C[]; -extern char D_801DC850[]; -extern char D_801DC864[]; -extern char D_801DC878[]; -extern char D_801DC88C[]; -extern char D_801DC8A0[]; -extern char D_801DC8B4[]; -extern char D_801DC8C8[]; -extern char D_801DC8DC[]; -extern char D_801DC8F0[]; -extern char D_801DC900[]; -extern char D_801DC910[]; -extern char D_801DC920[]; -extern char D_801DC930[]; -extern char D_801DC940[]; -extern char D_801DC950[]; -extern char D_801DC960[]; -extern char D_801DC970[]; -extern char D_801DC984[]; -extern char D_801DC998[]; -// extern UNK_TYPE1 D_801DC9AC; -// extern UNK_TYPE1 D_801DC9B0; -// extern UNK_TYPE1 D_801DC9B4; -extern char D_801DC9D0[]; -extern char D_801DC9D8[]; -extern char D_801DC9F8[]; -extern char D_801DCA10[]; -extern f32 D_801DCA14; -extern f32 D_801DCA18; -extern f32 D_801DCA1C; -extern f32 D_801DCA20; -extern f32 D_801DCA24; -extern f32 D_801DCA28; -extern f32 D_801DCA2C; -extern f32 D_801DCA30; -extern f32 D_801DCA34; -extern f32 D_801DCA38; -extern f32 D_801DCA3C; -extern f32 D_801DCA40; -extern f32 D_801DCA44; -extern f32 D_801DCA48; -extern f32 D_801DCA4C; -extern f32 D_801DCA50; -extern f32 D_801DCA54; -extern f32 D_801DCA6C; -extern f32 D_801DCA70; -extern f32 D_801DCA74; -extern f32 D_801DCA78; -extern f32 D_801DCA7C; -extern f32 D_801DCA80; -extern f32 D_801DCA84; -extern f32 D_801DCA88; -extern f32 D_801DCA8C; -extern f32 D_801DCA90; -extern f32 D_801DCA94; -extern f32 D_801DCA98; -extern f32 D_801DCA9C; -extern f32 D_801DCAA0; -extern f32 D_801DCAA4; -extern f32 D_801DCAA8; -extern f32 D_801DCAAC; -extern f32 D_801DCAB0; -extern f32 D_801DCAB4; -extern f32 D_801DCAB8; -extern f32 D_801DCABC; -extern f32 D_801DCAC0; -extern f32 D_801DCAC4; -extern f32 D_801DCAC8; -extern f32 D_801DCACC; -extern f32 D_801DCAD0; -extern f32 D_801DCAD4; -extern f32 D_801DCAD8; -extern f32 D_801DCADC; -extern f32 D_801DCAE0; -extern f32 D_801DCB68; -extern f32 D_801DCB6C; -extern f32 D_801DCB70; -extern f32 D_801DCB74; -extern f32 D_801DCB78; -extern f32 D_801DCB7C; -extern f32 D_801DCB80; -extern f32 D_801DCB84; -extern f32 D_801DCB88; -extern f32 D_801DCB8C; -extern f32 D_801DCB90; -extern f32 D_801DCB94; -extern f32 D_801DCB98; -extern f32 D_801DCB9C; -extern f32 D_801DCBA0; -extern f32 D_801DCBA4; -extern f32 D_801DCBA8; -extern f32 D_801DCBAC; -extern char D_801DCBB0[]; -extern char D_801DCBC4[]; -extern char D_801DCBE4[]; -// extern UNK_TYPE1 D_801DCBFC; -extern char D_801DCC00[]; -extern char D_801DCC10[]; -extern char D_801DCC20[]; -extern char D_801DCC64[]; -extern char D_801DCC94[]; -extern char D_801DCCB8[]; -extern char D_801DCCC8[]; -extern char D_801DCCE8[]; -extern char D_801DCCF8[]; -extern char D_801DCD18[]; -extern f32 D_801DCD28; -extern f32 D_801DCD2C; -extern f32 D_801DCD30; -extern f32 D_801DCD34; -extern f32 D_801DCD38; -extern f32 D_801DCD3C; -extern f32 D_801DCD40; -extern f32 D_801DCD44; -extern f32 D_801DCD48; -extern f32 D_801DCD4C; -extern f32 D_801DCD50; -extern f32 D_801DCD54; -extern f32 D_801DCD58; -extern f32 D_801DCD5C; -extern f32 D_801DCD60; -extern f32 D_801DCD64; -extern f32 D_801DCD68; -extern f32 D_801DCD6C; -extern f32 D_801DCD70; -extern f32 D_801DCD74; -extern f32 D_801DCD78; -extern f32 D_801DCD7C; -extern f32 D_801DCD80; -extern f32 D_801DCD84; -extern f32 D_801DCD88; -extern f32 D_801DCD8C; -extern f32 D_801DCD90; -extern f32 D_801DCD94; -extern f32 D_801DCD98; -extern f32 D_801DCD9C; -extern f32 D_801DCDA0; -extern f32 D_801DCDA4; -extern f32 D_801DCDB0; -extern f32 D_801DCDB4; -extern f32 D_801DCDC0; -extern f32 D_801DCDC4; -extern f32 D_801DCDC8; -extern f32 D_801DCDCC; -extern f32 D_801DCDD0; -extern f32 D_801DCDD4; -extern f32 D_801DCDD8; -extern f32 D_801DCDE4; -extern f32 D_801DCDE8; -extern f32 D_801DCDEC; -extern f32 D_801DCDF0; -extern f32 D_801DCDF4; -extern f32 D_801DCDF8; -extern f32 D_801DCDFC; -extern f32 D_801DCE00; -extern f32 D_801DCE04; -extern f32 D_801DCE08; -extern f32 D_801DCE0C; -extern f32 D_801DCE10; -extern f32 D_801DCE14; -extern f32 D_801DCE18; -extern f32 D_801DCE1C; -extern f32 D_801DCE20; -extern f32 D_801DCE24; -extern f32 D_801DCE28; -extern f32 D_801DCE2C; -extern f32 D_801DCE30; -extern f32 D_801DCE34; -extern f32 D_801DCE38; -extern f32 D_801DCE3C; -extern f32 D_801DCE40; -extern f32 D_801DCE44; -extern f32 D_801DCE48; -extern f32 D_801DCE4C; -extern f32 D_801DCE50; -extern f32 D_801DCE54; -extern f32 D_801DCE58; -extern f32 D_801DCE5C; -extern f32 D_801DCE60; -extern f32 D_801DCE64; -extern f32 D_801DCE68; -extern f32 D_801DCE6C; -extern f32 D_801DCE70; -extern f32 D_801DCE74; -extern f32 D_801DCE78; -extern f32 D_801DCE7C; -extern f32 D_801DCE80; -extern f32 D_801DCE84; -extern f32 D_801DCE88; -extern f32 D_801DCE8C; -extern f32 D_801DCE90; -extern f32 D_801DCE94; -extern f32 D_801DCE98; -extern f32 D_801DCE9C; -extern f32 D_801DCEA0; -extern f32 D_801DCEA4; -extern f32 D_801DCEA8; -extern f32 D_801DCEAC; -extern f32 D_801DCEB0; -extern f32 D_801DCEB4; -extern f32 D_801DCEB8; -extern f32 D_801DCEBC; -extern f32 D_801DCEC0; -extern f32 D_801DCEC4; -extern f32 D_801DCEC8; -extern f32 D_801DCECC; -extern f32 D_801DCED0; -extern f32 D_801DCED4; -extern f32 D_801DCED8; -extern f32 D_801DCEDC; -extern f32 D_801DCEE0; -extern f32 D_801DCEE4; -extern f32 D_801DCEE8; -extern f32 D_801DCEEC; -extern f32 D_801DCEF0; -extern f32 D_801DCEF4; -extern f32 D_801DCEF8; -extern f32 D_801DCEFC; -extern f32 D_801DCF00; -extern f32 D_801DCF04; -extern f32 D_801DCF08; -extern f32 D_801DCF0C; -extern f32 D_801DCF10; -extern f32 D_801DCF14; -extern f32 D_801DCF18; -extern f32 D_801DCF1C; -extern f32 D_801DCF34; -extern f32 D_801DCF38; -extern f32 D_801DCF3C; -extern f32 D_801DCF40; -extern f32 D_801DCF44; -extern f32 D_801DCF48; -extern f32 D_801DCF4C; -extern f32 D_801DCF50; -extern f32 D_801DCF54; -extern f32 D_801DCF58; -extern f32 D_801DCF5C; -extern f32 D_801DCF60; -extern f32 D_801DCF64; -extern f32 D_801DCF68; -extern f32 D_801DCF6C; -extern f32 D_801DCF70; -extern f32 D_801DCF74; -extern f32 D_801DCF78; -extern f32 D_801DCF7C; -extern f32 D_801DCF80; -extern f32 D_801DCF84; -extern f32 D_801DCF8C; -extern f32 D_801DCF90; -extern f32 D_801DCF98; -extern f32 D_801DCF9C; -extern f32 D_801DCFA0; -extern f32 D_801DCFA4; -extern f32 D_801DCFA8; -extern f32 D_801DCFAC; -extern f32 D_801DCFB0; -extern f32 D_801DCFB8; -extern f32 D_801DCFBC; -extern f32 D_801DCFC0; -extern f32 D_801DCFC4; -extern f32 D_801DCFC8; -extern f32 D_801DCFCC; -extern f32 D_801DCFD0; -extern f32 D_801DCFD4; -extern f32 D_801DD00C; -extern f32 D_801DD010; -extern f32 D_801DD014; -extern f32 D_801DD018; -extern f32 D_801DD01C; -extern f32 D_801DD020; -extern f32 D_801DD024; -extern f32 D_801DD028; -extern f32 D_801DD02C; -extern f32 D_801DD030; -extern f32 D_801DD034; -extern f32 D_801DD038; -extern f32 D_801DD03C; -extern f32 D_801DD040; -extern f32 D_801DD044; -extern f32 D_801DD048; -extern f32 D_801DD04C; -extern f32 D_801DD050; -extern f32 D_801DD054; -extern f32 D_801DD058; -extern f32 D_801DD060; -extern f32 D_801DD064; -extern f32 D_801DD068; -extern f32 D_801DD06C; -extern f32 D_801DD070; -extern f32 D_801DD074; -extern f32 D_801DD078; -extern f32 D_801DD07C; -extern f32 D_801DD080; -extern f32 D_801DD084; -extern f32 D_801DD088; -extern f32 D_801DD08C; -extern f32 D_801DD090; -extern f32 D_801DD094; -extern f32 D_801DD098; -extern f32 D_801DD09C; -extern f32 D_801DD0A0; -extern f32 D_801DD0A4; -extern f32 D_801DD0A8; -extern f32 D_801DD0AC; -extern f32 D_801DD0B0; -extern f32 D_801DD0B4; -extern f32 D_801DD0B8; -extern f32 D_801DD0BC; -extern f32 D_801DD0C0; -extern f32 D_801DD0C4; -extern f32 D_801DD0C8; -extern f32 D_801DD0CC; -extern f32 D_801DD0D0; -extern f32 D_801DD0D4; -extern f32 D_801DD0D8; -extern f32 D_801DD0DC; -extern f32 D_801DD0E0; -extern f32 D_801DD0E4; -extern f32 D_801DD0E8; -extern f32 D_801DD0EC; -extern f32 D_801DD0F0; -extern f32 D_801DD0F4; -extern f32 D_801DD0F8; -extern f32 D_801DD0FC; -extern f32 D_801DD100; -extern f32 D_801DD104; -extern f32 D_801DD108; -extern f32 D_801DD10C; -extern f32 D_801DD110; -extern f32 D_801DD114; -extern f32 D_801DD118; -extern f32 D_801DD11C; -extern f32 D_801DD120; -extern f32 D_801DD124; -extern f32 D_801DD128; -extern f32 D_801DD12C; -extern f32 D_801DD130; -extern f32 D_801DD134; -extern f32 D_801DD138; -extern f32 D_801DD13C; -extern f32 D_801DD140; -extern f32 D_801DD144; -extern f32 D_801DD148; -extern f32 D_801DD14C; -extern f32 D_801DD150; -extern f32 D_801DD154; -extern f32 D_801DD158; -extern f32 D_801DD15C; -extern f32 D_801DD160; -extern f32 D_801DD164; -extern f32 D_801DD168; -extern f32 D_801DD16C; -extern f32 D_801DD170; -extern f32 D_801DD174; -extern f32 D_801DD178; -extern f32 D_801DD1B0; -extern f32 D_801DD1B4; -extern f32 D_801DD1B8; -extern f32 D_801DD1BC; -extern f32 D_801DD1C0; -extern f32 D_801DD1C4; -extern f32 D_801DD1C8; -extern f32 D_801DD1CC; -extern f32 D_801DD1D0; -extern f32 D_801DD1D4; -extern f32 D_801DD1D8; -extern f32 D_801DD1DC; -extern f32 D_801DD1E0; -extern f32 D_801DD1E4; -extern f32 D_801DD1E8; -extern f32 D_801DD1EC; -extern f32 D_801DD1F0; -extern f32 D_801DD1F4; -extern f32 D_801DD1F8; -extern f32 D_801DD1FC; -extern f32 D_801DD200; -extern f32 D_801DD204; -extern f32 D_801DD208; -extern f32 D_801DD20C; -extern f32 D_801DD210; -extern f32 D_801DD214; -extern f32 D_801DD218; -extern f32 D_801DD21C; -extern f32 D_801DD220; -extern f32 D_801DD224; -extern f32 D_801DD228; -extern f32 D_801DD22C; -extern f32 D_801DD230; -extern f32 D_801DD234; -extern f32 D_801DD238; -extern f32 D_801DD23C; -extern f32 D_801DD240; -extern f32 D_801DD244; -extern f32 D_801DD248; -extern f32 D_801DD24C; -extern f32 D_801DD250; -extern f32 D_801DD254; -extern f32 D_801DD258; -extern f32 D_801DD25C; -extern f32 D_801DD260; -extern f32 D_801DD264; -extern f32 D_801DD268; -extern f32 D_801DD26C; -extern f32 D_801DD270; -extern f32 D_801DD274; -extern f32 D_801DD278; -extern f32 D_801DD27C; -extern f32 D_801DD2A0; -extern f32 D_801DD2A4; -extern f32 D_801DD2A8; -extern f32 D_801DD2AC; -extern f32 D_801DD2B0; -extern f32 D_801DD2B4; -extern f32 D_801DD2B8; -extern f32 D_801DD2BC; -extern f32 D_801DD2C0; -extern f32 D_801DD2C4; -extern f32 D_801DD344; -extern f32 D_801DD348; -extern f32 D_801DD34C; -extern f32 D_801DD350; -extern f32 D_801DD354; -extern f32 D_801DD358; -extern f32 D_801DD35C; -extern f32 D_801DD360; -extern f32 D_801DD364; -extern f32 D_801DD368; -extern f32 D_801DD36C; -extern f32 D_801DD370; -extern f32 D_801DD374; -extern f32 D_801DD38C; -extern f32 D_801DD390; -extern f32 D_801DD394; -extern f32 D_801DD398; -extern f32 D_801DD39C; -extern f32 D_801DD3A0; -extern f32 D_801DD3A4; -extern f32 D_801DD3A8; -extern f32 D_801DD3AC; -extern f32 D_801DD3B0; -extern f32 D_801DD3B4; -extern f32 D_801DD3B8; -extern f32 D_801DD3BC; -extern f32 D_801DD3C0; -extern f32 D_801DD3C4; -extern f32 D_801DD3C8; -extern f32 D_801DD3CC; -extern f32 D_801DD3D0; -extern f32 D_801DD3D4; -extern f32 D_801DD3D8; -extern f32 D_801DD3DC; -extern f32 D_801DD3E0; -extern f32 D_801DD3E4; -extern f32 D_801DD3E8; -extern f32 D_801DD3EC; -extern f32 D_801DD3F0; -extern f32 D_801DD3F4; -extern f32 D_801DD3F8; -extern f32 D_801DD3FC; -extern f32 D_801DD400; -extern f32 D_801DD404; -extern f32 D_801DD408; -extern f32 D_801DD40C; -extern f32 D_801DD410; -extern f32 D_801DD414; -extern f32 D_801DD418; -extern f32 D_801DD41C; -extern f32 D_801DD420; -extern f32 D_801DD424; -extern f32 D_801DD43C; -extern f32 D_801DD440; -extern f32 D_801DD444; -extern f32 D_801DD448; -extern f32 D_801DD44C; -extern f32 D_801DD450; -extern f32 D_801DD454; -extern f32 D_801DD458; -extern f32 D_801DD45C; -extern f32 D_801DD460; -extern f32 D_801DD5AC; -extern f32 D_801DD5B0; -extern f32 D_801DD5C0; -extern f32 D_801DD5C4; -extern f32 D_801DD5C8; -extern f32 D_801DD5CC; -extern f32 D_801DD5D0; -extern f32 D_801DD5D4; -extern f32 D_801DD5D8; -extern f32 minCylinderIntersectAmount; -extern f32 D_801DD5E0; -extern f32 D_801DD5E4; -extern f32 D_801DD5E8; -extern f32 D_801DD5EC; -extern f32 D_801DD5F0; -extern f32 D_801DD5F4; -extern f32 D_801DD5F8; -extern f32 D_801DD5FC; -extern char D_801DD600[]; -extern char D_801DD604[]; -extern f32 D_801DD6FC; -extern f32 D_801DD770; -extern f32 D_801DD774; -extern f32 D_801DD780; -extern f32 D_801DD7B0; -extern f32 D_801DD7C0; -// extern UNK_TYPE2 D_801DD880; -// extern UNK_TYPE1 D_801DD8E0; -// extern UNK_TYPE4 D_801DD900; -extern f32 D_801DD940; -extern f32 D_801DD944; -extern f32 D_801DD948; -extern f32 D_801DD94C; -extern f32 D_801DD950; -extern f32 D_801DD954; -extern f32 D_801DD958; -extern f32 D_801DD95C; -extern f32 D_801DD960; -extern f32 D_801DD964; -extern f32 D_801DD968; -extern f32 D_801DD96C; -extern f32 D_801DD970; -extern f32 D_801DD974; -extern f32 D_801DD978; -extern f32 D_801DD97C; -extern f32 D_801DD980; -extern f32 D_801DD984; -extern f32 D_801DD988; -extern f32 D_801DD98C; -extern f32 D_801DD990; -extern f32 D_801DD9EC; -extern f32 D_801DD9F0; -extern f32 D_801DD9F4; -extern f32 D_801DD9F8; -extern f32 D_801DD9FC; -extern f32 D_801DDA7C; -extern f32 D_801DDA80; -extern f32 D_801DDA84; -extern f32 D_801DDA90; -extern f32 D_801DDA94; -extern f32 D_801DDA98; -extern f32 D_801DDA9C; -extern f32 D_801DDAA0; -extern f32 D_801DDAB0; -extern f32 D_801DDAB4; -extern const f32 D_801DDAB8; -extern f32 D_801DDAC0; -extern f32 D_801DDAC4; -extern f32 D_801DDAC8; -extern f32 D_801DDACC; -extern f32 D_801DDAD0; -extern f32 D_801DDAD4; -extern f32 D_801DDAD8; -extern f32 D_801DDADC; -extern f32 D_801DDAE0; -extern f32 D_801DDAE4; -extern f32 D_801DDAE8; -extern f32 D_801DDAEC; -extern f32 D_801DDAF0; -extern f32 D_801DDAF4; -extern f32 D_801DDAF8; -extern f32 D_801DDAFC; -extern f32 D_801DDBA8; -extern f32 D_801DDBAC; -extern f32 D_801DDBB0; -extern f32 D_801DDBB4; -extern f32 D_801DDBB8; -extern f32 D_801DDBBC; -extern f32 D_801DDBC0; -extern f32 D_801DDBC4; -extern f32 D_801DDBC8; -extern f32 D_801DDBCC; -extern f32 D_801DDCF8; -extern f32 D_801DDCFC; -extern f32 D_801DDD00; -extern f32 D_801DDD04; -extern f32 D_801DDD08; -extern f32 D_801DDD0C; -extern f32 D_801DDD10; -extern f32 D_801DDD14; -extern f32 D_801DDD20; -extern f32 D_801DDD24; -extern f32 D_801DDD28; -extern f32 D_801DDD2C; -extern f32 D_801DDD30; -extern f32 D_801DDD34; -extern f32 D_801DDD38; -extern f32 D_801DDD3C; -extern f32 D_801DDD40; -extern f32 D_801DDD44; -extern f32 D_801DDD48; -extern f32 D_801DDD4C; -extern f32 D_801DDD50; -extern f32 D_801DDD54; -extern f32 D_801DDD58; -extern f32 D_801DDD5C; -extern f32 D_801DDD60; -extern f32 D_801DDD64; -extern f32 D_801DDD68; -extern f32 D_801DDD6C; -extern f32 D_801DDD70; -extern f32 D_801DDD74; -extern f32 D_801DDD78; -extern f32 D_801DDD7C; -extern f32 D_801DDD80; -extern f32 D_801DDD84; -extern f32 D_801DDD88; -extern f32 D_801DDD8C; -extern f32 D_801DDD90; -extern f32 D_801DDD94; -extern f32 D_801DDD98; -extern f32 D_801DDD9C; -extern f32 D_801DDDA0; -extern f32 D_801DDDA4; -extern f32 D_801DDDA8; -extern f32 D_801DDDAC; -extern f32 D_801DDDB0; -extern f32 D_801DDDB4; -extern f32 D_801DDDB8; -extern f32 D_801DDDBC; -extern f32 D_801DDDC0; -extern f32 D_801DDDC4; -extern f32 D_801DDDC8; -extern f32 D_801DDDCC; -extern f32 D_801DDDD0; -extern f32 D_801DDDD4; -extern f32 D_801DDDD8; -extern f32 D_801DDDDC; -extern f32 D_801DDDE0; -extern f32 D_801DDDE4; -extern f32 D_801DDDE8; -extern f32 D_801DDDEC; -extern f32 D_801DDDF0; -extern f32 D_801DDDF4; -extern f32 D_801DDDF8; -extern f32 D_801DDDFC; -extern f32 D_801DDE00; -extern f32 D_801DDE04; -extern f32 D_801DDE90; -extern f32 D_801DDE94; -extern f32 D_801DDE98; -extern f32 D_801DDE9C; -extern f32 D_801DDEA0; -extern f32 D_801DDEA4; -extern f32 D_801DDEA8; -extern f32 D_801DDEAC; -extern f32 D_801DDEB0; -extern f32 D_801DDEB4; -extern f32 D_801DDEB8; -extern f32 D_801DDEBC; -extern f32 D_801DDEC0; -extern f32 D_801DDEC4; -extern f32 D_801DDEC8; -extern f32 D_801DDECC; -extern f32 D_801DDED0; -extern f32 D_801DDED4; -extern f32 D_801DDED8; -extern f32 D_801DDEDC; -extern f32 D_801DDEE0; -extern f32 D_801DDEE4; -extern f32 D_801DDEE8; -extern f32 D_801DDEEC; -extern f32 D_801DDEF0; -extern f32 D_801DDEF4; -extern f32 D_801DDEF8; -extern f32 D_801DDEFC; -extern f32 D_801DDF00; -extern f32 D_801DDF04; -extern f32 D_801DDF08; -extern f32 D_801DDF0C; -extern f32 D_801DDF10; -extern f32 D_801DDF14; -extern f32 D_801DDF18; -extern f32 D_801DDF1C; -extern f32 D_801DDF20; -extern f32 D_801DDF24; -extern f32 D_801DDF28; -extern f32 D_801DDF2C; -extern f32 D_801DDF30; -extern f32 D_801DDF34; -extern f32 D_801DDF38; -extern f32 D_801DDF3C; -extern f32 D_801DDF40; -extern f32 D_801DDF44; -extern f32 D_801DDF48; -extern f32 D_801DDF4C; -extern f32 D_801DDF50; -extern f32 D_801DDF54; -extern f32 D_801DDF58; -extern f32 D_801DDF5C; -extern f32 D_801DDF60; -extern f32 D_801DDF64; -extern f32 D_801DDF68; -extern f32 D_801DDF6C; -extern f32 D_801DDF70; -extern f32 D_801DDF74; -extern f32 D_801DDF78; -extern f32 D_801DDF7C; -extern f32 D_801DDF80; -extern f32 D_801DDF84; -extern f32 D_801DDF88; -extern f32 D_801DDF8C; -extern f32 D_801DDF90; -extern f32 D_801DDF94; -extern char D_801DDFA0[]; -extern char D_801DDFAC[]; -extern char D_801DDFB8[]; -extern f32 D_801DDFC4; -extern f32 D_801DDFC8; -extern f32 D_801DDFCC; -extern f32 D_801DDFD0; -extern f32 D_801DDFD4; -extern f32 D_801DDFD8; -extern f32 D_801DDFDC; -extern f32 D_801DDFE0; -extern f32 D_801DDFE4; -extern char D_801DE020[]; -extern char D_801DE030[]; -extern char D_801DE03C[]; -extern char D_801DE04C[]; -extern char D_801DE058[]; -extern char D_801DE064[]; -extern char D_801DE074[]; -extern char D_801DE084[]; -extern char D_801DE094[]; -extern char D_801DE0A0[]; -extern char D_801DE0A8[]; -extern char D_801DE0B4[]; -extern char D_801DE0C0[]; -extern char D_801DE0CC[]; -extern char D_801DE0D8[]; -extern char D_801DE0E4[]; -extern char D_801DE0F0[]; -extern char D_801DE0FC[]; -extern char D_801DE10C[]; -extern char D_801DE118[]; -extern char D_801DE12C[]; -extern char D_801DE138[]; -extern char D_801DE144[]; -extern char D_801DE154[]; -extern char D_801DE164[]; -extern char D_801DE170[]; -extern char D_801DE180[]; -extern char D_801DE18C[]; -extern char D_801DE19C[]; -extern char D_801DE1A8[]; -extern char D_801DE1B8[]; -extern char D_801DE1C4[]; -extern char D_801DE1D0[]; -extern char D_801DE1E0[]; -extern char D_801DE1F0[]; -extern char D_801DE200[]; -extern char D_801DE20C[]; -extern char D_801DE21C[]; -extern char D_801DE22C[]; -extern char D_801DE234[]; -extern char D_801DE244[]; -extern char D_801DE258[]; -extern char D_801DE268[]; -extern char D_801DE278[]; -extern char D_801DE280[]; -extern char D_801DE290[]; -extern char D_801DE29C[]; -extern char D_801DE2A8[]; -extern char D_801DE2B8[]; -extern char D_801DE2C4[]; -extern char D_801DE2D4[]; -extern char D_801DE2E4[]; -extern char D_801DE2F4[]; -extern char D_801DE304[]; -extern char D_801DE314[]; -extern char D_801DE320[]; -extern char D_801DE328[]; -extern char D_801DE330[]; -extern char D_801DE340[]; -extern char D_801DE350[]; -extern char D_801DE360[]; -extern char D_801DE370[]; -extern char D_801DE384[]; -extern char D_801DE38C[]; -extern char D_801DE398[]; -extern char D_801DE3A4[]; -extern char D_801DE3B0[]; -extern char D_801DE3C4[]; -extern char D_801DE3D4[]; -extern char D_801DE3E0[]; -extern char D_801DE3F4[]; -extern char D_801DE400[]; -extern char D_801DE40C[]; -extern char D_801DE418[]; -extern char D_801DE424[]; -extern char D_801DE434[]; -extern char D_801DE444[]; -extern char D_801DE450[]; -extern char D_801DE458[]; -extern char D_801DE460[]; -extern char D_801DE478[]; -extern char D_801DE48C[]; -extern char D_801DE49C[]; -extern char D_801DE4AC[]; -extern char D_801DE4BC[]; -extern char D_801DE4C8[]; -extern char D_801DE4D4[]; -extern char D_801DE4E0[]; -extern char D_801DE4F0[]; -extern char D_801DE500[]; -extern char D_801DE510[]; -extern char D_801DE520[]; -extern char D_801DE530[]; -extern char D_801DE53C[]; -extern char D_801DE548[]; -extern char D_801DE558[]; -extern char D_801DE568[]; -extern char D_801DE578[]; -extern char D_801DE580[]; -extern char D_801DE58C[]; -extern char D_801DE598[]; -extern char D_801DE5A8[]; -extern f32 D_801DE5C0; -extern f32 D_801DE5D0; -// extern UNK_TYPE1 D_801DE5E0; -extern f32 D_801DE820; -extern f32 D_801DE824; -extern f32 D_801DE828; -extern f32 D_801DE82C; -extern f32 D_801DE830; -extern f32 D_801DE834; -extern f32 D_801DE838; -extern f32 D_801DE83C; -extern f32 D_801DE840; -extern f32 D_801DE844; -extern f32 D_801DE848; -extern f32 D_801DE84C; -extern f32 D_801DE850; -extern f32 D_801DE854; -extern f32 D_801DE858; -extern f32 D_801DE85C; -extern f32 D_801DE860; -extern f32 D_801DE864; -extern f32 D_801DE868; -extern f32 D_801DE884; extern TexturePtr gCircleTex[]; -extern f32 D_801DF090; -extern f32 D_801DF094; -extern f32 D_801DF0A0; -extern char D_801DF0B0[]; -// extern UNK_TYPE1 D_801DF0C0; -extern f32 D_801DF120; -extern f32 D_801DF124; -extern f32 D_801DF148; -extern f32 D_801DF3AC; -extern f32 D_801DF3B0; -extern f32 D_801DF3B4; -extern f32 D_801DF3B8; -extern f32 D_801DF3BC; -extern f32 D_801DF3C0; -extern f32 D_801DF3C4; -extern f32 D_801DF3C8; -extern UNK_PTR D_801DF83C; -extern f32 D_801DF8E0; -extern f32 D_801DF970; -extern f32 D_801DF974; -extern f32 D_801DF978; -extern f32 D_801DF97C; -extern f32 D_801DF980; -extern f32 D_801DF984; -extern f32 D_801DF988; -extern f32 D_801DF98C; -extern f32 D_801DF990; -extern f32 D_801DF994; -extern f32 D_801DF998; -extern f32 D_801DF99C; -extern f32 D_801DF9A0; -extern f32 D_801DF9A4; -extern f32 D_801DF9A8; -extern f32 D_801DF9AC; -extern f32 D_801DF9B0; -extern f32 D_801DF9B4; -extern char D_801DF9C0[]; -extern char D_801DF9D0[]; -extern f32 D_801DF9E0; -extern f32 D_801DF9E4; -extern f32 D_801DF9E8; -extern f32 D_801DF9EC; -extern f32 D_801DF9F0; -extern f32 D_801DF9F4; -extern f32 D_801DF9F8; -extern char D_801DFA00[]; -extern char D_801DFA0C[]; -extern f32 D_801DFC3C; -extern f32 D_801DFC40; -extern f32 D_801DFC44; -extern f32 D_801DFC50; -extern f32 D_801DFC54; -extern f32 D_801DFC58; -extern f32 D_801DFC5C; -extern char D_801DFC60[]; -extern u8 D_801DFC70[7]; -// extern UNK_TYPE1 D_801DFC77; -extern char D_801DFC80[]; -extern char D_801DFC9C[]; -extern char D_801DFCC0[]; -extern char D_801DFCCC[]; -extern char D_801DFCE0[]; -extern char D_801DFCFC[]; -extern char D_801DFD10[]; -extern char D_801DFD2C[]; -extern char D_801DFD40[]; -extern char D_801DFD50[]; -extern char D_801DFD5C[]; -extern char schedThreadName[]; -extern char audioThreadName[]; -extern char padmgrThreadName[]; -extern char graphThreadName[]; -extern char D_801DFD90[]; -extern char D_801DFD9C[]; -extern char D_801DFDA8[]; -extern char D_801DFDE0[]; -extern char D_801DFDFC[]; -extern char D_801DFE18[]; -extern char D_801DFE48[]; -extern char D_801DFE6C[]; -extern char D_801DFE8C[]; -// extern UNK_TYPE1 D_801DFEC0; -extern char D_801DFEF0[]; -extern char D_801DFF0C[]; -extern char D_801DFF28[]; -extern char D_801DFF58[]; -extern char D_801DFF7C[]; -// extern UNK_TYPE1 D_801DFF9C; -// extern UNK_TYPE1 D_801DFFCC; -// extern UNK_TYPE1 D_801DFFE0; -// extern UNK_TYPE1 D_801E0000; -extern char D_801E0038[]; -extern char D_801E0060[]; -extern char D_801E0088[]; -extern char D_801E0094[]; -extern char D_801E00A8[]; -extern char D_801E00BC[]; -extern char D_801E00E8[]; -extern f32 D_801E0120; -extern f32 D_801E0124; -extern f32 D_801E0128; -extern f32 D_801E012C; -extern f32 Math3D_Normalize_min_length; -extern f32 D_801E0134; -extern f32 D_801E0138; -extern f32 D_801E013C; -extern f32 D_801E0140; -extern f32 Math3D_AngleBetweenVectors_min_length; -extern f32 D_801E0148; -extern f32 D_801E014C; -extern f32 Math3D_UnitNormalVector_min_length; -extern f32 Math3D_NormalizedDistanceFromPlane_min_length; -extern f32 D_801E0158; -extern f32 D_801E015C; -extern f32 D_801E0160; -extern f32 D_801E0164; -extern f32 D_801E0168; -extern f32 D_801E016C; -extern f32 D_801E0170; -extern f32 D_801E0174; -extern f32 D_801E0178; -extern f32 D_801E017C; -extern f32 D_801E0180; -extern f32 D_801E0184; -extern f32 D_801E0188; -extern f32 D_801E018C; -extern f32 D_801E0190; -extern f32 D_801E0194; -extern f32 D_801E0198; -extern f32 D_801E019C; -extern f32 D_801E01A0; -extern f32 D_801E01A4; -extern f32 D_801E01A8; -extern f32 D_801E01AC; -extern f32 D_801E01B0; -extern f32 D_801E01B4; -extern f32 D_801E01B8; -extern f32 D_801E01BC; -extern f32 D_801E01C0; -extern f32 D_801E01C4; -extern f32 Math3D_ColSphereSphereIntersectAndDistance_min_intersect; -extern f32 D_801E01CC; -extern f32 D_801E01D0; -extern f32 D_801E01D4; -extern f32 D_801E01F0; -extern f32 D_801E01F4; -extern f32 D_801E01F8; -extern f32 D_801E0200; -extern f32 D_801E0204; -extern f32 D_801E0208; -extern f32 D_801E020C; -extern f32 D_801E0210; -extern f32 D_801E0214; -extern f32 D_801E0218; -extern f32 D_801E021C; -extern f32 D_801E0220; -extern f32 D_801E0224; -extern f32 D_801E0228; -extern char D_801E0230[]; -extern char D_801E0238[]; -extern char D_801E023C[]; -extern char D_801E0240[]; -extern char D_801E0248[]; -extern char D_801E0250[]; -extern char D_801E0258[]; -extern char D_801E026C[]; -extern f32 D_801E02A0; -extern f32 D_801E02B0; -extern f32 D_801E02B4; -extern f32 D_801E02B8; -extern f32 D_801E02D0; -extern char D_801E0300[]; -extern char D_801E0330[]; -extern char D_801E033C[]; -extern char D_801E0348[]; -extern char D_801E0354[]; -extern f32 D_801E0384; -extern f32 D_801E0388; -extern f32 D_801E038C; -extern f32 D_801E04E0; -extern f32 D_801E04E4; -extern f32 D_801E04E8; -extern f32 D_801E04EC; -extern f32 D_801E04F0; -extern f32 D_801E04F4; -extern f32 D_801E04F8; -extern f32 D_801E04FC; -extern f32 D_801E0500; -extern f32 D_801E0504; -extern f32 D_801E0508; -extern f32 D_801E050C; -extern f32 D_801E0534; -extern f32 D_801E0538; -extern f32 D_801E05B4; -extern f32 D_801E05B8; -extern f32 D_801E05D0; -extern f32 D_801E05D4; + extern const u16 gAudioEnvironmentalSfx[]; -// extern UNK_TYPE1 D_801E0BFC; -extern f32 D_801E0CEC; -extern f32 D_801E0CF0; -extern f32 D_801E0CF4; -extern f32 D_801E0CF8; -extern f32 D_801E0CFC; -extern f32 D_801E0D20; -extern f32 D_801E0D24; -extern f32 D_801E0D28; -extern f32 D_801E0D2C; -extern f32 D_801E0D30; -extern f32 D_801E0D34; -extern f64 D_801E0D58; -extern f32 D_801E0D60; -extern f32 D_801E0D64; -extern f32 D_801E0D68; -extern f32 D_801E0D8C; -extern f32 D_801E0D90; -extern f32 D_801E0D94; -extern f32 D_801E0D98; -extern f32 D_801E0D9C; -extern f32 D_801E0DBC; -extern f32 D_801E0DC0; -extern f32 D_801E0DC4; -extern f32 D_801E0DC8; -extern f32 D_801E0DCC; -extern f32 D_801E0DD0; -extern f32 D_801E0DD4; -extern f64 D_801E0DD8; -extern f64 D_801E0DE0; -extern f32 D_801E0DE8; -extern f32 D_801E0DEC; -extern f32 D_801E0DF0; -extern f32 D_801E0DF4; -extern f32 D_801E0DF8; -extern f32 D_801E0DFC; -extern f32 D_801E0E00; -extern f32 D_801E0E04; -extern f32 D_801E0E08; -extern f32 D_801E0E0C; -extern f32 D_801E0E10; -extern f32 D_801E0E14; -extern f32 D_801E0E18; -extern f32 D_801E0E1C; -extern f32 D_801E0E20; -extern f32 D_801E0E24; -extern f64 D_801E0EB0; -// extern UNK_TYPE4 D_801E1068; -extern UNK_PTR D_801E10B0; extern const s16 gAudioTatumInit[]; extern const AudioHeapInitSizes gAudioHeapInitSizes; -// extern UNK_TYPE4 D_801E1108; -// extern UNK_TYPE4 D_801E110C; extern u8 gSoundFontTable[]; extern u8 gSequenceFontTable[]; extern u8 gSequenceTable[]; extern u8 gSampleBankTable[]; // bss -// extern UNK_TYPE1 D_801ED894; - -// extern UNK_TYPE1 D_801F4E20; -// extern UNK_TYPE1 sBeatingHeartsDDPrim; -// extern UNK_TYPE1 sBeatingHeartsDDEnv; -// extern UNK_TYPE1 sHeartsDDPrim; -// extern UNK_TYPE1 D_801F4F56; -// extern UNK_TYPE1 D_801F4F58; -// extern UNK_TYPE1 D_801F4F5A; -// extern UNK_TYPE1 D_801F4F60; -// extern UNK_TYPE1 D_801F4F66; -// extern UNK_TYPE1 D_801F4F68; -// extern UNK_TYPE1 D_801F4F6A; - -// extern UNK_TYPE1 D_801F5130; -// extern UNK_TYPE1 D_801F5270; -// extern UNK_TYPE1 D_801F528E; -// extern UNK_TYPE1 D_801F53B0; -// extern UNK_TYPE1 D_801F56B0; -// extern UNK_TYPE1 D_801F5730; -// extern UNK_TYPE1 D_801F57B4; -// extern UNK_TYPE1 D_801F5834; - -// extern UNK_TYPE1 sSkyboxDrawMatrix; -// extern UNK_TYPE1 D_801F6AF0; -// extern UNK_TYPE1 D_801F6AF2; -// extern UNK_TYPE4 D_801F6B00; -// extern UNK_TYPE4 D_801F6B04; -// extern UNK_TYPE4 D_801F6B08; - -extern void (*sKaleidoScopeUpdateFunc)(PlayState* play); -extern void (*sKaleidoScopeDrawFunc)(PlayState* play); - extern s32 gTransitionTileState; extern Color_RGBA8_u32 gPlayVisMonoColor; @@ -1437,81 +91,6 @@ extern GfxMasterList* gGfxMasterDL; extern u64* gAudioSPDataPtr; extern u32 gAudioSPDataSize; -extern Vec3f D_801FBBF0; -extern LineSegment Math3D_ColSphereTri_line; -extern Vec3f Math3D_ColSphereTri_point; -// extern UNK_TYPE1 D_801FBC28; -// extern UNK_TYPE1 D_801FBC2C; -// extern UNK_TYPE1 D_801FBC30; -// extern UNK_TYPE1 D_801FBC38; -// extern UNK_TYPE1 D_801FBC3A; -// extern UNK_TYPE1 D_801FBC3C; -// extern UNK_TYPE1 D_801FBC3E; -// extern UNK_TYPE1 D_801FBC40; -// extern UNK_TYPE1 D_801FBC42; -// extern UNK_TYPE1 D_801FBC44; -// extern UNK_TYPE1 D_801FBC46; -// extern UNK_TYPE1 D_801FBC48; -// extern UNK_TYPE1 D_801FBC58; -extern Vec3f Math3D_NormalVector_temp1; -extern Vec3f Math3D_NormalVector_temp2; -extern f32 D_801FBC8C; -extern f32 D_801FBC90; -extern f32 D_801FBC98; -extern f32 D_801FBCA4; -extern f32 D_801FBCAC; -extern f32 D_801FBCB0; -extern f32 D_801FBCB4; -extern f32 D_801FBCB8; -extern f32 D_801FBCBC; -extern f32 D_801FBCC0; -extern f32 D_801FBCC4; -extern f32 D_801FBCC8; -extern f32 D_801FBCCC; -extern f32 D_801FBCD0; -extern f32 D_801FBCD4; -extern f32 D_801FBCD8; -extern f32 D_801FBCDC; -// extern UNK_TYPE1 D_801FBCE0; -// extern UNK_TYPE1 D_801FBCE4; -// extern UNK_TYPE1 D_801FBCE8; -// extern UNK_TYPE1 D_801FBCF0; -// extern UNK_TYPE1 D_801FBCF4; -// extern UNK_TYPE1 D_801FBCF8; -// extern UNK_TYPE1 D_801FBD00; -// extern UNK_TYPE1 D_801FBD04; -// extern UNK_TYPE1 D_801FBD08; -// extern UNK_TYPE1 D_801FBD10; -// extern UNK_TYPE1 D_801FBD20; -// extern UNK_TYPE1 D_801FBD24; -// extern UNK_TYPE1 D_801FBD28; -// extern UNK_TYPE1 D_801FBD30; -// extern UNK_TYPE1 D_801FBD34; -// extern UNK_TYPE1 D_801FBD38; -// extern UNK_TYPE1 D_801FBD40; -// extern UNK_TYPE1 D_801FBD44; -// extern UNK_TYPE1 D_801FBD48; -// extern UNK_TYPE1 D_801FBD50; -// extern UNK_TYPE1 D_801FBD54; -// extern UNK_TYPE1 D_801FBD58; -extern Vec3f Math3D_UnitNormalVector_temp; -// extern UNK_TYPE1 D_801FBD70; -// extern UNK_TYPE1 D_801FBD74; -// extern UNK_TYPE1 D_801FBD78; -extern Vec3f D_801FBD80[2]; -extern Vec3f D_801FBD98; -extern Vec3f D_801FBDA4; -// extern UNK_TYPE1 D_801FBDB0; -// extern UNK_TYPE1 D_801FBDB4; -// extern UNK_TYPE1 D_801FBDB8; -// extern UNK_TYPE1 D_801FBDC0; -// extern UNK_TYPE1 D_801FBDD8; -// extern UNK_TYPE1 D_801FBDDC; -// extern UNK_TYPE1 D_801FBDE0; -extern Vec3f D_801FBDE8; -extern MtxF* sMatrixStack; -extern MtxF* sCurrentMatrix; - extern s32 D_801FD120; extern u8 sResetAudioHeapTimer; diff --git a/include/z64actor.h b/include/z64actor.h index f87ad3ba9e..fee3ffbd0f 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -186,7 +186,7 @@ typedef enum { #define DYNA_INTERACT_ACTOR_ON_SWITCH (1 << 3) // Like the ACTOR_ON_TOP flag but only actors with ACTOR_FLAG_CAN_PRESS_SWITCH #define DYNA_INTERACT_ACTOR_ON_HEAVY_SWITCH (1 << 4) // Like the ACTOR_ON_TOP flag but only actors with ACTOR_FLAG_CAN_PRESS_HEAVY_SWITCH -typedef struct { +typedef struct DynaPolyActor { /* 0x000 */ Actor actor; /* 0x144 */ s32 bgId; /* 0x148 */ f32 pushForce; diff --git a/include/z64bgcheck.h b/include/z64bgcheck.h index 4d75287068..10258e0cdf 100644 --- a/include/z64bgcheck.h +++ b/include/z64bgcheck.h @@ -1,6 +1,10 @@ #ifndef Z64BGCHECK_H #define Z64BGCHECK_H +#include "ultra64.h" + +#include "z64math.h" + struct PlayState; struct Actor; struct DynaPolyActor; @@ -302,7 +306,7 @@ typedef struct { } DynaLookup; // size = 0x8 typedef struct { - /* 0x00 */ Actor* actor; + /* 0x00 */ struct Actor* actor; /* 0x04 */ CollisionHeader* colHeader; /* 0x08 */ DynaLookup dynaLookup; /* 0x10 */ u16 vtxStartIndex; @@ -377,7 +381,7 @@ typedef struct /* 0x20 */ f32 outDistSq; /* 0x24 */ f32 checkDist; /* 0x28 */ s32 bccFlags; - /* 0x2C */ Actor* actor; + /* 0x2C */ struct Actor* actor; } StaticLineTest; // size = 0x30 typedef struct { @@ -392,7 +396,7 @@ typedef struct { /* 0x20 */ s32 checkOneFace; // bccFlags & 0x8 /* 0x24 */ f32* distSq; // distance from posA to poly squared /* 0x28 */ f32 checkDist; // distance from poly - /* 0x2C */ Actor* actor; + /* 0x2C */ struct Actor* actor; /* 0x30 */ s32 bgId; } DynaLineTest; // size = 0x34 @@ -465,40 +469,40 @@ void BgCheck_Allocate(CollisionContext* colCtx, struct PlayState* play, Collisio void BgCheck_SetContextFlags(CollisionContext* colCtx, u32 flags); void BgCheck_UnsetContextFlags(CollisionContext* colCtx, u32 flags); CollisionHeader* BgCheck_GetCollisionHeader(CollisionContext* colCtx, s32 bgId); -f32 BgCheck_RaycastFloorImpl(struct PlayState* play, CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, Vec3f* pos, Actor* actor, u32 arg7, f32 checkDist, s32 arg9); +f32 BgCheck_RaycastFloorImpl(struct PlayState* play, CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, Vec3f* pos, struct Actor* actor, u32 arg7, f32 checkDist, s32 arg9); f32 BgCheck_CameraRaycastFloor1(CollisionContext* colCtx, CollisionPoly** outPoly, Vec3f* pos); f32 BgCheck_EntityRaycastFloor1(CollisionContext* colCtx, CollisionPoly** outPoly, Vec3f* pos); f32 BgCheck_EntityRaycastFloor2(struct PlayState* play, CollisionContext* colCtx, CollisionPoly** outPoly, Vec3f* pos); f32 BgCheck_EntityRaycastFloor2_1(struct PlayState* play, CollisionContext* colCtx, CollisionPoly** outPoly, Vec3f* pos); f32 BgCheck_EntityRaycastFloor3(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor5(CollisionContext* colCtx, CollisionPoly** outPoly, s32* outBgId, Actor* actor, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor5_2(struct PlayState* play, CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor5_3(struct PlayState* play, CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor6(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos, f32 checkDist); -f32 BgCheck_EntityRaycastFloor7(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); +f32 BgCheck_EntityRaycastFloor5(CollisionContext* colCtx, CollisionPoly** outPoly, s32* outBgId, struct Actor* actor, Vec3f* pos); +f32 BgCheck_EntityRaycastFloor5_2(struct PlayState* play, CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, struct Actor* actor, Vec3f* pos); +f32 BgCheck_EntityRaycastFloor5_3(struct PlayState* play, CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, struct Actor* actor, Vec3f* pos); +f32 BgCheck_EntityRaycastFloor6(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, struct Actor* actor, Vec3f* pos, f32 checkDist); +f32 BgCheck_EntityRaycastFloor7(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, struct Actor* actor, Vec3f* pos); f32 BgCheck_AnyRaycastFloor1(CollisionContext* colCtx, CollisionPoly* outPoly, Vec3f* pos); f32 BgCheck_AnyRaycastFloor2(CollisionContext* colCtx, CollisionPoly* outPoly, s32* bgId, Vec3f* pos); f32 BgCheck_CameraRaycastFloor2(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor8(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); +f32 BgCheck_EntityRaycastFloor8(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, struct Actor* actor, Vec3f* pos); f32 BgCheck_EntityRaycastFloor9(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); -s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight, u8 argA); +s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, struct Actor* actor, f32 checkHeight, u8 argA); s32 BgCheck_EntitySphVsWall1(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, f32 checkHeight); s32 BgCheck_EntitySphVsWall2(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, f32 checkHeight); -s32 BgCheck_EntitySphVsWall3(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); -s32 BgCheck_EntitySphVsWall4(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); -s32 BgCheck_CheckCeilingImpl(CollisionContext* colCtx, u16 xpFlags, f32* outY, Vec3f* pos, f32 checkHeight, CollisionPoly** outPoly, s32* outBgId, Actor* actor); +s32 BgCheck_EntitySphVsWall3(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, struct Actor* actor, f32 checkHeight); +s32 BgCheck_EntitySphVsWall4(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, struct Actor* actor, f32 checkHeight); +s32 BgCheck_CheckCeilingImpl(CollisionContext* colCtx, u16 xpFlags, f32* outY, Vec3f* pos, f32 checkHeight, CollisionPoly** outPoly, s32* outBgId, struct Actor* actor); s32 BgCheck_AnyCheckCeiling(CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight); -s32 BgCheck_EntityCheckCeiling(CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight, CollisionPoly** outPoly, s32* outBgId, Actor* actor); +s32 BgCheck_EntityCheckCeiling(CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight, CollisionPoly** outPoly, s32* outBgId, struct Actor* actor); s32 BgCheck_CameraLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkWall, s32 checkFloor, s32 checkCeil, s32 checkOneFace, s32* bgId); s32 BgCheck_CameraLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkWall, s32 checkFloor, s32 checkCeil, s32 checkOneFace, s32* bgId); s32 BgCheck_EntityLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkWall, s32 checkFloor, s32 checkCeil, s32 checkOneFace, s32* bgId); -s32 BgCheck_EntityLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkWall, s32 checkFloor, s32 checkCeil, s32 checkOneFace, s32* bgId, Actor* actor); -s32 BgCheck_EntityLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkWall, s32 checkFloor, s32 checkCeil, s32 checkOneFace, s32* bgId, Actor* actor, f32 checkDist); +s32 BgCheck_EntityLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkWall, s32 checkFloor, s32 checkCeil, s32 checkOneFace, s32* bgId, struct Actor* actor); +s32 BgCheck_EntityLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkWall, s32 checkFloor, s32 checkCeil, s32 checkOneFace, s32* bgId, struct Actor* actor, f32 checkDist); s32 BgCheck_ProjectileLineTest(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkWall, s32 checkFloor, s32 checkCeil, s32 checkOneFace, s32* bgId); s32 BgCheck_AnyLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkOneFace); s32 BgCheck_AnyLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkWall, s32 checkFloor, s32 checkCeil, s32 checkOneFace); s32 BgCheck_AnyLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 checkWall, s32 checkFloor, s32 checkCeil, s32 checkOneFace, s32* bgId); -s32 BgCheck_SphVsFirstPolyImpl(CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, Vec3f* center, f32 radius, Actor* actor, u16 bciFlags); +s32 BgCheck_SphVsFirstPolyImpl(CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, Vec3f* center, f32 radius, struct Actor* actor, u16 bciFlags); s32 BgCheck_SphVsFirstPoly(CollisionContext* colCtx, Vec3f* center, f32 radius); s32 BgCheck_SphVsFirstWall(CollisionContext* colCtx, Vec3f* center, f32 radius); void SSNodeList_Init(SSNodeList* this); @@ -513,7 +517,7 @@ void DynaLookup_Reset(DynaLookup* dynaLookup); void DynaLookup_ResetVtxStartIndex(u16* vtxStartIndex); void DynaLookup_ResetWaterBoxStartIndex(u16* waterBoxStartIndex); void BgActor_Init(struct PlayState* play, BgActor* bgActor); -void BgActor_SetActor(BgActor* bgActor, Actor* actor, CollisionHeader* colHeader); +void BgActor_SetActor(BgActor* bgActor, struct Actor* actor, CollisionHeader* colHeader); s32 BgActor_IsTransformUnchanged(BgActor* bgActor); void DynaPoly_NullPolyList(CollisionPoly** polyList); void DynaPoly_AllocPolyList(struct PlayState* play, CollisionPoly** polyList, s32 numPolys); @@ -525,8 +529,8 @@ void DynaPoly_SetBgActorPrevTransform(struct PlayState* play, BgActor* bgActor); s32 DynaPoly_IsBgIdBgActor(s32 bgId); void DynaPoly_Init(struct PlayState* play, DynaCollisionContext* dyna); void DynaPoly_Alloc(struct PlayState* play, DynaCollisionContext* dyna); -s32 DynaPoly_SetBgActor(struct PlayState* play, DynaCollisionContext* dyna, Actor* actor, CollisionHeader* colHeader); -DynaPolyActor* DynaPoly_GetActor(CollisionContext* colCtx, s32 bgId); +s32 DynaPoly_SetBgActor(struct PlayState* play, DynaCollisionContext* dyna, struct Actor* actor, CollisionHeader* colHeader); +struct DynaPolyActor* DynaPoly_GetActor(CollisionContext* colCtx, s32 bgId); void DynaPoly_DisableCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId); void DynaPoly_EnableCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId); void DynaPoly_DisableCeilingCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId); @@ -537,7 +541,7 @@ void DynaPoly_InvalidateLookup(struct PlayState* play, DynaCollisionContext* dyn void DynaPoly_DeleteBgActor(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId); void BgCheck_CalcWaterboxDimensions(Vec3f* minPos, Vec3f* maxXPos, Vec3f* maxZPos, Vec3s* minPosOut, s16* xLength, s16* zLength); void DynaPoly_AddBgActorToLookup(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId, s32* vtxStartIndex, s32* polyStartIndex, s32* waterBoxStartIndex); -void DynaPoly_UnsetAllInteractFlags(struct PlayState* play, DynaCollisionContext* dyna, Actor* actor); +void DynaPoly_UnsetAllInteractFlags(struct PlayState* play, DynaCollisionContext* dyna, struct Actor* actor); void DynaPoly_UpdateContext(struct PlayState* play, DynaCollisionContext* dyna); void func_800C756C(DynaCollisionContext* dyna, s32* numPolygons, s32* numVertices, s32* numWaterBoxes); void DynaPoly_UpdateBgActorTransforms(struct PlayState* play, DynaCollisionContext* dyna); diff --git a/include/z64bombers_notebook.h b/include/z64bombers_notebook.h index 5b89aaf706..825cf784ff 100644 --- a/include/z64bombers_notebook.h +++ b/include/z64bombers_notebook.h @@ -4,6 +4,8 @@ #include "ultra64.h" #include "z64dma.h" +struct GraphicsContext; +struct Input; struct PlayState; #define DEFINE_PERSON(enum, _photo, _description, _metEnum, _metMessage, _metFlag) enum, @@ -52,7 +54,7 @@ typedef struct { } BombersNotebook; // size = 0xAC void BombersNotebook_Draw(BombersNotebook* this, struct GraphicsContext* gfxCtx); -void BombersNotebook_Update(struct PlayState* play, BombersNotebook* this, Input* input); +void BombersNotebook_Update(struct PlayState* play, BombersNotebook* this, struct Input* input); void BombersNotebook_Init(BombersNotebook* this); void BombersNotebook_Destroy(BombersNotebook* this); diff --git a/include/z64message.h b/include/z64message.h index c70b97a9ee..e0b5f642bd 100644 --- a/include/z64message.h +++ b/include/z64message.h @@ -2,8 +2,11 @@ #define Z64MESSAGE_H #include "PR/ultratypes.h" -#include "z64view.h" +#include "libc/stdbool.h" + #include "unk.h" +#include "z64bombers_notebook.h" +#include "z64view.h" struct Actor; struct MessageTableEntry; @@ -328,7 +331,7 @@ void Message_HandleOcarina(struct PlayState* play); void Message_LoadItemIcon(struct PlayState* play, u16 itemId, s16 arg2); void Message_DecodeHeader(struct PlayState* play); void func_801514B0(struct PlayState* play, u16 arg1, u8 arg2); -void Message_StartTextbox(struct PlayState* play, u16 textId, Actor* actor); +void Message_StartTextbox(struct PlayState* play, u16 textId, struct Actor* actor); void Message_ContinueTextbox(struct PlayState* play, u16 textId); void Message_DisplaySceneTitleCard(struct PlayState* play, u16 textId); void Message_BombersNotebookQueueEvent(struct PlayState* play, u8 event); diff --git a/include/z64speed_meter.h b/include/z64speed_meter.h index 2c2bd9053a..70f7f49938 100644 --- a/include/z64speed_meter.h +++ b/include/z64speed_meter.h @@ -1,13 +1,15 @@ #ifndef Z64SPEED_METER_H #define Z64SPEED_METER_H -#include "ultra64.h" +#include "PR/ultratypes.h" +#include "PR/os_time.h" +#include "unk.h" struct GameState; struct GraphicsContext; typedef struct SpeedMeter { - /* 0x00 */ char unk_00[0x18]; + /* 0x00 */ UNK_TYPE1 unk_00[0x18]; /* 0x18 */ s32 x; // Unused /* 0x1C */ s32 y; } SpeedMeter; // size = 0x20 diff --git a/include/z64voice.h b/include/z64voice.h index 957f20a234..7bf3c94ffd 100644 --- a/include/z64voice.h +++ b/include/z64voice.h @@ -5,6 +5,11 @@ #include "unk.h" #include "PR/os_voice.h" +typedef struct { + /* 0x000 */ u16 words[20][15]; // 20 words, each with up to 15 syllables + /* 0x258 */ u8 numWords; +} OSVoiceDictionary; // size = 0x25C + typedef enum OSVoiceWordId { /* 0 */ VOICE_WORD_ID_HOURS, /* 1 */ VOICE_WORD_ID_CHEESE, diff --git a/src/audio/lib/load.c b/src/audio/lib/load.c index 37a68ff4c7..c3a101102a 100644 --- a/src/audio/lib/load.c +++ b/src/audio/lib/load.c @@ -1263,8 +1263,8 @@ void AudioLoad_Init(void* heap, size_t heapSize) { gAudioCtx.curAiBufferIndex = 0; gAudioCtx.soundMode = SOUNDMODE_STEREO; gAudioCtx.curTask = NULL; - gAudioCtx.rspTask[0].task.t.dataSize = 0; - gAudioCtx.rspTask[1].task.t.dataSize = 0; + gAudioCtx.rspTask[0].task.t.data_size = 0; + gAudioCtx.rspTask[1].task.t.data_size = 0; osCreateMesgQueue(&gAudioCtx.syncDmaQueue, &gAudioCtx.syncDmaMesg, 1); osCreateMesgQueue(&gAudioCtx.curAudioFrameDmaQueue, gAudioCtx.currAudioFrameDmaMesgBuf, diff --git a/src/audio/lib/thread.c b/src/audio/lib/thread.c index e1acb15834..988d1580f2 100644 --- a/src/audio/lib/thread.c +++ b/src/audio/lib/thread.c @@ -168,21 +168,21 @@ AudioTask* AudioThread_UpdateImpl(void) { task = &gAudioCtx.curTask->task.t; task->type = M_AUDTASK; task->flags = 0; - task->ucodeBoot = aspMainTextStart; - task->ucodeBootSize = SP_UCODE_SIZE; - task->ucodeDataSize = ((aspMainDataEnd - aspMainDataStart) * sizeof(u64)) - 1; + task->ucode_boot = aspMainTextStart; + task->ucode_boot_size = SP_UCODE_SIZE; + task->ucode_data_size = ((aspMainDataEnd - aspMainDataStart) * sizeof(u64)) - 1; task->ucode = aspMainTextStart; - task->ucodeData = aspMainDataStart; - task->ucodeSize = SP_UCODE_SIZE; - task->dramStack = (u64*)D_801D6200; - task->dramStackSize = 0; - task->outputBuff = NULL; - task->outputBuffSize = NULL; + task->ucode_data = aspMainDataStart; + task->ucode_size = SP_UCODE_SIZE; + task->dram_stack = (u64*)D_801D6200; + task->dram_stack_size = 0; + task->output_buff = NULL; + task->output_buff_size = NULL; if (1) {} - task->dataPtr = (u64*)gAudioCtx.abiCmdBufs[index]; - task->dataSize = numAbiCmds * sizeof(Acmd); - task->yieldDataPtr = NULL; - task->yieldDataSize = 0; + task->data_ptr = (u64*)gAudioCtx.abiCmdBufs[index]; + task->data_size = numAbiCmds * sizeof(Acmd); + task->yield_data_ptr = NULL; + task->yield_data_size = 0; if (gAudioCtx.numAbiCmdsMax < numAbiCmds) { gAudioCtx.numAbiCmdsMax = numAbiCmds; diff --git a/src/audio/voice_internal.c b/src/audio/voice_internal.c index 3458cd85b1..348d2c215d 100644 --- a/src/audio/voice_internal.c +++ b/src/audio/voice_internal.c @@ -280,7 +280,7 @@ s32 func_801A5808(void) { PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue); if (func_801A51F0(errorCode) == 0) { - switch (gVoiceHandle.status) { + switch (gVoiceHandle.cmd_status) { case VOICE_STATUS_READY: sVoiceContext.mode = VOICE_MODE_2; break; @@ -305,10 +305,10 @@ s32 func_801A5808(void) { case VOICE_MODE_2: if (((D_801FD5C8.warning & sVoiceContext.warning) == 0) && - (sVoiceContext.answerNum >= D_801FD5C8.answerNum) && + (sVoiceContext.answerNum >= D_801FD5C8.answer_num) && (sVoiceContext.distance >= D_801FD5C8.distance[0]) && - (D_801FD5C8.voiceLevel >= sVoiceContext.voiceLevel) && - (D_801FD5C8.voiceRelLevel >= sVoiceContext.voiceRelLevel)) { + (D_801FD5C8.voice_level >= sVoiceContext.voiceLevel) && + (D_801FD5C8.voice_sn >= sVoiceContext.voiceRelLevel)) { D_801FD5E8 = D_801FD5C8; sVoiceContext.data = &D_801FD5E8; } diff --git a/src/boot/CIC6105.c b/src/boot/CIC6105.c index f42edf656f..6d21643ab4 100644 --- a/src/boot/CIC6105.c +++ b/src/boot/CIC6105.c @@ -1,5 +1,6 @@ #include "prevent_bss_reordering.h" #include "CIC6105.h" + #include "build.h" #include "fault.h" diff --git a/src/boot/O2/mtxuty-cvt.c b/src/boot/O2/mtxuty-cvt.c index a5da24522e..f96de806f2 100644 --- a/src/boot/O2/mtxuty-cvt.c +++ b/src/boot/O2/mtxuty-cvt.c @@ -7,9 +7,13 @@ void MtxConv_F2L(Mtx* mtx, MtxF* mf) { for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { s32 value = (mf->mf[i][j] * 0x10000); + struct { + u16 intPart[4][4]; + u16 fracPart[4][4]; + }* mu = (void*)mtx; - mtx->intPart[i][j] = value >> 16; - mtx->fracPart[i][j] = value; + mu->intPart[i][j] = value >> 16; + mu->fracPart[i][j] = value; } } } diff --git a/src/boot/boot_main.c b/src/boot/boot_main.c index 0f95871eaf..905582fe75 100644 --- a/src/boot/boot_main.c +++ b/src/boot/boot_main.c @@ -1,9 +1,8 @@ -#include "prevent_bss_reordering.h" #include "carthandle.h" +#include "CIC6105.h" #include "idle.h" #include "stack.h" #include "stackcheck.h" -#include "CIC6105.h" #include "z64thread.h" StackEntry sBootStackInfo; diff --git a/src/boot/fault.c b/src/boot/fault.c index 2fa53c0dc7..e23ba6c988 100644 --- a/src/boot/fault.c +++ b/src/boot/fault.c @@ -39,19 +39,18 @@ * DPad-Up may be pressed to enable sending fault pages over osSyncPrintf as well as displaying them on-screen. * DPad-Down disables sending fault pages over osSyncPrintf. */ - -#include "fault_internal.h" #include "fault.h" +#include "fault_internal.h" -#include "libc64/sprintf.h" #include "libc64/sleep.h" -#include "vt.h" +#include "libc64/sprintf.h" #include "PR/osint.h" + +#include "macros.h" +#include "main.h" +#include "vt.h" #include "stackcheck.h" #include "z64thread.h" -#include "main.h" -#include "macros.h" -#include "global.h" FaultMgr* sFaultInstance; f32 sFaultTimeTotal; // read but not set anywhere @@ -547,7 +546,7 @@ void Fault_Wait5Seconds(void) { do { Fault_Sleep(1000 / 60); - } while ((osGetTime() - start) <= OS_SEC_TO_CYCLES(5)); + } while ((osGetTime() - start) <= OS_USEC_TO_CYCLES(5 * 1000 * 1000)); sFaultInstance->autoScroll = true; } @@ -931,7 +930,6 @@ void Fault_SetOptions(void) { uintptr_t ra; uintptr_t sp; - // BTN_RESET is the "neutral reset". Corresponds to holding L+R and pressing S if (CHECK_BTN_ALL(input3->press.button, BTN_RESET)) { faultCustomOptions = !faultCustomOptions; } diff --git a/src/boot/fault_drawer.c b/src/boot/fault_drawer.c index 78dc4fd38c..03025fd460 100644 --- a/src/boot/fault_drawer.c +++ b/src/boot/fault_drawer.c @@ -7,7 +7,8 @@ #include "fault.h" #include "fault_internal.h" -#include "global.h" + +#include "macros.h" #include "vt.h" typedef struct { diff --git a/src/boot/irqmgr.c b/src/boot/irqmgr.c index 4085e57b9b..a3daeff11f 100644 --- a/src/boot/irqmgr.c +++ b/src/boot/irqmgr.c @@ -35,7 +35,9 @@ #include "irqmgr.h" #include "libc/stdbool.h" + #include "macros.h" +#include "scheduler.h" #include "stackcheck.h" #include "z64thread.h" @@ -145,7 +147,7 @@ void IrqMgr_HandlePreNMI(IrqMgr* irqMgr) { sIrqMgrResetTime = irqMgr->resetTime = osGetTime(); // Wait .45 seconds then generate a stage 2 prenmi interrupt - osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(450), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI450_MSG); + osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(450 * 1000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI450_MSG); IrqMgr_JamMesgToClients(irqMgr, (OSMesg)&irqMgr->prenmiMsg); } @@ -159,14 +161,14 @@ void IrqMgr_HandlePRENMI450(IrqMgr* irqMgr) { irqMgr->resetStatus = IRQ_RESET_STATUS_NMI; // Wait .03 seconds then generate a stage 3 prenmi interrupt - osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(30), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG); + osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(30 * 1000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG); IrqMgr_SendMesgToClients(irqMgr, (OSMesg)&irqMgr->nmiMsg); } void IrqMgr_HandlePRENMI480(IrqMgr* irqMgr) { // Wait .52 seconds. After this we will have waited an entire second - osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(520), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI500_MSG); + osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(520 * 1000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI500_MSG); osAfterPreNMI(); } diff --git a/src/code/PreRender.c b/src/code/PreRender.c index 70963d1261..011b07f1ff 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -5,18 +5,19 @@ * buffer copies and coverage drawing. Also contains software implementations of the Video Interface anti-aliasing and * divot filters. */ - #include "z64prerender.h" -#include "global.h" -#include "PR/gs2dex.h" + #include "libc/alloca.h" #include "libc/stdbool.h" +#include "PR/gs2dex.h" + +#include "global.h" #include "color.h" #include "macros.h" +#include "gfx.h" #include "slowly.h" #include "stack.h" #include "stackcheck.h" -#include "prevent_bss_reordering.h" /** * Assigns the "save" values in PreRender diff --git a/src/code/code_80183070.c b/src/code/code_80183070.c index ce84e3b2ba..974cdd4a3b 100644 --- a/src/code/code_80183070.c +++ b/src/code/code_80183070.c @@ -1,4 +1,3 @@ -#include "global.h" #include "libc64/sleep.h" void func_80183070(void) { diff --git a/src/code/graph.c b/src/code/graph.c index e13a6ea77b..a48dd61bd2 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -170,20 +170,20 @@ retry: task->type = M_GFXTASK; task->flags = OS_SC_DRAM_DLIST; - task->ucodeBoot = SysUcode_GetUCodeBoot(); - task->ucodeBootSize = SysUcode_GetUCodeBootSize(); + task->ucode_boot = SysUcode_GetUCodeBoot(); + task->ucode_boot_size = SysUcode_GetUCodeBootSize(); task->ucode = SysUcode_GetUCode(); - task->ucodeData = SysUcode_GetUCodeData(); - task->ucodeSize = SP_UCODE_SIZE; - task->ucodeDataSize = SP_UCODE_DATA_SIZE; - task->dramStack = (u64*)gGfxSPTaskStack; - task->dramStackSize = sizeof(gGfxSPTaskStack); - task->outputBuff = gGfxSPTaskOutputBufferPtr; - task->outputBuffSize = (void*)gGfxSPTaskOutputBufferEnd; - task->dataPtr = (u64*)gGfxMasterDL; - task->dataSize = 0; - task->yieldDataPtr = (u64*)gGfxSPTaskYieldBuffer; - task->yieldDataSize = sizeof(gGfxSPTaskYieldBuffer); + task->ucode_data = SysUcode_GetUCodeData(); + task->ucode_size = SP_UCODE_SIZE; + task->ucode_data_size = SP_UCODE_DATA_SIZE; + task->dram_stack = (u64*)gGfxSPTaskStack; + task->dram_stack_size = sizeof(gGfxSPTaskStack); + task->output_buff = gGfxSPTaskOutputBufferPtr; + task->output_buff_size = (void*)gGfxSPTaskOutputBufferEnd; + task->data_ptr = (u64*)gGfxMasterDL; + task->data_size = 0; + task->yield_data_ptr = (u64*)gGfxSPTaskYieldBuffer; + task->yield_data_size = sizeof(gGfxSPTaskYieldBuffer); scTask->next = NULL; scTask->flags = OS_SC_RCP_MASK | OS_SC_SWAPBUFFER | OS_SC_LAST_TASK; diff --git a/src/code/sched.c b/src/code/sched.c index 77822e27e8..48cc5ed6d5 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -1,11 +1,16 @@ #include "scheduler.h" + +#include "libc64/sleep.h" + #include "fault.h" #include "idle.h" -#include "libc64/sleep.h" #include "macros.h" +#include "regs.h" +#include "stackcheck.h" #include "viconfig.h" +#include "z64speed_meter.h" +#include "z64thread.h" -// Variables are put before most headers as a hacky way to bypass bss reordering FaultClient sSchedFaultClient; OSTime sRSPGFXStartTime; @@ -16,17 +21,24 @@ OSTime sRDPStartTime; u64* gAudioSPDataPtr; u32 gAudioSPDataSize; -#include "functions.h" -#include "stackcheck.h" -#include "z64speed_meter.h" -#include "z64thread.h" - #define RSP_DONE_MSG 667 #define RDP_DONE_MSG 668 #define NOTIFY_MSG 670 #define RDP_AUDIO_CANCEL_MSG 671 #define RSP_GFX_CANCEL_MSG 672 +#define OS_SC_DP 0x0001 +#define OS_SC_SP 0x0002 +#define OS_SC_YIELD 0x0010 +#define OS_SC_YIELDED 0x0020 + +#define OS_SC_XBUS (OS_SC_SP | OS_SC_DP) +#define OS_SC_DRAM (OS_SC_SP | OS_SC_DP | OS_SC_DRAM_DLIST) +#define OS_SC_DP_XBUS (OS_SC_SP) +#define OS_SC_DP_DRAM (OS_SC_SP | OS_SC_DRAM_DLIST) +#define OS_SC_SP_XBUS (OS_SC_DP) +#define OS_SC_SP_DRAM (OS_SC_DP | OS_SC_DRAM_DLIST) + /** * Set the current framebuffer to the swapbuffer pointed to by the provided cfb */ @@ -193,7 +205,7 @@ halt_rdp: if (dpTask->type == M_GFXTASK) { // Try to stop DP osSyncPrintf("DP止めようとします\n"); - bzero(dpTask->outputBuff, (uintptr_t)dpTask->outputBuffSize - (uintptr_t)dpTask->outputBuff); + bzero(dpTask->output_buff, (uintptr_t)dpTask->output_buff_size - (uintptr_t)dpTask->output_buff); osSendMesg(&sched->interruptQueue, (OSMesg)RDP_DONE_MSG, OS_MESG_NOBLOCK); } } @@ -376,8 +388,8 @@ void Sched_RunTask(Scheduler* sched, OSScTask* spTask, OSScTask* dpTask) { if (spTask->list.t.type == M_AUDTASK) { // Set global pointers to audio task data for use in audio processing - gAudioSPDataPtr = spTask->list.t.dataPtr; - gAudioSPDataSize = spTask->list.t.dataSize; + gAudioSPDataPtr = spTask->list.t.data_ptr; + gAudioSPDataSize = spTask->list.t.data_size; } // Begin task execution @@ -584,7 +596,7 @@ void Sched_FaultClient(void* arg0, void* arg1) { spTask = sched->curRSPTask; if (spTask != NULL) { FaultDrawer_Printf("RSPTask %08x %08x %02x %02x\n%01x %08x %08x\n", spTask, spTask->next, spTask->state, - spTask->flags, spTask->list.t.type, spTask->list.t.dataPtr, spTask->list.t.dataSize); + spTask->flags, spTask->list.t.type, spTask->list.t.data_ptr, spTask->list.t.data_size); } dpTask = sched->curRDPTask; diff --git a/src/code/speed_meter.c b/src/code/speed_meter.c index e82fb29753..d027e913d9 100644 --- a/src/code/speed_meter.c +++ b/src/code/speed_meter.c @@ -1,16 +1,15 @@ -#include "prevent_bss_reordering.h" #include "z64speed_meter.h" +#include "libc64/malloc.h" + #include "gfx.h" +#include "main.h" #include "regs.h" #include "sys_cfb.h" -#include "libc64/malloc.h" #include "z64game.h" #include "z64malloc.h" #include "z64view.h" -#include "variables.h" - /** * How much time the RSP ran audio tasks for over the course of `gGraphUpdatePeriod`. */ @@ -78,15 +77,15 @@ typedef struct { #define gDrawRect(gfx, color, ulx, uly, lrx, lry) \ do { \ if (gSysCfbHiResEnabled == true) { \ - u32 tmp = color; \ + u32 c = color; \ gDPPipeSync(gfx); \ - gDPSetFillColor(gfx, ((tmp) << 16) | (tmp)); \ + gDPSetFillColor(gfx, ((c) << 16) | (c)); \ gDPFillRectangle(gfx, (ulx)*2, (uly)*2, (lrx)*2, (lry)*2); \ if (1) {} \ } else { \ - u32 tmp = color; \ + u32 c = color; \ gDPPipeSync(gfx); \ - gDPSetFillColor(gfx, ((tmp) << 16) | (tmp)); \ + gDPSetFillColor(gfx, ((c) << 16) | (c)); \ gDPFillRectangle(gfx, (ulx), (uly), (lrx), (lry)); \ } \ } while (0) diff --git a/src/code/su_mtx.c b/src/code/su_mtx.c index 09cbda90e2..29f0351613 100644 --- a/src/code/su_mtx.c +++ b/src/code/su_mtx.c @@ -77,43 +77,46 @@ */ void Mtx_SetTranslateScaleMtx(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY, f32 translateZ) { - Mtx* m = mtx; + struct { + u16 intPart[4][4]; + u16 fracPart[4][4]; + }* mu = (void*)mtx; s32 fixedPoint; - m->m[0][1] = 0; // [i02, i03] == [0, 0] - m->m[2][1] = 0; // [f02, f03] == [0, 0] - m->m[0][3] = 0; // [i12, i13] == [0, 0] - m->m[2][3] = 0; // [f22, f23] == [0, 0] - m->m[1][0] = 0; // [i20, i21] == [0, 0] - // - fixedPoint = scaleX * 0x10000; // - m->m[0][0] = fixedPoint; // [i00, i01] == [scaleX.i, scaleX.f]; i01 is now "dirty" - m->intPart[0][1] = 0; // Clean i01 by zeroing it: [i00, i01] == [scaleX.i, 0] - m->m[2][0] = (u32)fixedPoint << 16; // [f00, f01] == [scaleX.f, 0] - // - fixedPoint = scaleY * 0x10000; // - m->m[0][2] = (u32)fixedPoint >> 16; // [i10, i11] == [0, scaleY.i] - m->m[2][2] = fixedPoint & 0xFFFF; // [f10, f11] == [0, scaleY.f] - // - fixedPoint = scaleZ * 0x10000; // - m->m[1][1] = fixedPoint; // [i22, i23] == [scaleZ.i, scaleZ.f] - m->intPart[2][3] = 0; // [i22, i23] == [scaleZ.i, 0] - m->m[3][1] = (u32)fixedPoint << 16; // [f22, f23] == [scaleZ.f, 0] - // - m->m[3][0] = 0; // [f20, f21] == [0, 0] - // - fixedPoint = translateX * 0x10000; // - m->intPart[3][0] = ((u32)fixedPoint >> 16) & 0xFFFF; // [i30, i31] == [translateX.i, ?] - m->fracPart[3][0] = fixedPoint & 0xFFFF; // [f30, f31] == [translateX.f, ?] - // - fixedPoint = translateY * 0x10000; // - m->intPart[3][1] = ((u32)fixedPoint >> 16) & 0xFFFF; // [i30, i31] == [translateX.i, translateY.i] - m->fracPart[3][1] = fixedPoint & 0xFFFF; // [f30, f31] == [translateX.f, translateY.f] - // - fixedPoint = translateZ * 0x10000; // - m->intPart[3][2] = ((u32)fixedPoint >> 16) & 0xFFFF; // [i30, i31] == [translateZ.i, ?] - m->intPart[3][3] = 1; // [i32, i33] == [translateZ.i, 1] - m->m[3][3] = (u32)fixedPoint << 16; // [f32, f33] == [translateZ.f, 0] + mtx->m[0][1] = 0; // [i02, i03] == [0, 0] + mtx->m[2][1] = 0; // [f02, f03] == [0, 0] + mtx->m[0][3] = 0; // [i12, i13] == [0, 0] + mtx->m[2][3] = 0; // [f22, f23] == [0, 0] + mtx->m[1][0] = 0; // [i20, i21] == [0, 0] + // + fixedPoint = scaleX * 0x10000; // + mtx->m[0][0] = fixedPoint; // [i00, i01] == [scaleX.i, scaleX.f]; i01 is now "dirty" + mu->intPart[0][1] = 0; // Clean i01 by zeroing it: [i00, i01] == [scaleX.i, 0] + mtx->m[2][0] = (u32)fixedPoint << 16; // [f00, f01] == [scaleX.f, 0] + // + fixedPoint = scaleY * 0x10000; // + mtx->m[0][2] = (u32)fixedPoint >> 16; // [i10, i11] == [0, scaleY.i] + mtx->m[2][2] = fixedPoint & 0xFFFF; // [f10, f11] == [0, scaleY.f] + // + fixedPoint = scaleZ * 0x10000; // + mtx->m[1][1] = fixedPoint; // [i22, i23] == [scaleZ.i, scaleZ.f] + mu->intPart[2][3] = 0; // [i22, i23] == [scaleZ.i, 0] + mtx->m[3][1] = (u32)fixedPoint << 16; // [f22, f23] == [scaleZ.f, 0] + // + mtx->m[3][0] = 0; // [f20, f21] == [0, 0] + // + fixedPoint = translateX * 0x10000; // + mu->intPart[3][0] = ((u32)fixedPoint >> 16) & 0xFFFF; // [i30, i31] == [translateX.i, ?] + mu->fracPart[3][0] = fixedPoint & 0xFFFF; // [f30, f31] == [translateX.f, ?] + // + fixedPoint = translateY * 0x10000; // + mu->intPart[3][1] = ((u32)fixedPoint >> 16) & 0xFFFF; // [i30, i31] == [translateX.i, translateY.i] + mu->fracPart[3][1] = fixedPoint & 0xFFFF; // [f30, f31] == [translateX.f, translateY.f] + // + fixedPoint = translateZ * 0x10000; // + mu->intPart[3][2] = ((u32)fixedPoint >> 16) & 0xFFFF; // [i30, i31] == [translateZ.i, ?] + mu->intPart[3][3] = 1; // [i32, i33] == [translateZ.i, 1] + mtx->m[3][3] = (u32)fixedPoint << 16; // [f32, f33] == [translateZ.f, 0] // So we end up with // [scaleX.i, 0], [0, 0], @@ -159,6 +162,7 @@ void Mtx_SetTranslateScaleMtx(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 * * @remark Original name: probably something like "suMtxMakeR" or "suMtxMakeRotateVector" */ +// TODO: Find a way to match without the intPart/fracPart union (see Mtx_SetTranslateScaleMtx) void Mtx_SetRotationMtx(Mtx* mtx, s32 angle, f32 axisX, f32 axisY, f32 axisZ) { //! FAKE? The somewhat peculiar distribution of temps in this function seems necessary to match? f32 tempX; @@ -275,6 +279,7 @@ void Mtx_SetRotationMtx(Mtx* mtx, s32 angle, f32 axisX, f32 axisY, f32 axisZ) { * @remark Original name: probably something like "suMtxMakeSRT", although Animal Forest function is a Tait-Bryan * rotation rather than axis-angle. */ +// TODO: Find a way to match without the intPart/fracPart union (see Mtx_SetTranslateScaleMtx) void Mtx_SetTranslationRotationScaleMtx(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, s32 angle, f32 axisX, f32 axisY, f32 axisZ, f32 translateX, f32 translateY, f32 translateZ) { f32 tempX; diff --git a/src/code/sys_flashrom.c b/src/code/sys_flashrom.c index 7ba8f219c5..75286d8079 100644 --- a/src/code/sys_flashrom.c +++ b/src/code/sys_flashrom.c @@ -1,12 +1,13 @@ -#include "prevent_bss_reordering.h" -#include "global.h" +#include "sys_flashrom.h" + +#include "libc64/malloc.h" +#include "PR/os_internal_flash.h" + #include "fault.h" +#include "macros.h" #include "stack.h" #include "stackcheck.h" -#include "libc64/malloc.h" #include "z64thread.h" -#include "sys_flashrom.h" -#include "PR/os_internal_flash.h" OSMesgQueue sFlashromMesgQueue; OSMesg sFlashromMesg[1]; diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index f84dae383f..66db1a35c7 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -38,9 +38,12 @@ * Throughout this file, `mode` indicates whether to multiply the matrix on top of the stack by the new construction * (APPLY), or to just overwrite it (NEW). */ +#include "sys_matrix.h" -#include "prevent_bss_reordering.h" -#include "global.h" +#include "gfx.h" +#include "macros.h" +#include "z64game.h" +#include "z64skin_matrix.h" /* data */ diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 532d71ec93..937b986e65 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -2,35 +2,20 @@ * File: z_actor.c * Description: */ - -#include "z64actor.h" - -#include "prevent_bss_reordering.h" #include "fault.h" #include "sys_cfb.h" #include "loadfragment.h" -#include "z64horse.h" -#include "z64malloc.h" -#include "z64quake.h" -#include "z64rumble.h" -#include "overlays/actors/ovl_En_Horse/z_en_horse.h" -#include "overlays/actors/ovl_En_Part/z_en_part.h" -#include "overlays/actors/ovl_En_Box/z_en_box.h" -#include "objects/gameplay_keep/gameplay_keep.h" -#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" -#include "objects/object_bdoor/object_bdoor.h" - -// bss +// Variables are put before most headers as a hacky way to bypass bss reordering FaultClient sActorFaultClient; // 2 funcs -CollisionPoly* D_801ED8B0; // 1 func -s32 D_801ED8B4; // 2 funcs +struct CollisionPoly* D_801ED8B0; // 1 func +s32 D_801ED8B4; // 2 funcs -Actor* sTargetableNearestActor; -Actor* sTargetablePrioritizedActor; -Actor* D_801ED8C0; -Actor* D_801ED8C4; +struct Actor* sTargetableNearestActor; +struct Actor* sTargetablePrioritizedActor; +struct Actor* D_801ED8C0; +struct Actor* D_801ED8C4; f32 sTargetableNearestActorDistSq; f32 sBgmEnemyDistSq; @@ -41,7 +26,22 @@ s16 sTargetPlayerRotY; Mtx sActorHiliteMtx; -Actor* D_801ED920; // 2 funcs. 1 out of z_actor +struct Actor* D_801ED920; // 2 funcs. 1 out of z_actor + +#include "z64actor.h" + +#include "z64horse.h" +#include "z64malloc.h" +#include "z64quake.h" +#include "z64rumble.h" + +#include "overlays/actors/ovl_En_Horse/z_en_horse.h" +#include "overlays/actors/ovl_En_Part/z_en_part.h" +#include "overlays/actors/ovl_En_Box/z_en_box.h" + +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" +#include "objects/object_bdoor/object_bdoor.h" #define ACTOR_AUDIO_FLAG_SFX_ACTOR_POS (1 << 0) #define ACTOR_AUDIO_FLAG_SFX_CENTERED_1 (1 << 1) diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index a20f5f93ce..866d99c3ff 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" #include "fault.h" diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 6fe6e2d3b2..7a1cf4c746 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1,8 +1,13 @@ #include "prevent_bss_reordering.h" -#include "fault.h" +#include "z64bgcheck.h" + #include "libc64/fixed_point.h" #include "libc64/sprintf.h" + +#include "fault.h" #include "vt.h" +#include "z64actor.h" + #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" #define DYNA_RAYCAST_FLOORS 1 diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 818b2023cd..869b3fd74f 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "z64collision_check.h" #include "z64actor.h" diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index a571e4d9df..222e801738 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -53,10 +53,10 @@ void Jpeg_ScheduleDecoderTask(JpegContext* jpegCtx) { workBuf->taskData.qTableVPtr = &workBuf->qTableV; sJpegTask.flags = 0; - sJpegTask.ucodeBoot = SysUcode_GetUCodeBoot(); - sJpegTask.ucodeBootSize = SysUcode_GetUCodeBootSize(); - sJpegTask.yieldDataPtr = (u64*)&workBuf->yieldData; - sJpegTask.dataPtr = (u64*)&workBuf->taskData; + sJpegTask.ucode_boot = SysUcode_GetUCodeBoot(); + sJpegTask.ucode_boot_size = SysUcode_GetUCodeBootSize(); + sJpegTask.yield_data_ptr = (u64*)&workBuf->yieldData; + sJpegTask.data_ptr = (u64*)&workBuf->taskData; jpegCtx->scTask.next = NULL; jpegCtx->scTask.flags = OS_SC_NEEDS_RSP; diff --git a/src/code/z_message.c b/src/code/z_message.c index d27fcaf26c..21205ddabd 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -1,12 +1,15 @@ -#include "prevent_bss_reordering.h" -#include "global.h" +#include "z64message.h" +#include "message_data_static.h" + +#include "padmgr.h" +#include "z64actor.h" #include "z64horse.h" #include "z64shrink_window.h" -#include "z64view.h" -#include "message_data_static.h" -#include "interface/parameter_static/parameter_static.h" + #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" +#include "interface/parameter_static/parameter_static.h" + u8 D_801C6A70 = 0; s16 sOcarinaButtonIndexBufPos = 0; s16 sOcarinaButtonIndexBufLen = 0; diff --git a/src/code/z_quake.c b/src/code/z_quake.c index c4b6e67828..9c42e1f379 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -1,7 +1,8 @@ -#include "prevent_bss_reordering.h" -#include "global.h" -#include "libc/string.h" #include "z64quake.h" + +#include "libc/string.h" + +#include "global.h" #include "z64view.h" typedef struct { diff --git a/src/code/z_scene_proc.c b/src/code/z_scene_proc.c index 2daa0ee780..b4597a5c29 100644 --- a/src/code/z_scene_proc.c +++ b/src/code/z_scene_proc.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" s32 sMatAnimStep; diff --git a/src/code/z_shrink_window.c b/src/code/z_shrink_window.c index c4084a18c0..5dc28737dd 100644 --- a/src/code/z_shrink_window.c +++ b/src/code/z_shrink_window.c @@ -2,11 +2,12 @@ * File: z_shrink_window.c * Description: Draws black top/bottom/side borders on the viewing window (e.g. Z-targeting, talking to NPC) */ - -#include "prevent_bss_reordering.h" -#include "global.h" #include "z64shrink_window.h" +#include "gfx.h" +#include "main.h" +#include "z64math.h" + typedef struct { /* 0x0 */ s8 letterboxTarget; /* 0x1 */ s8 letterboxSize; diff --git a/src/code/z_skin.c b/src/code/z_skin.c index 0139335e41..cbf85860b2 100644 --- a/src/code/z_skin.c +++ b/src/code/z_skin.c @@ -1,7 +1,12 @@ -#include "prevent_bss_reordering.h" -#include "global.h" #include "z64skin.h" +#include "libc/stdbool.h" + +#include "global.h" +#include "gfx.h" +#include "sys_matrix.h" +#include "z64actor.h" + // 60 is an arbitrary number which specifies the max amount of limbs per skeleton this system supports MtxF gSkinLimbMatrices[60]; diff --git a/src/libultra/io/sptask.c b/src/libultra/io/sptask.c index 511461fafc..0edf6ede2d 100644 --- a/src/libultra/io/sptask.c +++ b/src/libultra/io/sptask.c @@ -14,12 +14,12 @@ OSTask* _VirtualToPhysicalTask(OSTask* intp) { bcopy(intp, tp, sizeof(OSTask)); _osVirtualToPhysical(tp->t.ucode); - _osVirtualToPhysical(tp->t.ucodeData); - _osVirtualToPhysical(tp->t.dramStack); - _osVirtualToPhysical(tp->t.outputBuff); - _osVirtualToPhysical(tp->t.outputBuffSize); - _osVirtualToPhysical(tp->t.dataPtr); - _osVirtualToPhysical(tp->t.yieldDataPtr); + _osVirtualToPhysical(tp->t.ucode_data); + _osVirtualToPhysical(tp->t.dram_stack); + _osVirtualToPhysical(tp->t.output_buff); + _osVirtualToPhysical(tp->t.output_buff_size); + _osVirtualToPhysical(tp->t.data_ptr); + _osVirtualToPhysical(tp->t.yield_data_ptr); return tp; } @@ -28,12 +28,12 @@ void osSpTaskLoad(OSTask* intp) { OSTask* tp = _VirtualToPhysicalTask(intp); if (tp->t.flags & OS_TASK_YIELDED) { - tp->t.ucodeData = tp->t.yieldDataPtr; - tp->t.ucodeDataSize = tp->t.yieldDataSize; + tp->t.ucode_data = tp->t.yield_data_ptr; + tp->t.ucode_data_size = tp->t.yield_data_size; intp->t.flags &= ~OS_TASK_YIELDED; if (tp->t.flags & OS_TASK_LOADABLE) { - tp->t.ucode = (void*)IO_READ((uintptr_t)intp->t.yieldDataPtr + OS_YIELD_DATA_SIZE - 4); + tp->t.ucode = (void*)IO_READ((uintptr_t)intp->t.yield_data_ptr + OS_YIELD_DATA_SIZE - 4); } } @@ -46,7 +46,7 @@ void osSpTaskLoad(OSTask* intp) { while (__osSpDeviceBusy()) {} - while (__osSpRawStartDma(1, SP_IMEM_START, tp->t.ucodeBoot, tp->t.ucodeBootSize) == -1) {} + while (__osSpRawStartDma(1, SP_IMEM_START, tp->t.ucode_boot, tp->t.ucode_boot_size) == -1) {} } void osSpTaskStartGo(OSTask* tp) { diff --git a/src/libultra/voice/voicecheckresult.c b/src/libultra/voice/voicecheckresult.c index 2524721921..e5e13c9260 100644 --- a/src/libultra/voice/voicecheckresult.c +++ b/src/libultra/voice/voicecheckresult.c @@ -7,16 +7,16 @@ #include "PR/os_voice.h" s32 __osVoiceCheckResult(OSVoiceHandle* hd, u8* status) { - s32 errorCode = __osVoiceGetStatus(hd->mq, hd->channel, status); + s32 errorCode = __osVoiceGetStatus(hd->__mq, hd->__channel, status); u8 data[2]; if (errorCode == 0) { if (*status & 1) { errorCode = CONT_ERR_VOICE_NO_RESPONSE; } else { - errorCode = __osVoiceContRead2(hd->mq, hd->channel, 0, data); + errorCode = __osVoiceContRead2(hd->__mq, hd->__channel, 0, data); if (errorCode == 0) { - hd->status = data[0] & 7; + hd->cmd_status = data[0] & 7; if (data[0] & 0x40) { errorCode = CONT_ERR_VOICE_NO_RESPONSE; diff --git a/src/libultra/voice/voicecleardictionary.c b/src/libultra/voice/voicecleardictionary.c index eceb9bb715..f212aeae21 100644 --- a/src/libultra/voice/voicecleardictionary.c +++ b/src/libultra/voice/voicecleardictionary.c @@ -19,7 +19,7 @@ s32 osVoiceClearDictionary(OSVoiceHandle* hd, u8 numWords) { u8 status; u8 data[4]; - errorCode = __osVoiceGetStatus(hd->mq, hd->channel, &status); + errorCode = __osVoiceGetStatus(hd->__mq, hd->__channel, &status); if (errorCode != 0) { return errorCode; } @@ -37,7 +37,7 @@ s32 osVoiceClearDictionary(OSVoiceHandle* hd, u8 numWords) { *(u32*)data = 0x2000000; data[2] = numWords; - errorCode = __osVoiceContWrite4(hd->mq, hd->channel, 0, data); + errorCode = __osVoiceContWrite4(hd->__mq, hd->__channel, 0, data); if (errorCode != 0) { return errorCode; } diff --git a/src/libultra/voice/voicecontrolgain.c b/src/libultra/voice/voicecontrolgain.c index bac3871d79..0acdf86dbd 100644 --- a/src/libultra/voice/voicecontrolgain.c +++ b/src/libultra/voice/voicecontrolgain.c @@ -21,7 +21,7 @@ s32 osVoiceControlGain(OSVoiceHandle* hd, s32 analog, s32 digital) { cmd = 0x98; } - errorCode = __osVoiceSetADConverter(hd->mq, hd->channel, cmd); + errorCode = __osVoiceSetADConverter(hd->__mq, hd->__channel, cmd); if (errorCode != 0) { return errorCode; } @@ -32,7 +32,7 @@ s32 osVoiceControlGain(OSVoiceHandle* hd, s32 analog, s32 digital) { return CONT_ERR_INVALID; } - errorCode = __osVoiceSetADConverter(hd->mq, hd->channel, cmd); + errorCode = __osVoiceSetADConverter(hd->__mq, hd->__channel, cmd); if (errorCode != 0) { return errorCode; } diff --git a/src/libultra/voice/voicegetreaddata.c b/src/libultra/voice/voicegetreaddata.c index a82d23a870..9e1a0da259 100644 --- a/src/libultra/voice/voicegetreaddata.c +++ b/src/libultra/voice/voicegetreaddata.c @@ -15,9 +15,9 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { u8 status; u8 data[36]; - switch (hd->mode) { + switch (hd->__mode) { case VOICE_HANDLE_MODE_1: - errorCode = __osVoiceGetStatus(hd->mq, hd->channel, &status); + errorCode = __osVoiceGetStatus(hd->__mq, hd->__channel, &status); if (errorCode != 0) { return errorCode; } @@ -26,21 +26,21 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { return CONT_ERR_NOT_READY; } - errorCode = __osVoiceContRead2(hd->mq, hd->channel, 0, data); + errorCode = __osVoiceContRead2(hd->__mq, hd->__channel, 0, data); if (errorCode != 0) { return errorCode; } sHandleStatus = data[0] & 7; - hd->status = sHandleStatus; + hd->cmd_status = sHandleStatus; if ((sHandleStatus != VOICE_STATUS_READY) && (sHandleStatus != VOICE_STATUS_END)) { return CONT_ERR_NOT_READY; } // fallthrough case VOICE_HANDLE_MODE_2: - hd->mode = VOICE_HANDLE_MODE_2; + hd->__mode = VOICE_HANDLE_MODE_2; - errorCode = __osVoiceGetStatus(hd->mq, hd->channel, &status); + errorCode = __osVoiceGetStatus(hd->__mq, hd->__channel, &status); if (errorCode != 0) { return errorCode; } @@ -50,15 +50,15 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { } *(u32*)data = 0x600; - errorCode = __osVoiceContWrite4(hd->mq, hd->channel, 0, data); + errorCode = __osVoiceContWrite4(hd->__mq, hd->__channel, 0, data); if (errorCode != 0) { return errorCode; } // fallthrough case VOICE_HANDLE_MODE_3: - hd->mode = VOICE_HANDLE_MODE_3; + hd->__mode = VOICE_HANDLE_MODE_3; - errorCode = __osVoiceGetStatus(hd->mq, hd->channel, &status); + errorCode = __osVoiceGetStatus(hd->__mq, hd->__channel, &status); if (errorCode != 0) { return errorCode; } @@ -67,16 +67,16 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { return CONT_ERR_VOICE_NO_RESPONSE; } - errorCode = __osVoiceContRead36(hd->mq, hd->channel, 0, data); + errorCode = __osVoiceContRead36(hd->__mq, hd->__channel, 0, data); if (errorCode != 0) { return errorCode; } result->warning = data[4] + (data[5] << 8); - result->answerNum = data[6]; - result->voiceLevel = data[8] + (data[9] << 8); - result->voiceRelLevel = data[10] + (data[11] << 8); - result->voiceTime = data[12] + (data[13] << 8); + result->answer_num = data[6]; + result->voice_level = data[8] + (data[9] << 8); + result->voice_sn = data[10] + (data[11] << 8); + result->voice_time = data[12] + (data[13] << 8); for (i = 0; i < 5; i++) { result->answer[i] = data[14 + (i << 2)] + (data[15 + (i << 2)] << 8); @@ -84,18 +84,18 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { } if (result->answer[0] == 0x7FFF) { - result->answerNum = 0; + result->answer_num = 0; } - hd->status = data[34] & 7; - if ((sHandleStatus == VOICE_STATUS_READY) || (hd->status == VOICE_STATUS_READY)) { + hd->cmd_status = data[34] & 7; + if ((sHandleStatus == VOICE_STATUS_READY) || (hd->cmd_status == VOICE_STATUS_READY)) { break; } // fallthrough case VOICE_HANDLE_MODE_4: - hd->mode = VOICE_HANDLE_MODE_4; + hd->__mode = VOICE_HANDLE_MODE_4; - errorCode = __osVoiceGetStatus(hd->mq, hd->channel, &status); + errorCode = __osVoiceGetStatus(hd->__mq, hd->__channel, &status); if (errorCode != 0) { return errorCode; } @@ -104,12 +104,12 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { return CONT_ERR_VOICE_NO_RESPONSE; } - errorCode = __osVoiceContRead2(hd->mq, hd->channel, 0, data); + errorCode = __osVoiceContRead2(hd->__mq, hd->__channel, 0, data); if (errorCode != 0) { return errorCode; } - hd->status = data[0] & 7; + hd->cmd_status = data[0] & 7; if (data[0] & 7) { return CONT_ERR_VOICE_NO_RESPONSE; } @@ -120,6 +120,6 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { return CONT_ERR_INVALID; } - hd->mode = VOICE_HANDLE_MODE_0; + hd->__mode = VOICE_HANDLE_MODE_0; return errorCode; } diff --git a/src/libultra/voice/voiceinit.c b/src/libultra/voice/voiceinit.c index 69fc2fd7c3..af72e73720 100644 --- a/src/libultra/voice/voiceinit.c +++ b/src/libultra/voice/voiceinit.c @@ -20,9 +20,9 @@ s32 osVoiceInit(OSMesgQueue* mq, OSVoiceHandle* hd, int channel) { u8 status = 0; u8 data[4]; - hd->channel = channel; - hd->mq = mq; - hd->mode = VOICE_HANDLE_MODE_0; + hd->__channel = channel; + hd->__mq = mq; + hd->__mode = VOICE_HANDLE_MODE_0; errorCode = __osVoiceGetStatus(mq, channel, &status); if (errorCode != 0) { diff --git a/src/libultra/voice/voicemaskdictionary.c b/src/libultra/voice/voicemaskdictionary.c index 6ff957d45e..0453aaf94c 100644 --- a/src/libultra/voice/voicemaskdictionary.c +++ b/src/libultra/voice/voicemaskdictionary.c @@ -17,7 +17,7 @@ s32 osVoiceMaskDictionary(OSVoiceHandle* hd, u8* maskPattern, int size) { u8 status; u8 data[20]; - errorCode = __osVoiceGetStatus(hd->mq, hd->channel, &status); + errorCode = __osVoiceGetStatus(hd->__mq, hd->__channel, &status); if (errorCode != 0) { return errorCode; } @@ -45,7 +45,7 @@ s32 osVoiceMaskDictionary(OSVoiceHandle* hd, u8* maskPattern, int size) { data[ARRAY_COUNT(data) - 1] = 0; } - errorCode = __osVoiceContWrite20(hd->mq, hd->channel, 0, data); + errorCode = __osVoiceContWrite20(hd->__mq, hd->__channel, 0, data); if (errorCode == 0) { errorCode = __osVoiceCheckResult(hd, &status); if (errorCode & 0xFF00) { diff --git a/src/libultra/voice/voicesetword.c b/src/libultra/voice/voicesetword.c index f832b60106..54338f2e4c 100644 --- a/src/libultra/voice/voicesetword.c +++ b/src/libultra/voice/voicesetword.c @@ -17,7 +17,7 @@ s32 osVoiceSetWord(OSVoiceHandle* hd, u8* word) { u8 status; u8 data[40]; - errorCode = __osVoiceGetStatus(hd->mq, hd->channel, &status); + errorCode = __osVoiceGetStatus(hd->__mq, hd->__channel, &status); if (errorCode != 0) { return errorCode; } @@ -42,13 +42,13 @@ s32 osVoiceSetWord(OSVoiceHandle* hd, u8* word) { data[ARRAY_COUNT(data) - 1 - i - 5] = 3; if (k >= 15) { - errorCode = __osVoiceContWrite20(hd->mq, hd->channel, 0, &data[0]); + errorCode = __osVoiceContWrite20(hd->__mq, hd->__channel, 0, &data[0]); if (errorCode != 0) { return errorCode; } } - errorCode = __osVoiceContWrite20(hd->mq, hd->channel, 0, &data[20]); + errorCode = __osVoiceContWrite20(hd->__mq, hd->__channel, 0, &data[20]); if (errorCode != 0) { return errorCode; } diff --git a/src/libultra/voice/voicestartreaddata.c b/src/libultra/voice/voicestartreaddata.c index 0ff35fd2b4..fb2662f245 100644 --- a/src/libultra/voice/voicestartreaddata.c +++ b/src/libultra/voice/voicestartreaddata.c @@ -13,7 +13,7 @@ s32 osVoiceStartReadData(OSVoiceHandle* hd) { u8 status; u8 data[4]; - errorCode = __osVoiceGetStatus(hd->mq, hd->channel, &status); + errorCode = __osVoiceGetStatus(hd->__mq, hd->__channel, &status); if (errorCode != 0) { return errorCode; } @@ -22,7 +22,7 @@ s32 osVoiceStartReadData(OSVoiceHandle* hd) { return CONT_ERR_VOICE_NO_RESPONSE; } - if (hd->mode != VOICE_HANDLE_MODE_0) { + if (hd->__mode != VOICE_HANDLE_MODE_0) { return CONT_ERR_INVALID; } @@ -33,7 +33,7 @@ s32 osVoiceStartReadData(OSVoiceHandle* hd) { * data[3] = 0 */ *(u32*)data = 0x5000000; - errorCode = __osVoiceContWrite4(hd->mq, hd->channel, 0, data); + errorCode = __osVoiceContWrite4(hd->__mq, hd->__channel, 0, data); if (errorCode == 0) { errorCode = __osVoiceCheckResult(hd, &status); @@ -41,7 +41,7 @@ s32 osVoiceStartReadData(OSVoiceHandle* hd) { if (errorCode & 0xFF00) { errorCode = CONT_ERR_INVALID; } else { - hd->mode = VOICE_HANDLE_MODE_1; + hd->__mode = VOICE_HANDLE_MODE_1; } } diff --git a/src/libultra/voice/voicestopread.c b/src/libultra/voice/voicestopread.c index 905efb19f2..e6dc7888dd 100644 --- a/src/libultra/voice/voicestopread.c +++ b/src/libultra/voice/voicestopread.c @@ -14,7 +14,7 @@ s32 osVoiceStopReadData(OSVoiceHandle* hd) { u8 status; u8 data[4]; - errorCode = __osVoiceGetStatus(hd->mq, hd->channel, &status); + errorCode = __osVoiceGetStatus(hd->__mq, hd->__channel, &status); if (errorCode != 0) { return errorCode; } @@ -23,7 +23,7 @@ s32 osVoiceStopReadData(OSVoiceHandle* hd) { return CONT_ERR_VOICE_NO_RESPONSE; } - if (hd->mode == VOICE_HANDLE_MODE_0) { + if (hd->__mode == VOICE_HANDLE_MODE_0) { return CONT_ERR_INVALID; } @@ -34,7 +34,7 @@ s32 osVoiceStopReadData(OSVoiceHandle* hd) { * data[3] = 0 */ *(u32*)data = 0x700; - errorCode = __osVoiceContWrite4(hd->mq, hd->channel, 0, data); + errorCode = __osVoiceContWrite4(hd->__mq, hd->__channel, 0, data); if (errorCode == 0) { i = 0; @@ -43,12 +43,12 @@ s32 osVoiceStopReadData(OSVoiceHandle* hd) { if (errorCode & 0xFF00) { if (((errorCode & 7) == 0) || ((errorCode & 7) == 7)) { errorCode = 0; - hd->mode = VOICE_HANDLE_MODE_0; + hd->__mode = VOICE_HANDLE_MODE_0; } else { errorCode = CONT_ERR_INVALID; } } else { - hd->mode = VOICE_HANDLE_MODE_0; + hd->__mode = VOICE_HANDLE_MODE_0; } i++; } while ((errorCode == CONT_ERR_VOICE_NO_RESPONSE) && (i < 20)); diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c index ae01b84014..8b5144991d 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -3,7 +3,6 @@ * Overlay: ovl_En_Fishing * Description: Fishing Pond Elements (Owner, Fish, Props, Effects...) */ -#include "prevent_bss_reordering.h" #include "z_en_fishing.h" #include "z64rumble.h" #include "z64shrink_window.h"