#148894 - rook02 - Fri Jan 11, 2008 7:13 pm
Okay, I'm not sure what I'm doing wrong. I've been trying to see how exactly the OAM works, so that I'll be able to just throw in arrays of pixel data in it. However, I can't even seem to load a small 8x8 sprite into it correctly.
The sprite displays, but it's broken in vertical lines or something.
Here's what I did after doing initOAM();
What did I miss here? Any help would be appreciated.
Last edited by rook02 on Fri Jan 25, 2008 8:03 pm; edited 1 time in total
The sprite displays, but it's broken in vertical lines or something.
Here's what I did after doing initOAM();
Code: |
int index = 0; oam[index].attribute[0] = ATTR0_COLOR_256 | ATTR0_ROTSCALE; oam[index].attribute[1] = ATTR1_ROTDATA(0) | ATTR1_SIZE_8; oam[index].attribute[2] = 0; const unsigned short palette[2]= { 0x001,0x01F, }; const unsigned char test[64]= { 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x00,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, }; dmaCopy ( palette, SPRITE_PALETTE, 2 * sizeof ( unsigned short ) ); dmaCopy ( test, &SPRITE_GFX[0 * 16], 64 * sizeof ( unsigned char )); swiWaitForVBlank(); updateOAM(); |
What did I miss here? Any help would be appreciated.
Last edited by rook02 on Fri Jan 25, 2008 8:03 pm; edited 1 time in total