1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 09:45:02 +00:00

Cleanup pad's in z_scene_table.c (#1215)

* cleanup

* More cleanup
This commit is contained in:
engineer124 2022-05-08 00:10:06 +10:00 committed by GitHub
parent ca77b26c90
commit 5cc5cf5a7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 57 deletions

View file

@ -26,7 +26,7 @@ void TransitionFade_Start(void* thisx) {
this->fadeColor.a = 0;
break;
}
this->isDone = 0;
this->isDone = false;
}
void* TransitionFade_Init(void* thisx) {
@ -51,7 +51,7 @@ void TransitionFade_Update(void* thisx, s32 updateRate) {
this->fadeTimer += updateRate;
if (this->fadeTimer >= gSaveContext.transFadeDuration) {
this->fadeTimer = gSaveContext.transFadeDuration;
this->isDone = 1;
this->isDone = true;
}
if (!gSaveContext.transFadeDuration) {
// "Divide by 0! Zero is included in ZCommonGet fade_speed"
@ -72,7 +72,7 @@ void TransitionFade_Update(void* thisx, s32 updateRate) {
Math_StepToS(&iREG(50), 20, 60);
if (Math_StepToS(&newAlpha, 0, iREG(50))) {
iREG(50) = 0;
this->isDone = 1;
this->isDone = true;
}
}
}

View file

@ -39,7 +39,7 @@ Gfx sWipeSyncDList[] = {
void TransitionWipe_Start(void* thisx) {
TransitionWipe* this = (TransitionWipe*)thisx;
this->isDone = 0;
this->isDone = false;
if (this->direction) {
this->texY = 0x14D;
@ -63,21 +63,18 @@ void TransitionWipe_Destroy(void* thisx) {
void TransitionWipe_Update(void* thisx, s32 updateRate) {
TransitionWipe* this = (TransitionWipe*)thisx;
u8 speed;
if (this->direction != 0) {
speed = gSaveContext.transWipeSpeed;
this->texY += (speed * 3) / updateRate;
this->texY += (((void)0, gSaveContext.transWipeSpeed) * 3) / updateRate;
if (this->texY >= 0x264) {
this->texY = 0x264;
this->isDone = 1;
this->isDone = true;
}
} else {
speed = gSaveContext.transWipeSpeed;
this->texY -= (speed * 3) / updateRate;
if (this->texY < 0x14E) {
this->texY -= (((void)0, gSaveContext.transWipeSpeed) * 3) / updateRate;
if (this->texY <= 0x14D) {
this->texY = 0x14D;
this->isDone = 1;
this->isDone = true;
}
}
}

View file

@ -1852,9 +1852,7 @@ void func_800995DC(GlobalContext* globalCtx) {
gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 128);
{ s32 pad; }
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A2F8[gSaveContext.nightFlag]));
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A2F8[((void)0, gSaveContext.nightFlag)]));
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 4783);
}
@ -1894,7 +1892,7 @@ void func_80099878(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 4905);
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gDCEntranceTextures[gSaveContext.nightFlag]));
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gDCEntranceTextures[((void)0, gSaveContext.nightFlag)]));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sDCLavaFloorTextures[(s32)(gameplayFrames & 14) >> 1]));
gSPSegment(POLY_XLU_DISP++, 0x09,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 256, 0, 64, 32, 1, 0,
@ -1903,8 +1901,6 @@ void func_80099878(GlobalContext* globalCtx) {
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 128, 32, 32, 1, 0,
(gameplayFrames * 2) % 128, 32, 32));
{ s32 pad2[2]; }
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128);
@ -2147,9 +2143,8 @@ void func_8009AFE0(GlobalContext* globalCtx) {
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 3) % 128, 32, 32));
{ s32 pad[2]; }
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sThievesHideoutEntranceTextures[gSaveContext.nightFlag]));
gSPSegment(POLY_XLU_DISP++, 0x08,
SEGMENTED_TO_VIRTUAL(sThievesHideoutEntranceTextures[((void)0, gSaveContext.nightFlag)]));
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 5507);
}
@ -2173,7 +2168,7 @@ void func_8009B0FC(GlobalContext* globalCtx) {
spAC = globalCtx->roomCtx.unk_74[1] & 0xFF;
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A330[gSaveContext.nightFlag]));
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A330[((void)0, gSaveContext.nightFlag)]));
if (spB0 == 1) {
gSPSegment(POLY_OPA_DISP++, 0x08,
@ -2226,8 +2221,6 @@ void func_8009B0FC(GlobalContext* globalCtx) {
Gfx_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 4, 0, 32, 32, 1,
gameplayFrames * 4, 0, 32, 32, 0, 0, 0, 128));
{ s32 pad[2]; }
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 5644);
}
@ -2404,7 +2397,8 @@ void func_8009C3EC(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 6042);
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sIceCavernEntranceTextures[gSaveContext.nightFlag]));
gSPSegment(POLY_XLU_DISP++, 0x08,
SEGMENTED_TO_VIRTUAL(sIceCavernEntranceTextures[((void)0, gSaveContext.nightFlag)]));
gSPSegment(POLY_OPA_DISP++, 0x09,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
@ -2412,8 +2406,6 @@ void func_8009C3EC(GlobalContext* globalCtx) {
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
{ s32 pad[2]; }
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128);
@ -2508,7 +2500,7 @@ void func_8009CC00(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 6290);
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sGTGEntranceTextures[gSaveContext.nightFlag]));
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sGTGEntranceTextures[((void)0, gSaveContext.nightFlag)]));
gSPSegment(POLY_OPA_DISP++, 0x09,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
@ -2516,8 +2508,6 @@ void func_8009CC00(GlobalContext* globalCtx) {
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
{ s32 pad[2]; }
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128);
@ -2602,9 +2592,8 @@ void* sLonLonHouseEntranceTextures[] = {
void func_8009D31C(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 6515);
{ s32 pad[2]; }
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sLonLonHouseEntranceTextures[gSaveContext.nightFlag]));
gSPSegment(POLY_XLU_DISP++, 0x08,
SEGMENTED_TO_VIRTUAL(sLonLonHouseEntranceTextures[((void)0, gSaveContext.nightFlag)]));
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128);
@ -2683,7 +2672,8 @@ void func_8009D758(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 6640);
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sForestTempleEntranceTextures[gSaveContext.nightFlag]));
gSPSegment(POLY_XLU_DISP++, 0x08,
SEGMENTED_TO_VIRTUAL(sForestTempleEntranceTextures[((void)0, gSaveContext.nightFlag)]));
gSPSegment(POLY_XLU_DISP++, 0x09,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
@ -2691,8 +2681,6 @@ void func_8009D758(GlobalContext* globalCtx) {
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
{ s32 pad[2]; }
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128);
@ -2711,9 +2699,8 @@ void* sSpiritTempleEntranceTextures[] = {
void func_8009D974(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 6752);
{ s32 pad[2]; }
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sSpiritTempleEntranceTextures[gSaveContext.nightFlag]));
gSPSegment(POLY_XLU_DISP++, 0x08,
SEGMENTED_TO_VIRTUAL(sSpiritTempleEntranceTextures[((void)0, gSaveContext.nightFlag)]));
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 6762);
}
@ -2773,9 +2760,7 @@ void* sKakarikoWindowTextures[] = {
void func_8009DD5C(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 6890);
{ s32 pad[2]; }
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sKakarikoWindowTextures[gSaveContext.nightFlag]));
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sKakarikoWindowTextures[((void)0, gSaveContext.nightFlag)]));
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128);
@ -2914,9 +2899,8 @@ void func_8009E730(GlobalContext* globalCtx) {
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sZorasDomainEntranceTextures[gSaveContext.nightFlag]));
{ s32 pad[2]; }
gSPSegment(POLY_XLU_DISP++, 0x08,
SEGMENTED_TO_VIRTUAL(sZorasDomainEntranceTextures[((void)0, gSaveContext.nightFlag)]));
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 7147);
}
@ -3042,9 +3026,7 @@ void* D_8012A380[] = {
void func_8009F1B4(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 7363);
{ s32 pad[2]; }
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A380[gSaveContext.nightFlag]));
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A380[((void)0, gSaveContext.nightFlag)]));
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 7371);
}
@ -3177,9 +3159,8 @@ void func_8009F9D0(GlobalContext* globalCtx) {
gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 128);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sGoronCityEntranceTextures[gSaveContext.nightFlag]));
{ s32 pad[2]; }
gSPSegment(POLY_XLU_DISP++, 0x08,
SEGMENTED_TO_VIRTUAL(sGoronCityEntranceTextures[((void)0, gSaveContext.nightFlag)]));
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 7578);
}
@ -3193,9 +3174,8 @@ void* sLonLonRanchWindowTextures[] = {
void func_8009FB74(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 7602);
{ s32 pad[2]; }
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sLonLonRanchWindowTextures[gSaveContext.nightFlag]));
gSPSegment(POLY_OPA_DISP++, 0x08,
SEGMENTED_TO_VIRTUAL(sLonLonRanchWindowTextures[((void)0, gSaveContext.nightFlag)]));
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128);

View file

@ -1072,12 +1072,10 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, GlobalContext* globalCtx, Player* play
void func_80A45288(EnGo2* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s32 linkAge;
if (this->actionFunc != EnGo2_GoronFireGenericAction) {
this->unk_194.unk_18 = player->actor.world.pos;
linkAge = gSaveContext.linkAge;
this->unk_194.unk_14 = D_80A482D8[this->actor.params & 0x1F][linkAge];
this->unk_194.unk_14 = D_80A482D8[this->actor.params & 0x1F][((void)0, gSaveContext.linkAge)];
func_80034A14(&this->actor, &this->unk_194, 4, this->unk_26E);
}
if ((this->actionFunc != EnGo2_SetGetItem) && (this->isAwake == true)) {