14 users online: Anas,  Anorakun, Dangil,  DeppySlide, Green, JUMPY_NEB, Koopster, MasterMario97, Red2010, RemiFlan,  Tahixham, Will86, Yoshimaster96, zAce08xZ - Guests: 131 - Bots: 176
Users: 62,810 (2,619 active)
Latest user: ionshadow

with Layer 4 ExAnimation Problem

Hey everyone! I wanted to fix SMWCP, and I kinda seem to fix almost everything then I ran to this problem at the end. On level 24: Peach's Castle at the credits scene of the game. The screen seems to flickering every second due to huge ExAnimation in the BG/FG. And it's only doing this on accurate emulator and the console. Lunar Magic v1.82.

And also I'm too nervous to let 'S.N.N'. know that I'm fixing this hack.

It's hard to know specifically what is causing it, but the graphics turning into something like that is a sign of VRAM getting corrupted. Given that it's only occurring on accurate emulators, I'd guess that the cause is that there's code running in that level manually writing to the SNES registers outside of NMI, which can have some issues with actual hardware. Comparing against the credits seen here, my bet is that it's code being used to animate the water. (alternatively it could also just be whatever is being used to write the actual credits text)

Even knowing that though, it may still be hard to debug the exact location of the cause, but there are some options for isolating it (I even recently wrote up a brief guide to the debugging toolchains available by various emulators over here if you need it). The two main methods I'd suggest are either:

  • Running a trace log, and then looking for references to the DMA channels ($420B).
  • Using an emulator with a proper debugger (Mesen2 or bsnes-plus), and setting a breakpoint on either DMA-related register addresses (e.g. $420B, same as with a trace log), or setting a breakpoint directly on the VRAM address of one of the corrupted tiles.

Once you find code that appears to be causing the corruption, it's just a matter of extracting the code, disabling the original implementation, and then re-implementing it properly, however it is that that may need to be done.

If you want to do the route of setting a breakpoint on the VRAM address, an easy way to do that is through the tile viewers of Mesen/bsnes-plus. For Mesen, start by opening the tile viewer. Right click a tile that gets corrupted (preferably one not being otherwise animated by ExAnimation or whatever) and select "view in memory viewer". Right click the VRAM address that pops up and select "edit breakpoint", then hit OK in the window that pops up to add the breakpoint. Now, Mesen's code debugger will stop on the exact line of code initiating the DMA that corrupted the VRAM data.

For example, here's what finding the code responsible for the overworld water animation would look like:

Which does indeed find the routine responsible for actually writing the water VRAM data ($00A4E3). One of the advantages of Mesen also is that it will automatically perform a disassembly of the code for you, which can make extracting it from the ROM much easier.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer