I was playing a gba game and noticed that when i closed the lid the ds does not go to sleep??
is this normal?
is this normal?
The DS games have to be programmed to go to sleep mode when the DS is closed?
Or is it already an in-built function for all DS games.
Dwedit said:Apparently, GBATA does indeed do this already. However, GBATA's version does not appear to shut down the screen and sound hardware properly, or make any attempt to hide the sleep sequence joystick buttons from the game. (my tool suppresses START if you hold down L+R then hit start, doesn't do anything about L or R though.). With my tool, the wake up sequence is also filtered from the game since it waits for you to let go, then waits 3 frames afterwards.
The programs both work differently. His program changes the first instruction to jump to some code at the end, which installs the IRQ handler. Then any time the game would install its own IRQ handler, it redirects the address to another address designated as the "game's IRQ address". The IRQ handler sits in cartridge space, and the game jumps there first, then jumps to the real IRQ handler. His tool also appears to add a huge overhead of 17 instructions (arm instructions executed from cartridge space...ouch) to all interrupts, which is about a whopping 5% cpu usage if hblank interrupts are enabled.
My program modifies the code when a game tries to install an interrupt to instead jump (so it changes the write to a long jump... weeee) to a custom interrupt installing routine, which sets up the 'game's IRQ address', and installs 7 words of fast IRQ code at the top of the supervisor stack, then sets the interrupt handler to point there. My IRQ handler only has 4 instructions (in iwram) of overhead for non-vblank interrupts.
I guess his idea to hijack the first instruction, then alter the address of all the game's irq installers was probably a better idea.
Other differences between the program is that his tool fails on Final Fantasy 5, when mine doesn't.
Ok, what about GBA games that support pseudo-sleep (like Metroid Fusion and Zero-Mission)? When i activate the sleep mode, they dim and then almost instantly wake up. Do i need to patch them or something like that?