-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
Boktai 2: Solar Sensor emulation breaks on rewind #3294
Comments
Sounds like there's likely a problem with solar sensor savestates, since BizHawk relies on mGBA for the savestate implementation. That doesn't guarantee the issue lies with mGBA, but it's worth looking into. |
The solar sensor afaicr doesn't store anything in savestates. The sensor has two callbacks: sample, which tells it to update the cached value, and read, which gets the cached value out. It's possible that BizHawk doesn't restore the cached value upon loading a state if it happens between a sample and a read, or something similar. @YoshiRulz any idea? |
To be clear, the amount of state actually specific to the solar sensor is very very low (I can count all the variables directly related with 1 hand). A cursory look at the savestate function seems to indicate all state is accounted for for the solar sensor. There also should not be any sort of issue with what BizHawk itself reports, as the solar value is set per FrameAdvance(), taken from current input (if this was going wrong, it would affect practically every system in BizHawk). It's more likely just a generic savestate issue, with the solar sensor possibly exacerbating the issue (since the way the game queries the solar sensor is somewhat timing related, it could very well be from seemingly unrelated issues), but not being the fault of the issue. |
Resolves mgba-emu#3294 Also see TASEmulators/BizHawk#4060 (this is fixed with this patch).
Note: there's still some savestate non-determinacy with solar sensor apparently: TASEmulators/BizHawk#4094. Could open a new issue, but this issue as written still basically applies (unless it turns out to be a BizHawk-specific problem). |
Using the movie from here, I've created a few savestates which can reproduce the issue within mGBA (using 2a0ed00, and with a real BIOS file and a 1.0 Japanese Boktai ROM). desync.zip The behavior appears to be a case of the act of loading a savestate (even within the same frame it was created on, i.e. save/load a state without advancing any frames in-between) causing some state to be mangled and resulting in a desync later on. For these peek at 0x46B8 (4 bytes) in IWRAM to confirm behavior (stops incrementing at 906 in "expected" case, in desync case it keeps incrementing longer, stopping at 934 instead, assuming default solar sensor sample state) |
Good evening. I'm currently working on a TAS of Boktai 2: Solar Boy Django on Windows 11, in Bizhawk 2.9.2 which according to the program is using mGBA 0.11 as the GBA core (Though I see 0.10.3 is the newest version?)
I took two clips from a stream I did tonight to show persistent issues with the solar sensor:
https://www.twitch.tv/drakodan/clip/TameEvilIcecreamMVGame-nRRHnu2D8jGAROlQ
https://www.twitch.tv/drakodan/clip/SmellyBlushingMartenLitFam-OH3JMZGspfwKQz7Q
The first clip shows how on rewinding per-frame, the entire displayed gamestate can change. My understanding of why this happens is because Boktai's displayed sun level occurs at fixed intervals, and I think that rewinding/frame-advancing during these intervals messes with cached stuff? That's my best guess.
The second clip shows that the above behaviour can cause phantom lag frames to occur that otherwise should not be occurring.
I can try to provide more examples/information if this is an issue worth addressing, but this is the common scenario/cause of the bugs (Rewinding a movie manually)
The text was updated successfully, but these errors were encountered: