Banner
Views: 993,749,494
Time:
14 users online: aaad151, DasFueller, edgar,  Fernap, gui, Jaden1291 the Toad, KaidenThelens, Kusrry, Lyphoon, NBKevin98, Quinkerman, Russ, Sig_AM, underway - Guests: 71 - Bots: 151 Users: 54,491 (2,077 active)
Latest: Lyphoon
Tip: The No More Sprite Tile Limits patch does NOT increase the limit for the amount of sprites onscreen at once. The SA-1 Pack does.
Not logged in.
Revamping my Waves Code
Forum Index - Sunken Ghost Ship - C3 Museum - Winter 2022 - Revamping my Waves Code
Tags:
Pages: « 1 » Link
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.

Okay, it's been finished now.

Enjoy!
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).

Originally posted by Knight of Time
did you base this effect on the first stage of Wily Tower from Mega Man: The Wily Wars?

Not at all. The reason is that HDMA waves are far too generic to be specific to Mega Man: The Wily Wars or any game, in fact.
This would be perfect for a abstract or even underwater levels could be quite useful

--------------------


You are challenged by Champion Daisy!

LAYOUT FOOTER:

This is the final update to this code for this C3: Waves now can appear only at the bottom part of the screen which may be tied to a layer (though that can be made optional).

Download link is the same as before.
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!
Pages: « 1 » Link
Forum Index - Sunken Ghost Ship - C3 Museum - Winter 2022 - Revamping my Waves Code

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2022 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks