Some of you may remember how I released an UberASM library for handling waves for C3 Summer 2020. That one was mostly created as a quick release just to gather some points but I also created that somewhat with a legitime goal in the sense to create a good (considering that I also created the Parallax HDMA Toolkit).
Either way, I went back and rewrote the routine:
Most of the code is pretty much identical. However, where it failed is the lack of support of scrolling i.e. the waves seem to move separate from the scrolling. My parallax toolkit is one of the few wave HDMA codes which aren't affected by it (though this is also because Nintendo figured out on how to fix this issue in Yoshi's Island) but it's only build for a couple of scanlines. This library, however, works with a faster solution:
Changes to previous version:
Scanliens are calculated only once. The previous version calculated each scanline individually which made it an extremely terrible choice for non-SA-1 ROMs. Though my system still uses a buffering system, I managed to make it faster by writing only one wavelength of scanlines and fill the rest by copying the data.
Of course, too large scanlines can and will still slow down the game.
Better calculations. As mentioned above, layer offsets are now considered with the calculation and will shift the waves appropriately. In addition, the calculation is also closer to calculating a way than before with the wavelength as a parameter, for example (previously, it was the reciprocal).
Macros. The previous codes were easily customisable, though not really easily integratable. However, to easy some backwards compatibility and remove some clutter, I provide some macros to ease the setup.
Independent tables. This allows you to have multiple kinds of HDMA tables. I still provide in a default table. This allows you to apply the waves on multiple layers or have horizontal and vertical waves (though the latter may not look very good).
Height. Together with the above option, this easily allows you to have two kinds of waves on the same layer (such as the BG2 background of Stage 1 of Castlevania - Dracula X) or have it only applied partially in the screen (such as in Super Metroid with the water) as as well as allow some kind of compatibility with the vanilla status bar (though you also would have to rewrite the IRQ routine to prevent writing to the BG3 offsets).
Right now, the code is still WIP and no download link is published but you can expect a download link in a couple hours with the same codes recreated.
That wave code looks really interesting, MarioFanGamer! Personally, I think it would look best in levels with lava and other fiery obstacles, which reminds me, did you base this effect on the first stage of Wily Tower from Mega Man: The Wily Wars? I recall that stage uses a similar effect near the end of the stage where the lava is, as well as in the boss arena, anyway here's a video showing what I'm talking about (the effect is first shown around the 1:27 mark).
Shot after shot—you just don't miss, do you? I don't know where we'd be without you MFG, this paired with some nice water GFX would look breathtaking. ...or it could be used to simulate motion sickness if one so desired. What a multi-faceted resource!