From 6c9c8e7f82dbce7c3abad95eb0eaa92024f03cdc Mon Sep 17 00:00:00 2001 From: Vincent Bousquet Date: Tue, 30 Jan 2024 21:32:39 +0100 Subject: [PATCH 1/2] PWM: more tables --- release/whatsnew.txt | 2 +- src/wpc/s11.c | 102 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/release/whatsnew.txt b/release/whatsnew.txt index 30e7bcc33..6065b98ee 100644 --- a/release/whatsnew.txt +++ b/release/whatsnew.txt @@ -29,7 +29,7 @@ Fix Capcom crashes in 64bit builds Fix some external DMD alphanumeric mappings: GTS80B, GTS3, Hankin, Police Force, Riverboat Gambler, Algar, Alien Poker and 7 digit variants of Firepower -Added the emulation of physical bulbs & LEDs connected to binary outputs, for WPC, GTS3, SAM, Whitestar, Capcom and S11 hardware. +Added the emulation of physical bulbs & LEDs connected to binary outputs, for WPC, GTS3, SAM, Whitestar, Capcom, S9 and S11 hardware. This allows to dramatically improve e.g. lamp or flasher modulation (for example the pulsing lights below the princess of TOTAN, or the Sauron eye of LOTR, or slowly fading lamps in Breakshot). This needs to be enabled before use, the same way as for the existing 'modulated' solenoids: by setting SolMask(2) to 1 for legacy modulated solenoids or 2 for physical model of all outputs. diff --git a/src/wpc/s11.c b/src/wpc/s11.c index 6477ce323..6b5f539ad 100644 --- a/src/wpc/s11.c +++ b/src/wpc/s11.c @@ -811,8 +811,27 @@ static MACHINE_INIT(s11) { while (rootDrv->clone_of && (rootDrv->clone_of->flags & NOT_A_DRIVER) == 0) rootDrv = rootDrv->clone_of; const char* const gn = rootDrv->name; + // Williams S9 + if (strncasecmp(gn, "comet_l5", 8) == 0) { // Comet + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 3 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 7 - 1, 3, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 13 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output + } + else if (strncasecmp(gn, "sorcr_l2", 8) == 0) { // Sorcerer + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 5 - 1, 3, CORE_MODOUT_BULB_89_25V_DC_S11); + // Wired to a relay in the schematics, Labeled as "Flash eyes (cabinet)" but also as "Flipper Enable Relay" in the manual => left as is for the time being + //core_set_pwm_output_type(CORE_MODOUT_SOL0 + 8 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // GI output + } + else if (strncasecmp(gn, "sshtl_l7", 8) == 0) { // Space Shuttle + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 14 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + } + // Williams S11 - if (strncasecmp(gn, "bbnny_l2", 8) == 0) { // Bugs Bunny's Birthday Ball + else if (strncasecmp(gn, "bbnny_l2", 8) == 0) { // Bugs Bunny's Birthday Ball core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) @@ -823,6 +842,13 @@ static MACHINE_INIT(s11) { core_set_pwm_output_type(CORE_MODOUT_SOL0 + 14 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) } + else if (strncasecmp(gn, "bguns_l8", 8) == 0) { // Big Guns + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Left Playfield GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Right Playfield GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 15 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) + } else if (strncasecmp(gn, "bk2k_l4", 7) == 0) { // Black Knight 2000 core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Upper Playfield GI output @@ -870,6 +896,25 @@ static MACHINE_INIT(s11) { core_set_pwm_output_type(CORE_MODOUT_SOL0 + 15 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) } + else if (strncasecmp(gn, "f14_l1", 6) == 0) { // F14 + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 15 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) + } + else if (strncasecmp(gn, "fire_l3", 7) == 0) { // Fire + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 14 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 4, CORE_MODOUT_BULB_89_25V_DC_S11); // 4 muxed flasher outputs (Mux relay is solenoid #12) + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 30 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); // 2 muxed flasher outputs (Mux relay is solenoid #12) + } + else if (strncasecmp(gn, "grand_l4", 8) == 0) { // Grand Lizard + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 6 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 12 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); + } else if (strncasecmp(gn, "gs_lu4", 6) == 0) { // Gameshow core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); @@ -877,6 +922,14 @@ static MACHINE_INIT(s11) { core_set_pwm_output_type(CORE_MODOUT_SOL0 + 16 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) } + else if (strncasecmp(gn, "hs_l4", 5) == 0) { // High Speed + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 4 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); // In fact, this is a relay controlling police light which is a #1628 28V bulb + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 5 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 12 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 22 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + } else if (strncasecmp(gn, "jokrz_l6", 8) == 0) { // Jokerz core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield & Backbox GI output @@ -884,12 +937,25 @@ static MACHINE_INIT(s11) { core_set_pwm_output_type(CORE_MODOUT_SOL0 + 22 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) } + else if (strncasecmp(gn, "milln_l3", 8) == 0) { // Millionaire + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); // 2 muxed flasher outputs (Mux relay is solenoid #12) + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 28 - 1, 5, CORE_MODOUT_BULB_89_25V_DC_S11); // 5 muxed flasher outputs (Mux relay is solenoid #12) + } else if (strncasecmp(gn, "mousn_l4", 8) == 0) { // Mousin' Around! core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output core_set_pwm_output_type(CORE_MODOUT_SOL0 + 15 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) } + else if (strncasecmp(gn, "pb_l5", 5) == 0) { // Pinbot + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 15 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 18 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); // Aux board + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 26 - 1, 7, CORE_MODOUT_BULB_89_25V_DC_S11); // 7 muxed flasher outputs (Mux relay is solenoid #12) + } else if (strncasecmp(gn, "polic_l4", 8) == 0) { // Police Force core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output @@ -911,6 +977,40 @@ static MACHINE_INIT(s11) { core_set_pwm_output_type(CORE_MODOUT_SOL0 + 16 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) } + else if (strncasecmp(gn, "rollr_l2", 8) == 0) { // Rollergames + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 16 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) + } + else if (strncasecmp(gn, "rvrbt_l3", 8) == 0) { // Riverboat Gambler + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 16 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) + } + else if (strncasecmp(gn, "rdkng_l4", 8) == 0) { // Road King + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 5 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 7 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 14 - 1, 2, CORE_MODOUT_BULB_89_25V_DC_S11); + } + else if (strncasecmp(gn, "spstn_l5", 8) == 0) { // Space Station + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 15 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 7, CORE_MODOUT_BULB_89_25V_DC_S11); // 7 muxed flasher outputs (Mux relay is solenoid #12) + } + else if (strncasecmp(gn, "swrds_l2", 8) == 0) { // Swords of Fury + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 9 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // GI output + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_89_25V_DC_S11); + core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_BULB_89_25V_DC_S11); // 8 muxed flasher outputs (Mux relay is solenoid #12) + } else if (strncasecmp(gn, "taxi_l4", 7) == 0) { // Taxi core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Backbox GI output core_set_pwm_output_type(CORE_MODOUT_SOL0 + 11 - 1, 1, CORE_MODOUT_BULB_44_6_3V_AC); // Playfield GI output From 4e6599f79f5ef499076f4c50a96ffa3ceca11395 Mon Sep 17 00:00:00 2001 From: Vincent Bousquet Date: Tue, 30 Jan 2024 22:09:05 +0100 Subject: [PATCH 2/2] PWM: fix BOP chase light --- src/wpc/sims/wpc/full/bop.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wpc/sims/wpc/full/bop.c b/src/wpc/sims/wpc/full/bop.c index 8d4d2b361..503589264 100644 --- a/src/wpc/sims/wpc/full/bop.c +++ b/src/wpc/sims/wpc/full/bop.c @@ -711,23 +711,23 @@ static int bop_getMech(int mechNo) { static WRITE_HANDLER(parallel_0_out) { coreGlobals.tmpLampMatrix[8] = data ^ 0xff; - core_write_pwm_output_8b(CORE_MODOUT_LAMP0 + 8 * 8, data ^ 0xff); } static WRITE_HANDLER(parallel_1_out) { coreGlobals.tmpLampMatrix[9] = data ^ 0xff; - core_write_pwm_output_8b(CORE_MODOUT_LAMP0 + 9 * 8, data ^ 0xff); } static WRITE_HANDLER(bop_wpc_w) { static UINT16 prev[64], lamps; int i; wpc_w(offset, data); - if (offset == WPC_SOLENOID1 && (data & 3)) { + if (offset == WPC_SOLENOID1) { if (GET_BIT1) { lamps <<= 1; - } - if (GET_BIT0) { - lamps |= 1; + if (GET_BIT0) { + lamps |= 1; + } + core_write_pwm_output_8b(CORE_MODOUT_LAMP0 + 8 * 8, lamps); + core_write_pwm_output_8b(CORE_MODOUT_LAMP0 + 9 * 8, lamps >> 8); } } for (i = 0; i < 64; i++) {