Language…
13 users online:  AmperSam, asterkafton, ClaireChan, DanMario24YT, Everest, Gamet2004, Hayashi Neru, LightAligns, mathie, MorrieTheMagpie, PaceTheAce, Rhubarb44230,  zuccha - Guests: 256 - Bots: 359
Users: 64,795 (2,378 active)
Latest user: mathew

Layer 1 HDMA based on another layer Y position?

I was originally looking into this because I was looking into if it was feasible to do the wavy effect found in Lockjaw's Locker but by utilizing either rising/sinking layer 2 or preferably layer 3 tides to trigger the effect.

I wasn't sure how to approach it so I dug and found some threads that seemed to be looking at somewhat similar problems. From those I think the answer is no, but a lot of those were 5-10 years old, so I figured I'd at least ask again just in case.

Honestly even a way to "fake" the effect would be more than good enough for what I need, I'm more looking into the execution over the actual implementation.


Not quite sure what you mean, are you referring to the effect where everything below Layer 3 in that level has a watery "shimmer" effect to it? Because HDMA is pretty much the only way to achieve that effect, by writing an HDMA table into RAM and adjusting the position the effect starts at during runtime.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Yeah, that's exactly what I'm trying to do. I'm just trying to figure out how I could and adjust a wave HDMA's starting position on layer 1 according to a variable, which in this case would be layer 3's Y position.
I tried this one last C3 but it wasn't perfect. I would have to make changes to the code anyway so it only creates a single wavelength of the waves and fills out the rest manually but I never worked on it since C3.

Either way, if DKC2 can do it then it then SMW likely can also do it.


When you write out the HDMA table, the first byte of each row of data specifies the number of scanlines to hold that value for. So you can just adjust that byte for the first row to change at what point your waves start, e.g. if the water starts at a Y position of 0x60 onscreen, you'd write out something like:

Code
	db $60 : db $00		; the length to apply no wave to
	db $10 : db $01		; the wave effect
	db $10 : db $00
	db $10 : db $01
	;...for the rest of the screen (just loop while keeping track of the scanline, and stop when you pass 0xF0)
	db $00


Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
That's an easy way to add waves... but a pretty static method. DKC2's wave is much more dynamic. It's really a better idea to wait until I finish my Waves HDMA Toolkit.


I mean, yeah, if you write the table exactly like that. But since you're writing the table into RAM you can just adjust any parameters of the effect as necessary, i.e. using the position onscreen for that first row and a timer for offsetting the rest.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
What you're suggesting seems simple but I'm left pretty lost since I've never tried customizing HDMA before. It sounds like this should work with HDMA straight out of Effect Tool with only editing the table right? So if my Table was


it sounds like I could edit this to load those wave effects from a different part of the screen, but I only got glitchy effects trying to make changes based on what you previously described (even just trying to start at 0x60 like in your example), so I feel like I'm missing something.