4 users online: amyysucks, BastarB, Heitor Porfirio, WONIU - Guests: 84 - Bots: 182
Users: 66,534 (2,384 active)
Latest user: amyysucks

Hdma bg gradient + parallax scrolling gives random flickers

I have this UberASM Tool code in a level. It makes a background gradient effect together with parallax, both set up thanks to Effect Tool.
Although, I get random flickers in the topmost part of the BG, which apparently gets more insane as soon as I do stuff related to updating blocks status (i.e. collecting a coin, destroying a block, etc.)
An example is shown here in the very beginning.

I tried changing RAM addresses at first, but nothing worked for me.
Since my friend also gets this issue sometimes in his hack, I wonder if the code there is faulty somewhere, or if it's just an issue on my end.
Help is greatly appreciated since I'm going insane with this. Thanks in advance!
My first guess is that the flickering is happening on lag frames. It's something to do with how the parallax code was written; obviously the gradient works fine.
Two things I can think of that could cause this:
1) Too much exanimation or related stuff.
2) You're using a channel that the game is already using. (I think only 3 channels were unused by the game but your code uses at least 4 as far as I can tell, I might've miss remembered that though)

the hdma code for the parallax is set up to read directly from a ram table. said ram table gets updated in levelasm main, which runs at the beginning of the frame. beginning of the frame runs after nmi ends. nmi usually ends early, meaning it does not take up all of vblank. which means the beginning of the frame usually runs within vblank. of course, when lots of stuff gets updated, nmi lasts longer. not enough to exceed vblank, but enough to push the parallax updater outside of vblank. which is fine, except in this case where the parallax portion is at the top of the screen, so the parallax updater ends up running while hdma transfers occur, so bad things dot tm happen

solution: shove the parallax updater into nmi, and yeah try and save some vblank time (use my nmi fixed color whatever optimizer!)
ladida I love you deeply
It worked!
Thanks everyone who posted!
Quick Question: How did you get both the HDMA & parallax to work in the same level?

LINKS -> YouTube - Discord - Twitter