#162981 - strat - Wed Sep 17, 2008 7:19 pm
Hey, I've got a little problem with no$gba, tried searching for the same thing...
When you're using swi 0x5 (in thumb mode) and no$gba gives you a black screen, no warning (i.e. no "bad header checksum real Gameboy would shut down"), says you have exactly one error, and low power is unsupported, but it all runs fine in VBA, what could you possibly have done wrong?
Also, if I set/unset the force blank flag at the start of the rom, it stays gray.
#162982 - tepples - Wed Sep 17, 2008 7:26 pm
You said "swi". Have you dumped your GBA's BIOS, or are you using the high-level-emulated BIOS built into the emulator?
You said "swi 5". This is VBlankIntrWait(). On a GBA, this function requires that you have already installed a conforming ISR (interrupt service routine). VBA's HLE BIOS may not emulate this requirement. There's a working ISR in libgba, which you can use by putting this at the top of main():
Code: |
irqInit();
irqSet(IRQ_VBLANK, Vblank);
irqEnable(IRQ_VBLANK); |
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#162983 - strat - Wed Sep 17, 2008 7:36 pm
Found the problem. It was putting a large data array in iwram (normally I put these in rom and declare them const or .rodata but this is a map that was being accessed just often enough to slow down the program so I thought an extra copy in iwram would help. It's being used by both collision detection and screenblock updating).
Also, I forgot to mention there's an isr, but thanks anyway.
#163085 - strat - Mon Sep 22, 2008 3:32 am
Huh. After some experimenting, it looks like pre-allocating too much RAM causes no$gba to lock up. And there's no way I could have used it all up. Soon as I add another array in EWRAM or even a static var to a subroutine, it totally fails. But it still runs in VBA. Another "last straw" was passing a reference to a local var, then modifying its value in the called routine. I wonder if the stack is overwritten?
I'll just try to use less RAM for now.