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 > Sprites and extended palettes

#134658 - Twindruff - Sun Jul 15, 2007 11:35 am

Hi, I've got one question:
how can I use extended palettes for sprites ?
I think it is possible because I saw VRAM E could be mapped to VRAM_E_OBJ_EXT_PALETTE for example (see http://www.dev-scene.com/NDS/NDS_Tutorials_VramTable) and NDeSmuME has Main spr ExtPAL 0 in its palette viewer.
But I can't find any doc on this :(
Thanks.

#134673 - knight0fdragon - Sun Jul 15, 2007 3:26 pm

add this to your display_cd (set video mode)

DISPLAY_SPR_EXT_PALETTE


then set the vram to LCDC mode
write pallete
set the vram to VRAM_?_OBJ_EXT_PALETTE ? depends on bank

then set ATTR2_PALETTE(n) in attr2 of your spriteEntry, n can be from 0 - 15
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#134679 - Twindruff - Sun Jul 15, 2007 6:07 pm

Thanks :)
But when I use the extended palette, I can't use the normal palette any more. I thought I could have had 32 palettes at the same time (normal + extended). There's no way to do that ?
And if there no way to have both sets of palettes at the same time, what is the use of an extended palette ?

#134681 - tepples - Sun Jul 15, 2007 7:25 pm

Extended palettes can be 255 colors in size, not 15.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#134684 - Twindruff - Sun Jul 15, 2007 7:45 pm

You mean, in extended palette mode I have 16 palettes of 256 colors ? Really cool :D
Okay, I understand now the slider in dualis :p

#134701 - knight0fdragon - Mon Jul 16, 2007 12:11 am

who said anything about extended palettes being 15 in size, what I was talking about is you can have 16 different palettes, and yes they can be 256 colors
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#134743 - Twindruff - Mon Jul 16, 2007 9:06 am

knight0fdragon wrote:
who said anything about extended palettes being 15 in size

It was me I didn't know extended palettes had 256 colors :P

#134758 - Twindruff - Mon Jul 16, 2007 1:19 pm

Another question, where did you learn how the extended palette mode worked ? I couldn't find any doc on google :(

#134775 - knight0fdragon - Mon Jul 16, 2007 5:25 pm

forums and trial and error
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#134925 - Twindruff - Wed Jul 18, 2007 12:56 pm

ok :|
In fact it is a bit documented in no$ gbatek

#135269 - LiraNuna - Sat Jul 21, 2007 5:49 pm

Hope this helps

The 'frightening' sprite union will be added on the next libnds update, afaik.
_________________
Private property.
Violators will be shot, survivors will be shot again.

#135271 - Twindruff - Sat Jul 21, 2007 5:55 pm

I already succeeded to make it work, but thank you it will help some other people for sure ;)