melonDS-emu / melonDS

DS emulator, sorta
https://melonds.kuribo64.net
GNU General Public License v3.0
3.27k stars 542 forks source link

Castlevania: DoS and PoR Sprite Jittering [Software] #1028

Open Awakened0 opened 3 years ago

Awakened0 commented 3 years ago

While playing both of these games I notice certain sprites "jitter" when near the top of the screen. It's mostly the lanterns or other objects you can destroy for hearts. It only happens when using the software renderer though, GL is fine. I had the JIT disabled and tried disabling "Use separate thread", but it didn't fix it. Was testing on the 0.9.1 Windows build.

dawn

Here's a save file closest to the area in the GIF. Just go left a few screens.

Castlevania - Dawn of Sorrow (USA).zip

RSDuck commented 3 years ago

that looks like it occurs on real hw as well, where it only isn't visible because the DS's LCD is pretty slow. Some games even use flickering intentionally to produce transparencies. This needs investigation with a capture card.

nadiaholmquist commented 3 years ago

It would seem weird that the issue with the lanterns at the top of the screen happens on hardware when the one on the ground the character is standing on does not?

RSDuck commented 3 years ago

might be some rounding weirdness then

Awakened0 commented 3 years ago

Yeah, it only seems to occur when the objects are very near the top of the screen. This also might be related; in Portrait of Ruin some background elements are shifting down a pixel when they are scrolled to a few lines from the top of the screen:

port

The bottom of the shelf behind the character portrait is where you see it. It shifts down and up, covering a dull red line underneath it when it shifts down. You can kind of see how the same type of shelf at the bottom of the screen doesn't shift over the red line. Plus you can see some garbage pixels appear at the very top of the screen for a few frames.

Awakened0 commented 3 years ago

I found a room in Portrait that shows the problem off really well. After exiting the save room, ride the platforms up or down and watch the top of the screen. There is a line where sprites and the background seems to get "compressed". It looks sort of like screen tearing, except how the sprites get pushed down a pixel.

Save file: Castlevania - Portrait of Ruin (USA).zip

https://user-images.githubusercontent.com/4565863/110574866-e88c0780-812b-11eb-9968-5d818d66d7b4.mp4

0x647262 commented 2 years ago

This may be a similar but unrelated issue, but on melonDS 0.9.4 when using scaling above 1x the internal resolution this happens in Metroid Prime: Hunters

https://user-images.githubusercontent.com/6733785/175789258-7127b4f5-4055-44a3-b1e4-ce16cbb90043.mp4

jayare5 commented 2 months ago

that looks like it occurs on real hw as well, where it only isn't visible because the DS's LCD is pretty slow. Some games even use flickering intentionally to produce transparencies. This needs investigation with a capture card.

I have a Phat DS with a capture card! I can confirm that this does not happen on real hw. I have recorded a comparison video side by side.

https://github.com/user-attachments/assets/3ba6f4f7-0c33-4a6d-a61e-20602cbf3c66

Jaklyy commented 2 months ago

good hunch that this is probably related to how vertices and their attributes are handled during clipping