How to use Button-Combination to activate cheat?

Started by lindtec, July 26, 2008, 10:23:06 PM

Previous topic - Next topic

lindtec

Hello again

I've seen those codes of Zelda TP, where you can change your
form with the pressing of a button combination.

Could someone tell me generaly (hopefully in simple terms), how this works?
Which codes I have to use und how are those combinations defined?

If there is allready a tutorial for this out there, I would be thankful for
a link.

Greetings lindtec

Link

#1
Note: I also added interesting tidbits for advanced members but I'll start out the easy way!

doing button combinations not too hard:

first of all you need to know button values:

GCN Wii Clasic
L 0001 L 0001 U+ 0001
R 0002 R 0002 L+ 0002
D 0004 D 0004 Zr 0004
U 0008 U 0008 X  0008
Z 0010 + 0010 A  0010
R 0020 2 0100 Y  0020
L 0040 1 0200 B  0040
A 0100 B 0400 Zl 0080
B 0200 A 0800 R  0200
X 0400 - 1000 +  0400
Y 0800 Z 2000 -  1000
S 1000 C 4000 L  2000
D+ 4000
R+ 8000

(copied from an old thread)..
now I'll use an example:

Form Switch C+Z+R = Wolf (code minorly modified for understanding!)
2844BB66 00006002
00492946 00000001
E0000000 80008000

The actual key is: 2844BB66.. this means: "Read the 16 bit value at the address 8044BB66. Now we know - we're using Wii buttons.. and we want.. C, Z and R to be pressed: look up in the table: C is 4000, Z is 2000 and R is 0002 - so.. we'll go for:

C+Z+R=4000+2000+0002=6002

2844BB66 00006002 therefore checks:
is the value at address 8044BB66 6002 - if it is: then this condition is met.. in our case the condition is met when C+Z and R are pressed. Please note: 8044BB66 is game dependent. A possible way to search for these kinda codes is to look in the table.. press no buttons: search for 16 bit 0000.. now press A (ONLY A).. and search for 0800. You'll slowly narrow down addresses.

For advanced members: I highly recommend you to do codes a little more cooler than that one.. this one is: Press C+Z+R and nothing else, it won't work if you press anything. Simply open calc.exe and set it to Scientific mode.. now enable Hex mode.. and type in: 6002 and click on NOT: you'll get FFFFFFFFFFFF9FFD... only take the last 4 digits.. 9FFD.. and rewrite the code above to:

2844BB66 9FFD6002

technically 28 codes parse the following:

28XXXXXX YYYYZZZZ

If [value at base+XXXXXX] AND (NOT YYYY) == ZZZZ

now we have to slowly approach that.. now YYYY is 9FFD.. notting 9FFD is 6002 again.. now imagine I press C+Z+R+A.. this is 6802...
so.. 6802 AND (NOT 9FFD) = 6802 AND 6002 = 6002 (you can verify in calc.exe).. so.. this condition is true.. using that additional data it ignored A... now to verify I am not talking garbage.. what if YYYY=0000.. I press C+Z+A+R = 6802

6802 AND (NOT 0000) = 6802 AND FFFF = 6802
this is not 6002!

So what is
b) 2844BB66 00006002
a) 2844BB66 9FFD6002
Precisely spoken:
a means: Press C+Z+R and nothing else! If you press anything else, nothing will happen!
b means: Press at least C+Z+R - every other button is also allowed but at least these must be pressed!

Of course these code parts are tricky.. you could technically bring this to an even more complicated level.. if people are interested in example.. I'll happily post!

lindtec

Thanks a lot...

That was just the kind of info I needed.

Oh and concerning your part about "an even more complicated level",
what would be the use of doing it even more complicated.

Don't get me wrong. I understand, why you want to correct that Zelda-Code,
but what else can happen (besides someone pressing 4 instead of 3 buttons),
that makes it neccesary to go "even more complicated"?

Link

the more complicated part would be something like.. Press at least Z+C+R but do not press A.. this could be integrated..

that would in the end be:

2844BB66 97FD6002

97FD is: NOT 6802 - while 6802 is C+Z+R+A - this might be an interesting structure if people need to have additional buttons which mustn't be pressed for working of the code.

Or even stranger things are possible:

2844BB66 F7FF0000

this techncally means: As long as A is not pressed execute..
F7FF is (NOT 0800)

And well.. there are certainly very many possibilites.. and all those possibilities did not exist on the Gamecube so as most hackers here are coming from the GC scene there are certainly new things for them.

lindtec

Thanks again for this info...

It sure could come in handy, to know, that even not pressing a button could be used
for code execution.

James0x57

You mean copied from MY thread! lol ;p
Those "more complicated" ideas are pretty neat, Link. Heh. Just never thought to do it like that. :)

And for the record, I made that from switch code strictly CZR on purpose. 8)



One more thing about conditional codes, they have to end with a line like:
E0000000 80008000


lindtec

@James0x57

Just curious, why did you make this C+Z+R Code purposly so, that it won't work,
if another button is pressed?

And thanks for this last bit of advice. I guessed as much, but it's always better
to hear it from the experts...

James0x57

That way it's more of a deliberate, very specific, action. It reduces (a little) the risk of someone accidentally pressing the already odd combination.
(Pressing the buttons for being a wolf and then entering a shop may freeze the game, so extra precaution was necessary.)

And you're welcome ;)


lindtec

I see...

Just another thing.

I know, that when you press Left or Right, it would switch weapons in Zelda. Does this
still happen when you press it in combination with Z and C? Or are the normal button
functions deactivated, when you press it together with another button?

Since I don't own that game (Just borrowed it for HBC), I can't check myself.

Hope, my question doesn't sound too stupid.

Thanks in advance for your answer.
(That way, I don't have to make a new post, just to thank you)

Link

That's depending on the game.. most games however also ignore other buttons! In case of Zelda certain additional buttons are allowed to my knowledge but by far not all. Other button function override weapon switches!

James0x57

Most games? I'd say it's rare for a game to ignore the buttons you press..

Zelda does still switch the weapons when you press that combination.


Link

well, you're right but still.. it's the developer's way.. they might or might not..

just 99% of all do ^^

schmake

Thanks for the help in this thread Link and James0x57, been invaluable :)
I've managed to incorporate it into some of my cheats that I didn't always want on

lindtec

@schmake

Maybe you know this allready, but if you put CC000000 00000000 as your next
line after the one with the button-combination, you can switch this code with
the same combination off again.

This is also listed in the codetypelist at "CST6: On/Off-Switch".

BTW. Good luck with your future code-creation

James0x57

That's what that does? Hah, I couldn't figure it out. lol