Fix missing gMtxClear address for pal gc roms (#282)

This commit is contained in:
GaryOderNichts 2022-05-11 21:14:40 +02:00 committed by GitHub
parent a5651742ba
commit bf2825e9a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -31,6 +31,8 @@
#include "../StrHash64.h"
#include "../../SohImGuiImpl.h"
#include "../../Environment.h"
#include "../../GameVersions.h"
#include "../../ResourceMgr.h"
// OTRTODO: fix header files for these
extern "C" {
@ -2151,8 +2153,16 @@ static void gfx_run_dl(Gfx* cmd) {
uintptr_t mtxAddr = cmd->words.w1;
// OTRTODO: Temp way of dealing with gMtxClear. Need something more elegant in the future...
if (mtxAddr == SEG_ADDR(0, 0x12DB20) || mtxAddr == SEG_ADDR(0, 0x12DB40))
mtxAddr = clearMtx;
uint32_t gameVersion = Ship::GlobalCtx2::GetInstance()->GetResourceManager()->GetGameVersion();
if (gameVersion == OOT_PAL_GC) {
if (mtxAddr == SEG_ADDR(0, 0x0FBC20)) {
mtxAddr = clearMtx;
}
} else {
if (mtxAddr == SEG_ADDR(0, 0x12DB20) || mtxAddr == SEG_ADDR(0, 0x12DB40)) {
mtxAddr = clearMtx;
}
}
#ifdef F3DEX_GBI_2
gfx_sp_matrix(C0(0, 8) ^ G_MTX_PUSH, (const int32_t *) seg_addr(mtxAddr));