From 7e99dce6cad75d29840e0c5de8b608fe664bf17c Mon Sep 17 00:00:00 2001 From: Vincent Bousquet Date: Fri, 27 Dec 2024 23:36:08 +0100 Subject: [PATCH] GTS3: fix dimmed segment of additional displays (Hoops, Andretti, ...) --- src/wpc/gts3.c | 51 ++++++++++++++++++++++++++++++++------------------ src/wpc/sam.c | 9 +++------ 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/src/wpc/gts3.c b/src/wpc/gts3.c index 42d418cca..d488c5521 100644 --- a/src/wpc/gts3.c +++ b/src/wpc/gts3.c @@ -279,25 +279,40 @@ static WRITE_HANDLER( xvia_1_a_w ) AX4 = Latch the Data (set by aux write handler) */ static WRITE_HANDLER( xvia_1_b_w ) { - // FIXME this looks somewhat wrong to me: I think the 6522 VIA is supposed to latch the data on its programmable inpout/output parallel port, - // then the CPU trigger AX4/5/6 for the aux board to handle it. Here we are doing the opposite if (GTS3locals.extra16led) { // used for the 3 playfield alpha digit displays on Vegas only // TODO implement full aux board logic if (data > 0 && data < 4 && GTS3locals.ax[4] == GTS3locals.ax[6]) - coreGlobals.segments[39 + data].w = (GTS3locals.ax[6] & 0x3f) - | ((GTS3locals.ax[6] & 0xc0) << 3) - | ((GTS3locals.ax[5] & 0x0f) << 11) - | ((GTS3locals.ax[5] & 0x10) << 2) - | ((GTS3locals.ax[5] & 0x20) << 3); + { + core_tWord val; + val.w = (GTS3locals.ax[6] & 0x3f) + | ((GTS3locals.ax[6] & 0xc0) << 3) + | ((GTS3locals.ax[5] & 0x0f) << 11) + | ((GTS3locals.ax[5] & 0x10) << 2) + | ((GTS3locals.ax[5] & 0x20) << 3); + coreGlobals.segments[39 + data].w = val.w; + for (int i = 1; i < 4; i++) + { + core_write_pwm_output_8b(CORE_MODOUT_SEG0 + (39 + i) * 16, i == data ? val.b.lo : 0); + core_write_pwm_output_8b(CORE_MODOUT_SEG0 + (39 + i) * 16 + 8, i == data ? val.b.hi : 0); + } + } } else if (core_gameData->hw.lampCol > 4) { // flashers drived by auxiliary board (for example backbox lights in SF2) // FIXME From the schematics, I would say that the latch only happens if ax[4] is raised up (not checked here) coreGlobals.lampMatrix[12] = coreGlobals.tmpLampMatrix[12] = data; core_write_pwm_output_8b(CORE_MODOUT_LAMP0 + 12 * 8, data); } else if (!(GTS3locals.ax[4] & 1)) { // LEDs if (GTS3locals.alphagen) + { coreGlobals.segments[40 + (data >> 4)].w = core_bcd2seg[data & 0x0f]; + for (int i = 0; i < 12; i++) + core_write_pwm_output_8b(CORE_MODOUT_SEG0 + (40 + i) * 16, i == (data >> 4) ? core_bcd2seg[data & 0x0f] : 0); + } else + { coreGlobals.segments[data >> 4].w = core_bcd2seg[data & 0x0f]; + for (int i = 0; i < 12; i++) + core_write_pwm_output_8b(CORE_MODOUT_SEG0 + i * 16, i == (data >> 4) ? core_bcd2seg[data & 0x0f] : 0); + } } } @@ -509,15 +524,15 @@ static void GTS3_alpha_common_init(void) { else if (strncasecmp(gn, "deadweap", 8) == 0) { // Deadly Weapon coreGlobals.nAlphaSegs = 20 * 16 * 2 + 8 * 16; core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10, 15, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield & Backbox flashers - for (int i = 0; i < 8; i++) // TODO check strobe timings for LED power - core_set_pwm_output_type(CORE_MODOUT_SEG0 + 20 * 16 * 2 + i * 16, 7, CORE_MODOUT_VFD_STROBE_05_20MS); // Additional VFD display + for (int i = 0; i < 8; i++) + core_set_pwm_output_type(CORE_MODOUT_SEG0 + 20 * 16 * 2 + i * 16, 7, CORE_MODOUT_LED_STROBE_1_10MS); // Additional LED display (1ms strobe over 8ms period) } else if (strncasecmp(gn, "hoops", 5) == 0) { // Hoops coreGlobals.nAlphaSegs = 20 * 16 * 2 + 12 * 16; core_set_pwm_output_type(CORE_MODOUT_SOL0 + 8, 6, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield & Backbox flashers core_set_pwm_output_type(CORE_MODOUT_SOL0 + 16, 6, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield & Backbox flashers - for (int i = 0; i < 12; i++) // TODO check strobe timings for LED power - core_set_pwm_output_type(CORE_MODOUT_SEG0 + 20 * 16 * 2 + i * 16, 7, CORE_MODOUT_VFD_STROBE_05_20MS); // Additional VFD display + for (int i = 0; i < 12; i++) + core_set_pwm_output_type(CORE_MODOUT_SEG0 + 20 * 16 * 2 + i * 16, 7, CORE_MODOUT_LED_STROBE_1_10MS); // Additional LED display (1ms strobe over 12ms period) } else if (strncasecmp(gn, "lca", 3) == 0) { // Light Camera Action core_set_pwm_output_type(CORE_MODOUT_SOL0 + 17, 6, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield & Backbox flashers @@ -532,8 +547,8 @@ static void GTS3_alpha_common_init(void) { } else if (strncasecmp(gn, "silvslug", 8) == 0) { // Silver Slugger core_set_pwm_output_type(CORE_MODOUT_SOL0 + 8, 15, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield & Backbox flashers - for (int i = 0; i < 12; i++) // TODO check strobe timings for LED power - core_set_pwm_output_type(CORE_MODOUT_SEG0 + 20 * 16 * 2 + i * 16, 7, CORE_MODOUT_VFD_STROBE_05_20MS); // Additional VFD display + for (int i = 0; i < 12; i++) + core_set_pwm_output_type(CORE_MODOUT_SEG0 + 20 * 16 * 2 + i * 16, 7, CORE_MODOUT_LED_STROBE_1_10MS); // Additional LED display (1ms strobe over 8ms period) } else if (strncasecmp(gn, "surfnsaf", 8) == 0) { // Surf'n Safari core_set_pwm_output_type(CORE_MODOUT_SOL0 + 10, 15, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield & Backbox flashers @@ -548,7 +563,7 @@ static void GTS3_alpha_common_init(void) { else if (strncasecmp(gn, "vegas", 5) == 0) { // Vegas coreGlobals.nAlphaSegs = 20 * 16 * 2 + 3 * 16; core_set_pwm_output_type(CORE_MODOUT_SOL0 + 7, 18, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield & Backbox flashers - core_set_pwm_output_type(CORE_MODOUT_SEG0 + 20 * 16 * 2, 3 * 16, CORE_MODOUT_VFD_STROBE_05_20MS); // Additional VFD display + core_set_pwm_output_type(CORE_MODOUT_SEG0 + 20 * 16 * 2, 3 * 16, CORE_MODOUT_LED_STROBE_1_5MS); // Additional LED display (1ms strobe over 3ms period) } } @@ -629,8 +644,8 @@ static void gts3dmd_init(void) { if (strncasecmp(gn, "andretti", 8) == 0) { // Mario Andretti core_set_pwm_output_type(CORE_MODOUT_SOL0 + 19, 6, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield & Backbox flashers coreGlobals.nAlphaSegs = 6 * 16; - for (int i = 0; i < 6; i++) // TODO check strobe timings for LED power - core_set_pwm_output_type(CORE_MODOUT_SEG0 + i * 16, 7, CORE_MODOUT_VFD_STROBE_05_20MS); // Additional VFD display + for (int i = 0; i < 6; i++) + core_set_pwm_output_type(CORE_MODOUT_SEG0 + i * 16, 7, CORE_MODOUT_LED_STROBE_1_10MS); // Additional LED display (1ms strobe over 8ms period) } else if (strncasecmp(gn, "barbwire", 8) == 0) { // Barbwire core_set_pwm_output_type(CORE_MODOUT_SOL0 + 13, 2, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield & Backbox flashers @@ -667,8 +682,8 @@ static void gts3dmd_init(void) { else if (strncasecmp(gn, "shaqattq", 8) == 0) { // Shaq Attaq core_set_pwm_output_type(CORE_MODOUT_SOL0 + 12, 10, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield flashers coreGlobals.nAlphaSegs = 12 * 16; - for (int i = 0; i < 12; i++) // TODO check strobe timings for LED power - core_set_pwm_output_type(CORE_MODOUT_SEG0 + i * 16, 7, CORE_MODOUT_VFD_STROBE_05_20MS); // Additional VFD display + for (int i = 0; i < 12; i++) + core_set_pwm_output_type(CORE_MODOUT_SEG0 + i * 16, 7, CORE_MODOUT_LED_STROBE_1_10MS); // Additional LED display (1ms strobe over 12ms period) } else if (strncasecmp(gn, "smbmush", 7) == 0) { // Super Mario Bros. Mushroom World core_set_pwm_output_type(CORE_MODOUT_SOL0 + 20, 3, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield flashers diff --git a/src/wpc/sam.c b/src/wpc/sam.c index 47c698bb1..11312b5b9 100644 --- a/src/wpc/sam.c +++ b/src/wpc/sam.c @@ -138,8 +138,6 @@ struct { UINT16 value; INT16 bank; - data8_t tmp_leds[SAM_LED_MAX_STRING_LENGTH]; // gather the serial data for the LEDs board - // IO Board: int lampcol; int lamprow; @@ -943,7 +941,7 @@ static WRITE32_HANDLER(sambank_w) samlocals.latchB = (samlocals.latchA & 0x7F); samlocals.latchA = samlocals.auxdata; } - for (int row = 0; row < 10; row++) { + for (int row = 0; row < 10; row++) { // 2 rows of 7 LED matrix, each matrix being 7 cols x 5 rows (so 10 rows, 49 cols) int r = ((samlocals.latchA & 0x80) || (~data & 0x80)) ? 0 : (samlocals.col & (1 << row)); int c = CORE_MODOUT_LAMP0 + 10 * 8 + 49 * row; core_write_pwm_output(c , 7, r ? (core_revbyte((UINT8)samlocals.latchH) >> 1) : 0); @@ -1437,13 +1435,12 @@ static MACHINE_INIT(sam) { core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 8, CORE_MODOUT_LED); // 4 LED flasher at the back of the wheel } else if (strncasecmp(gn, "wpt_", 4) == 0) { // World Poker Tour - core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 80, 490, CORE_MODOUT_LED); // Mini DMD (490 LEDs, but are they really faded ?) core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 62 - 1, 1, CORE_MODOUT_LED_STROBE_1_10MS); // Bumper LED core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 70 - 1, 1, CORE_MODOUT_LED_STROBE_1_10MS); // Bumper LED core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 78 - 1, 1, CORE_MODOUT_LED_STROBE_1_10MS); // Bumper LED core_set_pwm_output_type(CORE_MODOUT_SOL0 + 22 - 1, 2, CORE_MODOUT_BULB_89_20V_DC_WPC); core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 7, CORE_MODOUT_BULB_89_20V_DC_WPC); - core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 80 - 1, 49 * 10, CORE_MODOUT_LED_STROBE_1_10MS); // 14 Block LED (actually 2ms strobe every 20ms) + core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 80 - 1, 49 * 10, CORE_MODOUT_LED_STROBE_1_10MS); // 14 Block LED (actually 2ms strobe every 20ms, but are they really faded ?) } else if (strncasecmp(gn, "xmn_", 4) == 0) { // X-Men core_set_pwm_output_type(CORE_MODOUT_LAMP0, 80, CORE_MODOUT_LED_STROBE_1_10MS); // All LED (Looks nicer with bulbs, but it really has LEDs) @@ -2385,7 +2382,7 @@ CORE_CLONEDEF(sam1_flashb, 0230, 0310, "S.A.M. System Flash Boot (V2.3)", 2007, /*------------------------------------------------------------------- / World Poker Tour /-------------------------------------------------------------------*/ -INITGAME(wpt, GEN_SAM, sammini1_dmd128x32, SAM_2COL + 62, SAM_GAME_WPT) // 62 additinal columns for Mini DMD (5*7 displays * 14) +INITGAME(wpt, GEN_SAM, sammini1_dmd128x32, SAM_2COL + 60, SAM_GAME_WPT) // 62 additinal columns for Mini DMD (5*7 displays * 14) SAM1_ROM32MB(wpt_103a, "wpt_103a.bin", CRC(cd5f80bc) SHA1(4aaab2bf6b744e1a3c3509dc9dd2416ff3320cdb), 0x019bb1dc)