In this tutorial we'll discuss how to replace certain items with other ones in Mario Kart Wii. This is done with a conditional "Force Next Item" code.
First, we need the values for all items.
Item Values:
Next, we need to know the way the assembly code needs to be written for this purpose.
The code on the right is now ready to use.
Note
Make sure comments (text included in ## tags) or instructions do not line-wrap otherwise you'll have to expand the window to successfully compile the code.
Code credits go to XeR and me.
I hope you enjoyed this tutorial! Leave some feedback if you want
First, we need the values for all items.
Item Values:
- Code:
14 = Nothing
12 = Triple Bananas
11 = Triple Red Shells
10 = Triple Green Shells
0F = Bullet Bill
0E = Thunder Cloud
0D = POW
0C = Blooper
0B = Mega Mushroom
0A = Golden Mushroom
09 = Star Power
08 = Lightning
07 = Blue Shell
06 = Bomb
05 = Triple Mushrooms
04 = Single Mushroom
03 = Fake Box
02 = Banana
01 = Red Shell
00 = Green Shell
- Code:
0 = Nothing
3 = Triple Mushrooms
3 = Triple Green Shells
3 = Triple Bananas
3 = Triple Red Shells
1 = Otherwise
Next, we need to know the way the assembly code needs to be written for this purpose.
- Spoiler:
- The original instruction
- Code:
stw r0,8(r3)
- Code:
807BC95C
- Code:
cmpwi r28, 0xORIGINAL_ITEM
- Code:
bne- SKIP1
- Code:
li r28, 0xNEW_ITEM
- Code:
stw r28, 4 (r3)
- Code:
li r0, 0xNEW_ITEM_AMOUNT
- Code:
SKIP1:
- Code:
cmpwi r28, 0xORIGINAL_ITEM
bne- SKIP1
li r28, 0xNEW_ITEM
stw r28, 4 (r3)
li r0, 0xNEW_ITEM_AMOUNT
SKIP1:
stw r0,8(r3)
- Code:
SKIP1
- Code:
SKIP2
- Code:
cmpwi r28, 0xORIGINAL_ITEM
bne- SKIP1
li r28, 0xNEW_ITEM
stw r28, 4 (r3)
li r0, 0xNEW_ITEM_AMOUNT
SKIP1:
cmpwi r28, 0xORIGINAL_ITEM
bne- SKIP2
li r28, 0xNEW_ITEM
stw r28, 4 (r3)
li r0, 0xNEW_ITEM_AMOUNT
SKIP2:
stw r0,8(r3)
- Code:
cmpwi r28, 0xORIGINAL_ITEM
bne- SKIP1
li r28, 0xNEW_ITEM
stw r28, 4 (r3)
li r0, 0xNEW_ITEM_AMOUNT
SKIP1:
cmpwi r28, 0xORIGINAL_ITEM
bne- SKIP2
li r28, 0xNEW_ITEM
stw r28, 4 (r3)
li r0, 0xNEW_ITEM_AMOUNT
SKIP2:
cmpwi r28, 0xORIGINAL_ITEM
bne- SKIP3
li r28, 0xNEW_ITEM
stw r28, 4 (r3)
li r0, 0xNEW_ITEM_AMOUNT
SKIP3:
stw r0,8(r3)
- Code:
#Banana -> Triple#
cmpwi r28, 0x02
bne- SKIP1
li r28, 0x12
stw r28, 4 (r3)
li r0, 0x3
SKIP1:
#Green Shell -> Triple#
cmpwi r28, 0x00
bne- SKIP2
li r28, 0x10
stw r28, 4 (r3)
li r0, 0x3
SKIP2:
#Red Shell -> Triple#
cmpwi r28, 0x01
bne- SKIP3
li r28, 0x11
stw r28, 4 (r3)
li r0, 0x3
SKIP3:
stw r0,8(r3)
The code on the right is now ready to use.
Note
Make sure comments (text included in ## tags) or instructions do not line-wrap otherwise you'll have to expand the window to successfully compile the code.
Code credits go to XeR and me.
I hope you enjoyed this tutorial! Leave some feedback if you want
Last edited by Bully@WiiPlaza on 1/31/2015, 8:08 am; edited 6 times in total