From bde1559da17dea3a098774b1cad080e6615d38d1 Mon Sep 17 00:00:00 2001 From: mamehaze Date: Mon, 8 Dec 2014 22:09:38 +0000 Subject: [PATCH] (nw) --- src/emu/cpu/arcompact/arcompactdasm.c | 8 ++++---- src/mess/drivers/leapster.c | 22 ++++++++++++++++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/emu/cpu/arcompact/arcompactdasm.c b/src/emu/cpu/arcompact/arcompactdasm.c index 4488939fbd5..96742326e68 100644 --- a/src/emu/cpu/arcompact/arcompactdasm.c +++ b/src/emu/cpu/arcompact/arcompactdasm.c @@ -1094,8 +1094,8 @@ int arcompact_handle0e_dasm(DASM_OPS_16) // this is as messed up as the rest of the 16-bit alignment in LE mode... #define GET_LIMM \ - limm = oprom[6] | (oprom[7] << 8); \ - limm |= (oprom[4] << 16) | (oprom[5] << 24); \ + limm = oprom[4] | (oprom[5] << 8); \ + limm |= (oprom[2] << 16) | (oprom[3] << 24); \ int arcompact_handle0e_00_dasm(DASM_OPS_16) @@ -1640,7 +1640,7 @@ CPU_DISASSEMBLE(arcompact) { int size = 2; - UINT32 op = oprom[2] | (oprom[3] << 8); + UINT32 op = oprom[0] | (oprom[1] << 8); output = buffer; UINT8 instruction = ARCOMPACT_OPERATION; @@ -1649,7 +1649,7 @@ CPU_DISASSEMBLE(arcompact) { size = 4; op <<= 16; - op |= oprom[0] | (oprom[1] << 8); + op |= oprom[2] | (oprom[3] << 8); op &= ~0xf8000000; diff --git a/src/mess/drivers/leapster.c b/src/mess/drivers/leapster.c index afa79907a65..58ad61a0886 100644 --- a/src/mess/drivers/leapster.c +++ b/src/mess/drivers/leapster.c @@ -224,6 +224,7 @@ public: UINT32 screen_update_leapster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(leapster_cart); + DECLARE_DRIVER_INIT(leapster); protected: required_device m_cart; @@ -304,6 +305,23 @@ ROM_START(leapstertv) ROM_LOAD( "am29pl160cb-90sf.bin", 0x00000, 0x200000, BAD_DUMP CRC(dc281f1f) SHA1(17588de54ab3bb82801bd5062f3e6aa687412178) ) ROM_END +DRIVER_INIT_MEMBER(leapster_state,leapster) +{ + // the CPU is apparently Little Endian (or 'middle endian') but according to documentation definitely NOT 'Big Endian' + // a regular ROM order with sensible DASM function makes sense for the 16-bit code, but not for the 32-bit code?! (or initial PC isn't at 0 / there is missing code?) -CONS(2003, leapster, 0, 0, leapster, leapster, driver_device, 0, "LeapFrog", "Leapster (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IS_SKELETON ) -CONS(2005, leapstertv, leapster, 0, leapster, leapster, driver_device, 0, "LeapFrog", "Leapster TV (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IS_SKELETON ) + // do PC = 460c0 to see some code + +#if 0 + UINT16 *ROM = (UINT16*)memregion("maincpu")->base(); + for (int i = 0; i < 0x200000 / 2; i += 2) + { + UINT16 temp = ROM[i]; + ROM[i] = ROM[i + 1];; + ROM[i + 1] = temp; + } +#endif +} + +CONS(2003, leapster, 0, 0, leapster, leapster, leapster_state, leapster, "LeapFrog", "Leapster (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IS_SKELETON ) +CONS(2005, leapstertv, leapster, 0, leapster, leapster, leapster_state, leapster, "LeapFrog", "Leapster TV (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IS_SKELETON )