From 12e44c67c4a6ca8006fbb4a9b54e8990972c7310 Mon Sep 17 00:00:00 2001 From: Nicola Salmoria Date: Sun, 23 Nov 2008 16:05:14 +0000 Subject: [PATCH] removed ROM banking kludge --- src/mame/drivers/bublbobl.c | 16 ++++++++++++---- src/mame/machine/bublbobl.c | 8 ++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c index e257d209411..f9dc357ea0f 100644 --- a/src/mame/drivers/bublbobl.c +++ b/src/mame/drivers/bublbobl.c @@ -1268,17 +1268,23 @@ ROM_START( bub68705 ) ROM_LOAD( "a71-25.41", 0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) ) /* video timing */ ROM_END -static DRIVER_INIT( bublbobl ) + + +static void configure_banks(running_machine* machine) { UINT8 *ROM = memory_region(machine, "main"); + memory_configure_bank(machine, 1, 0, 8, &ROM[0x10000], 0x4000); +} - /* in Bubble Bobble, bank 0 has code falling from 7fff to 8000, */ - /* so I have to copy it there because bank switching wouldn't catch it */ - memcpy(ROM + 0x08000, ROM + 0x10000, 0x4000); +static DRIVER_INIT( bublbobl ) +{ + configure_banks(machine); } static DRIVER_INIT( tokio ) { + configure_banks(machine); + /* preemptively enable video, the bit is not mapped for this game and */ /* I don't know if it even has it. */ bublbobl_video_enable = 1; @@ -1286,6 +1292,8 @@ static DRIVER_INIT( tokio ) static DRIVER_INIT( tokiob ) { + configure_banks(machine); + memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r ); DRIVER_INIT_CALL(tokio); diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c index ff0560eb84f..f10c0ccaa2c 100644 --- a/src/mame/machine/bublbobl.c +++ b/src/mame/machine/bublbobl.c @@ -18,10 +18,8 @@ UINT8 *bublbobl_mcu_sharedram; WRITE8_HANDLER( bublbobl_bankswitch_w ) { - UINT8 *ROM = memory_region(space->machine, "main"); - /* bits 0-2 select ROM bank */ - memory_set_bankptr(space->machine, 1,&ROM[0x10000 + 0x4000 * ((data ^ 4) & 7)]); + memory_set_bank(space->machine, 1, (data ^ 4) & 7); /* bit 3 n.c. */ @@ -41,10 +39,8 @@ WRITE8_HANDLER( bublbobl_bankswitch_w ) WRITE8_HANDLER( tokio_bankswitch_w ) { - UINT8 *ROM = memory_region(space->machine, "main"); - /* bits 0-2 select ROM bank */ - memory_set_bankptr(space->machine, 1,&ROM[0x10000 + 0x4000 * (data & 7)]); + memory_set_bank(space->machine, 1, data & 7); /* bits 3-7 unknown */ }