diff --git a/src/mame/drivers/megadrvb.c b/src/mame/drivers/megadrvb.c index d3525f29ee8..d1814020e6f 100644 --- a/src/mame/drivers/megadrvb.c +++ b/src/mame/drivers/megadrvb.c @@ -738,27 +738,14 @@ DRIVER_INIT_MEMBER(md_boot_state,srmdb) { UINT8* rom = machine().root_device().memregion("maincpu")->base(); - /* todo, reduce bitswaps to single swap */ for (int x = 0x00001; x < 0x40000; x += 2) { - rom[x] = rom[x] ^ 0xff; - rom[x] = BITSWAP8(rom[x], 7,6,5,4,3,2,1,0); - rom[x] = BITSWAP8(rom[x], 1,6,5,4,3,2,7,0); - rom[x] = BITSWAP8(rom[x], 7,6,5,3,4,2,1,0); - rom[x] = BITSWAP8(rom[x], 7,6,5,2,3,4,1,0); - rom[x] = BITSWAP8(rom[x], 5,6,7,4,3,2,1,0); - rom[x] = BITSWAP8(rom[x], 7,5,6,4,3,2,1,0); + rom[x] = BITSWAP8(rom[x] ^ 0xff, 5,1,6,2,4,3,7,0); } for (int x = 0x40001; x < 0x80000; x += 2) { - rom[x] = BITSWAP8(rom[x], 7,6,5,4,3,2,1,0); - rom[x] = BITSWAP8(rom[x], 7,6,1,4,3,2,5,0); - rom[x] = BITSWAP8(rom[x], 7,6,5,4,0,2,1,3); - rom[x] = BITSWAP8(rom[x], 2,6,5,4,3,7,1,0); - rom[x] = BITSWAP8(rom[x], 7,6,5,0,3,2,1,4); - rom[x] = BITSWAP8(rom[x], 7,6,5,1,3,2,4,0); - + rom[x] = BITSWAP8(rom[x] ^ 0x00, 2,6,1,5,0,7,3,4); } // boot vectors don't seem to be valid, so they are patched... diff --git a/src/mame/machine/pgmprot1.c b/src/mame/machine/pgmprot1.c index 3539d37447f..18b78b05748 100644 --- a/src/mame/machine/pgmprot1.c +++ b/src/mame/machine/pgmprot1.c @@ -952,8 +952,11 @@ void command_handler_kov(pgm_arm_type1_state *state, int pc) break; case 0xcc: // Background layer offset - if (state->m_value0 & 0x400) state->m_value0 = -(0x400 - (state->m_value0 & 0x3ff)); - state->m_valueresponse = 0x900000 + ((state->m_kov_cb_value + (state->m_value0 * 0x40)) * 4); + { + int y = state->m_value0; + if (y & 0x400) y = -(0x400 - (y & 0x3ff)); + state->m_valueresponse = 0x900000 + ((state->m_kov_cb_value + (y * 0x40)) * 4); + } break; case 0xd0: // Text palette offset @@ -1015,7 +1018,7 @@ void command_handler_kov(pgm_arm_type1_state *state, int pc) default: state->m_valueresponse = 0x880000; -// bprintf (PRINT_NORMAL, _T("Unknown ASIC27 command: %2.2x data: %4.4x\n"), (data ^ state->m_valuekey) & 0xff, state->m_value0); +// logerror("Unknown ASIC27 command: %2.2x data: %4.4x\n", (data ^ state->m_valuekey) & 0xff, state->m_value0); break; } }