Sub Engine issue with oamGfxPtrToOffset()
Posted: Thu Aug 27, 2009 5:02 pm
Current code from svn:
The line:
causes the first allocated memory for the sub engine to report that it has an index of 32768 instead of 0 as it should be.
I'm gathering there should just be a < instead of a <=.
Code: Select all
//---------------------------------------------------------------------------------
unsigned int oamGfxPtrToOffset(const void* offset) {
//---------------------------------------------------------------------------------
unsigned int temp = (unsigned int)offset;
if(temp <= (unsigned int)SPRITE_GFX_SUB)
{
temp -= (unsigned int)SPRITE_GFX;
temp >>= oamMain.gfxOffsetStep;
}
else
{
temp -= (unsigned int)SPRITE_GFX_SUB;
temp >>= oamSub.gfxOffsetStep;
}
return temp;
}
Code: Select all
if(temp <= (unsigned int)SPRITE_GFX_SUB)
I'm gathering there should just be a < instead of a <=.