From c98003f3096b0cda4749f93b0389456b38ccdee5 Mon Sep 17 00:00:00 2001 From: Vincent Bousquet Date: Sun, 5 Jan 2025 17:53:40 +0100 Subject: [PATCH] Fix Elvis/Monopoly flipper, SAM cleanups, bug list update --- docs/dmd.md | 4 ++-- release/bugs.txt | 10 ++++++---- src/wpc/sam.c | 25 ++++++++++++++----------- src/wpc/se.c | 18 +++++++++--------- src/wpc/sims/se/prelim/elvis.c | 17 +++++------------ src/wpc/sims/se/prelim/monopoly.c | 13 +++---------- 6 files changed, 39 insertions(+), 48 deletions(-) diff --git a/docs/dmd.md b/docs/dmd.md index a119296cc..55e1b937d 100644 --- a/docs/dmd.md +++ b/docs/dmd.md @@ -34,8 +34,8 @@ The table below gives the main information (PWM FPS / Display FPS / PWM pattern) |[WPC](#wpc) | **122.1** / 61.1-40.7 | 2/3 frames | | |[WPC Phantom Haus](#wpc) | 61.05 / 30.1 | 2 frames | | |[Data East 128x16](#data-east-128x16) | 177.5 / **59.2** | 2u row | | -|[Data East 128x32](#data-east-128x32-segastern-whitestar) | 234.2 / **78.1** | 2u row | | -|Sega 192x64 | 224.2 / 74.73 | 2u row | | +|[Data East 128x32](#data-east-128x32-segastern-whitestar) | 234.2 / **78.1** | 2u row |Some machines exhibit slow startup | +|Sega 192x64 | 224.2 / 74.73 | 2u row |Title screen shows sometimes, likely due to timing issues | |Gottlieb GTS3 | **375.9** / 125.3-37.6 | 3/6/8/10 frames | | |[Alvin G. 1](#alvin-g) | 332.4 / 83.1 | 4 row |Still a little flicker on the title screen | |[Alvin G. 2](#alvin-g) | 298.6 / **74.6** | 4 row | | diff --git a/release/bugs.txt b/release/bugs.txt index 74bca1547..1ec762e85 100644 --- a/release/bugs.txt +++ b/release/bugs.txt @@ -19,7 +19,8 @@ Major bugs in PinMAME that we are aware of: (~24 and above, for example on Nascar and Grand Prix, or even ~20 on LOTR, so avoid this) This seems to happen on real machines (verified on 2 different Grand Prix pinballs), too. - #6) Data East/Sega/Stern/Gottlieb/Alvin G DMD timing is not 100% accurate for all machines. + #6) Some Data East have slow DMD startups (Star Wars,...), Sega 192x64 timing is not 100% accurate and + sometimes shows startup screen, Alvin G. has timings issues resulting in some flicker. #7) Sound gets cut off in Alvin G games sometimes, and some weird notes in World Tour occasionally. @@ -31,6 +32,7 @@ Major bugs in PinMAME that we are aware of: #10) Some setups crash when using the AT91 JIT compiled code (e.g. Whitestar II and SAM), disable AT91 JIT by setting "at91jit" to 0 in the registry. -#11) AT91 JIT is 32-bit and x86 only. The non-JIT core doesn't have tight IRQ timing, and that results in the SAM serial ports freezing - ("slow DMD/CPU disease" on SAM LE tables). It would be possible to tighten up the timing in the interpreted core, - but it causes a huge performance hit (have to keep checking on memory writes whether an IRQ needs to fire). +#11) AT91 JIT is 32-bit and x86 only. The non-JIT core doesn't have tight IRQ timing that may cause emulation issues. + It would be possible to tighten up the timing in the interpreted core, but it causes a huge performance hit + (have to keep checking on memory writes whether an IRQ needs to fire). + diff --git a/src/wpc/sam.c b/src/wpc/sam.c index 11312b5b9..6f0878411 100644 --- a/src/wpc/sam.c +++ b/src/wpc/sam.c @@ -139,8 +139,8 @@ struct { INT16 bank; // IO Board: - int lampcol; - int lamprow; + UINT16 lampcol; + UINT8 lamprow; UINT8 auxstrb; UINT8 auxdata; @@ -884,7 +884,7 @@ static WRITE32_HANDLER(sambank_w) break; case 0x02400029: // AUX_LMP samlocals.lampcol = (samlocals.lampcol & 0x00FF) | (data << 8); - core_write_pwm_output_lamp_matrix(CORE_MODOUT_LAMP0, samlocals.lampcol & 0x00FF, samlocals.lamprow, 8); + core_write_pwm_output_lamp_matrix(CORE_MODOUT_LAMP0, samlocals.lampcol & 0x00FF, samlocals.lamprow, 8); core_write_pwm_output_lamp_matrix(CORE_MODOUT_LAMP0 + 64, (samlocals.lampcol >> 8) & 0x0003, samlocals.lamprow, 2); break; case 0x0240002A: // LMP_DRV @@ -2246,22 +2246,25 @@ static PINMAME_VIDEO_UPDATE(samdmd_update) { // Little 5x7 led matrix used in World Poker Tour (2 rows of 7 each) static PINMAME_VIDEO_UPDATE(samminidmd_update) { - int ii,kk; const int dmd_x = (layout->left-10)/7; const int dmd_y = (layout->top-34)/9; + assert(layout->length == 5); + assert(layout->start == 7); + assert(0 <= dmd_x && dmd_x < 7); + assert(0 <= dmd_y && dmd_y < 2); for (int y = 0; y < 7; y++) for (int x = 0; x < 5; x++) { const int target = 10 * 8 + (dmd_y * 5 + x) * 49 + (dmd_x * 7 + y); const float v = coreGlobals.physicOutputState[CORE_MODOUT_LAMP0 + target].value; - coreGlobals.dmdDotRaw[y * layout->length + x] = SAT_NYB(v); - coreGlobals.dmdDotLum[y * layout->length + x] = SAT_BYTE(v); + coreGlobals.dmdDotRaw[y * 5 + x] = SAT_NYB(v); // TODO raw value should not be tied to the PWM integration + coreGlobals.dmdDotLum[y * 5 + x] = SAT_BYTE(v); } // Use the video update to output mini DMD as LED segments (somewhat hacky) - for (ii = 0; ii < 5; ii++) { + for (int x = 0; x < 5; x++) { int bits = 0; - for (kk = 0; kk < 7; kk++) - bits = (bits<<1) | (coreGlobals.dmdDotRaw[kk * layout->length + ii] ? 1 : 0); - coreGlobals.drawSeg[5*dmd_x + 35*dmd_y + ii] = bits; + for (int y = 0; y < 7; y++) + bits = (bits << 1) | (coreGlobals.dmdDotRaw[y * 5 + x] ? 1 : 0); + coreGlobals.drawSeg[35 * dmd_y + 5 * dmd_x + x] = bits; } if (!pmoptions.dmd_only) core_dmd_video_update(bitmap, cliprect, layout, NULL); @@ -2275,7 +2278,7 @@ static PINMAME_VIDEO_UPDATE(samminidmd2_update) { for (kk = 0; kk < 5; kk++) { const int target = 140 + jj + (kk * 35); const float v = coreGlobals.physicOutputState[CORE_MODOUT_LAMP0 + target].value; - coreGlobals.dmdDotRaw[kk * layout->length + jj] = SAT_NYB(v); + coreGlobals.dmdDotRaw[kk * layout->length + jj] = SAT_NYB(v); // TODO raw value should not be tied to the PWM integration coreGlobals.dmdDotLum[kk * layout->length + jj] = SAT_BYTE(v); } // Use the video update to output mini DMD as LED segments (somewhat hacky) diff --git a/src/wpc/se.c b/src/wpc/se.c index 761740b91..461d579d1 100644 --- a/src/wpc/se.c +++ b/src/wpc/se.c @@ -168,18 +168,18 @@ static INTERRUPT_GEN(se_vblank) { selocals.flipsol = selocals.flipsolPulse; } if ((selocals.vblankCount % (VBLANK*SE_SOLSMOOTH)) == 0) { - coreGlobals.solenoids = selocals.solenoids; - // Fast flips. Use Solenoid 15, this is the left flipper solenoid that is - // unused because it is remapped to VPM flipper constants. + coreGlobals.solenoids = selocals.solenoids; + // Fast flips. Use Solenoid 15, this is the left flipper solenoid that is + // unused because it is remapped to VPM flipper constants. if (selocals.fastflipaddr > 0 && memory_region(SE_CPUREGION)[selocals.fastflipaddr - 1] > 0) { - coreGlobals.solenoids |= 0x4000; - core_write_pwm_output(CORE_MODOUT_SOL0 + 15 - 1, 1, 1); + coreGlobals.solenoids |= 0x4000; + core_write_pwm_output(CORE_MODOUT_SOL0 + 15 - 1, 1, 1); } else { - core_write_pwm_output(CORE_MODOUT_SOL0 + 15 - 1, 1, 0); + core_write_pwm_output(CORE_MODOUT_SOL0 + 15 - 1, 1, 0); } - selocals.solenoids = coreGlobals.pulsedSolState; + selocals.solenoids = coreGlobals.pulsedSolState; #ifdef PROC_SUPPORT if (coreGlobals.p_rocEn) { static UINT64 lastSol = 0; @@ -637,7 +637,7 @@ static READ_HANDLER(dip_r) { return ~core_getDip(0); } /*-- Solenoids --*/ static const int solmaskno[] = { 8, 0, 16, 24 }; -static WRITE_HANDLER(solenoid_w) { +WRITE_HANDLER(se_solenoid_w) { UINT32 mask = ~(0xff<>7) | ((data & 0x40)>>4); - sols &= 0xffff3fff; /* mask off flipper solenoids */ - } - coreGlobals.pulsedSolState = (coreGlobals.pulsedSolState & mask) | sols; - selocals.solenoids |= sols; + se_solenoid_w(offset, data); + if (offset == 3) { int pos = data & 0x0f; - locals.legs = (data & 0x10) ? 1 : 0; - locals.arms = (data & 0x20) ? 1 : 0; + locals.legs = (data & 0x10) ? 1 : 0; + locals.arms = (data & 0x20) ? 1 : 0; if (pos) { if (locals.lastPos != pos) { if ((locals.lastPos == 0x0c && pos == 0x06) || (locals.lastPos == 0x06 && pos == 0x03) || (locals.lastPos == 0x03 && pos == 0x09) || (locals.lastPos == 0x09 && pos == 0x0c)) { diff --git a/src/wpc/sims/se/prelim/monopoly.c b/src/wpc/sims/se/prelim/monopoly.c index 2b5dc8396..bd4a8e084 100644 --- a/src/wpc/sims/se/prelim/monopoly.c +++ b/src/wpc/sims/se/prelim/monopoly.c @@ -517,17 +517,10 @@ static core_tGameData monopolyGameData = { }; /*-- Solenoids --*/ +extern WRITE_HANDLER(se_solenoid_w); static WRITE_HANDLER(monopoly_w) { - static const int solmaskno[] = { 8, 0, 16, 24 }; - core_write_pwm_output_8b(CORE_MODOUT_SOL0 + solmaskno[offset], data); - UINT32 mask = ~(0xff<>7) | ((data & 0x40)>>4); - sols &= 0xffff3fff; /* mask off flipper solenoids */ - } - coreGlobals.pulsedSolState = (coreGlobals.pulsedSolState & mask) | sols; - selocals.solenoids |= sols; + se_solenoid_w(offset, data); + if (offset == 3) { locals.flipperDir = ((data & 0x04) >> 1) - 1; // so +1 for cw, -1 for ccw if (data & 0x01) { // increase flipper speed if set