mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-13 03:14:38 +00:00
Improve and fix some non matchings (#148)
This commit is contained in:
parent
e29b77919b
commit
c599318a17
11 changed files with 49 additions and 275 deletions
|
@ -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).
|
||||
|
|
|
@ -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++;
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,16 +2,13 @@
|
|||
#include <global.h>
|
||||
#include <ultra64/hardware.h>
|
||||
|
||||
s32 __osSpSetPc(u32 data) {
|
||||
|
||||
s32 __osSpSetPc(void* pc) {
|
||||
register u32 spStatus = HW_REG(SP_STATUS_REG, u32);
|
||||
|
||||
if (!(spStatus & SP_STATUS_HALT)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
else {
|
||||
HW_REG(SP_PC_REG, u32) = data;
|
||||
} else {
|
||||
HW_REG(SP_PC_REG, void*) = pc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -28,7 +28,7 @@ s32 __osSiRawWriteIo(void*, u32);
|
|||
s32 osPiRawReadIo(u32 a0, u32 *a1);
|
||||
void __osSpSetStatus(u32);
|
||||
u32 __osSpGetStatus();
|
||||
s32 __osSpSetPc(u32 data);
|
||||
s32 __osSpSetPc(void*);
|
||||
s32 __osSpDeviceBusy();
|
||||
s32 __osSiDeviceBusy();
|
||||
s32 __osSpRawStartDma(u32 dir, void *sp_ptr, void *dram_ptr, size_t size);
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
}
|
||||
|
||||
static OSTask sTmpTask;
|
||||
|
||||
OSTask* _VirtualToPhysicalTask(OSTask* intp) {
|
||||
OSTask* tp;
|
||||
tp = &sTmpTask;
|
||||
OSTask* tp = &sTmpTask;
|
||||
|
||||
bcopy(intp, tp, sizeof(OSTask));
|
||||
|
||||
_osVirtualToPhysical(tp->t.ucode);
|
||||
|
@ -22,12 +23,9 @@ OSTask* _VirtualToPhysicalTask(OSTask* intp) {
|
|||
return tp;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// very close to matching, just regalloc
|
||||
void osSpTaskLoad(OSTask* intp) {
|
||||
OSTask* tp = _VirtualToPhysicalTask(intp);
|
||||
|
||||
OSTask* tp;
|
||||
tp = _VirtualToPhysicalTask(intp);
|
||||
if (tp->t.flags & OS_TASK_YIELDED) {
|
||||
tp->t.ucode_data = tp->t.yield_data_ptr;
|
||||
tp->t.ucode_data_size = tp->t.yield_data_size;
|
||||
|
@ -38,11 +36,11 @@ void osSpTaskLoad(OSTask* intp) {
|
|||
}
|
||||
osWritebackDCache(tp, sizeof(OSTask));
|
||||
__osSpSetStatus(SP_CLR_SIG0 | SP_CLR_SIG1 | SP_CLR_SIG2 | SP_SET_INTR_BREAK);
|
||||
while (__osSpSetPc(SP_IMEM_START) == -1) {
|
||||
while (__osSpSetPc((void*)SP_IMEM_START) == -1) {
|
||||
;
|
||||
}
|
||||
|
||||
while (__osSpRawStartDma(1, (SP_IMEM_START - sizeof(*tp)), tp, sizeof(OSTask)) == -1) {
|
||||
while (__osSpRawStartDma(1, (void*)(SP_IMEM_START - sizeof(*tp)), tp, sizeof(OSTask)) == -1) {
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -50,13 +48,10 @@ void osSpTaskLoad(OSTask* intp) {
|
|||
;
|
||||
}
|
||||
|
||||
while (__osSpRawStartDma(1, SP_IMEM_START, tp->t.ucode_boot, tp->t.ucode_boot_size) == -1) {
|
||||
while (__osSpRawStartDma(1, (void*)SP_IMEM_START, tp->t.ucode_boot, tp->t.ucode_boot_size) == -1) {
|
||||
;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sptask/osSpTaskLoad.s")
|
||||
#endif
|
||||
|
||||
void osSpTaskStartGo(OSTask* tp) {
|
||||
|
||||
|
|
|
@ -639,31 +639,30 @@ void func_80A544AC(EnHeishi2* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// ordering and float stuff
|
||||
// regalloc differences
|
||||
void func_80A5455C(EnHeishi2* this, GlobalContext* globalCtx) {
|
||||
EnBom* bomb;
|
||||
Vec3f vec;
|
||||
Actor* thisx = &this->actor;
|
||||
s16 temp;
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 5)) {
|
||||
if (func_80106BC8(globalCtx) != 0) {
|
||||
Vec3f pos;
|
||||
s32 rotY;
|
||||
EnBom* bomb;
|
||||
|
||||
func_8002DF54(globalCtx, NULL, 7);
|
||||
func_80106CCC(globalCtx);
|
||||
vec.x = Math_Rand_CenteredFloat(20.0f) + this->unk_274.x;
|
||||
vec.y = Math_Rand_CenteredFloat(20.0f) + (this->unk_274.y - 40.0f);
|
||||
vec.z = Math_Rand_CenteredFloat(20.0f) + (this->unk_274.z - 20.0f);
|
||||
bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, vec.x, vec.y, vec.z, 0,
|
||||
(s16)(Math_Rand_CenteredFloat(7000.0f) + thisx->rotTowardsLinkY), 0, 0);
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 5) && (func_80106BC8(globalCtx) != 0)) {
|
||||
func_8002DF54(globalCtx, NULL, 7);
|
||||
func_80106CCC(globalCtx);
|
||||
|
||||
if (bomb != NULL) {
|
||||
bomb->actor.speedXZ = Math_Rand_CenteredFloat(5.0f) + 10.0f;
|
||||
bomb->actor.velocity.y = Math_Rand_CenteredFloat(5.0f) + 10.0f;
|
||||
}
|
||||
// This is down!
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ これでダウンだ! ☆☆☆☆☆ \n" VT_RST);
|
||||
this->actionFunc = func_80A546DC;
|
||||
pos.x = Math_Rand_CenteredFloat(20.0f) + this->unk_274.x;
|
||||
pos.y = Math_Rand_CenteredFloat(20.0f) + (this->unk_274.y - 40.0f);
|
||||
pos.z = Math_Rand_CenteredFloat(20.0f) + (this->unk_274.z - 20.0f);
|
||||
rotY = Math_Rand_CenteredFloat(7000.0f) + thisx->rotTowardsLinkY;
|
||||
bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, pos.x, pos.y, pos.z, 0, rotY, 0, 0);
|
||||
if (bomb != NULL) {
|
||||
bomb->actor.speedXZ = Math_Rand_CenteredFloat(5.0f) + 10.0f;
|
||||
bomb->actor.velocity.y = Math_Rand_CenteredFloat(5.0f) + 10.0f;
|
||||
}
|
||||
|
||||
// This is down!
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ これでダウンだ! ☆☆☆☆☆ \n" VT_RST);
|
||||
this->actionFunc = func_80A546DC;
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue