summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/overdriv.cpp
diff options
context:
space:
mode:
authorGravatarGravatar Olivier Galibert <galibert@pobox.com>2018-03-13 07:36:43 +0100
committerGravatarGravatar Olivier Galibert <galibert@pobox.com>2018-03-14 14:07:14 +0100
commit115bb9936c5cd3faf955d7eb1e251a94e4744b7b (patch) (github)
treef0230f547f6c750f9974c61479eef28cbe4ad571 /src/mame/drivers/overdriv.cpp
parentf155992daab88ad024cec995428a67108218b51d (diff)
downloadmame-115bb9936c5cd3faf955d7eb1e251a94e4744b7b.tar.bz2
mame-115bb9936c5cd3faf955d7eb1e251a94e4744b7b.zip
Address maps macros removal, pass 1 [O. Galibert]
Diffstat (limited to 'src/mame/drivers/overdriv.cpp')
-rw-r--r--src/mame/drivers/overdriv.cpp112
1 files changed, 58 insertions, 54 deletions
diff --git a/src/mame/drivers/overdriv.cpp b/src/mame/drivers/overdriv.cpp
index e466016fbf6..e624dafca50 100644
--- a/src/mame/drivers/overdriv.cpp
+++ b/src/mame/drivers/overdriv.cpp
@@ -156,32 +156,33 @@ WRITE16_MEMBER(overdriv_state::slave_irq5_assert_w)
m_subcpu->set_input_line(5, HOLD_LINE);
}
-ADDRESS_MAP_START(overdriv_state::overdriv_master_map)
- AM_RANGE(0x000000, 0x03ffff) AM_ROM
- AM_RANGE(0x040000, 0x043fff) AM_RAM /* work RAM */
- AM_RANGE(0x080000, 0x080fff) AM_RAM_DEVWRITE("palette", palette_device, write16) AM_SHARE("palette")
- AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("INPUTS")
- AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("SYSTEM")
- AM_RANGE(0x0e0000, 0x0e0001) AM_WRITENOP /* unknown (always 0x30) */
- AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) /* 053252? (LSB) */
- AM_RANGE(0x140000, 0x140001) AM_WRITENOP //watchdog reset?
- AM_RANGE(0x180000, 0x180001) AM_READ_PORT("PADDLE") AM_WRITENOP // writes 0 at POST and expect that motor busy flag is off, then checks if paddle is at center otherwise throws a "VOLUME ERROR".
- AM_RANGE(0x1c0000, 0x1c001f) AM_DEVWRITE8("k051316_1", k051316_device, ctrl_w, 0xff00)
- AM_RANGE(0x1c8000, 0x1c801f) AM_DEVWRITE8("k051316_2", k051316_device, ctrl_w, 0xff00)
- AM_RANGE(0x1d0000, 0x1d001f) AM_DEVWRITE("k053251", k053251_device, msb_w)
- AM_RANGE(0x1d8000, 0x1d8003) AM_DEVREADWRITE8("k053260_1", k053260_device, main_read, main_write, 0x00ff)
- AM_RANGE(0x1e0000, 0x1e0003) AM_DEVREADWRITE8("k053260_2", k053260_device, main_read, main_write, 0x00ff)
- AM_RANGE(0x1e8000, 0x1e8001) AM_WRITE(overdriv_soundirq_w)
- AM_RANGE(0x1f0000, 0x1f0001) AM_WRITE(cpuA_ctrl_w) /* halt cpu B, coin counter, start lamp, other? */
- AM_RANGE(0x1f8000, 0x1f8001) AM_WRITE(eeprom_w)
- AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x210000, 0x210fff) AM_DEVREADWRITE8("k051316_1", k051316_device, read, write, 0xff00)
- AM_RANGE(0x218000, 0x218fff) AM_DEVREADWRITE8("k051316_2", k051316_device, read, write, 0xff00)
- AM_RANGE(0x220000, 0x220fff) AM_DEVREAD8("k051316_1", k051316_device, rom_r, 0xff00)
- AM_RANGE(0x228000, 0x228fff) AM_DEVREAD8("k051316_2", k051316_device, rom_r, 0xff00)
- AM_RANGE(0x230000, 0x230001) AM_WRITE(slave_irq4_assert_w)
- AM_RANGE(0x238000, 0x238001) AM_WRITE(slave_irq5_assert_w)
-ADDRESS_MAP_END
+void overdriv_state::overdriv_master_map(address_map &map)
+{
+ map(0x000000, 0x03ffff).rom();
+ map(0x040000, 0x043fff).ram(); /* work RAM */
+ map(0x080000, 0x080fff).ram().w("palette", FUNC(palette_device::write16)).share("palette");
+ map(0x0c0000, 0x0c0001).portr("INPUTS");
+ map(0x0c0002, 0x0c0003).portr("SYSTEM");
+ map(0x0e0000, 0x0e0001).nopw(); /* unknown (always 0x30) */
+ map(0x100000, 0x10001f).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)).umask16(0x00ff); /* 053252? (LSB) */
+ map(0x140000, 0x140001).nopw(); //watchdog reset?
+ map(0x180000, 0x180001).portr("PADDLE").nopw(); // writes 0 at POST and expect that motor busy flag is off, then checks if paddle is at center otherwise throws a "VOLUME ERROR".
+ map(0x1c0000, 0x1c001f).w(m_k051316_1, FUNC(k051316_device::ctrl_w)).umask16(0xff00);
+ map(0x1c8000, 0x1c801f).w(m_k051316_2, FUNC(k051316_device::ctrl_w)).umask16(0xff00);
+ map(0x1d0000, 0x1d001f).w(m_k053251, FUNC(k053251_device::msb_w));
+ map(0x1d8000, 0x1d8003).rw("k053260_1", FUNC(k053260_device::main_read), FUNC(k053260_device::main_write)).umask16(0x00ff);
+ map(0x1e0000, 0x1e0003).rw("k053260_2", FUNC(k053260_device::main_read), FUNC(k053260_device::main_write)).umask16(0x00ff);
+ map(0x1e8000, 0x1e8001).w(this, FUNC(overdriv_state::overdriv_soundirq_w));
+ map(0x1f0000, 0x1f0001).w(this, FUNC(overdriv_state::cpuA_ctrl_w)); /* halt cpu B, coin counter, start lamp, other? */
+ map(0x1f8000, 0x1f8001).w(this, FUNC(overdriv_state::eeprom_w));
+ map(0x200000, 0x203fff).ram().share("share1");
+ map(0x210000, 0x210fff).rw(m_k051316_1, FUNC(k051316_device::read), FUNC(k051316_device::write)).umask16(0xff00);
+ map(0x218000, 0x218fff).rw(m_k051316_2, FUNC(k051316_device::read), FUNC(k051316_device::write)).umask16(0xff00);
+ map(0x220000, 0x220fff).r(m_k051316_1, FUNC(k051316_device::rom_r)).umask16(0xff00);
+ map(0x228000, 0x228fff).r(m_k051316_2, FUNC(k051316_device::rom_r)).umask16(0xff00);
+ map(0x230000, 0x230001).w(this, FUNC(overdriv_state::slave_irq4_assert_w));
+ map(0x238000, 0x238001).w(this, FUNC(overdriv_state::slave_irq5_assert_w));
+}
#ifdef UNUSED_FUNCTION
WRITE16_MEMBER( overdriv_state::overdriv_k053246_word_w )
@@ -221,43 +222,46 @@ WRITE16_MEMBER(overdriv_state::objdma_w)
m_k053246->k053246_w(space,5,data,mem_mask);
}
-ADDRESS_MAP_START(overdriv_state::overdriv_slave_map)
- AM_RANGE(0x000000, 0x03ffff) AM_ROM
- AM_RANGE(0x080000, 0x083fff) AM_RAM /* work RAM */
- AM_RANGE(0x0c0000, 0x0c1fff) AM_RAM //AM_DEVREADWRITE("k053250_1", k053250_device, ram_r, ram_w)
- AM_RANGE(0x100000, 0x10000f) AM_DEVREADWRITE("k053250_1", k053250_device, reg_r, reg_w)
- AM_RANGE(0x108000, 0x10800f) AM_DEVREADWRITE("k053250_2", k053250_device, reg_r, reg_w)
- AM_RANGE(0x118000, 0x118fff) AM_DEVREADWRITE("k053246", k053247_device, k053247_word_r, k053247_word_w) // data gets copied to sprite chip with DMA..
- AM_RANGE(0x120000, 0x120001) AM_DEVREAD("k053246", k053247_device, k053246_word_r)
- AM_RANGE(0x128000, 0x128001) AM_READWRITE(cpuB_ctrl_r, cpuB_ctrl_w) /* enable K053247 ROM reading, plus something else */
- AM_RANGE(0x130000, 0x130007) AM_DEVREADWRITE8("k053246", k053247_device, k053246_r,k053246_w,0xffff)
- AM_RANGE(0x130004, 0x130005) AM_WRITE(objdma_w)
+void overdriv_state::overdriv_slave_map(address_map &map)
+{
+ map(0x000000, 0x03ffff).rom();
+ map(0x080000, 0x083fff).ram(); /* work RAM */
+ map(0x0c0000, 0x0c1fff).ram(); //AM_DEVREADWRITE("k053250_1", k053250_device, ram_r, ram_w)
+ map(0x100000, 0x10000f).rw("k053250_1", FUNC(k053250_device::reg_r), FUNC(k053250_device::reg_w));
+ map(0x108000, 0x10800f).rw("k053250_2", FUNC(k053250_device::reg_r), FUNC(k053250_device::reg_w));
+ map(0x118000, 0x118fff).rw(m_k053246, FUNC(k053247_device::k053247_word_r), FUNC(k053247_device::k053247_word_w)); // data gets copied to sprite chip with DMA..
+ map(0x120000, 0x120001).r(m_k053246, FUNC(k053247_device::k053246_word_r));
+ map(0x128000, 0x128001).rw(this, FUNC(overdriv_state::cpuB_ctrl_r), FUNC(overdriv_state::cpuB_ctrl_w)); /* enable K053247 ROM reading, plus something else */
+ map(0x130000, 0x130007).rw(m_k053246, FUNC(k053247_device::k053246_r), FUNC(k053247_device::k053246_w));
+ map(0x130004, 0x130005).w(this, FUNC(overdriv_state::objdma_w));
//AM_RANGE(0x140000, 0x140001) used in later stages, set after writes at 0x208000-0x20bfff range
- AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x208000, 0x20bfff) AM_RAM // sprite indirect table?
- AM_RANGE(0x218000, 0x219fff) AM_DEVREAD("k053250_1", k053250_device, rom_r)
- AM_RANGE(0x220000, 0x221fff) AM_DEVREAD("k053250_2", k053250_device, rom_r)
-ADDRESS_MAP_END
+ map(0x200000, 0x203fff).ram().share("share1");
+ map(0x208000, 0x20bfff).ram(); // sprite indirect table?
+ map(0x218000, 0x219fff).r("k053250_1", FUNC(k053250_device::rom_r));
+ map(0x220000, 0x221fff).r("k053250_2", FUNC(k053250_device::rom_r));
+}
WRITE8_MEMBER(overdriv_state::sound_ack_w)
{
m_audiocpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
}
-ADDRESS_MAP_START(overdriv_state::overdriv_sound_map)
- AM_RANGE(0x0000, 0x0000) AM_WRITE(sound_ack_w)
+void overdriv_state::overdriv_sound_map(address_map &map)
+{
+ map(0x0000, 0x0000).w(this, FUNC(overdriv_state::sound_ack_w));
// 0x012 read during explosions
// 0x180
- AM_RANGE(0x0200, 0x0201) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
- AM_RANGE(0x0400, 0x042f) AM_DEVREADWRITE("k053260_1", k053260_device, read, write)
- AM_RANGE(0x0600, 0x062f) AM_DEVREADWRITE("k053260_2", k053260_device, read, write)
- AM_RANGE(0x0800, 0x0fff) AM_RAM
- AM_RANGE(0x1000, 0xffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(overdriv_state::overdriv_k053260_map)
- AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_REGION("k053260", 0)
-ADDRESS_MAP_END
+ map(0x0200, 0x0201).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write));
+ map(0x0400, 0x042f).rw("k053260_1", FUNC(k053260_device::read), FUNC(k053260_device::write));
+ map(0x0600, 0x062f).rw("k053260_2", FUNC(k053260_device::read), FUNC(k053260_device::write));
+ map(0x0800, 0x0fff).ram();
+ map(0x1000, 0xffff).rom();
+}
+
+void overdriv_state::overdriv_k053260_map(address_map &map)
+{
+ map(0x00000000, 0x001fffff).rom().region("k053260", 0);
+}
/* Both IPT_START1 assignments are needed. The game will reset during */
/* the "continue" sequence if the assignment on the first port */