ROM Hack (Real Dumb Question) Control Hack for Super Mario 64 DS?

Steel-Winged_Pegasus

Well-Known Member
OP
Newcomer
Joined
Mar 2, 2018
Messages
80
Trophies
0
Age
27
XP
1,348
Country
United States
Yeah, the title is what it says on the tin, that's the short story.

The long story: I was recently wanting my SM64 DS fix, and I just... really find it a bit awkward (not unplayable, just awkward) to use the Circle Pad for the game, because it only emulates the D-pad. Was looking into making a super simple hack to just remap some of the buttons (B for attack, A jump, X and Y for camera controls, etc), but wondering if possible. I know someone made an analog mod of sorts, where the touch input movement is mapped to the D-pad (or maybe Circle Pad, I don't remember), so I know that much is possible, though IIRC, that's possible only in an emulator, and not on 3DS via DSiMenu++ (due to TWL firm needing to be hacked, or something like that), but I could be wrong. The Wii U VC version has an option to map the touch input to the analog stick on the Gamepad, apparently, but I really doubt it'll work like that on the 3DS.

Now, I really don't have any experience in hacking, so obviously, the first step for me is to read up on it and learn how the game's innards work. I VERY much doubt this will actually go anywhere, though. This was just me wondering if it's possible to make a hack like that. I know I could use DeSmuME, but if I can play such a hack on the 3DS, that'd be stellar!
 

Sono

cripple piss
Developer
Joined
Oct 16, 2015
Messages
2,821
Trophies
2
Location
home
XP
9,319
Country
Hungary
Yeah, the title is what it says on the tin, that's the short story.

The long story: I was recently wanting my SM64 DS fix, and I just... really find it a bit awkward (not unplayable, just awkward) to use the Circle Pad for the game, because it only emulates the D-pad. Was looking into making a super simple hack to just remap some of the buttons (B for attack, A jump, X and Y for camera controls, etc), but wondering if possible. I know someone made an analog mod of sorts, where the touch input movement is mapped to the D-pad (or maybe Circle Pad, I don't remember), so I know that much is possible, though IIRC, that's possible only in an emulator, and not on 3DS via DSiMenu++ (due to TWL firm needing to be hacked, or something like that), but I could be wrong. The Wii U VC version has an option to map the touch input to the analog stick on the Gamepad, apparently, but I really doubt it'll work like that on the 3DS.

Now, I really don't have any experience in hacking, so obviously, the first step for me is to read up on it and learn how the game's innards work. I VERY much doubt this will actually go anywhere, though. This was just me wondering if it's possible to make a hack like that. I know I could use DeSmuME, but if I can play such a hack on the 3DS, that'd be stellar!

I'm pretty sure button remapping is possible, even if the game uses LSL/BMI slide, Branch table, or simple bit tests (ordered from hardest to easiest).

As for analog input, that's another story. Since there is no unified analog input other than the touch screen, you need to come up with your own data transmission method which is compatible with the host of your choice.
On emulator you could hack it to be almost anything, because the emulator's CPU core must have a way to add or intercept memory values to act as analog input, and at that point you could directly map that memory value to the ARM9, so you won't even have to touch ARM7, making for easier patches.

On the 3DS it's a different story... you need to compile parts of Rtc3DS, namely rtcom.cpp from arm7, and the entirety of arm11 (which you need to modify).
After that you need to hack the compiled arm7 code into the game's ARM7 binary, write some initialization code which initializes rtcom (see arm7/main.cpp), and after a successful init, install rtcom's VBlank handler so it gets triggered on each VBlank (or you can also do ARM9 --> ARM7 --> ARM11 trigger if that sounds better for you, but you'll still need to wait for ARM11 to enter VBlank).
Once you have confirmed that rtcom integration was successful (the ARM11 doesn't hang during comms while still hearing sound), then you need to hack your own ARM7 code into ARM7 which communicates with your own ARM11 code. From there you're free to do whatever with the values. What Rtc3DS does is that it writes the values to an unused region in memory, which the ARM9 can read. This is probably the best solution, but other solutions are also possible (like sending the values over FIFO).
Now that the hardest(?) part is done, you just need to hack the ARM9-side code to read the values from the shared memory, and write it to its own analog input values (if it has any).
 

smileyhead

I like cute stuff.
Member
Joined
Aug 31, 2015
Messages
4,803
Trophies
3
Age
23
Location
Budakeszi, Hungary
Website
sites.google.com
XP
10,583
Country
Hungary
Be a real man and play the whole game with the DS thumb strap.

Like sad Bortz did in the summer of 2005.
I just looked it up and I never knew it existed, and Jesus Christ that thing looks terrible.
 
  • Like
Reactions: Sono

BORTZ

DO NOT SCREENSHOT
Supervisor
Joined
Dec 2, 2007
Messages
13,243
Trophies
3
Age
34
Location
Pittsburgh
XP
15,986
Country
United States
I just looked it up and I never knew it existed, and Jesus Christ that thing looks terrible.
So joking aside I did actually play the whole game with the strap and it actually worked really well. Obviously I wouldn't really suggest it to anyone as a serious play option but it actually works.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Veho @ Veho: Touché.