SGDK - get palette color

SGDK only sub forum

Moderator: Stef

Post Reply
Helghast
Interested
Posts: 29
Joined: Sat May 25, 2013 8:53 pm
Location: Amsterdam, Netherlands
Contact:

SGDK - get palette color

Post 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
Chilly Willy
Very interested
Posts: 2993
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy »

index is 0 to 63 and specifies the offset into the CRAM.
Helghast
Interested
Posts: 29
Joined: Sat May 25, 2013 8:53 pm
Location: Amsterdam, Netherlands
Contact:

Post 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
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post 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 :)
Helghast
Interested
Posts: 29
Joined: Sat May 25, 2013 8:53 pm
Location: Amsterdam, Netherlands
Contact:

Post 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
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post 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 !
Post Reply