1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

Improve and fix some non matchings (#148)

This commit is contained in:
Roman971 2020-05-19 21:55:49 +02:00 committed by GitHub
parent e29b77919b
commit c599318a17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 49 additions and 275 deletions

View file

@ -255,8 +255,6 @@ UnkInstrument* Audio_GetUnkInstrument(s32 bankId, s32 unkInstrumentId) {
return unkInstrument;
}
#ifdef NON_MATCHING
// Regalloc in case 1.
s32 func_800E7744(s32 instrument, s32 bankId, s32 instId, UnkInstrument* arg3) {
UnkInstrument* temp_t7;
@ -280,9 +278,7 @@ s32 func_800E7744(s32 instrument, s32 bankId, s32 instId, UnkInstrument* arg3) {
if (instId >= (gAudioContext.gCtlEntries[bankId].numUnkInstruments)) {
return -3;
}
temp_t7 = &gAudioContext.gCtlEntries[bankId].unkInstruments[instId];
temp_t7->unk_0 = arg3->unk_0;
temp_t7->unk_4 = arg3->unk_4;
gAudioContext.gCtlEntries[bankId].unkInstruments[instId] = *arg3;
break;
default:
@ -295,9 +291,6 @@ s32 func_800E7744(s32 instrument, s32 bankId, s32 instId, UnkInstrument* arg3) {
return 0;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_800E7744.s")
#endif
#if 0
// This code is SM64 PAL's version with changes made to build here (and a couple legitimate changes made in the function).

View file

@ -249,10 +249,11 @@ void GameState_ReqPadData(GameState* gameState) {
}
#ifdef NON_MATCHING
// Minor reodering and regalloc
// regalloc differences and additional redundant instructions
void GameState_Update(GameState* gameState) {
GraphicsContext* gfxCtx = gameState->gfxCtx;
GameState_SetFrameBuffer(gameState->gfxCtx);
GameState_SetFrameBuffer(gfxCtx);
gameState->main(gameState);
@ -268,9 +269,9 @@ void GameState_Update(GameState* gameState) {
} else if (SREG(48) > 0) {
func_800ACAF8(&D_80166528, gameState->input, gfxCtx);
gfxCtx->viMode = &D_80166528.viMode;
gfxCtx->viFeatures = D_80166528.viFeatures;
gfxCtx->xScale = 1.0f;
gfxCtx->yScale = 1.0f;
gfxCtx->viFeatures = D_80166528.viFeatures;
}
} else if (SREG(63) >= 2) {
gfxCtx->viMode = &gViConfigMode;
@ -309,20 +310,25 @@ void GameState_Update(GameState* gameState) {
HREG(84) = 0;
}
HREG(82) = CLAMP(HREG(82), 0, 0x30);
if (HREG(82) < 0) {
HREG(82) = 0;
}
if (HREG(82) > 0x30) {
HREG(82) = 0x30;
}
if ((HREG(83) != HREG(82)) || HREG(84) != HREG(81)) {
HREG(83) = HREG(82);
HREG(84) = HREG(81);
gViConfigAdditionalScanLines = HREG(82);
gViConfigYScale = HREG(81) == 0 ? 240.0f / ((u8)HREG(82) + 240.0f) : 1.0f;
gViConfigYScale = HREG(81) == 0 ? 240.0f / (gViConfigAdditionalScanLines + 240.0f) : 1.0f;
D_80009430 = 1;
}
}
if (SREG(94) != 2) {
GameState_Draw(gameState, gameState->gfxCtx);
func_800C49F4(gameState->gfxCtx);
if (R_PAUSE_MENU_MODE != 2) {
GameState_Draw(gameState, gfxCtx);
func_800C49F4(gfxCtx);
}
gameState->frames++;

View file

@ -70,7 +70,7 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
pauseCtx->unk_1EC = 0;
pauseCtx->state++;
} else if (pauseCtx->state == 2 || pauseCtx->state == 9) {
osSyncPrintf("R_PAUSE_MENU_MODE=%d\n", R_PAUSE_MENU_MODE);
osSyncPrintf("PR_KAREIDOSCOPE_MODE=%d\n", R_PAUSE_MENU_MODE);
if (R_PAUSE_MENU_MODE >= 3) {
pauseCtx->state++;
}

View file

@ -1790,7 +1790,7 @@ void Gameplay_TriggerVoidOut(GlobalContext* globalCtx) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = globalCtx->actorCtx.flags.tempCollect;
gSaveContext.respawnFlag = 1;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->nextEntranceIndex = gSaveContext.respawn[0].entranceIndex;
globalCtx->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex;
globalCtx->fadeTransition = 2;
}