#99696 - pkwong - Wed Aug 23, 2006 11:36 am
i have a sprite that is 144x8
seems that it's much wider than the sprite size...
what can i do instead of treating it as 5 32x8 sprites?
one more question,
if i have a sprite that i wanted to display in two or more locations,
do i need to create more than 1 identical sprites?
thanks!
#99707 - tepples - Wed Aug 23, 2006 1:58 pm
Most games do in fact treat odd-size sprites such as that one as multiple sprites.
If you want to display the same sprite cel in more than one location, load the sprite cel into VRAM and then have multiple sprites (multiple OAM entries) point attribute 2 to it.
Shadowed because it applies equally well to the GBA and DS.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#99719 - pkwong - Wed Aug 23, 2006 3:59 pm
many thanks for the fast answer!
#100043 - pkwong - Fri Aug 25, 2006 7:37 pm
more questions...
my situation is, i got some sprites of 16bit color. i convert them into 256 and then put them in SPRITE_GFX and SPRITE_PALETTE.
first few sprties displayed fine, but the others are corrupted, i think it's because my palettes exceeds 256... i dunno how to extend the mem...simply using vramSetBank doesn't help.
after some search in this forum, i tried to use the bmp mode by setting ATTR0_BMP. everything worked great! but just on the emulator(dualis)...
it can display my bg, just the sprites are not working on the real hardware. got any hints?
i'll quote some of my code here:
init:
Code: |
powerON(POWER_ALL);
videoSetMode(MODE_5_2D | DISPLAY_SPR_ACTIVE | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_1D_BMP);
videoSetModeSub(MODE_5_2D | DISPLAY_SPR_ACTIVE | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_1D_BMP);
vramSetMainBanks( VRAM_A_MAIN_BG, VRAM_B_MAIN_SPRITE,
VRAM_C_SUB_BG , VRAM_D_SUB_SPRITE); |
copying the gfx, i've set BIT(15) already
Code: |
memcpy(SPRITE_GFX + spriteID[0],white_Sprite, spriteSize[0]); |
putting into the sprite entry, it's a 16x8 sprite
Code: |
spritesMain[0].attribute[0] = ATTR0_BMP | ATTR0_WIDE | i;
spritesMain[0].attribute[1] = ATTR1_SIZE_8 | notes_pos_x[1];
spritesMain[0].attribute[2] = tileID[0]; |
#100077 - tepples - Fri Aug 25, 2006 11:01 pm
pkwong wrote: |
my situation is, i got some sprites of 16bit color. i convert them into 256 and then put them in SPRITE_GFX and SPRITE_PALETTE.
first few sprties displayed fine, but the others are corrupted, i think it's because my palettes exceeds 256... i dunno how to extend the mem...simply using vramSetBank doesn't help. |
Did you try converting all the hi-color sprites to the same 256-color palette? Have you tried converting them to 16-color mode?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#100105 - pkwong - Sat Aug 26, 2006 5:06 am
ya, i tried to convert them with PAGfx. it displays fine but there are too many palette to fit into SPRITE_PALETTE.
i checked in dualis, the excess palettes overflow to the sub bg palette...
is there any way to extend the size?
i think 16 color may do the work, but it really doesn't look good... :P
so i want to try others first.
#100190 - pkwong - Sat Aug 26, 2006 7:49 pm
hm...
i was trying to use extended palette..but no luck
here's what i did, anything missing or wrong?
1. enable DISPLAY_SPR_EXT_PALETTE
2. set VRAM_E to LCD mode
3. copy the palettes to VRAM_E
4. set VRAM_E to VRAM_E_OBJ_EXT_PALETTE
i checked the palettes in dualis and they are fine
and the DS is still reading from the original SPRITE_PALTTE's address
#100201 - pkwong - Sat Aug 26, 2006 8:21 pm
figured out!
i should use VRAM_F instead of E...