#142648 - HyperHacker - Thu Oct 11, 2007 5:22 am
In HBlank, I do this to create an 8-scanline gradient behing BG0, by hiding BG3 and adjusting the background colour:
BG0 has a text layer and BG3 has a 16-bit bitmap. When I do this, as I adjust HighlightLine to move the effect up and down the screen, the image on BG3 actually jumps up and down. It looks like instead of skipping 8 lines of BG3 when it's turned off, it actually moves the remaining portion down 8 lines. Is this normal? Is there a better way to hide BG3 so that the background colour can be seen through it?
Also, when I do this, about 8 pixels of the very top scanline become one of these colours too. Why is that? It looks like for some reason BG3 is off while these are drawn, so the last set background colour (that of the bottom scanline from the effect) is shown. I don't touch the backgrounds in VBlank though, and this is all HBlank is doing, and the effect doesn't reach anywhere near the bottom of the screen.
[edit] Yep, that's what it's doing alright. If I don't turn BG3 on until halfway down the screen, then the top half, not the bottom, gets shown. What the heck? It's not getting squished either, just 8 pixels are getting cut off the bottom.
What's even stranger is it looks like the gradient actually takes up about 10 scanlines. O_o
_________________
I'm a PSP hacker now, but I still <3 DS.
Last edited by HyperHacker on Fri Oct 12, 2007 3:44 am; edited 1 time in total
Code: |
void HBlankInterrupt()
{ s32 Line; static bool BG3On = true; //Highlight selected menu option if enabled. if(HighlightSelOption && (HighlightLine >= 0)) { Line = REG_VCOUNT - (HighlightLine - 1); if((!Line) && BG3On) { videoSetMode(MODE_5_2D | DISPLAY_BG0_ACTIVE); BG3On = false; } if((Line >= 0) && (Line < 8)) BG_PALETTE[0] = SelOptionBG[(Line + HighlightAnim) & 7]; else if((Line >= 8) && !BG3On) { videoSetMode(MODE_5_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG3_ACTIVE); BG3On = true; } } } |
Also, when I do this, about 8 pixels of the very top scanline become one of these colours too. Why is that? It looks like for some reason BG3 is off while these are drawn, so the last set background colour (that of the bottom scanline from the effect) is shown. I don't touch the backgrounds in VBlank though, and this is all HBlank is doing, and the effect doesn't reach anywhere near the bottom of the screen.
[edit] Yep, that's what it's doing alright. If I don't turn BG3 on until halfway down the screen, then the top half, not the bottom, gets shown. What the heck? It's not getting squished either, just 8 pixels are getting cut off the bottom.
What's even stranger is it looks like the gradient actually takes up about 10 scanlines. O_o
_________________
I'm a PSP hacker now, but I still <3 DS.
Last edited by HyperHacker on Fri Oct 12, 2007 3:44 am; edited 1 time in total