Need some help with button activated switches.

Started by Strangeone2007, February 15, 2011, 02:05:32 AM

Previous topic - Next topic

Strangeone2007

Sorry if this is the wrong section.  I am trying to insert a switch activator in a code with the line CC000000 00000000.
However it is a C2 code and don't understand how it works.  This code specifically:
Super Swing Golf Season 2 [R29E9B]
Hole in One [ZiT] ported by Arudo
C216638C 00000005
83840004 2C1C0000
41820010 38030002
98040028 4800000C
38000001 98040028
60000000 00000000

I tried setting it up like this:
Hole in One (A & 1) [ZiT]
285CF036 00000A00
CC000000 00000000
C216638C 00000005
83840004 2C1C0000
41820010 38030002
98040028 4800000C
38000001 98040028
60000000 00000000
E0000000 80008000

But apparently without the original value or something, it isn't going to toggle on and off.  Can someone with more knowledge of codes help me with this?  I don't have a usb gecko.  Thanks.

dcx2

Yeah, you need an anti-code.  You'll probably need to ask Arudo for what the original instruction at that address is.

If I had to guess, I would bet that the anticode is 98040028.  So you could try adding this line before your 28 button activator.

0416638C 98040028

That may or may not work.

Strangeone2007

Woah, have no idea what you did there but it made the code toggle like I wanted it too.  Thanks for fast reply.

dcx2

The C2 code hooks the address 8016638C.  Looking at the C2 code itself, it looks as if 98040028 is the original instruction (some sort of stw, I think).  So all I did was make sure that the original instruction (aka anti-code), 98040028, over-writes the C2 hook, 0416638C.  Then, if your switch is currently on, the C2 hook will over-write anti-code with the code.