warmCabin / mm2_flicker_ender

Simulates a few of Rockman 2's key drawing routines in Lua to eliminate sprite flicker
0 stars 0 forks source link

Inaccurate sprite priority behavior when opaque pixel matches background #3

Open warmCabin opened 8 months ago

warmCabin commented 8 months ago
Accurate Flicker Ender
Rockman 2 - Dr  Wily no Nazo (Japan)-616 resize Rockman 2 - Dr  Wily no Nazo (Japan)-617 resize

During the pulsating cloud palette animation in Air Man's stage, the outer border is set to the same shade of blue as the background to shrink the clouds. But the PPU doesn't care about that; an opaque pixel is an opaque pixel, so sprites appear behind it. However, In tiledraw.lua, it essentially takes a little Photoshop eyedropper and compares the color of the on-screen pixel to the global BG color at PPU $3F00, with no way of knowing whether it was actually opaque in the nametables. So in this scenario, it gets tricked into thinking the pixel is transparent.

The solution, of course is to just check the nametables. There is no fundamental API limitation that prevents me from doing this. I just didn't feel like it...

This is an interesting issue because I actually think it looks better how it is. We are getting into bug-for-bug compatibility here. Although, it's not out of the question that a game would set things up (knowingly or not) to use this behavior, so it would be best to fix it.

warmCabin commented 5 days ago
Accurate Flicker Ender
fan_chain_accurate fan_chain_flender

I actually found another example. It's the chain sprites that awkwardly underflow up the bottom of the screen in Wily 2. There's one specific crusher that happens to underflow into the animated tiles of a giant fan.