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

Manage 2P in attract and game example #7

Closed
totologic opened this issue Aug 9, 2021 · 4 comments
Closed

Manage 2P in attract and game example #7

totologic opened this issue Aug 9, 2021 · 4 comments

Comments

@totologic
Copy link

Hi.

Back to the attract-and-game example, I try to adapt it in order to manage properly 2 players.

The kind of scenario I want to support is the "here comes a new challenger", in the same way Puzzle De Pon does: when one player is already playing and the other is pushing START, a credit is DOWN and the game is interrupted to start a new 2P game.

The problem I meet is the impossibility to have the inactive player to spend a credit by pushing START while the other is already playing. I tried to set up all kind of registers (BIOS_USER_MODE, BIOS_CREDIT_DEC, BIOS_PLAYER_MOD1...) with different values, but nothing work as expected. I always have both player able to spend a credit (which is a fault for the player already playing) or none of them.

@dciabrin
Copy link
Owner

dciabrin commented Aug 9, 2021

Good question, I'll try to come up with something if you don't beat me to it.

(Also for good measure I might need to tweak the nullbios substitute ROM to support 2 players credit management...)

@totologic
Copy link
Author

I found a discussion from 2015 illustrating and solving the exact same problem.

https://www.yaronet.com/topics/171604-user-subroutine-with-neobitz-c-dev-kit-datlib

Im not sure I can solve it myself with my skills as the solution involves modifications in the ASM header. But I am going to give a try.

@dciabrin
Copy link
Owner

I just added a new example 10-credits-management in branch https://github.com/dciabrin/ngdevkit-examples/tree/credits, it requires a fairly recent ngdevkit as it uses bios variables defined in the latest ld linkscripts.
Could you check whether it does what you wanted?

Note: it doesn't work with nullbios yet, as I need to implement the small bits required for credit management with multiple players. Once done, I'll merge this new example into the main branch.

@totologic
Copy link
Author

I tried so many things, except to write directly in the bios_start_flag :'(

Your example is perfect, exactly what is expected in a game.

dciabrin added a commit to dciabrin/ngdevkit that referenced this issue Aug 19, 2021
dciabrin added a commit to dciabrin/ngdevkit that referenced this issue Aug 21, 2021
Fix the AES start_status check after the implementation of
credit management for 2 players.

Fix an invalid shift for credit checks in the MVS case.

Ref dciabrin/ngdevkit-examples#7
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

No branches or pull requests

2 participants