summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorcadmic <cadmic24@gmail.com>2024-09-04 11:56:24 -0700
committerGitHub <noreply@github.com>2024-09-05 03:56:24 +0900
commit8153c952f6d74e29b12aa03f1503530d5a39e732 (patch)
tree4c5b431f6515375d6c1322c0edb029c1d1e4e688 /src/code
parentaa1c7f31558139d6bc4209edb5edc27c71ca3cc1 (diff)
[ntsc-1.2] Organize n64dd declarations and convert to 1.0 addresses (#2127)
* Reorganize n64dd declarations * Fix bss * Really fix bss
Diffstat (limited to 'src/code')
-rw-r--r--src/code/code_n64dd_800AD410.c35
-rw-r--r--src/code/code_n64dd_800AD4C0.c42
-rw-r--r--src/code/game.c16
-rw-r--r--src/code/main.c8
-rw-r--r--src/code/sys_math3d.c2
-rw-r--r--src/code/z_collision_check.c2
-rw-r--r--src/code/z_demo.c4
-rw-r--r--src/code/z_kaleido_setup.c8
-rw-r--r--src/code/z_play.c22
-rw-r--r--src/code/z_room.c4
-rw-r--r--src/code/z_scene_table.c4
11 files changed, 68 insertions, 79 deletions
diff --git a/src/code/code_n64dd_800AD410.c b/src/code/code_n64dd_800AD410.c
index 8e380f64c..66dcc3cc7 100644
--- a/src/code/code_n64dd_800AD410.c
+++ b/src/code/code_n64dd_800AD410.c
@@ -3,32 +3,25 @@
#include "segment_symbols.h"
#include "n64dd.h"
-DECLARE_SEGMENT(n64dd)
-DECLARE_ROM_SEGMENT(n64dd)
-DECLARE_BSS_SEGMENT(n64dd)
+u8 D_80121210;
+u8 D_80121211;
+u8 D_80121212;
+vu8 D_80121213;
+vu8 D_80121214;
-s8 func_801C7740_unknown(void);
-
-u8 B_80121AE0;
-s8 B_80121AE1;
-u8 B_80121AE2;
-vu8 B_80121AE3;
-vu8 B_80121AE4;
-
-void func_800ADA80(void) {
- if (!B_80121AE0) {
+void func_800AD410(void) {
+ if (!D_80121210) {
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) {}
+ bzero(_n64ddSegmentBssStart, _n64ddSegmentBssEnd - _n64ddSegmentBssStart);
+ D_80121210 = true;
+ D_80121211 = func_801C6E80();
+ if (D_80121211) {}
}
}
-void func_800ADAF8(void) {
- if (B_80121AE0 && (B_80121AE2 == 0)) {
- B_80121AE0 = false;
+void func_800AD488(void) {
+ if (D_80121210 && (D_80121212 == 0)) {
+ D_80121210 = false;
}
}
diff --git a/src/code/code_n64dd_800AD4C0.c b/src/code/code_n64dd_800AD4C0.c
index ed1477f93..3f1488c66 100644
--- a/src/code/code_n64dd_800AD4C0.c
+++ b/src/code/code_n64dd_800AD4C0.c
@@ -2,12 +2,8 @@
#include "fault.h"
#include "n64dd.h"
-// TODO functions of unknown prototype
-extern char osGetIntMask[];
-extern char osSetTime[];
-
-n64ddStruct_800FF4B0_pointers D_800FF4B0 = {
- func_801C8510_unknown,
+n64ddStruct_800FEE70_pointers D_800FEE70 = {
+ func_801C7C1C,
NULL,
NULL,
Fault_RemoveClient,
@@ -16,7 +12,7 @@ n64ddStruct_800FF4B0_pointers D_800FF4B0 = {
Fault_WaitForInput,
Fault_AddHungupAndCrashImpl,
Fault_AddHungupAndCrash,
- func_800ADC08,
+ func_800AD598,
_Printf,
osCreateThread,
osDestroyThread,
@@ -53,34 +49,34 @@ n64ddStruct_800FF4B0_pointers D_800FF4B0 = {
NULL,
};
-n64ddStruct_80121AF0* B_80121AF0;
+n64ddStruct_80121220* B_80121220;
-n64ddStruct_80121AF0* func_800ADB30(n64ddStruct_80121AF0* arg0) {
- n64ddStruct_800FF4B0_pointers* temp_a0 = func_800ADBD0();
+n64ddStruct_80121220* func_800AD4C0(n64ddStruct_80121220* arg0) {
+ n64ddStruct_800FEE70_pointers* temp_a0 = func_800AD560();
if (arg0 != NULL && arg0->unk_00 != NULL) {
arg0->unk_00(temp_a0, arg0);
}
- B_80121AF0 = arg0;
- return B_80121AF0;
+ B_80121220 = arg0;
+ return B_80121220;
}
-void func_800ADB8C(void) {
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_04 != NULL)) {
- B_80121AF0->unk_04();
+void func_800AD51C(void) {
+ if ((B_80121220 != NULL) && (B_80121220->unk_04 != NULL)) {
+ B_80121220->unk_04();
}
- B_80121AF0 = NULL;
+ B_80121220 = 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;
+n64ddStruct_800FEE70_pointers* func_800AD560(void) {
+ D_800FEE70.unk_04 = 0;
+ D_800FEE70.unk_08 = gRegEditor;
+ D_800FEE70.unk_88 = &gSaveContext;
+ return &D_800FEE70;
}
-void func_800ADC00(void) {
+void func_800AD590(void) {
}
-void func_800ADC08(s32 arg0, s32 arg1, s32 arg2) {
+void func_800AD598(s32 arg0, s32 arg1, s32 arg2) {
}
diff --git a/src/code/game.c b/src/code/game.c
index 07007f6a7..e00bc7406 100644
--- a/src/code/game.c
+++ b/src/code/game.c
@@ -73,8 +73,8 @@ void GameState_SetFBFilter(Gfx** gfxP) {
void func_800C4344(GameState* gameState) {
#if PLATFORM_N64
- if (B_80121AE2 != 0) {
- func_801C86F0_unknown();
+ if (D_80121212 != 0) {
+ func_801C7E78();
}
#elif OOT_DEBUG
Input* selectedInput;
@@ -245,8 +245,8 @@ void func_800C49F4(GraphicsContext* gfxCtx) {
gSPDisplayList(OVERLAY_DISP++, newDlist);
#if PLATFORM_N64
- if (B_80121AE2 != 0) {
- func_801C7760_unknown(&newDlist);
+ if (D_80121212 != 0) {
+ func_801C6EA0(&newDlist);
}
#endif
@@ -271,11 +271,11 @@ void GameState_Update(GameState* gameState) {
gameState->main(gameState);
#if PLATFORM_N64
- if (B_80121AE2 != 0) {
- func_801C86F0_unknown();
+ if (D_80121212 != 0) {
+ func_801C7E78();
}
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_74 != NULL)) {
- B_80121AF0->unk_74(gameState);
+ if ((B_80121220 != NULL) && (B_80121220->unk_74 != NULL)) {
+ B_80121220->unk_74(gameState);
}
#endif
diff --git a/src/code/main.c b/src/code/main.c
index ce1739a5c..248772563 100644
--- a/src/code/main.c
+++ b/src/code/main.c
@@ -60,12 +60,12 @@ void Main(void* arg) {
PreNmiBuff_Init(gAppNmiBufferPtr);
Fault_Init();
#if PLATFORM_N64
- func_800ADA80();
- if ((u8)B_80121AE1 != 0) {
- systemHeapStart = (uintptr_t)&D_801E8090;
+ func_800AD410();
+ if (D_80121211 != 0) {
+ systemHeapStart = (uintptr_t)&_n64ddSegmentEnd;
SysCfb_Init(1);
} else {
- func_800ADAF8();
+ func_800AD488();
systemHeapStart = (uintptr_t)_buffersSegmentEnd;
SysCfb_Init(0);
}
diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c
index 9d2759601..570da1ab0 100644
--- a/src/code/sys_math3d.c
+++ b/src/code/sys_math3d.c
@@ -5,7 +5,7 @@
#include "macros.h"
#include "sys_math3d.h"
-#pragma increment_block_number "gc-eu:108 gc-eu-mq:108 gc-jp:108 gc-jp-ce:108 gc-jp-mq:108 gc-us:108 gc-us-mq:108"
+#pragma increment_block_number "gc-eu:106 gc-eu-mq:106 gc-jp:106 gc-jp-ce:106 gc-jp-mq:106 gc-us:106 gc-us-mq:106"
s32 Math3D_LineVsLineClosestTwoPoints(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB,
Vec3f* lineAClosestToB, Vec3f* lineBClosestToA);
diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c
index b80ac0bb5..b18f3e226 100644
--- a/src/code/z_collision_check.c
+++ b/src/code/z_collision_check.c
@@ -5,7 +5,7 @@
#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"
-#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0"
typedef s32 (*ColChkResetFunc)(PlayState*, Collider*);
typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*);
diff --git a/src/code/z_demo.c b/src/code/z_demo.c
index 56a94816c..6cf3ae941 100644
--- a/src/code/z_demo.c
+++ b/src/code/z_demo.c
@@ -2423,8 +2423,8 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) {
void Cutscene_SetScript(PlayState* play, void* script) {
#if PLATFORM_N64
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_78 != NULL)) {
- if (B_80121AF0->unk_78(play, script, sCutscenesUnknownList)) {
+ if ((B_80121220 != NULL) && (B_80121220->unk_78 != NULL)) {
+ if (B_80121220->unk_78(play, script, sCutscenesUnknownList)) {
return;
}
}
diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c
index 987527712..1e5407165 100644
--- a/src/code/z_kaleido_setup.c
+++ b/src/code/z_kaleido_setup.c
@@ -177,16 +177,16 @@ void KaleidoSetup_Init(PlayState* play) {
View_Init(&pauseCtx->view, play->state.gfxCtx);
#if PLATFORM_N64
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_3C != NULL)) {
- B_80121AF0->unk_3C();
+ if ((B_80121220 != NULL) && (B_80121220->unk_3C != NULL)) {
+ B_80121220->unk_3C();
}
#endif
}
void KaleidoSetup_Destroy(PlayState* play) {
#if PLATFORM_N64
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_40 != NULL)) {
- B_80121AF0->unk_40();
+ if ((B_80121220 != NULL) && (B_80121220->unk_40 != NULL)) {
+ B_80121220->unk_40();
}
#endif
}
diff --git a/src/code/z_play.c b/src/code/z_play.c
index 084ef4ddc..c650cbd6c 100644
--- a/src/code/z_play.c
+++ b/src/code/z_play.c
@@ -243,8 +243,8 @@ void Play_Destroy(GameState* thisx) {
ZeldaArena_Cleanup();
#if PLATFORM_N64
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_14 != NULL)) {
- B_80121AF0->unk_14(this);
+ if ((B_80121220 != NULL) && (B_80121220->unk_14 != NULL)) {
+ B_80121220->unk_14(this);
}
#endif
@@ -279,8 +279,8 @@ void Play_Init(GameState* thisx) {
GameState_Realloc(&this->state, 0x1D4790);
#if PLATFORM_N64
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_10 != NULL)) {
- B_80121AF0->unk_10(this);
+ if ((B_80121220 != NULL) && (B_80121220->unk_10 != NULL)) {
+ B_80121220->unk_10(this);
}
#endif
@@ -388,7 +388,7 @@ void Play_Init(GameState* thisx) {
#endif
#if PLATFORM_N64
- if ((B_80121AF0 != NULL && B_80121AF0->unk_54 != NULL && B_80121AF0->unk_54(this))) {
+ if ((B_80121220 != NULL && B_80121220->unk_54 != NULL && B_80121220->unk_54(this))) {
} else {
Cutscene_HandleEntranceTriggers(this);
}
@@ -1499,7 +1499,7 @@ void* Play_LoadFileFromDiskDrive(PlayState* this, RomFile* file) {
size = file->vromEnd - file->vromStart;
allocp = THA_AllocTailAlign16(&this->state.tha, size);
- func_801C8510_unknown(allocp, file->vromStart, size);
+ func_801C7C1C(allocp, file->vromStart, size);
return allocp;
}
@@ -1537,8 +1537,8 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
u32 size;
#if PLATFORM_N64
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_48 != NULL)) {
- scene = B_80121AF0->unk_48(sceneId, gSceneTable);
+ if ((B_80121220 != NULL) && (B_80121220->unk_48 != NULL)) {
+ scene = B_80121220->unk_48(sceneId, gSceneTable);
} else {
scene = &gSceneTable[sceneId];
scene->unk_13 = 0;
@@ -1555,7 +1555,7 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
PRINTF("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f);
#if PLATFORM_N64
- if ((B_80121AF0 != NULL) && (scene->unk_12 > 0)) {
+ if ((B_80121220 != NULL) && (scene->unk_12 > 0)) {
this->sceneSegment = Play_LoadFileFromDiskDrive(this, &scene->sceneFile);
scene->unk_13 = 1;
} else {
@@ -1574,8 +1574,8 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
Play_InitScene(this, spawn);
#if PLATFORM_N64
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_0C != NULL)) {
- B_80121AF0->unk_0C(this);
+ if ((B_80121220 != NULL) && (B_80121220->unk_0C != NULL)) {
+ B_80121220->unk_0C(this);
}
#endif
diff --git a/src/code/z_room.c b/src/code/z_room.c
index 2b727deea..5a88f1c28 100644
--- a/src/code/z_room.c
+++ b/src/code/z_room.c
@@ -623,8 +623,8 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1);
#if PLATFORM_N64
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_08 != NULL)) {
- B_80121AF0->unk_08(play, roomCtx, roomNum);
+ if ((B_80121220 != NULL) && (B_80121220->unk_08 != NULL)) {
+ B_80121220->unk_08(play, roomCtx, roomNum);
} else {
DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0,
&roomCtx->loadQueue, NULL, "../z_room.c", 1036);
diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c
index 2879a3fa4..6767993f0 100644
--- a/src/code/z_scene_table.c
+++ b/src/code/z_scene_table.c
@@ -196,8 +196,8 @@ SceneDrawConfigFunc sSceneDrawConfigs[SDC_MAX] = {
};
void Scene_Draw(PlayState* play) {
- if ((B_80121AF0 != NULL) && (B_80121AF0->unk_6C != NULL)) {
- B_80121AF0->unk_6C(play, sSceneDrawConfigs);
+ if ((B_80121220 != NULL) && (B_80121220->unk_6C != NULL)) {
+ B_80121220->unk_6C(play, sSceneDrawConfigs);
return;
}