diff options
| author | cadmic <cadmic24@gmail.com> | 2024-09-07 11:37:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-08 03:37:15 +0900 |
| commit | e52d135e15be227326b58d75d6779fbb1db6f232 (patch) | |
| tree | ce30d6c22b9e6f213ff5047c7174e4ba674dda4f /include | |
| parent | c27b83ac29a7c143ab8193682355cfab44f86f63 (diff) | |
[ntsc-1.2] Import n64dd code from Decompollaborate/n64dd (#2136)
* Import n64dd code from Decompollaborate/n64dd
Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com>
* Don't stub out missing textures
* Remove @brief
* Add low-effort file comments
* Match OoT if style
* Fix n64dd matching due to int vs long
* Fix English n64dd error textures
* Compress n64dd segment
* Align n64dd to 0x40
---------
Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/functions.h | 2 | ||||
| -rw-r--r-- | include/n64dd.h | 80 | ||||
| -rw-r--r-- | include/variables.h | 1 | ||||
| -rw-r--r-- | include/z64.h | 4 |
4 files changed, 87 insertions, 0 deletions
diff --git a/include/functions.h b/include/functions.h index 403cd89b2..ee7a203a6 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1395,6 +1395,8 @@ void Audio_SetCutsceneFlag(s8 flag); void Audio_PlaySfxIfNotInCutscene(u16 sfxId); void func_800F6964(u16); void Audio_StopBgmAndFanfare(u16 fadeOutDuration); +void func_800F6B3C(void); +void func_800F6BDC(void); void Audio_PreNMI(void); void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 ioPort, u8 ioData); void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId); diff --git a/include/n64dd.h b/include/n64dd.h index 4f117f682..6931eac26 100644 --- a/include/n64dd.h +++ b/include/n64dd.h @@ -2,6 +2,7 @@ #define N64DD_H #include "ultra64.h" +#include "ultra64/leo.h" #include "z64pause.h" #include "z64scene.h" #include "z64map_mark.h" @@ -59,6 +60,35 @@ typedef struct n64ddStruct_80121220 { s32 (*unk_78)(struct PlayState*, void*, void*); } n64ddStruct_80121220; // size = ? +typedef struct struct_801E0D18 { + /* 0x00 */ LEOCmd unk_00; + /* 0x1C */ OSMesgQueue unk_1C; + /* 0x38 */ LEODiskID diskId; + /* 0x58 */ UNK_TYPE unk_58; + /* 0x5C */ UNK_TYPE unk_5C; + /* 0x60 */ u32 unk_60; + /* 0x64 */ u8 unk_64; + /* 0x65 */ u8 unk_65; + /* 0x66 */ u8 unk_66; + /* 0x68 */ s32 unk_68; + /* 0x6C */ s32 unk_6C; +} struct_801E0D18; // size = 0x70 + +typedef struct struct_801D9D50 { + /* 0x00 */ u8 unk_00; // command enum + /* 0x04 */ s32 unk_04; + /* 0x08 */ u8 unk_08; + /* 0x0C */ void (*unk_0C)(void*, void*, void*); + /* 0x10 */ s32 unk_10; + /* 0x14 */ void (*unk_14)(void*, uintptr_t, size_t); + /* 0x18 */ void* unk_18; + /* 0x1C */ void* unk_1C; // either OSMesgQueue* (command 0) or integer LBA (commands 2 and 3) + /* 0x20 */ void* unk_20; // either OSMesgQueue* (command 0) or integer byte size (commands 3 and 4) + /* 0x24 */ OSId unk_24; + /* 0x28 */ void* unk_28; + /* 0x2C */ OSPri unk_2C; +} struct_801D9D50; // size = 0x30 + void func_800AD410(void); void func_800AD488(void); n64ddStruct_80121220* func_800AD4C0(n64ddStruct_80121220* arg0); @@ -77,6 +107,35 @@ void func_801C7C1C(void* dest, s32 offset, s32 size); void func_801C7E78(void); void n64dd_SetDiskVersion(s32 arg0); +s32 func_801C8000(struct_801D9D50* arg0); +s32 func_801C81C4(void); +void func_801C81EC(struct_801E0D18* arg0); +void func_801C8298(struct_801E0D18* arg0); +void func_801C82E0(struct_801E0D18* arg0); +void func_801C832C(struct_801E0D18* arg0); +void func_801C83A0(struct_801E0D18* arg0); +void func_801C8414(struct_801E0D18* arg0); +s32 func_801C873C(struct_801E0D18* arg0); + +void func_801C8AA8(void); +s32 func_801C91E0(struct_801E0D18*); +s32 func_801C9260(struct_801E0D18*); +s32 func_801C9334(struct_801E0D18*); +s32 func_801C93C4(struct_801E0D18*); + +void func_801C94F8(u8* arg0, u16 arg1); +void func_801C9A10(u8* arg0, s32 arg1, u8* str); +void func_801C9B50(s32 arg0, void (*arg1)(void*, uintptr_t, size_t)); + +u8* func_801C9E28(s32 errorNum); +u8* func_801C9EC0(void); +u8* func_801C9F90(s32 errorNum); +u8* func_801C9FFC(void); +u8* func_801CA030(s32 errorNum); +u8* func_801CA070(void); + +void func_801CA1F0(void* charTexBuf, s32 posX, s32 posY, s32 dx, s32 dy, s32 cy, void* frameBuf, s32 screenWidth); + extern n64ddStruct_800FEE70_pointers D_800FEE70; extern n64ddStruct_80121220* B_80121220; @@ -86,4 +145,25 @@ extern u8 D_80121212; extern vu8 D_80121213; extern vu8 D_80121214; +extern s32 (*D_801D2E54)(struct_801E0D18*); + +extern u8 B_801DC000[]; + +extern s32 D_801D2E90; +extern OSMesgQueue* B_801E0D10[2]; + +extern s32 D_801D2EA0; +extern s32 D_801D2EA8; +extern s32 B_801E0F60; +extern s32 B_801E0F64; +extern void (*D_801D2EB4)(void*, void*, void*); + +// Error messages +extern const char* D_801D2ED0[]; // "Error Number " array +extern const char* D_801D2EE0[2][8][4]; // Array of error message strings + +// Error textures +extern u64 gN64DDError41Texs[2][0x600 / sizeof(u64)]; +extern u64 gN64DDPleaseReadManualTexs[2][0x2800 / sizeof(u64)]; + #endif diff --git a/include/variables.h b/include/variables.h index bf4fb15c5..dc01f712d 100644 --- a/include/variables.h +++ b/include/variables.h @@ -203,6 +203,7 @@ extern PreNmiBuff* gAppNmiBufferPtr; extern uintptr_t gSegments[NUM_SEGMENTS]; extern Scheduler gScheduler; extern PadMgr gPadMgr; +extern IrqMgr gIrqMgr; extern volatile OSTime gAudioThreadUpdateTimeTotalPerGfxTask; extern volatile OSTime gGfxTaskSentToNextReadyMinusAudioThreadUpdateTime; extern volatile OSTime gRSPAudioTimeTotal; diff --git a/include/z64.h b/include/z64.h index 7a6187a48..377a760ce 100644 --- a/include/z64.h +++ b/include/z64.h @@ -76,6 +76,8 @@ #define THREAD_PRI_DMAMGR_LOW 10 // Used when decompressing files #define THREAD_PRI_GRAPH 11 #define THREAD_PRI_AUDIOMGR 12 +#define THREAD_PRI_N64DD 13 +#define THREAD_PRI_DDMSG 13 #define THREAD_PRI_PADMGR 14 #define THREAD_PRI_MAIN 15 #define THREAD_PRI_SCHED 15 @@ -90,6 +92,8 @@ #define THREAD_ID_GRAPH 4 #define THREAD_ID_SCHED 5 #define THREAD_ID_PADMGR 7 +#define THREAD_ID_N64DD 8 +#define THREAD_ID_DDMSG 9 #define THREAD_ID_AUDIOMGR 10 #define THREAD_ID_DMAMGR 18 #define THREAD_ID_IRQMGR 19 |
