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 > How is I bank used for Extended palette in latest libnds?

#167505 - Emmanuel - Sun Mar 15, 2009 10:36 am

Well, the VRAM I bank doesn't have a define for EXT_PALETTE and so, I wonder if it's different, included else where or what?

I guess the palette is stored contiguosly with no weird spaces or something... so for now I'll try a standard memcpy with the spaces for palettes calculated accordingly...

I'll try memcpy to VRAM_I ((u16*)0x68A0000) for now... but, is there a EXT_PALETTE for the VRAM_I ?

*note: I don't expect this to work... and even if it does, I'd prefer to use a EXT_PALETTE define instead....

Edit: well... DSemuMe shows me the palette loaded... even though the sprite still doesn't show up....

Why doesn't libnds have the EXT_PALETTE for the I bank? Does it work different somehow?

#167506 - eKid - Sun Mar 15, 2009 12:17 pm

The hardware doesn't allow VRAM I to be used for the main-screen's extended palettes. It can only be mapped to the sub-screen's OBJ extended palette (VRAM_I_SUB_SPRITE_EXT_PALETTE).

See http://nocash.emubase.de/gbatek.htm#dsmemorycontrolvram to see which banks can be used. (E, F, G for main palettes)

#167548 - Emmanuel - Wed Mar 18, 2009 2:52 am

eKid wrote:
The hardware doesn't allow VRAM I to be used for the main-screen's extended palettes. It can only be mapped to the sub-screen's OBJ extended palette (VRAM_I_SUB_SPRITE_EXT_PALETTE).

See http://nocash.emubase.de/gbatek.htm#dsmemorycontrolvram to see which banks can be used. (E, F, G for main palettes)


Yeah I know... I need I for sub sprite... I already have my main ext palette up and running... and working... my I bank is shown in DSemuMe... but, doing nothing... plus, that the I bank doesn't have the good looking EXT_PALETTE...

I've gone through the code like 20 times.... both are the same, except for the switch it has in stuff like the memcpy, and the registers... which are the same except for _SUB and _I_

#167573 - Tommmie - Wed Mar 18, 2009 7:38 pm

did you tested it on no$gba or hardware, my code is just running fine, even with sub extended palettes