Moppu / SecretOfManaRandomizer

Randomizer for Secret of Mana
GNU Lesser General Public License v2.1
8 stars 3 forks source link

Certain bosses on certain maps cause flickering #22

Open Moppu opened 2 months ago

Moppu commented 2 months ago

Certain bosses will cause annoying graphical flickering when layer 3 messages are up, in some arenas. Mech Rider does this pretty often.

I've spent some time looking at this and haven't come up with much in terms of a definitive cause. Best guess is vblank is taking longer than expected to complete in certain cases and SNES/VRAM isn't handling it well. If I remember right you get a certain number of CPU cycles to complete your NMI handling, and I'm not sure what's expected to happen if you exceed that window. The flicker appears to be every 5 frames, which is the length of SoM's main frame rule system controlled by the counter at 7E0056, so it might help to first isolate which of the 5 frames is causing this and take a look at all the processing involved in that frame.

Moppu commented 2 months ago

image

Here's a screenshot of it happening. This is a boss/arena combo that consistently causes it. The layer 3 message has to be visible for the effect to be observed.

Note the color shift partway down through the water. These are not different tiles, or a different palette past this point - somehow the graphics are seemingly being corrupted on a per-scaline basis.

Moppu commented 2 months ago

image

For reference, here's a normal screenshot of that arena

Moppu commented 2 months ago

Some experimentation that may or may not be helpful

image

Disabling transparency in display settings 13 (0x80177 -> 0x00, 0x80178 -> 0x00) did NOT work around the issue.

image

Disabling layer 2 in the same display settings however (0x80176 -> 0x15) DID make the issue go away - maybe due to less stuff going on in the resulting NMI handler, allowing the game to meet its rendering timeline again.