-
Notifications
You must be signed in to change notification settings - Fork 1
/
astro_turret_armer_data.asm
131 lines (97 loc) · 4.31 KB
/
astro_turret_armer_data.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//////////////////////////////////////////////////////////////////////////////
// astro_turret_armer_data.asm
// Copyright(c) 2021 Neal Smith.
// License: MIT. See LICENSE file in root directory.
//////////////////////////////////////////////////////////////////////////////
// file contains the data for turret armer
#importonce
#import "../nv_c64_util/nv_color_macs.asm"
#import "../nv_c64_util/nv_screen_macs.asm"
#import "astro_vars_data.asm"
/////////////////
// starfield consts and variables
// number of steps which in this case won't be the same as number of frames
// frames for turret effect. Each step is a different color level for the turret.
// the turret will stay at each level for some number of frames defined by
// turret_frames_between_steps
.const TURRET_ARM_FRAMES=5
// The three modes for the turret. pass into TurretArm
.const TURRET_ARM_EASY = 1
.const TURRET_ARM_MED = 2
.const TURRET_ARM_HARD = 3
// number of seconds it should take to arm the turret completely. three
// different possibilities for easy, medium, and hard difficulty
.const TURRET_SECONDS_TO_ARM_EASY = 4
.const TURRET_SECONDS_TO_ARM_MED = 2
.const TURRET_SECONDS_TO_ARM_HARD = 1.5
// number of frames it takes before a step should be made
.const TURRET_FRAMES_BETWEEN_STEPS_EASY = ((TURRET_SECONDS_TO_ARM_EASY * ASTRO_FPS) / TURRET_ARM_FRAMES)
.const TURRET_FRAMES_BETWEEN_STEPS_MED = ((TURRET_SECONDS_TO_ARM_MED * ASTRO_FPS) / TURRET_ARM_FRAMES)
.const TURRET_FRAMES_BETWEEN_STEPS_HARD = ((TURRET_SECONDS_TO_ARM_HARD * ASTRO_FPS) / TURRET_ARM_FRAMES)
// when turret arming starts this will be non zero and count down each frame
turret_arm_count: .byte $00
turret_currently_armed: .byte $00
turret_second_counter: .byte $00
turret_second_saved_value: .byte $00
turret_frames_between_steps: .word TURRET_FRAMES_BETWEEN_STEPS_EASY
// count down some number of frames between steps. This is the counter.
turret_arm_frame_counter: .byte $00
// table of the addresses of all the streams for each frame for turret 2
TurretArmStreamAddrTable:
.word turret_arm_stream_frame_1
.word turret_arm_stream_frame_2
.word turret_arm_stream_frame_3
.word turret_arm_stream_frame_4
.word turret_arm_stream_frame_5
turret_arm_stream_empty_frame:
.word $FFFF
.word $FF
.const TURRET_ARM_ROW = 10
.const TURRET_ARM_COL = 38
.const TURRET_ARM_CHAR_TOP = $53
.const TURRET_ARM_CHAR_BOTTOM = $4A
turret_arm_stream_frame_1:
.word $FFFF
.byte $01, NV_COLOR_RED
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+1, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+3, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+4, TURRET_ARM_COL)
.word $FFFF
.word $FF
turret_arm_stream_frame_2:
.word $FFFF
.byte $01, NV_COLOR_LITE_RED
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+1, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+3, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+4, TURRET_ARM_COL)
.word $FFFF
.word $FF
turret_arm_stream_frame_3:
.word $FFFF
.byte $01, NV_COLOR_LITE_GREY
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+1, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+3, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+4, TURRET_ARM_COL)
.word $FFFF
.word $FF
turret_arm_stream_frame_4:
.word $FFFF
.byte $01, NV_COLOR_LITE_GREY
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+1, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+3, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+4, TURRET_ARM_COL)
.word $FFFF
.word $FF
turret_arm_stream_frame_5:
.word $FFFF
.byte $01, NV_COLOR_YELLOW
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+1, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+3, TURRET_ARM_COL)
.word nv_screen_color_addr_from_yx(TURRET_ARM_ROW+4, TURRET_ARM_COL)
.word $FFFF
.word $FF