Vram I Sub Spr Ext Pal

Post Reply
Flow
Posts: 1
Joined: Sun Mar 08, 2009 2:20 am

Vram I Sub Spr Ext Pal

Post by Flow » Sun Mar 08, 2009 2:38 am

Code: Select all

/** \brief  Allowed VRAM bank I modes */
typedef enum {
	VRAM_I_LCD                    = 0,
	VRAM_I_SUB_BG_0x06208000       = 1,
	VRAM_I_SUB_SPRITE             = 2,
	VRAM_I_SUB_SPRITE_EXT_PALETTE = 3,
}VRAM_I_TYPE;


/** \brief  an array of 256 15-bit RGB values*/
typedef u16 _palette[256];

/** \brief  An array of 16 256-color palettes */
typedef _palette _ext_palette[16];

/** \brief  Used for accessing vram E as an external palette */
#define VRAM_E_EXT_PALETTE ((_palette *)VRAM_E)

/** \brief  Used for accessing vram F as an external palette */
#define VRAM_F_EXT_PALETTE ((_palette *)VRAM_F)

/** \brief  Used for accessing _palette G as an external palette */
#define VRAM_G_EXT_PALETTE ((_palette *)VRAM_G)

/** \brief  Used for accessing vram H as an external palette */
#define VRAM_H_EXT_PALETTE ((_palette *)VRAM_H)
So I was going to set Vram bank I as 'VRAM_I_SUB_SPRITE_EXT_PALETTE' but noticed that there was no reference to a VRAM_I_EXT_PALETTE and was wondering if this was just an omission or if Vram I can't really be used that way?

The hope was to be able to do something like this:

Code: Select all

vramSetBankI(VRAM_I_LCD);
dmaCopy(spritePal, &VRAM_I_EXT_PALETTE[i], 512);
vramSetBankI(VRAM_I_SUB_SPRITE_EXT_PALETTE);
or is that a terrible way to do Ext palettes cause I couldn't find any other way to do it?

Thanks for all the hard work and help!

Sylus101
Posts: 179
Joined: Wed Dec 24, 2008 5:08 am

Re: Vram I Sub Spr Ext Pal

Post by Sylus101 » Sun Mar 08, 2009 6:16 am

I'm fairly certain you have this correct. Besides this, you'd just have to enable extended palettes for sprites in the Display Control.
-Sylus "Not Stylus..." McFrederickson

Come visit my web site.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 7 guests