A Step Above God [Star]
#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


Messages In This Thread
A Step Above God [Star] - by Star - 03-23-2020, 03:04 AM
RE: A Step Above God - by FancyWheelies - 03-23-2020, 03:15 PM
RE: A Step Above God - by Vega - 03-23-2020, 05:46 PM
RE: A Step Above God - by Ro_ - 03-24-2020, 12:05 AM
RE: A Step Above God - by Vega - 03-24-2020, 03:34 AM
RE: A Step Above God [Star] - by Vega - 03-28-2020, 01:13 PM
RE: A Step Above God [Star] - by Unnamed - 08-21-2020, 08:22 AM
RE: A Step Above God [Star] - by Vega - 08-21-2020, 11:41 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)