summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/missb2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/missb2.cpp')
-rw-r--r--src/mame/drivers/missb2.cpp95
1 files changed, 49 insertions, 46 deletions
diff --git a/src/mame/drivers/missb2.cpp b/src/mame/drivers/missb2.cpp
index e48415eb0f1..d40c46c9547 100644
--- a/src/mame/drivers/missb2.cpp
+++ b/src/mame/drivers/missb2.cpp
@@ -179,56 +179,59 @@ READ8_MEMBER(missb2_state::missb2_oki_r)
/* Memory Maps */
-ADDRESS_MAP_START(missb2_state::maincpu_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
- AM_RANGE(0xc000, 0xdcff) AM_RAM AM_SHARE("videoram")
- AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_SHARE("objectram")
- AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0xf800, 0xf9ff) AM_RAM_DEVWRITE("palette", palette_device, write8) AM_SHARE("palette")
- AM_RANGE(0xfa00, 0xfa00) AM_MIRROR(0x007c) AM_DEVREAD("sound_to_main", generic_latch_8_device, read) AM_DEVWRITE("main_to_sound", generic_latch_8_device, write)
- AM_RANGE(0xfa01, 0xfa01) AM_MIRROR(0x007c) AM_READ(common_sound_semaphores_r)
- AM_RANGE(0xfa03, 0xfa03) AM_MIRROR(0x007c) AM_WRITE(bublbobl_soundcpu_reset_w)
- AM_RANGE(0xfa80, 0xfa80) AM_MIRROR(0x007f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0xfb40, 0xfb40) AM_WRITE(bublbobl_bankswitch_w)
- AM_RANGE(0xfc00, 0xfcff) AM_RAM
- AM_RANGE(0xfd00, 0xfdff) AM_RAM // ???
- AM_RANGE(0xfe00, 0xfe03) AM_RAM // ???
- AM_RANGE(0xfe80, 0xfe83) AM_RAM // ???
- AM_RANGE(0xff00, 0xff00) AM_READ_PORT("DSW1")
- AM_RANGE(0xff01, 0xff01) AM_READ_PORT("DSW2")
- AM_RANGE(0xff02, 0xff02) AM_READ_PORT("P1")
- AM_RANGE(0xff03, 0xff03) AM_READ_PORT("P2")
- AM_RANGE(0xff94, 0xff94) AM_WRITENOP // ???
- AM_RANGE(0xff98, 0xff98) AM_WRITENOP // ???
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(missb2_state::subcpu_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x9000, 0x9fff) AM_ROMBANK("bank2") // ROM data for the background palette ram
- AM_RANGE(0xa000, 0xafff) AM_ROMBANK("bank3") // ROM data for the background palette ram
- AM_RANGE(0xb000, 0xb1ff) AM_ROM // banked ???
- AM_RANGE(0xc000, 0xc1ff) AM_RAM_DEVWRITE("bgpalette", palette_device, write8) AM_SHARE("bgpalette")
- AM_RANGE(0xc800, 0xcfff) AM_RAM // main ???
- AM_RANGE(0xd000, 0xd000) AM_WRITE(missb2_bg_bank_w)
- AM_RANGE(0xd002, 0xd002) AM_WRITENOP
- AM_RANGE(0xd003, 0xd003) AM_RAM AM_SHARE("bgvram")
- AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE("share1")
-ADDRESS_MAP_END
+void missb2_state::maincpu_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0x8000, 0xbfff).bankr("bank1");
+ map(0xc000, 0xdcff).ram().share("videoram");
+ map(0xdd00, 0xdfff).ram().share("objectram");
+ map(0xe000, 0xf7ff).ram().share("share1");
+ map(0xf800, 0xf9ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette");
+ map(0xfa00, 0xfa00).mirror(0x007c).r(m_sound_to_main, FUNC(generic_latch_8_device::read)).w(m_main_to_sound, FUNC(generic_latch_8_device::write));
+ map(0xfa01, 0xfa01).mirror(0x007c).r(this, FUNC(missb2_state::common_sound_semaphores_r));
+ map(0xfa03, 0xfa03).mirror(0x007c).w(this, FUNC(missb2_state::bublbobl_soundcpu_reset_w));
+ map(0xfa80, 0xfa80).mirror(0x007f).w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0xfb40, 0xfb40).w(this, FUNC(missb2_state::bublbobl_bankswitch_w));
+ map(0xfc00, 0xfcff).ram();
+ map(0xfd00, 0xfdff).ram(); // ???
+ map(0xfe00, 0xfe03).ram(); // ???
+ map(0xfe80, 0xfe83).ram(); // ???
+ map(0xff00, 0xff00).portr("DSW1");
+ map(0xff01, 0xff01).portr("DSW2");
+ map(0xff02, 0xff02).portr("P1");
+ map(0xff03, 0xff03).portr("P2");
+ map(0xff94, 0xff94).nopw(); // ???
+ map(0xff98, 0xff98).nopw(); // ???
+}
+
+void missb2_state::subcpu_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0x9000, 0x9fff).bankr("bank2"); // ROM data for the background palette ram
+ map(0xa000, 0xafff).bankr("bank3"); // ROM data for the background palette ram
+ map(0xb000, 0xb1ff).rom(); // banked ???
+ map(0xc000, 0xc1ff).ram().w(m_bgpalette, FUNC(palette_device::write8)).share("bgpalette");
+ map(0xc800, 0xcfff).ram(); // main ???
+ map(0xd000, 0xd000).w(this, FUNC(missb2_state::missb2_bg_bank_w));
+ map(0xd002, 0xd002).nopw();
+ map(0xd003, 0xd003).ram().share("bgvram");
+ map(0xe000, 0xf7ff).ram().share("share1");
+}
// Looks like the original bublbobl code modified to support the OKI M6295.
// due to some really wacky bugs in the way the oki6295 was hacked in place, writes will happen to
// many addresses other than 9000: 9000-9001, 0000-0001, 3827-3828, 44a8-44a9
-ADDRESS_MAP_START(missb2_state::sound_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0x8fff) AM_RAM
- AM_RANGE(0x9000, 0x9000) AM_READWRITE(missb2_oki_r, missb2_oki_w) //AM_MIRROR(0x0fff) ???
- AM_RANGE(0xa000, 0xa001) AM_MIRROR(0x0ffe) AM_DEVREADWRITE("ymsnd", ym3526_device, read, write)
- AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x0ffc) AM_DEVREAD("main_to_sound", generic_latch_8_device, read) AM_DEVWRITE("sound_to_main", generic_latch_8_device, write)
- AM_RANGE(0xb001, 0xb001) AM_MIRROR(0x0ffc) AM_READ(common_sound_semaphores_r) AM_DEVWRITE("soundnmi", input_merger_device, in_set<0>)
- AM_RANGE(0xb002, 0xb002) AM_MIRROR(0x0ffc) AM_DEVWRITE("soundnmi", input_merger_device, in_clear<0>)
- AM_RANGE(0xe000, 0xefff) AM_ROM // space for diagnostic ROM?
-ADDRESS_MAP_END
+void missb2_state::sound_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0x8000, 0x8fff).ram();
+ map(0x9000, 0x9000).rw(this, FUNC(missb2_state::missb2_oki_r), FUNC(missb2_state::missb2_oki_w)); //AM_MIRROR(0x0fff) ???
+ map(0xa000, 0xa001).mirror(0x0ffe).rw("ymsnd", FUNC(ym3526_device::read), FUNC(ym3526_device::write));
+ map(0xb000, 0xb000).mirror(0x0ffc).r(m_main_to_sound, FUNC(generic_latch_8_device::read)).w(m_sound_to_main, FUNC(generic_latch_8_device::write));
+ map(0xb001, 0xb001).mirror(0x0ffc).r(this, FUNC(missb2_state::common_sound_semaphores_r)).w(m_soundnmi, FUNC(input_merger_device::in_set<0>));
+ map(0xb002, 0xb002).mirror(0x0ffc).w(m_soundnmi, FUNC(input_merger_device::in_clear<0>));
+ map(0xe000, 0xefff).rom(); // space for diagnostic ROM?
+}
/* Input Ports */