summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2019-11-05 14:21:42 -0500
committer AJR <ajrhacker@users.noreply.github.com>2019-11-05 14:21:42 -0500
commit6b6af5c63b821675ce957cc5bf8580a7c76dd291 (patch)
tree5b2e17a11fb4050564af724017013b826adc73dd
parent9744e1238650e1e69ff3f841fd0817dda8679854 (diff)
stv.cpp: Move per-game I/O into memory maps; simplify code (nw)
-rw-r--r--src/mame/drivers/stv.cpp260
-rw-r--r--src/mame/includes/stv.h18
2 files changed, 88 insertions, 190 deletions
diff --git a/src/mame/drivers/stv.cpp b/src/mame/drivers/stv.cpp
index 584cfafa190..55d0ee354e4 100644
--- a/src/mame/drivers/stv.cpp
+++ b/src/mame/drivers/stv.cpp
@@ -101,12 +101,12 @@ READ8_MEMBER(stv_state::stv_ioga_r)
uint8_t res;
res = 0xff;
- if(offset & 0x20 && !machine().side_effects_disabled())
- printf("Reading from mirror %08x?\n",offset);
+ if(offset & 0x10 && !machine().side_effects_disabled())
+ printf("Reading from mirror %08x?\n",offset * 2 + 1);
- offset &= 0x1f; // mirror?
+ offset &= 0x0f; // mirror?
- switch(offset)
+ switch(offset * 2 + 1)
{
case 0x01: res = ioport("PORTA")->read(); break; // P1
case 0x03: res = ioport("PORTB")->read(); break; // P2
@@ -132,12 +132,12 @@ READ8_MEMBER(stv_state::stv_ioga_r)
WRITE8_MEMBER(stv_state::stv_ioga_w)
{
- if(offset & 0x20 && !machine().side_effects_disabled())
- printf("Writing to mirror %08x %02x?\n",offset,data);
+ if(offset & 0x10 && !machine().side_effects_disabled())
+ printf("Writing to mirror %08x %02x?\n",offset * 2 + 1,data);
- offset &= 0x1f; // mirror?
+ offset &= 0x0f; // mirror?
- switch(offset)
+ switch(offset * 2 + 1)
{
case 0x07:
// if (data != m_system_output)
@@ -169,11 +169,11 @@ READ8_MEMBER(stv_state::critcrsh_ioga_r)
res = 0xff;
- switch(offset)
+ switch(offset * 2 + 1)
{
case 0x01:
case 0x03:
- res = ioport(lgnames[offset >> 1])->read();
+ res = ioport(lgnames[offset])->read();
res = bitswap<8>(res, 2, 3, 0, 1, 6, 7, 5, 4) & 0xf3;
res |= (ioport("PORTC")->read() & 0x10) ? 0x0 : 0x4; // x/y hit latch actually
break;
@@ -189,12 +189,9 @@ READ8_MEMBER(stv_state::magzun_ioga_r)
res = 0xff;
- //if(offset > 0x0b)
- // printf("%08x\n",offset);
-
// 0x4a 0x40 0x47
- switch(offset)
+ switch(offset * 2 + 1)
{
case 0x17:
res = 0;
@@ -210,7 +207,7 @@ READ8_MEMBER(stv_state::magzun_ioga_r)
WRITE8_MEMBER(stv_state::magzun_ioga_w)
{
- switch(offset)
+ switch(offset * 2 + 1)
{
case 0x13: m_serial_tx = (data << 8) | (m_serial_tx & 0xff); break;
case 0x15: m_serial_tx = (data & 0xff) | (m_serial_tx & 0xff00); break;
@@ -227,7 +224,7 @@ READ8_MEMBER(stv_state::stvmp_ioga_r)
res = 0xff;
- switch(offset)
+ switch(offset * 2 + 1)
{
case 0x01:
case 0x03:
@@ -240,7 +237,7 @@ READ8_MEMBER(stv_state::stvmp_ioga_r)
for(i=0;i<5;i++)
{
if(m_mux_data & 1 << i)
- res = ioport(mpnames[offset >> 1][i])->read();
+ res = ioport(mpnames[offset][i])->read();
}
}
break;
@@ -252,7 +249,7 @@ READ8_MEMBER(stv_state::stvmp_ioga_r)
WRITE8_MEMBER(stv_state::stvmp_ioga_w)
{
- switch(offset)
+ switch(offset * 2 + 1)
{
case 0x09: m_mux_data = data ^ 0xff; break;
case 0x11: m_port_sel = data; break;
@@ -262,129 +259,11 @@ WRITE8_MEMBER(stv_state::stvmp_ioga_w)
WRITE8_MEMBER(stv_state::hop_ioga_w)
{
- if (offset == 7)
+ if ((offset * 2 + 1) == 7)
m_hopper->motor_w(data & 0x80);
stv_ioga_w(space, offset, data);
}
-/* remaps with a 8-bit handler because MAME can't install r/w handlers with a different bus parallelism than the CPU native one, shrug ... */
-READ32_MEMBER(stv_state::stv_ioga_r32)
-{
- uint32_t res;
-
- res = 0;
- if(ACCESSING_BITS_16_23)
- res |= stv_ioga_r(space,offset*4+1) << 16;
- if(ACCESSING_BITS_0_7)
- res |= stv_ioga_r(space,offset*4+3);
- if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31)
- if(!(ACCESSING_BITS_16_23 || ACCESSING_BITS_0_7))
- printf("Warning: IOGA reads from odd offset %02x %08x!\n",offset*4,mem_mask);
-
- return res;
-}
-
-WRITE32_MEMBER(stv_state::stv_ioga_w32)
-{
- if(ACCESSING_BITS_16_23)
- stv_ioga_w(space,offset*4+1,data >> 16);
- if(ACCESSING_BITS_0_7)
- stv_ioga_w(space,offset*4+3,data);
- if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31)
- if(!(ACCESSING_BITS_16_23 || ACCESSING_BITS_0_7))
- printf("Warning: IOGA writes to odd offset %02x (%08x) -> %08x!",offset*4,mem_mask,data);
-
- return;
-}
-
-READ32_MEMBER(stv_state::critcrsh_ioga_r32)
-{
- uint32_t res;
-
- res = 0;
- if(ACCESSING_BITS_16_23)
- res |= critcrsh_ioga_r(space,offset*4+1) << 16;
- if(ACCESSING_BITS_0_7)
- res |= critcrsh_ioga_r(space,offset*4+3);
- if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31)
- if(!(ACCESSING_BITS_16_23 || ACCESSING_BITS_0_7))
- if(!machine().side_effects_disabled())
- printf("Warning: IOGA reads from odd offset %02x %08x!\n",offset*4,mem_mask);
-
- return res;
-}
-
-READ32_MEMBER(stv_state::stvmp_ioga_r32)
-{
- uint32_t res;
-
- res = 0;
- if(ACCESSING_BITS_16_23)
- res |= stvmp_ioga_r(space,offset*4+1) << 16;
- if(ACCESSING_BITS_0_7)
- res |= stvmp_ioga_r(space,offset*4+3);
- if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31)
- if(!(ACCESSING_BITS_16_23 || ACCESSING_BITS_0_7))
- if(!machine().side_effects_disabled())
- printf("Warning: IOGA reads from odd offset %02x %08x!\n",offset*4,mem_mask);
-
- return res;
-}
-
-WRITE32_MEMBER(stv_state::stvmp_ioga_w32)
-{
- if(ACCESSING_BITS_16_23)
- stvmp_ioga_w(space,offset*4+1,data >> 16);
- if(ACCESSING_BITS_0_7)
- stvmp_ioga_w(space,offset*4+3,data);
- if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31)
- if(!(ACCESSING_BITS_16_23 || ACCESSING_BITS_0_7))
- if(!machine().side_effects_disabled())
- printf("Warning: IOGA writes to odd offset %02x (%08x) -> %08x!",offset*4,mem_mask,data);
-}
-
-READ32_MEMBER(stv_state::magzun_ioga_r32)
-{
- uint32_t res;
-
- res = 0;
- if(ACCESSING_BITS_16_23)
- res |= magzun_ioga_r(space,offset*4+1) << 16;
- if(ACCESSING_BITS_0_7)
- res |= magzun_ioga_r(space,offset*4+3);
- if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31)
- if(!(ACCESSING_BITS_16_23 || ACCESSING_BITS_0_7))
- if(!machine().side_effects_disabled())
- printf("Warning: IOGA reads from odd offset %02x %08x!\n",offset*4,mem_mask);
-
- return res;
-}
-
-WRITE32_MEMBER(stv_state::magzun_ioga_w32)
-{
- if(ACCESSING_BITS_16_23)
- magzun_ioga_w(space,offset*4+1,data >> 16);
- if(ACCESSING_BITS_0_7)
- magzun_ioga_w(space,offset*4+3,data);
- if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31)
- if(!(ACCESSING_BITS_16_23 || ACCESSING_BITS_0_7))
- if(!machine().side_effects_disabled())
- printf("Warning: IOGA writes to odd offset %02x (%08x) -> %08x!",offset*4,mem_mask,data);
-}
-
-WRITE32_MEMBER(stv_state::hop_ioga_w32)
-{
- if(ACCESSING_BITS_16_23)
- hop_ioga_w(space,offset*4+1,data >> 16);
- if(ACCESSING_BITS_0_7)
- hop_ioga_w(space,offset*4+3,data);
- if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31)
- if(!(ACCESSING_BITS_16_23 || ACCESSING_BITS_0_7))
- printf("Warning: IOGA writes to odd offset %02x (%08x) -> %08x!",offset*4,mem_mask,data);
-
- return;
-}
-
/*
06013AE8: MOV.L @($D4,PC),R5
@@ -435,9 +314,6 @@ void stv_state::init_stv()
m_maincpu->sh2drc_set_options(SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
m_slave->sh2drc_set_options(SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(*this, FUNC(stv_state::stv_ioga_r32)), write32_delegate(*this, FUNC(stv_state::stv_ioga_w32)));
- m_slave->space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(*this, FUNC(stv_state::stv_ioga_r32)), write32_delegate(*this, FUNC(stv_state::stv_ioga_w32)));
-
m_maincpu->sh2drc_add_fastram(0x00000000, 0x0007ffff, 1, &m_rom[0]);
m_maincpu->sh2drc_add_fastram(0x00200000, 0x002fffff, 0, &m_workram_l[0]);
m_maincpu->sh2drc_add_fastram(0x06000000, 0x060fffff, 0, &m_workram_h[0]);
@@ -448,13 +324,6 @@ void stv_state::init_stv()
m_vdp2.pal = 0;
}
-void stv_state::init_critcrsh()
-{
- init_stv();
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(*this, FUNC(stv_state::critcrsh_ioga_r32)), write32_delegate(*this, FUNC(stv_state::stv_ioga_w32)));
- m_slave->space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(*this, FUNC(stv_state::critcrsh_ioga_r32)), write32_delegate(*this, FUNC(stv_state::stv_ioga_w32)));
-}
-
/*
- if pc==604bf20 && 608e832 <- 1 (HWEF)
- if pc==604bfbe && 608e832 <- 2 (HREF)
@@ -487,9 +356,6 @@ void stv_state::init_magzun()
init_stv();
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(*this, FUNC(stv_state::magzun_ioga_r32)), write32_delegate(*this, FUNC(stv_state::magzun_ioga_w32)));
- m_slave->space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(*this, FUNC(stv_state::magzun_ioga_r32)), write32_delegate(*this, FUNC(stv_state::magzun_ioga_w32)));
-
m_maincpu->space(AS_PROGRAM).install_read_handler(0x608e830, 0x608e833, read32_delegate(*this, FUNC(stv_state::magzun_hef_hack_r)));
m_maincpu->space(AS_PROGRAM).install_read_handler(0x60ff3b4, 0x60ff3b7, read32_delegate(*this, FUNC(stv_state::magzun_rx_hack_r)));
@@ -504,14 +370,6 @@ void stv_state::init_magzun()
}
-void stv_state::init_stvmp()
-{
- init_stv();
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(*this, FUNC(stv_state::stvmp_ioga_r32)), write32_delegate(*this, FUNC(stv_state::stvmp_ioga_w32)));
- m_slave->space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(*this, FUNC(stv_state::stvmp_ioga_r32)), write32_delegate(*this, FUNC(stv_state::stvmp_ioga_w32)));
-}
-
-
void stv_state::init_shienryu()
{
// master
@@ -697,7 +555,7 @@ void stv_state::init_danchih()
m_maincpu->sh2drc_add_pcflush(0x6028c8e);
m_slave->sh2drc_add_pcflush(0x602ae26);
- init_stvmp();
+ init_stv();
m_minit_boost_timeslice = m_sinit_boost_timeslice = attotime::from_usec(5);
}
@@ -1025,20 +883,13 @@ void stv_state::init_nameclv3()
init_stv();
}
-void stv_state::init_hopper()
-{
- init_stv();
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(*this, FUNC(stv_state::stv_ioga_r32)), write32_delegate(*this, FUNC(stv_state::hop_ioga_w32)));
- m_slave->space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(*this, FUNC(stv_state::stv_ioga_r32)), write32_delegate(*this, FUNC(stv_state::hop_ioga_w32)));
-}
-
void stv_state::stv_mem(address_map &map)
{
map(0x00000000, 0x0007ffff).rom().mirror(0x20000000).region("bios", 0); // bios
map(0x00100000, 0x0010007f).rw(m_smpc_hle, FUNC(smpc_hle_device::read), FUNC(smpc_hle_device::write));
map(0x00180000, 0x0018ffff).rw(FUNC(stv_state::saturn_backupram_r), FUNC(stv_state::saturn_backupram_w)).share("share1");
map(0x00200000, 0x002fffff).ram().mirror(0x20100000).share("workram_l");
-// map(0x00400000, 0x0040001f).rw(FUNC(stv_state::stv_ioga_r32), FUNC(stv_state::stv_io_w32)).share("ioga").mirror(0x20); /* installed with per-game specific */
+ map(0x00400000, 0x0040003f).rw(FUNC(stv_state::stv_ioga_r), FUNC(stv_state::stv_ioga_w)).umask32(0x00ff00ff);
map(0x01000000, 0x017fffff).w(FUNC(stv_state::minit_w));
map(0x01800000, 0x01ffffff).w(FUNC(stv_state::sinit_w));
map(0x02000000, 0x04ffffff).rom().mirror(0x20000000).region("abus", 0); // cartridge
@@ -1058,6 +909,30 @@ void stv_state::stv_mem(address_map &map)
map(0xc0000000, 0xc00007ff).ram(); // cache RAM
}
+void stv_state::critcrsh_mem(address_map &map)
+{
+ stv_mem(map);
+ map(0x00400000, 0x0040003f).rw(FUNC(stv_state::critcrsh_ioga_r), FUNC(stv_state::stv_ioga_w)).umask32(0x00ff00ff);
+}
+
+void stv_state::magzun_mem(address_map &map)
+{
+ stv_mem(map);
+ map(0x00400000, 0x0040003f).rw(FUNC(stv_state::magzun_ioga_r), FUNC(stv_state::magzun_ioga_w)).umask32(0x00ff00ff);
+}
+
+void stv_state::stvmp_mem(address_map &map)
+{
+ stv_mem(map);
+ map(0x00400000, 0x0040003f).rw(FUNC(stv_state::stvmp_ioga_r), FUNC(stv_state::stvmp_ioga_w)).umask32(0x00ff00ff);
+}
+
+void stv_state::hopper_mem(address_map &map)
+{
+ stv_mem(map);
+ map(0x00400000, 0x0040003f).rw(FUNC(stv_state::stv_ioga_r), FUNC(stv_state::hop_ioga_w)).umask32(0x00ff00ff);
+}
+
void stv_state::stvcd_mem(address_map &map)
{
stv_mem(map);
@@ -1200,6 +1075,30 @@ void stv_state::stv_5881(machine_config &config)
m_cryptdevice->set_read_cb(FUNC(stv_state::crypt_read_callback));
}
+void stv_state::critcrsh(machine_config &config)
+{
+ stv(config);
+
+ m_maincpu->set_addrmap(AS_PROGRAM, &stv_state::critcrsh_mem);
+ m_slave->set_addrmap(AS_PROGRAM, &stv_state::critcrsh_mem);
+}
+
+void stv_state::magzun(machine_config &config)
+{
+ stv(config);
+
+ m_maincpu->set_addrmap(AS_PROGRAM, &stv_state::magzun_mem);
+ m_slave->set_addrmap(AS_PROGRAM, &stv_state::magzun_mem);
+}
+
+void stv_state::stvmp(machine_config &config)
+{
+ stv(config);
+
+ m_maincpu->set_addrmap(AS_PROGRAM, &stv_state::stvmp_mem);
+ m_slave->set_addrmap(AS_PROGRAM, &stv_state::stvmp_mem);
+}
+
void stv_state::stvcd(machine_config &config)
{
stv(config);
@@ -1277,6 +1176,9 @@ void stv_state::hopper(machine_config &config)
{
stv(config);
HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH);
+
+ m_maincpu->set_addrmap(AS_PROGRAM, &stv_state::hopper_mem);
+ m_slave->set_addrmap(AS_PROGRAM, &stv_state::hopper_mem);
}
MACHINE_RESET_MEMBER(stv_state,stv)
@@ -3729,9 +3631,9 @@ GAME( 1996, batmanfr, stvbios, batmanfr, batmanfr, stv_state, init_batmanfr,
GAME( 1996, colmns97, stvbios, stv, stv, stv_state, init_colmns97, ROT0, "Sega", "Columns '97 (JET 961209 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1997, cotton2, stvbios, stv, stv, stv_state, init_cotton2, ROT0, "Success", "Cotton 2 (JUET 970902 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1998, cottonbm, stvbios, stv, stv, stv_state, init_cottonbm, ROT0, "Success", "Cotton Boomerang (JUET 980709 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1995, critcrsh, stvbios, stv, critcrsh, stv_state, init_critcrsh, ROT0, "Sega", "Critter Crusher (EA 951204 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1995, tatacot, critcrsh,stv, critcrsh, stv_state, init_critcrsh, ROT0, "Sega", "Tatacot (JA 951128 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1999, danchih, stvbios, stv, stvmp, stv_state, init_danchih, ROT0, "Altron (Tecmo license)", "Danchi de Hanafuda (J 990607 V1.400)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1995, critcrsh, stvbios, critcrsh, critcrsh, stv_state, init_stv, ROT0, "Sega", "Critter Crusher (EA 951204 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1995, tatacot, critcrsh,critcrsh, critcrsh, stv_state, init_stv, ROT0, "Sega", "Tatacot (JA 951128 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1999, danchih, stvbios, stvmp, stvmp, stv_state, init_danchih, ROT0, "Altron (Tecmo license)", "Danchi de Hanafuda (J 990607 V1.400)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 2000, danchiq, stvbios, stv, stv, stv_state, init_danchiq, ROT0, "Altron", "Danchi de Quiz: Okusan Yontaku Desuyo! (J 001128 V1.200)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1996, diehard, stvbios, stv, stv, stv_state, init_diehard, ROT0, "Sega", "Die Hard Arcade (UET 960515 V1.000)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1996, dnmtdeka, diehard, stv, stv, stv_state, init_dnmtdeka, ROT0, "Sega", "Dynamite Deka (J 960515 V1.000)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
@@ -3747,13 +3649,13 @@ GAME( 1998, grdforce, stvbios, stv, stv, stv_state, init_grdforce,
GAME( 1997, groovef, stvbios, stv, stv6b, stv_state, init_groovef, ROT0, "Atlus", "Groove on Fight - Gouketsuji Ichizoku 3 (J 970416 V1.001)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1997, hanagumi, stvbios, stv, stv, stv_state, init_hanagumi, ROT0, "Sega", "Sakura Taisen - Hanagumi Taisen Columns (J 971007 V1.010)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 1996, introdon, stvbios, stv, stv, stv_state, init_stv, ROT0, "Sunsoft / Success", "Karaoke Quiz Intro Don Don! (J 960213 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1995, kiwames, stvbios, stv, stvmp, stv_state, init_stvmp, ROT0, "Athena", "Pro Mahjong Kiwame S (J 951020 V1.208)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1995, kiwames, stvbios, stvmp, stvmp, stv_state, init_stv, ROT0, "Athena", "Pro Mahjong Kiwame S (J 951020 V1.208)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1997, maruchan, stvbios, stv, stv, stv_state, init_maruchan, ROT0, "Sega / Toyosuisan", "Maru-Chan de Goo! (J 971216 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1996, mausuke, stvbios, stv, stv, stv_state, init_mausuke, ROT0, "Data East", "Mausuke no Ojama the World (J 960314 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1999, micrombc, stvbios, hopper, micrombc, stv_state, init_hopper, ROT0, "Sega", "Microman Battle Charge (J 990326 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1998, myfairld, stvbios, stv, myfairld, stv_state, init_stvmp, ROT0, "Micronet", "Virtual Mahjong 2 - My Fair Lady (J 980608 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1999, micrombc, stvbios, hopper, micrombc, stv_state, init_stv, ROT0, "Sega", "Microman Battle Charge (J 990326 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1998, myfairld, stvbios, stvmp, myfairld, stv_state, init_stv, ROT0, "Micronet", "Virtual Mahjong 2 - My Fair Lady (J 980608 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1998, othellos, stvbios, stv, stv, stv_state, init_othellos, ROT0, "Success", "Othello Shiyouyo (J 980423 V1.002)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 2001, patocar, stvbios, hopper, patocar, stv_state, init_hopper, ROT0, "Sega", "Hashire Patrol Car (J 990326 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 2001, patocar, stvbios, hopper, patocar, stv_state, init_stv, ROT0, "Sega", "Hashire Patrol Car (J 990326 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1995, pblbeach, stvbios, stv, stv, stv_state, init_pblbeach, ROT0, "T&E Soft", "Pebble Beach - The Great Shot (JUE 950913 V0.990)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1996, prikura, stvbios, stv, stv, stv_state, init_prikura, ROT0, "Atlus", "Princess Clara Daisakusen (J 960910 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1996, puyosun, stvbios, stv, stv, stv_state, init_puyosun, ROT0, "Compile", "Puyo Puyo Sun (J 961115 V0.001)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
@@ -3767,15 +3669,15 @@ GAME( 1998, sss, stvbios, stv_5881, stv, stv_state, init_sss,
GAME( 1995, sandor, stvbios, stv, stv, stv_state, init_sandor, ROT0, "Sega", "Puzzle & Action: Sando-R (J 951114 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1997, thunt, sandor, stv, stv, stv_state, init_thunt, ROT0, "Sega", "Puzzle & Action: Treasure Hunt (JUET 970901 V2.00E)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1997, thuntk, sandor, stv, stv, stv_state, init_sandor, ROT0, "Sega / Deniam", "Puzzle & Action: BoMulEul Chajara (JUET 970125 V2.00K)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 2000, skychal, stvbios, hopper, patocar, stv_state, init_hopper, ROT0, "Sega", "Sky Challenger (J 000406 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 2000, skychal, stvbios, hopper, patocar, stv_state, init_stv, ROT0, "Sega", "Sky Challenger (J 000406 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1995, smleague, stvbios, stv, stv, stv_state, init_smleague, ROT0, "Sega", "Super Major League (U 960108 V1.000)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1995, finlarch, smleague,stv, stv, stv_state, init_finlarch, ROT0, "Sega", "Final Arch (J 950714 V1.001)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1996, sokyugrt, stvbios, stv, stv, stv_state, init_sokyugrt, ROT0, "Raizing / Eighting", "Soukyugurentai / Terra Diver (JUET 960821 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1995, suikoenb, stvbios, stv, stv6b, stv_state, init_suikoenb, ROT0, "Data East", "Suiko Enbu / Outlaws of the Lost Dynasty (JUETL 950314 V2.001)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1998, supgoal, stvbios, hopper, patocar, stv_state, init_hopper, ROT0, "Sega", "Nerae! Super Goal (J 981218 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1997, techbowl, stvbios, hopper, patocar, stv_state, init_hopper, ROT0, "Sega", "Technical Bowling (J 971212 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1998, supgoal, stvbios, hopper, patocar, stv_state, init_stv, ROT0, "Sega", "Nerae! Super Goal (J 981218 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1997, techbowl, stvbios, hopper, patocar, stv_state, init_stv, ROT0, "Sega", "Technical Bowling (J 971212 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1996, vfkids, stvbios, stv, stv, stv_state, init_stv, ROT0, "Sega", "Virtua Fighter Kids (JUET 960319 V0.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1997, vmahjong, stvbios, stv, vmahjong, stv_state, init_stvmp, ROT0, "Micronet", "Virtual Mahjong (J 961214 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1997, vmahjong, stvbios, stvmp, vmahjong, stv_state, init_stv, ROT0, "Micronet", "Virtual Mahjong (J 961214 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1997, winterht, stvbios, stv, stv, stv_state, init_winterht, ROT0, "Sega", "Winter Heat (JUET 971012 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1997, znpwfv, stvbios, stv, stv, stv_state, init_znpwfv, ROT0, "Sega", "Zen Nippon Pro-Wrestling Featuring Virtua (J 971123 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1997, znpwfvt, znpwfv, stv, stv, stv_state, init_znpwfv, ROT0, "Sega", "Zen Nippon Pro-Wrestling Featuring Virtua (T 971123 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
@@ -3836,7 +3738,7 @@ GAME( 1998, twcup98, stvbios, stv_5881, stv, stv_state, init_twcup98,
GAME( 1998, twsoc98, twcup98, stv_5881, stv, stv_state, init_twcup98, ROT0, "Tecmo", "Tecmo World Soccer '98 (JUET 980410 V1.000)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // ^^ (check)
/* Gives I/O errors */
-GAME( 1996, magzun, stvbios, stv, stv, stv_state, init_magzun, ROT0, "Sega", "Magical Zunou Power (J 961031 V1.000)", MACHINE_NOT_WORKING | MACHINE_NODEVICE_MICROPHONE )
+GAME( 1996, magzun, stvbios, magzun, stv, stv_state, init_magzun, ROT0, "Sega", "Magical Zunou Power (J 961031 V1.000)", MACHINE_NOT_WORKING | MACHINE_NODEVICE_MICROPHONE )
GAME( 1998, choroqhr, stvbios, stv, stv, stv_state, init_stv, ROT0, "Sega / Takara", "Choro Q Hyper Racing 5 (J 981230 V1.000)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 2000, sackids, stvbios, stv, stv, stv_state, init_stv, ROT0, "Sega", "Soreyuke Anpanman Crayon Kids (J 001026 V1.000)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
diff --git a/src/mame/includes/stv.h b/src/mame/includes/stv.h
index 9656725a9cf..14aa711538c 100644
--- a/src/mame/includes/stv.h
+++ b/src/mame/includes/stv.h
@@ -33,6 +33,9 @@ public:
void stv_slot(machine_config &config);
void stv_cartslot(machine_config &config);
void stv(machine_config &config);
+ void critcrsh(machine_config &config);
+ void magzun(machine_config &config);
+ void stvmp(machine_config &config);
void hopper(machine_config &config);
void batmanfr(machine_config &config);
void shienryu(machine_config &config);
@@ -61,8 +64,6 @@ public:
void init_seabass();
void init_stv();
void init_thunt();
- void init_critcrsh();
- void init_stvmp();
void init_sasissu();
void init_dnmtdeka();
void init_ffreveng();
@@ -86,7 +87,6 @@ public:
void init_znpwfv();
void init_othellos();
void init_mausuke();
- void init_hopper();
private:
DECLARE_READ8_MEMBER(stv_ioga_r);
@@ -96,17 +96,9 @@ private:
DECLARE_WRITE8_MEMBER(magzun_ioga_w);
DECLARE_READ8_MEMBER(stvmp_ioga_r);
DECLARE_WRITE8_MEMBER(stvmp_ioga_w);
- DECLARE_READ32_MEMBER(stv_ioga_r32);
- DECLARE_WRITE32_MEMBER(stv_ioga_w32);
- DECLARE_READ32_MEMBER(critcrsh_ioga_r32);
- DECLARE_READ32_MEMBER(stvmp_ioga_r32);
- DECLARE_WRITE32_MEMBER(stvmp_ioga_w32);
- DECLARE_READ32_MEMBER(magzun_ioga_r32);
- DECLARE_WRITE32_MEMBER(magzun_ioga_w32);
DECLARE_READ32_MEMBER(magzun_hef_hack_r);
DECLARE_READ32_MEMBER(magzun_rx_hack_r);
DECLARE_WRITE8_MEMBER(hop_ioga_w);
- DECLARE_WRITE32_MEMBER(hop_ioga_w32);
image_init_result load_cart(device_image_interface &image, generic_slot_device *slot);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( stv_cart1 ) { return load_cart(image, m_cart1); }
@@ -169,6 +161,10 @@ private:
void sound_mem(address_map &map);
void scsp_mem(address_map &map);
void stv_mem(address_map &map);
+ void critcrsh_mem(address_map &map);
+ void magzun_mem(address_map &map);
+ void stvmp_mem(address_map &map);
+ void hopper_mem(address_map &map);
void stvcd_mem(address_map &map);
};