News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Nintendo DS: Contra 4 ~ Hacking on changing buttons (Is it possible?)  (Read 2545 times)

cospefogo

  • Full Member
  • ***
  • Posts: 142
  • "Take this silver dagger to save your neck."
    • View Profile
    • Fliperamas
Hello guys,

I love the Contra games so much, really like them!
However Contra 4 became a nightmare to play using the original bundled controlling configuration Y + B.
Y shoots. B jumps. This is horrible...

I really would love to hack the rom to have the classic B+A.
B shots. A jumps.

However I have no idea how to hack this on a NDS game.
Do you think it is possible at all?

Looking forward for some hope!
Cospefogo.
"Replicants are like any other machine - they're either a benefit or a hazard.
If they're a benefit, it's not my problem."

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Nintendo DS: Contra 4 ~ Hacking on changing buttons (Is it possible?)
« Reply #1 on: August 30, 2013, 01:40:07 pm »
Swapping the buttons isn't more than some bit juggling. It shouldn't require more than a short snipped of code in the key reading routine.

FAST6191

  • Hero Member
  • *****
  • Posts: 2695
    • View Profile
Re: Nintendo DS: Contra 4 ~ Hacking on changing buttons (Is it possible?)
« Reply #2 on: August 30, 2013, 01:57:07 pm »
Possible sure, things almost exactly like it have been done on several occasions in the past. It works much the same as you do anything else* assuming you do not fancy a hardware mod.

*there may be some really old hardware that does not copy the states but most will.

1) Change what buttons the DS thinks are pressed.

2) Change what buttons trigger what function.

At various points both have their advantages and disadvantages.

The buttons thing, as part of operation the DS notes what buttons are pressed and stores that data. This is to help dodge switch bounce issues and more. Find where this data is stored and preferably at the end of that routine have it swap the numbers around (it is just a long row of bits for the old GBA stuff and then another set for the new DS buttons).
http://nocash.emubase.de/gbatek.htm#dskeypad and http://crackerscrap.com/docs/sfchacktut.html might be of interest.

You can do this in cheats (they tend to have button activated cheats and you then direct the rest to the location things are debounced to) without even doing any assembly (it is very similar to how the guitar hero guitar grip cheats work) and even hardpatch them in with something like DSATM but I prefer the assembly method myself as it a lot smaller change.

The functions thing works much the same in that you find what I presume will either be an IF statement with the button press as the subject or an interrupt doing much the same and change what triggers the function. As there can be many functions doing many things this is less than ideal for a lot of hacks.

There is a third method if the game allows any remapping at all (even another mapping you do not like -- such an option to change means things for the code lower down) as you then can try changing the mapping there. However if there is nothing like here then the is not much point considering it.

cospefogo

  • Full Member
  • ***
  • Posts: 142
  • "Take this silver dagger to save your neck."
    • View Profile
    • Fliperamas
Re: Nintendo DS: Contra 4 ~ Hacking on changing buttons (Is it possible?)
« Reply #3 on: August 30, 2013, 04:29:18 pm »
Thank you very much, FAST6191, for you great input.
I will keep working on that.

I will first try some cheats with Contra in my R4i flashcard.
Maybe there is a "cheat" there already for YB/BA button change!

I really have no idea why Konami did not put this option in the
official game settings area.

Regards,
C.
"Replicants are like any other machine - they're either a benefit or a hazard.
If they're a benefit, it's not my problem."