The Basics of Wii Cheat Codes & the Gecko Code Handler
#11
(08-11-2018, 03:23 AM)420 Matt Wrote: I have a question regarding the C2 codetype. So do I need to end every C2 code with "60000000 00000000"? Or can I put the default RAM value for the first part of the last line? I know most C2 codes end in 60000000, but I have seen some ASM codes that don't end like that. EG: Bully's Invincibility hack.

All C2 codes end in 00000000. If there are an odd number of instructions, the final line of the code will be the last instruction and 00000000.

Example:

li r0, 0

C2000000 00000001
38000000 00000000

If there are an even number of instructions in the code, the final line of the code will be 60000000 00000000.

Example:

li r0, 0
li r0, 1

C2000000 00000002
38000000 38000001
60000000 00000000

This is done because the code handler replaces the 00000000 with a branch instruction going back to the next instruction you left off at. The nop is just a filler to properly align everything in memory, all it does is wait one CPU cycle (do nothing).

However, the ASM <-> WiiRD Converter will handle all of this for you.
Reply
#12
Well, I guess you can say that I am making my own. Or at the least, just to see how working ASM codes function in the game. I know I may seem more experienced with codemaking than you think, but I am somewhat experienced overall. Like for example, I know how to make simple byte, halfword, and word RAM writes. With more advanced stuff like making sure a C2 code will work properly, is what I am unfamiliar with. I apologize if my noobness at this is annoying you. Sad I feel like I have potential to make some great codes if I have the knowledge of this settled in.

Btw, I am replying to Vega. Sorry if this causes any confusion.

(08-11-2018, 03:44 PM)Star Wrote:
(08-11-2018, 03:23 AM)420 Matt Wrote: I have a question regarding the C2 codetype. So do I need to end every C2 code with "60000000 00000000"? Or can I put the default RAM value for the first part of the last line? I know most C2 codes end in 60000000, but I have seen some ASM codes that don't end like that. EG: Bully's Invincibility hack.

A C2 code will end in 00000000 if there are an odd number of lines in the code.

Example:

li r0, 0

C2000000 00000001
38000000 00000000

If there are an even number of lines in the code, it will end in 60000000 00000000.

Example:

li r0, 0
li r0, 1

C2000000 00000002
38000000 38000001
60000000 00000000

This is done because the 00000000 instruction tells the code handler to branch back from where you came from. The nop is just a filler to tell the CPU to wait a cycle (do nothing).

However, the ASM <-> WiiRD Converter will do all of that for you.

Ah. I see. Makes more sense to me now. 1 last question, do I need to have the default RAM value as the last instruction? Before I add the nop or not, depending on the total amount of instructions my ASM code has.

Please note that I have read and studied how the gecko codetypes and PowerPC instructions work. Everything logically makes sense to me, but sometimes the small specifics of them get me confused.
Reply
#13
No need to apologize about your 'noobness'. Everyone use to be a noob at one point. All we care about is that you take the time to read up any needed documentation and not be afraid to ask questions.

In regards to the default RAM value-- In MOST codes, it is needed. It all depends on what you are trying to accomplish with your ASM. If the game's original ASM function on said address is not needed for your code to execute correctly, then its not needed.

Last night I completed typing up this tutorial - http://mkwii.com/showthread.php?tid=830

It's still in rough draft/beta form. You will see lots of typos. When I get time, I will fix all the grammatical errors and add in screenshots as well.
Reply
#14
(08-12-2018, 07:34 PM)Vega Wrote: No need to apologize about your 'noobness'. Everyone use to be a noob at one point. All we care about is that you take the time to read up any needed documentation and not be afraid to ask questions.

In regards to the default RAM value-- In MOST codes, it is needed. It all depends on what you are trying to accomplish with your ASM. If the game's original ASM function on said address is not needed for your code to execute correctly, then its not needed.

Last night I completed typing up this tutorial - http://mkwii.com/showthread.php?tid=830

It's still in rough draft/beta form. You will see lots of typos. When I get time, I will fix all the grammatical errors and add in screenshots as well.

Thanks for understanding and answering my question. I saw the tutorial actually. Seems easy to understand for me. The process just takes a while and is tedious, especially if you are trying this for the first time. Plus you need to be careful to make sure no mistakes are present. Otherwise 1 small hiccup could mess the whole thing up.
Reply
#15
So insert ASM codes don't count as lines of the code section above it? Just making sure.
Reply
#16
(10-30-2018, 02:41 PM)xXCrazySniperXx Wrote: So insert ASM codes don't count as lines of the code section above it? Just making sure.

The top line of an ASM code (C2/C0 line) doesn't count for the total lines of code designated by the code itself.

Example:
C2000000 00000004
39E00001 39C0000A
7C571378 7D107214
3FC08000 63DE1500
7FB8C850 00000000

The 4 means 0x4 amount of lines underneath. Number value is always in Hex. So 10 lines would show as 00000000A.

You never need to worry about this though when compiling ASM. The compiler does this for you. Don't even attempt ASM until you are seasoned enough with the gecko code documentation, and messing around with RAM fill/writes. Reread the Make Codes on Dolphin guide. Specifically Chapter 1.
Reply
#17
So.... does a nop just cancel a value out, or...?
Reply
#18
Basically, yes.
Reply
#19
Completely revamped the OP. Much much cleaner.
Reply
#20
(11-06-2018, 05:35 PM)Vega Wrote: Completely revamped the OP. Much much cleaner.

yeah it looks so much better now. it looked good before though as well.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)