Homebrew Modify godmode9 buttons

alx4130

New Member
OP
Newbie
Joined
May 25, 2022
Messages
1
Trophies
0
Age
19
Location
CDMX
XP
8
Country
Mexico
I need help with godmode9, I need to decrypt many cias for citra but it takes me a long time because I can't select many cias at the same time because my L and R buttons don't work, is there a way or something to modify the godmode9 buttons?
 

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
29,903
Trophies
2
XP
19,547
Country
United States
I can't even compile it. maybe @Pk11 can help both of us:

C:\Users\GODREBORN\Desktop\a\GodMode9>make firm
Building arm9/arm9.elf
make[1]: Nothing to be done for 'all'.
Building arm11/arm11.elf
make[1]: Nothing to be done for 'all'.
Creating output/vram0.tar
add: aeskeydb.bin
add: easter.bin
add: font_default.frf
add: GodMode9_splash.png
[FLAVOR] GodMode9
[VERSION] v2.1.1-1-g658c9b49
[BUILD] 2022-05-24 19:07:12
[FIRM] output/GodMode9.firm
/opt/devkitpro/msys2/usr/bin/python3.exe: No module named firmtool
make: *** [Makefile:99: firm] Error 1
 

Pk11

A catgirl with a DSi
Member
Joined
Jun 26, 2019
Messages
816
Trophies
1
Age
20
Location
米国
Website
pk11.us
XP
2,732
Country
United States
I can't even compile it. maybe @Pk11 can help both of us:

C:\Users\GODREBORN\Desktop\a\GodMode9>make firm
Building arm9/arm9.elf
make[1]: Nothing to be done for 'all'.
Building arm11/arm11.elf
make[1]: Nothing to be done for 'all'.
Creating output/vram0.tar
add: aeskeydb.bin
add: easter.bin
add: font_default.frf
add: GodMode9_splash.png
[FLAVOR] GodMode9
[VERSION] v2.1.1-1-g658c9b49
[BUILD] 2022-05-24 19:07:12
[FIRM] output/GodMode9.firm
/opt/devkitpro/msys2/usr/bin/python3.exe: No module named firmtool
make: *** [Makefile:99: firm] Error 1
I think to fix that error you just need to install firmtool, should just be pip install -U git+https://github.com/TuxSH/firmtool.git as per the README. (Depending on how Python is installed you may need to swap pip for pip3, python3 -m pip, or py -3 -m pip)

I need help with godmode9, I need to decrypt many cias for citra but it takes me a long time because I can't select many cias at the same time because my L and R buttons don't work, is there a way or something to modify the godmode9 buttons?
It seems it's very simple to swap around the buttons, just gotta swap around a couple defines. I've attached a build with L/SELECT and R/START swapped, I didn't change anything visually so just press SELECT whenever it says L and START whenever it says R, I picked those since they're rarely used but I can do something else if needed.

Diff:
diff --git a/common/hid_map.h b/common/hid_map.h
index 7f2ac2a..083f04b 100755
--- a/common/hid_map.h
+++ b/common/hid_map.h
@@ -2,14 +2,14 @@
 
 #define BUTTON_A      ((u32)1 << 0)
 #define BUTTON_B      ((u32)1 << 1)
-#define BUTTON_SELECT ((u32)1 << 2)
-#define BUTTON_START  ((u32)1 << 3)
+#define BUTTON_SELECT ((u32)1 << 9)
+#define BUTTON_START  ((u32)1 << 8)
 #define BUTTON_RIGHT  ((u32)1 << 4)
 #define BUTTON_LEFT   ((u32)1 << 5)
 #define BUTTON_UP     ((u32)1 << 6)
 #define BUTTON_DOWN   ((u32)1 << 7)
-#define BUTTON_R1     ((u32)1 << 8)
-#define BUTTON_L1     ((u32)1 << 9)
+#define BUTTON_R1     ((u32)1 << 3)
+#define BUTTON_L1     ((u32)1 << 2)
 #define BUTTON_X      ((u32)1 << 10)
 #define BUTTON_Y      ((u32)1 << 11)
 #define BUTTON_ANY    0x00000FFF
 

Attachments

  • GodMode9_lr_swap.firm.zip
    272.5 KB · Views: 4
  • Like
Reactions: CoolMe and alx4130

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
29,903
Trophies
2
XP
19,547
Country
United States
I think to fix that error you just need to install firmtool, should just be pip install -U git+https://github.com/TuxSH/firmtool.git as per the README. (Depending on how Python is installed you may need to swap pip for pip3, python3 -m pip, or py -3 -m pip)


It seems it's very simple to swap around the buttons, just gotta swap around a couple defines. I've attached a build with L/SELECT and R/START swapped, I didn't change anything visually so just press SELECT whenever it says L and START whenever it says R, I picked those since they're rarely used but I can do something else if needed.

Diff:
diff --git a/common/hid_map.h b/common/hid_map.h
index 7f2ac2a..083f04b 100755
--- a/common/hid_map.h
+++ b/common/hid_map.h
@@ -2,14 +2,14 @@
 
 #define BUTTON_A      ((u32)1 << 0)
 #define BUTTON_B      ((u32)1 << 1)
-#define BUTTON_SELECT ((u32)1 << 2)
-#define BUTTON_START  ((u32)1 << 3)
+#define BUTTON_SELECT ((u32)1 << 9)
+#define BUTTON_START  ((u32)1 << 8)
 #define BUTTON_RIGHT  ((u32)1 << 4)
 #define BUTTON_LEFT   ((u32)1 << 5)
 #define BUTTON_UP     ((u32)1 << 6)
 #define BUTTON_DOWN   ((u32)1 << 7)
-#define BUTTON_R1     ((u32)1 << 8)
-#define BUTTON_L1     ((u32)1 << 9)
+#define BUTTON_R1     ((u32)1 << 3)
+#define BUTTON_L1     ((u32)1 << 2)
 #define BUTTON_X      ((u32)1 << 10)
 #define BUTTON_Y      ((u32)1 << 11)
 #define BUTTON_ANY    0x00000FFF
That's what I tried doing, but it still errors. It built firmware tool, but it's not in devkitPro. Do I need to put it in tools?
 

Pk11

A catgirl with a DSi
Member
Joined
Jun 26, 2019
Messages
816
Trophies
1
Age
20
Location
米国
Website
pk11.us
XP
2,732
Country
United States
That's what I tried doing, but it still errors. It built firmware tool, but it's not in devkitPro. Do I need to put it in tools?
Hmm, maybe try /opt/devkitpro/msys2/usr/bin/python3.exe -m pip install -U git+https://github.com/TuxSH/firmtool.git actually, looks like msys2 has its own special Python so try explicitly using its pip.
 
  • Like
Reactions: godreborn

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
29,903
Trophies
2
XP
19,547
Country
United States
Hmm, maybe try /opt/devkitpro/msys2/usr/bin/python3.exe -m pip install -U git+https://github.com/TuxSH/firmtool.git actually, looks like msys2 has its own special Python so try explicitly using its pip.
this error'd in windows. and, it says that it has to do with the package.
 

Pk11

A catgirl with a DSi
Member
Joined
Jun 26, 2019
Messages
816
Trophies
1
Age
20
Location
米国
Website
pk11.us
XP
2,732
Country
United States
this error'd in windows. and, it says that it has to do with the package.
Are you using msys2 or cmd? If you're using cmd might need to do C:\opt\devkitpro\msys2\usr\bin\python3.exe -m pip install -U git+https://github.com/TuxSH/firmtool.git (or whatever the exact path is, might need to leave out the "opt\")

I don't use Windows much so not sure exactly... I know it can be a bit of a pain with all the different msys2 and cmd and such, could also help to just run it in msys2 instead of cmd or the other way around.

Might also help to quote the URL in the command.
 
  • Like
Reactions: godreborn

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
29,903
Trophies
2
XP
19,547
Country
United States
1653445240020.png


I got it to work in linux easily. there always seem to be issues with windows. here's the error:

1653445319517.png
 
  • Like
Reactions: Pk11

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
29,903
Trophies
2
XP
19,547
Country
United States
Ah weird... Afraid I'm not sure why that would happen...
I give up on it. I figured out where the files are supposed to go, but once I got to no module _cffi_backend, I couldn't figure out how to fix it. it may not work in windows cmd prompt or at least, it takes a lot of struggling to force it to work.
 

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
29,903
Trophies
2
XP
19,547
Country
United States
@Pk11 , I was successful in windows cmd prompt:

1653468038550.png


I installed setuptools via pip (that's what was causing the error before, as it didn't know what to do with setup python scripts), then I install cffi, which created the backend file via the python3 that was in devkitpro's folder, and I installed pycryptodome as you can see above. And, I needed to install libffi and libffi-devel to get ffi.h via pacman. :D
 
Last edited by godreborn,
  • Like
Reactions: Pk11

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
29,903
Trophies
2
XP
19,547
Country
United States
@Pk11 , I had a great idea, to make an mklink for the python3.9 in the devkitpro folder, and naming it python4.exe. it should work. btw, you also don't need to install Crypto or pycryptodome. using that command to install firmtool will install pycryptodome as well. I fixed and optimized my setup, so now I'm making a disk image:

1653493705629.png


1653494075041.png
 
Last edited by godreborn,
General chit-chat
Help Users
  • No one is chatting at the moment.
    NeoGaming @ NeoGaming: but able for to sell it i had to unhomebrew it which was a pain