Never Pickup Certain Item From Box
#1
Never Pickup Certain Item From Box

NOTE: Outdated by Star's Perfect Replace Item with Shared Item. This code functions way differently than Star's code but the end result is the same. His code is better to use because you can use his code and 'my Selective Max Item Probability' code in the same GCT file due to different Base Addresses.

This code will zero out a desired item's probability for all positions. Therefore, it is impossible to ever receive that item from a box. Good code to use for crappy items such as Bloopers and TC's. The code is undetectable.

NTSC-U
C27ACBCC 00000006
9421FFB0 BDC10008
39E4FFWW 3A000000
3A20000C B60F0026
3631FFFF 4082FFF8
B9C10008 38210050
7EE41A14 00000000

PAL
C27BB62C 00000006
9421FFB0 BDC10008
39E4FFWW 3A000000
3A20000C B60F0026
3631FFFF 4082FFF8
B9C10008 38210050
7EE41A14 00000000

NTSC-J
C27BAC98 00000006
9421FFB0 BDC10008
39E4FFWW 3A000000
3A20000C B60F0026
3631FFFF 4082FFF8
B9C10008 38210050
7EE41A14 00000000

NTSC-K
C27A99EC 00000006
9421FFB0 BDC10008
39E4FFWW 3A000000
3A20000C B60F0026
3631FFFF 4082FFF8
B9C10008 38210050
7EE41A14 00000000

#Example Code for 2 Items (no address assigned, fill it in for whatever region you are)#
C2000000 00000009
9421FFB0 BDC10008
39E4FFWW 3A000000
3A20000C B60F0026
3631FFFF 4082FFF8
39E4FFWW 3A20000C
B60F0026 3631FFFF
4082FFF8 B9C10008
38210050 7EE41A14
60000000 00000000

#Example Code for 3 Items (no address assigned, fill it in for whatever region you are)#
C2000000 0000000B
9421FFB0 BDC10008
39E4FFWW 3A000000
3A20000C B60F0026
3631FFFF 4082FFF8
39E4FFWW 3A20000C
B60F0026 3631FFFF
4082FFF8 39E4FFWW
3A20000C B60F0026
3631FFFF 4082FFF8
B9C10008 38210050
7EE41A14 00000000

WW Item Values:
DA = Green
DC = Red
DE = Banana
E0 = Fib
E2 = Shroom
E4 = Triple Shroom
E6 = Bomb
E8 = Blue
EA = Shock
EC = Star
EE = Golden
F0 = Mega
F2 = Blooper
F4 = POW
F6 = TC
F8 = Bill
FA = Triple Green
FC = Triple Red
FE = Triple Banana

Source (For 1 Item):
stwu r1,-80(r1) #Register Safety
stmw r14,8(r1) #Register Safety

addi r15, r4, -0x0026 #Add -0x0026 (Green Shell used for source example) to mem location of r4, store result to r15. This mem location will be exactly -0x0026 away from the desired cheated item's first place halfword mem location
li r16, 0x0 #Load 0x0000 into r16. This will be used to zero out the desired halfword item values.
li r17, 0xC #Load C into r17. There will be C (12) amount of halfwords to rewrite for desired cheated item. This is for a total of 12 positions.

de_crement:
sthu r16, 0x0026 (r15) #First, store the 0x0000 value to overwrite the first item halfword value for desired cheated item. To get to the item's value for the next position and so on. You have to jump 0x26. So this ASM increases the destination mem location by 0x26 every time it is executed.
subic. r17, r17, 1 #Subtract one from r17 every time this ASM is done. Thus this will be C amount of times for the 12 spots for each 7FFF overwritten halfword
bne+ de_crement #If r17 does NOT equal 0, jump backwards to sthu and repeat. If r17 does equal 0, continue down to next ASM

lmw r14,8(r1) #End Register Safety
addi r1,r1,80 #End Register Safety
add r23, r4, r3 #Default ASM

Source (For 2 Items):
stwu r1,-80(r1) #Register Safety
stmw r14,8(r1) #Register Safety

addi r15, r4, -0x0026 #Add -0x0026 (Green Shell used for source example) to mem location of r4, store result to r15. This mem location will be exactly -0x0026 away from the desired cheated item's first place halfword mem location
li r16, 0x0 #Load 0x0000 into r16. This will be used to zero out the desired halfword item values.
li r17, 0xC #Load C into r17. There will be C (12) amount of halfwords to rewrite for desired cheated item. This is for a total of 12 positions.

de_crement:
sthu r16, 0x0026 (r15) #First, store the 0x0000 value to overwrite the first item halfword value for desired cheated item. To get to the item's value for the next position and so on. You have to jump 0x26. So this ASM increases the destination mem location by 0x26 every time it is executed.
subic. r17, r17, 1 #Subtract one from r17 every time this ASM is done. Thus this will be C amount of times for the 12 spots for each 0x0000 overwritten halfword
bne+ de_crement #If r17 does NOT equal 0, jump backwards to sthu and repeat. If r17 does equal 0, continue down to next ASM

addi r15, r4, -0x0026 #Add -0x0026 (Green Shell used for source example) to mem location of r4, store result to r15. This mem location will be exactly -0x0026 away from the desired cheated item's first place halfword mem location
li r17, 0xC #Load C into r17. There will be C (12) amount of halfwords to rewrite for desired cheated item. This is for a total of 12 positions.

de_crement2:
sthu r16, 0x0026 (r15) #First, store the 0x0000 value to overwrite the first item halfword value for desired cheated item. To get to the item's value for the next position and so on. You have to jump 0x26. So this ASM increases the destination mem location by 0x26 every time it is executed.
subic. r17, r17, 1 #Subtract one from r17 every time this ASM is done. Thus this will be C amount of times for the 12 spots for each 0x0000 overwritten halfword
bne+ de_crement2 #If r17 does NOT equal 0, jump backwards to sthu and repeat. If r17 does equal 0, continue down to next ASM

lmw r14,8(r1) #End Register Safety
addi r1,r1,80 #End Register Safety
add r23, r4, r3 #Default ASM

Code creator: zak  Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)