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?
It writes to the addresses every frame like the 04 code
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.
What do you mean rewrite the 06 code in ASM?
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.
Why not just use conditionals?
Can you give me an example using conditionals with the 06 code type.
22002FF0 00000001
06079674 00000010
77777777 77777777
77777777 77777777
04002FF0 00000001
E0000000 80008000
That would make it so it only writes to the addresses once
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.
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.
Thanks for all of the good information.