r/3dshacks • • Aug 23 '26

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

140 Upvotes

31 comments sorted by

23

u/epistaxis64 n3DS | latest Luma + B9S 1.2 | latest Sys Aug 24 '26 edited Aug 24 '26

Holy shit. Thanks for this. Does your full screen implementation do 800p integer scaling like mGBA?

10

u/a2my7463 Aug 24 '26

Hey, no, not yet. Simply because i personally like the look of 400x240.
But libn3ds does support 800x240 already.
I'll add it to the todo list ๐Ÿ‘

2

u/epistaxis64 n3DS | latest Luma + B9S 1.2 | latest Sys Aug 24 '26

I'll add it to the todo list ๐Ÿ‘

Very cool. Thanks!

14

u/Slinkwyde New 3DS XL Aug 24 '26

For others reading, see this related upstream pull request: https://github.com/profi200/open_agb_firm/pull/282

10

u/communist_llama Aug 24 '26

Hoping this gets up streamed. Incredible

1

u/a2my7463 Aug 24 '26

Thanks mate โค๏ธ

5

u/nuncatomeibanho Aug 24 '26

Any installation instructions available?

3

u/Frebb0 Aug 24 '26

Download open_agb_firm as usual (via Universal Updater is fine), then just drop the new .firm file in your /luma/payloads directory and launch that one instead

3

u/a2my7463 Aug 24 '26

Hey, yeah installation is the same as with the og firmware.
There are two builds here: https://github.com/dleicht/open_agb_firm/releases/latest

You'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

u/nuncatomeibanho Aug 25 '26

Thank you. Works very well!

3

u/Spooky_Blob Aug 24 '26

After 1 billion years, we got something new with this

2

u/a2my7463 Aug 24 '26

Haha! Did you actually test it? Does it work for you?

1

u/Spooky_Blob Aug 24 '26 edited Aug 24 '26

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 Aug 24 '26

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 Aug 24 '26

Yeah, plainly called Github 3ds. Helps you look for repos, users, download and all. Very basic looking but works surprisingly well

3

u/a2my7463 Aug 24 '26

Okay, so there are two ways to initiate GBA sleep:

  1. close the lid -> This does GBA + 3DS sleep
  2. L+SELECT -> This does GBA sleep (SWI 03h), it literally stops the game.

There are two ways to wake it up again:

  1. open the lid -> This wakes 3DS sleep and also GBA sleep
  2. 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 Aug 24 '26

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 Aug 24 '26

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 Aug 24 '26

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 Aug 24 '26

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 Aug 25 '26

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).

3

u/a2my7463 Aug 25 '26

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 Aug 24 '26

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ย 

7

u/a2my7463 Aug 24 '26

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+SELECT

It 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 Aug 24 '26

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

u/Vortigaunt11 Aug 24 '26

Works great!

1

u/a2my7463 Aug 24 '26

Glad to hear it ๐Ÿ‘

1

u/mayong13 24d ago

Wow! this is world breaking feature ever!

2

u/a2my7463 24d ago

Glad you like it :)

2

u/mayong13 24d ago

I just try OG open_agb_firm a few day ago and mildly annoy about cant sleep without turn off console. Love your version xoxo

thanks again