Emulator Issues #11173
Rounding differences in SM64 (VC) (JIT bug)
Super Mario 64
Game ID? (right click the game in the game list, properties, info tab)
MD5 Hash? (right click the game in the game list, properties, info tab, MD5 Hash: Compute)
What's the problem? Describe what went wrong.
On actual Wii Virtual Console, a rounding error causes the rising platforms in BitfS to slowly rise up. (https://clips.twitch.tv/ImpossibleLittleSmoothieRedCoat). This is not present in Dolphin. This glitch is really useful as it could help us get past the pole with 0 A presses, however we can't TAS this because it isn't present in Dolphin.
What steps will reproduce the problem?
Wait for a while and the platforms will slowly rise up
Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.
Yes, it is present in the latest dev build (5.0-7826)
Is the issue present in the latest stable version?
Yes this is present in the latest stable version
If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)
If your issue is a graphical issue, please attach screenshots and record a three frame fifolog of the issue if possible. Screenshots showing what it is supposed to look like from either console or older builds of Dolphin will help too. For more information on how to use the fifoplayer, please check here: https://wiki.dolphin-emu.org/index.php?title=FifoPlayer
What are your PC specifications? (CPU, GPU, Operating System, more)
Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)
State in the spot
#1 Updated by JMC4789 over 1 year ago
- Status changed from New to Accepted
- Subject changed from Rounding difference in SM64 to Rounding differences in SM64 (VC)
I can confirm it doesn't really rise up, but, it'd be nice if we could narrow down what's changing on console. If we figure out what rounding is the problem, it becomes much, much, much easier to implement said behavior in Dolphin. It'd also be nice (albeit not very realistic) to see if it happens in interpreter.
#5 Updated by JMC4789 over 1 year ago
Go into Options/Configuration/Interface and turn on the debug GUI.
Then pause the game and click the JIT dropdown on the menu bar. I turned off Jit Loadstore floating and FloatingPoint.
If we figure out which instruction is the problem we could probably fix this in the JIT as well without needing this.
#9 Updated by degasus over 1 year ago
I just wanted to highlight that this was unexpected and that it reduced the amound of possible issues a lot. As our JIT does some optimization based on loaded registers, may you try to test the opposite as well: Does it start to raise as well if you only select the FloatingPoint fallbacks?
#13 Updated by Thestickman391 over 1 year ago
I've spent the last ~2 hours trying to raise the platform again. I've uninstalled and reinstalled dolphin multiple times, installed several different versions of Dolphin and with no luck! I can't for the life of me figure out why it won't work again. Any help you could give would be very much appreciated.
#28 Updated by JMC4789 over 1 year ago
Likely the ConvertDoubleToSingle function here: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp#L115
This may be the cause of the problem.
#30 Updated by JMC4789 over 1 year ago
The modification in that build if you want to do it yourself is to add the following at line 104 of JITLoadstoreFloating.cpp
The chunk looks like this after the modification.
int accessSize = single ? 32 : 64;
FALLBACK_IF(update && jo.memcheck && a == b);
#34 Updated by JMC4789 over 1 year ago
- Status changed from Accepted to Work started
By enabling a more accurate rounding feature (fixed, but not enabled in this PR https://github.com/dolphin-emu/dolphin/pull/7013) I can get Mario 64 working without requiring fallbacks. I did not use a savestate and instead walked to Bowser in the Fire Sea.
#36 Updated by JMC4789 over 1 year ago
- Status changed from Work started to Fix pending
Can you try this pull request - https://buildbot.dolphin-emu.org/#builders/20/builds/2059
#40 Updated by JMC4789 over 1 year ago
Dolphin is very, very unlikely to be wrong on the timing of it. The formula I changed it to was hardware verified by phire. The old formula just didn't handle it because we thought no game would ever rely on the behavior.
If there are more bugs regarding this behavior, we'll happily look into it though, as edge-cases like these often expose unknown behaviors.
#41 Updated by JMC4789 over 1 year ago
- Fixed in set to 5.0-8009
- Status changed from Fix pending to Fixed
Thanks for the report, the bug now works in Dolphin. Bring us home that 0x A Button run!
Fixed in https://dolphin-emu.org/download/dev/9b431807315028ca646cae70084466ae8ad5b022/ - 5.0-8009