-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.asm
executable file
·212 lines (154 loc) · 2.59 KB
/
main.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
mov ax,13h
int 10h
mov di,0
push sky1
call skyInicialize
push sky2
call skyInicialize
push sky3
call skyInicialize
main:
;-----------------
push bx
in ax,60h
mov bx,[_a]
cmp byte [KEY_UP],1
jne _next1
sub [player+6],bx
jmp _next2
_next1:
cmp byte [KEY_DOWN],1
jne _next2
add [player+6],bx
_next2:
cmp byte [KEY_LEFT],1
jne _next3
sub [player+4],bx
jmp _next4
_next3:
cmp byte [KEY_RIGHT],1
jne _next4
add [player+4],bx
_next4:
;----shooting--------------
mov cx,[_shoot_timer]
inc word [_shoot_timer]
cmp cx,[_speed_shoot]
jl _end
cmp byte [KEY_FIRE1],1
jne _end
push objects_array
push objects
call playerShoot
mov word [_shoot_timer],0
;-----end_shooting------------
_end:
pop bx
;---------------------
call playerMovie
call clearScreen
inc word [_enemy_timer]
mov ax,[_enemy_rate]
cmp [_enemy_timer],ax
jb _next5
mov word [_enemy_timer],0
;---------------------------------------
push bx
mov ax,[objects_array]
inc ax
mov [objects_array],ax
shl ax,1
push ax
shr ax,1
mov dx,[OBJ_SIGNATURE_SIZE]
mul dl
add ax,objects
mov bx,ax
push ax
call rnd
xor dx,dx
mov cx,200
div cx
add dx,50
mov word [bx],dx
pop ax
mov word [bx+2],-19
mov word [bx+4],0
mov word [bx+6],1
mov word [bx+8],3
mov word [bx+10],model2
mov word [bx+12],1
push ax
call rnd
xor dx,dx
mov cx,40
div cx
mov word [bx+14],dx
pop ax
mov word [bx+16],40
mov word [bx+18],0
pop bx
add bx,objects_array
mov [bx],ax
pop bx
;-----------------------------------
_next5:
cmp word [player+8],0
je _end_all
push sky1
call skyRender
push sky2
call skyRender
push sky3
call skyRender
push objects_array
call deleteObject
push objects_array
call objectsManeger
push objects_array
call collisionTest
push 0
push 0
push interface_model_1
call modelPainter
push 7
push 1
push word [player+8]
push 40
call trace
push 300
push 1
push word [_score]
push 20h
call trace
;---------------------
main_next1:
xor ah,ah
int 1Ah
cmp dx,bx
je main_next1
mov bx,dx
call repaint
jmp main
_end_all:
call clearScreen
push sky3
call skyRender
push sky2
call skyRender
push sky1
call skyRender
push 150
push 100
push word model_t_LOST
call modelPainter
main_next2:
xor ah,ah
int 1Ah
cmp dx,bx
je main_next2
mov bx,dx
call repaint
cmp byte [KEY_ESC],1
je start
jmp _end_all