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.

C/C++ > "Sleep" mode?

#26535 - ImInABand - Fri Sep 17, 2004 11:44 pm

can anybody explain to me which register is used to enable "sleep mode" AKA power conservation mode, and what methods are required to enable/disable sleep mode.

#26540 - tepples - Sat Sep 18, 2004 1:15 am

To put the GBA in sleep mode, make sure you have a working ISR, then do the following:
  1. Fade video to white and then blank it (DISPCNT = 0x0080).
  2. Set up the joypad interrupt.
  3. Block all other interrupts in the mask (IF).
  4. Call SWI 3 (see details in GBATEK).
  5. Restore interrupts.
  6. At next vblank, turn on video.

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.


Last edited by tepples on Sat Sep 18, 2004 2:02 pm; edited 1 time in total

#26541 - ImInABand - Sat Sep 18, 2004 1:24 am

thanks tepples, i'll piddle around with it.