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

cps2.cpp: Added TOURNAMENT board communication simulation. #9699

Merged
merged 3 commits into from
May 6, 2022

Conversation

cuavas
Copy link
Member

@cuavas cuavas commented May 5, 2022

Thanks to Darksoft for tracing the board, and @originalgrego for producing a proof of concept implementation.

To use this, enable communication in the Machine Configuration menu for four instances of ssf2tb or a clone, and then daisy-chain them using the various comm_* options. The comm_remotehost option for the head of the daisy chain must be empty. For example, to run them all on one machine:

  • mame ssf2tb -comm_localhost 0.0.0.0 -comm_localport 1234 -comm_remotehost ""
  • mame ssf2tb -comm_localhost 0.0.0.0 -comm_localport 1235 -comm_remotehost 127.0.0.1 -comm_remoteport 1234
  • mame ssf2tb -comm_localhost 0.0.0.0 -comm_localport 1236 -comm_remotehost 127.0.0.1 -comm_remoteport 1235
  • mame ssf2tb -comm_localhost "" -comm_remotehost 127.0.0.1 -comm_remoteport 1236

The TOURNAMENT board apparently can generate interrupts, but the game doesn’t seem to mind if it doesn’t – it still polls the USART. This is all simulated at a very high level due to the way MAME only synchronises with the wall clock once per frame – on a typical PC, the main thread is sleeping over 90% of the time when running a CPS2 game. Trying to do it more realistically would require major changes to MAME’s event loop.

The games will lose sync pretty quickly if they aren’t running at the same speed (e.g. if you try to fast-forward one of them). I’ve had it lose sync once with normal play, but it seems to work fairly well most of the time.

@cuavas
Copy link
Member Author

cuavas commented May 5, 2022

Oh, I also untangled the CPS-2 class from the CPS-1 files while I was at it.

@cuavas
Copy link
Member Author

cuavas commented May 5, 2022

image

@cuavas cuavas merged commit fe8e132 into mamedev:master May 6, 2022
@cuavas cuavas deleted the tournament branch May 6, 2022 04:04
couriersud pushed a commit to couriersud/mame that referenced this pull request May 6, 2022
wilbertpol pushed a commit to wilbertpol/mame that referenced this pull request May 17, 2022
@cuavas cuavas mentioned this pull request Jun 3, 2022
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.

1 participant