gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Flash Equipment > gba mode switch not booting gbamp :(

#129587 - spinal_cord - Wed May 23, 2007 11:53 pm

I'm switching to gba mode using the method in the following page -

http://www.bottledlight.com/ds/index.php/Main/GBAMode

but my gbamp doesn't boot, although its fine with other [pre-compiled] switchers on the net. Is there a way to fix this, or better code to use?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#129743 - cory1492 - Fri May 25, 2007 9:55 pm

There is a bit more to it than just that... from gbatek document, which appears to be MIA on the web at the moment...
Code:
Switching from NDS Mode to GBA Mode

  --- NDS9: ---
  ZEROFILL VRAM A,B     ;init black screen border (or other color/image)
  POWCNT=8003h          ;enable 2D engine A on upper screen (0003h=lower)
  EXMEMCNT=...          ;set Async Main Memory mode (clear bit14)
  IME=0                 ;disable interrupts
  SWI 06h               ;halt with interrupts disabled (lockdown)
  --- NDS7: ---
  POWERMAN.REG0=09h     ;enable sound amplifier & upper backlight (05h=lower)
  IME=0                 ;disable interrupts
  wait for VCOUNT=200   ;wait until VBlank
  SWI 1Fh with R2=40h   ;enter GBA mode, by CustomHalt(40h)

A small/simplistic demo I slapped together for someone not so long ago which compiles under R20:
resetgba.zip (not tested on GBAMP, that I am aware of any way)
There are alternates in discussions here already, which inline the assembly in the A7 as well...
Code:
   // Restart in gba mode
   __asm (".arm\n"
   "mov    r2, #0x40\n"
   "swi    0x1F0000\n"
   );


search is your friend...
http://forum.gbadev.org/viewtopic.php?p=122119#122119

#130117 - tondopie - Thu May 31, 2007 1:35 am

You can also acheive the same with a lot simpler way specified in hbfirmware. It needs some updating to DKA r20 mind you.