mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-05 15:34:41 +00:00
[ntsc-1.2] Organize n64dd declarations and convert to 1.0 addresses (#2127)
* Reorganize n64dd declarations * Fix bss * Really fix bss
This commit is contained in:
parent
aa1c7f3155
commit
8153c952f6
31 changed files with 156 additions and 178 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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*);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue