From 25487d5e5429c647b85caecbd7e2d161599b0286 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Thu, 24 Apr 2008 05:46:31 +0000 Subject: [PATCH] Fix: 01740: carnival, headon, heiankyo, pulsar, samurai, tranqgun : Is not possible to insert any coin 01721: sspaceat, sspacat2, sspacat3, sspacatc : Problems with inserting coins 01710: spacetrk, sptrekct: Cannot insert coins in both sets --- src/mame/drivers/vicdual.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mame/drivers/vicdual.c b/src/mame/drivers/vicdual.c index c6ae035e31a..2a2698fc228 100644 --- a/src/mame/drivers/vicdual.c +++ b/src/mame/drivers/vicdual.c @@ -68,7 +68,6 @@ #define COIN_PORT_TAG "COIN" static UINT32 coin_status; -static UINT32 last_coin_input; static TIMER_CALLBACK( clear_coin_status ) @@ -85,9 +84,13 @@ static void assert_coin_status(void) static CUSTOM_INPUT( vicdual_read_coin_status ) { - UINT32 coin_input = input_port_read(machine, COIN_PORT_TAG); + return coin_status; +} - if (coin_input && !last_coin_input) + +static INPUT_CHANGED( coin_changed ) +{ + if (newval && !oldval) { /* increment the coin counter */ coin_counter_w(0, 1); @@ -98,16 +101,12 @@ static CUSTOM_INPUT( vicdual_read_coin_status ) /* simulate the coin switch being closed for a while */ timer_set(double_to_attotime(4 * attotime_to_double(video_screen_get_frame_period(machine->primary_screen))), NULL, 0, clear_coin_status); } - - last_coin_input = coin_input; - - return coin_status; } #define PORT_COIN \ PORT_START_TAG(COIN_PORT_TAG) \ - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) \ + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_changed, NULL) \ PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )