summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Alex W. Jackson <alex.w.jackson@gmail.com>2015-02-23 11:48:04 -0500
committer Alex W. Jackson <alex.w.jackson@gmail.com>2015-02-23 11:48:04 -0500
commit660442b985901d6184b5bc14c838f45eb53f6a4c (patch)
tree1d437897a9a7b85efadaa9ad47d6896e174c5912
parent888b26da776c96a56e61f51b565060f7431e395c (diff)
thedeep.c: use configured banking (nw)
-rw-r--r--src/mame/drivers/thedeep.c30
-rw-r--r--src/mame/includes/thedeep.h2
2 files changed, 4 insertions, 28 deletions
diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c
index 86e04014489..cc3db30a16d 100644
--- a/src/mame/drivers/thedeep.c
+++ b/src/mame/drivers/thedeep.c
@@ -51,18 +51,18 @@ WRITE8_MEMBER(thedeep_state::sound_w)
void thedeep_state::machine_start()
{
+ membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000);
save_item(NAME(m_nmi_enable));
save_item(NAME(m_protection_command));
save_item(NAME(m_protection_data));
save_item(NAME(m_protection_index));
save_item(NAME(m_protection_irq));
- save_item(NAME(m_rombank));
save_item(NAME(m_mcu_p3_reg));
}
void thedeep_state::machine_reset()
{
- membank("bank1")->set_base(memregion("maincpu")->base() + 0x10000 + 0 * 0x4000);
+ membank("bank1")->set_entry(0);
m_scroll[0] = 0;
m_scroll[1] = 0;
m_scroll[2] = 0;
@@ -70,7 +70,6 @@ void thedeep_state::machine_reset()
m_protection_command = 0;
m_protection_index = -1;
m_protection_irq = 0;
- m_rombank = -1;
}
WRITE8_MEMBER(thedeep_state::protection_w)
@@ -90,15 +89,7 @@ WRITE8_MEMBER(thedeep_state::protection_w)
case 0x31:
case 0x32:
case 0x33:
- {
- UINT8 *rom;
- int new_rombank = m_protection_command & 3;
- if (m_rombank == new_rombank) break;
- m_rombank = new_rombank;
- rom = memregion("maincpu")->base();
- membank("bank1")->set_base(rom + 0x10000 + m_rombank * 0x4000);
-
- }
+ membank("bank1")->set_entry(m_protection_command & 3);
break;
case 0x59:
@@ -195,23 +186,10 @@ ADDRESS_MAP_END
***************************************************************************/
-void thedeep_state::maincpu_bankswitch(UINT8 bank_trig)
-{
- UINT8 *rom;
- int new_rombank = bank_trig & 3;
-
- if (m_rombank == new_rombank)
- return;
- m_rombank = new_rombank;
- rom = memregion("maincpu")->base();
- membank("bank1")->set_base(rom + 0x10000 + m_rombank * 0x4000);
-
-}
-
WRITE8_MEMBER(thedeep_state::p1_w)
{
flip_screen_set((data & 1) ^ 1);
- maincpu_bankswitch((data & 6) >> 1);
+ membank("bank1")->set_entry((data & 6) >> 1);
logerror("P1 %02x\n",data);
}
diff --git a/src/mame/includes/thedeep.h b/src/mame/includes/thedeep.h
index d074b169fdf..9d645964b23 100644
--- a/src/mame/includes/thedeep.h
+++ b/src/mame/includes/thedeep.h
@@ -31,7 +31,6 @@ public:
UINT8 m_protection_data;
int m_protection_index;
int m_protection_irq;
- int m_rombank;
tilemap_t *m_tilemap_0;
tilemap_t *m_tilemap_1;
UINT8 m_mcu_p3_reg;
@@ -62,7 +61,6 @@ public:
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
- void maincpu_bankswitch(UINT8 bank_trig);
INTERRUPT_GEN_MEMBER(mcu_irq);
TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
};