forked from Ports/perfect_dark
port: slightly simpler fix for bgTestHitOnObj
This commit is contained in:
1 parent
83c5b4980b
commit
5df6d2fdfb
1 file changed
+3
-7
+3
-7
@@ -3659,23 +3659,19 @@ bool bgTestHitOnObj(struct coord *arg0, struct coord *arg1, struct coord *arg2,
|
|||||||
} else if (gdl->dma.cmd == G_VTX) {
|
} else if (gdl->dma.cmd == G_VTX) {
|
||||||
ptr = var800a6470;
|
ptr = var800a6470;
|
||||||
count = gdl->bytes[GFX_W0_BYTE(1)] & 0xf;
|
count = gdl->bytes[GFX_W0_BYTE(1)] & 0xf;
|
||||||
numvertices = (((u32) gdl->bytes[GFX_W0_BYTE(1)] >> 4) & 0xf) + 1;
|
|
||||||
|
|
||||||
#ifdef PLATFORM_N64
|
#ifdef PLATFORM_N64
|
||||||
offset = (UNSEGADDR(gdl->words.w1) & 0xffffff);
|
offset = (UNSEGADDR(gdl->words.w1) & 0xffffff);
|
||||||
vtx = (Vtx *)((uintptr_t)vertices + offset);
|
|
||||||
#else
|
#else
|
||||||
if (gdl->words.w1 & 1) {
|
if (gdl->words.w1 & 1) {
|
||||||
// segmented address
|
// segmented address
|
||||||
offset = (UNSEGADDR(gdl->words.w1) & 0xffffff);
|
offset = (UNSEGADDR(gdl->words.w1) & 0xffffff);
|
||||||
vtx = (Vtx *)((uintptr_t)vertices + offset);
|
|
||||||
} else {
|
} else {
|
||||||
// linear address
|
// linear address
|
||||||
offset = 0;
|
offset = gdl->words.w1 - (uintptr_t)vertices;
|
||||||
vtx = (Vtx *)gdl->words.w1;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
numvertices = (((u32) gdl->bytes[GFX_W0_BYTE(1)] >> 4) & 0xf) + 1;
|
||||||
|
vtx = (Vtx *)((uintptr_t)vertices + offset);
|
||||||
vtx -= count;
|
vtx -= count;
|
||||||
|
|
||||||
ptr[0] = vtx->x;
|
ptr[0] = vtx->x;
|
||||||
|
|||||||
Reference in new issue
Block a user