summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/nascom1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/nascom1.cpp')
-rw-r--r--src/mame/drivers/nascom1.cpp73
1 files changed, 39 insertions, 34 deletions
diff --git a/src/mame/drivers/nascom1.cpp b/src/mame/drivers/nascom1.cpp
index 805176f4bfb..a183c9714dc 100644
--- a/src/mame/drivers/nascom1.cpp
+++ b/src/mame/drivers/nascom1.cpp
@@ -473,40 +473,45 @@ void nascom_state::screen_update(bitmap_ind16 &bitmap, const rectangle &cliprect
// ADDRESS MAPS
//**************************************************************************
-ADDRESS_MAP_START(nascom1_state::nascom1_mem)
- AM_RANGE(0x0000, 0x07ff) AM_ROM // MONITOR
- AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("videoram")
- AM_RANGE(0x0c00, 0x0fff) AM_RAM // WRAM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(nascom1_state::nascom1_io)
- ADDRESS_MAP_GLOBAL_MASK(0x0f)
- AM_RANGE(0x00, 0x00) AM_READWRITE(nascom1_port_00_r, nascom1_port_00_w)
- AM_RANGE(0x01, 0x01) AM_READWRITE(nascom1_port_01_r, nascom1_port_01_w)
- AM_RANGE(0x02, 0x02) AM_READ(nascom1_port_02_r)
- AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("z80pio", z80pio_device, read, write )
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(nascom2_state::nascom2_mem)
- AM_RANGE(0x0000, 0x07ff) AM_ROM // MONITOR
- AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("videoram")
- AM_RANGE(0x0c00, 0x0fff) AM_RAM // WRAM
- AM_RANGE(0xe000, 0xffff) AM_ROM AM_REGION("basic", 0)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(nascom2_state::nascom2_io)
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READWRITE(nascom1_port_00_r, nascom1_port_00_w)
- AM_RANGE(0x01, 0x01) AM_READWRITE(nascom1_port_01_r, nascom1_port_01_w)
- AM_RANGE(0x02, 0x02) AM_READ(nascom1_port_02_r)
- AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("z80pio", z80pio_device, read, write )
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(nascom2_state::nascom2c_mem)
- AM_RANGE(0xf000, 0xf7ff) AM_ROM AM_REGION("maincpu", 0)
- AM_RANGE(0xf800, 0xfbff) AM_RAM AM_SHARE("videoram")
- AM_RANGE(0xfc00, 0xffff) AM_RAM // WRAM
-ADDRESS_MAP_END
+void nascom1_state::nascom1_mem(address_map &map)
+{
+ map(0x0000, 0x07ff).rom(); // MONITOR
+ map(0x0800, 0x0bff).ram().share("videoram");
+ map(0x0c00, 0x0fff).ram(); // WRAM
+}
+
+void nascom1_state::nascom1_io(address_map &map)
+{
+ map.global_mask(0x0f);
+ map(0x00, 0x00).rw(this, FUNC(nascom1_state::nascom1_port_00_r), FUNC(nascom1_state::nascom1_port_00_w));
+ map(0x01, 0x01).rw(this, FUNC(nascom1_state::nascom1_port_01_r), FUNC(nascom1_state::nascom1_port_01_w));
+ map(0x02, 0x02).r(this, FUNC(nascom1_state::nascom1_port_02_r));
+ map(0x04, 0x07).rw("z80pio", FUNC(z80pio_device::read), FUNC(z80pio_device::write));
+}
+
+void nascom2_state::nascom2_mem(address_map &map)
+{
+ map(0x0000, 0x07ff).rom(); // MONITOR
+ map(0x0800, 0x0bff).ram().share("videoram");
+ map(0x0c00, 0x0fff).ram(); // WRAM
+ map(0xe000, 0xffff).rom().region("basic", 0);
+}
+
+void nascom2_state::nascom2_io(address_map &map)
+{
+ map.global_mask(0xff);
+ map(0x00, 0x00).rw(this, FUNC(nascom2_state::nascom1_port_00_r), FUNC(nascom2_state::nascom1_port_00_w));
+ map(0x01, 0x01).rw(this, FUNC(nascom2_state::nascom1_port_01_r), FUNC(nascom2_state::nascom1_port_01_w));
+ map(0x02, 0x02).r(this, FUNC(nascom2_state::nascom1_port_02_r));
+ map(0x04, 0x07).rw("z80pio", FUNC(z80pio_device::read), FUNC(z80pio_device::write));
+}
+
+void nascom2_state::nascom2c_mem(address_map &map)
+{
+ map(0xf000, 0xf7ff).rom().region("maincpu", 0);
+ map(0xf800, 0xfbff).ram().share("videoram");
+ map(0xfc00, 0xffff).ram(); // WRAM
+}
//**************************************************************************