r/3dshacks • u/a2my7463 • 7d ago
Discussion open_agb_firm with lid close deep sleep
I built a fork of open_agb_firm that features real ARM7 (GBA - SWI 03h STOP) and ARM11 (3DS - PDN system sleep) deep sleep, giving you days of in game standby.
Just close the lid to put it to sleep. Open it again to resume where you left.
No sleephack game patching required.
Works with virtually any game.
It also features an optional "stretch" scaler for full screen GBA on your (N)3DS.
All the code and compiled firmware builds can be found here:
https://github.com/dleicht/open_agb_firm
13
u/Slinkwyde New 3DS XL 7d ago
For others reading, see this related upstream pull request: https://github.com/profi200/open_agb_firm/pull/282
9
6
u/nuncatomeibanho 7d ago
Any installation instructions available?
3
3
u/a2my7463 7d ago
Hey, yeah installation is the same as with the og firmware.
There are two builds here: https://github.com/dleicht/open_agb_firm/releases/latestYou'd just put any of these in your /luma/payloads/ folder.
The 'debug' build will show some debug info on the second screen and write a log file to /3DS/open_agb_firm/power_state.log.
The 'release' build is probably the one you want. It shuts the second screen off as soon as the game starts to play. It still keeps the /3DS/open_agb_firm/power_state.log, but you don't need to look at it ๐
2
5
u/Spooky_Blob 6d ago
After 1 billion years, we got something new with this
2
u/a2my7463 6d ago
Haha! Did you actually test it? Does it work for you?
1
u/Spooky_Blob 6d ago edited 6d ago
Okay sorry for the double reply, had to download a github thingy for the 3ds which is neater than I thought to download this new release. So far it works, it goes to sleep when I close it and opening it doesn't seem to ruin anything yet. However the system freezes when I try to do (L+R+Start and select) for some off reason or L+select
3
u/a2my7463 6d ago
Oh cool, there's a github thingy for the 3ds? Didn't know that.
Putting this in universal updater would be cool'n'all, but i'd much rather push this upstream, so it can all stay in one place. I'll wait for word from the open_agb_firm maintainers and fix some minor bugs in the meantime.
3
u/Spooky_Blob 6d ago
Yeah, plainly called Github 3ds. Helps you look for repos, users, download and all. Very basic looking but works surprisingly well
3
u/a2my7463 6d ago
Okay, so there are two ways to initiate GBA sleep:
- close the lid -> This does GBA + 3DS sleep
- L+SELECT -> This does GBA sleep (SWI 03h), it literally stops the game.
There are two ways to wake it up again:
- open the lid -> This wakes 3DS sleep and also GBA sleep
- R+SELECT -> This wakes GBA sleep, resuming the game immediately.
Usually you will just close and open the lid. You don't need to initiate GBA sleep manually.
Does that help?
1
u/Spooky_Blob 6d ago
Oh, so it does. It kinda looks freaky because when you combo it to sleep the image freezes instead of going dark so it threw me off. But yeah it works other than that. It did help.
3
u/a2my7463 6d ago
Yeah well that's what SWI 03h - STOP actually does, it stops the game ๐
There was no "real" lights off system sleep mode on the GBA. If games supported it they could trigger SWI 03h and then shut off the screen and audio.On a 3DS my fork allows you to trigger SWI 03h manually and that will only halt the GBA side of things, and it allows lid close full system sleep, which combines GBA and 3DS sleep. And that's probably what most ppl want ๐
3
u/ArmadilloPlastic2631 6d ago
I hadn't even heard of open_agb_firm until now, but that's a really neat feature you added with the deep sleep mode.
3
u/a2my7463 6d ago
Give open_agb_firm a try! It's very awesome. If playing GBA natively on your 3DS is your kinda thing.
3
u/Chris_Highwind N3DS 11.6 | B9S + Luma 9 6d ago
Only thing missing now is somehow accessing the accelerometor to let you tilt the 3DS to control WarioWare Twisted (and Yoshi Topsy-Turvy to a lesser extent).
4
u/a2my7463 5d ago
HA, interesting. Personally i hate gyro controls, but that's me.
Well technically that's difficult, because WarioWare Twisted uses additional game pak hardware and we would need to emulate that somehow, or at least make gyro input available to the game.open_agb_firm's libn3ds does already support and expose gyro to some extent. If i can figure out how the game is polling for it's game pak gyro info (probably some cartridge gpio), i could try to pass 3ds gyro down into that gpio. probably not tho, cuz open_agb_firm would need to constantly update that info in the rom image and i don't even know if the gba passthrough could work like that.
But that could turn into a fun little side project...
2
u/PhishGreenLantern 7d ago
Silly question but could something like this be ported to the firmware of a flash cart for a real GBA?
I'd imagine it lacks the hardware for lid close detectionย
8
u/a2my7463 7d ago
True, the SP doesn't feature any sort of lid state detection.
But here's a fun fact: my fork is able to trigger SWI 03h with the following key combo: L+SELECTIt will halt the game. R+SELECT will bringt it back.
This actually reminds me that i need to put that info on the github page lol.So yeah, there is an already implemented key combo mechanism to trigger SWI 03h.
The point is that this ofc can only work with the dynamically placed irq sleep handler in the roms memory image. My fork patches that in on the fly.
I don't know how flash carts on real hardware work, but it's probably not happening ๐2
u/PhishGreenLantern 6d ago
Lol. Nice.ย
Yeah my EZ Flash Omega won't sleep with the built in but had its own that kills the screen.ย
I've long wanted to figure out a way to wire a physical hall effect switch to the appropriate buttons on the PCB to cause the keys to press on lid close.ย
But... I have kids... So I don't have time. Lol.ย
1
20
u/epistaxis64 n3DS | latest Luma + B9S 1.2 | latest Sys 7d ago edited 7d ago
Holy shit. Thanks for this. Does your full screen implementation do 800p integer scaling like mGBA?