fork/training-mode-ce

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

AitchMerge pull request #242 from NickCondron/remove-asm96edbd1

nix
2.0 KiB85 linesraw
1    # To be inserted at 8006ab78
2    .include "../../../../Globals.s"
3    .include "../../../../m-ex/Header.s"
4
5# Inc Frame Count + Frames Tangible + Hitstun
6
7    # Don't Run During Hitlag
8    lbz r0, 0x2219(r31)
9    rlwinm. r0, r0, 30, 31, 31
10    bne exit
11
12########################
13## Increment AS Frame ##
14########################
15
16    lhz r3, TM_FramesinCurrentAS(r31)
17    addi r3, r3, 0x1
18    sth r3, TM_FramesinCurrentAS(r31)
19
20##################################
21## Increment Tangibility Frames ##
22##################################
23
24    # Check Timer Intangible Count
25    lwz r3, 0x1990(r31)
26    cmpwi r3, 0x0
27    bgt IsIntangible
28
29    # Ensure Player Had Ledge Intang FIRST
30    lhz r3, TM_TangibleFrameCount(r31)
31    cmpwi r3, 0x0
32    bne IncTangibleFrames
33    # Check For Subaction Intang
34    lwz r3, 0x1988(r31)
35    cmpwi r3, 0x2
36    bne IncTangibleFrames
37
38# Set Tangible Frames to 0 When Player Has Intangibility
39IsIntangible:
40    li r3, 0x0
41    sth r3, TM_TangibleFrameCount(r31)  # Store Tangible Frame Count
42    b Tangible_End
43
44IncTangibleFrames:
45    lhz r3, TM_TangibleFrameCount(r31)
46    addi r3, r3, 0x1
47    sth r3, TM_TangibleFrameCount(r31)
48
49Tangible_End:
50
51###################
52## Update Inputs ##
53###################
54
55InputsShiftOld:
56    addi r4, r31, TM_Inputs    # Get to the Start of the Inputs
57    addi r3, r4, 8
58    li r5, 0xF8                # 0x100 - 8
59    branchl r6, memmove
60InputsWriteNew:
61    load r3, 0x804c21cc  # engine pad array
62    lbz r4, 0x618(r31)   # pad_index
63    mulli r4, r4, 0x44   # r4 *= sizeof(HSD_Pad)
64    add r3, r3, r4
65    # ptr to HSD_pad now in r3
66
67    addi r5, r31, TM_Inputs    # Get to the Start of the Inputs
68    lwz r4, 0x0(r3) # held
69    sth r4, 0x0(r5)
70
71    lbz r4, 0x18(r3) # stick_x
72    stb r4, 0x2(r5)
73    lbz r4, 0x19(r3) # stick_y
74    stb r4, 0x3(r5)
75    lbz r4, 0x1A(r3) # cstick_x
76    stb r4, 0x4(r5)
77    lbz r4, 0x1B(r3) # cstick_y
78    stb r4, 0x5(r5)
79    lbz r4, 0x1C(r3) # l_trigger
80    stb r4, 0x6(r5)
81    lbz r4, 0x1D(r3) # r_trigger
82    stb r4, 0x7(r5)
83
84exit:
85    mr r3, r30