summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/mstation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/mstation.cpp')
-rw-r--r--src/mame/drivers/mstation.cpp55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/mame/drivers/mstation.cpp b/src/mame/drivers/mstation.cpp
index f2a1cce7b98..bab0cac33ce 100644
--- a/src/mame/drivers/mstation.cpp
+++ b/src/mame/drivers/mstation.cpp
@@ -256,33 +256,36 @@ READ8_MEMBER( mstation_state::kb_r )
}
-ADDRESS_MAP_START(mstation_state::mstation_banked_map)
- AM_RANGE(0x0000000, 0x00fffff) AM_MIRROR(0x0300000) AM_DEVREADWRITE("flash0", intelfsh8_device, read, write)
- AM_RANGE(0x0400000, 0x041ffff) AM_MIRROR(0x03e0000) AM_RAM AM_SHARE("nvram")
- AM_RANGE(0x0c00000, 0x0c7ffff) AM_MIRROR(0x0380000) AM_DEVREADWRITE("flash1", intelfsh8_device, read, write)
- AM_RANGE(0x0800000, 0x0803fff) AM_MIRROR(0x03fc000) AM_READWRITE(lcd_left_r, lcd_left_w)
- AM_RANGE(0x1000000, 0x1003fff) AM_MIRROR(0x03fc000) AM_READWRITE(lcd_right_r, lcd_right_w)
- AM_RANGE(0x1400000, 0x1403fff) AM_MIRROR(0x03fc000) AM_READWRITE(modem_r, modem_w)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(mstation_state::mstation_mem)
- AM_RANGE(0x0000, 0x3fff) AM_DEVREADWRITE("flash0", intelfsh8_device, read, write)
- AM_RANGE(0x4000, 0x7fff) AM_DEVREADWRITE("bank0", address_map_bank_device, read8, write8)
- AM_RANGE(0x8000, 0xbfff) AM_DEVREADWRITE("bank1", address_map_bank_device, read8, write8)
- AM_RANGE(0xc000, 0xffff) AM_RAMBANK("sysram") // system ram always first RAM bank
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(mstation_state::mstation_io)
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE( 0x01, 0x01 ) AM_READWRITE(kb_r, kb_w)
- AM_RANGE( 0x02, 0x02 ) AM_WRITE(port2_w)
- AM_RANGE( 0x03, 0x03 ) AM_READWRITE(irq_r, irq_w)
- AM_RANGE( 0x05, 0x06 ) AM_READWRITE(bank1_r, bank1_w)
- AM_RANGE( 0x07, 0x08 ) AM_READWRITE(bank2_r, bank2_w)
- AM_RANGE( 0x09, 0x09 ) AM_READ(battery_status_r)
- AM_RANGE( 0x10, 0x1f ) AM_DEVREADWRITE("rtc", rp5c01_device, read, write)
+void mstation_state::mstation_banked_map(address_map &map)
+{
+ map(0x0000000, 0x00fffff).mirror(0x0300000).rw("flash0", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write));
+ map(0x0400000, 0x041ffff).mirror(0x03e0000).ram().share("nvram");
+ map(0x0c00000, 0x0c7ffff).mirror(0x0380000).rw("flash1", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write));
+ map(0x0800000, 0x0803fff).mirror(0x03fc000).rw(this, FUNC(mstation_state::lcd_left_r), FUNC(mstation_state::lcd_left_w));
+ map(0x1000000, 0x1003fff).mirror(0x03fc000).rw(this, FUNC(mstation_state::lcd_right_r), FUNC(mstation_state::lcd_right_w));
+ map(0x1400000, 0x1403fff).mirror(0x03fc000).rw(this, FUNC(mstation_state::modem_r), FUNC(mstation_state::modem_w));
+}
+
+void mstation_state::mstation_mem(address_map &map)
+{
+ map(0x0000, 0x3fff).rw("flash0", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write));
+ map(0x4000, 0x7fff).rw(m_bankdev1, FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x8000, 0xbfff).rw(m_bankdev2, FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xc000, 0xffff).bankrw("sysram"); // system ram always first RAM bank
+}
+
+void mstation_state::mstation_io(address_map &map)
+{
+ map.global_mask(0xff);
+ map(0x01, 0x01).rw(this, FUNC(mstation_state::kb_r), FUNC(mstation_state::kb_w));
+ map(0x02, 0x02).w(this, FUNC(mstation_state::port2_w));
+ map(0x03, 0x03).rw(this, FUNC(mstation_state::irq_r), FUNC(mstation_state::irq_w));
+ map(0x05, 0x06).rw(this, FUNC(mstation_state::bank1_r), FUNC(mstation_state::bank1_w));
+ map(0x07, 0x08).rw(this, FUNC(mstation_state::bank2_r), FUNC(mstation_state::bank2_w));
+ map(0x09, 0x09).r(this, FUNC(mstation_state::battery_status_r));
+ map(0x10, 0x1f).rw("rtc", FUNC(rp5c01_device::read), FUNC(rp5c01_device::write));
//AM_RANGE( 0x2c, 0x2c ) printer
-ADDRESS_MAP_END
+}
/* Input ports */