Problem with 768pxx768px bg
Problem with 768pxx768px bg
hi friends,
I'm trying put a 768x768 px background and do it scroll, but the final is:
in the top: when I do scroll, the result is
and in the botton whithout scroll there are many black px:
and the code is:
http://devkitpro.org/download/file.php?mode=view&id=56
I'm trying put a 768x768 px background and do it scroll, but the final is:
in the top: when I do scroll, the result is
and in the botton whithout scroll there are many black px:
and the code is:
http://devkitpro.org/download/file.php?mode=view&id=56
- Attachments
-
- EJ1.rar
- code of problem
- (46.06 KiB) Downloaded 958 times
-
- Sin título.png
- problem bg
- (41.17 KiB) Not downloaded yet
Re: Problem with 768pxx768px bg
at a quick glance at your code it looks like you are using 8 bit backgrounds. I believe that palette index 0 is reserved for transparent and cannot be mapped to a color.
Re: Problem with 768pxx768px bg
mmm,
but, with up screen, what i can do?
but, with up screen, what i can do?
Re: Problem with 768pxx768px bg
By any chance, did you call something else that writes to VRAM, such as iprintf?
Re: Problem with 768pxx768px bg
No, but I think that I have the solve of problem,
result that bg have 1024 diferent tiles, and I'm trying to allocate in ((0x6000000) + (tilebase << 11)) or ((0x6200000) + (tilebase << 11))
, what i can do?
and whith botton screen
result that bg have 1024 diferent tiles, and I'm trying to allocate in ((0x6000000) + (tilebase << 11)) or ((0x6200000) + (tilebase << 11))
, what i can do?
and whith botton screen
Re: Problem with 768pxx768px bg
Please make sure you can fill out this worksheet with no conflicts. If you don't understand the parameters, please visit the irc channel #dsdev on irc.blitzed.org for further assistance.
Re: Problem with 768pxx768px bg
It will probably also help to improve readability if you try to use the libnds API's instead of using registers directly:
becomes though you may need to change the way you define bg_size.
However, your CreateBG function is a little too generic; it is prone to corrupt video. You can easily see the limitations on your backgrounds are with the values hard-coded in this function without the risk of corrupt video.
Note: For REG_BG2CNT and REG_BG2CNT_SUB you used BG_MAP_BASE(5) where I think you mean 2 (the rest of the code in that block uses 2).
Code: Select all
void InitBasico(void){
//Iniciar modo de Video
videoSetMode(MODE_0_2D);
videoSetModeSub(MODE_0_2D);
bgExtPaletteEnable();
bgExtPaletteEnableSub();
//Memoria Vram
vramSetPrimaryBanks(VRAM_A_MAIN_BG, VRAM_B_MAIN_SPRITE, VRAM_C_SUB_BG, VRAM_D_SUB_SPRITE);
vramSetBanks_EFG(VRAM_E_LCD, VRAM_F_LCD, VRAM_G_LCD);
vramSetBankH(VRAM_H_LCD);
vramSetBankI(VRAM_I_LCD);
}
Code: Select all
REG_BG0CNT = BgType_Text8bpp | bg_size | BG_PRIORITY_0 | BG_PALETTE_SLOT0 | BG_COLOR_256 | BG_TILE_BASE(1) | BG_MAP_BASE(0);
Code: Select all
bgInit(0, BgType_Text8bpp, bg_size, 0, 1);
bgSetPriority(0, 0);
However, your CreateBG function is a little too generic; it is prone to corrupt video. You can easily see the limitations on your backgrounds are with the values hard-coded in this function without the risk of corrupt video.
Note: For REG_BG2CNT and REG_BG2CNT_SUB you used BG_MAP_BASE(5) where I think you mean 2 (the rest of the code in that block uses 2).
Re: Problem with 768pxx768px bg
I make the changes that you say, but the result is the same.
Anything else?
Anything else?
Who is online
Users browsing this forum: No registered users and 0 guests