Skip to content

Commit d89baae

Browse files
committed
Fix starg_gm for F3DEX2, prefer LoadGeometryMode
1 parent 5d95c71 commit d89baae

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/gfxdis/gfxdis.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@ static int strarg_tile(char *buf, uint32_t arg)
320320
static int strarg_gm(char *buf, uint32_t arg)
321321
{
322322
int p = 0;
323+
if (arg == 0) {
324+
strappf("0");
325+
return p;
326+
}
323327
if (arg & G_ZBUFFER)
324328
strappf("G_ZBUFFER");
325329
if (arg & G_TEXTURE_ENABLE) {
@@ -3690,12 +3694,12 @@ int gfx_dis_spGeometryMode(struct gfx_insn *insn, uint32_t hi, uint32_t lo)
36903694
{
36913695
uint32_t clearbits = getfield(~hi, 24, 0);
36923696
uint32_t setbits = lo;
3693-
if (clearbits == 0 && setbits != 0)
3697+
if (clearbits == 0x00FFFFFF)
3698+
return gfx_dis_spLoadGeometryMode(insn, hi, lo);
3699+
else if (clearbits == 0)
36943700
return gfx_dis_spSetGeometryMode(insn, hi, lo);
3695-
else if (clearbits != 0 && setbits == 0)
3701+
else if (setbits == 0)
36963702
return gfx_dis_spClearGeometryMode(insn, hi, lo);
3697-
else if (clearbits == 0x00FFFFFF)
3698-
return gfx_dis_spLoadGeometryMode(insn, hi, lo);
36993703
else {
37003704
insn->def = GFX_ID_SPGEOMETRYMODE;
37013705
insn->n_gfx = 1;

0 commit comments

Comments
 (0)