diff options
author | 2018-03-13 07:36:43 +0100 | |
---|---|---|
committer | 2018-03-14 14:07:14 +0100 | |
commit | 115bb9936c5cd3faf955d7eb1e251a94e4744b7b (patch) | |
tree | f0230f547f6c750f9974c61479eef28cbe4ad571 /src/mame/drivers/itech32.cpp | |
parent | f155992daab88ad024cec995428a67108218b51d (diff) |
Address maps macros removal, pass 1 [O. Galibert]
Diffstat (limited to 'src/mame/drivers/itech32.cpp')
-rw-r--r-- | src/mame/drivers/itech32.cpp | 226 |
1 files changed, 117 insertions, 109 deletions
diff --git a/src/mame/drivers/itech32.cpp b/src/mame/drivers/itech32.cpp index 1b41a8b5eec..27e0c9319f2 100644 --- a/src/mame/drivers/itech32.cpp +++ b/src/mame/drivers/itech32.cpp @@ -894,41 +894,43 @@ void itech32_state::nvram_init(nvram_device &nvram, void *base, size_t length) *************************************/ /*------ Time Killers memory layout ------*/ -ADDRESS_MAP_START(itech32_state::timekill_map) - AM_RANGE(0x000000, 0x003fff) AM_RAM AM_SHARE("nvram") - AM_RANGE(0x040000, 0x040001) AM_READ_PORT("P1") - AM_RANGE(0x048000, 0x048001) AM_READ_PORT("P2") - AM_RANGE(0x050000, 0x050001) AM_READ_PORT("SYSTEM") AM_WRITE(timekill_intensity_w) - AM_RANGE(0x058000, 0x058001) AM_READ_PORT("DIPS") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) - AM_RANGE(0x060000, 0x060001) AM_WRITE(timekill_colora_w) - AM_RANGE(0x068000, 0x068001) AM_WRITE(timekill_colorbc_w) - AM_RANGE(0x070000, 0x070001) AM_WRITENOP /* noisy */ - AM_RANGE(0x078000, 0x078001) AM_WRITE(sound_data_w) - AM_RANGE(0x080000, 0x08007f) AM_READWRITE(itech32_video_r, itech32_video_w) AM_SHARE("video") - AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(int1_ack_w) - AM_RANGE(0x0c0000, 0x0c7fff) AM_RAM_DEVWRITE("palette", palette_device, write16) AM_SHARE("palette") - AM_RANGE(0x100000, 0x17ffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("main_rom") -ADDRESS_MAP_END +void itech32_state::timekill_map(address_map &map) +{ + map(0x000000, 0x003fff).ram().share("nvram"); + map(0x040000, 0x040001).portr("P1"); + map(0x048000, 0x048001).portr("P2"); + map(0x050000, 0x050001).portr("SYSTEM").w(this, FUNC(itech32_state::timekill_intensity_w)); + map(0x058000, 0x058001).portr("DIPS").w("watchdog", FUNC(watchdog_timer_device::reset16_w)); + map(0x060000, 0x060001).w(this, FUNC(itech32_state::timekill_colora_w)); + map(0x068000, 0x068001).w(this, FUNC(itech32_state::timekill_colorbc_w)); + map(0x070000, 0x070001).nopw(); /* noisy */ + map(0x078000, 0x078001).w(this, FUNC(itech32_state::sound_data_w)); + map(0x080000, 0x08007f).rw(this, FUNC(itech32_state::itech32_video_r), FUNC(itech32_state::itech32_video_w)).share("video"); + map(0x0a0000, 0x0a0001).w(this, FUNC(itech32_state::int1_ack_w)); + map(0x0c0000, 0x0c7fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x100000, 0x17ffff).rom().region("user1", 0).share("main_rom"); +} /*------ BloodStorm and later games memory layout ------*/ -ADDRESS_MAP_START(itech32_state::bloodstm_map) - AM_RANGE(0x000000, 0x00ffff) AM_RAM AM_SHARE("nvram") - AM_RANGE(0x080000, 0x080001) AM_READ_PORT("P1") AM_WRITE(int1_ack_w) - AM_RANGE(0x100000, 0x100001) AM_READ_PORT("P2") - AM_RANGE(0x180000, 0x180001) AM_READ_PORT("P3") - AM_RANGE(0x200000, 0x200001) AM_READ_PORT("P4") AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) - AM_RANGE(0x280000, 0x280001) AM_READ_PORT("DIPS") - AM_RANGE(0x300000, 0x300001) AM_WRITE(bloodstm_color1_w) - AM_RANGE(0x380000, 0x380001) AM_WRITE(bloodstm_color2_w) - AM_RANGE(0x400000, 0x400001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) - AM_RANGE(0x480000, 0x480001) AM_WRITE(sound_data_w) - AM_RANGE(0x500000, 0x5000ff) AM_READWRITE(bloodstm_video_r, bloodstm_video_w) AM_SHARE("video") - AM_RANGE(0x580000, 0x59ffff) AM_RAM_WRITE(bloodstm_paletteram_w) AM_SHARE("palette") - AM_RANGE(0x700000, 0x700001) AM_WRITE(bloodstm_plane_w) - AM_RANGE(0x780000, 0x780001) AM_READ_PORT("EXTRA") - AM_RANGE(0x800000, 0x87ffff) AM_MIRROR(0x780000) AM_ROM AM_REGION("user1", 0) AM_SHARE("main_rom") -ADDRESS_MAP_END +void itech32_state::bloodstm_map(address_map &map) +{ + map(0x000000, 0x00ffff).ram().share("nvram"); + map(0x080000, 0x080001).portr("P1").w(this, FUNC(itech32_state::int1_ack_w)); + map(0x100000, 0x100001).portr("P2"); + map(0x180000, 0x180001).portr("P3"); + map(0x200000, 0x200001).portr("P4").w("watchdog", FUNC(watchdog_timer_device::reset16_w)); + map(0x280000, 0x280001).portr("DIPS"); + map(0x300000, 0x300001).w(this, FUNC(itech32_state::bloodstm_color1_w)); + map(0x380000, 0x380001).w(this, FUNC(itech32_state::bloodstm_color2_w)); + map(0x400000, 0x400001).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); + map(0x480000, 0x480001).w(this, FUNC(itech32_state::sound_data_w)); + map(0x500000, 0x5000ff).rw(this, FUNC(itech32_state::bloodstm_video_r), FUNC(itech32_state::bloodstm_video_w)).share("video"); + map(0x580000, 0x59ffff).ram().w(this, FUNC(itech32_state::bloodstm_paletteram_w)).share("palette"); + map(0x700000, 0x700001).w(this, FUNC(itech32_state::bloodstm_plane_w)); + map(0x780000, 0x780001).portr("EXTRA"); + map(0x800000, 0x87ffff).mirror(0x780000).rom().region("user1", 0).share("main_rom"); +} /*------ Driver's Edge memory layouts ------*/ @@ -972,68 +974,72 @@ WRITE32_MEMBER(itech32_state::test2_w) } #endif -ADDRESS_MAP_START(itech32_state::drivedge_map) - AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x40000) AM_RAM AM_SHARE("nvram") +void itech32_state::drivedge_map(address_map &map) +{ + map(0x000000, 0x03ffff).mirror(0x40000).ram().share("nvram"); #if LOG_DRIVEDGE_UNINIT_RAM -AM_RANGE(0x000100, 0x0003ff) AM_MIRROR(0x40000) AM_READWRITE(test1_r, test1_w) -AM_RANGE(0x000c00, 0x007fff) AM_MIRROR(0x40000) AM_READWRITE(test2_r, test2_w) +map(0x000100, 0x0003ff).mirror(0x40000).rw(this, FUNC(itech32_state::test1_r), FUNC(itech32_state::test1_w)); +map(0x000c00, 0x007fff).mirror(0x40000).rw(this, FUNC(itech32_state::test2_r), FUNC(itech32_state::test2_w)); #endif - AM_RANGE(0x080000, 0x080003) AM_READ_PORT("80000") - AM_RANGE(0x082000, 0x082003) AM_READ_PORT("82000") - AM_RANGE(0x084000, 0x084003) AM_READWRITE(sound_data32_r, sound_data32_w) + map(0x080000, 0x080003).portr("80000"); + map(0x082000, 0x082003).portr("82000"); + map(0x084000, 0x084003).rw(this, FUNC(itech32_state::sound_data32_r), FUNC(itech32_state::sound_data32_w)); // AM_RANGE(0x086000, 0x08623f) AM_RAM -- networking -- first 0x40 bytes = our data, next 0x40*8 bytes = their data, r/w on IRQ2 - AM_RANGE(0x088000, 0x088003) AM_READ(drivedge_steering_r) - AM_RANGE(0x08a000, 0x08a003) AM_READ(drivedge_gas_r) AM_WRITENOP - AM_RANGE(0x08c000, 0x08c003) AM_READ_PORT("8c000") - AM_RANGE(0x08e000, 0x08e003) AM_READ_PORT("8e000") AM_WRITENOP - AM_RANGE(0x100000, 0x10000f) AM_WRITE(drivedge_zbuf_control_w) AM_SHARE("drivedge_zctl") - AM_RANGE(0x180000, 0x180003) AM_WRITE(drivedge_color0_w) - AM_RANGE(0x1a0000, 0x1bffff) AM_RAM_DEVWRITE("palette", palette_device, write32) AM_SHARE("palette") - AM_RANGE(0x1c0000, 0x1c0003) AM_WRITENOP - AM_RANGE(0x1e0000, 0x1e0113) AM_READWRITE(itech020_video_r, itech020_video_w) AM_SHARE("video") - AM_RANGE(0x1e4000, 0x1e4003) AM_WRITE(tms_reset_assert_w) - AM_RANGE(0x1ec000, 0x1ec003) AM_WRITE(tms_reset_clear_w) - AM_RANGE(0x200000, 0x200003) AM_READ_PORT("200000") - AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(tms1_68k_ram_w) AM_SHARE("tms1_ram") - AM_RANGE(0x300000, 0x300fff) AM_RAM_WRITE(tms2_68k_ram_w) AM_SHARE("tms2_ram") - AM_RANGE(0x380000, 0x380003) AM_WRITENOP // AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) - AM_RANGE(0x600000, 0x607fff) AM_ROM AM_REGION("user1", 0) AM_SHARE("main_rom") -ADDRESS_MAP_END - -ADDRESS_MAP_START(itech32_state::drivedge_tms1_map) - AM_RANGE(0x000000, 0x001fff) AM_RAM AM_SHARE("tms1_boot") - AM_RANGE(0x008000, 0x0083ff) AM_MIRROR(0x400) AM_RAM_WRITE(tms1_trigger_w) AM_SHARE("tms1_ram") - AM_RANGE(0x080000, 0x0bffff) AM_RAM -ADDRESS_MAP_END - -ADDRESS_MAP_START(itech32_state::drivedge_tms2_map) - AM_RANGE(0x000000, 0x0003ff) AM_MIRROR(0x8400) AM_RAM_WRITE(tms2_trigger_w) AM_SHARE("tms2_ram") - AM_RANGE(0x080000, 0x08ffff) AM_RAM -ADDRESS_MAP_END + map(0x088000, 0x088003).r(this, FUNC(itech32_state::drivedge_steering_r)); + map(0x08a000, 0x08a003).r(this, FUNC(itech32_state::drivedge_gas_r)).nopw(); + map(0x08c000, 0x08c003).portr("8c000"); + map(0x08e000, 0x08e003).portr("8e000").nopw(); + map(0x100000, 0x10000f).w(this, FUNC(itech32_state::drivedge_zbuf_control_w)).share("drivedge_zctl"); + map(0x180000, 0x180003).w(this, FUNC(itech32_state::drivedge_color0_w)); + map(0x1a0000, 0x1bffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); + map(0x1c0000, 0x1c0003).nopw(); + map(0x1e0000, 0x1e0113).rw(this, FUNC(itech32_state::itech020_video_r), FUNC(itech32_state::itech020_video_w)).share("video"); + map(0x1e4000, 0x1e4003).w(this, FUNC(itech32_state::tms_reset_assert_w)); + map(0x1ec000, 0x1ec003).w(this, FUNC(itech32_state::tms_reset_clear_w)); + map(0x200000, 0x200003).portr("200000"); + map(0x280000, 0x280fff).ram().w(this, FUNC(itech32_state::tms1_68k_ram_w)).share("tms1_ram"); + map(0x300000, 0x300fff).ram().w(this, FUNC(itech32_state::tms2_68k_ram_w)).share("tms2_ram"); + map(0x380000, 0x380003).nopw(); // AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) + map(0x600000, 0x607fff).rom().region("user1", 0).share("main_rom"); +} + +void itech32_state::drivedge_tms1_map(address_map &map) +{ + map(0x000000, 0x001fff).ram().share("tms1_boot"); + map(0x008000, 0x0083ff).mirror(0x400).ram().w(this, FUNC(itech32_state::tms1_trigger_w)).share("tms1_ram"); + map(0x080000, 0x0bffff).ram(); +} + +void itech32_state::drivedge_tms2_map(address_map &map) +{ + map(0x000000, 0x0003ff).mirror(0x8400).ram().w(this, FUNC(itech32_state::tms2_trigger_w)).share("tms2_ram"); + map(0x080000, 0x08ffff).ram(); +} /*------ 68EC020-based memory layout ------*/ -ADDRESS_MAP_START(itech32_state::itech020_map) - AM_RANGE(0x000000, 0x007fff) AM_RAM AM_SHARE("main_ram") - AM_RANGE(0x080000, 0x080003) AM_READ_PORT("P1") AM_WRITE(int1_ack32_w) - AM_RANGE(0x100000, 0x100003) AM_READ_PORT("P2") - AM_RANGE(0x180000, 0x180003) AM_READ_PORT("P3") - AM_RANGE(0x200000, 0x200003) AM_READ_PORT("P4") - AM_RANGE(0x280000, 0x280003) AM_READ_PORT("DIPS") - AM_RANGE(0x300000, 0x300003) AM_WRITE(itech020_color1_w) - AM_RANGE(0x380000, 0x380003) AM_WRITE(itech020_color2_w) - AM_RANGE(0x400000, 0x400003) AM_DEVWRITE("watchdog", watchdog_timer_device, reset32_w) - AM_RANGE(0x480000, 0x480003) AM_WRITE(sound_data32_w) - AM_RANGE(0x500000, 0x5000ff) AM_READWRITE(itech020_video_r, itech020_video_w) AM_SHARE("video") - AM_RANGE(0x578000, 0x57ffff) AM_READNOP /* touched by protection */ - AM_RANGE(0x580000, 0x59ffff) AM_RAM_DEVWRITE("palette", palette_device, write32) AM_SHARE("palette") - AM_RANGE(0x600000, 0x603fff) AM_RAM AM_SHARE("nvram") -/* ? */ AM_RANGE(0x61ff00, 0x61ffff) AM_WRITENOP /* Unknown Writes */ - AM_RANGE(0x680000, 0x680003) AM_READ(itech020_prot_result_r) AM_WRITENOP -/* ! */ AM_RANGE(0x680800, 0x68083f) AM_READONLY AM_WRITENOP /* Serial DUART Channel A/B & Top LED sign - To Do! */ - AM_RANGE(0x700000, 0x700003) AM_WRITE(itech020_plane_w) - AM_RANGE(0x800000, 0xbfffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("main_rom") -ADDRESS_MAP_END +void itech32_state::itech020_map(address_map &map) +{ + map(0x000000, 0x007fff).ram().share("main_ram"); + map(0x080000, 0x080003).portr("P1").w(this, FUNC(itech32_state::int1_ack32_w)); + map(0x100000, 0x100003).portr("P2"); + map(0x180000, 0x180003).portr("P3"); + map(0x200000, 0x200003).portr("P4"); + map(0x280000, 0x280003).portr("DIPS"); + map(0x300000, 0x300003).w(this, FUNC(itech32_state::itech020_color1_w)); + map(0x380000, 0x380003).w(this, FUNC(itech32_state::itech020_color2_w)); + map(0x400000, 0x400003).w("watchdog", FUNC(watchdog_timer_device::reset32_w)); + map(0x480000, 0x480003).w(this, FUNC(itech32_state::sound_data32_w)); + map(0x500000, 0x5000ff).rw(this, FUNC(itech32_state::itech020_video_r), FUNC(itech32_state::itech020_video_w)).share("video"); + map(0x578000, 0x57ffff).nopr(); /* touched by protection */ + map(0x580000, 0x59ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); + map(0x600000, 0x603fff).ram().share("nvram"); +/* ? */ map(0x61ff00, 0x61ffff).nopw(); /* Unknown Writes */ + map(0x680000, 0x680003).r(this, FUNC(itech32_state::itech020_prot_result_r)).nopw(); +/* ! */ map(0x680800, 0x68083f).readonly().nopw(); /* Serial DUART Channel A/B & Top LED sign - To Do! */ + map(0x700000, 0x700003).w(this, FUNC(itech32_state::itech020_plane_w)); + map(0x800000, 0xbfffff).rom().region("user1", 0).share("main_rom"); +} @@ -1044,30 +1050,32 @@ ADDRESS_MAP_END *************************************/ /*------ Rev 1 sound board memory layout ------*/ -ADDRESS_MAP_START(itech32_state::sound_map) - AM_RANGE(0x0000, 0x0000) AM_WRITE(sound_return_w) - AM_RANGE(0x0400, 0x0400) AM_READ(sound_data_r) - AM_RANGE(0x0800, 0x083f) AM_MIRROR(0x80) AM_DEVREADWRITE("ensoniq", es5506_device, read, write) - AM_RANGE(0x0c00, 0x0c00) AM_WRITE(sound_bank_w) - AM_RANGE(0x1000, 0x1000) AM_WRITENOP /* noisy */ - AM_RANGE(0x1400, 0x140f) AM_DEVREADWRITE("via6522_0", via6522_device, read, write) - AM_RANGE(0x2000, 0x3fff) AM_RAM - AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("soundbank") - AM_RANGE(0x8000, 0xffff) AM_ROM -ADDRESS_MAP_END +void itech32_state::sound_map(address_map &map) +{ + map(0x0000, 0x0000).w(this, FUNC(itech32_state::sound_return_w)); + map(0x0400, 0x0400).r(this, FUNC(itech32_state::sound_data_r)); + map(0x0800, 0x083f).mirror(0x80).rw("ensoniq", FUNC(es5506_device::read), FUNC(es5506_device::write)); + map(0x0c00, 0x0c00).w(this, FUNC(itech32_state::sound_bank_w)); + map(0x1000, 0x1000).nopw(); /* noisy */ + map(0x1400, 0x140f).rw("via6522_0", FUNC(via6522_device::read), FUNC(via6522_device::write)); + map(0x2000, 0x3fff).ram(); + map(0x4000, 0x7fff).bankr("soundbank"); + map(0x8000, 0xffff).rom(); +} /*------ Rev 2 sound board memory layout ------*/ -ADDRESS_MAP_START(itech32_state::sound_020_map) - AM_RANGE(0x0000, 0x0000) AM_MIRROR(0x400) AM_READ(sound_data_r) - AM_RANGE(0x0800, 0x083f) AM_MIRROR(0x80) AM_DEVREADWRITE("ensoniq", es5506_device, read, write) - AM_RANGE(0x0c00, 0x0c00) AM_WRITE(sound_bank_w) - AM_RANGE(0x1400, 0x1400) AM_WRITE(firq_clear_w) - AM_RANGE(0x1800, 0x1800) AM_READ(sound_data_buffer_r) AM_WRITENOP - AM_RANGE(0x2000, 0x3fff) AM_RAM - AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("soundbank") - AM_RANGE(0x8000, 0xffff) AM_ROM -ADDRESS_MAP_END +void itech32_state::sound_020_map(address_map &map) +{ + map(0x0000, 0x0000).mirror(0x400).r(this, FUNC(itech32_state::sound_data_r)); + map(0x0800, 0x083f).mirror(0x80).rw("ensoniq", FUNC(es5506_device::read), FUNC(es5506_device::write)); + map(0x0c00, 0x0c00).w(this, FUNC(itech32_state::sound_bank_w)); + map(0x1400, 0x1400).w(this, FUNC(itech32_state::firq_clear_w)); + map(0x1800, 0x1800).r(this, FUNC(itech32_state::sound_data_buffer_r)).nopw(); + map(0x2000, 0x3fff).ram(); + map(0x4000, 0x7fff).bankr("soundbank"); + map(0x8000, 0xffff).rom(); +} |