Logging game events to text file
#21
And now, just for fun, the conditional version!

C278894C 00000006
83E3008C 3D808000
39600001 2C1F0009
4082001C 807B0000
80630000 88630010
2C030000 41810008
996C165F 00000000

Source:

# NOTE this is meant for four player mode, edit the second cmpwi if in another mode
# Insertion Address: 8078894C
lwz r31, 0x008C (r3) # Default instruction, loads item to r31
lis r12, 0x8000 #Set the upper 16 bits of the EVA
li r11, 1 # Get our value ready in case a human uses a star

# Find out if a star was used
cmpwi r31, 9
bne end_code # If not, skip to the end

# Load the slot of player that just used an item
lwz r3, 0x0 (r27) # Slot loading code start, load mem address from r27 into r3
lwz r3, 0x0 (r3)  # Load new word from a memory address based on the word we just loaded
lbz r3, 0x10 (r3) # Load new byte from a memory address based on the word we just loaded
cmpwi r3, 3 # EDIT SECOND NUMBER IF IN ANOTHER MODE, use 2 for 3 player, 1 for 2 player, 0 for 1 player.
bgt end_code # If the value in r3 is greater than 3, a non-human player used the star, cancel
stb r11, 0x165F (r12) #Store a 1 to the EVA at address 8000165F
end_code:
Reply


Messages In This Thread
Logging game events to text file - by seanmcnally - 03-02-2024, 09:56 PM
RE: Logging game events to text file - by Vega - 03-04-2024, 01:38 AM
RE: Logging game events to text file - by Vega - 03-04-2024, 09:37 PM
RE: Logging game events to text file - by Vega - 03-07-2024, 01:02 AM
RE: Logging game events to text file - by Vega - 03-08-2024, 12:25 AM
RE: Logging game events to text file - by Vega - 03-08-2024, 06:44 PM
RE: Logging game events to text file - by Vega - 03-12-2024, 09:13 PM
RE: Logging game events to text file - by Vega - 03-13-2024, 11:36 PM
RE: Logging game events to text file - by Vega - 03-14-2024, 06:28 PM
RE: Logging game events to text file - by Vega - 03-16-2024, 02:23 AM
RE: Logging game events to text file - by seanmcnally - 03-16-2024, 06:00 AM
RE: Logging game events to text file - by Vega - 03-16-2024, 04:54 PM
RE: Logging game events to text file - by Vega - 03-16-2024, 11:13 PM
RE: Logging game events to text file - by Vega - 03-18-2024, 05:20 PM

Forum Jump:


Users browsing this thread: 5 Guest(s)