What are these commands?

Started by standardtoaster, October 30, 2010, 11:36:13 PM

Previous topic - Next topic

standardtoaster

I've seen 05_ , 01_ , and 15_used in quite a few codes. What are they and how are they used? Why didn't they use 04_ , 00_ or 15_? With the pirate ship water level beta, I did see that C1A31581 was being written to 8054958C. Why did spunit262 use 05_ instead of 04_?

An example of 05_ would be:

Pirate Ship Water Level Beta [spunit262]
0554958C YYYYYYYY
Default C1A31581 (most of the time)
Special thank to Igglyboo, his coordinate hacks helped.

Another example of 05_ would be:

Deactivate trophy collission:
--Allows you to move trophies through each other
0516E588 FC207090
0516E688 FC207090


An example of 01_ would be:

Mario's down b move is always charged [Jassim]
01262A87 000005A
012B4A87 000005A
01306A87 000005A
01358A87 000005A

An example of 15 would be:

Always Have 99 Lives [REDSOXROX]
1528AE64 00000063
E0000000 80008000


Thank you for any and all help with this. I'm pretty familiar with the 04_ and the 02_ commands.

dcx2

Read this post and it might help explain things.  05 is 04 at a higher address.  15 is 14 at a higher address.

http://wiird.l0nk.org/forum/index.php/topic,6024.msg53253.html#msg53253

standardtoaster

An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you.

dcx2, I can't view that post.

Thomas83Lin

Quote from: dcx2 on June 23, 2010, 06:47:36 PM
Part of the problem that I think we're having is that a hex digit actually represents 4 bits, and you need to look at the underlying bits to understand why the code types are defined the way they are.  Normally, we refer to a 32-bit RAM write as an "04 code type", but this is actually a misnomer.  It misleadingly implies that the 8 bits belonging to the two hex digits "04" are the code type, when the actual code type only has 7 bits!  The 8th bit belongs to the address, which creates the "05" code type.  People also think that the address is only comprised of 24 bits = the other 6 hex digits, when the address is actually 25 bits = the other 6 hex digits + the last bit of the second digit.

Maybe a picture will help?  Here's the binary breakdown of the first code word.


Hex Digit  |         First         |        Second         |        Third     |   Fourth ...
Bit#       |   0   1   2   |   3   |   4   5   6   |   7   |   8   9  10  11  |   12     ...
is         |   Code Type   | ba/po | Code Sub Type |  address ..............................


Using this same picture, you can see why codes that use the ba only look at the first 7 bits of the ba - because the other 25 bits of the address are supposed to be specified in the code type's address bits 7->31.  The ba's purpose in life is to make up for the missing 7 bits of the address that can't be specified due to the code type's "opcode bits" 0->6.

dcx2

lol, whoops, my bad.  But thomas83lin copy/pasted it for you.

cydp3

I have a similar problem to standardtoaster. I don't know when to use these codetypes or why you use these codetypes. I've read dcx2's post but I still don't understand, can anyone help? Thanks.

dcx2

We use two hex digits to represent code types.  We call them 04, 14, 48, C2, CC, etc.  Two hex digits represent eight bits total.

The trick is that code types are only seven bits; bits 0 through 6 in the diagram, red pink and dark green.  The light blue bits, the remaining 25 bits, specify the address.

I'll use Jassim's codes as an example.

012B4A87 000005A

This would be an "01" code type, right?  0x01 = 0000 0001.  That last bit is not actually a part of the code type, it's a part of the address.  What we actually have is the 00 code, an 8-bit write using ba.  Assuming the standard ba value of 0x80000000, this would be writing the 8-bit value 0x5A to the address 0x812B4A87.

standardtoaster

Ah, okay. So if I wanted to write an 8-bit value to a place in 81XXXXXX, I would use 01. Right? I think I get it now. You use these ones to write into 81XXXXXX.

dcx2

Essentially, that's what happens.  The thing to remember is that there is no "01" code type.  The bit where the 1 is located is not considered part of the code type; it's part of the address.  That's why all code types are even numbers (00, 02, 04, 06, 10, 12, 14, 16, etc)

cydp3

#9
Ok...I get it now...I think. So if I wanted to write a 32-bit value to 81XXXXXX would I use "05"?

Bully@Wiiplaza

Quote from: cydp3 on November 01, 2010, 05:13:58 PM
Ok...I get it now...I think. So if I wanted to write a 32-bit value to 81XXXXXX would I use "05"?
yes that will work.
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

standardtoaster

Thank you so much for your explanations, guys! I now have a much better understanding of this.