BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the community, you simply need to register an account or log into an existing one.

Be sure to check out disposable e-mail services, in case you prefer using one for this site instead of your legit address: http://10minutemail.com/10MinuteMail/

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can see and download all content provided for regular members even without an account!

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Search
 
 

Display results as :
 


Rechercher Advanced Search

October 2017
MonTueWedThuFriSatSun
      1
2345678
9101112131415
16171819202122
23242526272829
3031     

Calendar Calendar

Country Statistics
Free counters!
LaTeX Generator


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Bits, Bytes, Halfwords, and Words on 11/3/2012, 4:29 am

Welohabi

avatar
Moderator & Coder
Moderator & Coder
An Introduction to Bits, Bytes, Halfwords, and Words for Wii coding
by Welohabi

Understanding these basics are important to understanding the codes themselves. I have left out some details due to them not being important to Wii coding.

Let's start with some definitions first.

  • bit    -    A single binary digit, that can only have a value of 0 or 1.
  • nybble  -   4 bits
  • byte    -   8 bits
  • halfword  - 16 bits
  • word   -    32 bits


When dealing with Wii codes you are normally reading them in hexadecimal form.

For example:
Binary Decimal Hexadecimal
000000
000111
001022
001133
010044
010155
011066
011177
100088
100199
101010A
101111B
110012C
110113D
111014E
111115F
Notice that {A,B,C,D,E,F} are not letters, they are numbers! Hexadecimal "C" means decimal "12" just like binary "1100". Computers are designed to use hexadecimal because binary-hexadecimal handling is far more efficient than binary-decimal.

The hexadecimal number 1 is made up of 4-bits (0001) also known as 1 nybble.
The hexadecimal number 11 is made up of 8-bits (00010001) also known as 1 byte.
The hexadecimal number 1111 is made up of 16-bits (0001000100010001) also known as a halfword.
The hexadecimal number 11111111 is made up of 32-bits (00010001000100010001000100010001) also known as a word.

I'm sure you can see why it is easier to read the numbers in hexadecimal form versus reading them in binary. This should also help you to understand basic codetypes a little better.

Example 8-bit Code [Welohabi]
0012346B 00000011

Example 16-bit Code [Welohabi]
0212346A 00001111

Example 32-bit Code [Welohabi]
04123468 11111111


_________________
Please help me earn some extra dropbox space. http://db.tt/9srKWou0

The energy you give, you shall receive.

Xylon

avatar
Code Creator
Theres also Dword and Qword^^
What about the 06, 08, 12 and so on? Simply +8 bits? So 06 = 40 bits, and so on? I think it goes to 80, right?

Sincerely

3 Re: Bits, Bytes, Halfwords, and Words on 11/3/2012, 11:05 am

Welohabi

avatar
Moderator & Coder
Moderator & Coder
Dword 64-bit and Qword 128-bit are not used in Wii coding really so they are not needed in this simple tutorial. Also "word" meanings can change depending on what you are applying them to but bit,nybble,and byte are universal. I have found some places that refer to a word as only 16-bit and a Dword as 32-bit.

06 08 12? <- I don't know what you mean or at least I don't understand what you are asking. If you are referring to codetypes then NO, A 32-bit direct write is the largest as far as I know. That is if you don't count the 06 codetype which allows you to write to as many bytes as you want starting with a specific address. After you write more than 4 bytes you are not writing to the same address anymore though.


The 00,02,04 codetypes I used as examples are simple 8-bit,16-bit, and 32-bit writes.



_________________
Please help me earn some extra dropbox space. http://db.tt/9srKWou0

The energy you give, you shall receive.

4 Re: Bits, Bytes, Halfwords, and Words on 11/3/2012, 12:18 pm

Xylon

avatar
Code Creator
Yes...This I also know, but what about the codetypes with the beginning like 12, 80 or what so ever:
Infinite Ammo [Skiller]
* 4A000000 90000000
* 1214AE22 00000063
* 120E06D2 00000063
* 1214AE26 00000063
* 120E06D6 00000063
* 1214AE2A 00000063
* 120E06DA 00000063
* 1214AE2E 00000063
* 120E06DE 00000063
* 1214AE32 00000063
* 120E06E2 00000063
* 1214AE36 00000063
* 120E06E6 00000063
* 1214AE3A 00000063
* 120E06EA 00000063
* 1214AE3E 00000063
* 120E06EE 00000063
* E0000000 80008000
There also codes with 80 or 81, this are the adresses, arent they? Like in this code:

Teleporter -PAL- [Bully@Wiiplaza]
C23BAB14 0000000B
3D408065 614AB89A
A14A0000 3D608170
2C0A100C 4082001C
81990000 918B1500
81990004 918B1504
81990008 918B1508
2C0A200C 4082001C
818B1500 91990000
818B1504 91990004
818B1508 91990008
EC4007F2 00000000
*Press C+Z+D-PAD_DOWN to save position*
*Press C+Z+D-PAD_UP to teleport*
Or may I have meesed up something...

Sincerely

Welohabi

avatar
Moderator & Coder
Moderator & Coder
Ok... Let's start with the first code.

4A codetype is setting the pointer address to 90000000.

12 codetype is just a 02 codetype that is using the pointer address instead of the base address.


For example, the 1214AE22 00000063 line is writing a 16-bit value the address 9014AE22. (I could be wrong on the exact address because I'm not that good with pointers)

The second code is a C2 codetype.

C23BAB14 0000000B
This entire code is replacing the original ASM instruction at address 803BAB14 with the next 11 lines in the code which are all ASM instructions. B = 11

You can use PyiiASMH to see these ASM instructions which are:
lis r10,-32667
ori r10,r10,47258

lhz r10,0(r10)
lis r11,-32400
cmpwi r10,4108
bne- 0x001C
lwz r12,0(r25)
stw r12,5376(r11)
lwz r12,4(r25)
stw r12,5380(r11)
lwz r12,8(r25)
stw r12,5384(r11)
cmpwi r10,8204
bne- 0x001C
lwz r12,5376(r11)
stw r12,0(r25)
lwz r12,5380(r11)
stw r12,4(r25)
lwz r12,5384(r11)
stw r12,8(r25)
fmuls f2,f0,f31

Each instruction represents 8 digits of the code.
For example, these two instruction are the 16 digits on the second line of the code.
lis r10,-32667 = 3D408065
ori r10,r10,47258 =614AB89A


The 81 "codetypes" you are seeing are the lwz instructions.






This code also gave me a question of my own. I am curious to which part of the ASM are making the button activators work. I'm guessing it has something to do with the cmpwi instructions. Maybe Bully will let me know.


_________________
Please help me earn some extra dropbox space. http://db.tt/9srKWou0

The energy you give, you shall receive.

Xylon

avatar
Code Creator
This is very much an information...I need a German Tutorial Very Happy

Sincerely

7 Re: Bits, Bytes, Halfwords, and Words on 11/4/2012, 11:20 am

Welohabi

avatar
Moderator & Coder
Moderator & Coder
The only German coder I know is Bully, you might be better off learning English. Unless he decides to make a shit ton of tutorials.


_________________
Please help me earn some extra dropbox space. http://db.tt/9srKWou0

The energy you give, you shall receive.

Bully@WiiPlaza

avatar
 
 
Wiiplaza.tk has German tutorials. They may be old but who cares. I´ve written most of them. Wink


_________________

Xylon

avatar
Code Creator
Yay Very Happy I hope it will help. I really would like to be as good as the others Smile

Sincerely

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum