From 115bb9936c5cd3faf955d7eb1e251a94e4744b7b Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Tue, 13 Mar 2018 07:36:43 +0100 Subject: Address maps macros removal, pass 1 [O. Galibert] --- src/mame/drivers/tomcat.cpp | 61 ++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 29 deletions(-) (limited to 'src/mame/drivers/tomcat.cpp') diff --git a/src/mame/drivers/tomcat.cpp b/src/mame/drivers/tomcat.cpp index d7ccfcca97a..0a433512fc4 100644 --- a/src/mame/drivers/tomcat.cpp +++ b/src/mame/drivers/tomcat.cpp @@ -248,24 +248,26 @@ WRITE8_MEMBER(tomcat_state::tomcat_nvram_w) m_nvram[offset] = data; } -ADDRESS_MAP_START(tomcat_state::tomcat_map) - AM_RANGE(0x000000, 0x00ffff) AM_ROM - AM_RANGE(0x402000, 0x402001) AM_READ(tomcat_adcread_r) AM_WRITE(tomcat_adcon_w) - AM_RANGE(0x404000, 0x404001) AM_READ(tomcat_inputs_r) AM_DEVWRITE("avg", avg_tomcat_device, go_word_w) - AM_RANGE(0x406000, 0x406001) AM_DEVWRITE("avg", avg_tomcat_device, reset_word_w) - AM_RANGE(0x408000, 0x408001) AM_READ(tomcat_inputs2_r) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) - AM_RANGE(0x40a000, 0x40a001) AM_READWRITE(tomcat_320bio_r, tomcat_irqclr_w) - AM_RANGE(0x40e000, 0x40e01f) AM_WRITE(main_latch_w) - AM_RANGE(0x800000, 0x803fff) AM_RAM AM_SHARE("vectorram") - AM_RANGE(0xffa000, 0xffbfff) AM_RAM AM_SHARE("shared_ram") - AM_RANGE(0xffc000, 0xffcfff) AM_RAM - AM_RANGE(0xffd000, 0xffdfff) AM_DEVREADWRITE8("m48t02", timekeeper_device, read, write, 0xff00) - AM_RANGE(0xffd000, 0xffdfff) AM_READWRITE8(tomcat_nvram_r, tomcat_nvram_w, 0x00ff) -ADDRESS_MAP_END - -ADDRESS_MAP_START(tomcat_state::dsp_map) - AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("shared_ram") -ADDRESS_MAP_END +void tomcat_state::tomcat_map(address_map &map) +{ + map(0x000000, 0x00ffff).rom(); + map(0x402000, 0x402001).r(this, FUNC(tomcat_state::tomcat_adcread_r)).w(this, FUNC(tomcat_state::tomcat_adcon_w)); + map(0x404000, 0x404001).r(this, FUNC(tomcat_state::tomcat_inputs_r)).w("avg", FUNC(avg_tomcat_device::go_word_w)); + map(0x406000, 0x406001).w("avg", FUNC(avg_tomcat_device::reset_word_w)); + map(0x408000, 0x408001).r(this, FUNC(tomcat_state::tomcat_inputs2_r)).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); + map(0x40a000, 0x40a001).rw(this, FUNC(tomcat_state::tomcat_320bio_r), FUNC(tomcat_state::tomcat_irqclr_w)); + map(0x40e000, 0x40e01f).w(this, FUNC(tomcat_state::main_latch_w)); + map(0x800000, 0x803fff).ram().share("vectorram"); + map(0xffa000, 0xffbfff).ram().share("shared_ram"); + map(0xffc000, 0xffcfff).ram(); + map(0xffd000, 0xffdfff).rw("m48t02", FUNC(timekeeper_device::read), FUNC(timekeeper_device::write)).umask16(0xff00); + map(0xffd000, 0xffdfff).rw(this, FUNC(tomcat_state::tomcat_nvram_r), FUNC(tomcat_state::tomcat_nvram_w)).umask16(0x00ff); +} + +void tomcat_state::dsp_map(address_map &map) +{ + map(0x0000, 0x0fff).ram().share("shared_ram"); +} WRITE8_MEMBER(tomcat_state::soundlatches_w) @@ -282,17 +284,18 @@ WRITE8_MEMBER(tomcat_state::soundlatches_w) } } -ADDRESS_MAP_START(tomcat_state::sound_map) - AM_RANGE(0x0000, 0x1fff) AM_RAM - AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x3000, 0x30df) AM_WRITE(soundlatches_w) - AM_RANGE(0x30e0, 0x30e0) AM_NOP // COINRD Inputs: D7 = Coin L, D6 = Coin R, D5 = SOUNDFLAG - AM_RANGE(0x5000, 0x507f) AM_RAM // 6532 ram - AM_RANGE(0x5080, 0x509f) AM_DEVREADWRITE("riot", riot6532_device, read, write) - AM_RANGE(0x6000, 0x601f) AM_DEVREADWRITE("pokey1", pokey_device, read, write) - AM_RANGE(0x7000, 0x701f) AM_DEVREADWRITE("pokey2", pokey_device, read, write) - AM_RANGE(0x8000, 0xffff) AM_NOP // main sound program rom -ADDRESS_MAP_END +void tomcat_state::sound_map(address_map &map) +{ + map(0x0000, 0x1fff).ram(); + map(0x2000, 0x2001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x3000, 0x30df).w(this, FUNC(tomcat_state::soundlatches_w)); + map(0x30e0, 0x30e0).noprw(); // COINRD Inputs: D7 = Coin L, D6 = Coin R, D5 = SOUNDFLAG + map(0x5000, 0x507f).ram(); // 6532 ram + map(0x5080, 0x509f).rw("riot", FUNC(riot6532_device::read), FUNC(riot6532_device::write)); + map(0x6000, 0x601f).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write)); + map(0x7000, 0x701f).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write)); + map(0x8000, 0xffff).noprw(); // main sound program rom +} static INPUT_PORTS_START( tomcat ) PORT_START("IN0") /* INPUTS */ -- cgit v1.2.3-70-g09d2