From 4b22e9211fabae21e049d6857ba0e2f32a3eb0ac Mon Sep 17 00:00:00 2001 From: Risugami <@> Date: Wed, 31 Aug 2016 14:26:17 -0500 Subject: [PATCH] Added layout for California Speed. --- src/mame/drivers/seattle.cpp | 45 +++++++++++++- src/mame/layout/calspeed.lay | 117 +++++++++++++++++++++++++++++++++++ 2 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 src/mame/layout/calspeed.lay diff --git a/src/mame/drivers/seattle.cpp b/src/mame/drivers/seattle.cpp index 395b7cfd0fd..a4841a71263 100644 --- a/src/mame/drivers/seattle.cpp +++ b/src/mame/drivers/seattle.cpp @@ -194,6 +194,7 @@ #include "machine/smc91c9x.h" #include "video/voodoo.h" #include "machine/nvram.h" +#include "calspeed.lh" @@ -368,6 +369,7 @@ /* Widget registers */ #define WREG_ETHER_ADDR (0x00/4) #define WREG_INTERRUPT (0x04/4) +#define WREG_OUTPUT (0x0C/4) #define WREG_ANALOG (0x10/4) #define WREG_ETHER_DATA (0x14/4) @@ -469,6 +471,8 @@ public: UINT8 m_pending_analog_read; UINT8 m_status_leds; UINT32 m_cmos_write_enabled; + UINT32 m_output; + UINT8 m_output_mode; DECLARE_READ32_MEMBER(interrupt_state_r); DECLARE_READ32_MEMBER(interrupt_state2_r); DECLARE_WRITE32_MEMBER(interrupt_config_w); @@ -492,6 +496,8 @@ public: DECLARE_WRITE32_MEMBER(status_leds_w); DECLARE_READ32_MEMBER(ethernet_r); DECLARE_WRITE32_MEMBER(ethernet_w); + DECLARE_READ32_MEMBER(output_r); + DECLARE_WRITE32_MEMBER(output_w); DECLARE_READ32_MEMBER(widget_r); DECLARE_WRITE32_MEMBER(widget_w); DECLARE_READ32_MEMBER(seattle_ide_r); @@ -599,6 +605,8 @@ void seattle_state::machine_start() save_item(NAME(m_pending_analog_read)); save_item(NAME(m_status_leds)); save_item(NAME(m_cmos_write_enabled)); + save_item(NAME(m_output)); + save_item(NAME(m_output_mode)); } @@ -1563,6 +1571,29 @@ void seattle_state::update_widget_irq() } +READ32_MEMBER(seattle_state::output_r) +{ + return m_output; +} + + +WRITE32_MEMBER(seattle_state::output_w) +{ + UINT8 bit; + UINT8 op = (data >> 8) & 0xFF; + UINT8 arg = data & 0xFF; + switch (op) { + case 0xF7: m_output_mode = arg; break; + case 0xFB: + switch (m_output_mode) { + case 0x04: output().set_value("wheel", arg); break; //wheel motor delta. signed byte. + case 0x05: for (bit = 0; bit < 8; bit++) output().set_lamp_value(bit, (arg >> bit) & 0x1); break; + } + break; + } +} + + READ32_MEMBER(seattle_state::widget_r) { UINT32 result = ~0; @@ -1577,6 +1608,10 @@ READ32_MEMBER(seattle_state::widget_r) result = m_ethernet_irq_state << WINT_ETHERNET_SHIFT; result = ~result; break; + + case WREG_OUTPUT: + result = output_r(m_maincpu->space(AS_PROGRAM), 0, mem_mask); + break; case WREG_ANALOG: result = analog_port_r(m_maincpu->space(AS_PROGRAM), 0, mem_mask); @@ -1608,6 +1643,10 @@ WRITE32_MEMBER(seattle_state::widget_w) m_widget.irq_mask = data; update_widget_irq(); break; + + case WREG_OUTPUT: + output_w(m_maincpu->space(AS_PROGRAM), 0, data, mem_mask); + break; case WREG_ANALOG: analog_port_w(m_maincpu->space(AS_PROGRAM), 0, data, mem_mask); @@ -3231,9 +3270,9 @@ GAME( 1996, mace, 0, mace, mace, seattle_state, mace GAME( 1997, macea, mace, mace, mace, seattle_state, mace, ROT0, "Atari Games", "Mace: The Dark Age (HDD 1.0a)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, sfrush, 0, sfrush, sfrush, seattle_state, sfrush, ROT0, "Atari Games", "San Francisco Rush", MACHINE_SUPPORTS_SAVE ) GAME( 1996, sfrushrk, 0, sfrushrk, sfrushrk, seattle_state, sfrushrk, ROT0, "Atari Games", "San Francisco Rush: The Rock", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1998, calspeed, 0, calspeed, calspeed, seattle_state, calspeed, ROT0, "Atari Games", "California Speed (Version 2.1a Apr 17 1998, GUTS 1.25 Apr 17 1998 / MAIN Apr 17 1998)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, calspeeda,calspeed, calspeed, calspeed, seattle_state, calspeed, ROT0, "Atari Games", "California Speed (Version 1.0r8 Mar 10 1998, GUTS Mar 10 1998 / MAIN Mar 10 1998)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, calspeedb,calspeed, calspeed, calspeed, seattle_state, calspeed, ROT0, "Atari Games", "California Speed (Version 1.0r7a Mar 4 1998, GUTS Mar 3 1998 / MAIN Jan 19 1998)", MACHINE_SUPPORTS_SAVE ) +GAMEL( 1998, calspeed, 0, calspeed, calspeed, seattle_state, calspeed, ROT0, "Atari Games", "California Speed (Version 2.1a Apr 17 1998, GUTS 1.25 Apr 17 1998 / MAIN Apr 17 1998)", MACHINE_SUPPORTS_SAVE, layout_calspeed ) +GAMEL( 1998, calspeeda,calspeed, calspeed, calspeed, seattle_state, calspeed, ROT0, "Atari Games", "California Speed (Version 1.0r8 Mar 10 1998, GUTS Mar 10 1998 / MAIN Mar 10 1998)", MACHINE_SUPPORTS_SAVE, layout_calspeed ) +GAMEL( 1998, calspeedb,calspeed, calspeed, calspeed, seattle_state, calspeed, ROT0, "Atari Games", "California Speed (Version 1.0r7a Mar 4 1998, GUTS Mar 3 1998 / MAIN Jan 19 1998)", MACHINE_SUPPORTS_SAVE, layout_calspeed ) diff --git a/src/mame/layout/calspeed.lay b/src/mame/layout/calspeed.lay new file mode 100644 index 00000000000..9e6ce650f40 --- /dev/null +++ b/src/mame/layout/calspeed.lay @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +