summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/sprint2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/sprint2.cpp')
-rw-r--r--src/mame/drivers/sprint2.cpp60
1 files changed, 27 insertions, 33 deletions
diff --git a/src/mame/drivers/sprint2.cpp b/src/mame/drivers/sprint2.cpp
index 915292612da..73e075122e9 100644
--- a/src/mame/drivers/sprint2.cpp
+++ b/src/mame/drivers/sprint2.cpp
@@ -47,8 +47,6 @@ DRIVER_INIT_MEMBER(sprint2_state,dominos4)
{
m_game = 3;
m_maincpu->space(AS_PROGRAM).install_read_port(0x0880, 0x0880, "SELFTTEST");
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x0c50, 0x0c5f, write8_delegate(FUNC(sprint2_state::dominos4_lamp3_w),this));
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x0c60, 0x0c6f, write8_delegate(FUNC(sprint2_state::dominos4_lamp4_w),this));
}
int sprint2_state::service_mode()
@@ -170,7 +168,7 @@ READ8_MEMBER(sprint2_state::sprint2_sync_r)
{
uint8_t val = 0;
- if (m_attract != 0)
+ if (m_outlatch->q0_r() != 0)
val |= 0x10;
if (m_screen->vpos() == 261)
@@ -212,12 +210,9 @@ WRITE8_MEMBER(sprint2_state::sprint2_wram_w)
}
-WRITE8_MEMBER(sprint2_state::sprint2_attract_w)
+WRITE8_MEMBER(sprint2_state::output_latch_w)
{
- m_attract = offset & 1;
-
- // also DOMINOS_ATTRACT_EN
- m_discrete->write(space, SPRINT2_ATTRACT_EN, m_attract);
+ m_outlatch->write_bit(offset >> 4, offset & 1);
}
@@ -227,34 +222,24 @@ WRITE8_MEMBER(sprint2_state::sprint2_noise_reset_w)
}
-WRITE8_MEMBER(sprint2_state::sprint2_skid1_w)
+WRITE_LINE_MEMBER(sprint2_state::lamp1_w)
{
- // also DOMINOS_TUMBLE_EN
- m_discrete->write(space, SPRINT2_SKIDSND1_EN, offset & 1);
+ output().set_led_value(0, state);
}
-WRITE8_MEMBER(sprint2_state::sprint2_skid2_w)
+WRITE_LINE_MEMBER(sprint2_state::lamp2_w)
{
- m_discrete->write(space, SPRINT2_SKIDSND2_EN, offset & 1);
+ output().set_led_value(1, state);
}
-
-WRITE8_MEMBER(sprint2_state::sprint2_lamp1_w)
+WRITE_LINE_MEMBER(sprint2_state::lamp3_w)
{
- output().set_led_value(0, offset & 1);
-}
-WRITE8_MEMBER(sprint2_state::sprint2_lamp2_w)
-{
- output().set_led_value(1, offset & 1);
+ output().set_led_value(2, state);
}
-WRITE8_MEMBER(sprint2_state::dominos4_lamp3_w)
+WRITE_LINE_MEMBER(sprint2_state::lamp4_w)
{
- output().set_led_value(2, offset & 1);
-}
-WRITE8_MEMBER(sprint2_state::dominos4_lamp4_w)
-{
- output().set_led_value(3, offset & 1);
+ output().set_led_value(3, state);
}
static ADDRESS_MAP_START( sprint2_map, AS_PROGRAM, 8, sprint2_state )
@@ -268,12 +253,7 @@ static ADDRESS_MAP_START( sprint2_map, AS_PROGRAM, 8, sprint2_state )
AM_RANGE(0x0880, 0x08bf) AM_READ(sprint2_steering1_r)
AM_RANGE(0x08c0, 0x08ff) AM_READ(sprint2_steering2_r)
AM_RANGE(0x0c00, 0x0fff) AM_READ(sprint2_sync_r)
- AM_RANGE(0x0c00, 0x0c0f) AM_WRITE(sprint2_attract_w)
- AM_RANGE(0x0c10, 0x0c1f) AM_WRITE(sprint2_skid1_w)
- AM_RANGE(0x0c20, 0x0c2f) AM_WRITE(sprint2_skid2_w)
- AM_RANGE(0x0c30, 0x0c3f) AM_WRITE(sprint2_lamp1_w)
- AM_RANGE(0x0c40, 0x0c4f) AM_WRITE(sprint2_lamp2_w)
- AM_RANGE(0x0c60, 0x0c6f) AM_WRITENOP /* SPARE */
+ AM_RANGE(0x0c00, 0x0c7f) AM_WRITE(output_latch_w)
AM_RANGE(0x0c80, 0x0cff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0x0d00, 0x0d7f) AM_WRITE(sprint2_collision_reset1_w)
AM_RANGE(0x0d80, 0x0dff) AM_WRITE(sprint2_collision_reset2_w)
@@ -556,6 +536,14 @@ static MACHINE_CONFIG_START( sprint2 )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_DEVICE_ADD("outlatch", F9334, 0) // at H8
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(DEVWRITELINE("discrete", discrete_device, write_line<SPRINT2_ATTRACT_EN>)) // also DOMINOS_ATTRACT_EN
+ MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(DEVWRITELINE("discrete", discrete_device, write_line<SPRINT2_SKIDSND1_EN>)) // also DOMINOS_TUMBLE_EN
+ MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(DEVWRITELINE("discrete", discrete_device, write_line<SPRINT2_SKIDSND2_EN>))
+ MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(sprint2_state, lamp1_w))
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(sprint2_state, lamp2_w))
+ //MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(sprint2_state, sprint2_spare_w))
+
MCFG_SOUND_ADD("discrete", DISCRETE, 0)
MCFG_DISCRETE_INTF(sprint2)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
@@ -592,6 +580,12 @@ static MACHINE_CONFIG_DERIVED( dominos, sprint2 )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( dominos4, dominos )
+ MCFG_DEVICE_MODIFY("outlatch")
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(sprint2_state, lamp3_w))
+ MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(sprint2_state, lamp4_w))
+MACHINE_CONFIG_END
+
ROM_START( sprint1 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "6290-01.b1", 0x2000, 0x0800, CRC(41fc985e) SHA1(7178846480cbf8d15955ccd987d0b0e902ab9f90) )
@@ -721,4 +715,4 @@ GAME( 1976, sprint2, sprint1, sprint2, sprint2, sprint2_state, sprint2, ROT0, "
GAME( 1976, sprint2a, sprint1, sprint2, sprint2, sprint2_state, sprint2, ROT0, "Atari (Kee Games)", "Sprint 2 (set 2)", 0 )
GAME( 1976, sprint2h, sprint1, sprint2, sprint2, sprint2_state, sprint2, ROT0, "hack", "Sprint 2 (color kit, Italy)", MACHINE_WRONG_COLORS ) // Italian hack, supposedly is color instead of b/w? how?
GAME( 1977, dominos, 0, dominos, dominos, sprint2_state, dominos, ROT0, "Atari", "Dominos", 0 )
-GAME( 1977, dominos4, dominos, dominos, dominos4,sprint2_state, dominos4,ROT0, "Atari", "Dominos 4 (Cocktail)", 0 )
+GAME( 1977, dominos4, dominos, dominos4, dominos4,sprint2_state, dominos4,ROT0, "Atari", "Dominos 4 (Cocktail)", 0 )