ps2dev / ps2sdk

Homebrew PS2 SDK
Other
935 stars 133 forks source link

add IOP type checker macros #552

Closed israpps closed 6 months ago

israpps commented 6 months ago

This allows us to detect DECKARD models without even opening rom0:DECKARD. Thought it might be useful to have it as part of the SDK headers

israpps commented 6 months ago

this also works on IOP! Where should I move it so it is available to both EE and IOP @rickgaiser ?

If I had 2 guess... iop_regs.h, but I want a 2nd opinion

rickgaiser commented 6 months ago

Yes, https://github.com/ps2dev/ps2sdk/blob/master/common/include/iop_regs.h looks like the right place for this.

There's already 2 defines for the same location (I think?):

#define A_IOP_IRQ_CTRL 0xBF801450
#define A_IOP_SIF_1450 0xBF801450

#define GM_IF ((vu32 *)0x1F801450)

Do these point to the same registers and can they be re-used?

israpps commented 6 months ago

Yes, https://github.com/ps2dev/ps2sdk/blob/master/common/include/iop_regs.h looks like the right place for this.

There's already 2 defines for the same location (I think?):

#define A_IOP_IRQ_CTRL 0xBF801450
#define A_IOP_SIF_1450 0xBF801450

#define GM_IF ((vu32 *)0x1F801450)

Do these point to the same registers and can they be re-used?

The values are not the same I think?

israpps commented 6 months ago

@rickgaiser this should suffice

rickgaiser commented 6 months ago

image

0x1F801450 + 0xA0000000 = 0xBF801450

it's the same address, only accessed differently:

But I'm fine with this change. Merging.