- Joined
- Aug 1, 2009
- Messages
- 53
- Trophies
- 0
- Location
- broady
- Website
- numbat.cs.rmit.edu.au
- XP
- 42
- Country
Hello, I want to be able to load more OAM Sprites.
I've mapped one of the main VRAM blocks to sprite memory and banks F and G to Sprite Extended Palettes, DMA copied my pallet to the extended palette, and allocated with oamAllocate
I'm using 16color (4bit) images.
But what do i use for the "int palette_alpha" parameter of oamSet to use a palette in the extended palette area?
Also, after loading a few sprites I'm getting NULL when i call oamAllocateGfx, despite having mapped one of the main VRAM banks to object memory opposed to using the smaller bank E.
this is how my VRAM BANKS are mapped btw
I init OAM with:
This is the relevent part of my sprite loading function
So now what do i use for the palette_alpha paremter when i call
Sorry if this is in the wrong section, but i couldn't seem to find a coding board, only the dstwo dev board >_
I've mapped one of the main VRAM blocks to sprite memory and banks F and G to Sprite Extended Palettes, DMA copied my pallet to the extended palette, and allocated with oamAllocate
I'm using 16color (4bit) images.
But what do i use for the "int palette_alpha" parameter of oamSet to use a palette in the extended palette area?
Also, after loading a few sprites I'm getting NULL when i call oamAllocateGfx, despite having mapped one of the main VRAM banks to object memory opposed to using the smaller bank E.
this is how my VRAM BANKS are mapped btw
Code:
ÂÂÂÂvramSetBankA( VRAM_A_MAIN_BG );
ÂÂÂÂvramSetBankB( VRAM_B_MAIN_SPRITE );
ÂÂÂÂvramSetBankD( VRAM_D_MAIN_BG_0x06020000 );
ÂÂÂÂvramSetBankC( VRAM_C_SUB_BG );
ÂÂÂÂ
ÂÂÂÂvramSetBankF( VRAM_F_SPRITE_EXT_PALETTE );
ÂÂÂÂvramSetBankG( VRAM_G_SPRITE_EXT_PALETTE );
ÂÂÂÂvideoSetMode( MODE_5_2D |ÂÂDISPLAY_BG2_ACTIVE |ÂÂÂÂ DISPLAY_BG3_ACTIVE |ÂÂDISPLAY_SPR_ACTIVE |ÂÂDISPLAY_SPR_1D_LAYOUT );ÂÂÂÂ
ÂÂÂÂvideoSetModeSub( MODE_3_2D | DISPLAY_BG3_ACTIVE );
I init OAM with:
Code:
oamEnable( &oamMain );
oamInit( &oamMain, SpriteMapping_1D_32, true );
This is the relevent part of my sprite loading function
Code:
ÂÂÂÂÂÂ _oamGfx = oamAllocateGfx(&oamMain, _sSize, SpriteColorFormat_16Color );
ÂÂÂÂvramSetBankF(VRAM_F_LCD);
ÂÂÂÂdmaCopy(_gfx, _oamGfx, _gfxLen);
ÂÂÂÂdmaCopy(_pal, &VRAM_F_EXT_SPR_PALETTE[0], _palLen);
ÂÂÂÂvramSetBankF(VRAM_F_SPRITE_EXT_PALETTE);
So now what do i use for the palette_alpha paremter when i call
Code:
void ÂÂÂÂoamSet (OamState *oam, int id, int x, int y, int priority, int palette_alpha, SpriteSize size, SpriteColorFormat format, const void *gfxOffset, int affineIndex, bool sizeDouble, bool hide, bool hflip, bool vflip, bool mosaic)
Sorry if this is in the wrong section, but i couldn't seem to find a coding board, only the dstwo dev board >_