fork/training-mode-ce

git clone https://git.julia.blue/fork/training-mode-ce

AitchMerge pull request #88 from NickCondron/remove-asm2c08d3a

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