-
Notifications
You must be signed in to change notification settings - Fork 1
/
gameBars.asm
54 lines (46 loc) · 1.46 KB
/
gameBars.asm
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
gbUpdateBarsAndGauges
lda VerticalVelocityFracHi ; Load Hi Value
sta VerticalBarValue ; Bar Value
lda VerticalVelocity ; Load Vertical Velocity
lsr ; /2
ror VerticalBarValue
lsr ; /4
ror VerticalBarValue
lsr ; /8
ror VerticalBarValue
lda VerticalBarValue ; load Bar Value
eor #$FF ; NOT The result (Invert)
LIBBARSANDGAUGES_SHOWYBAR_AV $044E, $2C
lda FuelBarValue
LIBBARSANDGAUGES_SHOWYGAUGE_AV $044D, $00
rts
gbSetupFuelAndSpeedBars
LIBBARSANDGAUGES_INITYBAR_AV $044E,12
lda MaxSafeLandingSpeed
lsr ; divind by 2
lsr ; divide by 4
lsr ; divide by 8
tay
dey
lda #$D9
sta SafeZonePlace + 2
lda #$16
sta SafeZonePlace + 1
SafeZoneLoop
lda #Green
SafeZonePlace
sta $D916 ; Indicate Safe Landing Speed Zone
sec
lda SafeZonePlace + 1
sbc #40
sta SafeZonePlace + 1
bcs @Bypass
dec SafeZonePlace + 2
@ByPass
dey
bpl SafeZoneLoop
LIBBARSANDGAUGES_INITYBAR_AV $044D,12
lda #Red
sta $D9DD ; Show Low Fuel Zone
sta $DA05
rts