Positional Shared Item
#1
Positional Shared Item

This code will replace the items that you receive in a certain position, with one of your choosing. It is undetectable if the item received is one that can legitimately be received in your current position.

(NTSC-U)
# Single Position
2834XXXX YYYYZZZZ
C27AB704 00000003
2C19000P 40A20008
386000WW 90770020
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
047AB704 90770020
E0000000 80008000

# Multiple Positions
2834XXXX YYYYZZZZ
C27AB704 00000005
2C19000P 40A2000C
386000WW 48000010
2C19000P 40A20008
386000WW 90770020
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
047AB704 90770020
E0000000 80008000

(PAL)
# Single Position
2834XXXX YYYYZZZZ
C27BA164 00000003
2C19000P 40A20008
386000WW 90770020
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
047BA164 90770020
E0000000 80008000

# Multiple Positions
2834XXXX YYYYZZZZ
C27BA164 00000005
2C19000P 40A2000C
386000WW 48000010
2C19000P 40A20008
386000WW 90770020
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
047BA164 90770020
E0000000 80008000

(NTSC-J)
# Single Position
2834XXXX YYYYZZZZ
C27B97D0 00000003
2C19000P 40A20008
386000WW 90770020
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
047B97D0 90770020
E0000000 80008000

# Multiple Positions
2834XXXX YYYYZZZZ
C27B97D0 00000005
2C19000P 40A2000C
386000WW 48000010
2C19000P 40A20008
386000WW 90770020
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
047B97D0 90770020
E0000000 80008000

(NTSC-K)
# Single Position
2833XXXX YYYYZZZZ
C27A8524 00000003
2C19000P 40A20008
386000WW 90770020
60000000 00000000
E0000000 00000000
2833XXXX YYYYZZZZ
047A8524 90770020
E0000000 80008000

# Multiple Positions
2833XXXX YYYYZZZZ
C27A8524 00000005
2C19000P 40A2000C
386000WW 48000010
2C19000P 40A20008
386000WW 90770020
60000000 00000000
E0000000 00000000
2833XXXX YYYYZZZZ
047A8524 90770020
E0000000 80008000

[Values]
P = Position to Replace Items

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

WW = Item to Obtain

00 = Green Shell
01 = Red Shell
02 = Banana
03 = Fake Item Box
04 = Mushroom
05 = Triple Mushroom
06 = Bob-omb
07 = Blue Shell
08 = Lightning
09 = Star
0A = Golden Mushroom
0B = Mega Mushroom
0C = Blooper
0D = POW Block
0E = Thunder Cloud
0F = Bullet Bill
10 = Triple Green Shells
11 = Triple Red Shells
12 = Triple Bananas
14 = No Item Available (Mushroom)



# Source
# r3 = Item player will receive
# r25 = Player's current position
# Item Definitions
.set ITEM_GREENSHELL, 0x0
.set ITEM_REDSHELL, 0x1
.set ITEM_BANANA, 0x2
.set ITEM_FAKEITEMBOX, 0x3
.set ITEM_MUSHROOM, 0x4
.set ITEM_TRIPLEMUSHROOM, 0x5
.set ITEM_BOBOMB, 0x6
.set ITEM_BLUESHELL, 0x7
.set ITEM_LIGHTNING, 0x8
.set ITEM_STAR, 0x9
.set ITEM_GOLDENMUSHROOM, 0xA
.set ITEM_MEGAMUSHROOM, 0xB
.set ITEM_BLOOPER, 0xC
.set ITEM_POWBLOCK, 0xD
.set ITEM_THUNDERCLOUD, 0xE
.set ITEM_BULLETBILL, 0xF
.set ITEM_TRIPLEGREENSHELLS, 0x10
.set ITEM_TRIPLEREDSHELLS, 0x11
.set ITEM_TRIPLEBANANAS, 0x12
.set ITEM_NOITEM_MUSHROOM, 0x14

cmpwi r25, POSITION_TO_REPLACE_ITEMS # Compare the word in r25 (Player's Current Position) to the position to replace items in
bne+ 0x08 # If they are not in said position, branch
li r3, ITEM_REPLACED_WITH # If they are in said position, load the value of the item we want into r3 (Item player will receive)
stw r3,32(r23) # Store the word in r3 to the address in r23 offset by 32



Code Creator: Star
Code Credits: Guru (Shared Item Code)
Reply
#2
Wow. Nice job!
Reply
#3
Updated to support both single and multiple positions.
Reply
#4
Updated the multiple positions version to improve performance. It still functions identical to the original version. The only difference is it will store the item immediately when it reaches your current position, rather than redundantly checking the rest of the positions.
Reply
#5
bne- 0x08 # If they are not in said position, branch

wouldn't this be bne+ since the branch is most likely to happen since the player is most likely to have a position NOT equal to X
Reply
#6
Thank you for pointing that out to me ! I have rectified the error on a few of my codes. Blush
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)