summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/model2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/model2.cpp')
-rw-r--r--src/mame/drivers/model2.cpp366
1 files changed, 190 insertions, 176 deletions
diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp
index 00076754fa1..07e132832aa 100644
--- a/src/mame/drivers/model2.cpp
+++ b/src/mame/drivers/model2.cpp
@@ -1378,69 +1378,71 @@ WRITE16_MEMBER(model2_state::fbvram_bankA_w) { COMBINE_DATA(&m_fbvramA[offset]);
WRITE16_MEMBER(model2_state::fbvram_bankB_w) { COMBINE_DATA(&m_fbvramB[offset]); }
/* common map for all Model 2 versions */
-ADDRESS_MAP_START(model2_state::model2_base_mem)
- AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_WRITENOP
+void model2_state::model2_base_mem(address_map &map)
+{
+ map(0x00000000, 0x001fffff).rom().nopw();
- AM_RANGE(0x00500000, 0x005fffff) AM_RAM AM_SHARE("workram")
+ map(0x00500000, 0x005fffff).ram().share("workram");
- AM_RANGE(0x00800000, 0x00803fff) AM_READWRITE(geo_r, geo_w)
+ map(0x00800000, 0x00803fff).rw(this, FUNC(model2_state::geo_r), FUNC(model2_state::geo_w));
//AM_RANGE(0x00800010, 0x00800013) AM_WRITENOP
//AM_RANGE(0x008000b0, 0x008000b3) AM_WRITENOP
//AM_RANGE(0x00804004, 0x0080400f) AM_WRITENOP // quiet psikyo games
//AM_RANGE(0x00880000, 0x00883fff) AM_WRITE(copro_w)
- AM_RANGE(0x00900000, 0x0091ffff) AM_MIRROR(0x60000) AM_RAM AM_SHARE("bufferram")
+ map(0x00900000, 0x0091ffff).mirror(0x60000).ram().share("bufferram");
- AM_RANGE(0x00980004, 0x00980007) AM_READ(fifoctl_r)
- AM_RANGE(0x0098000c, 0x0098000f) AM_READWRITE(videoctl_r,videoctl_w)
- AM_RANGE(0x00980030, 0x0098003f) AM_READ8(tgpid_r,0xffffffff)
+ map(0x00980004, 0x00980007).r(this, FUNC(model2_state::fifoctl_r));
+ map(0x0098000c, 0x0098000f).rw(this, FUNC(model2_state::videoctl_r), FUNC(model2_state::videoctl_w));
+ map(0x00980030, 0x0098003f).r(this, FUNC(model2_state::tgpid_r));
- AM_RANGE(0x00e00000, 0x00e00037) AM_RAM // CPU control (wait-states)
- AM_RANGE(0x00e80000, 0x00e80003) AM_READWRITE(irq_request_r, irq_ack_w)
- AM_RANGE(0x00e80004, 0x00e80007) AM_READWRITE(irq_enable_r, irq_enable_w)
+ map(0x00e00000, 0x00e00037).ram(); // CPU control (wait-states)
+ map(0x00e80000, 0x00e80003).rw(this, FUNC(model2_state::irq_request_r), FUNC(model2_state::irq_ack_w));
+ map(0x00e80004, 0x00e80007).rw(this, FUNC(model2_state::irq_enable_r), FUNC(model2_state::irq_enable_w));
- AM_RANGE(0x00f00000, 0x00f0000f) AM_READWRITE(timers_r, timers_w)
+ map(0x00f00000, 0x00f0000f).rw(this, FUNC(model2_state::timers_r), FUNC(model2_state::timers_w));
- AM_RANGE(0x01000000, 0x0100ffff) AM_DEVREADWRITE16("tile", segas24_tile_device, tile_r, tile_w,0xffffffff) AM_MIRROR(0x110000)
- AM_RANGE(0x01020000, 0x01020003) AM_WRITENOP AM_MIRROR(0x100000) // ABSEL, always 0
- AM_RANGE(0x01040000, 0x01040003) AM_DEVWRITE16("tile", segas24_tile_device, xhout_w, 0x0000ffff) AM_MIRROR(0x100000) // Horizontal synchronization register
- AM_RANGE(0x01060000, 0x01060003) AM_DEVWRITE16("tile", segas24_tile_device, xvout_w, 0x0000ffff) AM_MIRROR(0x100000) // Vertical synchronization register
- AM_RANGE(0x01070000, 0x01070003) AM_WRITENOP AM_MIRROR(0x100000) // Video synchronization switch
- AM_RANGE(0x01080000, 0x010fffff) AM_DEVREADWRITE16("tile", segas24_tile_device, char_r, char_w,0xffffffff) AM_MIRROR(0x100000)
+ map(0x01000000, 0x0100ffff).rw("tile", FUNC(segas24_tile_device::tile_r), FUNC(segas24_tile_device::tile_w)).mirror(0x110000);
+ map(0x01020000, 0x01020003).nopw().mirror(0x100000); // ABSEL, always 0
+ map(0x01040000, 0x01040001).w("tile", FUNC(segas24_tile_device::xhout_w)).mirror(0x100000); // Horizontal synchronization register
+ map(0x01060000, 0x01060001).w("tile", FUNC(segas24_tile_device::xvout_w)).mirror(0x100000); // Vertical synchronization register
+ map(0x01070000, 0x01070003).nopw().mirror(0x100000); // Video synchronization switch
+ map(0x01080000, 0x010fffff).rw("tile", FUNC(segas24_tile_device::char_r), FUNC(segas24_tile_device::char_w)).mirror(0x100000);
- AM_RANGE(0x01800000, 0x01803fff) AM_READWRITE16(palette_r, palette_w,0xffffffff)
- AM_RANGE(0x01810000, 0x0181bfff) AM_READWRITE16(colorxlat_r,colorxlat_w,0xffffffff)
- AM_RANGE(0x0181c000, 0x0181c003) AM_WRITE(model2_3d_zclip_w)
- AM_RANGE(0x01a10000, 0x01a13fff) AM_DEVREADWRITE8("m2comm", m2comm_device, share_r, share_w, 0xffffffff)
- AM_RANGE(0x01a14000, 0x01a14003) AM_DEVREADWRITE8("m2comm", m2comm_device, cn_r, cn_w, 0x000000ff)
- AM_RANGE(0x01a14000, 0x01a14003) AM_DEVREADWRITE8("m2comm", m2comm_device, fg_r, fg_w, 0x00ff0000)
- AM_RANGE(0x01d00000, 0x01d03fff) AM_RAM AM_SHARE("backup1") // Backup sram
- AM_RANGE(0x02000000, 0x03ffffff) AM_ROM AM_REGION("main_data", 0)
+ map(0x01800000, 0x01803fff).rw(this, FUNC(model2_state::palette_r), FUNC(model2_state::palette_w));
+ map(0x01810000, 0x0181bfff).rw(this, FUNC(model2_state::colorxlat_r), FUNC(model2_state::colorxlat_w));
+ map(0x0181c000, 0x0181c003).w(this, FUNC(model2_state::model2_3d_zclip_w));
+ map(0x01a10000, 0x01a13fff).rw(m_m2comm, FUNC(m2comm_device::share_r), FUNC(m2comm_device::share_w));
+ map(0x01a14000, 0x01a14000).rw(m_m2comm, FUNC(m2comm_device::cn_r), FUNC(m2comm_device::cn_w));
+ map(0x01a14002, 0x01a14002).rw(m_m2comm, FUNC(m2comm_device::fg_r), FUNC(m2comm_device::fg_w));
+ map(0x01d00000, 0x01d03fff).ram().share("backup1"); // Backup sram
+ map(0x02000000, 0x03ffffff).rom().region("main_data", 0);
// "extra" data
- AM_RANGE(0x06000000, 0x06ffffff) AM_ROM AM_REGION("main_data", 0x1000000)
+ map(0x06000000, 0x06ffffff).rom().region("main_data", 0x1000000);
- AM_RANGE(0x10000000, 0x101fffff) AM_READWRITE(render_mode_r,render_mode_w)
+ map(0x10000000, 0x101fffff).rw(this, FUNC(model2_state::render_mode_r), FUNC(model2_state::render_mode_w));
// AM_RANGE(0x10200000, 0x103fffff) renderer status register
- AM_RANGE(0x10400000, 0x105fffff) AM_READ(polygon_count_r)
+ map(0x10400000, 0x105fffff).r(this, FUNC(model2_state::polygon_count_r));
// AM_RANGE(0x10600000, 0x107fffff) polygon data ping
// AM_RANGE(0x10800000, 0x109fffff) polygon data pong
// AM_RANGE(0x10a00000, 0x10bfffff) fill memory ping
// AM_RANGE(0x10c00000, 0x10dfffff) fill memory pong
// format is xGGGGGRRRRRBBBBB (512x400)
- AM_RANGE(0x11600000, 0x1167ffff) AM_READWRITE16(fbvram_bankA_r,fbvram_bankA_w,0xffffffff) // framebuffer A (last bronx title screen)
- AM_RANGE(0x11680000, 0x116fffff) AM_READWRITE16(fbvram_bankB_r,fbvram_bankB_w,0xffffffff) AM_SHARE("fbvram2") // framebuffer B
+ map(0x11600000, 0x1167ffff).rw(this, FUNC(model2_state::fbvram_bankA_r), FUNC(model2_state::fbvram_bankA_w)); // framebuffer A (last bronx title screen)
+ map(0x11680000, 0x116fffff).rw(this, FUNC(model2_state::fbvram_bankB_r), FUNC(model2_state::fbvram_bankB_w)).share("fbvram2"); // framebuffer B
- AM_RANGE(0x12800000, 0x1281ffff) AM_READWRITE16(lumaram_r,lumaram_w,0x0000ffff) // polygon "luma" RAM
-ADDRESS_MAP_END
+ map(0x12800000, 0x1281ffff).rw(this, FUNC(model2_state::lumaram_r), FUNC(model2_state::lumaram_w)).umask32(0x0000ffff); // polygon "luma" RAM
+}
/* common map for 5881 protection */
-ADDRESS_MAP_START(model2_state::model2_5881_mem)
- AM_RANGE(0x01d80000,0x01d8ffff) AM_RAM
- AM_RANGE(0x01d90000,0x01d9ffff) AM_DEVICE16("315_5881", sega_315_5881_crypt_device, iomap_le, 0xffffffff)
-ADDRESS_MAP_END
+void model2_state::model2_5881_mem(address_map &map)
+{
+ map(0x01d80000, 0x01d8ffff).ram();
+ map(0x01d90000, 0x01d9ffff).m(m_cryptdevice, FUNC(sega_315_5881_crypt_device::iomap_le));
+}
READ8_MEMBER(model2_state::virtuacop_lightgun_r)
{
@@ -1495,31 +1497,32 @@ READ8_MEMBER(model2o_state::model2o_in_r)
}
/* original Model 2 overrides */
-ADDRESS_MAP_START(model2o_state::model2o_mem)
- AM_IMPORT_FROM(model2_base_mem)
-
- AM_RANGE(0x00200000, 0x0021ffff) AM_RAM
- AM_RANGE(0x00220000, 0x0023ffff) AM_ROM AM_REGION("maincpu", 0x20000)
-
- AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE(geo_prg_r, geo_prg_w)
- AM_RANGE(0x00880000, 0x00883fff) AM_WRITE(copro_function_port_w)
- AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE(copro_fifo_r, copro_fifo_w)
-
- AM_RANGE(0x00980000, 0x00980003) AM_READWRITE(copro_ctl1_r,copro_ctl1_w)
- AM_RANGE(0x00980004, 0x00980007) AM_READ(fifoctrl_r)
- AM_RANGE(0x00980008, 0x0098000b) AM_WRITE(geo_ctl1_w)
- AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE(model2_serial_r, model2_serial_w)
-
- AM_RANGE(0x12000000, 0x121fffff) AM_RAM_WRITE(model2o_tex_w0) AM_MIRROR(0x200000) AM_SHARE("textureram0") // texture RAM 0
- AM_RANGE(0x12400000, 0x125fffff) AM_RAM_WRITE(model2o_tex_w1) AM_MIRROR(0x200000) AM_SHARE("textureram1") // texture RAM 1
-
- AM_RANGE(0x01c00000, 0x01c0001f) AM_READ8(model2o_in_r, 0x00ff00ff)
- AM_RANGE(0x01c00040, 0x01c00043) AM_READ(daytona_unk_r)
- AM_RANGE(0x01c00100, 0x01c0010f) AM_READ8(virtuacop_lightgun_r, 0x00ff00ff)
- AM_RANGE(0x01c00110, 0x01c00113) AM_READ8(virtuacop_lightgun_offscreen_r, 0x00ff00ff)
- AM_RANGE(0x01c00200, 0x01c002ff) AM_RAM AM_SHARE("backup2")
- AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE(model2_serial_r, model2_serial_w)
-ADDRESS_MAP_END
+void model2o_state::model2o_mem(address_map &map)
+{
+ model2_base_mem(map);
+
+ map(0x00200000, 0x0021ffff).ram();
+ map(0x00220000, 0x0023ffff).rom().region("maincpu", 0x20000);
+
+ map(0x00804000, 0x00807fff).rw(this, FUNC(model2o_state::geo_prg_r), FUNC(model2o_state::geo_prg_w));
+ map(0x00880000, 0x00883fff).w(this, FUNC(model2o_state::copro_function_port_w));
+ map(0x00884000, 0x00887fff).rw(this, FUNC(model2o_state::copro_fifo_r), FUNC(model2o_state::copro_fifo_w));
+
+ map(0x00980000, 0x00980003).rw(this, FUNC(model2o_state::copro_ctl1_r), FUNC(model2o_state::copro_ctl1_w));
+ map(0x00980004, 0x00980007).r(this, FUNC(model2o_state::fifoctrl_r));
+ map(0x00980008, 0x0098000b).w(this, FUNC(model2o_state::geo_ctl1_w));
+ map(0x009c0000, 0x009cffff).rw(this, FUNC(model2o_state::model2_serial_r), FUNC(model2o_state::model2_serial_w));
+
+ map(0x12000000, 0x121fffff).ram().w(this, FUNC(model2o_state::model2o_tex_w0)).mirror(0x200000).share("textureram0"); // texture RAM 0
+ map(0x12400000, 0x125fffff).ram().w(this, FUNC(model2o_state::model2o_tex_w1)).mirror(0x200000).share("textureram1"); // texture RAM 1
+
+ map(0x01c00000, 0x01c0001f).r(this, FUNC(model2o_state::model2o_in_r)).umask32(0x00ff00ff);
+ map(0x01c00040, 0x01c00043).r(this, FUNC(model2o_state::daytona_unk_r));
+ map(0x01c00100, 0x01c0010f).r(this, FUNC(model2o_state::virtuacop_lightgun_r)).umask32(0x00ff00ff);
+ map(0x01c00110, 0x01c00113).r(this, FUNC(model2o_state::virtuacop_lightgun_offscreen_r)).umask32(0x00ff00ff);
+ map(0x01c00200, 0x01c002ff).ram().share("backup2");
+ map(0x01c80000, 0x01c80003).rw(this, FUNC(model2o_state::model2_serial_r), FUNC(model2o_state::model2_serial_w));
+}
/* Daytona "To The MAXX" PIC protection simulation */
READ32_MEMBER(model2o_maxx_state::maxx_r)
@@ -1563,10 +1566,11 @@ READ32_MEMBER(model2o_maxx_state::maxx_r)
return ROM[offset + (0x040000/4)];
}
-ADDRESS_MAP_START(model2o_maxx_state::model2o_maxx_mem)
- AM_IMPORT_FROM(model2o_mem)
- AM_RANGE(0x00240000,0x0024ffff) AM_READ(maxx_r)
-ADDRESS_MAP_END
+void model2o_maxx_state::model2o_maxx_mem(address_map &map)
+{
+ model2o_mem(map);
+ map(0x00240000, 0x0024ffff).r(this, FUNC(model2o_maxx_state::maxx_r));
+}
READ8_MEMBER(model2o_gtx_state::gtx_r)
{
@@ -1597,112 +1601,118 @@ READ32_MEMBER(model2_state::copro_status_r)
}
/* 2A-CRX overrides */
-ADDRESS_MAP_START(model2a_state::model2a_crx_mem)
- AM_IMPORT_FROM(model2_base_mem)
-
- AM_RANGE(0x00200000, 0x0023ffff) AM_RAM
-
- AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE(geo_prg_r, geo_prg_w)
- AM_RANGE(0x00880000, 0x00883fff) AM_WRITE(copro_function_port_w)
- AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE(copro_fifo_r, copro_fifo_w)
-
- AM_RANGE(0x00980000, 0x00980003) AM_READWRITE(copro_ctl1_r,copro_ctl1_w)
- AM_RANGE(0x00980008, 0x0098000b) AM_WRITE(geo_ctl1_w)
- AM_RANGE(0x00980014, 0x00980017) AM_READ(copro_status_r)
- AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE(model2_serial_r, model2_serial_w)
-
- AM_RANGE(0x12000000, 0x121fffff) AM_RAM_WRITE(model2o_tex_w0) AM_MIRROR(0x200000) AM_SHARE("textureram0") // texture RAM 0
- AM_RANGE(0x12400000, 0x125fffff) AM_RAM_WRITE(model2o_tex_w1) AM_MIRROR(0x200000) AM_SHARE("textureram1") // texture RAM 1
-
- AM_RANGE(0x01c00000, 0x01c0001f) AM_READ8(model2_crx_in_r, 0x00ff00ff)
- AM_RANGE(0x01c00000, 0x01c00003) AM_WRITE(ctrl0_w)
- AM_RANGE(0x01c00008, 0x01c0000f) AM_WRITENOP
- AM_RANGE(0x01c00010, 0x01c00013) AM_WRITENOP
- AM_RANGE(0x01c00014, 0x01c00017) AM_WRITE(hotd_lightgun_w)
- AM_RANGE(0x01c0001c, 0x01c0001f) AM_WRITE(analog_2b_w)
- AM_RANGE(0x01c00040, 0x01c00043) AM_WRITENOP
- AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE(model2_serial_r, model2_serial_w)
-ADDRESS_MAP_END
+void model2a_state::model2a_crx_mem(address_map &map)
+{
+ model2_base_mem(map);
+
+ map(0x00200000, 0x0023ffff).ram();
+
+ map(0x00804000, 0x00807fff).rw(this, FUNC(model2a_state::geo_prg_r), FUNC(model2a_state::geo_prg_w));
+ map(0x00880000, 0x00883fff).w(this, FUNC(model2a_state::copro_function_port_w));
+ map(0x00884000, 0x00887fff).rw(this, FUNC(model2a_state::copro_fifo_r), FUNC(model2a_state::copro_fifo_w));
+
+ map(0x00980000, 0x00980003).rw(this, FUNC(model2a_state::copro_ctl1_r), FUNC(model2a_state::copro_ctl1_w));
+ map(0x00980008, 0x0098000b).w(this, FUNC(model2a_state::geo_ctl1_w));
+ map(0x00980014, 0x00980017).r(this, FUNC(model2a_state::copro_status_r));
+ map(0x009c0000, 0x009cffff).rw(this, FUNC(model2a_state::model2_serial_r), FUNC(model2a_state::model2_serial_w));
+
+ map(0x12000000, 0x121fffff).ram().w(this, FUNC(model2a_state::model2o_tex_w0)).mirror(0x200000).share("textureram0"); // texture RAM 0
+ map(0x12400000, 0x125fffff).ram().w(this, FUNC(model2a_state::model2o_tex_w1)).mirror(0x200000).share("textureram1"); // texture RAM 1
+
+ map(0x01c00000, 0x01c0001f).r(this, FUNC(model2a_state::model2_crx_in_r)).umask32(0x00ff00ff);
+ map(0x01c00000, 0x01c00003).w(this, FUNC(model2a_state::ctrl0_w));
+ map(0x01c00008, 0x01c0000f).nopw();
+ map(0x01c00010, 0x01c00013).nopw();
+ map(0x01c00014, 0x01c00017).w(this, FUNC(model2a_state::hotd_lightgun_w));
+ map(0x01c0001c, 0x01c0001f).w(this, FUNC(model2a_state::analog_2b_w));
+ map(0x01c00040, 0x01c00043).nopw();
+ map(0x01c80000, 0x01c80003).rw(this, FUNC(model2a_state::model2_serial_r), FUNC(model2a_state::model2_serial_w));
+}
-ADDRESS_MAP_START(model2a_state::model2a_5881_mem)
- AM_IMPORT_FROM(model2a_crx_mem)
- AM_IMPORT_FROM(model2_5881_mem)
-ADDRESS_MAP_END
+void model2a_state::model2a_5881_mem(address_map &map)
+{
+ model2a_crx_mem(map);
+ model2_5881_mem(map);
+}
/* 2B-CRX overrides */
-ADDRESS_MAP_START(model2b_state::model2b_crx_mem)
- AM_IMPORT_FROM(model2_base_mem)
+void model2b_state::model2b_crx_mem(address_map &map)
+{
+ model2_base_mem(map);
- AM_RANGE(0x00200000, 0x0023ffff) AM_RAM
+ map(0x00200000, 0x0023ffff).ram();
- AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE(geo_prg_r, geo_prg_w)
+ map(0x00804000, 0x00807fff).rw(this, FUNC(model2b_state::geo_prg_r), FUNC(model2b_state::geo_prg_w));
//AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE(geo_sharc_fifo_r, geo_sharc_fifo_w)
//AM_RANGE(0x00840000, 0x00840fff) AM_WRITE(geo_sharc_iop_w)
- AM_RANGE(0x00880000, 0x00883fff) AM_WRITE(copro_function_port_w)
- AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE(copro_fifo_r, copro_fifo_w)
- AM_RANGE(0x008c0000, 0x008c0fff) AM_WRITE(copro_sharc_iop_w)
+ map(0x00880000, 0x00883fff).w(this, FUNC(model2b_state::copro_function_port_w));
+ map(0x00884000, 0x00887fff).rw(this, FUNC(model2b_state::copro_fifo_r), FUNC(model2b_state::copro_fifo_w));
+ map(0x008c0000, 0x008c0fff).w(this, FUNC(model2b_state::copro_sharc_iop_w));
- AM_RANGE(0x00980000, 0x00980003) AM_READWRITE(copro_ctl1_r,copro_ctl1_w)
- AM_RANGE(0x00980008, 0x0098000b) AM_WRITE(geo_ctl1_w)
- AM_RANGE(0x00980014, 0x00980017) AM_READ(copro_status_r)
+ map(0x00980000, 0x00980003).rw(this, FUNC(model2b_state::copro_ctl1_r), FUNC(model2b_state::copro_ctl1_w));
+ map(0x00980008, 0x0098000b).w(this, FUNC(model2b_state::geo_ctl1_w));
+ map(0x00980014, 0x00980017).r(this, FUNC(model2b_state::copro_status_r));
//AM_RANGE(0x00980008, 0x0098000b) AM_WRITE(geo_sharc_ctl1_w )
- AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE(model2_serial_r, model2_serial_w)
-
- AM_RANGE(0x11000000, 0x110fffff) AM_RAM AM_SHARE("textureram0") // texture RAM 0 (2b/2c)
- AM_RANGE(0x11100000, 0x111fffff) AM_RAM AM_SHARE("textureram0") // texture RAM 0 (2b/2c)
- AM_RANGE(0x11200000, 0x112fffff) AM_RAM AM_SHARE("textureram1") // texture RAM 1 (2b/2c)
- AM_RANGE(0x11300000, 0x113fffff) AM_RAM AM_SHARE("textureram1") // texture RAM 1 (2b/2c)
- AM_RANGE(0x11400000, 0x1140ffff) AM_READWRITE16(lumaram_r,lumaram_w,0xffffffff) // polygon "luma" RAM (2b/2c)
- AM_RANGE(0x12800000, 0x1281ffff) AM_READWRITE16(lumaram_r,lumaram_w,0x0000ffff) // polygon "luma" RAM
-
- AM_RANGE(0x01c00000, 0x01c0001f) AM_READ8(model2_crx_in_r, 0x00ff00ff)
- AM_RANGE(0x01c00000, 0x01c00003) AM_WRITE(ctrl0_w)
- AM_RANGE(0x01c00008, 0x01c0000b) AM_WRITENOP
- AM_RANGE(0x01c00010, 0x01c00013) AM_WRITENOP // gunblade
- AM_RANGE(0x01c00014, 0x01c00017) AM_WRITE(hotd_lightgun_w)
- AM_RANGE(0x01c0001c, 0x01c0001f) AM_WRITE(analog_2b_w)
- AM_RANGE(0x01c00040, 0x01c00043) AM_WRITENOP
- AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE(model2_serial_r, model2_serial_w)
-ADDRESS_MAP_END
+ map(0x009c0000, 0x009cffff).rw(this, FUNC(model2b_state::model2_serial_r), FUNC(model2b_state::model2_serial_w));
+
+ map(0x11000000, 0x110fffff).ram().share("textureram0"); // texture RAM 0 (2b/2c)
+ map(0x11100000, 0x111fffff).ram().share("textureram0"); // texture RAM 0 (2b/2c)
+ map(0x11200000, 0x112fffff).ram().share("textureram1"); // texture RAM 1 (2b/2c)
+ map(0x11300000, 0x113fffff).ram().share("textureram1"); // texture RAM 1 (2b/2c)
+ map(0x11400000, 0x1140ffff).rw(this, FUNC(model2b_state::lumaram_r), FUNC(model2b_state::lumaram_w)); // polygon "luma" RAM (2b/2c)
+ map(0x12800000, 0x1281ffff).rw(this, FUNC(model2b_state::lumaram_r), FUNC(model2b_state::lumaram_w)).umask32(0x0000ffff); // polygon "luma" RAM
+
+ map(0x01c00000, 0x01c0001f).r(this, FUNC(model2b_state::model2_crx_in_r)).umask32(0x00ff00ff);
+ map(0x01c00000, 0x01c00003).w(this, FUNC(model2b_state::ctrl0_w));
+ map(0x01c00008, 0x01c0000b).nopw();
+ map(0x01c00010, 0x01c00013).nopw(); // gunblade
+ map(0x01c00014, 0x01c00017).w(this, FUNC(model2b_state::hotd_lightgun_w));
+ map(0x01c0001c, 0x01c0001f).w(this, FUNC(model2b_state::analog_2b_w));
+ map(0x01c00040, 0x01c00043).nopw();
+ map(0x01c80000, 0x01c80003).rw(this, FUNC(model2b_state::model2_serial_r), FUNC(model2b_state::model2_serial_w));
+}
-ADDRESS_MAP_START(model2b_state::model2b_5881_mem)
- AM_IMPORT_FROM(model2b_crx_mem)
- AM_IMPORT_FROM(model2_5881_mem)
-ADDRESS_MAP_END
+void model2b_state::model2b_5881_mem(address_map &map)
+{
+ model2b_crx_mem(map);
+ model2_5881_mem(map);
+}
/* 2C-CRX overrides */
-ADDRESS_MAP_START(model2c_state::model2c_crx_mem)
- AM_IMPORT_FROM(model2_base_mem)
-
- AM_RANGE(0x00200000, 0x0023ffff) AM_RAM
-
- AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE(geo_prg_r, geo_prg_w)
- AM_RANGE(0x00880000, 0x00883fff) AM_WRITE(copro_function_port_w)
- AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE(copro_fifo_r, copro_fifo_w)
-
- AM_RANGE(0x00980000, 0x00980003) AM_READWRITE(copro_ctl1_r,copro_ctl1_w)
- AM_RANGE(0x00980008, 0x0098000b) AM_WRITE(geo_ctl1_w )
- AM_RANGE(0x00980014, 0x00980017) AM_READ(copro_status_r)
- AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE(model2_serial_r, model2_serial_w)
-
- AM_RANGE(0x11000000, 0x111fffff) AM_RAM AM_SHARE("textureram0") // texture RAM 0 (2b/2c)
- AM_RANGE(0x11200000, 0x113fffff) AM_RAM AM_SHARE("textureram1") // texture RAM 1 (2b/2c)
- AM_RANGE(0x11400000, 0x1140ffff) AM_READWRITE16(lumaram_r,lumaram_w,0xffffffff) // polygon "luma" RAM (2b/2c)
- AM_RANGE(0x12800000, 0x1281ffff) AM_READWRITE16(lumaram_r,lumaram_w,0x0000ffff) // polygon "luma" RAM
-
- AM_RANGE(0x01c00000, 0x01c0001f) AM_READ8(model2_crx_in_r, 0x00ff00ff)
- AM_RANGE(0x01c00000, 0x01c00003) AM_WRITE(ctrl0_w)
- AM_RANGE(0x01c00014, 0x01c00017) AM_WRITE(hotd_lightgun_w)
- AM_RANGE(0x01c0001c, 0x01c0001f) AM_WRITE(analog_2b_w)
- AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE(model2_serial_r, model2_serial_w )
-ADDRESS_MAP_END
+void model2c_state::model2c_crx_mem(address_map &map)
+{
+ model2_base_mem(map);
-ADDRESS_MAP_START(model2c_state::model2c_5881_mem)
- AM_IMPORT_FROM(model2c_crx_mem)
- AM_IMPORT_FROM(model2_5881_mem)
-ADDRESS_MAP_END
+ map(0x00200000, 0x0023ffff).ram();
+
+ map(0x00804000, 0x00807fff).rw(this, FUNC(model2c_state::geo_prg_r), FUNC(model2c_state::geo_prg_w));
+ map(0x00880000, 0x00883fff).w(this, FUNC(model2c_state::copro_function_port_w));
+ map(0x00884000, 0x00887fff).rw(this, FUNC(model2c_state::copro_fifo_r), FUNC(model2c_state::copro_fifo_w));
+
+ map(0x00980000, 0x00980003).rw(this, FUNC(model2c_state::copro_ctl1_r), FUNC(model2c_state::copro_ctl1_w));
+ map(0x00980008, 0x0098000b).w(this, FUNC(model2c_state::geo_ctl1_w));
+ map(0x00980014, 0x00980017).r(this, FUNC(model2c_state::copro_status_r));
+ map(0x009c0000, 0x009cffff).rw(this, FUNC(model2c_state::model2_serial_r), FUNC(model2c_state::model2_serial_w));
+
+ map(0x11000000, 0x111fffff).ram().share("textureram0"); // texture RAM 0 (2b/2c)
+ map(0x11200000, 0x113fffff).ram().share("textureram1"); // texture RAM 1 (2b/2c)
+ map(0x11400000, 0x1140ffff).rw(this, FUNC(model2c_state::lumaram_r), FUNC(model2c_state::lumaram_w)); // polygon "luma" RAM (2b/2c)
+ map(0x12800000, 0x1281ffff).rw(this, FUNC(model2c_state::lumaram_r), FUNC(model2c_state::lumaram_w)).umask32(0x0000ffff); // polygon "luma" RAM
+
+ map(0x01c00000, 0x01c0001f).r(this, FUNC(model2c_state::model2_crx_in_r)).umask32(0x00ff00ff);
+ map(0x01c00000, 0x01c00003).w(this, FUNC(model2c_state::ctrl0_w));
+ map(0x01c00014, 0x01c00017).w(this, FUNC(model2c_state::hotd_lightgun_w));
+ map(0x01c0001c, 0x01c0001f).w(this, FUNC(model2c_state::analog_2b_w));
+ map(0x01c80000, 0x01c80003).rw(this, FUNC(model2c_state::model2_serial_r), FUNC(model2c_state::model2_serial_w));
+}
+
+void model2c_state::model2c_5881_mem(address_map &map)
+{
+ model2c_crx_mem(map);
+ model2_5881_mem(map);
+}
@@ -2542,18 +2552,20 @@ WRITE8_MEMBER(model2_state::driveio_port_w)
// popmessage("%02x",data);
}
-ADDRESS_MAP_START(model2_state::drive_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0xe000, 0xffff) AM_RAM
-ADDRESS_MAP_END
+void model2_state::drive_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0xe000, 0xffff).ram();
+}
-ADDRESS_MAP_START(model2_state::drive_io_map)
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITENOP //watchdog
- AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE("driveio1", sega_315_5296_device, read, write)
- AM_RANGE(0x40, 0x4f) AM_DEVREADWRITE("driveio2", sega_315_5296_device, read, write)
- AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("driveadc", msm6253_device, d0_r, address_w)
-ADDRESS_MAP_END
+void model2_state::drive_io_map(address_map &map)
+{
+ map.global_mask(0xff);
+ map(0x00, 0x00).nopw(); //watchdog
+ map(0x20, 0x2f).rw("driveio1", FUNC(sega_315_5296_device::read), FUNC(sega_315_5296_device::write));
+ map(0x40, 0x4f).rw("driveio2", FUNC(sega_315_5296_device::read), FUNC(sega_315_5296_device::write));
+ map(0x80, 0x83).rw("driveadc", FUNC(msm6253_device::d0_r), FUNC(msm6253_device::address_w));
+}
MACHINE_CONFIG_START(model2_state::sj25_0207_01)
MCFG_CPU_ADD("drivecpu", Z80, XTAL(8'000'000)/2) // confirmed
@@ -2711,15 +2723,17 @@ MACHINE_CONFIG_START(model2b_state::indy500)
MACHINE_CONFIG_END
-ADDRESS_MAP_START(model2b_state::rchase2_iocpu_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0x9fff) AM_RAM
-ADDRESS_MAP_END
+void model2b_state::rchase2_iocpu_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0x8000, 0x9fff).ram();
+}
-ADDRESS_MAP_START(model2b_state::rchase2_ioport_map)
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x07) AM_DEVREADWRITE("ioexp", cxd1095_device, read, write)
-ADDRESS_MAP_END
+void model2b_state::rchase2_ioport_map(address_map &map)
+{
+ map.global_mask(0xff);
+ map(0x00, 0x07).rw("ioexp", FUNC(cxd1095_device::read), FUNC(cxd1095_device::write));
+}
MACHINE_CONFIG_START(model2b_state::rchase2)
model2b(config);