Page 1 of 1

SGDK - get palette color

Posted: Fri May 31, 2013 9:54 pm
by Helghast
hey Guys,

in the SGDK, when I try to do u16 VDP_getPaletteColor (u16 index ), there is no argument to set which palette to get values from, is that a bug, or am I interpreting that wrong?

regards, Dennis

Posted: Sat Jun 01, 2013 12:56 am
by Chilly Willy
index is 0 to 63 and specifies the offset into the CRAM.

Posted: Sat Jun 01, 2013 5:23 am
by Helghast
Chilly Willy wrote:index is 0 to 63 and specifies the offset into the CRAM.
ofcourse!
Still New to this, so excuse me for these kinds of questions!

gards, Dennis

Posted: Sat Jun 01, 2013 10:31 am
by Stef
Helghast wrote:
Chilly Willy wrote:index is 0 to 63 and specifies the offset into the CRAM.
ofcourse!
Still New to this, so excuse me for these kinds of questions!

gards, Dennis
Actually the old method getPalette(..) was working as you expected: (palette_ind, color_ind)

But in fact that just make stuff a bit less practical sometime so i modified it only for plain color index :)

Posted: Sat Jun 01, 2013 11:19 am
by Helghast
Stef wrote:
Helghast wrote:
Chilly Willy wrote:index is 0 to 63 and specifies the offset into the CRAM.
ofcourse!
Still New to this, so excuse me for these kinds of questions!

gards, Dennis
Actually the old method getPalette(..) was working as you expected: (palette_ind, color_ind)

But in fact that just make stuff a bit less practical sometime so i modified it only for plain color index :)
Makes sense, once i understood this, It was a matter of seconds before I fixed what I wanted to do (ugly hack to swap palette colours to have 1 sprite in mutiple colors from a single bitmap).

I got my rom all done now actually! Now it's time to get It on the actual hardware... This is gonna be an adventure.

Regards, Dennis

Posted: Sat Jun 01, 2013 5:06 pm
by Stef
Helghast wrote: Makes sense, once i understood this, It was a matter of seconds before I fixed what I wanted to do (ugly hack to swap palette colours to have 1 sprite in mutiple colors from a single bitmap).

I got my rom all done now actually! Now it's time to get It on the actual hardware... This is gonna be an adventure.

Regards, Dennis
Glad to hear that ! Hopefully it will work on first try on actual hardware, at least i wish you that !