Rev 485 | Rev 551 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 485 | Rev 503 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; |
1 | ; |
- | 2 | ; PONG for MENUET v1.0 |
|
2 | ; Pong Gaem 2Ver Mini Sample by Pavlushin Evgeni for ASCL |
3 | ; 2001 by Mario Birkner, Germany |
3 | ; www.waptap@mail.ru |
4 | ; cyflexx@digitalrice.com |
4 | ; |
5 | ; |
- | 6 | ; PONG for MENUET is |
|
- | 7 | ; a small PONG-clone for MenuetOS |
|
- | 8 | ; |
|
- | 9 | ; HINT: If the Paddle moves too slow,increase the |
|
- | 10 | ; typematic Rate in your BIOS |
|
- | 11 | ; |
|
- | 12 | ||
- | 13 | include '..\..\..\macros.inc' |
|
Line -... | Line 14... | ||
- | 14 | ||
- | 15 | CK_UP1 equ 113 |
|
- | 16 | CK_DOWN1 equ 97 |
|
- | 17 | CK_UP2 equ 130+48 |
|
Line 5... | Line -... | ||
5 | - | ||
6 | 18 | CK_DOWN2 equ 129+48 |
|
- | 19 | ||
7 | ;****************************************************************************** |
20 | use32 |
8 | use32 |
- | |
9 | org 0x0 |
- | |
10 | db 'MENUET01' ; 8 byte id |
- | |
11 | dd 0x01 ; header version |
- | |
12 | dd START ; start of code |
- | |
13 | dd IM_END ; size of image |
- | |
14 | dd 0x300000 ; memory for app |
- | |
Line -... | Line 21... | ||
- | 21 | ||
- | 22 | org 0x0 |
|
- | 23 | ||
- | 24 | db 'MENUET00' ; 8 byte id |
|
15 | dd 0x300000 ; esp |
25 | dd 38 ; required os |
16 | dd temp_area , 0x0 ; I_Param , I_Icon |
26 | dd START ; program start |
- | 27 | dd I_END ; program image size |
|
Line 17... | Line -... | ||
17 | - | ||
18 | ;****************************************************************************** |
- | |
19 | ;5941 ;4523(with new random) |
28 | dd 0x2000 ; required amount of memory |
20 | - | ||
Line 21... | Line -... | ||
21 | - | ||
22 | 29 | dd 0x2000 ; esp = 0x7FFF0 |
|
Line 23... | Line -... | ||
23 | include 'lang.inc' |
- | |
24 | include '..\..\..\macros.inc' |
- | |
25 | include 'ascl.inc' |
- | |
26 | include 'ascgl.inc' |
- | |
27 | - | ||
28 | START: ; start of execution |
- | |
29 | call draw_window |
- | |
30 | - | ||
31 | loadbmp '/RD/1/MFAR.BMP',temp_area,I_END,tsoi |
- | |
32 | bmptoimg I_END,tsoi,img |
- | |
33 | loadbmp '/RD/1/COPY.BMP',temp_area,I_END,tsoi |
- | |
34 | bmptoimg I_END,tsoi,img2 |
- | |
Line 35... | Line 30... | ||
35 | loadbmp '/RD/1/SMILE.BMP',temp_area,I_END,tsoi |
30 | dd 0x00000000 ; reserved=no extended header |
Line -... | Line 31... | ||
- | 31 | ||
36 | bmptoimg I_END,tsoi,img3 |
32 | |
37 | 33 | ||
38 | fullimg img4 , 32 ,32 ,0x00000000 ;black |
- | |
39 | 34 | START: |
|
40 | loadbmp '/RD/1/MBAR_I3.BMP',temp_area,I_END,tsoi |
35 | |
41 | bmptoimg I_END,tsoi,img5 |
36 | call draw_window |
42 | 37 | ||
43 | 38 | ||
44 | still: |
39 | still: |
- | 40 | ||
- | 41 | mov eax,10 |
|
Line 45... | Line -... | ||
45 | - | ||
46 | mov eax,11 ; scan event |
42 | add eax,[control] |
47 | mcall |
- | |
48 | 43 | mcall |
|
49 | cmp eax,1 ; redraw request ? |
- | |
50 | je red |
- | |
51 | cmp eax,2 ; key in buffer ? |
44 | cmp eax,1 |
52 | je key |
- | |
53 | cmp eax,3 ; button in buffer ? |
- | |
54 | je button |
- | |
55 | - | ||
56 | out_scorea: |
- | |
57 | mov eax,47 |
- | |
58 | mov ebx,5*65536 |
- | |
59 | mov ecx,[scorea] |
- | |
60 | mov edx,300*65536+8 |
- | |
61 | mov esi,cl_Blue |
- | |
62 | mcall |
- | |
63 | out_scoreb: |
- | |
64 | mov eax,47 |
- | |
65 | mov ebx,5*65536 |
- | |
66 | mov ecx,[scoreb] |
- | |
67 | mov edx,350*65536+8 |
- | |
68 | mov esi,cl_Red |
- | |
69 | mcall |
- | |
70 | - | ||
71 | del_images: |
- | |
72 | setimg dword [ply1x],dword [ply1y],img4 |
- | |
73 | setimg dword [ply2x],dword [ply2y],img4 |
- | |
74 | setimg dword [ballx],dword [bally],img4 |
- | |
75 | setimg dword [gravx],dword [gravy],img4 |
- | |
76 | - | ||
77 | - | ||
78 | move_images: |
- | |
79 | - | ||
80 | x_move: |
- | |
81 | mov eax,dword [ply1rx] |
- | |
82 | cmp dword [ply1x],eax |
- | |
83 | je no_m |
- | |
84 | cmp dword [ply1x],eax |
- | |
85 | ja m_m |
- | |
86 | m_p: |
- | |
87 | add dword [ply1x],4 |
- | |
88 | jmp no_m |
- | |
89 | m_m: |
- | |
90 | sub dword [ply1x],4 |
- | |
91 | no_m: |
- | |
92 | - | ||
93 | - | ||
94 | y_move: |
- | |
95 | mov eax,dword [ply1ry] |
- | |
96 | cmp dword [ply1y],eax |
- | |
97 | je no_m2 |
- | |
98 | cmp dword [ply1y],eax |
- | |
99 | ja m_m2 |
- | |
100 | m_p2: |
- | |
101 | add dword [ply1y],2 |
- | |
102 | jmp no_m2 |
- | |
103 | m_m2: |
- | |
104 | sub dword [ply1y],2 |
- | |
105 | no_m2: |
- | |
106 | - | ||
107 | ;automove ball |
- | |
108 | mov eax,dword [ballxv] |
- | |
109 | add dword [ballx],eax |
- | |
110 | mov eax,dword [ballyv] |
- | |
111 | add dword [bally],eax |
- | |
112 | - | ||
113 | - | ||
114 | ;autoslow ball |
- | |
115 | cmp dword [ballxv],0 |
- | |
116 | jl ballb |
- | |
117 | balla: |
- | |
118 | cmp dword [ballxv],2 |
- | |
119 | jng balln |
- | |
120 | dec dword [ballxv] |
- | |
121 | ; mov dword [ballxv],2 |
- | |
122 | jmp balln |
- | |
123 | - | ||
124 | ballb: |
- | |
125 | cmp dword [ballxv],-2 |
- | |
126 | jng balln |
- | |
127 | inc dword [ballxv] |
- | |
128 | ; mov dword [ballxv],-2 |
- | |
129 | jmp balln |
- | |
130 | - | ||
131 | balln: |
- | |
132 | - | ||
133 | cmp dword [ballyv],2 |
- | |
134 | jng by_n |
- | |
135 | dec dword [ballyv] |
- | |
136 | by_n: |
- | |
137 | - | ||
138 | ;test ball on collusion of screen |
- | |
139 | ; cmp dword [bally],480+16-32 |
- | |
140 | ; jna ya_ok |
- | |
141 | ; neg dword [ballyv] |
- | |
142 | ;ya_ok: |
- | |
143 | ; cmp dword [bally],30 |
- | |
144 | ; jnb yb_ok |
- | |
145 | ; neg dword [ballyv] |
- | |
146 | ;yb_ok: |
- | |
147 | cmp dword [ballx],640-32 |
- | |
148 | jna xa_ok |
- | |
149 | neg dword [ballxv] |
- | |
150 | xa_ok: |
- | |
151 | cmp dword [ballx],6 |
- | |
152 | jnb xb_ok |
- | |
153 | neg dword [ballxv] |
- | |
154 | xb_ok: |
- | |
155 | - | ||
156 | ;if ball far out of screen come back |
- | |
157 | ; is not work already |
- | |
158 | cmp dword [bally],466 |
- | |
159 | jng yax_ok |
- | |
160 | call draw_window |
- | |
161 | inc dword [scoreb] |
- | |
162 | mov dword [bally],240 |
- | |
163 | mov dword [ballx],310 |
- | |
164 | mov dword [ballyv],2 |
- | |
165 | random 5,dword [ballxv] |
- | |
166 | sub dword [ballxv],2 |
- | |
167 | yax_ok: |
- | |
168 | cmp dword [bally],30 |
- | |
169 | jnl yax_ok2 |
- | |
170 | call draw_window |
- | |
171 | inc dword [scorea] |
- | |
172 | mov dword [bally],240 |
- | |
173 | mov dword [ballx],310 |
- | |
174 | mov dword [ballyv],2 |
- | |
175 | random 5,dword [ballxv] |
- | |
176 | sub dword [ballxv],2 |
- | |
177 | yax_ok2: |
- | |
178 | - | ||
179 | xorx: |
- | |
180 | cmp dword [ballxv],0 |
- | |
181 | jne norx |
- | |
182 | random 5,dword [ballxv] |
- | |
183 | sub dword [ballxv],2 |
- | |
184 | cmp dword [ballxv],0 |
- | |
185 | je xorx |
- | |
186 | norx: |
- | |
187 | - | ||
188 | ;test on collusion ply1 of ball |
- | |
189 | collusion_test: |
- | |
190 | collimg img,[ply1x],[ply1y],img3,[ballx],[bally],eax |
- | |
191 | cmp eax,1 |
- | |
192 | jne not_coll |
- | |
193 | neg dword [ballyv] |
- | |
194 | add dword [bally],18 |
- | |
195 | ; neg dword [ballxv] |
- | |
196 | not_coll: |
- | |
197 | - | ||
198 | ;test on collusion com of ball |
- | |
199 | collusion_com: |
- | |
200 | collimg img,[ply2x],[ply2y],img3,[ballx],[bally],eax |
- | |
201 | cmp eax,1 |
- | |
202 | jne not_collcom |
- | |
Line 203... | Line 45... | ||
203 | neg dword [ballyv] |
45 | je red |
Line 204... | Line -... | ||
204 | sub dword [bally],18 |
- | |
205 | ; neg dword [ballxv] |
- | |
206 | not_collcom: |
- | |
207 | - | ||
208 | ;test on collusion gravity of ball |
46 | cmp eax,2 |
209 | collusion_grav: |
- | |
210 | collimg img,[gravx],[gravy],img3,[ballx],[bally],eax |
47 | je key |
211 | cmp eax,1 |
- | |
212 | jne not_collg |
- | |
213 | neg dword [ballyv] |
- | |
214 | 48 | cmp eax,3 |
|
215 | ; mov dword [ballxv],-20 |
49 | je button |
216 | 50 | cmp [control],1 |
|
217 | cmp dword [ballyv],0 |
51 | jne still |
218 | jl ab |
- | |
219 | jg bf |
- | |
220 | jmp not_collgx |
52 | |
221 | ab: |
53 | mov eax,5 |
222 | sub dword [ballyv],30 |
- | |
223 | jmp not_collgx |
- | |
224 | bf: |
- | |
225 | add dword [ballyv],30 |
- | |
226 | not_collgx: |
- | |
227 | cmp dword [ballxv],0 |
- | |
228 | jl abx |
- | |
229 | jg bfx |
- | |
230 | jmp not_collg |
- | |
231 | abx: |
- | |
232 | sub dword [ballxv],10 |
- | |
233 | jmp not_collg |
- | |
234 | bfx: |
54 | mov ebx,[delay] |
235 | add dword [ballxv],10 |
- | |
236 | - | ||
237 | - | ||
238 | ; mov dword [ballyv],20 |
- | |
239 | not_collg: |
55 | mcall |
240 | - | ||
241 | ;com move |
- | |
242 | cx_move: |
- | |
243 | cmp dword [bally],200 |
- | |
244 | jna cno_m |
- | |
245 | mov eax,dword [ballx] |
- | |
246 | cmp dword [ply2x],eax |
- | |
247 | je cno_m |
- | |
248 | cmp dword [ply2x],eax |
- | |
249 | ja cm_m |
- | |
250 | cm_p: |
- | |
251 | add dword [ply2x],3 |
56 | |
252 | jmp cno_m |
57 | jmp move |
253 | cm_m: |
- | |
254 | sub dword [ply2x],3 |
- | |
255 | cno_m: |
- | |
256 | - | ||
257 | gravity: |
- | |
258 | cmp dword [gravtime],0 |
- | |
259 | je no_dg |
- | |
260 | dec dword [gravtime] |
- | |
261 | no_dg: |
- | |
262 | - | ||
263 | draw_gravity: |
- | |
264 | cmp dword [gravtime],0 |
- | |
265 | je nograv |
- | |
266 | mov eax,dword [ply1x] |
- | |
267 | mov ebx,dword [ply1y] |
- | |
268 | add ebx,20 |
- | |
Line -... | Line 58... | ||
- | 58 | ||
- | 59 | red: |
|
- | 60 | call draw_window |
|
- | 61 | cmp [control],1 |
|
- | 62 | jne still |
|
- | 63 | call clall |
|
- | 64 | call drawpad |
|
- | 65 | jmp still |
|
- | 66 | key: |
|
- | 67 | mov eax,2 |
|
- | 68 | mcall |
|
- | 69 | cmp [control],1 |
|
- | 70 | jne still |
|
- | 71 | ||
- | 72 | up1: |
|
- | 73 | cmp ah,CK_UP1 |
|
- | 74 | jne dn1 |
|
- | 75 | cmp [posya],52*65536+64 |
|
- | 76 | je still |
|
- | 77 | sub [posya],4*65536 |
|
- | 78 | call cl0 |
|
- | 79 | call drawpad |
|
- | 80 | jmp still |
|
- | 81 | dn1: |
|
- | 82 | cmp ah,CK_DOWN1 |
|
- | 83 | jne up2 |
|
- | 84 | cmp [posya],140*65536+64 |
|
- | 85 | je still |
|
- | 86 | add [posya],4*65536 |
|
- | 87 | call cl0 |
|
- | 88 | call drawpad |
|
- | 89 | jmp still |
|
- | 90 | up2: |
|
- | 91 | cmp ah,CK_UP2 |
|
- | 92 | jne dn2 |
|
- | 93 | cmp [posyb],52*65536+64 |
|
Line -... | Line 94... | ||
- | 94 | je still |
|
269 | mov dword [gravx],eax |
95 | sub [posyb],4*65536 |
- | 96 | call cl1 |
|
Line 270... | Line 97... | ||
270 | mov dword [gravy],ebx |
97 | call drawpad |
- | 98 | jmp still |
|
- | 99 | dn2: |
|
- | 100 | cmp ah,CK_DOWN2 |
|
Line 271... | Line -... | ||
271 | jmp endgrav |
- | |
272 | nograv: |
- | |
273 | mov dword [gravx],1000 |
101 | jne still |
Line -... | Line 102... | ||
- | 102 | cmp [posyb],140*65536+64 |
|
- | 103 | je still |
|
- | 104 | add [posyb],4*65536 |
|
- | 105 | call cl1 |
|
- | 106 | call drawpad |
|
- | 107 | jmp still |
|
- | 108 | ||
- | 109 | button: |
|
- | 110 | mov eax,17 |
|
- | 111 | mcall |
|
- | 112 | ||
- | 113 | cmp ah,1 |
|
- | 114 | jne button2 |
|
- | 115 | mov eax,-1 |
|
- | 116 | mcall |
|
- | 117 | ||
274 | mov dword [gravy],1000 |
118 | jmp still |
- | 119 | ||
- | 120 | button2: |
|
- | 121 | cmp ah,2 |
|
- | 122 | jne still |
|
- | 123 | mov [control],1 |
|
- | 124 | mov [scp1],0 |
|
- | 125 | mov [scp2],0 |
|
- | 126 | jmp res |
|
- | 127 | move: |
|
- | 128 | mov eax,[mposx] |
|
- | 129 | mov ebx,[mposy] |
|
- | 130 | add [bposx],eax |
|
- | 131 | add [bposy],ebx |
|
- | 132 | cmp [bposx],16*65536+16 |
|
- | 133 | je pf1 |
|
- | 134 | cmp [bposx],272*65536+16 |
|
- | 135 | je pf2 |
|
- | 136 | cmp [bposy],191*65536+16 |
|
- | 137 | je bot |
|
- | 138 | cmp [bposy],48*65536+16 |
|
- | 139 | je top |
|
- | 140 | cmp [bposx],247*65536+16 |
|
- | 141 | je rig |
|
- | 142 | jg padr |
|
- | 143 | cmp [bposx],55*65536+16 |
|
- | 144 | je lef |
|
- | 145 | jl padl |
|
- | 146 | jmp draw |
|
- | 147 | ||
- | 148 | padr: |
|
- | 149 | mov ecx,[posyb] |
|
- | 150 | jmp pad |
|
- | 151 | padl: |
|
- | 152 | mov ecx,[posya] |
|
- | 153 | pad: |
|
- | 154 | mov eax,[bposy] |
|
- | 155 | sub eax,16 |
|
- | 156 | mov ebx,eax |
|
- | 157 | add ebx,17*65536 |
|
- | 158 | sub ecx,64 |
|
- | 159 | mov edx,ecx |
|
- | 160 | add edx,65*65536 |
|
- | 161 | cmp eax,edx |
|
- | 162 | je top |
|
- | 163 | cmp ebx,ecx |
|
- | 164 | je bot |
|
- | 165 | jmp draw |
|
- | 166 | ||
- | 167 | bot: |
|
- | 168 | mov [mposy],-65536 |
|
- | 169 | jmp draw |
|
- | 170 | top: |
|
- | 171 | mov [mposy],65536 |
|
- | 172 | jmp draw |
|
- | 173 | rig: |
|
- | 174 | mov eax,[posyb] |
|
- | 175 | sub eax,1*65536-64 ;verhindert das der ball ins paddle eindringt |
|
- | 176 | mov ebx,[posyb] |
|
- | 177 | add ebx,64*65536-64 |
|
- | 178 | mov ecx,[bposy] |
|
- | 179 | add ecx,16*65536-16 |
|
- | 180 | mov edx,[bposy] |
|
- | 181 | sub edx,16 |
|
- | 182 | cmp ecx,eax |
|
- | 183 | je blr |
|
- | 184 | jl draw |
|
- | 185 | cmp edx,ebx |
|
- | 186 | je blr |
|
- | 187 | jl blr |
|
- | 188 | jg draw |
|
- | 189 | blr: |
|
- | 190 | mov [mposx],-65536 |
|
- | 191 | jmp draw |
|
- | 192 | ||
- | 193 | lef: |
|
- | 194 | mov eax,[posya] |
|
- | 195 | sub eax,1*65536+64 |
|
- | 196 | mov ebx,[posya] |
|
- | 197 | add ebx,64*65536-64 |
|
- | 198 | mov ecx,[bposy] |
|
- | 199 | add ecx,16*65536-16 |
|
- | 200 | mov edx,[bposy] |
|
- | 201 | add edx,16 |
|
- | 202 | cmp ecx,eax |
|
- | 203 | je bll |
|
- | 204 | jl draw |
|
- | 205 | cmp edx,ebx |
|
- | 206 | je bll |
|
275 | endgrav: |
207 | jl bll |
- | 208 | jg draw |
|
- | 209 | bll: |
|
276 | 210 | mov [mposx],65536 |
|
277 | redraw_images: |
- | |
278 | setimg dword [ply1x],dword [ply1y],img |
- | |
279 | setimg dword [ply2x],dword [ply2y],img2 ;2 |
- | |
280 | setimg dword [ballx],dword [bally],img3 |
- | |
281 | setimg dword [gravx],dword [gravy],img5 |
- | |
282 | 211 | jmp draw |
|
283 | - | ||
284 | delay 2 ;don't generate delay for fast speed programm |
- | |
285 | - | ||
286 | jmp still |
- | |
287 | - | ||
288 | red: |
- | |
289 | call draw_window |
- | |
290 | jmp still |
- | |
291 | - | ||
292 | key: ; key |
- | |
293 | mov eax,2 |
- | |
294 | mcall |
- | |
295 | cmp ah,key_Left |
- | |
296 | jne no_l |
- | |
Line -... | Line 212... | ||
- | 212 | ||
- | 213 | drawpad: |
|
- | 214 | ; draw paddle |
|
- | 215 | mov edx,[posya] |
|
- | 216 | shr edx,16 |
|
- | 217 | add edx,32*65536 |
|
- | 218 | mov ecx,24*65536+64 |
|
- | 219 | mov ebx,paddle |
|
- | 220 | mov eax,7 |
|
- | 221 | mcall |
|
- | 222 | mov edx,[posyb] |
|
- | 223 | shr edx,16 |
|
- | 224 | add edx,264*65536 |
|
- | 225 | mov eax,7 |
|
- | 226 | mov ebx,paddle |
|
- | 227 | mov ecx,24*65536+64 |
|
- | 228 | mcall |
|
- | 229 | ret |
|
- | 230 | ||
- | 231 | draw: |
|
- | 232 | ; draw ball |
|
- | 233 | mov eax,13 |
|
- | 234 | mov ebx,-65536+2 |
|
- | 235 | mov ecx,-65536+2 |
|
- | 236 | add ebx,[bposx] |
|
297 | sub dword [ply1rx],16 |
237 | add ecx,[bposy] |
- | 238 | xor edx,edx |
|
- | 239 | mcall |
|
- | 240 | add ebx,65536-2 |
|
- | 241 | add ecx,65536-2 |
|
- | 242 | mov edx,ebx |
|
298 | no_l: |
243 | and edx,0xffff0000 |
- | 244 | mov esi,ecx |
|
- | 245 | shr esi,16 |
|
- | 246 | add edx,esi |
|
- | 247 | mov esi,ebx |
|
- | 248 | shl esi,16 |
|
- | 249 | mov edi,ecx |
|
- | 250 | and edi,0x0000ffff |
|
- | 251 | add esi,edi |
|
- | 252 | mov ecx,esi |
|
- | 253 | mov ebx,ball |
|
- | 254 | mov eax,7 |
|
- | 255 | mcall |
|
- | 256 | jmp still |
|
- | 257 | cls: |
|
- | 258 | mov eax,13 |
|
- | 259 | mov edx,0x00000000 |
|
- | 260 | mcall |
|
- | 261 | ret |
|
- | 262 | cl0: |
|
- | 263 | mov ebx,32*65536+24 |
|
- | 264 | mov ecx,[posya] |
|
- | 265 | sub ecx,4*65536+60 |
|
- | 266 | call cls |
|
- | 267 | mov ecx,[posya] |
|
- | 268 | add ecx,64*65536-60 |
|
- | 269 | call cls |
|
- | 270 | ret |
|
- | 271 | cl1: |
|
- | 272 | mov ebx,264*65536+24 |
|
- | 273 | mov ecx,[posyb] |
|
- | 274 | sub ecx,4*65536+60 |
|
- | 275 | call cls |
|
299 | cmp ah,key_Right |
276 | mov ecx,[posyb] |
- | 277 | add ecx,64*65536-60 |
|
- | 278 | call cls |
|
- | 279 | ret |
|
- | 280 | clall: |
|
- | 281 | mov ebx,16*65536+288 |
|
- | 282 | mov ecx,47*65536+161 |
|
- | 283 | call cls |
|
- | 284 | ret |
|
- | 285 | pf1: |
|
300 | jne no_r |
286 | inc [scp2] |
- | 287 | jmp res |
|
- | 288 | pf2: |
|
- | 289 | inc [scp1] |
|
- | 290 | res: |
|
- | 291 | cmp [scp2],20 |
|
301 | add dword [ply1rx],16 |
292 | je over |
302 | no_r: |
- | |
303 | cmp ah,key_Up |
293 | cmp [scp1],20 |
- | 294 | je over |
|
304 | jne no_u |
295 | mov [bposx],152*65536+16 ;default position ball |
305 | sub dword [ply1ry],16 |
296 | mov [bposy],119*65536+16 |
306 | no_u: |
- | |
307 | cmp ah,key_Down |
297 | call draw_window |
Line -... | Line 298... | ||
- | 298 | call clall |
|
- | 299 | call drawpad |
|
- | 300 | jmp draw |
|
- | 301 | over: |
|
Line 308... | Line 302... | ||
308 | jne no_d |
302 | mov [control],0 |
309 | add dword [ply1ry],16 |
- | |
310 | no_d: |
- | |
311 | cmp ah,key_Space |
- | |
312 | jne no_sp |
- | |
313 | mov dword [gravtime],100 |
- | |
Line -... | Line 303... | ||
- | 303 | call draw_window |
|
- | 304 | mov eax,4 |
|
- | 305 | mov ebx,120*65536+100 |
|
Line 314... | Line -... | ||
314 | no_sp: |
- | |
315 | - | ||
316 | jmp still |
- | |
Line 317... | Line 306... | ||
317 | 306 | mov ecx,0x00ffdd00 |
|
- | 307 | mov esi,14 |
|
- | 308 | cmp [scp1],20 |
|
- | 309 | jne win |
|
- | 310 | mov edx,w1 |
|
- | 311 | mcall |
|
- | 312 | jmp still |
|
- | 313 | win: |
|
- | 314 | mov edx,w2 |
|
- | 315 | mcall |
|
- | 316 | jmp still |
|
- | 317 | ||
- | 318 | ; ********************************************* |
|
- | 319 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
|
- | 320 | ; ********************************************* |
|
- | 321 | ||
- | 322 | ||
318 | button: ; button |
323 | draw_window: |
319 | mov eax,17 ; get id |
324 | |
- | 325 | mov eax,12 |
|
Line 320... | Line 326... | ||
320 | mcall |
326 | mov ebx,1 |
- | 327 | mcall |
|
- | 328 | ||
- | 329 | ||
321 | cmp ah,1 ; button id=1 ? |
330 | mov eax,0 |
- | 331 | mov ebx,100*65536+320 |
|
Line 322... | Line 332... | ||
322 | jne noclose |
332 | mov ecx,100*65536+250 |
- | 333 | mov edx,0x134873a0 ;70d0 |
|
- | 334 | mov edi,labelt |
|
- | 335 | mcall |
|
- | 336 | ||
323 | mov eax,-1 ; close this program |
337 | mov eax,8 |
Line 324... | Line 338... | ||
324 | mcall |
338 | mov ebx,20*65536+80 |
- | 339 | mov ecx,220*65536+20 |
|
- | 340 | mov edx,2 |
|
- | 341 | mov esi,0x900000 |
|
- | 342 | mcall |
|
325 | noclose: |
343 | |
Line 326... | Line 344... | ||
326 | jmp still |
344 | mov eax,4 |
- | 345 | mov ebx,38*65536+227 |
|
- | 346 | mov ecx,0x00FFFFFF |
|
- | 347 | mov edx,b0lab |
|
- | 348 | mov esi,8 |
|
327 | 349 | mcall |
|
Line 328... | Line 350... | ||
328 | 350 | ||
329 | draw_window: |
351 | mov eax,4 |
- | 352 | mov ebx,25*65536+30 |
|
Line 330... | Line -... | ||
330 | startwd |
- | |
331 | window 0,0,640+8,480+24,window_Skinned |
353 | mov ecx,0x00ffdd00 |
Line 332... | Line -... | ||
332 | label 12,8,'PONG: USE ARROW KEYS SCORE',cl_White+font_Big |
- | |
333 | endwd |
- | |
Line -... | Line 354... | ||
- | 354 | mov edx,welcome |
|
- | 355 | mov esi,40 |
|
- | 356 | mcall |
|
- | 357 | ||
- | 358 | mov eax,4 |
|
- | 359 | mov ebx,220*65536+228 |
|
- | 360 | mov ecx,0x00ffdd00 |
|
- | 361 | mov edx,scotext |
|
- | 362 | mov esi,11 |
|
- | 363 | mcall |
|
- | 364 | ||
- | 365 | mov eax,47 |
|
- | 366 | mov ebx,0x00020000 |
|
- | 367 | mov ecx,[scp1] |
|
- | 368 | mov edx,268 shl 16+228 |
|
- | 369 | mov esi,0x0000ddff |
|
- | 370 | mcall |
|
- | 371 | ||
- | 372 | mov eax,47 |
|
334 | ret |
373 | mov ebx,0x00020000 |
- | 374 | mov ecx,[scp2] |
|
- | 375 | mov edx,285 shl 16+228 |
|
- | 376 | mov esi,0x0000ddff |
|
- | 377 | mcall |
|
- | 378 | ||
- | 379 | mov eax,12 |
|
- | 380 | mov ebx,2 |
|
Line 335... | Line -... | ||
335 | - | ||
336 | - | ||
337 | ; DATA AREA |
381 | mcall |
338 | xt dd 100 |
- | |
339 | yt dd 100 |
- | |
340 | - | ||
341 | gravtime dd 10 |
- | |
342 | gravx dd 1000 |
- | |
343 | gravy dd 1000 |
- | |
344 | 382 | ||
Line 345... | Line 383... | ||
345 | ply1rx dd 200 |
383 | ret |
346 | ply1ry dd 50 |
384 | |
Line 347... | Line 385... | ||
347 | 385 |