#169500 - LOst? - Sat Jul 18, 2009 11:47 am
Okay, I have a quick sprite system that allows 32 scaled sprites (0-31).
So once uRotPos >= 8, the sprite is just one color (all scaled to a wierd value). Because there is no DS emulator with accurate debugging information, I am stuck! Help plz ;)
Is there anything I have missed?
_________________
Exceptions are fun
Code: |
SpriteEntry OamEntry [128] VAR_IN_EXRAM; SpriteRotation* pOamRotation = (SpriteRotation*) OamEntry; void ClearOAM () { ... uRotPos = 0; } void AddOAMScaled (...) { if (uRotPos >= 32) return; ... // Set X offset, affine transformation index, sprite size OamEntry [uOamPos].attribute [1] = ((x & 0x1FF) | ((uRotPos & 0x1F) << 9) | ((size & 0x3) << 14)); ... // Scale the sprite using one of the 32 affine transformation parameters pOamRotation [uRotPos].hdx = (signed short) ((signed int) 0x10000 / (signed int) shScaleWidth); pOamRotation [uRotPos].hdy = 0; pOamRotation [uRotPos].vdx = 0; pOamRotation [uRotPos].vdy = (signed short) ((signed int) 0x10000 / (signed int) shScaleHeight); uRotPos++; } |
So once uRotPos >= 8, the sprite is just one color (all scaled to a wierd value). Because there is no DS emulator with accurate debugging information, I am stuck! Help plz ;)
Is there anything I have missed?
_________________
Exceptions are fun