Fix hardcoded segment addresses (#5)

This commit is contained in:
GaryOderNichts 2022-05-11 18:07:57 +02:00 committed by GitHub
commit cc6a7caad3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -46,6 +46,8 @@ extern "C" {
using namespace std;
#define SEG_ADDR(seg, addr) (addr | (seg << 24) | 1)
#define SUPPORT_CHECK(x) assert(x)
// SCALE_M_N: upscale/downscale M-bit integer to N-bit
@ -2149,7 +2151,7 @@ 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 == 0xF012DB20 || mtxAddr == 0xF012DB40)
if (mtxAddr == SEG_ADDR(0, 0x12DB20) || mtxAddr == SEG_ADDR(0, 0x12DB40))
mtxAddr = clearMtx;
#ifdef F3DEX_GBI_2

View file

@ -42,7 +42,7 @@ Gfx* VisMono_DrawTexture(VisMono* this, Gfx* gfx)
s32 y;
s32 height = 3;
//u16* tex = D_0F000000;
u16* tex = 0xFF000000;
u16* tex = SEG_ADDR(0xF, 0);
gDPPipeSync(gfx++);
gDPSetOtherMode(gfx++,