Kaizo CPU Mod [B_squo]
Video demo - https://www.youtube.com/watch?v=WCOathdibVU
Quote from B_squo~
=== Code ===
(PAL)
04731ffc 4bffd805
04731cb0 4bffdb51
02731fea 000000d4
02731c9e 000000d4
0472fb7c 38600001
0472fb80 4e800020
0472fcd8 60000000
C272FDAC 00000004
38600006 3C808074
6084B7F4 7C8903A6
4E800421 7C641B78
60000000 00000000
0472fdb4 60000000
0472fed0 60000000
04726ed4 38800000
048c98fc 462BE000
04726f70 4800000c
04727220 60000000
04727228 60000000
(NTSC-U)
04727e44 48018d81
04727af8 480190cd
02727e32 000000d4
02727ae6 000000d4
04740f40 38600001
04740f44 4e800020
0474109c 60000000
C2741170 00000004
38600006 3C808073
6084b928 7C8903A6
4E800421 7C641B78
60000000 00000000
04741178 60000000
04741294 60000000
0473cf3c 38800000
048c67cc 462BE000
0473cfd8 4800000c
0473d288 60000000
0473d290 60000000
Alternative version. Just like above, except that you can choose what item CPUs will throw. XX is the item ID (see "Item Box number" here: https ://wiki.tockdom.com/wiki/List_of_Identifiers#Items)
(PAL)
04731ffc 4bffd805
04731cb0 4bffdb51
02731fea 000000d4
02731c9e 000000d4
0472fb7c 38600001
0472fb80 4e800020
0472fcd8 60000000
0472fda4 38600001
0072fdb7 000000XX
0472fed0 60000000
04726ed4 38800000
048c98fc 462BE000
04726f70 4800000c
04727220 60000000
04727228 60000000
(NTSC-U)
04727e44 48018d81
04727af8 480190cd
02727e32 000000d4
02727ae6 000000d4
04740f40 38600001
04740f44 4e800020
0474109c 60000000
04741168 38600001
0074117b 000000XX
04741178 60000000
0473cf3c 38800000
048c67cc 462BE000
0473cfd8 4800000c
0473d288 60000000
0473d290 60000000
=== Documentation ===
This code switches the regular CPU race "control" by the one used in the N64 DK's Jungle Parkway competition, which allow them to equip an item without touching item boxes, nor requiring any item hack.
Normally, this control only allows CPUs to throw single bananas when near enough the player, and at certain semi-random intervals. This code modifies that so that the item equipped by the CPU is randomized every frame, and to remove the delay in-between each item throw.
As for the "CPUs following the exact path of the player" part, it was made by forcing the game into calling the function responsible for following the player when they have a Mega Mushroom or Thundercloud, with a modified, larger radius.
Collection of Codes with explanation:
Video demo - https://www.youtube.com/watch?v=WCOathdibVU
Quote from B_squo~
Quote:This is my own take at a "impossible CPUs"-type of mod. This features CPUs instantly throwing random items towards the player, plus them always following the player if near enough to them, even if they have to exit their usual paths.
This code hasn't been tested very much, only on Dolphin...
You should be able to combine this with other CPU-related codes, (such as codes that change the CPU's speed) to achieve even crazier results.
I recommend using an item delimiter code such as this one for the best experience: https ://mariokartwii.com/showthread.php?tid=259
=== Code ===
(PAL)
04731ffc 4bffd805
04731cb0 4bffdb51
02731fea 000000d4
02731c9e 000000d4
0472fb7c 38600001
0472fb80 4e800020
0472fcd8 60000000
C272FDAC 00000004
38600006 3C808074
6084B7F4 7C8903A6
4E800421 7C641B78
60000000 00000000
0472fdb4 60000000
0472fed0 60000000
04726ed4 38800000
048c98fc 462BE000
04726f70 4800000c
04727220 60000000
04727228 60000000
(NTSC-U)
04727e44 48018d81
04727af8 480190cd
02727e32 000000d4
02727ae6 000000d4
04740f40 38600001
04740f44 4e800020
0474109c 60000000
C2741170 00000004
38600006 3C808073
6084b928 7C8903A6
4E800421 7C641B78
60000000 00000000
04741178 60000000
04741294 60000000
0473cf3c 38800000
048c67cc 462BE000
0473cfd8 4800000c
0473d288 60000000
0473d290 60000000
Alternative version. Just like above, except that you can choose what item CPUs will throw. XX is the item ID (see "Item Box number" here: https ://wiki.tockdom.com/wiki/List_of_Identifiers#Items)
(PAL)
04731ffc 4bffd805
04731cb0 4bffdb51
02731fea 000000d4
02731c9e 000000d4
0472fb7c 38600001
0472fb80 4e800020
0472fcd8 60000000
0472fda4 38600001
0072fdb7 000000XX
0472fed0 60000000
04726ed4 38800000
048c98fc 462BE000
04726f70 4800000c
04727220 60000000
04727228 60000000
(NTSC-U)
04727e44 48018d81
04727af8 480190cd
02727e32 000000d4
02727ae6 000000d4
04740f40 38600001
04740f44 4e800020
0474109c 60000000
04741168 38600001
0074117b 000000XX
04741178 60000000
0473cf3c 38800000
048c67cc 462BE000
0473cfd8 4800000c
0473d288 60000000
0473d290 60000000
=== Documentation ===
This code switches the regular CPU race "control" by the one used in the N64 DK's Jungle Parkway competition, which allow them to equip an item without touching item boxes, nor requiring any item hack.
Normally, this control only allows CPUs to throw single bananas when near enough the player, and at certain semi-random intervals. This code modifies that so that the item equipped by the CPU is randomized every frame, and to remove the delay in-between each item throw.
As for the "CPUs following the exact path of the player" part, it was made by forcing the game into calling the function responsible for following the player when they have a Mega Mushroom or Thundercloud, with a modified, larger radius.
Collection of Codes with explanation:
Code:
When initializing the match, create the N64 DK's Jungle Parkway competition CPU control instead of the race one. This is done for both the race control and the battle control.
04731ffc 4bffd805
04731cb0 4bffdb51
02731fea 000000d4
02731c9e 000000d4
Makes the "isNearPlayer" function associated to the N64 DKJP competition CPU control always return true, in order to allow CPUs to throw items no matter where they are.
0472fb7c 38600001
0472fb80 4e800020
Remove the delay time in between item throws
0472fcd8 60000000
0472fed0 60000000
Small function that randomizes the item given to the player from items ID 0 to 6. The hook overwrites a call to a "item limit not reached" function, which we won't need for the mod.
C272FDAC 00000004
38600006 3C808074
6084B7F4 7C8903A6
4E800421 7C641B78
60000000 00000000
0472fdb4 60000000
Inject at 0x8072fdac (PAL)
.set rand, 0x8074b7f4 # (PAL)
li r3, 0x06
lis r4, rand@h
ori r4, r4, rand@l
mtctr r4
bctrl
mr r4, r3 # r4 is the item ID argument in the "set item to player" function
Force always calling the "CPU follows player" function
04727220 60000000
04727228 60000000
CPUs will only follow player 0 (the first human player)
04726ed4 38800000
Set the XZ size of the CPU follow radius. If the player is inside the radius limited by the CPU's position and this value, then the CPU will start chasing the human player.
048c98fc 462BE000
Ignore Y component of the CPU follow radius
04726f70 4800000c