(nw) more address map modernisation

This commit is contained in:
Robbbert 2018-04-12 01:23:58 +10:00
parent da3bcbde9b
commit ac3bf44b2d
10 changed files with 78 additions and 72 deletions

View File

@ -39,7 +39,7 @@ void a2600_base_state::a2600_mem(address_map &map) // 6507 has 13-bit address sp
map(0x0280, 0x029f).mirror(0x0d00).rw("riot", FUNC(riot6532_device::read), FUNC(riot6532_device::write)); map(0x0280, 0x029f).mirror(0x0d00).rw("riot", FUNC(riot6532_device::read), FUNC(riot6532_device::write));
#endif #endif
// map(0x1000, 0x1fff) is cart data and it is configured at reset time, depending on the mounted cart! // map(0x1000, 0x1fff) is cart data and it is configured at reset time, depending on the mounted cart!
ADDRESS_MAP_END }
READ8_MEMBER(a2600_state::cart_over_all_r) READ8_MEMBER(a2600_state::cart_over_all_r)

View File

@ -32,7 +32,7 @@ void asst128_mb_device::map(address_map &map)
map(0x0060, 0x006f).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x0060, 0x006f).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x0080, 0x008f).w(this, FUNC(asst128_mb_device::pc_page_w)); map(0x0080, 0x008f).w(this, FUNC(asst128_mb_device::pc_page_w));
map(0x00a0, 0x00a1).w(this, FUNC(asst128_mb_device::nmi_enable_w)); map(0x00a0, 0x00a1).w(this, FUNC(asst128_mb_device::nmi_enable_w));
ADDRESS_MAP_END }
DEFINE_DEVICE_TYPE(ASST128_MOTHERBOARD, asst128_mb_device, "asst128_mb", "ASST128_MOTHERBOARD") DEFINE_DEVICE_TYPE(ASST128_MOTHERBOARD, asst128_mb_device, "asst128_mb", "ASST128_MOTHERBOARD")

View File

@ -118,17 +118,18 @@ private:
}; };
ADDRESS_MAP_START(de_2_state::de_2_map) void de_2_state::de_2_map(address_map &map)
AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("nvram") {
AM_RANGE(0x2100, 0x2103) AM_DEVREADWRITE("pia21", pia6821_device, read, write) // sound+solenoids map(0x0000, 0x1fff).ram().share("nvram");
AM_RANGE(0x2200, 0x2200) AM_WRITE(sol3_w) // solenoids map(0x2100, 0x2103).rw("pia21", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // sound+solenoids
AM_RANGE(0x2400, 0x2403) AM_DEVREADWRITE("pia24", pia6821_device, read, write) // lamps map(0x2200, 0x2200).w(this, FUNC(de_2_state::sol3_w)); // solenoids
AM_RANGE(0x2800, 0x2803) AM_DEVREADWRITE("pia28", pia6821_device, read, write) // display map(0x2400, 0x2403).rw("pia24", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // lamps
AM_RANGE(0x2c00, 0x2c03) AM_DEVREADWRITE("pia2c", pia6821_device, read, write) // alphanumeric display map(0x2800, 0x2803).rw("pia28", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // display
AM_RANGE(0x3000, 0x3003) AM_DEVREADWRITE("pia30", pia6821_device, read, write) // inputs map(0x2c00, 0x2c03).rw("pia2c", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // alphanumeric display
AM_RANGE(0x3400, 0x3403) AM_DEVREADWRITE("pia34", pia6821_device, read, write) // widget map(0x3000, 0x3003).rw("pia30", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // inputs
AM_RANGE(0x4000, 0xffff) AM_ROM map(0x3400, 0x3403).rw("pia34", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); // widget
ADDRESS_MAP_END map(0x4000, 0xffff).rom();
}
void de_2_state::de_2_audio_map(address_map &map) void de_2_state::de_2_audio_map(address_map &map)
{ {

View File

@ -937,11 +937,12 @@ void xevious_state::battles_mem4(address_map &map)
map(0x8000, 0x80ff).ram(); map(0x8000, 0x80ff).ram();
} }
ADDRESS_MAP_START(galaga_state::dzigzag_mem4) void galaga_state::dzigzag_mem4(address_map &map)
AM_RANGE(0x0000, 0x0fff) AM_ROM {
AM_RANGE(0x1000, 0x107f) AM_RAM map(0x0000, 0x0fff).rom();
AM_RANGE(0x4000, 0x4007) AM_READONLY // dip switches? bits 0 & 1 used map(0x1000, 0x107f).ram();
ADDRESS_MAP_END map(0x4000, 0x4007).readonly(); // dip switches? bits 0 & 1 used
}
static INPUT_PORTS_START( bosco ) static INPUT_PORTS_START( bosco )

View File

@ -204,14 +204,14 @@ void qtsbc_state::mem_map(address_map &map)
{ {
map.unmap_value_high(); map.unmap_value_high();
map(0x0000, 0xffff).ram().share("ram"); map(0x0000, 0xffff).ram().share("ram");
map(0x0000, 0xffff).r(this, FUNC(qtsbc_state::memory_r)).w(this, FUNC(qtsbc_state::memory_w)); map(0x0000, 0xffff).rw(this, FUNC(qtsbc_state::memory_r), FUNC(qtsbc_state::memory_w));
} }
void qtsbc_state::io_map(address_map &map) void qtsbc_state::io_map(address_map &map)
{ {
map.unmap_value_high(); map.unmap_value_high();
map(0x0000, 0xffff).r(this, FUNC(qtsbc_state::io_r)).w(this, FUNC(qtsbc_state::io_w)); map(0x0000, 0xffff).rw(this, FUNC(qtsbc_state::io_r), FUNC(qtsbc_state::io_w));
ADDRESS_MAP_END }
/* Input ports */ /* Input ports */
static INPUT_PORTS_START( qtsbc ) static INPUT_PORTS_START( qtsbc )

View File

@ -94,16 +94,17 @@ private:
// ADDRESS MAPS // ADDRESS MAPS
//************************************************************************** //**************************************************************************
ADDRESS_MAP_START( rz1_state::map ) void rz1_state::map(address_map &map)
// AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION("maincpu", 0) {
AM_RANGE(0x2000, 0x3fff) AM_RAM // map(0x0000, 0x0fff).rom().region("maincpu", 0);
AM_RANGE(0x4000, 0x7fff) AM_ROM AM_REGION("program", 0) map(0x2000, 0x3fff).ram();
AM_RANGE(0x8000, 0x8fff) AM_WRITE(upd934g_c_w) map(0x4000, 0x7fff).rom().region("program", 0);
AM_RANGE(0x9000, 0x9fff) AM_READWRITE(key_r, upd934g_b_w) map(0x8000, 0x8fff).w(this, FUNC(rz1_state::upd934g_c_w));
AM_RANGE(0xa000, 0xbfff) AM_RAM // sample ram 1 map(0x9000, 0x9fff).rw(this, FUNC(rz1_state::key_r), FUNC(rz1_state::upd934g_b_w));
AM_RANGE(0xc000, 0xdfff) AM_RAM // sample ram 2 map(0xa000, 0xbfff).ram(); // sample ram 1
AM_RANGE(0xe000, 0xe001) AM_WRITE(leds_w) map(0xc000, 0xdfff).ram(); // sample ram 2
ADDRESS_MAP_END map(0xe000, 0xe001).w(this, FUNC(rz1_state::leds_w));
}
//************************************************************************** //**************************************************************************

View File

@ -27,23 +27,25 @@ void s11c_state::s11c_main_map(address_map &map)
map(0x4000, 0xffff).rom(); map(0x4000, 0xffff).rom();
} }
ADDRESS_MAP_START(s11c_state::s11c_audio_map) void s11c_state::s11c_audio_map(address_map &map)
AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x0800) AM_RAM {
AM_RANGE(0x1000, 0x1fff) AM_WRITE(bank_w) map(0x0000, 0x07ff).mirror(0x0800).ram();
AM_RANGE(0x2000, 0x2003) AM_MIRROR(0x0ffc) AM_DEVREADWRITE("pias", pia6821_device, read, write) map(0x1000, 0x1fff).w(this, FUNC(s11c_state::bank_w));
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank0") map(0x2000, 0x2003).mirror(0x0ffc).rw("pias", FUNC(pia6821_device::read), FUNC(pia6821_device::write));
AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank1") map(0x8000, 0xbfff).bankr("bank0");
ADDRESS_MAP_END map(0xc000, 0xffff).bankr("bank1");
}
ADDRESS_MAP_START(s11c_state::s11c_bg_map) void s11c_state::s11c_bg_map(address_map &map)
AM_RANGE(0x0000, 0x07ff) AM_RAM {
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x1ffe) AM_DEVREADWRITE("ym2151", ym2151_device, read, write) map(0x0000, 0x07ff).ram();
AM_RANGE(0x4000, 0x4003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE("pia40", pia6821_device, read, write) map(0x2000, 0x2001).mirror(0x1ffe).rw("ym2151", FUNC(ym2151_device::read), FUNC(ym2151_device::write));
AM_RANGE(0x6000, 0x67ff) AM_WRITE(bg_speech_digit_w) map(0x4000, 0x4003).mirror(0x1ffc).rw("pia40", FUNC(pia6821_device::read), FUNC(pia6821_device::write));
AM_RANGE(0x6800, 0x6fff) AM_WRITE(bg_speech_clock_w) map(0x6000, 0x67ff).w(this, FUNC(s11c_state::bg_speech_digit_w));
AM_RANGE(0x7800, 0x7fff) AM_WRITE(bgbank_w) map(0x6800, 0x6fff).w(this, FUNC(s11c_state::bg_speech_clock_w));
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bgbank") map(0x7800, 0x7fff).w(this, FUNC(s11c_state::bgbank_w));
ADDRESS_MAP_END map(0x8000, 0xffff).bankr("bgbank");
}
static INPUT_PORTS_START( s11c ) static INPUT_PORTS_START( s11c )
PORT_START("X0") PORT_START("X0")

View File

@ -341,14 +341,13 @@ WRITE16_MEMBER(pico_base_state::pico_68k_io_write )
} }
} }
ADDRESS_MAP_START(pico_base_state::pico_mem) void pico_base_state::pico_mem(address_map &map)
AM_RANGE(0x000000, 0x3fffff) AM_ROM {
map(0x000000, 0x3fffff).rom();
AM_RANGE(0x800000, 0x80001f) AM_READWRITE(pico_68k_io_read, pico_68k_io_write) map(0x800000, 0x80001f).rw(this, FUNC(pico_base_state::pico_68k_io_read), FUNC(pico_base_state::pico_68k_io_write));
map(0xc00000, 0xc0001f).rw("gen_vdp", FUNC(sega315_5313_device::vdp_r), FUNC(sega315_5313_device::vdp_w));
AM_RANGE(0xc00000, 0xc0001f) AM_DEVREADWRITE("gen_vdp", sega315_5313_device, vdp_r, vdp_w) map(0xe00000, 0xe0ffff).ram().mirror(0x1f0000);
AM_RANGE(0xe00000, 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000) }
ADDRESS_MAP_END
static INPUT_PORTS_START( pico ) static INPUT_PORTS_START( pico )

View File

@ -174,31 +174,33 @@ void sg1000_state::omv_io_map(address_map &map)
ADDRESS_MAP( sc3000_map ) ADDRESS_MAP( sc3000_map )
-------------------------------------------------*/ -------------------------------------------------*/
ADDRESS_MAP_START(sg1000_state::sc3000_map) void sg1000_state::sc3000_map(address_map &map)
AM_RANGE(0x0000, 0xbfff) AM_DEVREADWRITE(CARTSLOT_TAG, sega8_cart_slot_device, read_cart, write_cart) {
AM_RANGE(0xc000, 0xc7ff) AM_MIRROR(0x3800) AM_RAM map(0x0000, 0xbfff).rw(CARTSLOT_TAG, FUNC(sega8_cart_slot_device::read_cart), FUNC(sega8_cart_slot_device::write_cart));
ADDRESS_MAP_END map(0xc000, 0xc7ff).mirror(0x3800).ram();
}
/*------------------------------------------------- /*-------------------------------------------------
ADDRESS_MAP( sc3000_io_map ) ADDRESS_MAP( sc3000_io_map )
-------------------------------------------------*/ -------------------------------------------------*/
ADDRESS_MAP_START(sg1000_state::sc3000_io_map) void sg1000_state::sc3000_io_map(address_map &map)
ADDRESS_MAP_GLOBAL_MASK(0xff) {
AM_RANGE(0x7f, 0x7f) AM_DEVWRITE(SN76489AN_TAG, sn76489a_device, write) map.global_mask(0xff);
AM_RANGE(0xbe, 0xbe) AM_DEVREADWRITE(TMS9918A_TAG, tms9918a_device, vram_read, vram_write) map(0x7f, 0x7f).w(SN76489AN_TAG, FUNC(sn76489a_device::write));
AM_RANGE(0xbf, 0xbf) AM_DEVREADWRITE(TMS9918A_TAG, tms9918a_device, register_read, register_write) map(0xbe, 0xbe).rw(TMS9918A_TAG, FUNC(tms9918a_device::vram_read), FUNC(tms9918a_device::vram_write));
AM_RANGE(0xdc, 0xdf) AM_READWRITE(peripheral_r, peripheral_w) map(0xbf, 0xbf).rw(TMS9918A_TAG, FUNC(tms9918a_device::register_read), FUNC(tms9918a_device::register_write));
ADDRESS_MAP_END map(0xdc, 0xdf).rw(this, FUNC(sg1000_state::peripheral_r), FUNC(sg1000_state::peripheral_w));
}
/* This is how the I/O ports are really mapped, but MAME does not support overlapping ranges /* This is how the I/O ports are really mapped, but MAME does not support overlapping ranges
ADDRESS_MAP_START(sg1000_state::sc3000_io_map) ADDRESS_MAP_START(sg1000_state::sc3000_io_map)
ADDRESS_MAP_GLOBAL_MASK(0xff) ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_MIRROR(0xdf) AM_DEVREADWRITE(UPD9255_TAG, i8255_device, read, write) map(0x00, 0x00) AM_MIRROR(0xdf) AM_DEVREADWRITE(UPD9255_TAG, i8255_device, read, write)
AM_RANGE(0x00, 0x00) AM_MIRROR(0x7f) AM_DEVWRITE(SN76489AN_TAG, sn76489a_device, write) map(0x00, 0x00) AM_MIRROR(0x7f) AM_DEVWRITE(SN76489AN_TAG, sn76489a_device, write)
AM_RANGE(0x00, 0x00) AM_MIRROR(0xae) AM_DEVREADWRITE(TMS9918A_TAG, tms9918a_device, vram_read, vram_write) map(0x00, 0x00) AM_MIRROR(0xae) AM_DEVREADWRITE(TMS9918A_TAG, tms9918a_device, vram_read, vram_write)
AM_RANGE(0x01, 0x01) AM_MIRROR(0xae) AM_DEVREADWRITE(TMS9918A_TAG, tms9918a_device, register_read, register_write) map(0x01, 0x01) AM_MIRROR(0xae) AM_DEVREADWRITE(TMS9918A_TAG, tms9918a_device, register_read, register_write)
AM_RANGE(0x60, 0x60) AM_MIRROR(0x9f) AM_READ(sc3000_r_r) map(0x60, 0x60) AM_MIRROR(0x9f) AM_READ(sc3000_r_r)
ADDRESS_MAP_END ADDRESS_MAP_END
*/ */

View File

@ -476,7 +476,7 @@ static INPUT_PORTS_START( switches )
PORT_DIPNAME(0x03, 0x02, "DTR (RS232)") PORT_DIPLOCATION("S5:3,4") PORT_DIPNAME(0x03, 0x02, "DTR (RS232)") PORT_DIPLOCATION("S5:3,4")
PORT_DIPSETTING(0x02, "Tied to RTS") PORT_DIPSETTING(0x02, "Tied to RTS")
PORT_DIPSETTING(0x01, "Pulled to +12V") PORT_DIPSETTING(0x01, "Pulled to +12V")
ADDRESS_MAP_END INPUT_PORTS_END
static INPUT_PORTS_START( tv912b ) static INPUT_PORTS_START( tv912b )
PORT_INCLUDE(switches) PORT_INCLUDE(switches)