Emulator Issues #6096

Super Mario Sunshine JIT And Interpreter causes in-accurate collision detection in Pianta Village 5

Added by JMC4789 over 7 years ago.

% Done:


Operating system:
Issue type:
Relates to usability:
Relates to performance:
Relates to maintainability:
Regression start:
Fixed in:


Have you searched the issue tracker for a similar issue?


Game Name?

Super Mario Sunshine

Game ID?


What went wrong?

During Pianta Village 5 (the chuckster special stage) on the last throw, there is a catcher platform that, for some reason, if you hit the slanted wall and it pulls you toward the flat wall, you instantly die. This happens on both JIT and Interpreter, but surprisingly not JITIL. Dolphin is mostly accurate in collision bugs and tricks; this is easily the most blatant problem and easiest to show off. This happens in PAL as well.

What steps will reproduce the problem?

Go to Pianta Village Shine 5 (Entrance on top of The Shine Tower) and enter the special stage (Below the main area, need Yoshi.) On the very last throw, if you get thrown into the slanted walls and hit the back wall, you will die.

What version of Dolphin were you using?

From what I've heard, this bug has existed since 3.0, and has been confirmed to happen in 3.5. I was doing primary testing in 3.5-644 r83fc5f4747f9c8c6066bf002730827ecc17458aa That is also where the savestate was made from.

What Operating System were you using and what are your hardware

I was using Windows 7 x64, with a Core i5 760 @ 3.8 GHz and a GTX 280, 8 gigs of Ram.

Any other relevant information or links to logs:

Here's a demonstration screenshot of me dying:
Here's a savestate right before the last throw:
Here's a GCI with all the saves at 100%:

Related issues

Blocks Emulator - Emulator Issues #7304: frsqrtex Master IssueFixed


#1 Updated by JMC4789 over 7 years ago

I got a video of it now that looks pretty well, pretty much straight to the point with how it works.

#2 Updated by Billiard26 over 7 years ago

  • Issue type set to Bug

#3 Updated by JMC4789 about 7 years ago

  • Status changed from New to Accepted

This was confirmed by a lot of people, including speedrunners of the game.

#4 Updated by delroth about 7 years ago

kostamarino, can we control the JIT backend in gameinis? Forcing JitIL might be a good idea since Jit64 makes the game not 100% completable.

#5 Updated by JMC4789 about 7 years ago

It's technically completable, don't get me wrong, but you absolutely need savestates if you're going to try.

#6 Updated by delroth about 7 years ago

(not that this doesn't need to be fixed in Jit64, but that might be a good first step)

#7 Updated by JMC4789 about 7 years ago

It's FloatingPoint that has the problem, used debug mode in dolphin and disabled that one to trigger. Instead of changing to JITIL, maybe should fix that in INTERPRETER AND JIT.

#8 Updated by comexk about 7 years ago

To summarize discussion on IRC:

The issue is caused by inaccurate emulation of the frsqrte instruction. The correct behavior exists in the interpreter, but is currently hidden behind a define because it's somewhat complicated (uses a lookup table) and was not previously known to make a difference in any games. It does not exist in JitIL: x86 RSQRTSS (a single-precision operation), used by JitIL, is more accurate than the naive solution (in double precision), used by Jit64 and the interpreter without the define, at emulating fsqrte (a double-precision operation) in this specific instance, but this is probably not reliable. Since fsqrte does not seem to be used that often, interpreting it would probably work; after making this change on my machine running Sunshine under Jit64, Interpreter::frsqrtex only takes up 0.1% CPU.

#9 Updated by JMC4789 about 7 years ago

Can you disable a function for a game? I don't think we could do that, but it'd be good, JITIL is 30% slower than JIT64 in Sunshine.

#10 Updated by kostamarino about 7 years ago

Enforcing jitil is easy, if someone can fix it though i suppose there is no need for that.

#12 Updated by JMC4789 over 6 years ago

  • Status changed from Accepted to Fixed

Also available in: Atom PDF