12-27-2024, 03:45 PM
Nevermind the Region, I have written a region free code that can be used to assign Items to all offline racers, including CPUs
Source is ofc added, if anyone wants to modify it.
C0000000 00000014
3D208000 89695F27
3D40809C 2C0B00EC
80AA3618 41820030
2C0B008C 80AAEE20
41820024 2C0B0010
80AA2678 41820018
2C0B0054 3D40809B
80AA1C58 41820008
48000058 2C050000
41820050 39290FC4
81450014 38A00000
54AB083C 7C0958AE
396B0001 7C6958AE
2C030000 40A2000C
2C000000 41820018
1D850248 398C008C
7C0A612E 398C0004
7C6A612E 38A50001
2C05000C 4180FFC4
4E800020 00000000
The code will load Item and amount for each player, starting from adress 80000FC4. To set your specific item, you can use Button activators.
283PXXXX YYYYZZZZ
0200SSSS 0000II0Q
E0000000 00000000
where
XXXX: Controller adress
ZZZZ: Button Activator
YYYY = FFFF - ZZZZ, or YYYY = 0000 if only these buttons should be pressed
P = 3 for Korea, P = 4 else
SSSS: Player offset
0FC4 = Player 1
0FC6 = Player 2/CPU 1
0FC8 = Player 3/CPU 2
0FCA = Player 4/CPU 3
0FCC = CPU 4
0FCE = CPU 5
0FD0 = CPU 6
0FD2 = CPU 7
0FD4 = CPU 8
0FD6 = CPU 9
0FD8 = CPU 10
0FDA = CPU 11
II and Q: Item and Amount
II = 12, Q = 3: Triple Bannans
II = 11, Q = 3: Triple Reds
II = 10, Q = 3: Triple Greens
II = 0F, Q = 1: Bullet Bill
II = 0E, Q = 1: Cloud
II = 0D, Q = 1: POW
II = 0C, Q = 1: Blooper
II = 0B, Q = 1: Mega Shroom
II = 0A, Q = 1: Gold Shroom
II = 09, Q = 1: Star Power
II = 08, Q = 1: Lightning
II = 07, Q = 1: Blue shell
II = 06, Q = 1: Bomb
II = 05, Q = 3: Shrooms
II = 04, Q = 1: 1 Shroom
II = 03, Q = 1: Fake Box
II = 02, Q = 1: Bannana
II = 01, Q = 1: Red shell
II = 00, Q = 1: Green Shell
II = 14, Q = 0: Nothing
Here is an example how to setup it with Button activators
28345842 00000088 First Player Classic Controller PAL, Buttons X and Zl
02000FC4 00000101 Red Shell for Player 1
E0000000 00000000
28345842 00000028 First Player Classic Controller PAL, Buttons X and Y
02000FC4 00000201 Banana for Player 1
E0000000 00000000
28345D1A 00001000 Second Player Wiimote PAL, button -
02000FC6 00000701 Blue Shell for Player 2
E0000000 00000000
28345D1A 00000010 Second Player Wiimote PAL, button +
02000FC6 00000901 Star for Player 2
E0000000 00000000
E0000000 80008000
Source:
lis r9, 0x8000
#Find Region of Game
lbz r11, 0x5F27 (r9) #Instruction here is vital. Virtually impossible for this to be modded by something unrelated
lis r10, 0x809C #Prepare PlayerHolder
cmpwi r11, 0xEC #pal
lwz r5, 0x3618 (r10)
beq- next
cmpwi r11, 0x8C #usa
lwz r5, 0xFFFFEE20 (r10)
beq- next
cmpwi r11, 0x10 #japan
lwz r5, 0x2678 (r10)
beq- next
cmpwi r11, 0x54 #korea
lis r10, 0x809B
lwz r5, 0x1C58 (r10)
beq- next
#unknown region
b end
next:
cmpwi r5, 0 # check if PlayerHolder is active
beq- end
addi r9, r9, 0x0FC4
lwz r10, 0x14 (r5)
li r5, 0
# r0 = Item
# r3 = Amount
# r5 = counter
# r9 = Source Adress
# r10 = Target Adress
# r11 = Source Player offset
# r12 = Target Player offset
loop:
# load amount and Item
slwi r11, r5, 1
lbzx r0, r9, r11 # load custom Item
addi r11, r11, 1
lbzx r3, r9, r11 # load custom amount
cmpwi r3, 0x0
bne+ item_ok
cmpwi r0, 0
beq- deac_skip
item_ok:
mulli r12, r5, 584
addi r12, r12, 0x8c # 0x8c is Item offset
stwx r0, r10, r12 # store it to Item offset
addi r12, r12, 0x4 # 0x90 is amount offset
stwx r3, r10, r12 # store amount to offset
deac_skip:
addi r5, r5, 1
cmpwi r5, 12
blt loop
end:
Source is ofc added, if anyone wants to modify it.
C0000000 00000014
3D208000 89695F27
3D40809C 2C0B00EC
80AA3618 41820030
2C0B008C 80AAEE20
41820024 2C0B0010
80AA2678 41820018
2C0B0054 3D40809B
80AA1C58 41820008
48000058 2C050000
41820050 39290FC4
81450014 38A00000
54AB083C 7C0958AE
396B0001 7C6958AE
2C030000 40A2000C
2C000000 41820018
1D850248 398C008C
7C0A612E 398C0004
7C6A612E 38A50001
2C05000C 4180FFC4
4E800020 00000000
The code will load Item and amount for each player, starting from adress 80000FC4. To set your specific item, you can use Button activators.
283PXXXX YYYYZZZZ
0200SSSS 0000II0Q
E0000000 00000000
where
XXXX: Controller adress
ZZZZ: Button Activator
YYYY = FFFF - ZZZZ, or YYYY = 0000 if only these buttons should be pressed
P = 3 for Korea, P = 4 else
SSSS: Player offset
0FC4 = Player 1
0FC6 = Player 2/CPU 1
0FC8 = Player 3/CPU 2
0FCA = Player 4/CPU 3
0FCC = CPU 4
0FCE = CPU 5
0FD0 = CPU 6
0FD2 = CPU 7
0FD4 = CPU 8
0FD6 = CPU 9
0FD8 = CPU 10
0FDA = CPU 11
II and Q: Item and Amount
II = 12, Q = 3: Triple Bannans
II = 11, Q = 3: Triple Reds
II = 10, Q = 3: Triple Greens
II = 0F, Q = 1: Bullet Bill
II = 0E, Q = 1: Cloud
II = 0D, Q = 1: POW
II = 0C, Q = 1: Blooper
II = 0B, Q = 1: Mega Shroom
II = 0A, Q = 1: Gold Shroom
II = 09, Q = 1: Star Power
II = 08, Q = 1: Lightning
II = 07, Q = 1: Blue shell
II = 06, Q = 1: Bomb
II = 05, Q = 3: Shrooms
II = 04, Q = 1: 1 Shroom
II = 03, Q = 1: Fake Box
II = 02, Q = 1: Bannana
II = 01, Q = 1: Red shell
II = 00, Q = 1: Green Shell
II = 14, Q = 0: Nothing
Here is an example how to setup it with Button activators
28345842 00000088 First Player Classic Controller PAL, Buttons X and Zl
02000FC4 00000101 Red Shell for Player 1
E0000000 00000000
28345842 00000028 First Player Classic Controller PAL, Buttons X and Y
02000FC4 00000201 Banana for Player 1
E0000000 00000000
28345D1A 00001000 Second Player Wiimote PAL, button -
02000FC6 00000701 Blue Shell for Player 2
E0000000 00000000
28345D1A 00000010 Second Player Wiimote PAL, button +
02000FC6 00000901 Star for Player 2
E0000000 00000000
E0000000 80008000
Source:
lis r9, 0x8000
#Find Region of Game
lbz r11, 0x5F27 (r9) #Instruction here is vital. Virtually impossible for this to be modded by something unrelated
lis r10, 0x809C #Prepare PlayerHolder
cmpwi r11, 0xEC #pal
lwz r5, 0x3618 (r10)
beq- next
cmpwi r11, 0x8C #usa
lwz r5, 0xFFFFEE20 (r10)
beq- next
cmpwi r11, 0x10 #japan
lwz r5, 0x2678 (r10)
beq- next
cmpwi r11, 0x54 #korea
lis r10, 0x809B
lwz r5, 0x1C58 (r10)
beq- next
#unknown region
b end
next:
cmpwi r5, 0 # check if PlayerHolder is active
beq- end
addi r9, r9, 0x0FC4
lwz r10, 0x14 (r5)
li r5, 0
# r0 = Item
# r3 = Amount
# r5 = counter
# r9 = Source Adress
# r10 = Target Adress
# r11 = Source Player offset
# r12 = Target Player offset
loop:
# load amount and Item
slwi r11, r5, 1
lbzx r0, r9, r11 # load custom Item
addi r11, r11, 1
lbzx r3, r9, r11 # load custom amount
cmpwi r3, 0x0
bne+ item_ok
cmpwi r0, 0
beq- deac_skip
item_ok:
mulli r12, r5, 584
addi r12, r12, 0x8c # 0x8c is Item offset
stwx r0, r10, r12 # store it to Item offset
addi r12, r12, 0x4 # 0x90 is amount offset
stwx r3, r10, r12 # store amount to offset
deac_skip:
addi r5, r5, 1
cmpwi r5, 12
blt loop
end: