From 650dde81a73cb4b8b6c14f9e9c210270a0b9eef7 Mon Sep 17 00:00:00 2001 From: Vincent Bousquet Date: Sat, 28 Dec 2024 09:39:13 +0100 Subject: [PATCH] Fix Whitestar fake GameOn solenoid being constantly toggled Fix https://github.com/vpinball/pinmame/issues/398 --- src/wpc/se.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wpc/se.c b/src/wpc/se.c index 1d4e6d2b8..761740b91 100644 --- a/src/wpc/se.c +++ b/src/wpc/se.c @@ -299,7 +299,7 @@ static MACHINE_INIT(se3) { core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 80, 6 * 8, CORE_MODOUT_LED); coreGlobals.nSolenoids = CORE_FIRSTCUSTSOL - 1 + core_gameData->hw.custSol; core_set_pwm_output_type(CORE_MODOUT_SOL0, coreGlobals.nSolenoids, CORE_MODOUT_SOL_2_STATE); - core_set_pwm_output_type(CORE_MODOUT_SOL0 + 15 - 1, 1, CORE_MODOUT_PULSE); // Fake solenoids for fast flip + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 15 - 1, 2, CORE_MODOUT_PULSE); // Fake solenoids for fast flip coreGlobals.nGI = 1; core_set_pwm_output_type(CORE_MODOUT_GI0, coreGlobals.nGI, CORE_MODOUT_BULB_44_5_7V_AC); const struct GameDriver* rootDrv = Machine->gamedrv; @@ -417,7 +417,7 @@ static MACHINE_INIT(se) { core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 80, 6 * 8, CORE_MODOUT_LED); coreGlobals.nSolenoids = CORE_FIRSTCUSTSOL - 1 + core_gameData->hw.custSol; core_set_pwm_output_type(CORE_MODOUT_SOL0, coreGlobals.nSolenoids, CORE_MODOUT_SOL_2_STATE); - core_set_pwm_output_type(CORE_MODOUT_SOL0 + 15 - 1, 1, CORE_MODOUT_PULSE); // Fake solenoids for fast flip + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 15 - 1, 2, CORE_MODOUT_PULSE); // Fake solenoids for fast flip coreGlobals.nGI = 1; core_set_pwm_output_type(CORE_MODOUT_GI0, coreGlobals.nGI, CORE_MODOUT_BULB_44_5_7V_AC); // Game specific hardware @@ -638,12 +638,16 @@ static READ_HANDLER(dip_r) { return ~core_getDip(0); } /*-- Solenoids --*/ static const int solmaskno[] = { 8, 0, 16, 24 }; static WRITE_HANDLER(solenoid_w) { - core_write_pwm_output_8b(CORE_MODOUT_SOL0 + solmaskno[offset], data); UINT32 mask = ~(0xff<>7) | ((data & 0x40)>>4); sols &= 0xffff3fff; /* mask off flipper solenoids */ + core_write_masked_pwm_output_8b(CORE_MODOUT_SOL0 + solmaskno[offset], data, 0x3F); + } + else + { + core_write_pwm_output_8b(CORE_MODOUT_SOL0 + solmaskno[offset], data); } coreGlobals.pulsedSolState = (coreGlobals.pulsedSolState & mask) | sols; selocals.solenoids |= sols;