Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: AGB_FIRM sleep: Simulate buttons on lid close #1691

Closed
joemck opened this issue Nov 20, 2021 · 3 comments
Closed

Suggestion: AGB_FIRM sleep: Simulate buttons on lid close #1691

joemck opened this issue Nov 20, 2021 · 3 comments

Comments

@joemck
Copy link

joemck commented Nov 20, 2021

Is it possible to get AGB_FIRM to simulate a button combination on lid close?

We have sleep patches for GBA games where you push one button combination to put the game to sleep, then push another button combo or open the lid and it wakes up. Is it possible to get AGB_FIRM to send the sleep button combo when you close the lid? Even just a single hardcoded button combination that can be turned on or off on the config menu would be great. The default one seems to be L+R+select, at least in the New Super Ultimate Injector, but we can set it to almost anything.

@asdolo
Copy link

asdolo commented Mar 13, 2022

This is actually possible. AGB_FIRM already does that 🙂 (not sure about OPEN_AGB_FIRM though...)

Check this: https://www.3dbrew.org/wiki/3DS_Virtual_Console#Config

image

I already tested it and it works!

0000000001 in binary -> A button
0000000010 in binary -> B button
0000000100 in binary -> Select button
0000001000 in binary -> Start button
0000010000 in binary -> Right button
0000100000 in binary -> Left button
0001000000 in binary -> Up button
0010000000 in binary -> Down button
0100000000 in binary -> R button
1000000000 in binary -> L button

So lets say your GBA game goes to sleep when you press L+R+Select. The bitmask for that combination is 1100000100 in binary = 0x0304 in hex. Then, 0x0304 represented in little-endian is 0x04 0x03, so you should place 04 03 in position 0x00E of the GBA footer, like this:

IakvbC8Yt1

@joemck
Copy link
Author

joemck commented Mar 13, 2022

Wth... Nintendo even cited not being able to get sleep mode to work properly as a reason they never released GBA VC games outside of the ambassador program, and added that notice on the bottom screen about sleep not working, and it turns out they had a complete fix that only needs a sleep patch to work on most games? Amazing.

I'm off to manually take apart, hex edit and rebuild my GBA VC injects then. I really wish NSUI set this field when building a GBA inject with the optional sleep patch.

I opened this ticket thinking AGB_FIRM needed patching to do this and that Luma could do it. Now my only issue is with NSUI, so I'm closing my ticket here.

@joemck joemck closed this as completed Mar 13, 2022
@asdolo
Copy link

asdolo commented Mar 13, 2022

I'll add this feature to NSUI eventually. For now at least it's documented here for anyone 😛.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants