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/ajax.cpp | 67 +++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 32 deletions(-) (limited to 'src/mame/drivers/ajax.cpp') diff --git a/src/mame/drivers/ajax.cpp b/src/mame/drivers/ajax.cpp index fb4dd2cc4d6..af4d41e79b4 100644 --- a/src/mame/drivers/ajax.cpp +++ b/src/mame/drivers/ajax.cpp @@ -23,39 +23,42 @@ #include "speaker.h" -ADDRESS_MAP_START(ajax_state::ajax_main_map) - AM_RANGE(0x0000, 0x01c0) AM_READWRITE(ls138_f10_r, ls138_f10_w) /* bankswitch + sound command + FIRQ command */ - AM_RANGE(0x0800, 0x0807) AM_DEVREADWRITE("k051960", k051960_device, k051937_r, k051937_w) /* sprite control registers */ - AM_RANGE(0x0c00, 0x0fff) AM_DEVREADWRITE("k051960", k051960_device, k051960_r, k051960_w) /* sprite RAM 2128SL at J7 */ - AM_RANGE(0x1000, 0x1fff) AM_RAM_DEVWRITE("palette", palette_device, write8) AM_SHARE("palette")/* palette */ - AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("share1") /* shared RAM with the 6809 */ - AM_RANGE(0x4000, 0x5fff) AM_RAM /* RAM 6264L at K10 */ - AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("mainbank") /* banked ROM */ - AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM N11 */ -ADDRESS_MAP_END - -ADDRESS_MAP_START(ajax_state::ajax_sub_map) - AM_RANGE(0x0000, 0x07ff) AM_DEVREADWRITE("k051316", k051316_device, read, write) /* 051316 zoom/rotation layer */ - AM_RANGE(0x0800, 0x080f) AM_DEVWRITE("k051316", k051316_device, ctrl_w) /* 051316 control registers */ - AM_RANGE(0x1000, 0x17ff) AM_DEVREAD("k051316", k051316_device, rom_r) /* 051316 (ROM test) */ - AM_RANGE(0x1800, 0x1800) AM_WRITE(bankswitch_2_w) /* bankswitch control */ - AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("share1") /* shared RAM with the 052001 */ - AM_RANGE(0x4000, 0x7fff) AM_DEVREADWRITE("k052109", k052109_device, read, write) /* video RAM + color RAM + video registers */ - AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("subbank") /* banked ROM */ - AM_RANGE(0xa000, 0xffff) AM_ROM AM_REGION ("sub", 0x12000) /* ROM I16 */ -ADDRESS_MAP_END - -ADDRESS_MAP_START(ajax_state::ajax_sound_map) - AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM F6 */ - AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM 2128SL at D16 */ - AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w) /* 007232 bankswitch */ - AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE("k007232_1", k007232_device, read, write) /* 007232 registers (chip 1) */ - AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232_2", k007232_device, read, write) /* 007232 registers (chip 2) */ - AM_RANGE(0xb80c, 0xb80c) AM_WRITE(k007232_extvol_w) /* extra volume, goes to the 007232 w/ A11 */ +void ajax_state::ajax_main_map(address_map &map) +{ + map(0x0000, 0x01c0).rw(this, FUNC(ajax_state::ls138_f10_r), FUNC(ajax_state::ls138_f10_w)); /* bankswitch + sound command + FIRQ command */ + map(0x0800, 0x0807).rw(m_k051960, FUNC(k051960_device::k051937_r), FUNC(k051960_device::k051937_w)); /* sprite control registers */ + map(0x0c00, 0x0fff).rw(m_k051960, FUNC(k051960_device::k051960_r), FUNC(k051960_device::k051960_w)); /* sprite RAM 2128SL at J7 */ + map(0x1000, 0x1fff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette");/* palette */ + map(0x2000, 0x3fff).ram().share("share1"); /* shared RAM with the 6809 */ + map(0x4000, 0x5fff).ram(); /* RAM 6264L at K10 */ + map(0x6000, 0x7fff).bankr("mainbank"); /* banked ROM */ + map(0x8000, 0xffff).rom(); /* ROM N11 */ +} + +void ajax_state::ajax_sub_map(address_map &map) +{ + map(0x0000, 0x07ff).rw(m_k051316, FUNC(k051316_device::read), FUNC(k051316_device::write)); /* 051316 zoom/rotation layer */ + map(0x0800, 0x080f).w(m_k051316, FUNC(k051316_device::ctrl_w)); /* 051316 control registers */ + map(0x1000, 0x17ff).r(m_k051316, FUNC(k051316_device::rom_r)); /* 051316 (ROM test) */ + map(0x1800, 0x1800).w(this, FUNC(ajax_state::bankswitch_2_w)); /* bankswitch control */ + map(0x2000, 0x3fff).ram().share("share1"); /* shared RAM with the 052001 */ + map(0x4000, 0x7fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); /* video RAM + color RAM + video registers */ + map(0x8000, 0x9fff).bankr("subbank"); /* banked ROM */ + map(0xa000, 0xffff).rom().region("sub", 0x12000); /* ROM I16 */ +} + +void ajax_state::ajax_sound_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); /* ROM F6 */ + map(0x8000, 0x87ff).ram(); /* RAM 2128SL at D16 */ + map(0x9000, 0x9000).w(this, FUNC(ajax_state::sound_bank_w)); /* 007232 bankswitch */ + map(0xa000, 0xa00d).rw(m_k007232_1, FUNC(k007232_device::read), FUNC(k007232_device::write)); /* 007232 registers (chip 1) */ + map(0xb000, 0xb00d).rw(m_k007232_2, FUNC(k007232_device::read), FUNC(k007232_device::write)); /* 007232 registers (chip 2) */ + map(0xb80c, 0xb80c).w(this, FUNC(ajax_state::k007232_extvol_w)); /* extra volume, goes to the 007232 w/ A11 */ /* selecting a different latch for the external port */ - AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */ - AM_RANGE(0xe000, 0xe000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) -ADDRESS_MAP_END + map(0xc000, 0xc001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); /* YM2151 */ + map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); +} static INPUT_PORTS_START( ajax ) -- cgit v1.2.3-70-g09d2