PGM endian fix

This commit is contained in:
Barry Harris 2011-12-23 11:53:53 +00:00
parent 3bfed100ea
commit ca47b73af1
2 changed files with 26 additions and 32 deletions

View File

@ -693,9 +693,9 @@ static void drgw2_patch()
{
pgm_decrypt_dw2();
*((UINT16*)(PGM68KROM + 0x031098)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x03113e)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x0311ce)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x031098)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
*((UINT16*)(PGM68KROM + 0x03113e)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
*((UINT16*)(PGM68KROM + 0x0311ce)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
}
static INT32 drgw2Init()
@ -737,9 +737,9 @@ static void drgw2100c_patch()
{
pgm_decrypt_dw2();
*((UINT16*)(PGM68KROM + 0x0303bc)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x030462)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x0304F2)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x0303bc)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
*((UINT16*)(PGM68KROM + 0x030462)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
*((UINT16*)(PGM68KROM + 0x0304F2)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
}
static INT32 drgw2100cInit()
@ -781,9 +781,9 @@ static void drgw2100j_patch()
{
pgm_decrypt_dw2();
*((UINT16*)(PGM68KROM + 0x0302C0)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x030366)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x0303F6)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x0302C0)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
*((UINT16*)(PGM68KROM + 0x030366)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
*((UINT16*)(PGM68KROM + 0x0303F6)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
}
static INT32 drgw2100jInit()
@ -825,9 +825,9 @@ static void drgw2100x_patch()
{
pgm_decrypt_dw2();
*((UINT16*)(PGM68KROM + 0x031084)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x03112A)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x0311BA)) = SWAP_WORD_LSB(0x4e93);
*((UINT16*)(PGM68KROM + 0x031084)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
*((UINT16*)(PGM68KROM + 0x03112A)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
*((UINT16*)(PGM68KROM + 0x0311BA)) = BURN_ENDIAN_SWAP_INT16(0x4e93);
}
static INT32 drgw2100xInit()
@ -1673,17 +1673,17 @@ static void puzzli2_decrypt()
{
pgm_decrypt_puzzli2();
*((UINT16*)(PGM68KROM + 0x0268c0)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x0268c2)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x0268c4)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x03877a)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x04cee0)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x0548ec)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x0548fc)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x054948)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x05496A)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x0549FA)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x054A0A)) = SWAP_WORD_LSB(0x4e71);
*((UINT16*)(PGM68KROM + 0x0268c0)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
*((UINT16*)(PGM68KROM + 0x0268c2)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
*((UINT16*)(PGM68KROM + 0x0268c4)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
*((UINT16*)(PGM68KROM + 0x03877a)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
*((UINT16*)(PGM68KROM + 0x04cee0)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
*((UINT16*)(PGM68KROM + 0x0548ec)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
*((UINT16*)(PGM68KROM + 0x0548fc)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
*((UINT16*)(PGM68KROM + 0x054948)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
*((UINT16*)(PGM68KROM + 0x05496A)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
*((UINT16*)(PGM68KROM + 0x0549FA)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
*((UINT16*)(PGM68KROM + 0x054A0A)) = BURN_ENDIAN_SWAP_INT16(0x4e71);
}
static INT32 puzzli2Init()
@ -2104,8 +2104,8 @@ static void kov2pCallback()
{
pgm_decrypt_kov2p();
*((UINT16*)(PGMUSER0 + 0x0000de)) = SWAP_WORD_LSB(0x46c0);
*((UINT16*)(PGMUSER0 + 0x1ffffc)) = SWAP_WORD_LSB(0x9933);
*((UINT16*)(PGMUSER0 + 0x0000de)) = BURN_ENDIAN_SWAP_INT16(0x46c0);
*((UINT16*)(PGMUSER0 + 0x1ffffc)) = BURN_ENDIAN_SWAP_INT16(0x9933);
for (INT32 i = 0x4ed8; i <= 0x4f0c; i+=4) {
PGMUSER0[i] -= 0x08;
@ -2852,7 +2852,7 @@ static void ddp3blkPatchRAM()
SekClose();
// enable asic test
// *((UINT16*)(PGM68KROM + 0x03c0f4)) = SWAP_WORD_LSB(0x0012);
// *((UINT16*)(PGM68KROM + 0x03c0f4)) = BURN_ENDIAN_SWAP_INT16(0x0012);
}
static INT32 ddp3blkInit()

View File

@ -4,12 +4,6 @@
#define HARDWARE_IGS_JAMMAPCB 0x0002
#ifdef LSB_FIRST
#define SWAP_WORD_LSB(x) (((x&0xff)<<8)|((x>>8)&0xff))
#else
#define SWAP_WORD_LSB(x) (x)
#endif
// pgm_run
extern INT32 nPGM68KROMLen;
extern INT32 nPGMSPRColMaskLen;