mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-12 19:04:38 +00:00
Match a few functions (#324)
* match a few functions * run formath.sh * minor fixes
This commit is contained in:
parent
d3b88e1b1c
commit
d8d789d2a5
25 changed files with 145 additions and 1528 deletions
|
@ -65,74 +65,74 @@ void func_800BC5E0(GlobalContext* globalCtx, s32 transitionType) {
|
|||
transitionCtx->setType = TransitionCircle_SetType;
|
||||
transitionCtx->setColor = TransitionCircle_SetColor;
|
||||
transitionCtx->setEnvColor = TransitionCircle_SetEnvColor;
|
||||
return;
|
||||
} else {
|
||||
switch (transitionCtx->transitionType) {
|
||||
case 1:
|
||||
transitionCtx->init = TransitionTriforce_Init;
|
||||
transitionCtx->destroy = TransitionTriforce_Destroy;
|
||||
transitionCtx->start = TransitionTriforce_Start;
|
||||
transitionCtx->isDone = TransitionTriforce_IsDone;
|
||||
transitionCtx->draw = TransitionTriforce_Draw;
|
||||
transitionCtx->update = TransitionTriforce_Update;
|
||||
transitionCtx->setType = TransitionTriforce_SetType;
|
||||
transitionCtx->setColor = TransitionTriforce_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
break;
|
||||
case 0:
|
||||
case 8:
|
||||
transitionCtx->init = TransitionWipe_Init;
|
||||
transitionCtx->destroy = TransitionWipe_Destroy;
|
||||
transitionCtx->start = TransitionWipe_Start;
|
||||
transitionCtx->isDone = TransitionWipe_IsDone;
|
||||
transitionCtx->draw = TransitionWipe_Draw;
|
||||
transitionCtx->update = TransitionWipe_Update;
|
||||
transitionCtx->setType = TransitionWipe_SetType;
|
||||
transitionCtx->setColor = TransitionWipe_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
transitionCtx->init = TransitionFade_Init;
|
||||
transitionCtx->destroy = TransitionFade_Destroy;
|
||||
transitionCtx->start = TransitionFade_Start;
|
||||
transitionCtx->isDone = TransitionFade_IsDone;
|
||||
transitionCtx->draw = TransitionFade_Draw;
|
||||
transitionCtx->update = TransitionFade_Update;
|
||||
transitionCtx->setType = TransitionFade_SetType;
|
||||
transitionCtx->setColor = TransitionFade_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
globalCtx->transitionMode = 4;
|
||||
break;
|
||||
case 11:
|
||||
globalCtx->transitionMode = 10;
|
||||
break;
|
||||
case 12:
|
||||
globalCtx->transitionMode = 7;
|
||||
break;
|
||||
case 14:
|
||||
globalCtx->transitionMode = 12;
|
||||
break;
|
||||
case 15:
|
||||
globalCtx->transitionMode = 14;
|
||||
break;
|
||||
case 16:
|
||||
globalCtx->transitionMode = 16;
|
||||
break;
|
||||
default:
|
||||
Fault_AddHungupAndCrash("../z_play.c", 2290);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (transitionCtx->transitionType) {
|
||||
case 1:
|
||||
transitionCtx->init = TransitionTriforce_Init;
|
||||
transitionCtx->destroy = TransitionTriforce_Destroy;
|
||||
transitionCtx->start = TransitionTriforce_Start;
|
||||
transitionCtx->isDone = TransitionTriforce_IsDone;
|
||||
transitionCtx->draw = TransitionTriforce_Draw;
|
||||
transitionCtx->update = TransitionTriforce_Update;
|
||||
transitionCtx->setType = TransitionTriforce_SetType;
|
||||
transitionCtx->setColor = TransitionTriforce_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
return;
|
||||
case 0:
|
||||
case 8:
|
||||
transitionCtx->init = TransitionWipe_Init;
|
||||
transitionCtx->destroy = TransitionWipe_Destroy;
|
||||
transitionCtx->start = TransitionWipe_Start;
|
||||
transitionCtx->isDone = TransitionWipe_IsDone;
|
||||
transitionCtx->draw = TransitionWipe_Draw;
|
||||
transitionCtx->update = TransitionWipe_Update;
|
||||
transitionCtx->setType = TransitionWipe_SetType;
|
||||
transitionCtx->setColor = TransitionWipe_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
return;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
transitionCtx->init = TransitionFade_Init;
|
||||
transitionCtx->destroy = TransitionFade_Destroy;
|
||||
transitionCtx->start = TransitionFade_Start;
|
||||
transitionCtx->isDone = TransitionFade_IsDone;
|
||||
transitionCtx->draw = TransitionFade_Draw;
|
||||
transitionCtx->update = TransitionFade_Update;
|
||||
transitionCtx->setType = TransitionFade_SetType;
|
||||
transitionCtx->setColor = TransitionFade_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
return;
|
||||
case 9:
|
||||
case 10:
|
||||
globalCtx->transitionMode = 4;
|
||||
return;
|
||||
case 11:
|
||||
globalCtx->transitionMode = 10;
|
||||
return;
|
||||
case 12:
|
||||
globalCtx->transitionMode = 7;
|
||||
return;
|
||||
case 14:
|
||||
globalCtx->transitionMode = 12;
|
||||
return;
|
||||
case 15:
|
||||
globalCtx->transitionMode = 14;
|
||||
return;
|
||||
case 16:
|
||||
globalCtx->transitionMode = 16;
|
||||
return;
|
||||
}
|
||||
|
||||
Fault_AddHungupAndCrash("../z_play.c", 2290);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC5E0.s")
|
||||
|
@ -1589,19 +1589,15 @@ Camera* Gameplay_GetCamera(GlobalContext* globalCtx, s16 camId) {
|
|||
}
|
||||
|
||||
s32 func_800C04D8(GlobalContext* globalCtx, s16 camId, Vec3f* arg2, Vec3f* arg3) {
|
||||
u32 ret;
|
||||
s32 ret = 0;
|
||||
s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId;
|
||||
Camera* camera;
|
||||
Camera* camera = globalCtx->cameraPtrs[camIdx];
|
||||
Player* player;
|
||||
|
||||
camera = globalCtx->cameraPtrs[camIdx];
|
||||
|
||||
ret = Camera_SetParam(camera, 1, arg2);
|
||||
ret *= 2;
|
||||
ret |= Camera_SetParam(camera, 1, arg2);
|
||||
ret <<= 1;
|
||||
ret |= Camera_SetParam(camera, 2, arg3);
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
camera->dist = Math3D_Vec3f_DistXYZ(arg2, arg3);
|
||||
|
||||
player = camera->player;
|
||||
|
@ -1618,22 +1614,16 @@ s32 func_800C04D8(GlobalContext* globalCtx, s16 camId, Vec3f* arg2, Vec3f* arg3)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// missing an extra stack store/load instruction pair
|
||||
s32 func_800C05E4(GlobalContext* globalCtx, s16 camId, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4) {
|
||||
u32 ret;
|
||||
s32 ret = 0;
|
||||
s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId;
|
||||
Camera* camera;
|
||||
Camera* camera = globalCtx->cameraPtrs[camIdx];
|
||||
Player* player;
|
||||
|
||||
camera = globalCtx->cameraPtrs[camIdx];
|
||||
|
||||
if (1) {} // Probably necessary to match
|
||||
|
||||
ret = Camera_SetParam(camera, 1, arg2);
|
||||
ret *= 2;
|
||||
ret |= Camera_SetParam(camera, 1, arg2);
|
||||
ret <<= 1;
|
||||
ret |= Camera_SetParam(camera, 2, arg3);
|
||||
ret *= 2;
|
||||
ret <<= 1;
|
||||
ret |= Camera_SetParam(camera, 4, arg4);
|
||||
|
||||
camera->dist = Math3D_Vec3f_DistXYZ(arg2, arg3);
|
||||
|
@ -1651,18 +1641,12 @@ s32 func_800C05E4(GlobalContext* globalCtx, s16 camId, Vec3f* arg2, Vec3f* arg3,
|
|||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C05E4.s")
|
||||
#endif
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// missing an extra move instruction
|
||||
s32 func_800C0704(GlobalContext* globalCtx, s16 camId, f32 arg2) {
|
||||
return (Camera_SetParam(globalCtx->cameraPtrs[camId], 32, &arg2) & 1);
|
||||
s32 ret = Camera_SetParam(globalCtx->cameraPtrs[camId], 32, &arg2) & 1;
|
||||
if (1) {}
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0704.s")
|
||||
#endif
|
||||
|
||||
s32 func_800C0744(GlobalContext* globalCtx, s16 camId, s16 arg2) {
|
||||
s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue