Activate Deactivate Gecko Code based on trigger

Started by live2play, June 08, 2010, 03:19:53 AM

Previous topic - Next topic

live2play

I have a 06 codetype code that overwrites a section of memory with new data.  I only want this "overwrite" to occur after a specific opcode has been executed.  I then want the 06 code to stop after another opcode has been executed.  Does the 06 codetype write the data once or does it keep writing it like a 04 code type?  

wiiztec

It writes to the addresses every frame like the 04 code
If there's any code at all that you want to be button activated, or even able to toggle on & off, and I have the game, just PM me and I'll make it happen

live2play

Any other method other than rewriting the 06 code in ASM and hooking it where I want it with a C2 code?  Problem is I have 384 bytes of data to write and that would be a pain without the 06 code type.

wiiztec

If there's any code at all that you want to be button activated, or even able to toggle on & off, and I have the game, just PM me and I'll make it happen

live2play

Because a 06 code type writes the data every frame and I need to only write the data after a specific line of ASM is executed, it looks like I'll need to perform the same function the 06 code type would but with ASM.

wiiztec

If there's any code at all that you want to be button activated, or even able to toggle on & off, and I have the game, just PM me and I'll make it happen

live2play

Can you give me an example using conditionals with the 06 code type.

wiiztec

22002FF0 00000001
06079674 00000010
77777777 77777777
77777777 77777777
04002FF0 00000001
E0000000 80008000

That would make it so it only writes to the addresses once
If there's any code at all that you want to be button activated, or even able to toggle on & off, and I have the game, just PM me and I'll make it happen

live2play

Perfect!  Now how would I get the code above to only run when a particular ASM instruction has been executed?  It would be nice if I could add a C2 hook that contained the execution of the sample code you provided.

dcx2

Does the code need to execute exactly after the instruction is executed?  If so, you will need to hook with a C2 code that does the reading/writing of the data; the data can be embedded in the C2 code (see the LUT Discussion thread in the USA Wii Codes forum for how to read data embedded in a C2 code).  The C2 code could in theory be very short, if you're looping over lwzu/stwu.

However, if it can execute some time after the instruction (i.e. when the code handler next runs), then you can hook with a C2 code that basically does 04002FF0 00000000, which would then "enable" the 06/16 code for when the code handler ran.

live2play