summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/mz2500.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/mz2500.cpp')
-rw-r--r--src/mame/drivers/mz2500.cpp88
1 files changed, 45 insertions, 43 deletions
diff --git a/src/mame/drivers/mz2500.cpp b/src/mame/drivers/mz2500.cpp
index ad8be4569d1..52b0065d4b9 100644
--- a/src/mame/drivers/mz2500.cpp
+++ b/src/mame/drivers/mz2500.cpp
@@ -1227,16 +1227,17 @@ WRITE8_MEMBER(mz2500_state::floppy_side_w)
}
-ADDRESS_MAP_START(mz2500_state::mz2500_map)
- AM_RANGE(0x0000, 0x1fff) AM_READWRITE(bank0_r,bank0_w)
- AM_RANGE(0x2000, 0x3fff) AM_READWRITE(bank1_r,bank1_w)
- AM_RANGE(0x4000, 0x5fff) AM_READWRITE(bank2_r,bank2_w)
- AM_RANGE(0x6000, 0x7fff) AM_READWRITE(bank3_r,bank3_w)
- AM_RANGE(0x8000, 0x9fff) AM_READWRITE(bank4_r,bank4_w)
- AM_RANGE(0xa000, 0xbfff) AM_READWRITE(bank5_r,bank5_w)
- AM_RANGE(0xc000, 0xdfff) AM_READWRITE(bank6_r,bank6_w)
- AM_RANGE(0xe000, 0xffff) AM_READWRITE(bank7_r,bank7_w)
-ADDRESS_MAP_END
+void mz2500_state::mz2500_map(address_map &map)
+{
+ map(0x0000, 0x1fff).rw(this, FUNC(mz2500_state::bank0_r), FUNC(mz2500_state::bank0_w));
+ map(0x2000, 0x3fff).rw(this, FUNC(mz2500_state::bank1_r), FUNC(mz2500_state::bank1_w));
+ map(0x4000, 0x5fff).rw(this, FUNC(mz2500_state::bank2_r), FUNC(mz2500_state::bank2_w));
+ map(0x6000, 0x7fff).rw(this, FUNC(mz2500_state::bank3_r), FUNC(mz2500_state::bank3_w));
+ map(0x8000, 0x9fff).rw(this, FUNC(mz2500_state::bank4_r), FUNC(mz2500_state::bank4_w));
+ map(0xa000, 0xbfff).rw(this, FUNC(mz2500_state::bank5_r), FUNC(mz2500_state::bank5_w));
+ map(0xc000, 0xdfff).rw(this, FUNC(mz2500_state::bank6_r), FUNC(mz2500_state::bank6_w));
+ map(0xe000, 0xffff).rw(this, FUNC(mz2500_state::bank7_r), FUNC(mz2500_state::bank7_w));
+}
READ8_MEMBER(mz2500_state::mz2500_rom_r)
@@ -1511,46 +1512,47 @@ WRITE8_MEMBER(mz2500_state::mz2500_emm_data_w)
m_emm_ram[m_emm_offset] = data;
}
-ADDRESS_MAP_START(mz2500_state::mz2500_io)
- ADDRESS_MAP_GLOBAL_MASK(0xff)
+void mz2500_state::mz2500_io(address_map &map)
+{
+ map.global_mask(0xff);
// AM_RANGE(0x60, 0x63) AM_WRITE(w3100a_w)
// AM_RANGE(0x63, 0x63) AM_READ(w3100a_r)
// AM_RANGE(0x98, 0x99) ADPCM, unknown type, custom?
- AM_RANGE(0xa0, 0xa3) AM_DEVREADWRITE("z80sio", z80sio_device, ba_cd_r, ba_cd_w)
+ map(0xa0, 0xa3).rw("z80sio", FUNC(z80sio_device::ba_cd_r), FUNC(z80sio_device::ba_cd_w));
// AM_RANGE(0xa4, 0xa5) AM_READWRITE(sasi_r, sasi_w)
- AM_RANGE(0xa8, 0xa8) AM_WRITE(mz2500_rom_w)
- AM_RANGE(0xa9, 0xa9) AM_READ(mz2500_rom_r)
- AM_RANGE(0xac, 0xac) AM_WRITE(mz2500_emm_addr_w)
- AM_RANGE(0xad, 0xad) AM_READ(mz2500_emm_data_r) AM_WRITE(mz2500_emm_data_w)
- AM_RANGE(0xae, 0xae) AM_WRITE(palette4096_io_w)
+ map(0xa8, 0xa8).w(this, FUNC(mz2500_state::mz2500_rom_w));
+ map(0xa9, 0xa9).r(this, FUNC(mz2500_state::mz2500_rom_r));
+ map(0xac, 0xac).w(this, FUNC(mz2500_state::mz2500_emm_addr_w));
+ map(0xad, 0xad).r(this, FUNC(mz2500_state::mz2500_emm_data_r)).w(this, FUNC(mz2500_state::mz2500_emm_data_w));
+ map(0xae, 0xae).w(this, FUNC(mz2500_state::palette4096_io_w));
// AM_RANGE(0xb0, 0xb3) AM_READWRITE(sio_r,sio_w)
- AM_RANGE(0xb4, 0xb4) AM_READWRITE(mz2500_bank_addr_r,mz2500_bank_addr_w)
- AM_RANGE(0xb5, 0xb5) AM_READWRITE(mz2500_bank_data_r,mz2500_bank_data_w)
- AM_RANGE(0xb7, 0xb7) AM_WRITENOP
- AM_RANGE(0xb8, 0xb9) AM_READWRITE(mz2500_kanji_r,mz2500_kanji_w)
- AM_RANGE(0xbc, 0xbc) AM_READ(mz2500_bplane_latch_r) AM_WRITE(mz2500_cg_addr_w)
- AM_RANGE(0xbd, 0xbd) AM_READ(mz2500_rplane_latch_r) AM_WRITE(mz2500_cg_data_w)
- AM_RANGE(0xbe, 0xbe) AM_READ(mz2500_gplane_latch_r)
- AM_RANGE(0xbf, 0xbf) AM_READ(mz2500_iplane_latch_r)
- AM_RANGE(0xc6, 0xc6) AM_WRITE(mz2500_irq_sel_w)
- AM_RANGE(0xc7, 0xc7) AM_WRITE(mz2500_irq_data_w)
- AM_RANGE(0xc8, 0xc9) AM_DEVREADWRITE("ym", ym2203_device, read, write)
+ map(0xb4, 0xb4).rw(this, FUNC(mz2500_state::mz2500_bank_addr_r), FUNC(mz2500_state::mz2500_bank_addr_w));
+ map(0xb5, 0xb5).rw(this, FUNC(mz2500_state::mz2500_bank_data_r), FUNC(mz2500_state::mz2500_bank_data_w));
+ map(0xb7, 0xb7).nopw();
+ map(0xb8, 0xb9).rw(this, FUNC(mz2500_state::mz2500_kanji_r), FUNC(mz2500_state::mz2500_kanji_w));
+ map(0xbc, 0xbc).r(this, FUNC(mz2500_state::mz2500_bplane_latch_r)).w(this, FUNC(mz2500_state::mz2500_cg_addr_w));
+ map(0xbd, 0xbd).r(this, FUNC(mz2500_state::mz2500_rplane_latch_r)).w(this, FUNC(mz2500_state::mz2500_cg_data_w));
+ map(0xbe, 0xbe).r(this, FUNC(mz2500_state::mz2500_gplane_latch_r));
+ map(0xbf, 0xbf).r(this, FUNC(mz2500_state::mz2500_iplane_latch_r));
+ map(0xc6, 0xc6).w(this, FUNC(mz2500_state::mz2500_irq_sel_w));
+ map(0xc7, 0xc7).w(this, FUNC(mz2500_state::mz2500_irq_data_w));
+ map(0xc8, 0xc9).rw("ym", FUNC(ym2203_device::read), FUNC(ym2203_device::write));
// AM_RANGE(0xca, 0xca) AM_READWRITE(voice_r,voice_w)
- AM_RANGE(0xcc, 0xcc) AM_READWRITE(rp5c15_8_r, rp5c15_8_w)
- AM_RANGE(0xce, 0xce) AM_WRITE(mz2500_dictionary_bank_w)
- AM_RANGE(0xcf, 0xcf) AM_WRITE(mz2500_kanji_bank_w)
- AM_RANGE(0xd8, 0xdb) AM_READWRITE(fdc_r, fdc_w)
- AM_RANGE(0xdc, 0xdc) AM_WRITE(floppy_select_w)
- AM_RANGE(0xdd, 0xdd) AM_WRITE(floppy_side_w)
- AM_RANGE(0xde, 0xde) AM_WRITENOP
- AM_RANGE(0xe0, 0xe3) AM_DEVREADWRITE("i8255_0", i8255_device, read, write)
- AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("pit", pit8253_device, read, write)
- AM_RANGE(0xe8, 0xeb) AM_DEVREADWRITE("z80pio_1", z80pio_device, read_alt, write_alt)
- AM_RANGE(0xef, 0xef) AM_READWRITE(mz2500_joystick_r,mz2500_joystick_w)
- AM_RANGE(0xf0, 0xf3) AM_WRITE(timer_w)
- AM_RANGE(0xf4, 0xf7) AM_READ(mz2500_crtc_hvblank_r) AM_WRITE(mz2500_tv_crtc_w)
+ map(0xcc, 0xcc).rw(this, FUNC(mz2500_state::rp5c15_8_r), FUNC(mz2500_state::rp5c15_8_w));
+ map(0xce, 0xce).w(this, FUNC(mz2500_state::mz2500_dictionary_bank_w));
+ map(0xcf, 0xcf).w(this, FUNC(mz2500_state::mz2500_kanji_bank_w));
+ map(0xd8, 0xdb).rw(this, FUNC(mz2500_state::fdc_r), FUNC(mz2500_state::fdc_w));
+ map(0xdc, 0xdc).w(this, FUNC(mz2500_state::floppy_select_w));
+ map(0xdd, 0xdd).w(this, FUNC(mz2500_state::floppy_side_w));
+ map(0xde, 0xde).nopw();
+ map(0xe0, 0xe3).rw("i8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xe4, 0xe7).rw(m_pit, FUNC(pit8253_device::read), FUNC(pit8253_device::write));
+ map(0xe8, 0xeb).rw("z80pio_1", FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt));
+ map(0xef, 0xef).rw(this, FUNC(mz2500_state::mz2500_joystick_r), FUNC(mz2500_state::mz2500_joystick_w));
+ map(0xf0, 0xf3).w(this, FUNC(mz2500_state::timer_w));
+ map(0xf4, 0xf7).r(this, FUNC(mz2500_state::mz2500_crtc_hvblank_r)).w(this, FUNC(mz2500_state::mz2500_tv_crtc_w));
// AM_RANGE(0xf8, 0xf9) AM_READWRITE(extrom_r,extrom_w)
-ADDRESS_MAP_END
+}
/* Input ports */
static INPUT_PORTS_START( mz2500 )