fork/training-mode-ce
git clone https://git.julia.blue/fork/training-mode-ce
2c08d3a
master
1# To be inserted at 8002c5f0 2.include "../../../Globals.s" 3 4.set REG_Pauser , 31 5.set REG_Count , 30 6 7backup 8 9# Get player port who paused 10load r3 , 0x8046b6a0 11lbz REG_Pauser , 0x1 ( r3 ) 12 13# Search all players for this port 14li REG_Count , 0 15 16Loop : 17mr r3 , REG_Count 18branchl r12 , PlayerBlock_LoadMainCharDataOffset 19cmpwi r3 , 0 20beq IncLoop 21# Check their port to see if it matches 22mr r3 , REG_Count 23branchl r12 , 0x8003345c 24cmpw r3 , REG_Pauser 25beq FoundPauser 26 27IncLoop : 28addi REG_Count , REG_Count , 1 29cmpwi REG_Count , 4 30blt Loop 31b Dead 32 33FoundPauser : 34# Check if player is alive 35mr r3 , REG_Count 36branchl r12 , PlayerBlock_LoadMainCharDataOffset 37lwz r3 , 0x2C ( r3 ) 38lbz r3 , 0x221F ( r3 ) 39rlwinm. r3 , r3 , 0 , 25 , 25 40bne Dead 41 42Alive : 43restore 44branch r12 , 0x8002c644 45 46Dead : 47 48Exit : 49restore 50lfs f0 , 0x000C ( r26 )