Language…
21 users online: Ahrion, Alex No, Angel Miranda, AppleBoy54321, CourtlyHades296, Dan2point5, Danik2343, DasFueller,  Donut, E-man38, gemstonezVA, Jern, katun24,  Kevin, KimmyWBTVE2022, NikSik1, orka-bln,  PermaBan, Serge, TCgamerboy2002, The Yak Smoker - Guests: 115 - Bots: 184
Users: 56,266 (2,260 active)
Latest user: Bullrunfarms

Flickering red light when having FG Color Gradiend [solved]

Hi, I'm currently working on a vulcano level, so I used the Effect Tool to create a red FG Gradient.
Then I put this gradient into my level using levelasm.
When I test the level, the gradient works fine, but sometimes (for no apparent reason) the FG flickers in red (starting right above the end of the FG gradient) Problem is I cannot post a screenshot, because it's impossible to get one, cause I don't really know, when it will happen :D
If you need some more information, just ask, but I don't really know what else to add (I'm using Lunar Magic 2.20)
The Code:
Sorry if it is a quite obvious problem, but I'm not an ASM pro ;)

Code
{InitCodeLabel}:
RTL

{MainCodeLabel}:
;level101:
LDA #$17		;\ Everything
STA $212C		; | is on main screen
LDA #$00		; | Nothing
STA $212D		; | is on sub screen
LDA #$27		; | Affect layer 1,2,3
STA $40			;/ and back enable

REP #$20		;\
LDA #$3200		; | Use Mode 0 on register 2132
STA $4330		; | 4330 = Mode, 4331 = Register
LDA #.ColorData		; | Address of HDMA table
STA $4332		; | 4332 = Low-Byte of table, 4333 = High-Byte of table
LDY.b #.ColorData>>16	; | Address of HDMA table, get bank byte
STY $4334		; | 4334 = Bank-Byte of table
SEP #$20		;/

LDA #$08		;\
TSB $0D9F		; |Enable HDMA on Channel 3
RTL			;/  Return


.ColorData
	db $80, $00
	db $22, $00
	db $02, $21
	db $02, $22
	db $02, $23
	db $02, $24
	db $02, $25
	db $02, $26
	db $02, $27
	db $02, $28
	db $02, $29
	db $02, $2A
	db $02, $2B
	db $02, $2C
	db $02, $2D
	db $02, $2E
	db $02, $2F
	db $02, $30
	db $02, $31
	db $02, $32
	db $02, $33
	db $02, $34
	db $02, $35
	db $02, $36
	db $02, $37
	db $02, $38
	db $02, $39
	db $02, $3A
	db $02, $3B
	db $02, $3C
	db $02, $3D
	db $02, $3E
	db $02, $3F
	db $00

My Youtube channel

Currently working on:
Project C

Finished project:
You should try to paste the code to both the init and main codes.
Formerly known as nick 139
My YouTube channel
Tried it. Didn't change the outcome.
But thanks for the suggestion
My Youtube channel

Currently working on:
Project C

Finished project:
That really shouldn't do anything. Rather, try putting it in the INIT label only instead. That's where it's meant to be. I don't see why it would cause problems in the main label, but maybe it just does :P
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
Also didn't work :(
But I managed to get a screenshot this time
this is how it looks in zsnes (snes9x too)

My Youtube channel

Currently working on:
Project C

Finished project:
try changing
Code
	db $80, $00
	db $22, $00

to
Code
	db $80, $20
	db $22, $20

Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
I changed the numbers you told me and now it seems to work =)
While testing i didn't encounter the red flash of doom again.
what exactly did this change of the numbers?
My Youtube channel

Currently working on:
Project C

Finished project:
Ahhh FUCK, now I have to update Effect Tool on that to >.<
As to why this works. I don't really understand why it glitches up in the first place but the second byte sets the colors and their values in this format:

bgrccccc

which means a value of $00 has no effect whatsoever (didn't expect it to need one) while $20 (00100000) sets the red color to 0
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
Vague memory from aeons ago so I may be wrong:

If there's lag the color values aren't reset at the beginning of the frame. The large amount of red you're seeing is the color set very last in the HDMA table. You could also have solved it by having a single scanline of resetting everything to 0 at the very end.
Even if that exeeds 224 scanlines in total?
Either way, I'll have to have a look at how I coded it to see which way is easier to add *lazy*
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
I'm not confident enough in my memory to give a concrete answer to that.

Regardless, the BEST way of course would be to do what you suggested at first: use $20 instead of $00 for the first set of scanlines.
thanks very much guys
(Also JackTheSpades: You did a great job with this tool, it is helpfull in so many ways (even with this small problem ;)))
My Youtube channel

Currently working on:
Project C

Finished project: