diff options
Diffstat (limited to 'src/mame/drivers/deco32.cpp')
-rw-r--r-- | src/mame/drivers/deco32.cpp | 541 |
1 files changed, 276 insertions, 265 deletions
diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp index 63487755f80..e325f51e388 100644 --- a/src/mame/drivers/deco32.cpp +++ b/src/mame/drivers/deco32.cpp @@ -368,7 +368,6 @@ NOTE: There are several unpopulated locations (denoted by *) for additional rom #include "includes/deco32.h" #include "cpu/arm/arm.h" -#include "cpu/h6280/h6280.h" #include "cpu/m6809/m6809.h" #include "cpu/z80/z80.h" #include "machine/decocrpt.h" @@ -383,268 +382,277 @@ NOTE: There are several unpopulated locations (denoted by *) for additional rom // ADDRESS MAPS //************************************************************************** -ADDRESS_MAP_START(captaven_state::captaven_map) - AM_RANGE(0x000000, 0x0fffff) AM_ROM - AM_RANGE(0x100000, 0x100007) AM_READ(_71_r) - AM_RANGE(0x100000, 0x100003) AM_WRITE(buffer_spriteram_w<0>) - AM_RANGE(0x108000, 0x108003) AM_WRITENOP /* ? */ - AM_RANGE(0x110000, 0x111fff) AM_READWRITE(spriteram_r<0>, spriteram_w<0>) - AM_RANGE(0x120000, 0x127fff) AM_RAM /* Main RAM */ - AM_RANGE(0x128000, 0x12ffff) AM_READWRITE16(ioprot_r, ioprot_w, 0x0000ffff) - AM_RANGE(0x130000, 0x131fff) AM_RAM_DEVWRITE("palette", palette_device, write32) AM_SHARE("palette") - AM_RANGE(0x148000, 0x14800f) AM_DEVICE8("irq", deco_irq_device, map, 0x000000ff) - AM_RANGE(0x160000, 0x167fff) AM_RAM /* Extra work RAM */ - AM_RANGE(0x168000, 0x168003) AM_READ8(captaven_dsw1_r, 0x000000ff) - AM_RANGE(0x168000, 0x168003) AM_READ8(captaven_dsw2_r, 0x0000ff00) - AM_RANGE(0x168000, 0x168003) AM_READ8(captaven_dsw3_r, 0x00ff0000) - AM_RANGE(0x168000, 0x168003) AM_READ8(captaven_soundcpu_status_r, 0xff000000) - AM_RANGE(0x178000, 0x178003) AM_WRITE(pri_w) - AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x192000, 0x193fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) /* Mirror address - bug in program code */ - AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") - AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused - AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") // unused -ADDRESS_MAP_END +void captaven_state::captaven_map(address_map &map) +{ + map(0x000000, 0x0fffff).rom(); + map(0x100000, 0x100007).r(this, FUNC(captaven_state::_71_r)); + map(0x100000, 0x100003).w(this, FUNC(captaven_state::buffer_spriteram_w<0>)); + map(0x108000, 0x108003).nopw(); /* ? */ + map(0x110000, 0x111fff).rw(this, FUNC(captaven_state::spriteram_r<0>), FUNC(captaven_state::spriteram_w<0>)); + map(0x120000, 0x127fff).ram(); /* Main RAM */ + map(0x128000, 0x12ffff).rw(this, FUNC(captaven_state::ioprot_r), FUNC(captaven_state::ioprot_w)).umask32(0x0000ffff); + map(0x130000, 0x131fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); + map(0x148000, 0x14800f).m(m_deco_irq, FUNC(deco_irq_device::map)).umask32(0x000000ff); + map(0x160000, 0x167fff).ram(); /* Extra work RAM */ + map(0x168000, 0x168000).r(this, FUNC(captaven_state::captaven_dsw1_r)); + map(0x168001, 0x168001).r(this, FUNC(captaven_state::captaven_dsw2_r)); + map(0x168002, 0x168002).r(this, FUNC(captaven_state::captaven_dsw3_r)); + map(0x168003, 0x168003).r(this, FUNC(captaven_state::captaven_soundcpu_status_r)); + map(0x178000, 0x178003).w(this, FUNC(captaven_state::pri_w)); + map(0x180000, 0x18001f).rw("tilegen1", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x190000, 0x191fff).rw("tilegen1", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x192000, 0x193fff).rw("tilegen1", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); /* Mirror address - bug in program code */ + map(0x194000, 0x195fff).rw("tilegen1", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x1a0000, 0x1a3fff).ram().w(this, FUNC(captaven_state::pf_rowscroll_w<0>)).share("pf1_rowscroll32"); + map(0x1a4000, 0x1a5fff).ram().w(this, FUNC(captaven_state::pf_rowscroll_w<1>)).share("pf2_rowscroll32"); + map(0x1c0000, 0x1c001f).rw("tilegen2", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x1d0000, 0x1d1fff).rw("tilegen2", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x1d4000, 0x1d5fff).rw("tilegen2", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); // unused + map(0x1e0000, 0x1e3fff).ram().w(this, FUNC(captaven_state::pf_rowscroll_w<2>)).share("pf3_rowscroll32"); + map(0x1e4000, 0x1e5fff).ram().w(this, FUNC(captaven_state::pf_rowscroll_w<3>)).share("pf4_rowscroll32"); // unused +} -ADDRESS_MAP_START(fghthist_state::fghthist_map) - ADDRESS_MAP_UNMAP_HIGH +void fghthist_state::fghthist_map(address_map &map) +{ + map.unmap_value_high(); // AM_RANGE(0x000000, 0x001fff) AM_ROM AM_WRITE(pf1_data_w) // wtf?? - AM_RANGE(0x000000, 0x0fffff) AM_ROM - AM_RANGE(0x100000, 0x11ffff) AM_RAM - AM_RANGE(0x120020, 0x120023) AM_READ16(fghthist_in0_r, 0x0000ffff) - AM_RANGE(0x120024, 0x120027) AM_READ16(fghthist_in1_r, 0x0000ffff) - AM_RANGE(0x120028, 0x12002b) AM_READ8(eeprom_r, 0x000000ff) - AM_RANGE(0x12002c, 0x12002f) AM_WRITE8(eeprom_w, 0x000000ff) - AM_RANGE(0x12002c, 0x12002f) AM_WRITE8(volume_w, 0x0000ff00) - AM_RANGE(0x1201fc, 0x1201ff) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x000000ff) - AM_RANGE(0x140000, 0x140003) AM_WRITE(vblank_ack_w) - AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram") - AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(palette_dma_w) - AM_RANGE(0x16c010, 0x16c013) AM_READ(unk_status_r) - AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r<0>, spriteram_w<0>) - AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w<0>) - AM_RANGE(0x17c020, 0x17c023) AM_READ(unk_status_r) - AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") - AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") - AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(ioprot_r, ioprot_w, 0xffff0000) AM_SHARE("prot32ram") // only maps on 16-bits - AM_RANGE(0x208800, 0x208803) AM_WRITENOP /* ? */ -ADDRESS_MAP_END + map(0x000000, 0x0fffff).rom(); + map(0x100000, 0x11ffff).ram(); + map(0x120020, 0x120021).r(this, FUNC(fghthist_state::fghthist_in0_r)); + map(0x120024, 0x120025).r(this, FUNC(fghthist_state::fghthist_in1_r)); + map(0x120028, 0x120028).r(this, FUNC(fghthist_state::eeprom_r)); + map(0x12002c, 0x12002c).w(this, FUNC(fghthist_state::eeprom_w)); + map(0x12002d, 0x12002d).w(this, FUNC(fghthist_state::volume_w)); + map(0x1201fc, 0x1201fc).w(m_soundlatch, FUNC(generic_latch_8_device::write)); + map(0x140000, 0x140003).w(this, FUNC(fghthist_state::vblank_ack_w)); + map(0x168000, 0x169fff).ram().w(this, FUNC(fghthist_state::buffered_palette_w)).share("paletteram"); + map(0x16c008, 0x16c00b).w(this, FUNC(fghthist_state::palette_dma_w)); + map(0x16c010, 0x16c013).r(this, FUNC(fghthist_state::unk_status_r)); + map(0x178000, 0x179fff).rw(this, FUNC(fghthist_state::spriteram_r<0>), FUNC(fghthist_state::spriteram_w<0>)); + map(0x17c010, 0x17c013).w(this, FUNC(fghthist_state::buffer_spriteram_w<0>)); + map(0x17c020, 0x17c023).r(this, FUNC(fghthist_state::unk_status_r)); + map(0x182000, 0x183fff).rw("tilegen1", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x184000, 0x185fff).rw("tilegen1", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x192000, 0x193fff).ram().w(this, FUNC(fghthist_state::pf_rowscroll_w<0>)).share("pf1_rowscroll32"); + map(0x194000, 0x195fff).ram().w(this, FUNC(fghthist_state::pf_rowscroll_w<1>)).share("pf2_rowscroll32"); + map(0x1a0000, 0x1a001f).rw("tilegen1", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x1c2000, 0x1c3fff).rw("tilegen2", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x1c4000, 0x1c5fff).rw("tilegen2", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x1d2000, 0x1d3fff).ram().w(this, FUNC(fghthist_state::pf_rowscroll_w<2>)).share("pf3_rowscroll32"); + map(0x1d4000, 0x1d5fff).ram().w(this, FUNC(fghthist_state::pf_rowscroll_w<3>)).share("pf4_rowscroll32"); + map(0x1e0000, 0x1e001f).rw("tilegen2", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x200000, 0x207fff).rw(this, FUNC(fghthist_state::ioprot_r), FUNC(fghthist_state::ioprot_w)).umask32(0xffff0000).share("prot32ram"); // only maps on 16-bits + map(0x208800, 0x208803).nopw(); /* ? */ +} -ADDRESS_MAP_START(fghthist_state::fghthsta_memmap) - AM_RANGE(0x000000, 0x0fffff) AM_ROM - AM_RANGE(0x100000, 0x11ffff) AM_RAM - AM_RANGE(0x140000, 0x140003) AM_WRITE(vblank_ack_w) - AM_RANGE(0x150000, 0x150003) AM_WRITE8(eeprom_w, 0x000000ff) - AM_RANGE(0x150000, 0x150003) AM_WRITE8(volume_w, 0x0000ff00) - AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram") - AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(palette_dma_w) - AM_RANGE(0x16c010, 0x16c013) AM_READ(unk_status_r) - AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r<0>, spriteram_w<0>) - AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w<0>) - AM_RANGE(0x17c020, 0x17c023) AM_READ(unk_status_r) - AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") - AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") - AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(ioprot_r, ioprot_w, 0xffff0000) AM_SHARE("prot32ram") // only maps on 16-bits -ADDRESS_MAP_END +void fghthist_state::fghthsta_memmap(address_map &map) +{ + map(0x000000, 0x0fffff).rom(); + map(0x100000, 0x11ffff).ram(); + map(0x140000, 0x140003).w(this, FUNC(fghthist_state::vblank_ack_w)); + map(0x150000, 0x150000).w(this, FUNC(fghthist_state::eeprom_w)); + map(0x150001, 0x150001).w(this, FUNC(fghthist_state::volume_w)); + map(0x168000, 0x169fff).ram().w(this, FUNC(fghthist_state::buffered_palette_w)).share("paletteram"); + map(0x16c008, 0x16c00b).w(this, FUNC(fghthist_state::palette_dma_w)); + map(0x16c010, 0x16c013).r(this, FUNC(fghthist_state::unk_status_r)); + map(0x178000, 0x179fff).rw(this, FUNC(fghthist_state::spriteram_r<0>), FUNC(fghthist_state::spriteram_w<0>)); + map(0x17c010, 0x17c013).w(this, FUNC(fghthist_state::buffer_spriteram_w<0>)); + map(0x17c020, 0x17c023).r(this, FUNC(fghthist_state::unk_status_r)); + map(0x182000, 0x183fff).rw("tilegen1", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x184000, 0x185fff).rw("tilegen1", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x192000, 0x193fff).ram().w(this, FUNC(fghthist_state::pf_rowscroll_w<0>)).share("pf1_rowscroll32"); + map(0x194000, 0x195fff).ram().w(this, FUNC(fghthist_state::pf_rowscroll_w<1>)).share("pf2_rowscroll32"); + map(0x1a0000, 0x1a001f).rw("tilegen1", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x1c2000, 0x1c3fff).rw("tilegen2", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x1c4000, 0x1c5fff).rw("tilegen2", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x1d2000, 0x1d3fff).ram().w(this, FUNC(fghthist_state::pf_rowscroll_w<2>)).share("pf3_rowscroll32"); + map(0x1d4000, 0x1d5fff).ram().w(this, FUNC(fghthist_state::pf_rowscroll_w<3>)).share("pf4_rowscroll32"); + map(0x1e0000, 0x1e001f).rw("tilegen2", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x200000, 0x207fff).rw(this, FUNC(fghthist_state::ioprot_r), FUNC(fghthist_state::ioprot_w)).umask32(0xffff0000).share("prot32ram"); // only maps on 16-bits +} // the video drawing (especially sprite) code on this is too slow to cope with proper partial updates // raster effects appear to need some work on it anyway? -ADDRESS_MAP_START(dragngun_state::dragngun_map) - AM_RANGE(0x0000000, 0x00fffff) AM_ROM - AM_RANGE(0x0100000, 0x011ffff) AM_RAM - AM_RANGE(0x0120000, 0x0127fff) AM_READWRITE16(ioprot_r, ioprot_w, 0x0000ffff) +void dragngun_state::dragngun_map(address_map &map) +{ + map(0x0000000, 0x00fffff).rom(); + map(0x0100000, 0x011ffff).ram(); + map(0x0120000, 0x0127fff).rw(this, FUNC(dragngun_state::ioprot_r), FUNC(dragngun_state::ioprot_w)).umask32(0x0000ffff); // AM_RANGE(0x01204c0, 0x01204c3) AM_WRITE(sound_w) - AM_RANGE(0x0128000, 0x012800f) AM_DEVICE8("irq", deco_irq_device, map, 0x000000ff) - AM_RANGE(0x0130000, 0x0131fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram") - AM_RANGE(0x0138000, 0x0138003) AM_NOP /* Palette dma complete in bit 0x8? ack? return 0 else tight loop */ - AM_RANGE(0x0138008, 0x013800b) AM_WRITE(palette_dma_w) - AM_RANGE(0x0170100, 0x0170103) AM_WRITENOP - AM_RANGE(0x0170038, 0x017003b) AM_WRITENOP - AM_RANGE(0x017002C, 0x017002f) AM_WRITENOP - AM_RANGE(0x0170224, 0x0170227) AM_WRITENOP - AM_RANGE(0x0180000, 0x018001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x0190000, 0x0191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x0194000, 0x0195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x01a0000, 0x01a3fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x01a4000, 0x01a5fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") - AM_RANGE(0x01c0000, 0x01c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x01d0000, 0x01d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x01d4000, 0x01d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused - AM_RANGE(0x01e0000, 0x01e3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x01e4000, 0x01e5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") // unused - AM_RANGE(0x0204800, 0x0204fff) AM_RAM // ace? 0x10 byte increments only // 13f ff stuff - AM_RANGE(0x0208000, 0x0208fff) AM_RAM AM_SHARE("lay0") - AM_RANGE(0x020c000, 0x020cfff) AM_RAM AM_SHARE("lay1") - AM_RANGE(0x0210000, 0x0217fff) AM_RAM AM_SHARE("look0") - AM_RANGE(0x0218000, 0x021ffff) AM_RAM AM_SHARE("look1") - AM_RANGE(0x0220000, 0x0221fff) AM_RAM AM_SHARE("spriteram") /* Main spriteram */ - AM_RANGE(0x0228000, 0x02283ff) AM_RAM //0x10 byte increments only - AM_RANGE(0x0230000, 0x0230003) AM_WRITE(spriteram_dma_w) - AM_RANGE(0x0300000, 0x03fffff) AM_ROM - AM_RANGE(0x0400000, 0x0400003) AM_DEVREADWRITE8("oki3", okim6295_device, read, write, 0x000000ff) - AM_RANGE(0x0410000, 0x0410003) AM_WRITE(volume_w) - AM_RANGE(0x0418000, 0x0418003) AM_WRITE(speaker_switch_w) - AM_RANGE(0x0420000, 0x0420003) AM_READWRITE8(eeprom_r, eeprom_w, 0x000000ff) - AM_RANGE(0x0430000, 0x043001f) AM_WRITE(lightgun_w) - AM_RANGE(0x0438000, 0x0438003) AM_READ(lightgun_r) - AM_RANGE(0x0440000, 0x0440003) AM_READ_PORT("IN2") - AM_RANGE(0x0500000, 0x0500003) AM_WRITE(sprite_control_w) + map(0x0128000, 0x012800f).m(m_deco_irq, FUNC(deco_irq_device::map)).umask32(0x000000ff); + map(0x0130000, 0x0131fff).ram().w(this, FUNC(dragngun_state::buffered_palette_w)).share("paletteram"); + map(0x0138000, 0x0138003).noprw(); /* Palette dma complete in bit 0x8? ack? return 0 else tight loop */ + map(0x0138008, 0x013800b).w(this, FUNC(dragngun_state::palette_dma_w)); + map(0x0170100, 0x0170103).nopw(); + map(0x0170038, 0x017003b).nopw(); + map(0x017002C, 0x017002f).nopw(); + map(0x0170224, 0x0170227).nopw(); + map(0x0180000, 0x018001f).rw("tilegen1", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x0190000, 0x0191fff).rw("tilegen1", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x0194000, 0x0195fff).rw("tilegen1", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x01a0000, 0x01a3fff).ram().w(this, FUNC(dragngun_state::pf_rowscroll_w<0>)).share("pf1_rowscroll32"); + map(0x01a4000, 0x01a5fff).ram().w(this, FUNC(dragngun_state::pf_rowscroll_w<1>)).share("pf2_rowscroll32"); + map(0x01c0000, 0x01c001f).rw("tilegen2", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x01d0000, 0x01d1fff).rw("tilegen2", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x01d4000, 0x01d5fff).rw("tilegen2", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); // unused + map(0x01e0000, 0x01e3fff).ram().w(this, FUNC(dragngun_state::pf_rowscroll_w<2>)).share("pf3_rowscroll32"); + map(0x01e4000, 0x01e5fff).ram().w(this, FUNC(dragngun_state::pf_rowscroll_w<3>)).share("pf4_rowscroll32"); // unused + map(0x0204800, 0x0204fff).ram(); // ace? 0x10 byte increments only // 13f ff stuff + map(0x0208000, 0x0208fff).ram().share("lay0"); + map(0x020c000, 0x020cfff).ram().share("lay1"); + map(0x0210000, 0x0217fff).ram().share("look0"); + map(0x0218000, 0x021ffff).ram().share("look1"); + map(0x0220000, 0x0221fff).ram().share("spriteram"); /* Main spriteram */ + map(0x0228000, 0x02283ff).ram(); //0x10 byte increments only + map(0x0230000, 0x0230003).w(this, FUNC(dragngun_state::spriteram_dma_w)); + map(0x0300000, 0x03fffff).rom(); + map(0x0400000, 0x0400000).rw("oki3", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x0410000, 0x0410003).w(this, FUNC(dragngun_state::volume_w)); + map(0x0418000, 0x0418003).w(this, FUNC(dragngun_state::speaker_switch_w)); + map(0x0420000, 0x0420000).rw(this, FUNC(dragngun_state::eeprom_r), FUNC(dragngun_state::eeprom_w)); + map(0x0430000, 0x043001f).w(this, FUNC(dragngun_state::lightgun_w)); + map(0x0438000, 0x0438003).r(this, FUNC(dragngun_state::lightgun_r)); + map(0x0440000, 0x0440003).portr("IN2"); + map(0x0500000, 0x0500003).w(this, FUNC(dragngun_state::sprite_control_w)); // this is clearly the dvi video related area - AM_RANGE(0x1000000, 0x1000007) AM_READ(unk_video_r) - AM_RANGE(0x1000100, 0x1007fff) AM_RAM - AM_RANGE(0x10b0000, 0x10b01ff) AM_RAM - AM_RANGE(0x1400000, 0x1ffffff) AM_ROM AM_REGION("dvi", 0x00000) // reads from here during boss battles when the videos should be displayed at the offsets where the DVI headers are // as a result it ends up writing what looks like pointers to the frame data in the ram area above -ADDRESS_MAP_END + map(0x1000000, 0x1000007).r(this, FUNC(dragngun_state::unk_video_r)); + map(0x1000100, 0x1007fff).ram(); + map(0x10b0000, 0x10b01ff).ram(); + map(0x1400000, 0x1ffffff).rom().region("dvi", 0x00000); // reads from here during boss battles when the videos should be displayed at the offsets where the DVI headers are // as a result it ends up writing what looks like pointers to the frame data in the ram area above +} -ADDRESS_MAP_START(dragngun_state::lockloadu_map) - AM_IMPORT_FROM(dragngun_map) - AM_RANGE(0x0170000, 0x0170007) AM_READ(lockload_gun_mirror_r) /* Not on Dragongun */ -ADDRESS_MAP_END +void dragngun_state::lockloadu_map(address_map &map) +{ + dragngun_map(map); + map(0x0170000, 0x0170007).r(this, FUNC(dragngun_state::lockload_gun_mirror_r)); /* Not on Dragongun */ +} -ADDRESS_MAP_START(dragngun_state::lockload_map) - AM_RANGE(0x000000, 0x0fffff) AM_ROM - AM_RANGE(0x100000, 0x11ffff) AM_RAM - AM_RANGE(0x120000, 0x127fff) AM_READWRITE16(ioprot_r, ioprot_w, 0x0000ffff) - AM_RANGE(0x128000, 0x12800f) AM_DEVICE8("irq", deco_irq_device, map, 0x000000ff) - AM_RANGE(0x130000, 0x131fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram") - AM_RANGE(0x138000, 0x138003) AM_READONLY AM_WRITENOP //palette dma complete in bit 0x8? ack? return 0 else tight loop - AM_RANGE(0x138008, 0x13800b) AM_WRITE(palette_dma_w) - AM_RANGE(0x170000, 0x170007) AM_READ(lockload_gun_mirror_r) /* Not on Dragongun */ - AM_RANGE(0x178008, 0x17800f) AM_WRITE(gun_irq_ack_w) /* Gun read ACK's */ - AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") - AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused - AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") // unused - AM_RANGE(0x204800, 0x204fff) AM_RAM //0x10 byte increments only - AM_RANGE(0x208000, 0x208fff) AM_RAM AM_SHARE("lay0") - AM_RANGE(0x20c000, 0x20cfff) AM_RAM AM_SHARE("lay1") - AM_RANGE(0x210000, 0x217fff) AM_RAM AM_SHARE("look0") - AM_RANGE(0x218000, 0x21ffff) AM_RAM AM_SHARE("look1") - AM_RANGE(0x220000, 0x221fff) AM_RAM AM_SHARE("spriteram") /* Main spriteram */ - AM_RANGE(0x228000, 0x2283ff) AM_RAM //0x10 byte increments only - AM_RANGE(0x230000, 0x230003) AM_WRITE(spriteram_dma_w) - AM_RANGE(0x300000, 0x3fffff) AM_ROM - AM_RANGE(0x410000, 0x410003) AM_WRITE(volume_w) - AM_RANGE(0x420000, 0x420003) AM_READWRITE8(eeprom_r, eeprom_w, 0x000000ff) - AM_RANGE(0x440000, 0x440003) AM_READ_PORT("IN2") - AM_RANGE(0x500000, 0x500003) AM_WRITE(sprite_control_w) -ADDRESS_MAP_END +void dragngun_state::lockload_map(address_map &map) +{ + map(0x000000, 0x0fffff).rom(); + map(0x100000, 0x11ffff).ram(); + map(0x120000, 0x127fff).rw(this, FUNC(dragngun_state::ioprot_r), FUNC(dragngun_state::ioprot_w)).umask32(0x0000ffff); + map(0x128000, 0x12800f).m(m_deco_irq, FUNC(deco_irq_device::map)).umask32(0x000000ff); + map(0x130000, 0x131fff).ram().w(this, FUNC(dragngun_state::buffered_palette_w)).share("paletteram"); + map(0x138000, 0x138003).readonly().nopw(); //palette dma complete in bit 0x8? ack? return 0 else tight loop + map(0x138008, 0x13800b).w(this, FUNC(dragngun_state::palette_dma_w)); + map(0x170000, 0x170007).r(this, FUNC(dragngun_state::lockload_gun_mirror_r)); /* Not on Dragongun */ + map(0x178008, 0x17800f).w(this, FUNC(dragngun_state::gun_irq_ack_w)); /* Gun read ACK's */ + map(0x180000, 0x18001f).rw("tilegen1", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x190000, 0x191fff).rw("tilegen1", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x194000, 0x195fff).rw("tilegen1", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x1a0000, 0x1a3fff).ram().w(this, FUNC(dragngun_state::pf_rowscroll_w<0>)).share("pf1_rowscroll32"); + map(0x1a4000, 0x1a5fff).ram().w(this, FUNC(dragngun_state::pf_rowscroll_w<1>)).share("pf2_rowscroll32"); + map(0x1c0000, 0x1c001f).rw("tilegen2", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x1d0000, 0x1d1fff).rw("tilegen2", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x1d4000, 0x1d5fff).rw("tilegen2", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); // unused + map(0x1e0000, 0x1e3fff).ram().w(this, FUNC(dragngun_state::pf_rowscroll_w<2>)).share("pf3_rowscroll32"); + map(0x1e4000, 0x1e5fff).ram().w(this, FUNC(dragngun_state::pf_rowscroll_w<3>)).share("pf4_rowscroll32"); // unused + map(0x204800, 0x204fff).ram(); //0x10 byte increments only + map(0x208000, 0x208fff).ram().share("lay0"); + map(0x20c000, 0x20cfff).ram().share("lay1"); + map(0x210000, 0x217fff).ram().share("look0"); + map(0x218000, 0x21ffff).ram().share("look1"); + map(0x220000, 0x221fff).ram().share("spriteram"); /* Main spriteram */ + map(0x228000, 0x2283ff).ram(); //0x10 byte increments only + map(0x230000, 0x230003).w(this, FUNC(dragngun_state::spriteram_dma_w)); + map(0x300000, 0x3fffff).rom(); + map(0x410000, 0x410003).w(this, FUNC(dragngun_state::volume_w)); + map(0x420000, 0x420000).rw(this, FUNC(dragngun_state::eeprom_r), FUNC(dragngun_state::eeprom_w)); + map(0x440000, 0x440003).portr("IN2"); + map(0x500000, 0x500003).w(this, FUNC(dragngun_state::sprite_control_w)); +} -ADDRESS_MAP_START(nslasher_state::tattass_map) - AM_RANGE(0x000000, 0x0f7fff) AM_ROM - AM_RANGE(0x0f8000, 0x0fffff) AM_ROM AM_WRITENOP - AM_RANGE(0x100000, 0x11ffff) AM_RAM - AM_RANGE(0x120000, 0x120003) AM_NOP /* ACIA (unused) */ - AM_RANGE(0x130000, 0x130003) AM_WRITENOP /* Coin port (unused?) */ - AM_RANGE(0x140000, 0x140003) AM_WRITE(vblank_ack_w) - AM_RANGE(0x150000, 0x150003) AM_WRITE(tattass_control_w) /* Volume port/Eprom/Priority */ - AM_RANGE(0x162000, 0x162fff) AM_RAM /* 'Jack' RAM!? */ - AM_RANGE(0x163000, 0x16309f) AM_DEVREADWRITE16("deco_ace", deco_ace_device, ace_r, ace_w, 0x0000ffff) /* 'Ace' RAM */ - AM_RANGE(0x164000, 0x164003) AM_WRITENOP /* Palette control BG2/3 ($1a constant) */ - AM_RANGE(0x164004, 0x164007) AM_WRITENOP /* Palette control Obj1 ($6 constant) */ - AM_RANGE(0x164008, 0x16400b) AM_WRITENOP /* Palette control Obj2 ($5 constant) */ - AM_RANGE(0x16400c, 0x16400f) AM_WRITENOP - AM_RANGE(0x168000, 0x169fff) AM_DEVREADWRITE("deco_ace", deco_ace_device, buffered_palette_r, buffered_palette_w) - AM_RANGE(0x16c000, 0x16c003) AM_WRITENOP - AM_RANGE(0x16c008, 0x16c00b) AM_DEVWRITE16("deco_ace", deco_ace_device, palette_dma_w, 0xffffffff) - AM_RANGE(0x170000, 0x171fff) AM_READWRITE(spriteram_r<0>, spriteram_w<0>) - AM_RANGE(0x174000, 0x174003) AM_WRITENOP /* Sprite DMA mode (2) */ - AM_RANGE(0x174010, 0x174013) AM_WRITE(buffer_spriteram_w<0>) - AM_RANGE(0x174018, 0x17401b) AM_WRITENOP /* Sprite 'CPU' (unused) */ - AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r<1>, spriteram_w<1>) - AM_RANGE(0x17c000, 0x17c003) AM_WRITENOP /* Sprite DMA mode (2) */ - AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w<1>) - AM_RANGE(0x17c018, 0x17c01b) AM_WRITENOP /* Sprite 'CPU' (unused) */ - AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") - AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") - AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(ioprot_r, ioprot_w, 0xffff0000) - AM_RANGE(0x200000, 0x207fff) AM_READ16(nslasher_debug_r, 0x0000ffff) -ADDRESS_MAP_END +void nslasher_state::tattass_map(address_map &map) +{ + map(0x000000, 0x0f7fff).rom(); + map(0x0f8000, 0x0fffff).rom().nopw(); + map(0x100000, 0x11ffff).ram(); + map(0x120000, 0x120003).noprw(); /* ACIA (unused) */ + map(0x130000, 0x130003).nopw(); /* Coin port (unused?) */ + map(0x140000, 0x140003).w(this, FUNC(nslasher_state::vblank_ack_w)); + map(0x150000, 0x150003).w(this, FUNC(nslasher_state::tattass_control_w)); /* Volume port/Eprom/Priority */ + map(0x162000, 0x162fff).ram(); /* 'Jack' RAM!? */ + map(0x163000, 0x16309f).rw(m_deco_ace, FUNC(deco_ace_device::ace_r), FUNC(deco_ace_device::ace_w)).umask32(0x0000ffff); /* 'Ace' RAM */ + map(0x164000, 0x164003).nopw(); /* Palette control BG2/3 ($1a constant) */ + map(0x164004, 0x164007).nopw(); /* Palette control Obj1 ($6 constant) */ + map(0x164008, 0x16400b).nopw(); /* Palette control Obj2 ($5 constant) */ + map(0x16400c, 0x16400f).nopw(); + map(0x168000, 0x169fff).rw(m_deco_ace, FUNC(deco_ace_device::buffered_palette_r), FUNC(deco_ace_device::buffered_palette_w)); + map(0x16c000, 0x16c003).nopw(); + map(0x16c008, 0x16c00b).w(m_deco_ace, FUNC(deco_ace_device::palette_dma_w)); + map(0x170000, 0x171fff).rw(this, FUNC(nslasher_state::spriteram_r<0>), FUNC(nslasher_state::spriteram_w<0>)); + map(0x174000, 0x174003).nopw(); /* Sprite DMA mode (2) */ + map(0x174010, 0x174013).w(this, FUNC(nslasher_state::buffer_spriteram_w<0>)); + map(0x174018, 0x17401b).nopw(); /* Sprite 'CPU' (unused) */ + map(0x178000, 0x179fff).rw(this, FUNC(nslasher_state::spriteram_r<1>), FUNC(nslasher_state::spriteram_w<1>)); + map(0x17c000, 0x17c003).nopw(); /* Sprite DMA mode (2) */ + map(0x17c010, 0x17c013).w(this, FUNC(nslasher_state::buffer_spriteram_w<1>)); + map(0x17c018, 0x17c01b).nopw(); /* Sprite 'CPU' (unused) */ + map(0x182000, 0x183fff).rw("tilegen1", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x184000, 0x185fff).rw("tilegen1", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x192000, 0x193fff).ram().w(this, FUNC(nslasher_state::pf_rowscroll_w<0>)).share("pf1_rowscroll32"); + map(0x194000, 0x195fff).ram().w(this, FUNC(nslasher_state::pf_rowscroll_w<1>)).share("pf2_rowscroll32"); + map(0x1a0000, 0x1a001f).rw("tilegen1", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x1c2000, 0x1c3fff).rw("tilegen2", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x1c4000, 0x1c5fff).rw("tilegen2", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x1d2000, 0x1d3fff).ram().w(this, FUNC(nslasher_state::pf_rowscroll_w<2>)).share("pf3_rowscroll32"); + map(0x1d4000, 0x1d5fff).ram().w(this, FUNC(nslasher_state::pf_rowscroll_w<3>)).share("pf4_rowscroll32"); + map(0x1e0000, 0x1e001f).rw("tilegen2", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x200000, 0x207fff).rw(this, FUNC(nslasher_state::ioprot_r), FUNC(nslasher_state::ioprot_w)).umask32(0xffff0000); + map(0x200000, 0x207fff).r(this, FUNC(nslasher_state::nslasher_debug_r)).umask32(0x0000ffff); +} -ADDRESS_MAP_START(nslasher_state::nslasher_map) - AM_RANGE(0x000000, 0x0fffff) AM_ROM - AM_RANGE(0x100000, 0x11ffff) AM_RAM - AM_RANGE(0x120000, 0x1200ff) AM_NOP /* ACIA (unused) */ - AM_RANGE(0x140000, 0x140003) AM_WRITE(vblank_ack_w) - AM_RANGE(0x150000, 0x150003) AM_WRITE8(eeprom_w, 0x000000ff) - AM_RANGE(0x150000, 0x150003) AM_WRITE8(volume_w, 0x0000ff00) - AM_RANGE(0x163000, 0x16309f) AM_DEVREADWRITE16("deco_ace", deco_ace_device, ace_r, ace_w, 0x0000ffff) /* 'Ace' RAM */ - AM_RANGE(0x164000, 0x164003) AM_WRITENOP /* Palette control BG2/3 ($1a constant) */ - AM_RANGE(0x164004, 0x164007) AM_WRITENOP /* Palette control Obj1 ($4 constant) */ - AM_RANGE(0x164008, 0x16400b) AM_WRITENOP /* Palette control Obj2 ($6 constant) */ - AM_RANGE(0x16400c, 0x16400f) AM_WRITENOP - AM_RANGE(0x168000, 0x169fff) AM_DEVREADWRITE("deco_ace", deco_ace_device, buffered_palette_r, buffered_palette_w) - AM_RANGE(0x16c000, 0x16c003) AM_WRITENOP - AM_RANGE(0x16c008, 0x16c00b) AM_DEVWRITE16("deco_ace", deco_ace_device, palette_dma_w, 0xffffffff) - AM_RANGE(0x170000, 0x171fff) AM_READWRITE(spriteram_r<0>, spriteram_w<0>) - AM_RANGE(0x174000, 0x174003) AM_WRITENOP /* Sprite DMA mode (2) */ - AM_RANGE(0x174010, 0x174013) AM_WRITE(buffer_spriteram_w<0>) - AM_RANGE(0x174018, 0x17401b) AM_WRITENOP /* Sprite 'CPU' (unused) */ - AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r<1>, spriteram_w<1>) - AM_RANGE(0x17c000, 0x17c003) AM_WRITENOP /* Sprite DMA mode (2) */ - AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w<1>) - AM_RANGE(0x17c018, 0x17c01b) AM_WRITENOP /* Sprite 'CPU' (unused) */ - AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") - AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) - AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") - AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) - AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(ioprot_r, ioprot_w, 0xffff0000) - AM_RANGE(0x200000, 0x207fff) AM_READ16(nslasher_debug_r, 0x0000ffff) // seems to be debug switches / code activated by this? -ADDRESS_MAP_END +void nslasher_state::nslasher_map(address_map &map) +{ + map(0x000000, 0x0fffff).rom(); + map(0x100000, 0x11ffff).ram(); + map(0x120000, 0x1200ff).noprw(); /* ACIA (unused) */ + map(0x140000, 0x140003).w(this, FUNC(nslasher_state::vblank_ack_w)); + map(0x150000, 0x150000).w(this, FUNC(nslasher_state::eeprom_w)); + map(0x150001, 0x150001).w(this, FUNC(nslasher_state::volume_w)); + map(0x163000, 0x16309f).rw(m_deco_ace, FUNC(deco_ace_device::ace_r), FUNC(deco_ace_device::ace_w)).umask32(0x0000ffff); /* 'Ace' RAM */ + map(0x164000, 0x164003).nopw(); /* Palette control BG2/3 ($1a constant) */ + map(0x164004, 0x164007).nopw(); /* Palette control Obj1 ($4 constant) */ + map(0x164008, 0x16400b).nopw(); /* Palette control Obj2 ($6 constant) */ + map(0x16400c, 0x16400f).nopw(); + map(0x168000, 0x169fff).rw(m_deco_ace, FUNC(deco_ace_device::buffered_palette_r), FUNC(deco_ace_device::buffered_palette_w)); + map(0x16c000, 0x16c003).nopw(); + map(0x16c008, 0x16c00b).w(m_deco_ace, FUNC(deco_ace_device::palette_dma_w)); + map(0x170000, 0x171fff).rw(this, FUNC(nslasher_state::spriteram_r<0>), FUNC(nslasher_state::spriteram_w<0>)); + map(0x174000, 0x174003).nopw(); /* Sprite DMA mode (2) */ + map(0x174010, 0x174013).w(this, FUNC(nslasher_state::buffer_spriteram_w<0>)); + map(0x174018, 0x17401b).nopw(); /* Sprite 'CPU' (unused) */ + map(0x178000, 0x179fff).rw(this, FUNC(nslasher_state::spriteram_r<1>), FUNC(nslasher_state::spriteram_w<1>)); + map(0x17c000, 0x17c003).nopw(); /* Sprite DMA mode (2) */ + map(0x17c010, 0x17c013).w(this, FUNC(nslasher_state::buffer_spriteram_w<1>)); + map(0x17c018, 0x17c01b).nopw(); /* Sprite 'CPU' (unused) */ + map(0x182000, 0x183fff).rw("tilegen1", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x184000, 0x185fff).rw("tilegen1", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x192000, 0x193fff).ram().w(this, FUNC(nslasher_state::pf_rowscroll_w<0>)).share("pf1_rowscroll32"); + map(0x194000, 0x195fff).ram().w(this, FUNC(nslasher_state::pf_rowscroll_w<1>)).share("pf2_rowscroll32"); + map(0x1a0000, 0x1a001f).rw("tilegen1", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x1c2000, 0x1c3fff).rw("tilegen2", FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x1c4000, 0x1c5fff).rw("tilegen2", FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x1d2000, 0x1d3fff).ram().w(this, FUNC(nslasher_state::pf_rowscroll_w<2>)).share("pf3_rowscroll32"); + map(0x1d4000, 0x1d5fff).ram().w(this, FUNC(nslasher_state::pf_rowscroll_w<3>)).share("pf4_rowscroll32"); + map(0x1e0000, 0x1e001f).rw("tilegen2", FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x200000, 0x207fff).rw(this, FUNC(nslasher_state::ioprot_r), FUNC(nslasher_state::ioprot_w)).umask32(0xffff0000); + map(0x200000, 0x207fff).r(this, FUNC(nslasher_state::nslasher_debug_r)).umask32(0x0000ffff); // seems to be debug switches / code activated by this? +} // H6280 based sound -ADDRESS_MAP_START(deco32_state::h6280_sound_map) - AM_RANGE(0x000000, 0x00ffff) AM_ROM - AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) - AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) - AM_RANGE(0x140000, 0x140000) AM_DEVREAD("ioprot", deco_146_base_device, soundlatch_r) - AM_RANGE(0x1f0000, 0x1f1fff) AM_RAM - AM_RANGE(0x1fec00, 0x1fec01) AM_DEVWRITE("audiocpu", h6280_device, timer_w) - AM_RANGE(0x1ff400, 0x1ff403) AM_DEVWRITE("audiocpu", h6280_device, irq_status_w) -ADDRESS_MAP_END +void deco32_state::h6280_sound_map(address_map &map) +{ + map(0x000000, 0x00ffff).rom(); + map(0x110000, 0x110001).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x120000, 0x120001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x130000, 0x130001).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x140000, 0x140000).r(m_ioprot, FUNC(deco_146_base_device::soundlatch_r)); + map(0x1f0000, 0x1f1fff).ram(); + map(0x1fec00, 0x1fec01).w("audiocpu", FUNC(h6280_device::timer_w)); + map(0x1ff400, 0x1ff403).w("audiocpu", FUNC(h6280_device::irq_status_w)); +} ADDRESS_MAP_START(deco32_state::h6280_sound_custom_latch_map) AM_IMPORT_FROM(h6280_sound_map) @@ -652,29 +660,32 @@ ADDRESS_MAP_START(deco32_state::h6280_sound_custom_latch_map) ADDRESS_MAP_END // Z80 based sound -ADDRESS_MAP_START(deco32_state::z80_sound_map) - AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0x8000, 0x87ff) AM_RAM - AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0xb000, 0xb000) AM_DEVREADWRITE("oki1", okim6295_device, read, write) - AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("oki2", okim6295_device, read, write) - AM_RANGE(0xd000, 0xd000) AM_DEVREAD("ioprot", deco_146_base_device, soundlatch_r) -ADDRESS_MAP_END +void deco32_state::z80_sound_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0x87ff).ram(); + map(0xa000, 0xa001).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0xb000, 0xb000).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0xc000, 0xc000).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0xd000, 0xd000).r(m_ioprot, FUNC(deco_146_base_device::soundlatch_r)); +} ADDRESS_MAP_START(deco32_state::z80_sound_io) AM_RANGE(0x0000, 0xffff) AM_ROM AM_REGION("audiocpu", 0) ADDRESS_MAP_END // lockload needs hi bits of OKI2 bankswitching -ADDRESS_MAP_START(dragngun_state::lockload_sound_map) - AM_IMPORT_FROM(z80_sound_map) - AM_RANGE(0xe000, 0xe000) AM_WRITE(lockload_okibank_hi_w) -ADDRESS_MAP_END +void dragngun_state::lockload_sound_map(address_map &map) +{ + z80_sound_map(map); + map(0xe000, 0xe000).w(this, FUNC(dragngun_state::lockload_okibank_hi_w)); +} -ADDRESS_MAP_START(dragngun_state::lockloadu_sound_map) - AM_IMPORT_FROM(h6280_sound_map) - AM_RANGE(0x150000, 0x150000) AM_WRITE(lockload_okibank_hi_w) -ADDRESS_MAP_END +void dragngun_state::lockloadu_sound_map(address_map &map) +{ + h6280_sound_map(map); + map(0x150000, 0x150000).w(this, FUNC(dragngun_state::lockload_okibank_hi_w)); +} //************************************************************************** |