summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2024-08-21 01:20:11 +0200
committerGitHub <noreply@github.com>2024-08-20 19:20:11 -0400
commit942df4589221f03d054d09d6d91fb981e13af6f1 (patch)
tree446b04f87dbb023d9f7d057591d60f570744cf4f /src/code
parentac2224f095367073c53f9fd719eee3884d7b67ab (diff)
Match n64dd text in code (#2058)
* match n64dd text * format * fixups * add n64dd segment using baserom * cleanup syms 1 * cleanup symbols 2 * cleanup D_800FF4B0 * fix declaration usage and linking for D_800FF4B0
Diffstat (limited to 'src/code')
-rw-r--r--src/code/code_n64dd_800AD410.c31
-rw-r--r--src/code/code_n64dd_800AD4C0.c87
2 files changed, 118 insertions, 0 deletions
diff --git a/src/code/code_n64dd_800AD410.c b/src/code/code_n64dd_800AD410.c
index 8b1378917..330b99bb5 100644
--- a/src/code/code_n64dd_800AD410.c
+++ b/src/code/code_n64dd_800AD410.c
@@ -1 +1,32 @@
+#include "ultra64.h"
+#include "z64dma.h"
+#include "segment_symbols.h"
+#include "n64dd.h"
+DECLARE_SEGMENT(n64dd)
+DECLARE_ROM_SEGMENT(n64dd)
+DECLARE_BSS_SEGMENT(n64dd)
+
+s8 func_801C7740_unknown(void);
+
+u8 B_80121AE0;
+s8 B_80121AE1;
+u8 B_80121AE2;
+
+void func_800ADA80(void) {
+ if (!B_80121AE0) {
+ DmaMgr_RequestSync(_n64ddSegmentStart, (uintptr_t)_n64ddSegmentRomStart,
+ _n64ddSegmentRomEnd - _n64ddSegmentRomStart);
+ // TODO use _n64ddSegmentBssStart, _n64ddSegmentBssEnd
+ bzero(&D_801DA410, &D_801E8090 - &D_801DA410);
+ B_80121AE0 = true;
+ B_80121AE1 = func_801C7740_unknown();
+ if (B_80121AE1) {}
+ }
+}
+
+void func_800ADAF8(void) {
+ if (B_80121AE0 && (B_80121AE2 == 0)) {
+ B_80121AE0 = false;
+ }
+}
diff --git a/src/code/code_n64dd_800AD4C0.c b/src/code/code_n64dd_800AD4C0.c
index f75d79f5e..858348d2b 100644
--- a/src/code/code_n64dd_800AD4C0.c
+++ b/src/code/code_n64dd_800AD4C0.c
@@ -1,3 +1,90 @@
+#include "global.h"
#include "n64dd.h"
+// TODO functions of unknown prototype
+extern char func_801C8510_unknown[];
+extern char func_800AE170_unknown[];
+extern char func_800ADCD8_unknown[];
+extern char osGetIntMask[];
+extern char osSetTime[];
+
+n64ddStruct_800FF4B0_pointers D_800FF4B0 = {
+ func_801C8510_unknown,
+ NULL,
+ NULL,
+ Fault_RemoveClient,
+ Fault_AddClient,
+ func_800AE170_unknown,
+ func_800ADCD8_unknown,
+ Fault_AddHungupAndCrashImpl,
+ Fault_AddHungupAndCrash,
+ func_800ADC08,
+ _Printf,
+ osCreateThread,
+ osDestroyThread,
+ osYieldThread,
+ osStartThread,
+ osStopThread,
+ osGetThreadId,
+ osSetThreadPri,
+ osGetThreadPri,
+ osCreateMesgQueue,
+ osSendMesg,
+ osJamMesg,
+ osRecvMesg,
+ osSetEventMesg,
+ osGetIntMask,
+ osSetIntMask,
+ osInvalDCache,
+ osInvalICache,
+ osWritebackDCache,
+ osWritebackDCacheAll,
+ osGetTime,
+ osSetTime,
+ osSetTimer,
+ osStopTimer,
+ &gSaveContext,
+ DmaMgr_RequestAsync,
+ DmaMgr_RequestSync,
+ DmaMgr_DmaFromDriveRom,
+ Cutscene_HandleEntranceTriggers,
+ gSegments,
+ Flags_GetEventChkInf,
+ Flags_SetEventChkInf,
+ NULL, // TODO possibly file padding
+ NULL,
+};
+
n64ddStruct_80121AF0* B_80121AF0;
+
+n64ddStruct_80121AF0* func_800ADB30(n64ddStruct_80121AF0* arg0) {
+ n64ddStruct_800FF4B0_pointers* temp_a0 = func_800ADBD0();
+
+ if (arg0 != NULL && arg0->unk_00 != NULL) {
+ arg0->unk_00(temp_a0, arg0);
+ }
+ B_80121AF0 = arg0;
+ return B_80121AF0;
+}
+
+void func_800ADB8C(void) {
+ if (B_80121AF0 != NULL) {
+ if (B_80121AF0->unk_04 != NULL) {
+ B_80121AF0->unk_04();
+ }
+ }
+ B_80121AF0 = NULL;
+}
+
+n64ddStruct_800FF4B0_pointers* func_800ADBD0(void) {
+ D_800FF4B0.unk_04 = 0;
+ D_800FF4B0.unk_08 = gRegEditor;
+ D_800FF4B0.unk_88 = &gSaveContext;
+ return &D_800FF4B0;
+}
+
+void func_800ADC00(void) {
+}
+
+void func_800ADC08(s32 arg0, s32 arg1, s32 arg2) {
+}