Rev 2674 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2674 | Rev 6024 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ; www.waptap@mail.ru |
3 | ; www.waptap@mail.ru |
4 | ; |
4 | ; |
5 | ; Not use bmpfile! |
5 | ; Not use bmpfile! |
Line 6... | Line 6... | ||
6 | 6 | ||
- | 7 | ;****************************************************************************** |
|
- | 8 | format binary as "" |
|
7 | ;****************************************************************************** |
9 | |
8 | use32 |
10 | use32 |
9 | org 0x0 |
11 | org 0x0 |
10 | db 'MENUET01' ; 8 byte id |
12 | db 'MENUET01' ; 8 byte id |
11 | dd 0x01 ; header version |
13 | dd 0x01 ; header version |
12 | dd START ; start of code |
14 | dd START ; start of code |
13 | dd IM_END ; size of image |
15 | dd IM_END ; size of image |
14 | dd 0x300000 ; memory for app |
16 | dd 0x300000 ; memory for app |
15 | dd 0x300000 ; esp |
17 | dd 0x300000 ; esp |
Line 16... | Line 18... | ||
16 | dd temp_area , 0x0 ; I_Param , I_Icon |
18 | dd temp_area, 0x0 ; I_Param , I_Path |
Line 17... | Line 19... | ||
17 | 19 | ||
18 | ;****************************************************************************** |
20 | ;****************************************************************************** |
Line 24... | Line 26... | ||
24 | 26 | ||
25 | 27 | ||
Line 26... | Line -... | ||
26 | START: ; start of execution |
- | |
27 | call draw_window |
28 | START: ; start of execution |
28 | 29 | call draw_window |
|
29 | ; loadbmp '/RD/1/PONG.BMP',temp_area,I_END,tsoi |
30 | |
30 | convbmp pongfile,tsoi |
31 | convbmp pongfile, tsoi |
31 | bmptoimg pongfile,tsoi,pong |
32 | bmptoimg pongfile, tsoi,pong |
32 | getimg pong,0,0,80,4,img |
33 | getimg pong, 0, 0, 80, 4, img |
33 | getimg pong,0,4,80,4,img2 |
34 | getimg pong, 0, 4, 80, 4, img2 |
34 | getimg pong,5,38,15,15,img3 |
35 | getimg pong, 5, 38, 15, 15, img3 |
Line 35... | Line -... | ||
35 | getimg pong,0,8,80,20,img5 |
- | |
36 | fullimg img4 , 80 ,20 ,0x00000000 ;black for rocket |
- | |
37 | fullimg img6 , 15 ,15 ,0x00000000 ;black for ball |
36 | getimg pong, 0, 8, 80, 20, img5 |
38 | - | ||
39 | 37 | fullimg img4, 80 ,20 ,0x00000000 ;black for rocket |
|
Line 40... | Line 38... | ||
40 | 38 | fullimg img6, 15 ,15 ,0x00000000 ;black for ball |
|
41 | still: |
39 | |
42 | 40 | still: |
|
43 | scevent red,key,button |
41 | scevent red,key,button |
Line 44... | Line 42... | ||
44 | 42 | ||
45 | ;mcall 48, 4 ;get skin width |
43 | ;mcall 48, 4 ;get skin width |
Line 46... | Line 44... | ||
46 | ;sub [skin_h], 16 |
44 | ;sub [skin_h], 16 |
47 | ;div eax, 2 |
45 | ;div eax, 2 |
48 | ;mov [skin_h], eax |
46 | ;mov [skin_h], eax |
49 | 47 | ||
50 | outcount dword [scoreb],300,8,cl_Blue,5*65536 |
48 | outcount [scoreb], 300, 4, 0x10000000 + cl_Blue, 5 shl 16 |
Line 51... | Line 49... | ||
51 | outcount dword [scorea],350,8,cl_Red,5*65536 |
49 | outcount [scorea], 350, 4, 0x10000000 + cl_Red, 5 shl 16 |
52 | - | ||
53 | del_images: |
50 | |
54 | setimg dword [ply1x],dword [ply1y],img4 |
51 | del_images: |
Line 55... | Line 52... | ||
55 | setimg dword [ply2x],dword [ply2y],img4 |
52 | setimg [ply1x], [ply1y], img4 |
56 | setimg dword [ballx],dword [bally],img6 |
53 | setimg [ply2x], [ply2y], img4 |
57 | setimg dword [gravx],dword [gravy],img4 |
54 | setimg [ballx], [bally], img6 |
58 | 55 | setimg [gravx], [gravy], img4 |
|
59 | move_ply1: |
56 | |
60 | - | ||
Line 61... | Line 57... | ||
61 | correct [ply1x],[ply1rx],4 |
57 | move_ply1: |
62 | correct [ply1y],[ply1ry],2 |
58 | correct [ply1x], [ply1rx], 4 |
63 | 59 | correct [ply1y], [ply1ry], 2 |
|
64 | ;automove ball |
60 | |
65 | mov eax,dword [ballxv] |
61 | ; automove ball |
66 | add dword [ballx],eax |
62 | mov eax, [ballxv] |
67 | mov eax,dword [ballyv] |
63 | add [ballx], eax |
68 | add dword [bally],eax |
64 | mov eax, [ballyv] |
69 | 65 | add [bally], eax |
|
70 | 66 | ||
71 | ;autoslow ball |
67 | ;autoslow ball |
72 | cmp dword [ballxv],0 |
68 | cmp [ballxv], 0 |
73 | jl ballb |
69 | jl ballb |
74 | balla: |
70 | balla: |
75 | cmp dword [ballxv],2 |
71 | cmp [ballxv], 2 |
76 | jng balln |
72 | jng balln |
77 | dec dword [ballxv] |
73 | dec [ballxv] |
78 | jmp balln |
74 | jmp balln |
Line 79... | Line 75... | ||
79 | ballb: |
75 | ballb: |
80 | cmp dword [ballxv],-2 |
76 | cmp [ballxv], -2 |
81 | jnl balln |
77 | jnl balln |
82 | inc dword [ballxv] |
78 | inc [ballxv] |
83 | jmp balln |
79 | jmp balln |
84 | balln: |
80 | balln: |
85 | cmp dword [ballyv],2 |
81 | cmp [ballyv], 2 |
86 | jng by_n |
82 | jng by_n |
87 | dec dword [ballyv] |
83 | dec [ballyv] |
Line 88... | Line 84... | ||
88 | by_n: |
84 | by_n: |
89 | 85 | ||
90 | ;ball collusion of screen |
86 | ;ball collusion of screen |
91 | cmp dword [ballx],640-32 |
87 | cmp [ballx], 640-32 |
92 | jna xa_ok |
88 | jna xa_ok |
93 | neg dword [ballxv] |
89 | neg [ballxv] |
94 | xa_ok: |
90 | xa_ok: |
95 | cmp dword [ballx],6 |
91 | cmp [ballx], 6 |
96 | jnb xb_ok |
92 | jnb xb_ok |
97 | neg dword [ballxv] |
93 | neg [ballxv] |
98 | xb_ok: |
94 | xb_ok: |
99 | 95 | ||
100 | ;if ball far out of screen come back |
96 | ;if ball far out of screen come back |
101 | ; is not work already |
97 | ; is not work already |
102 | cmp dword [bally],466 |
98 | cmp [bally], 466 |
103 | jng yax_ok |
99 | jng yax_ok |
104 | call draw_window |
100 | call draw_window |
105 | inc dword [scoreb] |
101 | inc [scoreb] |
106 | mov dword [bally],240 |
102 | mov [bally], 240 |
107 | mov dword [ballx],310 |
103 | mov [ballx], 310 |
108 | mov dword [ballyv],2 |
104 | mov [ballyv], 2 |
109 | random 5,dword [ballxv] |
105 | random 5, [ballxv] |
Line 110... | Line 106... | ||
110 | sub dword [ballxv],2 |
106 | sub [ballxv], 2 |
111 | yax_ok: |
107 | yax_ok: |
112 | cmp dword [bally],30 |
108 | cmp [bally], 30 |
113 | jnl yax_ok2 |
109 | jnl yax_ok2 |
114 | call draw_window |
110 | call draw_window |
115 | inc dword [scorea] |
111 | inc [scorea] |
116 | mov dword [bally],240 |
112 | mov [bally], 240 |
117 | mov dword [ballx],310 |
113 | mov [ballx], 310 |
Line 118... | Line 114... | ||
118 | mov dword [ballyv],2 |
114 | mov [ballyv], 2 |
119 | random 5,dword [ballxv] |
115 | random 5, [ballxv] |
120 | sub dword [ballxv],2 |
116 | sub [ballxv], 2 |
121 | yax_ok2: |
117 | yax_ok2: |
122 | 118 | ||
123 | xorx: |
119 | xorx: |
124 | cmp dword [ballxv],0 |
120 | cmp [ballxv], 0 |
125 | jne norx |
121 | jne norx |
126 | random 5,dword [ballxv] |
122 | random 5, [ballxv] |
Line 127... | Line 123... | ||
127 | sub dword [ballxv],2 |
123 | sub [ballxv], 2 |
128 | cmp dword [ballxv],0 |
124 | cmp [ballxv], 0 |
129 | je xorx |
125 | je xorx |
130 | norx: |
126 | norx: |
131 | 127 | ||
132 | ;test on collusion ply1 of ball |
128 | ;test on collusion ply1 of ball |
133 | collusion_test: |
129 | collusion_test: |
134 | collimg img,[ply1x],[ply1y],img3,[ballx],[bally],eax |
130 | collimg img, [ply1x], [ply1y], img3, [ballx], [bally], eax |
135 | cmp eax,1 |
131 | cmp eax, 1 |
Line 136... | Line 132... | ||
136 | jne not_coll |
132 | jne not_coll |
137 | neg dword [ballyv] |
133 | neg [ballyv] |
138 | add dword [bally],4 |
134 | add [bally], 4 |
139 | ; neg dword [ballxv] |
135 | ; neg [ballxv] |
140 | not_coll: |
136 | not_coll: |
141 | 137 | ||
Line 142... | Line 138... | ||
142 | ;test on collusion com of ball |
138 | ;test on collusion com of ball |
Line 143... | Line 139... | ||
143 | collusion_com: |
139 | collusion_com: |
144 | collimg img,[ply2x],[ply2y],img3,[ballx],[bally],eax |
140 | collimg img, [ply2x], [ply2y], img3, [ballx], [bally], eax |
145 | cmp eax,1 |
141 | cmp eax, 1 |
146 | jne not_collcom |
142 | jne not_collcom |
147 | neg dword [ballyv] |
143 | neg [ballyv] |
148 | sub dword [bally],4 |
144 | sub [bally], 4 |
149 | ; neg dword [ballxv] |
145 | ; neg dword [ballxv] |
150 | not_collcom: |
146 | not_collcom: |
151 | 147 | ||
152 | ;test on collusion gravity of ball |
148 | ;test on collusion gravity of ball |
153 | collusion_grav: |
149 | collusion_grav: |
154 | collimg img,[gravx],[gravy],img3,[ballx],[bally],eax |
150 | collimg img, [gravx], [gravy], img3, [ballx], [bally], eax |
155 | cmp eax,1 |
151 | cmp eax, 1 |
156 | jne not_collg |
152 | jne not_collg |
157 | neg dword [ballyv] |
153 | neg [ballyv] |
158 | 154 | ||
159 | ; mov dword [ballxv],-20 |
155 | ; mov [ballxv], -20 |
160 | 156 | ||
161 | cmp dword [ballyv],0 |
157 | cmp [ballyv], 0 |
Line 162... | Line 158... | ||
162 | jl ab |
158 | jl ab |
163 | jg bf |
159 | jg bf |
Line 164... | Line 160... | ||
164 | jmp not_collgx |
160 | jmp not_collgx |
165 | ab: |
161 | ab: |
166 | sub dword [ballyv],25 |
162 | sub [ballyv], 25 |
167 | jmp not_collgx |
163 | jmp not_collgx |
168 | bf: |
164 | bf: |
169 | add dword [ballyv],25 |
165 | add [ballyv], 25 |
170 | not_collgx: |
166 | not_collgx: |
171 | cmp dword [ballxv],0 |
167 | cmp [ballxv], 0 |
172 | jl abx |
168 | jl abx |
173 | jg bfx |
169 | jg bfx |
Line 174... | Line 170... | ||
174 | jmp not_collg |
170 | jmp not_collg |
175 | abx: |
171 | abx: |
176 | sub dword [ballxv],8 ;15 |
172 | sub [ballxv], 8 ;15 |
177 | jmp not_collg |
173 | jmp not_collg |
178 | bfx: |
174 | bfx: |
179 | add dword [ballxv],8 |
175 | add [ballxv], 8 |
180 | 176 | ||
181 | 177 | ||
182 | ; mov dword [ballyv],20 |
178 | ; mov [ballyv], 20 |
183 | not_collg: |
179 | not_collg: |
Line 184... | Line 180... | ||
184 | 180 | ||
185 | ;ply contorl |
181 | ;ply contorl |
186 | cmp dword [ply1rx],560 |
182 | cmp [ply1rx], 560 |
187 | jna plyok |
183 | jna plyok |
188 | cmp dword [ply1rx],12000 |
184 | cmp [ply1rx], 12000 |
189 | jna paa |
185 | jna paa |
190 | mov dword [ply1rx],4 |
186 | mov [ply1rx], 4 |
191 | jmp plyok |
187 | jmp plyok |
192 | paa: |
188 | paa: |
193 | mov dword [ply1rx],560 |
189 | mov [ply1rx], 560 |
194 | plyok: |
190 | plyok: |
195 | 191 | ||
196 | 192 | ||
197 | ;com contorl |
193 | ;com contorl |
198 | cmp dword [ply2x],560 |
194 | cmp [ply2x], 560 |
199 | jna cplyok |
195 | jna cplyok |
Line 200... | Line 196... | ||
200 | cmp dword [ply2x],12000 |
196 | cmp [ply2x], 12000 |
201 | jna cpaa |
197 | jna cpaa |
202 | mov dword [ply2x],4 |
198 | mov [ply2x], 4 |
203 | jmp cplyok |
199 | jmp cplyok |
204 | cpaa: |
200 | cpaa: |
205 | mov dword [ply2x],560 |
201 | mov [ply2x], 560 |
Line 206... | Line 202... | ||
206 | cplyok: |
202 | cplyok: |
207 | 203 | ||
208 | 204 | ||
209 | ;com move |
205 | ;com move |
210 | cx_move: |
206 | cx_move: |
211 | cmp dword [bally],160 |
207 | cmp [bally], 160 |
212 | jna cno_m |
208 | jna cno_m |
213 | mov eax,dword [ballx] |
209 | mov eax, [ballx] |
214 | sub eax,30 |
210 | sub eax, 30 |
215 | cmp dword [ply2x],eax |
211 | cmp [ply2x], eax |
216 | je cno_m |
212 | je cno_m |
217 | cmp dword [ply2x],eax |
213 | cmp [ply2x], eax |
218 | ja cm_m |
214 | ja cm_m |
Line 219... | Line 215... | ||
219 | cm_p: |
215 | cm_p: |
220 | add dword [ply2x],3 |
216 | add [ply2x], 3 |
221 | jmp cno_m |
217 | jmp cno_m |
222 | cm_m: |
218 | cm_m: |
223 | sub dword [ply2x],3 |
219 | sub [ply2x], 3 |
224 | cno_m: |
- | |
Line 225... | Line 220... | ||
225 | 220 | cno_m: |
|
Line 226... | Line 221... | ||
226 | ;garvity |
221 | |
Line 262... | Line 257... | ||
262 | key: ; key |
257 | key: ; key |
263 | mov eax,2 |
258 | mov eax, 2 |
264 | mcall |
259 | mcall |
265 | cmp ah,key_Left |
260 | cmp ah, key_Left |
266 | jne no_l |
261 | jne no_l |
267 | sub dword [ply1rx],32 ;16 |
262 | sub [ply1rx], 32 ;16 |
268 | no_l: |
263 | no_l: |
269 | cmp ah,key_Right |
264 | cmp ah, key_Right |
270 | jne no_r |
265 | jne no_r |
271 | add dword [ply1rx],32 ;16 |
266 | add [ply1rx], 32 ;16 |
272 | no_r: |
267 | no_r: |
273 | cmp ah,key_Up |
268 | cmp ah, key_Up |
274 | jne no_u |
269 | jne no_u |
275 | sub dword [ply1ry],16 |
270 | sub [ply1ry], 16 |
276 | no_u: |
271 | no_u: |
277 | cmp ah,key_Down |
272 | cmp ah, key_Down |
278 | jne no_d |
273 | jne no_d |
279 | add dword [ply1ry],16 |
274 | add [ply1ry], 16 |
280 | no_d: |
275 | no_d: |
281 | cmp ah,key_Space |
276 | cmp ah, key_Space |
282 | jne no_sp |
277 | jne no_sp |
283 | mov dword [gravtime],100 |
278 | mov [gravtime], 100 |
284 | no_sp: |
279 | no_sp: |
Line 285... | Line 280... | ||
285 | 280 | ||
Line 286... | Line 281... | ||
286 | jmp still |
281 | jmp still |
Line 333... | Line 328... | ||
333 | scoreb dd 0 |
328 | scoreb dd 0 |
Line 334... | Line 329... | ||
334 | 329 | ||
335 | counter dd 0 |
330 | counter dd 0 |
Line 336... | Line -... | ||
336 | tsoi dd 0 |
- | |
337 | 331 | tsoi dd 0 |
|
Line 338... | Line 332... | ||
338 | pongfile: |
332 | |
Line 339... | Line -... | ||
339 | file 'pong.bmp' |
- | |
340 | 333 | pongfile file 'pong.bmp' |
|
Line 341... | Line -... | ||
341 | IM_END: |
- | |
342 | 334 | ||
343 | temp: |
- | |
344 | rb 20000 |
335 | IM_END: |
345 | - | ||
346 | pong: |
336 | |
347 | rb 80*60*3+8 |
- | |
348 | img: |
337 | temp rb 20000 |
349 | rb 32*32*3+8 |
- | |
350 | img2: |
338 | |
351 | rb 32*32*3+8 |
- | |
352 | img3: |
339 | pong rb 80*60*3+8 |
353 | rb 32*32*3+8 |
- | |
354 | img4: |
340 | img rb 32*32*3+8 |
Line 355... | Line -... | ||
355 | rb 80*20*3+8 |
- | |
356 | img5: |
341 | img2 rb 32*32*3+8 |
Line 357... | Line 342... | ||
357 | rb 32*32*3+8 |
342 | img3 rb 32*32*3+8 |