Homebrew [WIP] ButtonSwap3DS - Remap buttons on your 3DS

danger229

Well-Known Member
Newcomer
Joined
Mar 1, 2017
Messages
56
Trophies
0
Age
26
XP
1,356
Country
United States
This is a really dumb question but I don't understand the instructions. Where do I put this in the sc card so I can run it? Do I need to run it through a java program first? Or just put it in the 3DS folder?
if you are just using the cia that i gave to you, just put the cia onto your sd card and install it using FBI, if you are trying to make your own versions using my java program, you put the .jar into the folder with all the other ButtonSwap3ds Stuff, once you launch the maker program use the buttons to select the filenames for the icon, banner, audio and rsf, all of these should be found in the meta folder, after that you will want to add the rebinds that you want, for example, to swap the L and R buttons you would set the left side to be L and the right side to be R and then click the Save values to slot button, from there select the next slot (in this case slot 2) and just reverse the bindinds from the first slot, ( Left side, R and Right side, L) save once again and then click the build button, you can use the Build mode3 button if you are using a mode3 rsf file. if that was too complicated i could probably make a video about how to use the program.
 
  • Like
Reactions: Taisie

Taisie

Active Member
Newcomer
Joined
Jul 1, 2017
Messages
26
Trophies
0
Age
32
XP
76
Country
United States
if you are just using the cia that i gave to you, just put the cia onto your sd card and install it using FBI, if you are trying to make your own versions using my java program, you put the .jar into the folder with all the other ButtonSwap3ds Stuff, once you launch the maker program use the buttons to select the filenames for the icon, banner, audio and rsf, all of these should be found in the meta folder, after that you will want to add the rebinds that you want, for example, to swap the L and R buttons you would set the left side to be L and the right side to be R and then click the Save values to slot button, from there select the next slot (in this case slot 2) and just reverse the bindinds from the first slot, ( Left side, R and Right side, L) save once again and then click the build button, you can use the Build mode3 button if you are using a mode3 rsf file. if that was too complicated i could probably make a video about how to use the program.

Okay, I put it into the 3ds folder in the root of the sd card. It hasn't shown up though. Is that because I have to run it through FBI? I am using the swap so I can finish running udsploit for the first time. I haven't been able to finish the homebrew setup because my Start button is broken. Can I still run this through FBI first? I've also asked for help on the Noob forum too. I don't want to mess anything up. Also, thank you so much for all your help. A lot of this is way over my head so I wouldn't know what to do next without this community.
 

danger229

Well-Known Member
Newcomer
Joined
Mar 1, 2017
Messages
56
Trophies
0
Age
26
XP
1,356
Country
United States
Okay, I put it into the 3ds folder in the root of the sd card. It hasn't shown up though. Is that because I have to run it through FBI? I am using the swap so I can finish running udsploit for the first time. I haven't been able to finish the homebrew setup because my Start button is broken. Can I still run this through FBI first? I've also asked for help on the Noob forum too. I don't want to mess anything up. Also, thank you so much for all your help. A lot of this is way over my head so I wouldn't know what to do next without this community.
I dont think you will be able to install the rebind, I think it needs cfw to install since its not a legit title, it might be possible to change what button udsploit uses but i dont know how to work with the code for that so i cant help you there, maybe someone in the discord or the irc can help you with that problem
 
  • Like
Reactions: Taisie

Taisie

Active Member
Newcomer
Joined
Jul 1, 2017
Messages
26
Trophies
0
Age
32
XP
76
Country
United States
I dont think you will be able to install the rebind, I think it needs cfw to install since its not a legit title, it might be possible to change what button udsploit uses but i dont know how to work with the code for that so i cant help you there, maybe someone in the discord or the irc can help you with that problem
Thank you for getting back to me on it. I appreciate it. I'll look into what you recommended.
 

ChipJockey

Active Member
Newcomer
Joined
Jun 25, 2017
Messages
38
Trophies
0
Age
28
XP
221
Country
Poland
Hi, total noob here if it comes to compiling. Can someone make a build that swaps X and B, pretty please? It would be really helpful for GB games. It annoys me that you can't use X in GB VC like in NES VC, because it would help a lot in platformers.
 

danger229

Well-Known Member
Newcomer
Joined
Mar 1, 2017
Messages
56
Trophies
0
Age
26
XP
1,356
Country
United States
Hi, total noob here if it comes to compiling. Can someone make a build that swaps X and B, pretty please? It would be really helpful for GB games. It annoys me that you can't use X in GB VC like in NES VC, because it would help a lot in platformers.
Sorry this one took a bit, been binge watching some stuff, this version is a little different than other versions that can be found, i tweaked one of the files to remove mention of BootNTR since its not needed to run the app for extended memory mode games if the rsf that was used is right. EDIT: as a reminder to anyone who wanders, if you need a version of ButtonSwap3ds built for you and don't have a desire to use my program that i linked in my sig, shoot me a pm or let me know somehow,
 

Attachments

  • ChipJockey.zip
    363.5 KB · Views: 131
Last edited by danger229,

ChipJockey

Active Member
Newcomer
Joined
Jun 25, 2017
Messages
38
Trophies
0
Age
28
XP
221
Country
Poland
Sorry this one took a bit, been binge watching some stuff, this version is a little different than other versions that can be found, i tweaked one of the files to remove mention of BootNTR since its not needed to run the app for extended memory mode games if the rsf that was used is right. EDIT: as a reminder to anyone who wanders, if you need a version of ButtonSwap3ds built for you and don't have a desire to use my program that i linked in my sig, shoot me a pm or let me know somehow,
Thank you so much dude! To be honest, I didn't even saw your software and I'm curious to test it out. Again, thanks a bunch!
 

Noahs200010

New Member
Newbie
Joined
Aug 29, 2017
Messages
1
Trophies
0
Age
23
XP
41
Country
United States
Could anyone who still needs a build of this reply to me with what they need, i am going to be testing a program that i just finished making that builds these versions quickly and will be testing it over the next few days before seeing about releasing it.
Can you make me one that swaps A<>B X<>Y
 

OblivionReign

Developer
Developer
Joined
Apr 23, 2016
Messages
2,540
Trophies
2
XP
7,672
Country
Japan
I originally started looking into swapping buttons when I got the MHGen hunting grip. I've always thought Nintendo's placement of the L/R and ZL/ZR is backwards from everyone else, and I don't like it. While searching for something to swap the two, I looked at the source for InputRedirection from @Stary2001. If you don't know how it works, it hooks into the HID process (which is responsible for user input), and redirects where the values for user input are read from in memory through Arm assembly.
His patch was pretty easy for me to read to see what was going on, and I thought, "What if we could get the values from what buttons were pressed, then modify the values before the value gets written to this redirected memory?" After some experimentation, it worked!

I've put quite a bit of work to make this as user-friendly as possible, but be aware of a few things:
  • This code works at almost the lowest level possible-assembly code; it is really hard to debug. As long as you don't touch the other functions (.single, .combo, .touch, .cpad), the worst that can happen is your console will get bad input data and be uncontrollable. Just reboot and try a different configuration.
  • You cannot reconfigure this on the 3DS! Every time you want to change your button mappings, you need to edit the injected file and recompile the program. Hopefully I can change that in the future - I'm open to help for this.
  • The C-stick and ZL/ZR are not mappable right now. I'm looking into hooking the IR process to achieve this.
  • The Home button and Power button are not remappable. These buttons use a separate part of the hardware, and there are no plans to make this possible.
  • While based on InputRedirection, it is not compatible. This program would overwrite any data sent by the InputRedirection desktop programs.
  • It can still be a bit buggy. It is designed to un-press any buttons that were pressed if you use touchscreen or C-pad mappings, but I noticed that it doesn't always work when used with combos. YMMV.
  • I've just merged with Stary's latest changes, but I haven't tested the Mode3 version, as I don't have an O3DS.
How To Use
Code is located at my repo: https://github.com/MikahJC/ButtonSwap3DS
You will need a working setup of the devkitARM toolchain for 3DS, follow this guide if you need help: https://www.3dbrew.org/wiki/Setting_up_Development_Environment.
You will also need this library by @Stary2001: https://github.com/Stary2001/ScenicRoute. Clone it, then run make install in the ScenicRoute directory.
Finally, clone the repository at https://github.com/MikahJC/ButtonSwap3DS.
The instructions for each type of mapping are provided in the source/injected.s file. I've provided a Java program to generate the correct button masks and coordinate values. When you have saved your mappings into this file, you will need to compile it. To build, change to the ButtonSwap3DS directory in a terminal, then run make.
This is the data that defines which buttons will activate the remapping and which buttons will be pressed as a result. Either use the provided program, or manually calculate the mask using this table. For example, this code would swap A and B:
Code:
ldr r4, =0x1
ldr r5, =0x2
bl .button
ldr r4, =0x2
ldr r5, =0x1
bl .button
The next two data fields are six-digit numbers. The first 3 digits are the Y coordinate data, and the last 3 digits are the X coordinate data.
The data that will be sent as the touchscreen. Use the provided tool to generate this data.
Data that will be sent as the c-pad. This data is a bit harder to calculate. The default value for the C-pad is 0x800800. To calculate this value, you will need to use the developer mode on your calculator. Xor 0x800800 by the value you want the C-pad to have. For example, if you want to have the C-pad pushed to the right, you would xor 0x800800 by 0x800FFF, giving you 0x7FF. Pad this with 3 zeroes in front (0x0007FF), and you have your data!
I've attached a basic version that swaps A and B for demonstration purposes.

Thanks and credit to @Stary2001. He wrote all of the injection code and almost all of the setup code. I just figured out how to mess with the values in-between. :)
2/15/2017: Uploaded a new zip with the mode3 version as well.
3/28/2017: @Vague Rant pointed out an error with the combo swap documentation. Thanks!
4/15/2017: Changed how button pressing and un-pressing works. As @Vague Rant and @rolim91 pointed out, multiple mappings had the possibility of affecting each other, resulting in undesirable results when multiple buttons were pressed. The new system maintains a record of which buttons need to be pressed and unpressed, then applies all changes at the end of the mapping process. My initial testing shows that it is working much better, but I appreciate any feedback if there are still bugs.
Oooh looks cool o:
 

Uumas

Well-Known Member
Member
Joined
Sep 17, 2016
Messages
2,004
Trophies
0
Age
21
XP
1,147
Country
Finland
So does "c-stick and ZL ZR not mappable" mean that I can't make them act as any other button or make can't make other buttons act as them or I can do neither?
 

danger229

Well-Known Member
Newcomer
Joined
Mar 1, 2017
Messages
56
Trophies
0
Age
26
XP
1,356
Country
United States
So does "c-stick and ZL ZR not mappable" mean that I can't make them act as any other button or make can't make other buttons act as them or I can do neither?
di
it means that you can not use c-stick, ZL or ZR as an input for a rebind, or as an output of a rebind.
 
  • Like
Reactions: Uumas

panoschuvardas

Well-Known Member
Newcomer
Joined
Sep 22, 2015
Messages
91
Trophies
0
Age
25
XP
151
Country
Greece
Hey peeps! Is it possible for someone to create me a patch that swaps y with select and x with start? And one that reverses it.. for playing gba games and normal ones :D
 

danger229

Well-Known Member
Newcomer
Joined
Mar 1, 2017
Messages
56
Trophies
0
Age
26
XP
1,356
Country
United States
Hey peeps! Is it possible for someone to create me a patch that swaps y with select and x with start? And one that reverses it.. for playing gba games and normal ones :D
i think i understood what you waned. if there is a problem, get in contact with me and let me know
 

Attachments

  • panoschubardas.zip
    363.5 KB · Views: 142

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: