diff options
Diffstat (limited to 'src/mame/drivers/sm7238.cpp')
-rw-r--r-- | src/mame/drivers/sm7238.cpp | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/mame/drivers/sm7238.cpp b/src/mame/drivers/sm7238.cpp index fea756e2f2e..c08ec66df36 100644 --- a/src/mame/drivers/sm7238.cpp +++ b/src/mame/drivers/sm7238.cpp @@ -125,37 +125,40 @@ private: required_device<screen_device> m_screen; }; -ADDRESS_MAP_START(sm7238_state::sm7238_mem) - ADDRESS_MAP_UNMAP_HIGH - AM_RANGE (0x0000, 0x9fff) AM_ROM - AM_RANGE (0xa000, 0xa7ff) AM_RAM - AM_RANGE (0xb000, 0xb3ff) AM_RAM AM_SHARE("nvram") - AM_RANGE (0xb800, 0xb800) AM_WRITE(text_control_w) - AM_RANGE (0xbc00, 0xbc00) AM_WRITE(control_w) - AM_RANGE (0xc000, 0xcfff) AM_RAM // chargen - AM_RANGE (0xe000, 0xffff) AM_DEVICE("videobank", address_map_bank_device, amap8) -ADDRESS_MAP_END - -ADDRESS_MAP_START(sm7238_state::videobank_map) - AM_RANGE (0x0000, 0x1fff) AM_RAM AM_SHARE("videoram") - AM_RANGE (0x2000, 0x2fff) AM_MIRROR(0x1000) AM_WRITE(vmem_w) -ADDRESS_MAP_END - -ADDRESS_MAP_START(sm7238_state::sm7238_io) - ADDRESS_MAP_UNMAP_HIGH +void sm7238_state::sm7238_mem(address_map &map) +{ + map.unmap_value_high(); + map(0x0000, 0x9fff).rom(); + map(0xa000, 0xa7ff).ram(); + map(0xb000, 0xb3ff).ram().share("nvram"); + map(0xb800, 0xb800).w(this, FUNC(sm7238_state::text_control_w)); + map(0xbc00, 0xbc00).w(this, FUNC(sm7238_state::control_w)); + map(0xc000, 0xcfff).ram(); // chargen + map(0xe000, 0xffff).m(m_videobank, FUNC(address_map_bank_device::amap8)); +} + +void sm7238_state::videobank_map(address_map &map) +{ + map(0x0000, 0x1fff).ram().share("videoram"); + map(0x2000, 0x2fff).mirror(0x1000).w(this, FUNC(sm7238_state::vmem_w)); +} + +void sm7238_state::sm7238_io(address_map &map) +{ + map.unmap_value_high(); // AM_RANGE (0x40, 0x4f) AM_RAM // LUT - AM_RANGE (0xa0, 0xa0) AM_DEVREADWRITE("i8251line", i8251_device, data_r, data_w) - AM_RANGE (0xa1, 0xa1) AM_DEVREADWRITE("i8251line", i8251_device, status_r, control_w) - AM_RANGE (0xa4, 0xa4) AM_DEVREADWRITE("i8251kbd", i8251_device, data_r, data_w) - AM_RANGE (0xa5, 0xa5) AM_DEVREADWRITE("i8251kbd", i8251_device, status_r, control_w) - AM_RANGE (0xa8, 0xab) AM_DEVREADWRITE("t_color", pit8253_device, read, write) - AM_RANGE (0xac, 0xad) AM_DEVREADWRITE("pic8259", pic8259_device, read, write) - AM_RANGE (0xb0, 0xb3) AM_DEVREADWRITE("t_hblank", pit8253_device, read, write) - AM_RANGE (0xb4, 0xb7) AM_DEVREADWRITE("t_vblank", pit8253_device, read, write) - AM_RANGE (0xb8, 0xb8) AM_DEVREADWRITE("i8251prn", i8251_device, data_r, data_w) - AM_RANGE (0xb9, 0xb9) AM_DEVREADWRITE("i8251prn", i8251_device, status_r, control_w) - AM_RANGE (0xbc, 0xbf) AM_DEVREADWRITE("t_iface", pit8253_device, read, write) -ADDRESS_MAP_END + map(0xa0, 0xa0).rw(m_i8251line, FUNC(i8251_device::data_r), FUNC(i8251_device::data_w)); + map(0xa1, 0xa1).rw(m_i8251line, FUNC(i8251_device::status_r), FUNC(i8251_device::control_w)); + map(0xa4, 0xa4).rw(m_i8251kbd, FUNC(i8251_device::data_r), FUNC(i8251_device::data_w)); + map(0xa5, 0xa5).rw(m_i8251kbd, FUNC(i8251_device::status_r), FUNC(i8251_device::control_w)); + map(0xa8, 0xab).rw(m_t_color, FUNC(pit8253_device::read), FUNC(pit8253_device::write)); + map(0xac, 0xad).rw(m_pic8259, FUNC(pic8259_device::read), FUNC(pic8259_device::write)); + map(0xb0, 0xb3).rw(m_t_hblank, FUNC(pit8253_device::read), FUNC(pit8253_device::write)); + map(0xb4, 0xb7).rw(m_t_vblank, FUNC(pit8253_device::read), FUNC(pit8253_device::write)); + map(0xb8, 0xb8).rw(m_i8251prn, FUNC(i8251_device::data_r), FUNC(i8251_device::data_w)); + map(0xb9, 0xb9).rw(m_i8251prn, FUNC(i8251_device::status_r), FUNC(i8251_device::control_w)); + map(0xbc, 0xbf).rw(m_t_iface, FUNC(pit8253_device::read), FUNC(pit8253_device::write)); +} void sm7238_state::machine_reset() { |