#72890 - tonkinfash - Wed Feb 22, 2006 11:01 am
After starting out creating a bouncing ball using good old-fashioned blitting I decided to get to grips with OAM. To this end I hacked out a simple program that allows the user to guide a ball around the screen. I got it working, only to find that the sprite has been thrashed.
What should look like this:
[Images not permitted - Click here to view it]
Looks like this:
[Images not permitted - Click here to view it]
The corresponding arrays can be seen here:
And for the OAM version:
Weird, eh? Surely these arrays are the same?!
What should look like this:
[Images not permitted - Click here to view it]
Looks like this:
[Images not permitted - Click here to view it]
The corresponding arrays can be seen here:
Code: |
unsigned char ball [] = { 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xAA, 0xAA, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xAA, 0x55, 0x55, 0xAA, 0xFF, 0x00, 0xFF, 0xAA, 0x55, 0x00, 0x00, 0x55, 0xAA, 0xFF, 0xFF, 0xAA, 0x55, 0x00, 0x00, 0x55, 0xAA, 0xFF, 0x00, 0xFF, 0xAA, 0x55, 0x55, 0xAA, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xAA, 0xAA, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00 }; |
And for the OAM version:
Code: |
unsigned short ball [] = { 0x0000, 0x00ff, 0xff00, 0x0000, 0x00ff, 0xffaa, 0xaaff, 0xff00, 0x00ff, 0xaa55, 0x55aa, 0xff00, 0xffaa, 0x5500, 0x0055, 0xaaff, 0xffaa, 0x5500, 0x0055, 0xaaff, 0x00ff, 0xaa55, 0x55aa, 0xff00, 0x00ff, 0xffaa, 0xaaff, 0xff00, 0x0000, 0x00ff, 0xff00, 0x0000 }; |
Weird, eh? Surely these arrays are the same?!