A Step Above God [Star]
#1
A Step Above God [Star]

This code rejects a player's request to receive the specified item.

(NTSC-U)
# All Players
2834XXXX YYYYZZZZ
C265F1E8 00000002
9421FFF0 90610008
2C030000 00000000
C265F234 00000005
80610008 2C030000
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
0465F1E8 2C030000
0465F234 1C00001C
E0000000 80008000

# Specific Player
2834XXXX YYYYZZZZ
C265F1E8 00000002
9421FFF0 90610008
2C030000 00000000
C265F234 00000006
80610008 2C030000
40A20018 2C10000S
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
0465F1E8 2C030000
0465F234 1C00001C
E0000000 80008000

(PAL)
# All Players
2834XXXX YYYYZZZZ
C265E560 00000002
9421FFF0 90610008
2C030000 00000000
C265E5AC 00000005
80610008 2C030000
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
0465E560 2C030000
0465E5AC 1C00001C
E0000000 80008000

# Specific Player
2834XXXX YYYYZZZZ
C265E560 00000002
9421FFF0 90610008
2C030000 00000000
C265E5AC 00000006
80610008 2C030000
40A20018 2C10000S
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
0465E560 2C030000
0465E5AC 1C00001C
E0000000 80008000

(NTSC-J)
# All Players
2834XXXX YYYYZZZZ
C265DBCC 00000002
9421FFF0 90610008
2C030000 00000000
C265DC18 00000005
80610008 2C030000
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
0465DBCC 2C030000
0465DC18 1C00001C
E0000000 80008000

# Specific Player
2834XXXX YYYYZZZZ
C265DBCC 00000002
9421FFF0 90610008
2C030000 00000000
C265DC18 00000006
80610008 2C030000
40A20018 2C10000S
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
E0000000 00000000
2834XXXX YYYYZZZZ
0465DBCC 2C030000
0465DC18 1C00001C
E0000000 80008000

(NTSC-K)
# All Players
2833XXXX YYYYZZZZ
C264C878 00000002
9421FFF0 90610008
2C030000 00000000
C264C8C4 00000005
80610008 2C030000
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
E0000000 00000000
2833XXXX YYYYZZZZ
0464C878 2C030000
0464C8C4 1C00001C
E0000000 80008000

# Specific Player
2833XXXX YYYYZZZZ
C264C878 00000002
9421FFF0 90610008
2C030000 00000000
C264C8C4 00000006
80610008 2C030000
40A20018 2C10000S
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
E0000000 00000000
2833XXXX YYYYZZZZ
0464C878 2C030000
0464C8C4 1C00001C
E0000000 80008000

[S Values]
0 = 1st Player Slot
1 = 2nd Player Slot
2 = 3rd Player Slot
3 = 4th Player Slot
4 = 5th Player Slot
5 = 6th Player Slot
6 = 7th Player Slot
7 = 8th Player Slot
8 = 9th Player Slot
9 = 10th Player Slot
A = 11th Player Slot
B = 12th Player Slot

[RR Values]
00 = Green Shell
01 = Red Shell
02 = Banana
03 = Fake Item Box
04 = Mushroom
05 = Triple Mushrooms
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

Code Creator: Star
Code Credits: Nutmeg
[Image: GiVNKqR.png]
Reply
#2
Imagine being on Worldwides and denying everyone basic items like bananas and greens.
Reply
#3
Great work as usual!

For anyone who wants to make it also be positional-based, use this snippet of source I made for a position tracker..

#Code Creator: Vega
#RMCE 80709BA8
#RMCP 8071164C
#RMCJ 80710CB8
#RMCK 806FF9F4

#r26, 28 are not safe. However 0, 23, 24,25, 27, 30, 31, all safe, LR is safe
#r29 is safe if and only if default instruction is done first

stb r29, 0x003E (r26) #default instruction
lis r23, 0x8000
stb r29, 0xZZZZ (r23) #ZZZZ = exp vector desired location to store position value to

---

Then just add a simple position check with loading the position value from the ZZZZ exp vector location in the main code. I was using this setup to make ppl never pickup the blue whenever i was in 1st Lol. Easy front-runs.
Reply
#4
Would editing the code and adding more cmpwi's actually allow to remove more items?
Reply
#5
Yep. Learn a tiny bit of ASM, tinker with the code, and see how you do.
Reply
#6
For anyone who's too lazy to take the source I provided for a positional version of the code and compile it, here ya go...

P = Position you are in for the Code to execute. RR = Item. Whenever are you are NOT in the position, the code will stop executing. 0x800005FF (byte) of the exception vector is used.

NTSC-U
C265F1E8 00000002
9421FFF0 90610008
2C030000 00000000
C265F234 00000007
3C608000 886305FF
2C03000P 40A2001C
80610008 2C030000
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
C2709BA8 00000002
9BBA003E 3EE08000
9BB705FF 00000000

PAL
C265E560 00000002
9421FFF0 90610008
2C030000 00000000
C265E5AC 00000007
3C608000 886305FF
2C03000P 40A2001C
80610008 2C030000
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
C271164C 00000002
9BBA003E 3EE08000
9BB705FF 00000000

NTSC-J
C265DBCC 00000002
9421FFF0 90610008
2C030000 00000000
C265DC18 00000007
3C608000 886305FF
2C03000P 40A2001C
80610008 2C030000
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
C2710CB8 00000002
9BBA003E 3EE08000
9BB705FF 00000000

NTSC-K
C264C878 00000002
9421FFF0 90610008
2C030000 00000000
C264C8C4 00000007
3C608000 886305FF
2C03000P 40A2001C
80610008 2C030000
40A20010 2C0000RR
40A20008 3A600001
38210010 1C00001C
60000000 00000000
C26FF9F4 00000002
9BBA003E 3EE08000
9BB705FF 00000000

Code:
#============================================================#
#                           Source                           #
#------------------------------------------------------------#
# IsSlotLocalPlayer Return Address Ports:                    #
# RMCE - 0x8065F1E8                                          #
# RMCP - 0x8065E560                                          #
# RMCJ - 0x8065DBCC                                          #
# RMCK - 0x8064C878                                          #
#============================================================#

# Checks if the specified slot belongs to a local player
stwu      r1, -0x10(r1)
stw       r3,  0x08(r1)
cmpwi     r3,  0x00     # Original instruction

#============================================================#
#                           Source                           #
#------------------------------------------------------------#
# ProcessITEMRecordItemLimits Address Ports:                 #
# RMCE - 0x8065F234                                          #
# RMCP - 0x8065E5AC                                          #
# RMCJ - 0x8065DC18                                          #
# RMCK - 0x8064C8C4                                          #
#============================================================#

# Check if our position is met
lis       r3, 0x8000
lbz       r3, 0x05FF (r3) # Load Position from 0x800005FF
cmpwi     r3, 0xP
bne+      branch_not_our_position

# Check if this slot is a local player
lwz       r3,  0x08(r1)
cmpwi     r3,  0x00
bne+      branch_slot_is_local_player

# Check if this item is the specified item to block
cmpwi     r0,  0xRR
bne+      branch_not_blocked_item

li        r19, 0x01     # Reject the item

branch_not_our_position:
branch_slot_is_local_player:
branch_not_blocked_item:
addi      r1, r1, 0x10
mulli     r0, r0, 0x1C  # Original instruction

#~~~~~~~~~~~~~~~~~~~~#
# Positional Tracker #
#~~~~~~~~~~~~~~~~~~~~#

#RMCE 80709BA8
#RMCP 8071164C
#RMCJ 80710CB8
#RMCK 806FF9F4

#r26 and r28 not safe. #r0, r23 thru r27, r30 and r31 plus LR all safe
#r29 only safe if default instruction is executed first before r29 is used

stb r29, 0x003E (r26) #Default Instruction
lis r23, 0x8000
stb r29, 0x05FF (r23) #Store Position to 0x800005FF
Reply
#7
If I use a Position Tracker (especially for first), the check of the local Player isn't needed, right?
Because I (local Player) cannot get a Blue in first normally.
Reply
#8
Not sure what you mean? That version of Star's code makes it to where any time you are in first place, nobody can pick up a Blue shell from an item box legitimately. The code needs to constantly know your position.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)