-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwind.asm
More file actions
59 lines (58 loc) · 1.45 KB
/
Copy pathwind.asm
File metadata and controls
59 lines (58 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//------------------------------------------------------------//
// Recalculate wind speed //
//------------------------------------------------------------//
.func recalculateWindSpeed
addiu sp, sp, 0xFFE0
sw ra, 0x001C(sp)
la s2, currentHoleNumber
jal getHackEnabledFlag
li a0, recalculateWindSpeedFlag
bne v0, r0, @@recalculate
nop
li s0, baseLowerWindCutoff
b @@recalculateWindSpeedEnd
nop
@@recalculate:
li s0, hackLowerWindCutoff
jal getRandomShort
nop
mtc1 v0, f0
lui at, 0x461C
addiu at, at, 0x4000
cvt.s.w f6, f0
nop
lui a0, 0x4700
addiu a0, a0, 0xFE00
mtc1 at, f2
mtc1 a0, f4
nop
lw v0, 0xFFFC(s2)
sll v0, v0, 0x2
lui a1, hi(modTable)
addu a1, a1, v0
lb a0, lo(modTable)(a1)
sll a2, a0, 0x1
addu a2, a2, a0
mtc1 a2, f12
nop
cvt.s.w f12, f12
div.s f8, f2, f4
mul.s f0, f8, f6
mul.s f10, f12, f0
cvt.w.s f10, f10
nop
mfc1 v0, f10
nop
slt v1, v0, s0
beql v1, r0, @@recalculateWindSpeedEnd
sw v0, 0x0000(s1)
sw r0, 0x0000(s1)
li v0, 1
@@recalculateWindSpeedEnd:
lw ra, 0x001C(sp)
addiu sp, sp, 0x0020
jr ra
nop
.endfunc
.definelabel baseLowerWindCutoff, 0x17FFF
.definelabel hackLowerWindCutoff, 0x9C40