-
Notifications
You must be signed in to change notification settings - Fork 115
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
California Games not advancing past BMX event #858
Comments
Adding @DirtyHairy because the fact that it is working at other speeds than 100% makes me wondering. |
Yeah, that makes sense. |
Ideas: |
Attached is a simple test program, which checks the fire button twice per frame just like CG does. The background color should change when the button is pressed or released. This does not happen in Stella but works for other emulators. |
It doesn't work in MAME or z26 either, but does in Stellerator, gopher2600 and clksignal. |
Findings:
Some thoughts:
Ideas for solutions:
|
@DirtyHairy @sa666666 How shall we continue here? |
How about, in addition to the normal polling, we poll at each read of INPTx too? Would this cause too much slowdown, I wonder? If there are no pending events, this is essentially a small check (check returns false, so method returns immediately). |
We are doing this for paddle and trackball games anyway, no? |
No, currently all controllers are querying |
Hm, paddles are read multiple times per frame. So here Stella must update multiple times per frame. We should do the same with joystick controllers. |
Events are only grabbed from SDL once per frame. If the paddles are checking multiple times per frame, they are checking a cached event stored in |
Got you. Polling with each INPTx might become quite slow though. Maybe we should define a minimum interval between polls, e.g 1/2 frame. |
Well, first I would try it on every read, to see if it even fixes the issue. Then if that works, we can further optimize it. |
If we limit the change to INPT4/5, then we should be fine. Makes no sense for analog input anyway. |
@sa666666 Do you have an idea how to add this extra polling? Usually the controller code has no access to event handling. |
It's going to require some refactoring. New method(s) need to be added to |
Wouldn't a change in |
I don't know. And I guess we need to experiment. I'm not even entirely sure my suggestion will fix the problem. I think this work needs to be done in a branch first, since it has the potential to be very invasive either way. |
Be careful with this. Afaik accessing input is only legal on the main thread on some platforms, and emulation runs on thread. |
How about a separate thread which only polls the input multiple times per frame? Have you seen |
Two ideas here:
* sleep until current real time |
If I understand (1) correctly (terminate timeslice prematurely -> return to main thread -> poll -> go for next timeslice), this should work. I don't think (2) is viable; afaik polling has to happen on the main thread in order to be safe across platforms --- this is not just about race conditions, but about assumptions made by the API of windowing systems. |
Not quite. After polling, the current timeslice has to be continued before we go to the next one.
Then it must be made possible in the main thread to continue running (and polling) while emulation is dispatched. |
@DirtyHairy @sa666666 How should we proceed here? How would you interrupt emulation? I suppose this has to be triggered in |
@DirtyHairy @sa666666 Bump. IMO we should fix this for 7.0. |
@DirtyHairy @sa666666 2nd Bump |
Bug has apparently been present since Stella 3.9.3, and is still present in master!
ROM: California Games (1987) (Epyx).zip
State file from 6.5.3 (submitted by bug reporter): California Games (1987) (Epyx)_state_6.5.3.zip
State file from master: California Games (1987) (Epyx)_state_6.7pre.zip
This was reported by PM to AtariAge; I will include the relevant info here.
When playing California Games in normal mode (meaning that you're progressing from completing one event then moving on to the next), the game will not go past the BMX downhill event once complete. It will just stay at the screen with the bike at the finish line and never move to the next screen. It should display the team with the high score, then move on to the Surfing event. I tried with other emulators and it behaves as expected, but when playing with Stella, it "hangs" after the BMX event. Is this a known issue?
This save state0 will put you right before the last screen on the BMX event. Once you cross the finish line, you won’t be able to continue. It’s supposed to show the event winner screen and then go to the surfing event when you press the button.
I also added a save state for the end of the footbag event (state1). You'll see that when you press the button, it behaves as it should for this event.
I tried in Stella 6.5.3, and confirmed it there. And also in latest master (as of Dec. 29), with the same results. I set emulation speed to 1000%, to get to the desired point very quickly.
Some oddities:
The text was updated successfully, but these errors were encountered: