Update 2022-12-20:
The current version has a problem with the game's music slowdown by about 10-15%.
I've made an alternative version "v2" that uses slightly different faulty approach. Instead of working with the RTCom to communicate with the Arm11 all the time, it only uses it to upload a piece of code that would overwrite some RTC functionality of TwlBg (not permanently, of course) and would hijack the RTC regs to pass the CPad data instead of actual time.
Although, there are two problems with my implementation.
Firstly, in super rare cases it may (or maybe it can't anymore, I'm not sure) crash the console (because it modifies code at runtime, probably in front of another thread that theoretically can execute it at that moment; and I don't even want to think about caching). But it seems fine for now, I've relaunched the game like 40 times and it was okay.
Secondly, it overwrites part of functionality that may be actually important, but I've never seen this code executed myself (my guess is it has something to do with alarms, but I don't use them). In either way, I think this is an interesting idea when executed properly
Update 2022-12-23:
New version v2.3. This time the patch won't replace any potentially useful functionality of TwlBg (it most likely didn't before anyway). I've also changed a bit the way ZL&ZR work. They are no longer hardcoded to the camera rotation. They can be swapped or remapped to other functions such as crouching or jumping. To remap these two keys (and half of the others), just go
here, select your version, set preferred controls, and copy the AR code. Then the code can be added as usual in "r4cce" (as the new one, no need to extend this patch). However, I don't think this feature is very helpful.
In addition, I've added support for the iQue version of the game. And if someone's interested in the "technical" details of this project, there is also a
Github page for this whole project. The code may not be exactly understandable, but if one had enough motivation to include CPad, CStick, or Gyroscope support to another game, this part certainly wouldn't be the hardest.
Update 2023-01-03
v2.4. a few mostly cosmetic changes.
- Reduced the cheatcodes' size by half by using the "EXXXXXXX NNNNNNNN" AR instruction to copy bytes in bulk instead of word by word. The speed should also increase similarly. Before, I thought that these codes get somehow optimized or converted into ARM, but it seems like nds-bootstrap has
a piece of code that simply interprets them directly at runtime, 60 times per second, over and over again.
- The clock in nds-bootstrap's in-game menu now works properly. Solved by passing the CPad data through other RTC registers (alarm time 2 and DSi's counter).
- Reading RTC regs from NDS usually requires some kind of delay (gbatek says 5us for each bit transferred; nintendo puts a ~40 cycles there). But it looks like it's unnecessary in this case, everything works without them. That's naive, but I'd like to believe the reason for that is, as these legacy RTC registers are emulated, there are no real hardware behind it, thus delays aren't needed (on 3ds). The removal of these delays might be important, because some games (not this one, except for music) are hypersensitive to delays in their VBlank IRQ handlers.
- The problem with the sound distortions that I've mentioned somewhere around here has been finally solved (again). This time I rely on Arm11's RTCom autorelease feature (if I understand it correctly) to asynchronously initialize all the stuff and dynamically patch TwlBg. I think it used to take 20ms which was too much for Arm7 to swallow and so the distortions could pop up. Now Arm7 just sends one command to Arm11 to do all the work and doesn't wait for the answer (that frame).
Update 2023-01-18
I've created patches for several additional games.
Half of the patches are rather dumb and only use the CPad to control the direction of the main character, not their speed. Also, the cheats are mostly untested, I've only checked a few places here and there
- Metroid Prime: Hunters (New 3DS/New 2DS only) - the CPad controls Samus' movement (in both the morph ball form and the "normal" FPS form). The nub stick controls the camera's left/right and up/down movement. ZR opens/closes the Scan Visor. There is also a gyroscope support for controlling the camera, albeit super awkward. Pressing ZL + Down toggles the gyroscope, but it needs to be calibrated first. To do that, place the console on a flat surface (or just hold it still) and press ZL + Up. Pressing ZL + Left toggles between the gyro axis responsible for the camera's horizontal rotation (Y or Z). Essentially it depends on how you hold the console, probably the right way would be to interpolate between them based on the accelerometer data, but that's too much for a hack. Overall, just a dumb gimmick.
- Rayman DS - generally meaningless since the 3DS already has a native port that doesn't run in 16 fps (the DSi mode makes things just a little bit better). However, as a 3D platformer, it may be the best use case for such mods
- The Legend of Zelda: Spirit Tracks - the CPad also controls the rotation of the camera around the train. Additionally, CPad is unmapped from the dpad keys (because by default they open the menu, map, etc). But if you're going to play with the DPad mods (one and two), you'll need to put it back. For that, press the "L+R+Down" combination, it will map or unmap the dpad
- The Legend of Zelda: Phantom Hourglass - same, but for the ship
- Grand Theft Auto: Chinatown Wars
- Dragon Quest IX
- LEGO Star Wars: The Complete Saga
- Mini Ninjas
- Okamiden
- Animal Crossing: Wild World
Update 2023-01-25
- There was a problem when 3DS could just crash when starting a game (with 3-5% chance). I've fixed it and updated all patches (it's solved by flushing the data cache and invalidating instruction cache after patching the TwlBg at runtime). UPDATED: it's a lie. The crashes still happen.
- In Metroid, the camera could start moving in the opposite direction if you pushed the nub stick too hard. That also is supposed to be fixed now
Update 2023-02-19
-
3DS-NDS Key Remapper is a patch generator that allows you to map/remap any 3DS key to one or a combination of NDS keys. Furthermore, it's possible to map the CPad and CStick with ZL & ZR (for the New 3DS family); essentially, the sticks can behave as four separate keys (like CPad usually does when emulating the DPad). And, most importantly, it should theoretically work with any NDS game.
- To use just visit
the page, click some checkboxes to setup mappings, copy the resulting cheatcode, and insert it into your game in R4CCE. Normally, this cheat should get activated after about 20 seconds (to avoid conflicts with my other patches). Due to this "late" initialization, there may be sound distortions (you'll know when you hear them). If this happens, just open and close nds-boostrap's in-game menu several times and the sound should eventually shift back. Or change the sound mode in a game's settings to something other than "Surround" or "Headphones" (if that's possible). Or change the start delay on the generation page to something like 10 if you're not using any CPad patches. Actually, there is another thing where it can interfere with the CPad patches. For simplicity's sake some patches (notably Metroid, Zeldas and Star Fox) unmap the CPad from the DPad (because the DPad isn't responsible for movement in those games and does something else (or it was just easier for me)). This remapper, when enabled, will override those settings.
- The Key Remapper works exactly like my other patches (uploading code to arm11, patching TwlBg at runtime, inserting a hook, etc), except here I don't pass any data to Arm7, but simply use Arm11's
LGY_HIDEMU_MASK register to override native NDS keys (normally used to map CPad to DPad). The interesting thing here is that a cheatcode can be executed directly from nds-boostrap's cheat engine. It's useful in this case, because I'm patching TwlBg (that doesn't differ from game to game) rather than a specific game, so I don't need to know its layout. Also not sure about any performance implications. Won't be surprised if there are some timing delays, etc, because each key is funneled through that register.
- This thing requires the latest version of nds-bootstrap (currently v70). Older versions had
a bug that didn't allow the C2 instruction to be used (it lets us execute arbitrary ARM code directly from a cheatcode, without uploading it into the game's memory).
Plus some lazy CPad patches:
- Chibi-Robo! Park Patrol
- Final Fantasy III
- Final Fantasy IV
- Kingdom Hearts: 358-2 Days
- Kingdom Hearts: Re-coded
- Magician's Quest: Mysterious Times
- Nostalgia
- Rune Factory 3: A Fantasy Harvest Moon
- Solatorobo: Red the Hunter
- Star Fox Command - A to boost, B to brake. This one is essentially a dpad patch by Cracker, except that I modified it to use the CPad.
Update 2023-04-16
- Finally fixed a bug that could rarely crash the console when starting a game (I didn't handle RTCom errors properly)
- Fixed a bug in Final Fantasy 3 when it would take too long to complete a turn during a battle
- In SM64DS, the virtual joystick (a target) is now hidden from the bottom screen when the CPad is being used
- The camera can now be controlled with the CStick in the Kingdom Hearts games in new New3DS-family-only versions
And several new mods for the following games:
- C.O.P.: The Recruit
- CPad is also used for steering a vehicle (a little bit)
- CStick to control the camera
- Call of Duty: Black Ops (New3DS only)
- CStick to control the camera
- ZR to run
- To modify the sensitivity of the CStick (i.e. to increase the speed of the camera), find the hexadecimal number "00000142" in the cheatcode (it's somewhere near the end) and change it to something else
- Chibi-Robo: Clean Sweep! (Okaeri! Chibi-Robo! Happy Rich Oosouji!)
- `CPad` to run, push, climb, use the Chibi-Vacuum, Chibi-Eyes, &c.
- `Select` to interact with objects (when a red exclamation mark appears)
- `Left` to open/close the Chibi-Menu
- `Down` to equip the Chibi-Vacuum
- `Up` to pick up, drop, or pull out the Plug from an outlet
- `A/B` to answer "Yes" or "No" to a question
- Dementium II (New3DS only)
- CStick to control the camera
- ZR to run
- To change the CStick sensitivity, find and modify the hex number "00000011" in the cheatcode
- Flower, Sun and Rain: Murder and Mystery in Paradise
- GoldenEye 007 (New3DS only)
- CStick to control the camera
- ZR to run
- To change the CStick sensitivity, find and modify the hex number "00000210" in the cheatcode
Update 2023-04-20
- LEGO Batman: The Videogame
- LEGO Harry Potter: Years 1-4
- LEGO Indiana Jones: The Original Adventures
- LEGO Indiana Jones 2: The Adventure Continues
Update 2023-04-23
Update 2023-07-30
Fixed a bug in "Kingdom Hearts 358/2 Days" that caused the camera to go up without pressing any key
Update 2023-08-13
- Rune Factory: A Fantasy Harvest Moon
- Rune Factory 2: A Fantasy Harvest Moon
- Transformers: Decepticons
Update 2023-08-21
- Super Monkey Ball: Touch & Roll
Update 2023-09-13
Update 2023-10-05
Update 2023-10-15
- Dragon Ball: Origins
- Dragon Ball: Origins 2
- Lost in Blue
- Lost in Blue 2
- Lost in Blue 3
Update 2023-10-16
- Geometry Wars: Galaxies (New3DS only)
- CPad to move
- CStick to shoot
- To swap CPad and CStick, set "Handed" in the Options to "Left"
Update 2023-10-31
Fixed an issue in LoZ: Spirit Tracks (compatibility with the DPad patch)
- Call of Duty: World at War (New3DS only)
- CStick to control the camera
- ZR to run
- To change the CStick sensitivity (camera speed) find and change this hex value in the cheat code: 00000020
- Dementium: The Ward (New3DS only)
- CStick to control the camera
- ZR to run
- To change the CStick sensitivity (camera speed) find and change this hex value in the cheat code: 00000011
- Harvest Moon DS: Island of Happiness
- Harvest Moon DS: Sunshine Islands
- Moon (New3DS only)
- CStick to control the camera
- To change the CStick sensitivity (camera speed) find and change this hex value in the cheat code: 00000011
Update 2023-11-12
- The Wizard of Oz: Beyond the Yellow Brick Road
Update 2023-11-16
- Inazuma Eleven
- Inazuma Eleven 2
- Inazuma Eleven 3
Update 2023-12-16
Now, In Star Fox, you can do a barrel roll by pressing X
New mods:
- Call of Duty: Modern Warfare 3 - Defiance (New3DS only)
- CStick to control the camera
- ZR to run
- To change the CStick sensitivity (camera speed) find and change this hex value in the cheat code: 00000152
- Star Wars: Lethal Alliance
Update 2023-12-19
Fixed a small bug in Star Wars: Lethal Alliance. Now there's a proper 360 movement (previously the game would prioritize the forward direction for the main character)
Update 2023-12-28
- The World Ends with You
- CPad or CStick to move the character
Update 2024-03-31
- Tak: The Great Juju Challenge
- CStick to control the camera
- fixed a bug in Metroi Prime Hunters that allowed you to control certain enemies and move the character during the cutscenes