Skip to content

Commit

Permalink
nbaf: drain playfield balls when flippers off
Browse files Browse the repository at this point in the history
On WPC games, solenoid 31 indicates whether the flippers are enabled or
not.  If the ball isn't held (e.g., Crazy Bob's) and in the "Playfield"
state, we can automatically drain it.  Helpful for halftime and end of
game during Championship Link.
  • Loading branch information
tomlogic committed Sep 1, 2024
1 parent 4f6b615 commit c6c7ed8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/wpc/sims/wpc/prelim/nbaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,14 @@ static sim_tState nbaf_stateDef[] = {

static int nbaf_handleBallState(sim_tBallStatus *ball, int *inports) {
switch (ball->state) {
case stFree:
// Automatically drain any balls on the playfield (and not held somewhere)
// when the flippers are turned off.
if (!core_getSol(31)) {
return setState(stDrain, 5);
}
break;

case stShooter1:
if (core_getSol(sPassRight1)) {
return setState(stShooter2, 5);
Expand Down

0 comments on commit c6c7ed8

Please sign in to comment.