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/calorie.cpp | |
parent | f155992daab88ad024cec995428a67108218b51d (diff) |
Address maps macros removal, pass 1 [O. Galibert]
Diffstat (limited to 'src/mame/drivers/calorie.cpp')
-rw-r--r-- | src/mame/drivers/calorie.cpp | 76 |
1 files changed, 40 insertions, 36 deletions
diff --git a/src/mame/drivers/calorie.cpp b/src/mame/drivers/calorie.cpp index 3a60057fead..ae6a92f1605 100644 --- a/src/mame/drivers/calorie.cpp +++ b/src/mame/drivers/calorie.cpp @@ -264,44 +264,48 @@ WRITE8_MEMBER(calorie_state::bogus_w) * *************************************/ -ADDRESS_MAP_START(calorie_state::calorie_map) - AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0x8000, 0xbfff) AM_ROM - AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE("ram") - AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(fg_ram_w) AM_SHARE("fg_ram") - AM_RANGE(0xd800, 0xdbff) AM_RAM AM_SHARE("sprites") - AM_RANGE(0xdc00, 0xdcff) AM_RAM_DEVWRITE("palette", palette_device, write8) AM_SHARE("palette") - AM_RANGE(0xde00, 0xde00) AM_WRITE(bg_bank_w) - AM_RANGE(0xf000, 0xf000) AM_READ_PORT("P1") - AM_RANGE(0xf001, 0xf001) AM_READ_PORT("P2") - AM_RANGE(0xf002, 0xf002) AM_READ_PORT("SYSTEM") - AM_RANGE(0xf004, 0xf004) AM_READ_PORT("DSW1") AM_WRITE(calorie_flipscreen_w) - AM_RANGE(0xf005, 0xf005) AM_READ_PORT("DSW2") - AM_RANGE(0xf800, 0xf800) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) -ADDRESS_MAP_END - -ADDRESS_MAP_START(calorie_state::decrypted_opcodes_map) - AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes") - AM_RANGE(0x8000, 0xbfff) AM_ROM - AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE("ram") -ADDRESS_MAP_END - -ADDRESS_MAP_START(calorie_state::calorie_sound_map) - AM_RANGE(0x0000, 0x3fff) AM_ROM - AM_RANGE(0x8000, 0x87ff) AM_RAM - AM_RANGE(0xc000, 0xc000) AM_READ(calorie_soundlatch_r) -ADDRESS_MAP_END - -ADDRESS_MAP_START(calorie_state::calorie_sound_io_map) - ADDRESS_MAP_GLOBAL_MASK(0xff) +void calorie_state::calorie_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0xbfff).rom(); + map(0xc000, 0xcfff).ram().share("ram"); + map(0xd000, 0xd7ff).ram().w(this, FUNC(calorie_state::fg_ram_w)).share("fg_ram"); + map(0xd800, 0xdbff).ram().share("sprites"); + map(0xdc00, 0xdcff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); + map(0xde00, 0xde00).w(this, FUNC(calorie_state::bg_bank_w)); + map(0xf000, 0xf000).portr("P1"); + map(0xf001, 0xf001).portr("P2"); + map(0xf002, 0xf002).portr("SYSTEM"); + map(0xf004, 0xf004).portr("DSW1").w(this, FUNC(calorie_state::calorie_flipscreen_w)); + map(0xf005, 0xf005).portr("DSW2"); + map(0xf800, 0xf800).w(m_soundlatch, FUNC(generic_latch_8_device::write)); +} + +void calorie_state::decrypted_opcodes_map(address_map &map) +{ + map(0x0000, 0x7fff).rom().share("decrypted_opcodes"); + map(0x8000, 0xbfff).rom(); + map(0xc000, 0xcfff).ram().share("ram"); +} + +void calorie_state::calorie_sound_map(address_map &map) +{ + map(0x0000, 0x3fff).rom(); + map(0x8000, 0x87ff).ram(); + map(0xc000, 0xc000).r(this, FUNC(calorie_state::calorie_soundlatch_r)); +} + +void calorie_state::calorie_sound_io_map(address_map &map) +{ + map.global_mask(0xff); // 3rd ? - AM_RANGE(0x00, 0xff) AM_WRITE(bogus_w) + map(0x00, 0xff).w(this, FUNC(calorie_state::bogus_w)); - AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ym2149_device, address_data_w) - AM_RANGE(0x01, 0x01) AM_DEVREAD("ay1", ym2149_device, data_r) - AM_RANGE(0x10, 0x11) AM_DEVWRITE("ay2", ym2149_device, address_data_w) - AM_RANGE(0x11, 0x11) AM_DEVREAD("ay2", ym2149_device, data_r) -ADDRESS_MAP_END + map(0x00, 0x01).w("ay1", FUNC(ym2149_device::address_data_w)); + map(0x01, 0x01).r("ay1", FUNC(ym2149_device::data_r)); + map(0x10, 0x11).w("ay2", FUNC(ym2149_device::address_data_w)); + map(0x11, 0x11).r("ay2", FUNC(ym2149_device::data_r)); +} /************************************* |