From cf2b600756f704572535dba96025d624ca00fb4d Mon Sep 17 00:00:00 2001 From: Phil Bennett Date: Thu, 1 Apr 2010 08:59:44 +0000 Subject: [PATCH] Gun output cleanups/hookups [Howard Casto]: * drivers\othunder.c: Changed Operation Thunderbolt output names to something more appropriate. (They were routed to LEDs.) * video\rastan.c: Hooked up output for Operation Wolf. * machine\midwunit.c: Hooked up outputs for Revolution X. * machine\midyunit.c: Hooked up outputs for Terminator 2. * drivers\seta.c: Hooked up outputs for Zombie Raid. --- src/mame/drivers/othunder.c | 9 ++++++--- src/mame/drivers/seta.c | 5 +++++ src/mame/machine/midwunit.c | 10 ++++++++++ src/mame/machine/midyunit.c | 24 ++++++++++++++++++++++++ src/mame/video/rastan.c | 10 ++++++++++ 5 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c index 74112ff3c02..378cb789ad2 100644 --- a/src/mame/drivers/othunder.c +++ b/src/mame/drivers/othunder.c @@ -155,9 +155,11 @@ Notes: Possible values are: 111 (max) 011 (high) -01 (med) --0 (low). It's a rotary control so only one bit is supposed to be low. -- The keyboard leds I'm turning on are actually the gun solenoid outputs, which +(Changed set led output to proper output port. --HowardC) +- The outputs I'm turning on are actually the gun solenoid outputs, which would rattle the gun while firing. + - BM, 060108 - The original flyer for this game has screenshots which clearly show the background is 4 pixels to the left on several game stages (you can see the edge of sprites overlapping past the right edge). Therefore I @@ -327,8 +329,9 @@ static WRITE16_HANDLER( othunder_tc0220ioc_w ) 0x000000 eeprom in data x0000000 eeprom out data */ - set_led_status(space->machine, 0, data & 1); - set_led_status(space->machine, 1, data & 2); + /* Recoil Piston Motor Status */ + output_set_value("Player1_Recoil_Piston", data & 0x1 ); + output_set_value("Player2_Recoil_Piston", (data & 0x2) >>1 ); if (data & 4) popmessage("OBPRI SET!"); diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index 618b9926ea1..430cf087cd8 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -1887,6 +1887,11 @@ static WRITE16_HANDLER( zombraid_gun_w ) gun_input_src = (gun_input_src&1) | (data&2); break; default: + /* Gun Recoils */ + /* Note: In debug menu recoil solenoids strobe when held down. Is this correct?? */ + output_set_value("Player1_Gun_Recoil", (data & 0x10)>>4 ); + output_set_value("Player2_Gun_Recoil", (data & 0x8)>>3 ); + gun_input_bit = bit_count - 4; gun_input_bit = 8 - gun_input_bit; // Reverse order break; diff --git a/src/mame/machine/midwunit.c b/src/mame/machine/midwunit.c index 47f6a1998e9..120442879a8 100644 --- a/src/mame/machine/midwunit.c +++ b/src/mame/machine/midwunit.c @@ -149,6 +149,16 @@ WRITE16_HANDLER( midxunit_io_w ) break; default: + /* Gun Outputs for RevX */ + /* Note: The Gun for the Coin slot you use is supposed to rumble when you insert coins, and it doesn't for P3 */ + /* Perhaps an Input is hooked up wrong??? */ + output_set_value("Player1_Gun_Recoil", data & 0x1 ); + output_set_value("Player2_Gun_Recoil", (data & 0x2) >> 1 ); + output_set_value("Player3_Gun_Recoil", (data & 0x4) >> 2 ); + output_set_value("Player1_Gun_LED", (~data & 0x10) >> 4 ); + output_set_value("Player2_Gun_LED", (~data & 0x20) >> 5 ); + output_set_value("Player3_Gun_LED", (~data & 0x40) >> 6 ); + logerror("%08X:I/O write to %d = %04X\n", cpu_get_pc(space->cpu), offset, data); // logerror("%08X:Unknown I/O write to %d = %04X\n", cpu_get_pc(space->cpu), offset, data); break; diff --git a/src/mame/machine/midyunit.c b/src/mame/machine/midyunit.c index fe03cdee706..14741f7d3b7 100644 --- a/src/mame/machine/midyunit.c +++ b/src/mame/machine/midyunit.c @@ -172,6 +172,30 @@ static READ16_HANDLER( term2_input_r ) static WRITE16_HANDLER( term2_sound_w ) { + /* Flash Lamp Output Data */ + if ( ((data & 0x800) != 0x800) and ((data & 0x400) == 0x400 ) ) + { + output_set_value("Left_Flash_1", data & 0x1); + output_set_value("Left_Flash_2", (data & 0x2) >> 1); + output_set_value("Left_Flash_3", (data & 0x4) >> 2); + output_set_value("Left_Flash_4", (data & 0x8) >> 3); + output_set_value("Right_Flash_1", (data & 0x10) >> 4); + output_set_value("Right_Flash_2", (data & 0x20) >> 5); + output_set_value("Right_Flash_3", (data & 0x40) >> 6); + output_set_value("Right_Flash_4", (data & 0x80) >> 7); + } + + /* Gun Output Data */ + if ( ((data & 0x800) == 0x800) and ((data & 0x400) != 0x400 ) ) + { + output_set_value("Left_Gun_Recoil", data & 0x1); + output_set_value("Right_Gun_Recoil", (data & 0x2) >> 1); + output_set_value("Left_Gun_Green_Led", (~data & 0x20) >> 5); + output_set_value("Left_Gun_Red_Led", (~data & 0x10) >> 4); + output_set_value("Right_Gun_Green_Led", (~data & 0x80) >> 7); + output_set_value("Right_Gun_Red_Led", (~data & 0x40) >> 6); + } + if (offset == 0) term2_analog_select = (data >> 12) & 3; diff --git a/src/mame/video/rastan.c b/src/mame/video/rastan.c index 01448dbffd1..a7ead2da90c 100644 --- a/src/mame/video/rastan.c +++ b/src/mame/video/rastan.c @@ -75,6 +75,16 @@ WRITE16_HANDLER( opwolf_spritectrl_w ) /* other bits unknown */ pc090oj_set_sprite_ctrl(state->pc090oj, (data & 0xe0) >> 5); + + /* If data = 4, the Piston Motor is off, otherwise it's on. */ + if (data == 4) + { + output_set_value("Player1_Recoil_Piston", 0); + } + else + { + output_set_value("Player1_Recoil_Piston", 1); + } } }