Language…
20 users online: akawo, Alex No, CroNo, DanMario24YT, Gemini0, Golden Yoshi, Green, Gulaschko, Hammerer, kurtistrydiz,  MarioFanGamer, MarkVD100, Maw, mtheordinarygamer, rafaelfutbal, Rykon-V73, Spedinja, steelsburg, superbot12, Tulip Time Scholarship Games - Guests: 289 - Bots: 522
Users: 64,795 (2,370 active)
Latest user: mathew

I don't even know what this foreground gradient is even doing

So I'm trying to add a foreground gradient to part of my level, but I don't even know what it is doing here.



Part of the gradient is cut off, and anything past the gradient appears transparent. It also turns everything transparent when I pause (as shown on the right). I did double check some of the registers and memory, and none of them should cause anything to go transparent. What is going on here?
I have the same problem with foreground gradiants. Is it related to level mode?
Gotta aim fast.
How does the code look like?
Here's the code

Code
; To be inserted as generator with SpriteTool (as number D0 - FF).

print "INIT ",pc
print "MAIN ",pc
PHB : PHK : PLB
JSR Sprite
PLB
RTL


Sprite:

	REP #$20
	LDA #$3200
	STA $4330
	LDA #.RedTable
	STA $4332
	LDY.b #.RedTable>>16
	STY $4334
	SEP #$20
	LDA #$08
	TSB $0D9F
	RTS

.RedTable:           ; 
   db $26 : db $20   ; 
   db $07 : db $21   ; 
   db $06 : db $22   ; 
   db $06 : db $23   ; 
   db $06 : db $24   ; 
   db $07 : db $25   ; 
   db $07 : db $26   ; 
   db $05 : db $27   ; 
   db $07 : db $28   ; 
   db $07 : db $29   ; 
   db $06 : db $2A   ; 
   db $06 : db $2B   ; 
   db $07 : db $2C   ; 
   db $06 : db $2D   ; 
   db $07 : db $2E   ; 
   db $05 : db $2F   ; 
   db $07 : db $30   ; 
   db $07 : db $31   ; 
   db $06 : db $32   ; 
   db $06 : db $33   ; 
   db $07 : db $34   ; 
   db $06 : db $35   ; 
   db $07 : db $36   ; 
   db $06 : db $37   ; 
   db $06 : db $38   ; 
   db $07 : db $39   ; 
   db $06 : db $3A   ; 
   db $14 : db $3B   ; 
   db $00            ; 


I used Effect Tool V2.0.1 (Yes I did realize it has been updated since).
That code looks more or less fine.

But to clear out some confusion: A foreground gradient is just a backdrop gradient, functionally the same as a background gradient (usually). What is a difference is that every layer is transparent to the backdrop which is why layer 1 but also the Koopa shell (and all sprites of a certain palette) is transparent to layer 2 in the second screenshot.
You should have been looking at TS, the subscreen register, instead of the various colour maths registers.

Looking closely at the screenshots, it could be a side effect of the version of Minimalist Status Bar which you are using right now (it has recieved a couple of updated). More specifically, I see the part where the original status bar used to be is the part where layer 2 is on the subscreen (hence why the gradient cuts of where the vanilla Status Bar originally used to be but also why the foreground is transparent to the background).

Not sure why pausing the game causes layer 2 to move to subscreen for the whole screen, though. That requires more information about which patches you're using but also debugging the problem in general.
Originally posted by MarioFanGamer

Looking closely at the screenshots, it could be a side effect of the version of Minimalist Status Bar which you are using right now (it has recieved a couple of updated). More specifically, I see the part where the original status bar used to be is the part where layer 2 is on the subscreen (hence why the gradient cuts of where the vanilla Status Bar originally used to be but also why the foreground is transparent to the background).

Not sure why pausing the game causes layer 2 to move to subscreen for the whole screen, though. That requires more information about which patches you're using but also debugging the problem in general.


That sure does make this a tricky problem, doesn't it?

I'm not sure if there is a good way to solve this problem and keep this status bar. I think I'm just going to stick with a decent background gradient for now.
Originally posted by Digital Entertainment
That sure does make this a tricky problem, doesn't it?

For sure, that can only be solved by debugging so... why did you stop at debugging?

Originally posted by Digital Entertainment
I'm not sure if there is a good way to solve this problem and keep this status bar. I think I'm just going to stick with a decent background gradient for now.

How about updating Minimalis Status Bar?
Originally posted by MarioFanGamer

How about updating Minimalis Status Bar?

Is it possible, how can we do it?
Gotta aim fast.


Just redownload the newest version of the patch and apply it to your ROM.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Originally posted by MarioFanGamer

For sure, that can only be solved by debugging so... why did you stop at debugging?


I stopped at debugging because the foreground gradient isn't entirely necessary for this level, and there is a decent alternitive. Also, I'm trying to get a new demo out during C3, and I just don't have the time to worry about this issue for now.

Originally posted by MarioFanGamer
How about updating Minimalis Status Bar?


I did give that a shot, but that still hasn't been able to fix this issue for me.
Why are you using this a sprite and not actually UberASM init code?
Originally posted by Ice Man
Why are you using this a sprite and not actually UberASM init code?


That is actually something I'm looking into right now. I started with the sprites because they were easier to make at the time. However, if I have enough time, I could try testing this with a uberASM gradient. I'm probably going to switch to it sooner or later anyways.
Also, you should modify the main/sub screen if you want the gradient to be on everything:

Code
	LDA #$17
	STA $212C
	LDA #$00
	STA $212D

	REP #$20
	LDA #$3200
	STA $4330
	LDA #.RedTable
	STA $4332
	LDY.b #.RedTable>>16
	STY $4334
	SEP #$20
	LDA #$08
	TSB $0D9F
	RTS