C0 to C2 codetype?

Started by hetoan2, October 08, 2010, 02:20:45 AM

Previous topic - Next topic

hetoan2

i was wondering if there was any way that I could convert a C0 codetype that is just executed ASM to a C2 codetype that functions the same way?

I have a specific reason, but i'm just wondering if its possible and how you'd do it :S

For some reason when i try to make the code one long C0 code it freezes, but different ones for each function work too. Would be nice if it could be one code (for reasons to be left unexplained D:)


Check out my site with codes obviously...
http://hetoan2.com/

and youtube...
http://youtube.com/hetoan2

dcx2

Are you creating a stack frame for your C0 code?  Doing anything that modifies LR?

If you can find any instruction that's running once per frame, you can hook that instruction with C2 and it will be like C0.  However, it's tricky to find something that's always executed every frame.  You might find that your code stops running when you're in the menu, or at the level select screen, etc.  And you probably still should create a stack frame if your code is large.

hetoan2

yea i can send you the assembly, but i am using stack frames.

I tried doing a C2 code on the 800018A8 start handler address, but that didn't work out too well S:

Also the code seems to work if the codes are separate, but they fail to work if i make them 2 stack frames like such:


stackframe:
popstack:
stackframe:
popstack:


So i dont know why it wont execute like that as just a plain C2 code. Even though it is a 55 ish line code combined. >_<

I can send you the actual code in a PM if you want to see it, but for certain reasons, i'm not going to post it in public.


Check out my site with codes obviously...
http://hetoan2.com/

and youtube...
http://youtube.com/hetoan2

dcx2

Hm...I would like to see how you're doing this. 

AlexWong

I think that C0 is a very useful code type. It's better not to use other code types to replace C0.
Unsatisfied w/o cheats.

dcx2

C0 is basically a C2 that hooks the code handler instead of a game address.  I agree that if something works for C0, it's best to use that.  Especially because the code handler is always run.

However, sometimes you don't always want your code to run.  For instance, if you're modifying a certain party member of an RPG.  You could write a code for each member, but that's awkward.  Instead, use a read breakpoint on their e.g. Strength attribute to find an address for a C2 hook that only runs when you're in the status screen, and provides a convenient pointer for you to access the party member that you're currently displaying the status of.

hetoan2

i sent you a pm dcx2 to further explain complications i have :S


Check out my site with codes obviously...
http://hetoan2.com/

and youtube...
http://youtube.com/hetoan2