Skip to content

Commit

Permalink
fix PWM path for Super Mario Bros. Mushroom World, and generalize cor…
Browse files Browse the repository at this point in the history
…rect PWM path for more variants/clones
  • Loading branch information
toxieainc committed Sep 3, 2024
1 parent e8571cc commit 4bacf1e
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 161 deletions.
12 changes: 6 additions & 6 deletions src/wpc/capcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,30 +736,30 @@ static MACHINE_INIT(cc) {
const char* const gn = rootDrv->name;
// For flashers, Capcom uses #89 bulb wired through a STP20N10L Mosfet, 0.02 ohms resistor to a 20V DC source
// which is very similar to what Williams uses on WPC hardware, so just uses CORE_MODOUT_BULB_89_20V_DC_WPC
if (strncasecmp(gn, "abv106", 6) == 0) { // Airborne
if (strncasecmp(gn, "abv", 3) == 0) { // Airborne
coreGlobals.flipperCoils = 0xFFFFFFFFFFFF0908ull;
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 20 - 1, 8, CORE_MODOUT_BULB_89_20V_DC_WPC);
}
else if (strncasecmp(gn, "bbb109", 6) == 0) { // Big Bang Bar
else if (strncasecmp(gn, "bbb", 3) == 0) { // Big Bang Bar
coreGlobals.flipperCoils = 0xFFFFFFFFFF0A0908ull;
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 21 - 1, 6, CORE_MODOUT_BULB_89_20V_DC_WPC);
}
else if (strncasecmp(gn, "bsv103", 6) == 0) { // Breakshot
else if (strncasecmp(gn, "bsv", 3) == 0) { // Breakshot
coreGlobals.flipperCoils = 0xFFFFFFFFFF0A0908ull;
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 28 - 1, 5, CORE_MODOUT_BULB_89_20V_DC_WPC); // Center pocket Flasher
// core_set_pwm_output_type(CORE_MODOUT_SOL0 + 27 - 1, 5, CORE_MODOUT_BULB_89_20V_DC_WPC); // Plunger Flasher (appears in doc but was not kept in production)
}
else if (strncasecmp(gn, "ffv104", 6) == 0) { // Flipper Football
else if (strncasecmp(gn, "ffv", 3) == 0) { // Flipper Football
coreGlobals.flipperCoils = 0xFFFFFFFF0B0A0908ull;
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 28 - 1, 5, CORE_MODOUT_BULB_89_20V_DC_WPC);
}
else if (strncasecmp(gn, "kpb105", 6) == 0) { // KingPin
else if (strncasecmp(gn, "kpb", 3) == 0) { // KingPin
// To be checked since this is from VPX table (did not find a manual for this one)
coreGlobals.flipperCoils = 0xFFFFFFFFFFFF0908ull;
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 18 - 1, 2, CORE_MODOUT_BULB_89_20V_DC_WPC);
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 21 - 1, 11, CORE_MODOUT_BULB_89_20V_DC_WPC);
}
else if (strncasecmp(gn, "pmv112", 6) == 0) { // Pinball Magic
else if (strncasecmp(gn, "pmv", 3) == 0) { // Pinball Magic
coreGlobals.flipperCoils = 0xFFFFFFFFFFFF0908ull;
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 21 - 1, 11, CORE_MODOUT_BULB_89_20V_DC_WPC);
}
Expand Down
16 changes: 8 additions & 8 deletions src/wpc/dedmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ static void dmd32_init(struct sndbrdData *brdData) {
/* copy last 16K of ROM into last 16K of CPU region*/
memcpy(memory_region(DE_DMD32CPUREGION) + 0x8000,
memory_region(DE_DMD32ROMREGION) + memory_region_length(DE_DMD32ROMREGION)-0x8000,0x8000);

// Init 6845
crtc6845_init(0);
//crtc6845_set_vsync(0, /* 8000000 from 6809 E clock output */, dmd32_vblank); // we can not use the default implementation as the clock divider is toggled after each HSYNC
// The theory of operation given above would lead to a refresh rate of 80.1Hz (half of the frame with a CRTC6845 clocked at 1MHz, the other half at 500KHz)
// Measures on the real hardware shows that a few additional cycles are consumed while switching clock divider, this behavior having changed between initial revision (Data East)
// Measures on the real hardware show that a few additional cycles are consumed while switching clock divider, this behavior having changed between initial revision (Data East)
// and later ones (Sega/Stern Whitestar).
if ((core_gameData->gen & GEN_DEDMD32) != 0) // Board 520-5055-00
{
Expand All @@ -135,11 +135,11 @@ static void dmd32_init(struct sndbrdData *brdData) {
while (rootDrv->clone_of && (rootDrv->clone_of->flags & NOT_A_DRIVER) == 0)
rootDrv = rootDrv->clone_of;
const char* const gn = rootDrv->name;
if ((strncasecmp(gn, "stwr_104", 8) == 0) // Star Wars
|| (strncasecmp(gn, "rab_320", 7) == 0) // Adventures of Rocky and Bullwinkle and Friends
|| (strncasecmp(gn, "aar_101", 7) == 0) // Aaron Spelling
|| (strncasecmp(gn, "lw3_208", 7) == 0) // Lethal Weapon 3
|| (strncasecmp(gn, "mj_130", 6) == 0)) // Michael Jordan
if ((strncasecmp(gn, "stwr_", 5) == 0) // Star Wars
|| (strncasecmp(gn, "rab_", 4) == 0) // Adventures of Rocky and Bullwinkle and Friends
|| (strncasecmp(gn, "aar_", 4) == 0) // Aaron Spelling
|| (strncasecmp(gn, "lw3_", 4) == 0) // Lethal Weapon 3
|| (strncasecmp(gn, "mj_", 3) == 0)) // Michael Jordan
timer_pulse(1. / 86.20689655172414, 0, dmd32_vblank);
else
// Measured at 78.07Hz for the 3 PWM frames (234.21Hz fps)
Expand Down Expand Up @@ -360,7 +360,7 @@ static READ_HANDLER(dmd16_port_r);
static WRITE_HANDLER(dmd16_port_w);

static MEMORY_READ_START(dmd16_readmem)
{ 0x0000, 0x3fff, MRA_ROM }, /* Z80 ROM CODE*/
{ 0x0000, 0x3fff, MRA_ROM }, /* Z80 ROM CODE*/
{ 0x4000, 0x7fff, MRA_BANKNO(DMD16_BANK0) }, /* ROM BANK*/
{ 0x8000, 0x9fff, MRA_RAM },
MEMORY_END
Expand Down
14 changes: 7 additions & 7 deletions src/wpc/gts3.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//Cueball: CPU0: RST = FEF0, IRQ=462F, NMI=477A
GV 07/20/05: Finally found the typo that prevented the extra displays from working perfectly!
GV 07/27/05: Fixed the missing sound in Strikes And Spares
GV 07/27/05: Fixed the missing sound in Strikes N Spares
SE 07/27/05: Finally got that DAMN 2nd DMD working
*************************************************************************************************/
Expand All @@ -29,7 +29,7 @@
#define GTS3_IRQFREQ 1500 /* IRQ Frequency (Guessed) */
#define GTS3_ALPHANMIFREQ 1000 /* Alpha NMI Frequency (Guessed)*/

#define GTS3_CPUNO 0
#define GTS3_CPUNO 0
#define GTS3_DCPUNO 1
#define GTS3_SCPUNO 2
#define GTS3_DCPUNO2 2
Expand Down Expand Up @@ -672,16 +672,16 @@ static void gts3dmd_init(void) {
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
}
else if (strncasecmp(gn, "smb", 3) == 0) { // Super Mario Bros.
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 12, 12, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield flashers
core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 0 * 8 + 1, 7, CORE_MODOUT_LED_STROBE_1_10MS); // 7 Castle LEDs
core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 8 * 8 + 1, 7, CORE_MODOUT_LED_STROBE_1_10MS); // 7 Billboard LEDs
}
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
core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 12 * 8, 8, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Flashers from aux board
core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 0 * 8 + 1, 7, CORE_MODOUT_LED_STROBE_1_10MS); // 7 Wand LEDs
}
else if (strncasecmp(gn, "smb", 3) == 0) { // Super Mario Bros.
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 12, 12, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Playfield flashers
core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 0 * 8 + 1, 7, CORE_MODOUT_LED_STROBE_1_10MS); // 7 Castle LEDs
core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 8 * 8 + 1, 7, CORE_MODOUT_LED_STROBE_1_10MS); // 7 Billboard LEDs
}
else if (strncasecmp(gn, "stargate", 8) == 0) { // Stargate
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 21, 1, CORE_MODOUT_LED); // 'Rope Lights', circle of leds around Ra in backbox
core_set_pwm_output_type(CORE_MODOUT_LAMP0 + 12 * 8, 8, CORE_MODOUT_BULB_89_20V_DC_GTS3); // Flashers from aux board
Expand Down
Loading

0 comments on commit 4bacf1e

Please sign in to comment.