#105323 - pettersson - Sat Oct 07, 2006 6:48 pm
Hi, i just started developing for Nintendo DS. Using Mode_5_3D i can't get a simple sprite displayed. Using an emulator (ideas) only the bg image is shown. Running on real hardware, it displays a crippled thingy in the left upper corner, but not the red square as intended.
Here is what i do:
m_sprites is copied to OAM every frame.
thanks for any help.
Here is what i do:
Code: |
for (unsigned int idx=0; idx<128; ++idx) { m_sprites[ idx ].attribute[ 0 ] = ATTR0_DISABLED; m_sprites[ idx ].attribute[ 1 ] = 0; m_sprites[ idx ].attribute[ 2 ] = 0; m_sprites[ idx ].attribute[ 3 ] = 0; } // get SpriteRotation Pointer. SpriteRotation *p_sprite_rotation = (SpriteRotation*)m_sprites; int idx; for (idx=0; idx<32; ++idx) { p_sprite_rotation[ idx ].hdx = 256; p_sprite_rotation[ idx ].hdy = 0; p_sprite_rotation[ idx ].vdx = 0; p_sprite_rotation[ idx ].vdy = 256; } // enable one single sprite m_sprites[ 0 ].attribute[0] = ATTR0_BMP | ATTR0_ROTSCALE_DOUBLE | 10; m_sprites[ 0 ].attribute[1] = ATTR1_SIZE_32 | 20; m_sprites[ 0 ].attribute[2] = ATTR2_ALPHA(1) | 0; // copy some stuff to sprite memory... for (idx=0; idx<32*32; ++idx) { SPRITE_GFX[idx] = RGB15(31,0,0) | BIT(15); } |
m_sprites is copied to OAM every frame.
thanks for any help.