mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-16 04:44:44 +00:00
Fix and improve some non matchings (#229)
This commit is contained in:
parent
b55fc9a4e0
commit
4a64c556b0
9 changed files with 62 additions and 779 deletions
|
@ -104,7 +104,7 @@ void Health_UpdateData(GlobalContext* globalCtx) {
|
|||
temp2 *= temp_f0;
|
||||
interfaceCtx->unk_208[1] = (u8)(temp2 + 0x28);
|
||||
temp3 *= temp_f0;
|
||||
interfaceCtx->unk_208[2] = (u8)(temp2 + 0x3C);
|
||||
interfaceCtx->unk_208[2] = (u8)(temp3 + 0x3C);
|
||||
|
||||
D_8015FDD0[0] = 0xFF;
|
||||
D_8015FDD0[1] = 0xFF;
|
||||
|
|
|
@ -351,8 +351,8 @@ s32 func_800AAA9C(View* view) {
|
|||
}
|
||||
|
||||
func_800ABE74(view->eye.x, view->eye.y, view->eye.z);
|
||||
guLookAt(viewing, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z,
|
||||
view->up.x, view->up.y, view->up.z);
|
||||
guLookAt(viewing, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z, view->up.x,
|
||||
view->up.y, view->up.z);
|
||||
|
||||
view->viewing = *viewing;
|
||||
|
||||
|
@ -500,8 +500,8 @@ s32 func_800AB560(View* view) {
|
|||
}
|
||||
|
||||
func_800ABE74(view->eye.x, view->eye.y, view->eye.z);
|
||||
guLookAt(viewing, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z,
|
||||
view->up.x, view->up.y, view->up.z);
|
||||
guLookAt(viewing, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z, view->up.x,
|
||||
view->up.y, view->up.z);
|
||||
|
||||
view->viewing = *viewing;
|
||||
|
||||
|
@ -527,17 +527,23 @@ s32 func_800AB944(View* view) {
|
|||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// saved register usage is wrong, relatively minor reorderings, regalloc
|
||||
// regalloc differences
|
||||
s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
|
||||
GraphicsContext* gfxCtx = view->gfxCtx;
|
||||
Gfx* gfx = *gfxp;
|
||||
GraphicsContext* gfxCtx = view->gfxCtx;
|
||||
s32 width;
|
||||
s32 height;
|
||||
Vp* vp;
|
||||
Mtx* projection;
|
||||
Mtx* viewing;
|
||||
|
||||
arg1 = (view->flags & arg1) | arg1 >> 4;
|
||||
arg1 = (arg1 & view->flags) | (arg1 >> 4);
|
||||
|
||||
if (arg1 & 2) {
|
||||
Vp* vp = Graph_Alloc(view->gfxCtx, sizeof(Vp));
|
||||
vp = Graph_Alloc(view->gfxCtx, sizeof(Vp));
|
||||
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 910);
|
||||
View_ViewportToVp(vp, &view->viewport);
|
||||
|
||||
view->vp = *vp;
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
|
@ -547,7 +553,7 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
|
|||
}
|
||||
|
||||
if (arg1 & 8) {
|
||||
Mtx* projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 921);
|
||||
view->projectionPtr = projection;
|
||||
|
||||
|
@ -558,9 +564,7 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
|
|||
|
||||
gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
} else if (arg1 & 6) {
|
||||
s32 width;
|
||||
s32 height;
|
||||
Mtx* projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 932);
|
||||
view->projectionPtr = projection;
|
||||
|
||||
|
@ -577,7 +581,7 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
|
|||
}
|
||||
|
||||
if (arg1 & 1) {
|
||||
Mtx* viewing = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
viewing = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 948);
|
||||
view->viewingPtr = viewing;
|
||||
|
||||
|
|
|
@ -323,6 +323,7 @@ void BgSpot01Idohashira_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
void func_808AB700(BgSpot01Idohashira* this, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
|
|
@ -172,8 +172,6 @@ static SceneSelectEntry sScenes[] = {
|
|||
{ "title", Select_LoadTitle, 0x0000 },
|
||||
};
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// mostly regalloc, a good amount of instruction ordering. confirmed equivalent in game.
|
||||
void Select_UpdateMenu(SelectContext* this) {
|
||||
Input* controller1;
|
||||
s32 pad;
|
||||
|
@ -315,7 +313,8 @@ void Select_UpdateMenu(SelectContext* this) {
|
|||
}
|
||||
|
||||
if (CHECK_PAD(controller1->press, L_TRIG)) {
|
||||
this->unk_1DC = (++this->unk_1DC + 7) % 7;
|
||||
this->unk_1DC++;
|
||||
this->unk_1DC = (this->unk_1DC + 7) % 7;
|
||||
this->currentScene = this->unk_20C = this->unk_1E0[this->unk_1DC];
|
||||
}
|
||||
|
||||
|
@ -324,10 +323,13 @@ void Select_UpdateMenu(SelectContext* this) {
|
|||
if (this->unk_21C < -7) {
|
||||
this->unk_220 = 0;
|
||||
this->unk_21C = 0;
|
||||
|
||||
this->currentScene++;
|
||||
this->currentScene = (this->currentScene + this->count) % this->count;
|
||||
|
||||
this->currentScene = (++this->currentScene + this->count) % this->count;
|
||||
if (this->currentScene == ((this->unk_20C + this->count + 0x13) % this->count)) {
|
||||
this->unk_20C = (++this->unk_20C + this->count) % this->count;
|
||||
this->unk_20C++;
|
||||
this->unk_20C = (this->unk_20C + this->count) % this->count;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -336,13 +338,16 @@ void Select_UpdateMenu(SelectContext* this) {
|
|||
this->unk_21C = 0;
|
||||
|
||||
if (this->currentScene == this->unk_20C) {
|
||||
this->unk_20C = ((this->unk_20C - 2) + this->count) % this->count;
|
||||
this->unk_20C -= 2;
|
||||
this->unk_20C = (this->unk_20C + this->count) % this->count;
|
||||
}
|
||||
|
||||
this->currentScene = ((--this->currentScene) + this->count) % this->count;
|
||||
this->currentScene--;
|
||||
this->currentScene = (this->currentScene + this->count) % this->count;
|
||||
|
||||
if (this->currentScene == ((this->unk_20C + this->count) % this->count)) {
|
||||
this->unk_20C = (--this->unk_20C + this->count) % this->count;
|
||||
this->unk_20C--;
|
||||
this->unk_20C = (this->unk_20C + this->count) % this->count;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -369,9 +374,6 @@ void Select_UpdateMenu(SelectContext* this) {
|
|||
this->unk_230 = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/gamestates/ovl_select/Select_UpdateMenu.s")
|
||||
#endif
|
||||
|
||||
void Select_PrintMenu(SelectContext* this, GfxPrint* printer) {
|
||||
s32 scene;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue