#32374 - identitycrisisuk - Tue Dec 21, 2004 5:17 pm
I'm getting problems after starting to compile code in DevKitARM with the -O3 tag. I've checked for the standard mistakes listed in the FAQ and I have my Vcount and key registers set up as volatile but it's likely I need it for some other things I haven't thought of.
The problem is only with my sprites, the backgrounds seem to be fine as they are only loaded once at the beginning but the sprites are DMA transferred in each time a different frame of animation is needed so the OAM data should always be pointing to the same place in VRAM.
Looking at the VBA debug stuff the problem seems to be in a few areas, firstly using the tile viewer I can see that the sprites section is filled with nonsense, kinda like when you use map data as tiles by mistake. If I leave it on Automatic update I can see that sometimes the right sprite appears to be in VRAM but only for a brief second and then it's back to nonsense again. On top of this the OAM data seems to change too, later entries I don't use seem to change position, size etc. and my sprites move too, sometimes ending up at 0, 0 and becoming 8x8 instead of 32x32.
All in all a bit of a scary prospect but at least it must be with the sprites since the backgrounds and gamelogic seem fine. I've also checked that it is the same on VBA and hardware, which it is. I'm guessing my problems might be with more registers needing to be made volatile or perhaps I'm relying on some data to be initialised as zero when in non optimised mode. Any suggestions?
_________________
The problem is only with my sprites, the backgrounds seem to be fine as they are only loaded once at the beginning but the sprites are DMA transferred in each time a different frame of animation is needed so the OAM data should always be pointing to the same place in VRAM.
Looking at the VBA debug stuff the problem seems to be in a few areas, firstly using the tile viewer I can see that the sprites section is filled with nonsense, kinda like when you use map data as tiles by mistake. If I leave it on Automatic update I can see that sometimes the right sprite appears to be in VRAM but only for a brief second and then it's back to nonsense again. On top of this the OAM data seems to change too, later entries I don't use seem to change position, size etc. and my sprites move too, sometimes ending up at 0, 0 and becoming 8x8 instead of 32x32.
All in all a bit of a scary prospect but at least it must be with the sprites since the backgrounds and gamelogic seem fine. I've also checked that it is the same on VBA and hardware, which it is. I'm guessing my problems might be with more registers needing to be made volatile or perhaps I'm relying on some data to be initialised as zero when in non optimised mode. Any suggestions?
_________________
Code: |
CanIKickIt(YES_YOU_CAN); |