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

nbaf: add full sim for NBA Fastbreak #302

Merged
merged 8 commits into from
Sep 2, 2024

Conversation

tomlogic
Copy link
Contributor

Looking for some feedback on my code before merging, and any ideas regarding how to get the game to fire the "pass" solenoids when I hit the flippers (shift keys). If I used the stateDef structure it never recognized the passing. When I integrated solenoid tests into the handleBallState() handler I could only trigger the passing by hitting the flipper button 3-4 times.

Notes from my last commit:

Initial implementation works well, other than passing between players
when "In The Paint" requires multiple shift key (flipper button) hits to
trigger the passing solenoids.  Simulates defender motor/positioning,
defender magnet used to hold the ball, diverters/gate, and the backbox
game.

For some reason, nbaf_stateDef wouldn't trigger state changes with the
passing solenoids, so I integrated those checks into
nbaf_handleBallState().

@toxieainc
Copy link
Member

@volkenborn Do you have an idea? I don't..

@volkenborn
Copy link
Contributor

Nope, sorry. This is way beyond me.

@toxieainc
Copy link
Member

@tomlogic Then just give us a hint when we should merge this.. Thanks!

@tomlogic
Copy link
Contributor Author

Doing a bit of cleanup before submitting. I was able to use the mech_XXX APIs for the defender mech instead of my manual implementation. I wonder if anyone has implemented having balls automatically drain if they're in a "Playfield" state and the flippers turn off? I'm testing out the Championship Link feature, and the game kills the flippers at halftime and waits for balls to drain before going into the backbox game. And again at the end of the fourth quarter, or when you compete for a ring. It'd be nice to automatically clear the playfield in those moments.

I have not figured out the flipper button issue. I attained a high score, and using the flipper buttons was also wonky to enter initials. I am getting an "Unable to open the keyboard device. (error 32)" when PinMAME starts up, so perhaps that's related.

@toxieainc
Copy link
Member

I would love to help you with both issues, but i'm pretty much clueless in that area.

@tomlogic
Copy link
Contributor Author

tomlogic commented Sep 1, 2024

@toxieainc, automatically draining when the flippers are dead (e.g., Tilt) seems to be a simple addition. I'm going to move this from prelim to full as well, since there isn't anything left (that I'm aware of) to simulate.

Reduce any possible latency by always accepting bytes for transmission
instead of trying to emulate LSR bits related to sending.
Initial implementation works well, other than passing between players
when "In The Paint" requires multiple shift key (flipper button) hits to
trigger the passing solenoids.  Simulates defender motor/positioning,
defender magnet used to hold the ball, diverters/gate, and the backbox
game.

For some reason, nbaf_stateDef wouldn't trigger state changes with the
passing solenoids, so I integrated those checks into
nbaf_handleBallState().
When leaving FLIP_U out of the core_tGameData structure, the game will
eventually report a service error for switches F6 and F8.
PinMAME already has code to simulate the defender motor and have it
trigger various proximity switches.  Based on the "drac" motor from MB.
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.
@tomlogic tomlogic marked this pull request as ready for review September 1, 2024 23:29
@tomlogic
Copy link
Contributor Author

tomlogic commented Sep 1, 2024

Ready to merge, but I'd love to have someone try it out on a VPin to make sure I didn't break anything there. I'm also not sure how to update the failing checks. They're looking for nbaf.c in prelim instead of full, but I can't find any documents in the repository that still have the old path.

@toxieainc
Copy link
Member

Looks good to me, we'll figure out why it fails then. Thanks a lot!!
Would be cool to see a video of how the virtual and real machine interact. :)

@toxieainc toxieainc merged commit a254072 into vpinball:master Sep 2, 2024
32 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants