summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/coolridr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/coolridr.cpp')
-rw-r--r--src/mame/drivers/coolridr.cpp148
1 files changed, 77 insertions, 71 deletions
diff --git a/src/mame/drivers/coolridr.cpp b/src/mame/drivers/coolridr.cpp
index 04f6fb2b5a3..00bcf159fc8 100644
--- a/src/mame/drivers/coolridr.cpp
+++ b/src/mame/drivers/coolridr.cpp
@@ -2824,33 +2824,35 @@ WRITE32_MEMBER(coolridr_state::sysh1_dma_w)
}
-ADDRESS_MAP_START(coolridr_state::system_h1_map)
- AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_SHARE("share1") AM_WRITENOP
- AM_RANGE(0x01000000, 0x01ffffff) AM_ROM AM_REGION("gfx_data",0x0000000)
-
- AM_RANGE(0x03c00000, 0x03c1ffff) AM_MIRROR(0x00200000) AM_RAM_WRITE(sysh1_dma_w) AM_SHARE("fb_vram") /* mostly mapped at 0x03e00000 */
-
- AM_RANGE(0x03f00000, 0x03f0ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/
- AM_RANGE(0x03f40000, 0x03f4ffff) AM_RAM AM_SHARE("txt_vram")//text tilemap + "lineram"
- AM_RANGE(0x04000000, 0x0400000f) AM_READWRITE(sysh1_unk_blit_r,sysh1_unk_blit_w) AM_SHARE("sysh1_txt_blit")
- AM_RANGE(0x04000010, 0x04000013) AM_WRITE(sysh1_blit_mode_w)
- AM_RANGE(0x04000014, 0x04000017) AM_WRITE(sysh1_blit_data_w)
- AM_RANGE(0x04000018, 0x0400001b) AM_WRITE(sysh1_fb_mode_w)
- AM_RANGE(0x0400001c, 0x0400001f) AM_WRITE(sysh1_fb_data_w)
-
- AM_RANGE(0x06000000, 0x060fffff) AM_RAM AM_SHARE("sysh1_workrah")
- AM_RANGE(0x20000000, 0x201fffff) AM_ROM AM_SHARE("share1")
-
- AM_RANGE(0x60000000, 0x600003ff) AM_WRITENOP
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(coolridr_state::aquastge_h1_map)
- AM_IMPORT_FROM(system_h1_map)
- AM_RANGE(0x03c00000, 0x03c0ffff) AM_MIRROR(0x00200000) AM_RAM_WRITE(sysh1_dma_w) AM_SHARE("fb_vram") /* mostly mapped at 0x03e00000 */
- AM_RANGE(0x03f50000, 0x03f5ffff) AM_RAM // video registers
- AM_RANGE(0x03e10000, 0x03e1ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/
- AM_RANGE(0x03f00000, 0x03f0ffff) AM_RAM /*Communication area RAM*/
-ADDRESS_MAP_END
+void coolridr_state::system_h1_map(address_map &map)
+{
+ map(0x00000000, 0x001fffff).rom().share("share1").nopw();
+ map(0x01000000, 0x01ffffff).rom().region("gfx_data", 0x0000000);
+
+ map(0x03c00000, 0x03c1ffff).mirror(0x00200000).ram().w(this, FUNC(coolridr_state::sysh1_dma_w)).share("fb_vram"); /* mostly mapped at 0x03e00000 */
+
+ map(0x03f00000, 0x03f0ffff).ram().share("share3"); /*Communication area RAM*/
+ map(0x03f40000, 0x03f4ffff).ram().share("txt_vram");//text tilemap + "lineram"
+ map(0x04000000, 0x0400000f).rw(this, FUNC(coolridr_state::sysh1_unk_blit_r), FUNC(coolridr_state::sysh1_unk_blit_w)).share("sysh1_txt_blit");
+ map(0x04000010, 0x04000013).w(this, FUNC(coolridr_state::sysh1_blit_mode_w));
+ map(0x04000014, 0x04000017).w(this, FUNC(coolridr_state::sysh1_blit_data_w));
+ map(0x04000018, 0x0400001b).w(this, FUNC(coolridr_state::sysh1_fb_mode_w));
+ map(0x0400001c, 0x0400001f).w(this, FUNC(coolridr_state::sysh1_fb_data_w));
+
+ map(0x06000000, 0x060fffff).ram().share("sysh1_workrah");
+ map(0x20000000, 0x201fffff).rom().share("share1");
+
+ map(0x60000000, 0x600003ff).nopw();
+}
+
+void coolridr_state::aquastge_h1_map(address_map &map)
+{
+ system_h1_map(map);
+ map(0x03c00000, 0x03c0ffff).mirror(0x00200000).ram().w(this, FUNC(coolridr_state::sysh1_dma_w)).share("fb_vram"); /* mostly mapped at 0x03e00000 */
+ map(0x03f50000, 0x03f5ffff).ram(); // video registers
+ map(0x03e10000, 0x03e1ffff).ram().share("share3"); /*Communication area RAM*/
+ map(0x03f00000, 0x03f0ffff).ram(); /*Communication area RAM*/
+}
READ16_MEMBER( coolridr_state::h1_soundram_r)
{
@@ -2988,42 +2990,45 @@ WRITE32_MEMBER(coolridr_state::sysh1_sound_dma_w)
-ADDRESS_MAP_START(coolridr_state::coolridr_submap)
- AM_RANGE(0x00000000, 0x0001ffff) AM_ROM // note: SH7032 only supports 64KB
-
- AM_RANGE(0x01000000, 0x0100ffff) AM_RAM //communication RAM
-
- AM_RANGE(0x03000000, 0x0307ffff) AM_READWRITE16(h1_soundram_r, h1_soundram_w,0xffffffff) //AM_SHARE("soundram")
- AM_RANGE(0x03100000, 0x03100fff) AM_DEVREADWRITE16("scsp1", scsp_device, read, write, 0xffffffff)
- AM_RANGE(0x03200000, 0x0327ffff) AM_READWRITE16(h1_soundram2_r, h1_soundram2_w,0xffffffff) //AM_SHARE("soundram2")
- AM_RANGE(0x03300000, 0x03300fff) AM_DEVREADWRITE16("scsp2", scsp_device, read, write, 0xffffffff)
-
- AM_RANGE(0x04000000, 0x0400003f) AM_READWRITE(sysh1_sound_dma_r,sysh1_sound_dma_w) AM_SHARE("sound_dma")
-// AM_RANGE(0x04200000, 0x0420003f) AM_RAM /* unknown */
-
- AM_RANGE(0x05000000, 0x05000fff) AM_RAM
- AM_RANGE(0x05200000, 0x052001ff) AM_RAM
- AM_RANGE(0x05300000, 0x0530ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/
-// AM_RANGE(0x05fffe00, 0x05ffffff) AM_READWRITE16(sh7032_r,sh7032_w,0xffffffff) // SH-7032H internal i/o
- AM_RANGE(0x06000000, 0x060001ff) AM_RAM AM_SHARE("nvram") // backup RAM
- AM_RANGE(0x06100000, 0x06100003) AM_READ_PORT("IN0") AM_WRITE8(lamps_w,0x000000ff)
- AM_RANGE(0x06100004, 0x06100007) AM_READ_PORT("IN1")
- AM_RANGE(0x06100008, 0x0610000b) AM_READ_PORT("IN5")
- AM_RANGE(0x0610000c, 0x0610000f) AM_READ_PORT("IN6")
- AM_RANGE(0x06100010, 0x06100013) AM_READ_PORT("IN2") AM_WRITENOP
- AM_RANGE(0x06100014, 0x06100017) AM_READ_PORT("IN3")
- AM_RANGE(0x0610001c, 0x0610001f) AM_READWRITE8(analog_mux_r,analog_mux_w,0x000000ff) //AM_WRITENOP
- AM_RANGE(0x06200000, 0x06200fff) AM_RAM //network related?
- AM_RANGE(0x07ffe000, 0x07ffffff) AM_RAM // On-Chip RAM (actually mapped at 0x0fffe000-0x0fffffff)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(coolridr_state::aquastge_submap)
- AM_IMPORT_FROM(coolridr_submap)
- AM_RANGE(0x05200000, 0x0537ffff) AM_RAM
- AM_RANGE(0x05210000, 0x0521ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/
- AM_RANGE(0x06000200, 0x06000207) AM_WRITENOP // program bug?
- AM_RANGE(0x06100018, 0x0610001b) AM_READ_PORT("IN7")
-ADDRESS_MAP_END
+void coolridr_state::coolridr_submap(address_map &map)
+{
+ map(0x00000000, 0x0001ffff).rom(); // note: SH7032 only supports 64KB
+
+ map(0x01000000, 0x0100ffff).ram(); //communication RAM
+
+ map(0x03000000, 0x0307ffff).rw(this, FUNC(coolridr_state::h1_soundram_r), FUNC(coolridr_state::h1_soundram_w)); //.share("soundram");
+ map(0x03100000, 0x03100fff).rw("scsp1", FUNC(scsp_device::read), FUNC(scsp_device::write));
+ map(0x03200000, 0x0327ffff).rw(this, FUNC(coolridr_state::h1_soundram2_r), FUNC(coolridr_state::h1_soundram2_w)); //.share("soundram2");
+ map(0x03300000, 0x03300fff).rw("scsp2", FUNC(scsp_device::read), FUNC(scsp_device::write));
+
+ map(0x04000000, 0x0400003f).rw(this, FUNC(coolridr_state::sysh1_sound_dma_r), FUNC(coolridr_state::sysh1_sound_dma_w)).share("sound_dma");
+// map(0x04200000, 0x0420003f).ram(); /* unknown */
+
+ map(0x05000000, 0x05000fff).ram();
+ map(0x05200000, 0x052001ff).ram();
+ map(0x05300000, 0x0530ffff).ram().share("share3"); /*Communication area RAM*/
+// map(0x05fffe00, 0x05ffffff).rw(this, FUNC(coolridr_state::sh7032_r), FUNC(coolridr_state::sh7032_w)); // SH-7032H internal i/o
+ map(0x06000000, 0x060001ff).ram().share("nvram"); // backup RAM
+ map(0x06100000, 0x06100003).portr("IN0");
+ map(0x06100003, 0x06100003).w(this, FUNC(coolridr_state::lamps_w));
+ map(0x06100004, 0x06100007).portr("IN1");
+ map(0x06100008, 0x0610000b).portr("IN5");
+ map(0x0610000c, 0x0610000f).portr("IN6");
+ map(0x06100010, 0x06100013).portr("IN2").nopw();
+ map(0x06100014, 0x06100017).portr("IN3");
+ map(0x0610001f, 0x0610001f).rw(this, FUNC(coolridr_state::analog_mux_r), FUNC(coolridr_state::analog_mux_w)); // .nopw();
+ map(0x06200000, 0x06200fff).ram(); //network related?
+ map(0x07ffe000, 0x07ffffff).ram(); // On-Chip RAM (actually mapped at 0x0fffe000-0x0fffffff)
+}
+
+void coolridr_state::aquastge_submap(address_map &map)
+{
+ coolridr_submap(map);
+ map(0x05200000, 0x0537ffff).ram();
+ map(0x05210000, 0x0521ffff).ram().share("share3"); /*Communication area RAM*/
+ map(0x06000200, 0x06000207).nopw(); // program bug?
+ map(0x06100018, 0x0610001b).portr("IN7");
+}
/* TODO: what is this for, volume mixing? MIDI? */
WRITE8_MEMBER(coolridr_state::sound_to_sh1_w)
@@ -3031,14 +3036,15 @@ WRITE8_MEMBER(coolridr_state::sound_to_sh1_w)
sound_fifo = data;
}
-ADDRESS_MAP_START(coolridr_state::system_h1_sound_map)
- AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_REGION("scsp1",0) AM_SHARE("soundram")
- AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE("scsp1", scsp_device, read, write)
- AM_RANGE(0x200000, 0x27ffff) AM_RAM AM_REGION("scsp2",0) AM_SHARE("soundram2")
- AM_RANGE(0x300000, 0x300fff) AM_DEVREADWRITE("scsp2", scsp_device, read, write)
- AM_RANGE(0x800000, 0x80ffff) AM_MIRROR(0x200000) AM_RAM
- AM_RANGE(0x900000, 0x900001) AM_WRITE8(sound_to_sh1_w,0x00ff)
-ADDRESS_MAP_END
+void coolridr_state::system_h1_sound_map(address_map &map)
+{
+ map(0x000000, 0x07ffff).ram().region("scsp1", 0).share("soundram");
+ map(0x100000, 0x100fff).rw("scsp1", FUNC(scsp_device::read), FUNC(scsp_device::write));
+ map(0x200000, 0x27ffff).ram().region("scsp2", 0).share("soundram2");
+ map(0x300000, 0x300fff).rw("scsp2", FUNC(scsp_device::read), FUNC(scsp_device::write));
+ map(0x800000, 0x80ffff).mirror(0x200000).ram();
+ map(0x900001, 0x900001).w(this, FUNC(coolridr_state::sound_to_sh1_w));
+}