Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 372
» Latest member: Fear
» Forum threads: 1,329
» Forum posts: 6,753

Full Statistics

Online Users
There are currently 85 online users.
» 3 Member(s) | 79 Guest(s)
Bing, Discord, Google, ForgottenIce, stebler

Latest Threads
Start with Items [CLF78, ...
Forum: Incomplete & Outdated Codes
Last Post: Vega
1 hour ago
» Replies: 6
» Views: 602
NinjaWFC
Forum: Hacking General Discussion
Last Post: TheNinjaKingOW
Yesterday, 05:01 PM
» Replies: 11
» Views: 2,911
Setup Your Own Local MKW ...
Forum: Other
Last Post: TheNinjaKingOW
Yesterday, 03:38 AM
» Replies: 50
» Views: 18,654
Make it to 10,000
Forum: General Discussion
Last Post: Fzerowii
05-13-2021, 02:12 PM
» Replies: 1,815
» Views: 538,367
Always Get Respawn Boost ...
Forum: Online Non-Item
Last Post: _tZ
05-13-2021, 12:32 PM
» Replies: 2
» Views: 368
Change VR Limit [XeR]
Forum: Online Non-Item
Last Post: Unnamed
05-12-2021, 08:41 AM
» Replies: 17
» Views: 8,107
Porting Addresses
Forum: Wiimm's Tools
Last Post: Wiimm
05-08-2021, 10:13 AM
» Replies: 1
» Views: 274
Room Message Expander [CL...
Forum: Online Non-Item
Last Post: Wiimm
05-06-2021, 03:01 PM
» Replies: 6
» Views: 371
PyiiASMH 3 (ASM Compiler ...
Forum: Hacking General Discussion
Last Post: JoshuaMK
05-05-2021, 12:56 AM
» Replies: 18
» Views: 8,942
All About Bit Rotation
Forum: Power PC Assembly
Last Post: Vega
05-01-2021, 06:50 PM
» Replies: 4
» Views: 3,073

 
  Room Message Expander [CLF78]
Posted by: CLF78 - 05-03-2021, 01:14 PM - Forum: Online Non-Item - Replies (6)

This code will let you add more room messages than the game normally allows (and also replace existing ones). Please check the Notes below before using this code.

NTSC-U
0262C906 0000XXXX
0262B956 0000XXXX
0262B95A 0000XXXX
0262B2F6 0000XXXX
C262B2FC 00000004
5400083C 3C60YYYY
6063YYYY 7C63022E
382101A0 4E800020
60000000 00000000
C262D06C 00000003
7C741B78 2C030000
40A20008 3A80FFFF
60000000 00000000

PAL
025DC3EA 0000XXXX
025DB3E2 0000XXXX
025DB3E6 0000XXXX
025DAD82 0000XXXX
C25DAD88 00000004
5400083C 3C60YYYY
6063YYYY 7C63022E
382101A0 4E800020
60000000 00000000
C25DCB50 00000003
7C741B78 2C030000
40A20008 3A80FFFF
60000000 00000000

NTSC-J
025DBCC6 0000XXXX
025DACBE 0000XXXX
025DACC2 0000XXXX
025DA65E 0000XXXX
C25DA664 00000004
5400083C 3C60YYYY
6063YYYY 7C63022E
382101A0 4E800020
60000000 00000000
C25DC42C 00000003
7C741B78 2C030000
40A20008 3A80FFFF
60000000 00000000

NTSC-K
025CA586 0000XXXX
025C957E 0000XXXX
025C9582 0000XXXX
025C8F1E 0000XXXX
C25C8F24 00000004
5400083C 3C60YYYY
6063YYYY 7C63022E
382101A0 4E800020
60000000 00000000
C25CACEC 00000003
7C741B78 2C030000
40A20008 3A80FFFF
60000000 00000000

Notes:

  • XXXX = Total amount of messages
  • YYYYYYYY = Address of the array of the BMG IDs (use a 06 code to store the BMG IDs as halfwords)
  • This does not allow adding more "room start" buttons (i haven't figured out how to make them work properly yet, besides removing existing ones).
  • All users must be running the code for it to take effect. Users without it will receive the original messages (or none at all if the message ID is bigger than the amount of original messages).
ASM Sources:

Load BMGs from custom array:
Code:
# Set array location here
.set BMGArray, 0xXXXXXXXX

# Modified original instruction
slwi r0, r0, 2

# Load the BMG ID
lis r3, BMGArray@h
ori r3, r3, BMGArray@l
lhzx r3, r3, r0

# Copy of the game's original instructions to return directly from here
addi r1, r1, 0x1A0
blr

Hide button if message doesn't exist:
Code:
# Original instruction
mr r20, r3

# Check if BMG is 0
cmpwi r3, 0
bne+ end

# Replace r20 with -1 to hide message button
li r20, -1

# Return
end:

Code created by: CLF78

Print this item

  Minimap Opacity Modifier [CLF78]
Posted by: CLF78 - 04-28-2021, 10:52 AM - Forum: Visual & Sound Effects - No Replies

Overrides the minimap's opacity.

NTSC-U
047E0BEC 380000XX

PAL
047EA498 380000XX

NTSC-J
047E9B04 380000XX

NTSC-K
047D8858 380000XX

XX = New opacity (original value is 0x64).

Code created by: CLF78

Print this item

  Porting Addresses
Posted by: Wiimm - 04-24-2021, 08:09 AM - Forum: Wiimm's Tools - Replies (1)

If you create a cheat for Mario Kart Wii and want to adapt it for all regions, then you have to adapt different addresses. With Wiimmfi and CTGPR this process is called porting. With the SZS tools since version 2.25a there are 2 new commands that support porting:

Command wstrt PORT

With this command it is possible to port addresses. To do this, you enter the region (PAL, USA, JAPAN or KOREA) and any number of addresses. The region can be changed in the middle of the command line. If the region is not specified, PAL is used. An attempt is made to port every given address to all other regions.

Further details: https://szs.wiimm.de/cmd/wstrt/port

Porting is still experimental. Therefore, please report errors or missing addresses here.


Command wstrt WHERE

This command is a by-product. This allows you to determine in which memory area the addresses are located. Here, among other things, the various DOL segments and staticR.rel are recognized.

Further details: https://szs.wiimm.de/cmd/wstrt/where

Print this item

  Logical Operations for PPC ASM
Posted by: Vega - 04-23-2021, 11:16 PM - Forum: Power PC Assembly - No Replies

Logical Operations for PPC ASM

For ASM Coders who already know the basics.



Chapter 1 Intro; Understanding Binary/Bits

This thread will teach you how to do various logical operations in PowerPC Assembly. Values you see in registers are obviously displayed in Hex. These Hex values are actually in binary, but they are displayed in Hex for ease of use and readability. Binary is the lowest form of programming. Binary values are represented in bits and a bit can only have two possible values: 0 or 1.

For example, let's say r5 has a value 0x12300BCD. Each GPR is 32 bits in length obviously. This means each hex digit represents 4 bits of binary. The value in r5 in binary form is this....

0001 0010 0011 0000 0000 1011 1100 1101

The range of a Hex digit is 0x0 thru 0xF and this can be displayed in binary when the binary representation is split into groups of 4. So this grouping of 4-bits gives you an easy visual represenation of the register's value in binary form. The first bit (also called the sign bit or the most significant bit) is bit 0. The last bit (also called least significant bit) is bit 31.

When a bit's value is '1', that means the bit is flipped High/True. When a bit is '0',that means the bit is flipped Low/False.

Here is a list of all binary to hex digit conversions:
Code:
0000 = 0x0
0001 = 0x1
0010 = 0x2
0011 = 0x3
0100 = 0x4
0101 = 0x5
0110 = 0x6
0111 = 0x7
1000 = 0x8
1001 = 0x9
1010 = 0xA
1011 = 0xB
1100 = 0xC
1101 = 0xD
1110 = 0xE
1111 = 0xF

Btw, here's a good online converter (you can swap back & forth) - https://www.rapidtables.com/convert/numb...inary.html

Logical Operations on done on a per bit basis. So let's say we have a value in r3 and we preform a logical operation to the value in r27. Bit 0 of r3 will have a logical operation done in reference to bit 0 of r27. Bit 1 of r3 will have an operation done in reference to bit 1 of r27, and so on and so on.



Chapter 2: Logical OR

Logical ORing is one of the most commonly used logical operations. ORing means if at least value #1 or value #2 is true, then the result is true.

Binary Diagram:

Code:
Bit Value rA  Bit Value rB Bit Result rD
0                0            0
0                1            1
1                0            1
1                1            1

Scaling up from binary to a hex word value, if r3 has a value of 0x00000001, and r27 has a value of 0x80000001, and these two values are OR'd together, it would produce a result of 0x80000001. Confused by this? let's break it down in binary view...

r3  - 0000 0000 0000 0000 0000 0000 0000 0001
r27 - 1000 0000 0000 0000 0000 0000 0000 0001

Using the binary digram provided above, and you preform a logical OR for every bit, then the result in binary is...

1000 0000 0000 0000 0000 0000 0000 0001

This is why the hex result is 0x80000001.

Broadway comes with the following Logical OR instructions (all instructions include a Record feature):

Code:
or rD, rA, rB #Value of rA is logically OR'd with value of rB, result placed in rD. This instruction comes with the ability to use the Record feature (free use of cmpwi rD, 0).

ori rD, rA, VALUE #VALUE is logical/unsigned. rA is OR'd with 0x0000VVVV with VVVV being VALUE, the result is placed in rD.

oris rD, rA, VALUE #VALUE is logical/unsigned; rA is OR'd with 0xVVVV0000 with VVVV being VALUE, the result is placed in rD.

If you recall back from the Assembly Tutorial HERE, you should now have an understanding of why the usage of the lis and ori instructions are preformed to write entire 32-bit (word) values from scratch to a GPR.

You may find yourself in a scenario where you need flip a bit high and not mess with the other bits in a register. Here's an example where we need load a value into a register, flip its bit value high, then store the valueback

Code:
lwz rX, 0zZZZZ (rY)
oris rX, rX, 0x8000
stw rX, 0zZZZZ (rY)

A good usage for OR is to check if two separate values are both true to a third value. Example: check if values in r5 and r6 are both equal to the immediate value of 255

Code:
or r4, r5, r6 #OR r5 with r6, place result temporarily in r4
cmpwi r4, 255 #Compare result to 255 (0xFF)
beq- some_label #If equal, that means both nummbers in r5 and r6 are 255, take the branch

Fyi: nop is a simplified mnemonic of ori r0, r0, 0x0000
Fyi: mr rD, rA is a simplified mnemonic of or rD, rA, rA #rA is logically OR'd with itself



Chapter 3: Logical AND

Another commonly used logical operation is AND. AND means if both value#1 and value#2 are true, then the result is true, otherwise the result is always false. Here is a binary diagram for AND~

Code:
Bit Value rA  Bit Value rB Bit Result rD
0                0            0
0                1            0
1                0            0
1                1            1

ANDing operations for Broadway:

Code:
and rD, rA, rB #rA is AND'd with rB; result in rD. Comes with a Record feature if needed.

andi. rD, rA, VALUE #VALUE is unsigned; rA is AND'd with 0x0000VVVV with VVVV being VALUE, the result is placed in rD. A form of this instruction w/o the Record feature does NOT exist. The upper 16 bits of rD will always result in 0x0000!

andis. rD, rA, VALUE #VALUE is unsigned; rA is AND'd with 0xVVVV0000 with VVVV being VALUE, the result is placed in rD. A form of this instruction w/o the Record feature does NOT exist. The lower 16 bits of rD will always result in 0x0000!

ANDing can be a good way to check if certain bits are flipped high. Let's say a r19 has a value and you want to check if bit 30 + bit 31 are both flipped high. If not, take the branch

Code:
andi. r0, r19, 0x0003 #Bits 30 and 31 when flipped high are the hex digit value 3. And 0x3 with r19. Temporarily use r0 to place result in.
bne- some_label

ANDing is also a useful tool to remove a bit. Remember in the AND diagram above if any bit in the 'bit pair' reference is 0, the result is always 0.

Example of checking if a bit is flipped low in the upper 16 bits of a register. Check if bit 2 is flipped low in r5, temporarily use r0 to place result in. Lower 16 bits don't matter, will be set to null.

Code:
andis. r0, r5, 0xDFFF #Binary view: 1101 1111 1111 1111; notice bit 2 is set low to force r5's bit 2 to always be low in the result

Example of checking if bit 21 is flipped low in r5; place result in r0. Upper 16 bits don't matter, will be set to null.

Code:
andi. r0, r5, 0xFBFF  #Binary view 1111 1011 1111 1111

When dealing with needing to flip two seprate bits low, and one bit is in the upper 16 bits, while the other is in the lower 16 bits, you will need to use 'and' because you will be doing a logical AND with an entire 32 (word) value

Example of ANDing r5's value with the value of 0xFFF7DFFF to make sure bits 8 and 18 are set low. Use r30 to set the value in before the ANDing is executed. When ANDing is executed, check if result is 0 (use Record feature), and branch if result does equal 0.

Code:
lis r30, 0xFFF7 #Binary view 1111 1111 1111 0111; bit 8 is low
ori r30, r30, 0xDFFF  1101 1111 1111 1111; bit 18 is low
and. r0, r5, r30 #AND r00r0r0r0r
beq- some_label

NOTICE: You are probably wondering at this point how to remove a bit using a Logical AND without having the upper or lower 16 bits automatically set to null from using andi./andis.

This is done with the rlwinm instruction. It is a rotation-type instruction and can be used for many different purposes. An entire separate thread covering this instruction can be found HERE

However here is a quick example ~

Code:
rlwinm rD, rA, rB, 0, 0xZZZZZZZZ #Z values are the 32 value that will be AND'd with rA and place the result in rD.



Chapter 4: Other Logical Operations

Broadway also comes with...

nor (includes Record feature)
nand (includes Record feature)
xor (includes Record feature)
xori
xoris

Logical NOR is the exact opposite of OR. So if any ORing result would be 0, then NOR's result would be 1 and vice versa.

Binary Diagram of NOR

Code:
Bit Value rX  Bit Value rY Bit Result rZ
0                0            1
0                1            0
1                0            0
1                1            0


If you logically NOR a value with itself, you will actually just flip every bit to it's opposite value. This is known as a logical NOT. You can use the simplified mnemonic 'not' to preform this type of operation.

Code:
not rD, rA = nor rD, rA, rA

Logical NAND is the exact opposite of AND.

Binary Diagram of NAND

Code:
Bit Value rA  Bit Value rB Bit Result rD
0                0            1
0                1            1
1                0            1
1                1            0

Binary Diagram of XOR (Exclusive OR)

Code:
Bit Value rX  Bit Value rY Bit Result rZ
0                0            0
0                1            1
1                0            1
1                1            0



Chapter 5: Conclusion

Here's a good logical operations calculator - https://keisan.casio.com/exec/system/14495408631029

Understanding logical operation instructions is a must if you are working on a code that has a value in a register that uses bits to represent something such as a characters, levels, maps, items, etc. Happy coding!

Print this item

  Roll Itembox Anytime [1superchip]
Posted by: 1superchip - 04-23-2021, 01:53 AM - Forum: Online; Item - Replies (1)

Roll Itembox Anytime [1superchip]

Allows user to roll item roulette anytime they press their chosen button activator, does not allow for hacked items unless probabilities are modified. Works everywhere.
This code can cause the mushroom bug.

XXXX = Controller Address
ZZZZ = Button Value

NTSC-U
C0000000 00000010
3C608034 6063XXXX
A0630000 3960ZZZZ
7D601838 7C005800
40A20060 3C60809C
8063EE20 2C030000
41A20050 9421FF80
7D8802A6 BC610008
80630014 3C80809C
80848F68 88840B84
1C840248 7C632214
38800000 38A00000
38C00000 3D808078
618CFC2C 7D8803A6
4E800021 B8610008
7D8803A6 38210080
4E800020 00000000

PAL:
C0000000 00000010
3C608034 6063XXXX
A0630000 3960ZZZZ
7D601838 7C005800
40A20060 3C60809C
80633618 2C030000
41A20050 9421FF80
7D8802A6 BC610008
80630014 3C80809C
8084D728 88840B84
1C840248 7C632214
38800000 38A00000
38C00000 3D808079
618C8C38 7D8803A6
4E800021 B8610008
7D8803A6 38210080
4E800020 00000000

NTSC-J:
C0000000 00000010
3C608034 6063XXXX
A0630000 3960ZZZZ
7D601838 7C005800
40A20060 3C60809C
80632678 2C030000
41A20050 9421FF80
7D8802A6 BC610008
80630014 3C80809C
8084C788 88840B84
1C840248 7C632214
38800000 38A00000
38C00000 3D808079
618C82A4 7D8803A6
4E800021 B8610008
7D8803A6 38210080
4E800020 00000000

NTSC-K:
C0000000 00000010
3C608033 6063XXXX
A0630000 3960ZZZZ
7D601838 7C005800
40A20060 3C60809B
80631C58 2C030000
41A20050 9421FF80
7D8802A6 BC610008
80630014 3C80809B
8084BD68 88840B84
1C840248 7C632214
38800000 38A00000
38C00000 3D808078
618C6FF8 7D8803A6
4E800021 B8610008
7D8803A6 38210080
4E800020 00000000


Source:


#C0 asm

.set region, ''

.if (region == 'E' || region == 'e') # RMCE
    .set ItemFunction, 0x8078fc2c
    .set ItemHolder, 0x809bee20
    .set Racedata, 0x809B8F68
    lis r3, 0x8034
.elseif (region == 'P' || region == 'p') # RMCP
    .set ItemFunction, 0x80798c38
    .set ItemHolder, 0x809C3618
    .set Racedata, 0x809BD728
    lis r3, 0x8034
.elseif (region == 'J' || region == 'j') # RMCJ
    .set ItemFunction, 0x807982a4
    .set ItemHolder, 0x809C2678
    .set Racedata, 0x809BC788
    lis r3, 0x8034
.elseif (region == 'K' || region == 'k') # RMCK
    .set ItemFunction, 0x80786ff8
    .set ItemHolder, 0x809B1C58
    .set Racedata, 0x809ABD68
    lis r3, 0x8033
.else # Invalid Region
    .err
.endif

ori r3, r3, 0xXXXX #controller address
lhz r3, 0 (r3)
li r11, 0xZZZZ #button value
and r0, r11, r3
cmpw r0, r11
bne+ end

lis r3, ItemHolder@ha
lwz r3, ItemHolder@l (r3)

cmpwi r3, 0
beq+ end

stwu sp, -0x0080 (sp) #Make stack frame
mflr r12 #Backup LR because C0
stmw r3, 0x8 (sp)

lwz r3, 0x14 (r3)
lis r4, Racedata@ha
lwz r4, Racedata@l (r4)
lbz r4, 0xb84 (r4) #get player id, will work everywhere
mulli r4, r4, 0x248
add r3, r3, r4

#set parameters as NTSC-U 0x8081527c
li r4, 0
li r5, 0
li r6, 0

lis r12, ItemFunction@h
ori r12, r12, ItemFunction@l
mtlr r12
blrl

lmw r3, 0x8 (sp) #Pop stack frame
mtlr r12 #Recover LR because c0
addi sp, sp, 0x0080

end:
blr


Code Creator: 1superchip
Code Credits: Seeky (RaceData player id)

Print this item

  Anyone got a CTWW Patch? Like in CTGP
Posted by: Fynn935083 - 04-22-2021, 07:46 AM - Forum: Code Support / Help / Requests - Replies (1)

The title explains everything

Print this item

  Always Get Respawn Boost [CLF78]
Posted by: CLF78 - 04-20-2021, 02:01 PM - Forum: Online Non-Item - Replies (2)

You will always get a boost when landing from a respawn.

NTSC-U
0457B4A0 60000000

PAL
04581D04 60000000

NTSC-J
04581684 60000000

NTSC-K
0456FD5C 60000000

Code created by: CLF78

Print this item

  How would i write "if x==some value and y==some value" in a gecko code?
Posted by: jawa - 04-19-2021, 10:50 AM - Forum: Code Support / Help / Requests - Replies (1)

The title explains everything.

Print this item

  Disable Luma [CLF78]
Posted by: CLF78 - 04-17-2021, 01:05 PM - Forum: Visual & Sound Effects - No Replies

This code disables the Luma for Rosalina.

NTSC-U
027B9F1C 00004800

PAL
027C897C 00004800

NTSC-J
027C7FE8 00004800

NTSC-K
027B6D3C 00004800

Note: Nop the address to enable Luma for every character. Change the cmpwi in the previous instruction to change the character that makes Luma load.

Code created by: CLF78

Print this item

  Position Graphic Modifier [1superchip]
Posted by: 1superchip - 04-14-2021, 01:39 AM - Forum: Visual & Sound Effects - No Replies

Position Graphic Modifier [1superchip]

This code forces the position tracker to show a specific rank. Actual position not affected. 

NTSC-U
047ea428 3BE0000X

PAL
047f4a50 3BE0000X

NTSC-J
047f40bc 3BE0000X

NTSC-K
047e2e10 3BE0000X

X Values:
1 = 1st
2 = 2nd
3 = 3rd
4 = 4th
5 = 5th
6 = 6th
7 = 7th
8 = 8th
9 = 9th
A = 10th
B = 11th
C = 12th

Code Creator: 1superchip

Print this item