Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWM: better backward compatibility for drivers using FORCE_ON #355

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/wpc/capcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,15 @@ static MACHINE_INIT(cc) {
coreGlobals.flipperCoils = 0xFFFFFFFFFFFF0908ull;
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 21 - 1, 11, CORE_MODOUT_BULB_89_20V_DC_WPC);
}
// Defaults to 2 state legacy integrator for better backward compatibility
if ((options.usemodsol & (CORE_MODOUT_ENABLE_PHYSOUT_SOLENOIDS | CORE_MODOUT_ENABLE_MODSOL)) == 0)
for (int i = 0; i < coreGlobals.nSolenoids; i++)
if (coreGlobals.physicOutputState[i].type != CORE_MODOUT_SOL_2_STATE)
core_set_pwm_output_type(CORE_MODOUT_SOL0, 1, CORE_MODOUT_LEGACY_SOL_2_STATE);
if ((options.usemodsol & CORE_MODOUT_ENABLE_PHYSOUT_LAMPS) == 0)
core_set_pwm_output_type(CORE_MODOUT_LAMP0, 80 /*coreGlobals.nLamps*/, CORE_MODOUT_LEGACY_SOL_2_STATE);
if ((options.usemodsol & CORE_MODOUT_ENABLE_PHYSOUT_GI) == 0)
core_set_pwm_output_type(CORE_MODOUT_GI0, coreGlobals.nGI, CORE_MODOUT_LEGACY_SOL_2_STATE);

//Init soundboard
sndbrd_0_init(core_gameData->hw.soundBoard, CAPCOMS_CPUNO, memory_region(CAPCOMS_ROMREGION),NULL,NULL);
Expand Down
9 changes: 9 additions & 0 deletions src/wpc/sam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,15 @@ static MACHINE_INIT(sam) {
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 25 - 1, 1, CORE_MODOUT_BULB_89_20V_DC_WPC);
core_set_pwm_output_type(CORE_MODOUT_SOL0 + 28 - 1, 5, CORE_MODOUT_BULB_89_20V_DC_WPC);
}
// Defaults to 2 state legacy integrator for better backward compatibility
if ((options.usemodsol & (CORE_MODOUT_ENABLE_PHYSOUT_SOLENOIDS | CORE_MODOUT_ENABLE_MODSOL)) == 0)
for (int i = 0; i < coreGlobals.nSolenoids; i++)
if (coreGlobals.physicOutputState[i].type != CORE_MODOUT_SOL_2_STATE)
core_set_pwm_output_type(CORE_MODOUT_SOL0, 1, CORE_MODOUT_LEGACY_SOL_2_STATE);
if ((options.usemodsol & CORE_MODOUT_ENABLE_PHYSOUT_LAMPS) == 0)
core_set_pwm_output_type(CORE_MODOUT_LAMP0, 80 /*coreGlobals.nLamps*/, CORE_MODOUT_LEGACY_SOL_2_STATE);
if ((options.usemodsol & CORE_MODOUT_ENABLE_PHYSOUT_GI) == 0)
core_set_pwm_output_type(CORE_MODOUT_GI0, coreGlobals.nGI, CORE_MODOUT_LEGACY_SOL_2_STATE);
}

void sam_init(void)
Expand Down
Loading