#78197 - qw3rky - Wed Apr 05, 2006 10:12 pm
I am having serious trouble getting the vblank swi to work on the DS. I'm building my own minimalistic DS library for educational purposes and because I'm absurdly picky over naming things, and I've done the same already with the GBA, so I'm no n00b at coding interrupts. I've tried compiling the ISR as ARM only, putting it in ITCM, putting it in IWRAM, and it just won't work. My current code does work fine in iDeaS, but not in Dualis (which is becoming my favorite emulator) or actual hardware.
here's my SWI call: (carried over from my GBA code)
here's my interrupt initialization:
and here's my isr:
DSTek says that an ARM9 interrupt can be either ARM or THUMB code, so it seems there's no need to compile it separately as ARM like we had to do with the GBA. So it seems like my code should work perfectly fine, which it does on iDeaS, but if it doesn't work on hardware, I consider it completely useless. The Vsync is the most essential timing mechanism you can have in a console game, so obviously this is pretty important for me to sort out. Does anyone know what I'm doing wrong?
_________________
I've coded about 17 different implementations of Pong. It's the game dev's "hello, world".
DualScheme - Scheme Interpreter for DS
here's my SWI call: (carried over from my GBA code)
Code: |
#ifdef __thumb__ #define vsync() asm volatile("swi 0x5") #else #define vsync() asm volatile("swi 0x50000") #endif |
here's my interrupt initialization:
Code: |
disableInterrupts(); // IME = 0 InterruptHandler = (uint32) isr; InterruptEnable |= VBLANK_INTR_ENABLE; DisplayStatus |= VBLANK_INTR_REQUEST; enableInterrupts(); // IME = 1 |
and here's my isr:
Code: |
void isr() { /* disable interrupts */ disableInterrupts(); /* acknowledge flags */ InterruptCheck |= VBLANK_INTR_ENABLE; InterruptFlags |= VBLANK_INTR_ENABLE; /* re-enable interrupts */ enableInterrupts(); } |
DSTek says that an ARM9 interrupt can be either ARM or THUMB code, so it seems there's no need to compile it separately as ARM like we had to do with the GBA. So it seems like my code should work perfectly fine, which it does on iDeaS, but if it doesn't work on hardware, I consider it completely useless. The Vsync is the most essential timing mechanism you can have in a console game, so obviously this is pretty important for me to sort out. Does anyone know what I'm doing wrong?
_________________
I've coded about 17 different implementations of Pong. It's the game dev's "hello, world".
DualScheme - Scheme Interpreter for DS