mgba-emu / mgba

mGBA Game Boy Advance Emulator
https://mgba.io/
Mozilla Public License 2.0
5.76k stars 794 forks source link

[OpenGL] Golden Sun: Some NPCs' position gets slightly displaced compared to Software mode #2558

Open RafaelTrepaUnCarballo opened 2 years ago

RafaelTrepaUnCarballo commented 2 years ago

Some NPCs and sometimes even the main character are moved a bit to the left in OpenGL mode (in any resolution, even x1)

Software: Golden Sun (Spain) mGBA Software mode OpenGL: Golden Sun (Spain) mGBA OpenGL mode

Animated comparison: 174393171-1e7ad209-7283-4fcc-a378-3e1273650d2b

Present in the last build 0.10-7565-0dce8b392 , both for Windows x86_64 and Switch European Spanish Rom c63008d6

endrift commented 1 year ago

This appears to be related to transformation rounding, especially when the 0,0 component of the transformation matrix is negative. I managed to redo the origin so it matches the software renderer when it's set to 1× scaling, but at anything else it introduces pixel gaps due to the origins of sprites no longer being the top left. It's gonna take some experimentation to fix.