diff options
Diffstat (limited to 'src/mame/drivers/msisaac.cpp')
-rw-r--r-- | src/mame/drivers/msisaac.cpp | 96 |
1 files changed, 49 insertions, 47 deletions
diff --git a/src/mame/drivers/msisaac.cpp b/src/mame/drivers/msisaac.cpp index d82da48efc8..2529f7a44c5 100644 --- a/src/mame/drivers/msisaac.cpp +++ b/src/mame/drivers/msisaac.cpp @@ -174,44 +174,45 @@ WRITE8_MEMBER(msisaac_state::msisaac_mcu_w) #endif } -ADDRESS_MAP_START(msisaac_state::msisaac_map) - AM_RANGE(0x0000, 0xdfff) AM_ROM - AM_RANGE(0xe000, 0xe7ff) AM_RAM - AM_RANGE(0xe800, 0xefff) AM_RAM_DEVWRITE("palette", palette_device, write8) AM_SHARE("palette") - AM_RANGE(0xf000, 0xf000) AM_WRITE(msisaac_bg2_textbank_w) - AM_RANGE(0xf001, 0xf001) AM_WRITENOP //??? - AM_RANGE(0xf002, 0xf002) AM_WRITENOP //??? - - AM_RANGE(0xf060, 0xf060) AM_WRITE(sound_command_w) //sound command - AM_RANGE(0xf061, 0xf061) AM_WRITENOP /*sound_reset*/ //???? - - AM_RANGE(0xf0a3, 0xf0a3) AM_WRITE(ms_unknown_w) //???? written in interrupt routine - - AM_RANGE(0xf0c0, 0xf0c0) AM_WRITE(msisaac_fg_scrollx_w) - AM_RANGE(0xf0c1, 0xf0c1) AM_WRITE(msisaac_fg_scrolly_w) - AM_RANGE(0xf0c2, 0xf0c2) AM_WRITE(msisaac_bg2_scrollx_w) - AM_RANGE(0xf0c3, 0xf0c3) AM_WRITE(msisaac_bg2_scrolly_w) - AM_RANGE(0xf0c4, 0xf0c4) AM_WRITE(msisaac_bg_scrollx_w) - AM_RANGE(0xf0c5, 0xf0c5) AM_WRITE(msisaac_bg_scrolly_w) - - AM_RANGE(0xf0e0, 0xf0e0) AM_READWRITE(msisaac_mcu_r, msisaac_mcu_w) - AM_RANGE(0xf0e1, 0xf0e1) AM_READ(msisaac_mcu_status_r) - - AM_RANGE(0xf080, 0xf080) AM_READ_PORT("DSW1") - AM_RANGE(0xf081, 0xf081) AM_READ_PORT("DSW2") - AM_RANGE(0xf082, 0xf082) AM_READ_PORT("DSW3") - AM_RANGE(0xf083, 0xf083) AM_READ_PORT("IN0") - AM_RANGE(0xf084, 0xf084) AM_READ_PORT("IN1") +void msisaac_state::msisaac_map(address_map &map) +{ + map(0x0000, 0xdfff).rom(); + map(0xe000, 0xe7ff).ram(); + map(0xe800, 0xefff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); + map(0xf000, 0xf000).w(this, FUNC(msisaac_state::msisaac_bg2_textbank_w)); + map(0xf001, 0xf001).nopw(); //??? + map(0xf002, 0xf002).nopw(); //??? + + map(0xf060, 0xf060).w(this, FUNC(msisaac_state::sound_command_w)); //sound command + map(0xf061, 0xf061).nopw(); /*sound_reset*/ //???? + + map(0xf0a3, 0xf0a3).w(this, FUNC(msisaac_state::ms_unknown_w)); //???? written in interrupt routine + + map(0xf0c0, 0xf0c0).w(this, FUNC(msisaac_state::msisaac_fg_scrollx_w)); + map(0xf0c1, 0xf0c1).w(this, FUNC(msisaac_state::msisaac_fg_scrolly_w)); + map(0xf0c2, 0xf0c2).w(this, FUNC(msisaac_state::msisaac_bg2_scrollx_w)); + map(0xf0c3, 0xf0c3).w(this, FUNC(msisaac_state::msisaac_bg2_scrolly_w)); + map(0xf0c4, 0xf0c4).w(this, FUNC(msisaac_state::msisaac_bg_scrollx_w)); + map(0xf0c5, 0xf0c5).w(this, FUNC(msisaac_state::msisaac_bg_scrolly_w)); + + map(0xf0e0, 0xf0e0).rw(this, FUNC(msisaac_state::msisaac_mcu_r), FUNC(msisaac_state::msisaac_mcu_w)); + map(0xf0e1, 0xf0e1).r(this, FUNC(msisaac_state::msisaac_mcu_status_r)); + + map(0xf080, 0xf080).portr("DSW1"); + map(0xf081, 0xf081).portr("DSW2"); + map(0xf082, 0xf082).portr("DSW3"); + map(0xf083, 0xf083).portr("IN0"); + map(0xf084, 0xf084).portr("IN1"); // AM_RANGE(0xf086, 0xf086) AM_READ_PORT("IN2") - AM_RANGE(0xf100, 0xf17f) AM_RAM AM_SHARE("spriteram") //sprites - AM_RANGE(0xf400, 0xf7ff) AM_RAM_WRITE(msisaac_fg_videoram_w) AM_SHARE("videoram") - AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(msisaac_bg2_videoram_w) AM_SHARE("videoram3") - AM_RANGE(0xfc00, 0xffff) AM_RAM_WRITE(msisaac_bg_videoram_w) AM_SHARE("videoram2") + map(0xf100, 0xf17f).ram().share("spriteram"); //sprites + map(0xf400, 0xf7ff).ram().w(this, FUNC(msisaac_state::msisaac_fg_videoram_w)).share("videoram"); + map(0xf800, 0xfbff).ram().w(this, FUNC(msisaac_state::msisaac_bg2_videoram_w)).share("videoram3"); + map(0xfc00, 0xffff).ram().w(this, FUNC(msisaac_state::msisaac_bg_videoram_w)).share("videoram2"); // AM_RANGE(0xf801, 0xf801) AM_WRITE(msisaac_bgcolor_w) // AM_RANGE(0xfc00, 0xfc00) AM_WRITE(flip_screen_w) // AM_RANGE(0xfc03, 0xfc04) AM_WRITE(msisaac_coin_counter_w) -ADDRESS_MAP_END +} WRITE8_MEMBER(msisaac_state::sound_control_0_w) { @@ -240,20 +241,21 @@ WRITE8_MEMBER(msisaac_state::sound_control_1_w) //popmessage("SND1 0=%2x 1=%2x", m_snd_ctrl0, m_snd_ctrl1); } -ADDRESS_MAP_START(msisaac_state::msisaac_sound_map) - AM_RANGE(0x0000, 0x3fff) AM_ROM - AM_RANGE(0x4000, 0x47ff) AM_RAM - AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w) - AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay2", ay8910_device, address_data_w) - AM_RANGE(0x8010, 0x801d) AM_DEVWRITE("msm", msm5232_device, write) - AM_RANGE(0x8020, 0x8020) AM_WRITE(sound_control_0_w) - AM_RANGE(0x8030, 0x8030) AM_WRITE(sound_control_1_w) - AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) - AM_RANGE(0xc001, 0xc001) AM_WRITE(nmi_enable_w) - AM_RANGE(0xc002, 0xc002) AM_WRITE(nmi_disable_w) - AM_RANGE(0xc003, 0xc003) AM_WRITENOP /*???*/ /* this is NOT mixer_enable */ - AM_RANGE(0xe000, 0xffff) AM_READNOP /*space for diagnostic ROM (not dumped, not reachable) */ -ADDRESS_MAP_END +void msisaac_state::msisaac_sound_map(address_map &map) +{ + map(0x0000, 0x3fff).rom(); + map(0x4000, 0x47ff).ram(); + map(0x8000, 0x8001).w("ay1", FUNC(ay8910_device::address_data_w)); + map(0x8002, 0x8003).w("ay2", FUNC(ay8910_device::address_data_w)); + map(0x8010, 0x801d).w(m_msm, FUNC(msm5232_device::write)); + map(0x8020, 0x8020).w(this, FUNC(msisaac_state::sound_control_0_w)); + map(0x8030, 0x8030).w(this, FUNC(msisaac_state::sound_control_1_w)); + map(0xc000, 0xc000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xc001, 0xc001).w(this, FUNC(msisaac_state::nmi_enable_w)); + map(0xc002, 0xc002).w(this, FUNC(msisaac_state::nmi_disable_w)); + map(0xc003, 0xc003).nopw(); /*???*/ /* this is NOT mixer_enable */ + map(0xe000, 0xffff).nopr(); /*space for diagnostic ROM (not dumped, not reachable) */ +} static INPUT_PORTS_START( msisaac ) PORT_START("DSW1") |