gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > I'm stumped. Upgraded to devkitARM r20.

#132380 - Dark Knight ez - Tue Jun 26, 2007 11:32 am

Hey all.

I decided to install the latest development setup for the DS as the touch screen code was hugely improved. That's actually a big plus in my RTS engine and it's definitely noticable. Great job on that.

Anyway, the main screen suddenly refuses to show sprites. On devkitARM r19 it worked just fine.
Now, my sprite setup for my RTS was kind of advanced, so I just removed the following to check if it would work after that:
- HBlank and VBlank trickery
- extended palettes
This way, it should be the same as the sub screen when it comes to sprite showing code.... but whereas the sub screen actually shows it sprites, the main screen still did not.

So then I tried to just load the main graphics and palette to _SUB and copy the sprites to OAM_SUB, etc... changing nothing else in code really but adding the _SUB part, and then the sprites meant for the main screen show up properly on the sub screen. So that tells me that the actual sprite setting code is proper, but... well... I still don't know what could possibly be the problem.
I'm stumped. Any ideas on what could be wrong?

[side note]
I'm not as stupid as to not have sprite graphics VRAM for main screen set up or anything.
Code:
    VRAM_A_CR = VRAM_ENABLE | VRAM_A_MAIN_BG;     // 128 kb
    VRAM_B_CR = VRAM_ENABLE | VRAM_B_MAIN_SPRITE; // 128 kb
    VRAM_C_CR = VRAM_ENABLE | VRAM_C_SUB_BG;      // 128 kb
    VRAM_D_CR = VRAM_ENABLE | VRAM_D_SUB_SPRITE;  // 128 kb

_________________
AmplituDS website

#132382 - Lick - Tue Jun 26, 2007 11:34 am

Video mode flags? Background priorities?
_________________
http://licklick.wordpress.com

#132384 - Dark Knight ez - Tue Jun 26, 2007 11:44 am

I disabled all backgrounds just in case... did not help.

Code:
    DISPLAY_CR = (MODE_0_2D |
                  DISPLAY_SPR_ACTIVE |
                  DISPLAY_SPR_1D |
                  DISPLAY_SPR_1D_SIZE_256 //| // getting sprite references to be 256 byte (16x16 8-bit tiles)
                  //DISPLAY_SPR_EXT_PALETTE   // using extended palettes for sprites
                  //DISPLAY_WIN0_ON
                );

_________________
AmplituDS website

#132395 - tepples - Tue Jun 26, 2007 12:56 pm

Dark Knight ez wrote:
I decided to install the latest development setup for the DS as the touch screen code was hugely improved. That's actually a big plus in my RTS engine and it's definitely noticable. Great job on that.

Anyway, the main screen suddenly refuses to show sprites.

On the version of libnds included with devkitARM R20, the default VRAM address for some of the sprite banks has changed. What happened to you happened to me around LOCKJAW 0.34. Try specifying the sprite banks for the main screen entirely, including the address in VRAM to which they are mapped.

Quote:
I'm not as stupid as to not have sprite graphics VRAM for main screen set up or anything.
Code:
    VRAM_A_CR = VRAM_ENABLE | VRAM_A_MAIN_BG;     // 128 kb
    VRAM_B_CR = VRAM_ENABLE | VRAM_B_MAIN_SPRITE; // 128 kb
    VRAM_C_CR = VRAM_ENABLE | VRAM_C_SUB_BG;      // 128 kb
    VRAM_D_CR = VRAM_ENABLE | VRAM_D_SUB_SPRITE;  // 128 kb

Have you tried specifying an address for VRAM_B_MAIN_SPRITE?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#132399 - Dark Knight ez - Tue Jun 26, 2007 1:04 pm

That did it! :)
Thanks, tepples... not sure if I would have ever figured that one out myself. I would probably have reverted back to the older development setup instead.
_________________
AmplituDS website