fork/training-mode-ce

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

AitchMerge pull request #242 from NickCondron/remove-asm96edbd1

master
2.0 KiB66 linesraw
1    # To be inserted at 800693ec
2    .include "../../../../Globals.s"
3    .include "../../../../m-ex/Header.s"
4
5# Store Previous AS + Reset AS Frame Count Timer
6
7###################
8## Shift AS ID's ##
9###################
10
11    # SHIFT AS ID's
12    li r12, TM_PrevASSlots-2                # Loop Count
13
14ASLoop:
15    addi r3, r26, TM_PrevASStart            # Get Start of AS List
16    mulli r4, r12, 2                        # Current AS ID * Length
17    add r4, r3, r4                          # Get AS Offset in Playerblock
18    lhz r3, 0x0(r4)                         # Load Previous AS
19    sth r3, 0x2(r4)                         # Push Back
20
21ASIncLoop:
22    subi r12, r12, 1
23    cmpwi r12, 0x0
24    bge ASLoop
25
26    # Move Current AS To Last AS
27    lwz r3, 0x10(r26)                       # get action state that we just left
28    sth r3, TM_PrevASStart(r26)             # store as last action state
29
30#########################
31## SHIFT FRAME NUMBERS ##
32#########################
33
34    # SHIFT AS Frame #'s
35    li r12, TM_PrevASSlots-2                # Loop Count
36
37FrameCountLoop:
38    addi r3, r26, TM_FramesInPrevASStart    # Get to the Start of the Frame Counts
39    mulli r4, r12, 2                        # Current AS ID * Length
40    add r4, r3, r4                          # Get AS Offset in Playerblock
41    lhz r3, 0x0(r4)                         # Load Previous AS
42    sth r3, 0x2(r4)                         # Push up
43
44FrameCountIncLoop:
45    subi r12, r12, 1
46    cmpwi r12, 0x0
47    bge FrameCountLoop
48
49    # Move Current AS Frame To Last AS Frame
50    addi r3, r26, TM_FramesInPrevASStart    # Get to the Start of the Frame Counts
51    lhz r4, TM_FramesinCurrentAS(r26)       # Get AS Frame Number we Just Left
52    sth r4, 0x0(r3)
53
54###########################################
55## Init Current AS Frame To Int Variable ##
56###########################################
57
58    # lfs f1, 0x894(r26)
59    # fctiwz f1, f1
60    # stfd f1, 0x8(sp)
61    # lwz r3, 0xC(sp)
62    li r3, 0x0
63    sth r3, TM_FramesinCurrentAS(r26)
64
65exit:
66    cmplwi r27, 0