Rev 2075 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2075 | Rev 3013 | ||
---|---|---|---|
1 | IDA equ 1 ; We're running debugida.exe |
1 | IDA equ 1 ; We're running debugida.exe |
2 | 2 | ||
3 | STRIP equ 40 |
3 | STRIP equ 40 |
4 | LEVNUM equ 500 |
4 | LEVNUM equ 500 |
5 | XFOFS equ 10 |
5 | XFOFS equ 10 |
6 | YFOFS equ 55 |
6 | YFOFS equ 55 |
7 | MSGXO equ 32 |
7 | MSGXO equ 32 |
8 | GAMES_ALL equ 12 |
8 | GAMES_ALL equ 12 |
9 | WNDCOLOR equ 0x03c0c0c0;0x03f6f6f6; |
9 | WNDCOLOR equ 0x03c0c0c0;0x03f6f6f6; |
10 | MINCS equ 40 |
10 | MINCS equ 40 |
11 | MAXCS equ 80 |
11 | MAXCS equ 80 |
12 | macro icall lbl |
12 | macro icall lbl |
13 | { |
13 | { |
14 | call [lbl+ebp*4] |
14 | call [lbl+ebp*4] |
15 | } |
15 | } |
16 | 16 | ||
17 | use32 |
17 | use32 |
18 | org 0x0 |
18 | org 0x0 |
19 | 19 | ||
20 | db 'MENUET01' ; 8 byte id |
20 | db 'MENUET01' ; 8 byte id |
21 | dd 0x01 ; header version |
21 | dd 0x01 ; header version |
22 | dd run ; start of code |
22 | dd run ; start of code |
23 | dd I_END ; size of image |
23 | dd I_END ; size of image |
24 | dd end_mem ; memory for app |
24 | dd end_mem ; memory for app |
25 | dd stack_end ; esp |
25 | dd stack_end ; esp |
26 | dd 0x0 , 0x0 ; I_Param , I_Icon |
26 | dd 0x0 , 0x0 ; I_Param , I_Icon |
27 | lang fix ru |
27 | lang fix ru |
28 | include "MACROS.INC" |
28 | include "macros.inc" |
29 | purge mov |
29 | purge mov |
30 | ;include "DEBUG.INC" |
30 | ;include "../../../debug.inc" |
31 | COLOR_ORDER equ MENUETOS |
31 | COLOR_ORDER equ MENUETOS |
32 | 32 | ||
33 | include 'gif_lite.inc' |
33 | include 'gif_lite.inc' |
34 | 34 | ||
35 | include 'tam.inc' |
35 | include 'tam.inc' |
36 | include 'smz.inc' |
36 | include 'smz.inc' |
37 | include 'tilt.inc' |
37 | include 'tilt.inc' |
38 | include 'tilt2.inc' |
38 | include 'tilt2.inc' |
39 | include 'fhouse.inc' |
39 | include 'fhouse.inc' |
40 | include 'loops.inc' |
40 | include 'loops.inc' |
41 | include 'wriggle.inc' |
41 | include 'wriggle.inc' |
42 | include 'blackbox.inc' |
42 | include 'blackbox.inc' |
43 | include 'marble.inc' |
43 | include 'marble.inc' |
44 | include 'cstep.inc' |
44 | include 'cstep.inc' |
45 | include 'orient.inc' |
45 | include 'orient.inc' |
46 | include 'nolt.inc' |
46 | include 'nolt.inc' |
47 | include 'colzone.inc' |
47 | include 'colzone.inc' |
48 | 48 | ||
49 | run: |
49 | run: |
50 | mov [Ces],STRIP;20 |
50 | mov [Ces],STRIP;20 |
51 | mcall 3 |
51 | mcall 3 |
52 | mov cl,16 |
52 | mov cl,16 |
53 | ror eax,cl |
53 | ror eax,cl |
54 | mov [generator],eax ; random generator from Tetris |
54 | mov [generator],eax ; random generator from Tetris |
55 | 55 | ||
56 | and [mpress_flag],0 |
56 | and [mpress_flag],0 |
57 | and [gif_unp],0 |
57 | and [gif_unp],0 |
58 | xor ebp,ebp ; game_t |
58 | xor ebp,ebp ; game_t |
59 | ; mov ebp,10 |
59 | ; mov ebp,10 |
60 | mcall 64,1,end_mem |
60 | mcall 64,1,end_mem |
61 | mov [pause_time],40 |
61 | mov [pause_time],40 |
62 | call resize |
62 | call resize |
63 | .game1: |
63 | .game1: |
64 | mov [levnum],LEVNUM |
64 | mov [levnum],LEVNUM |
65 | .game: |
65 | .game: |
66 | and [win_flag],0 |
66 | and [win_flag],0 |
67 | and [drag_flag],0 |
67 | and [drag_flag],0 |
68 | mov ecx,[levnum] |
68 | mov ecx,[levnum] |
69 | mov esi,[levels+ebp*4] |
69 | mov esi,[levels+ebp*4] |
70 | jecxz .skip |
70 | jecxz .skip |
71 | .nxt: |
71 | .nxt: |
72 | movzx eax,byte[esi] |
72 | movzx eax,byte[esi] |
73 | add esi,eax |
73 | add esi,eax |
74 | xor eax,eax |
74 | xor eax,eax |
75 | cmp al,byte[esi] |
75 | cmp al,byte[esi] |
76 | jne .noz |
76 | jne .noz |
77 | mov esi,LEVNUM;500 |
77 | mov esi,LEVNUM;500 |
78 | sub esi,ecx |
78 | sub esi,ecx |
79 | mov [levcount],esi |
79 | mov [levcount],esi |
80 | and [levnum],0 |
80 | and [levnum],0 |
81 | jmp .game |
81 | jmp .game |
82 | .noz: |
82 | .noz: |
83 | loop .nxt |
83 | loop .nxt |
84 | .skip: |
84 | .skip: |
85 | mcall 40,111b |
85 | mcall 40,111b |
86 | mov [mouse_processed],1 |
86 | mov [mouse_processed],1 |
87 | xor eax,eax |
87 | xor eax,eax |
88 | icall prepare_level |
88 | icall prepare_level |
89 | wnd_size: |
89 | wnd_size: |
90 | mov eax,[Ces] |
90 | mov eax,[Ces] |
91 | shr eax,2 |
91 | shr eax,2 |
92 | sub eax,2 |
92 | sub eax,2 |
93 | mov [sq_size],eax |
93 | mov [sq_size],eax |
94 | if ~ IDA eq 1 |
94 | if ~ IDA eq 1 |
95 | mov edx,[fx] |
95 | mov edx,[fx] |
96 | imul edx,[Ces] |
96 | imul edx,[Ces] |
97 | add edx,XFOFS*2+20 |
97 | add edx,XFOFS*2+20 |
98 | mov esi,[fy] |
98 | mov esi,[fy] |
99 | imul esi,[Ces] |
99 | imul esi,[Ces] |
100 | add esi,YFOFS+30 |
100 | add esi,YFOFS+30 |
101 | mov ecx,-1 |
101 | mov ecx,-1 |
102 | mcall 67,ecx |
102 | mcall 67,ecx |
103 | end if |
103 | end if |
104 | red: |
104 | red: |
105 | call draw_window |
105 | call draw_window |
106 | 106 | ||
107 | drw: |
107 | drw: |
108 | call drwfld |
108 | call drwfld |
109 | 109 | ||
110 | still: |
110 | still: |
111 | mcall 2 |
111 | mcall 2 |
112 | test al,al |
112 | test al,al |
113 | jz still |
113 | jz still |
114 | mcall 10 |
114 | mcall 10 |
115 | cmp eax,2 |
115 | cmp eax,2 |
116 | je key |
116 | je key |
117 | cmp eax,1 ; redraw request ? |
117 | cmp eax,1 ; redraw request ? |
118 | je red |
118 | je red |
119 | cmp eax,3 ; button in buffer ? |
119 | cmp eax,3 ; button in buffer ? |
120 | je button |
120 | je button |
121 | cmp eax,6 ; mouse event ? |
121 | cmp eax,6 ; mouse event ? |
122 | je mouse |
122 | je mouse |
123 | key: |
123 | key: |
124 | mcall 2 |
124 | mcall 2 |
125 | ; movzx ebx,ah |
125 | ; movzx ebx,ah |
126 | ; dpd ebx |
126 | ; dpd ebx |
127 | cmp ebp,10 |
127 | cmp ebp,10 |
128 | je .noplus |
128 | je .noplus |
129 | mov ebx,5 |
129 | mov ebx,5 |
130 | cmp ah,184 |
130 | cmp ah,184 |
131 | jne .nomin |
131 | jne .nomin |
132 | cmp [Ces],MINCS |
132 | cmp [Ces],MINCS |
133 | je still |
133 | je still |
134 | .ces: |
134 | .ces: |
135 | sub [Ces],ebx |
135 | sub [Ces],ebx |
136 | call resize |
136 | call resize |
137 | jmp wnd_size |
137 | jmp wnd_size |
138 | .nomin: |
138 | .nomin: |
139 | cmp ah,183 |
139 | cmp ah,183 |
140 | jne .noplus |
140 | jne .noplus |
141 | cmp [Ces],MAXCS |
141 | cmp [Ces],MAXCS |
142 | je still |
142 | je still |
143 | neg ebx |
143 | neg ebx |
144 | jmp .ces |
144 | jmp .ces |
145 | .noplus: |
145 | .noplus: |
146 | cmp ah,'h' |
146 | cmp ah,'h' |
147 | jne .nohlp |
147 | jne .nohlp |
148 | ; if IDA eq 1 |
148 | ; if IDA eq 1 |
149 | ; cmp [child],0 |
149 | ; cmp [child],0 |
150 | ; jne still |
150 | ; jne still |
151 | ; else |
151 | ; else |
152 | call kill_help |
152 | call kill_help |
153 | ; end if |
153 | ; end if |
154 | mov [pack],ebp |
154 | mov [pack],ebp |
155 | mcall 51,1,show_help,chs_end |
155 | mcall 51,1,show_help,chs_end |
156 | ; dpd eax |
156 | ; dpd eax |
157 | mov [child],eax |
157 | mov [child],eax |
158 | jmp still |
158 | jmp still |
159 | .nohlp: |
159 | .nohlp: |
160 | cmp [win_flag],10 |
160 | cmp [win_flag],10 |
161 | je .levover |
161 | je .levover |
162 | cmp [win_flag],2 |
162 | cmp [win_flag],2 |
163 | je .no_win |
163 | je .no_win |
164 | cmp [win_flag],1 |
164 | cmp [win_flag],1 |
165 | jne .now |
165 | jne .now |
166 | .levover: |
166 | .levover: |
167 | call lev_next |
167 | call lev_next |
168 | .no_win: |
168 | .no_win: |
169 | and [win_flag],al |
169 | and [win_flag],al |
170 | jmp run.game |
170 | jmp run.game |
171 | .now: |
171 | .now: |
172 | shr eax,8 |
172 | shr eax,8 |
173 | mov [jump],drw;red |
173 | mov [jump],drw;red |
174 | cmp eax,13 |
174 | cmp eax,13 |
175 | je run.game |
175 | je run.game |
176 | icall key_handler |
176 | icall key_handler |
177 | jmp [jump] |
177 | jmp [jump] |
178 | 178 | ||
179 | button: |
179 | button: |
180 | mcall 17 |
180 | mcall 17 |
181 | cmp ah,1 |
181 | cmp ah,1 |
182 | je close |
182 | je close |
183 | cmp ah,2 |
183 | cmp ah,2 |
184 | je .game_type |
184 | je .game_type |
185 | cmp ah,4 |
185 | cmp ah,4 |
186 | je .inclev |
186 | je .inclev |
187 | cmp ah,3 |
187 | cmp ah,3 |
188 | je .declev |
188 | je .declev |
189 | jmp still |
189 | jmp still |
190 | .declev: |
190 | .declev: |
191 | dec [levnum] |
191 | dec [levnum] |
192 | cmp [levnum],0 |
192 | cmp [levnum],0 |
193 | jge run.game |
193 | jge run.game |
194 | push [levcount] |
194 | push [levcount] |
195 | pop [levnum] |
195 | pop [levnum] |
196 | jmp run.game |
196 | jmp run.game |
197 | .inclev: |
197 | .inclev: |
198 | call lev_next |
198 | call lev_next |
199 | jmp run.game |
199 | jmp run.game |
200 | .game_type: |
200 | .game_type: |
201 | inc ebp |
201 | inc ebp |
202 | cmp ebp,GAMES_ALL |
202 | cmp ebp,GAMES_ALL |
203 | jbe run.game1 |
203 | jbe run.game1 |
204 | xor ebp,ebp |
204 | xor ebp,ebp |
205 | jmp run.game1 |
205 | jmp run.game1 |
206 | close: |
206 | close: |
207 | if ~ IDA eq 1 |
207 | if ~ IDA eq 1 |
208 | call kill_help |
208 | call kill_help |
209 | end if |
209 | end if |
210 | mcall -1 |
210 | mcall -1 |
211 | 211 | ||
212 | ;if ~ IDA eq 1 |
212 | ;if ~ IDA eq 1 |
213 | 213 | ||
214 | kill_help: |
214 | kill_help: |
215 | mcall 9,prc_info2,-1 |
215 | mcall 9,prc_info2,-1 |
216 | mov edx,[child] |
216 | mov edx,[child] |
217 | mov ecx,eax |
217 | mov ecx,eax |
218 | .lp: |
218 | .lp: |
219 | mcall 9 |
219 | mcall 9 |
220 | cmp edx,[ebx+30] |
220 | cmp edx,[ebx+30] |
221 | jne .nochild |
221 | jne .nochild |
222 | mcall 18,2 |
222 | mcall 18,2 |
223 | and [child],0 |
223 | and [child],0 |
224 | ret |
224 | ret |
225 | .nochild: |
225 | .nochild: |
226 | loop .lp |
226 | loop .lp |
227 | ret |
227 | ret |
228 | 228 | ||
229 | ;end if |
229 | ;end if |
230 | 230 | ||
231 | mouse: |
231 | mouse: |
232 | cmp [mouse_processed],1 |
232 | cmp [mouse_processed],1 |
233 | jne .ex |
233 | jne .ex |
234 | mcall 37,1 |
234 | mcall 37,1 |
235 | sub eax,XFOFS shl 16+YFOFS |
235 | sub eax,XFOFS shl 16+YFOFS |
236 | xor edx,edx |
236 | xor edx,edx |
237 | mov ebx,[Ces] |
237 | mov ebx,[Ces] |
238 | mov ecx,eax |
238 | mov ecx,eax |
239 | and eax,0xffff |
239 | and eax,0xffff |
240 | div ebx |
240 | div ebx |
241 | xor edx,edx |
241 | xor edx,edx |
242 | mov [mouse_y],eax |
242 | mov [mouse_y],eax |
243 | cmp eax,[fy] |
243 | cmp eax,[fy] |
244 | jae .ex |
244 | jae .ex |
245 | mov eax,ecx |
245 | mov eax,ecx |
246 | shr eax,16 |
246 | shr eax,16 |
247 | div ebx |
247 | div ebx |
248 | mov [mouse_x],eax |
248 | mov [mouse_x],eax |
249 | cmp eax,[fx] |
249 | cmp eax,[fx] |
250 | jae .ex |
250 | jae .ex |
251 | mcall 37,2 ; get buttons |
251 | mcall 37,2 ; get buttons |
252 | cmp [drag_flag],0 |
252 | cmp [drag_flag],0 |
253 | je .nodrag |
253 | je .nodrag |
254 | mov ebx,eax |
254 | mov ebx,eax |
255 | cmp eax,[mpress_flag] |
255 | cmp eax,[mpress_flag] |
256 | mov eax,-1 |
256 | mov eax,-1 |
257 | je .nochg |
257 | je .nochg |
258 | dec eax |
258 | dec eax |
259 | .nochg: |
259 | .nochg: |
260 | mov [mpress_flag],ebx |
260 | mov [mpress_flag],ebx |
261 | jmp .call_hnd |
261 | jmp .call_hnd |
262 | .nodrag: |
262 | .nodrag: |
263 | test eax,eax |
263 | test eax,eax |
264 | jz .ex1 |
264 | jz .ex1 |
265 | cmp eax,[mpress_flag] |
265 | cmp eax,[mpress_flag] |
266 | je .ex |
266 | je .ex |
267 | mov [mpress_flag],eax |
267 | mov [mpress_flag],eax |
268 | mov eax,-1 |
268 | mov eax,-1 |
269 | .call_hnd: |
269 | .call_hnd: |
270 | mov [mouse_processed],0 |
270 | mov [mouse_processed],0 |
271 | icall key_handler |
271 | icall key_handler |
272 | jmp [jump] |
272 | jmp [jump] |
273 | .ex1: |
273 | .ex1: |
274 | mov [mpress_flag],0 |
274 | mov [mpress_flag],0 |
275 | .ex: |
275 | .ex: |
276 | jmp still |
276 | jmp still |
277 | 277 | ||
278 | lev_next: |
278 | lev_next: |
279 | push eax |
279 | push eax |
280 | inc [levnum] |
280 | inc [levnum] |
281 | mov eax,[levnum] |
281 | mov eax,[levnum] |
282 | cmp eax,[levcount] |
282 | cmp eax,[levcount] |
283 | jbe .ex |
283 | jbe .ex |
284 | and [levnum],0 |
284 | and [levnum],0 |
285 | .ex: |
285 | .ex: |
286 | pop eax |
286 | pop eax |
287 | ret |
287 | ret |
288 | ;--------------------------------------------------------------------- |
288 | ;--------------------------------------------------------------------- |
289 | ; ********************************************* |
289 | ; ********************************************* |
290 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
290 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
291 | ; ********************************************* |
291 | ; ********************************************* |
292 | draw_window: |
292 | draw_window: |
293 | pusha |
293 | pusha |
294 | mcall 12,1 |
294 | mcall 12,1 |
295 | mov ebx,[fx] |
295 | mov ebx,[fx] |
296 | imul ebx,[Ces] |
296 | imul ebx,[Ces] |
297 | push ebx |
297 | push ebx |
298 | add ebx,50 shl 16+XFOFS*2+20 |
298 | add ebx,50 shl 16+XFOFS*2+20 |
299 | mov ecx,[fy] |
299 | mov ecx,[fy] |
300 | imul ecx,[Ces] |
300 | imul ecx,[Ces] |
301 | add ecx,10 shl 16+YFOFS+30 |
301 | add ecx,10 shl 16+YFOFS+30 |
302 | mcall 0,,,WNDCOLOR |
302 | mcall 0,,,WNDCOLOR |
303 | 303 | ||
304 | push edx |
304 | push edx |
305 | mcall 4,<8,8>,0x10ffffff,header,header.size |
305 | mcall 4,<8,8>,0x10ffffff,header,header.size |
306 | pop esi |
306 | pop esi |
307 | and esi,0xffffff |
307 | and esi,0xffffff |
308 | mcall 9,prc_info,-1 |
308 | mcall 9,prc_info,-1 |
309 | pop ebx |
309 | pop ebx |
310 | 310 | ||
311 | mov eax,[prc_info+70] ;status of window |
311 | mov eax,[prc_info+70] ;status of window |
312 | test eax,100b |
312 | test eax,100b |
313 | jne .end |
313 | jne .end |
314 | 314 | ||
315 | add ebx,XFOFS shl 16+XFOFS*2 |
315 | add ebx,XFOFS shl 16+XFOFS*2 |
316 | 316 | ||
317 | mcall 8,,<25,12>,2 |
317 | mcall 8,,<25,12>,2 |
318 | 318 | ||
319 | mcall 8, |
319 | mcall 8, |
320 | add ebx,14 shl 16 |
320 | add ebx,14 shl 16 |
321 | inc edx |
321 | inc edx |
322 | mcall |
322 | mcall |
323 | 323 | ||
324 | mov ecx,ebp |
324 | mov ecx,ebp |
325 | mov edx,game_names+4 |
325 | mov edx,game_names+4 |
326 | call get_mstr |
326 | call get_mstr |
327 | mcall , |
327 | mcall , |
328 | imul esi,6 |
328 | imul esi,6 |
329 | add esi,3 |
329 | add esi,3 |
330 | shl esi,16 |
330 | shl esi,16 |
331 | lea edx,[ebx+esi] |
331 | lea edx,[ebx+esi] |
332 | mcall 47,0x020001,levnum,,0x8000 |
332 | mcall 47,0x020001,levnum,,0x8000 |
333 | 333 | ||
334 | mcall 4, |
334 | mcall 4, |
335 | .end: |
335 | .end: |
336 | mcall 12,2 |
336 | mcall 12,2 |
337 | popa |
337 | popa |
338 | ret |
338 | ret |
339 | ;--------------------------------------------------------------------- |
339 | ;--------------------------------------------------------------------- |
340 | unpack_level: |
340 | unpack_level: |
341 | mov ecx,[cell_count] |
341 | mov ecx,[cell_count] |
342 | mov edi,field |
342 | mov edi,field |
343 | .lp: |
343 | .lp: |
344 | movzx eax,byte[esi] |
344 | movzx eax,byte[esi] |
345 | inc esi |
345 | inc esi |
346 | shl ax,4 |
346 | shl ax,4 |
347 | shr al,4 |
347 | shr al,4 |
348 | stosw |
348 | stosw |
349 | loop .lp |
349 | loop .lp |
350 | ret |
350 | ret |
351 | ;--------------------------------------------------------------------- |
351 | ;--------------------------------------------------------------------- |
352 | get_xy: |
352 | get_xy: |
353 | ; eax-coord |
353 | ; eax-coord |
354 | ; out: [lx]-[x+2][CS-4],[ly]-[y+2][CS-4] |
354 | ; out: [lx]-[x+2][CS-4],[ly]-[y+2][CS-4] |
355 | pusha |
355 | pusha |
356 | xor edx,edx |
356 | xor edx,edx |
357 | mov esi,[sq_size] |
357 | mov esi,[sq_size] |
358 | lea edi,[esi*2] |
358 | lea edi,[esi*2] |
359 | neg edi |
359 | neg edi |
360 | add edi,[Ces] |
360 | add edi,[Ces] |
361 | mov [lx],edi |
361 | mov [lx],edi |
362 | mov [ly],edi |
362 | mov [ly],edi |
363 | mov ebx,[fx] |
363 | mov ebx,[fx] |
364 | div bx |
364 | div bx |
365 | imul eax,[Ces] |
365 | imul eax,[Ces] |
366 | imul edx,[Ces] |
366 | imul edx,[Ces] |
367 | lea edx,[edx+XFOFS+esi] |
367 | lea edx,[edx+XFOFS+esi] |
368 | lea eax,[eax+YFOFS+esi] |
368 | lea eax,[eax+YFOFS+esi] |
369 | mov word[ly+2],ax |
369 | mov word[ly+2],ax |
370 | mov word[lx+2],dx |
370 | mov word[lx+2],dx |
371 | popa |
371 | popa |
372 | ret |
372 | ret |
373 | 373 | ||
374 | check_move: |
374 | check_move: |
375 | ; eax-coord, ebx-direction |
375 | ; eax-coord, ebx-direction |
376 | ; CF=0 if move is valid |
376 | ; CF=0 if move is valid |
377 | bt dword[field+eax],ebx |
377 | bt dword[field+eax],ebx |
378 | ret |
378 | ret |
379 | 379 | ||
380 | delay: |
380 | delay: |
381 | pusha |
381 | pusha |
382 | mcall 5,[pause_time] |
382 | mcall 5,[pause_time] |
383 | popa |
383 | popa |
384 | ret |
384 | ret |
385 | 385 | ||
386 | get_mstr: |
386 | get_mstr: |
387 | ; in: edx,ecx |
387 | ; in: edx,ecx |
388 | ; out: edx,esi |
388 | ; out: edx,esi |
389 | mov esi,[edx-4] |
389 | mov esi,[edx-4] |
390 | jecxz .ex |
390 | jecxz .ex |
391 | lea edx,[edx+esi+4] |
391 | lea edx,[edx+esi+4] |
392 | dec ecx |
392 | dec ecx |
393 | jmp get_mstr |
393 | jmp get_mstr |
394 | .ex: |
394 | .ex: |
395 | ret |
395 | ret |
396 | 396 | ||
397 | maze_field: |
397 | maze_field: |
398 | mov edi,field |
398 | mov edi,field |
399 | mov [ly],YFOFS shl 16+YFOFS |
399 | mov [ly],YFOFS shl 16+YFOFS |
400 | mov eax,38 |
400 | mov eax,38 |
401 | mov ecx,[fy] |
401 | mov ecx,[fy] |
402 | .lp1: |
402 | .lp1: |
403 | push ecx |
403 | push ecx |
404 | mov [lx],XFOFS shl 16+XFOFS |
404 | mov [lx],XFOFS shl 16+XFOFS |
405 | mov ecx,[fx] |
405 | mov ecx,[fx] |
406 | .lp2: |
406 | .lp2: |
407 | push ecx |
407 | push ecx |
408 | xor esi,esi |
408 | xor esi,esi |
409 | .lp3: |
409 | .lp3: |
410 | mov edx,0xd0d0d0 |
410 | mov edx,0xd0d0d0 |
411 | bt dword[edi],esi |
411 | bt dword[edi],esi |
412 | jnc .gray |
412 | jnc .gray |
413 | mov edx,0 |
413 | mov edx,0 |
414 | .gray: |
414 | .gray: |
415 | mov ebx,[lx] |
415 | mov ebx,[lx] |
416 | add ebx,[dir_ofs+esi*4] |
416 | add ebx,[dir_ofs+esi*4] |
417 | mov ecx,[ly] |
417 | mov ecx,[ly] |
418 | add ecx,[dir_ofs+esi*4+8] |
418 | add ecx,[dir_ofs+esi*4+8] |
419 | mcall |
419 | mcall |
420 | inc esi |
420 | inc esi |
421 | cmp esi,4 |
421 | cmp esi,4 |
422 | jb .lp3 |
422 | jb .lp3 |
423 | inc edi |
423 | inc edi |
424 | mov ecx,[Ces] |
424 | mov ecx,[Ces] |
425 | add word[lx],cx |
425 | add word[lx],cx |
426 | add word[lx+2],cx |
426 | add word[lx+2],cx |
427 | pop ecx |
427 | pop ecx |
428 | loop .lp2 |
428 | loop .lp2 |
429 | mov ecx,[Ces] |
429 | mov ecx,[Ces] |
430 | add word[ly],cx |
430 | add word[ly],cx |
431 | add word[ly+2],cx |
431 | add word[ly+2],cx |
432 | pop ecx |
432 | pop ecx |
433 | loop .lp1 |
433 | loop .lp1 |
434 | ret |
434 | ret |
435 | 435 | ||
436 | grid_field: |
436 | grid_field: |
437 | mov edx,0xa0a0a0 |
437 | mov edx,0xa0a0a0 |
438 | mov eax,38 |
438 | mov eax,38 |
439 | 439 | ||
440 | mov ecx,[fy] |
440 | mov ecx,[fy] |
441 | mov ebx,[fx] |
441 | mov ebx,[fx] |
442 | imul ebx,[Ces] |
442 | imul ebx,[Ces] |
443 | add ebx,XFOFS shl 16+XFOFS |
443 | add ebx,XFOFS shl 16+XFOFS |
444 | mov esi,YFOFS shl 16+YFOFS |
444 | mov esi,YFOFS shl 16+YFOFS |
445 | inc ecx |
445 | inc ecx |
446 | .lp1: |
446 | .lp1: |
447 | push ecx |
447 | push ecx |
448 | mov ecx,esi |
448 | mov ecx,esi |
449 | mcall |
449 | mcall |
450 | mov ecx,[Ces] |
450 | mov ecx,[Ces] |
451 | add esi,ecx |
451 | add esi,ecx |
452 | shl ecx,16 |
452 | shl ecx,16 |
453 | add esi,ecx |
453 | add esi,ecx |
454 | pop ecx |
454 | pop ecx |
455 | loop .lp1 |
455 | loop .lp1 |
456 | 456 | ||
457 | mov ecx,[fx] |
457 | mov ecx,[fx] |
458 | mov esi,[fy] |
458 | mov esi,[fy] |
459 | imul esi,[Ces] |
459 | imul esi,[Ces] |
460 | add esi,YFOFS shl 16+YFOFS |
460 | add esi,YFOFS shl 16+YFOFS |
461 | mov ebx,XFOFS shl 16+XFOFS |
461 | mov ebx,XFOFS shl 16+XFOFS |
462 | inc ecx |
462 | inc ecx |
463 | .lp2: |
463 | .lp2: |
464 | push ecx |
464 | push ecx |
465 | mov ecx,esi |
465 | mov ecx,esi |
466 | mcall |
466 | mcall |
467 | mov ecx,[Ces] |
467 | mov ecx,[Ces] |
468 | add ebx,ecx |
468 | add ebx,ecx |
469 | shl ecx,16 |
469 | shl ecx,16 |
470 | add ebx,ecx |
470 | add ebx,ecx |
471 | pop ecx |
471 | pop ecx |
472 | loop .lp2 |
472 | loop .lp2 |
473 | ret |
473 | ret |
474 | 474 | ||
475 | get_xy_sf: |
475 | get_xy_sf: |
476 | xor eax,eax |
476 | xor eax,eax |
477 | and [player],eax |
477 | and [player],eax |
478 | mov [fx],eax |
478 | mov [fx],eax |
479 | mov [fy],eax |
479 | mov [fy],eax |
480 | lodsb |
480 | lodsb |
481 | lodsb |
481 | lodsb |
482 | mov ah,al |
482 | mov ah,al |
483 | shr ah,4 |
483 | shr ah,4 |
484 | and al,0xf |
484 | and al,0xf |
485 | mov byte[fx],ah |
485 | mov byte[fx],ah |
486 | mov byte[fy],al |
486 | mov byte[fy],al |
487 | lodsb |
487 | lodsb |
488 | mov byte[player],al |
488 | mov byte[player],al |
489 | lodsb |
489 | lodsb |
490 | mov byte[finish],al |
490 | mov byte[finish],al |
491 | .count: |
491 | .count: |
492 | mov eax,[fx] |
492 | mov eax,[fx] |
493 | mov [dirs+4],eax |
493 | mov [dirs+4],eax |
494 | neg eax |
494 | neg eax |
495 | mov [dirs+8],eax |
495 | mov [dirs+8],eax |
496 | mov eax,[fx] |
496 | mov eax,[fx] |
497 | imul eax,[fy] |
497 | imul eax,[fy] |
498 | mov [cell_count],eax |
498 | mov [cell_count],eax |
499 | 499 | ||
500 | ret |
500 | ret |
501 | 501 | ||
502 | get_last_mclick: |
502 | get_last_mclick: |
503 | ; out - eax=0 no click or outside field |
503 | ; out - eax=0 no click or outside field |
504 | ; eax>0 button pressed, ebx=[xy] |
504 | ; eax>0 button pressed, ebx=[xy] |
505 | mov [mouse_processed],1 |
505 | mov [mouse_processed],1 |
506 | mov eax,[mpress_flag] |
506 | mov eax,[mpress_flag] |
507 | mov ebx,[mouse_y] |
507 | mov ebx,[mouse_y] |
508 | imul ebx,[fx] |
508 | imul ebx,[fx] |
509 | add ebx,[mouse_x] |
509 | add ebx,[mouse_x] |
510 | ret |
510 | ret |
511 | 511 | ||
512 | erase_field: |
512 | erase_field: |
513 | pusha |
513 | pusha |
514 | mov ecx,[cell_count] |
514 | mov ecx,[cell_count] |
515 | xor eax,eax |
515 | xor eax,eax |
516 | mov edi,field |
516 | mov edi,field |
517 | rep stosb |
517 | rep stosb |
518 | popa |
518 | popa |
519 | ret |
519 | ret |
520 | 520 | ||
521 | get_pxy: |
521 | get_pxy: |
522 | ; in: [pack] - cell#, out: word[pack] - packed [xy] |
522 | ; in: [pack] - cell#, out: word[pack] - packed [xy] |
523 | pusha |
523 | pusha |
524 | mov eax,[pack] |
524 | mov eax,[pack] |
525 | cdq |
525 | cdq |
526 | mov ebx,[fx] |
526 | mov ebx,[fx] |
527 | div ebx |
527 | div ebx |
528 | shl edx,8 |
528 | shl edx,8 |
529 | add eax,edx |
529 | add eax,edx |
530 | mov [pack],eax |
530 | mov [pack],eax |
531 | popa |
531 | popa |
532 | ret |
532 | ret |
533 | 533 | ||
534 | check_bounds: |
534 | check_bounds: |
535 | ; in: eax - cell, ebx - dir |
535 | ; in: eax - cell, ebx - dir |
536 | ; out: ebx=-1 if bounds crossed |
536 | ; out: ebx=-1 if bounds crossed |
537 | push eax ecx |
537 | push eax ecx |
538 | mov ecx,eax |
538 | mov ecx,eax |
539 | add ecx,[dirs+ebx*4] |
539 | add ecx,[dirs+ebx*4] |
540 | mov ebx,ecx |
540 | mov ebx,ecx |
541 | call get_offset |
541 | call get_offset |
542 | mov ebx,eax |
542 | mov ebx,eax |
543 | pop ecx eax |
543 | pop ecx eax |
544 | cmp ebx,-1 |
544 | cmp ebx,-1 |
545 | ret |
545 | ret |
546 | 546 | ||
547 | get_offset: |
547 | get_offset: |
548 | ; in: eax - start, ebx-end |
548 | ; in: eax - start, ebx-end |
549 | ; out: eax - dir or -1 if not straight |
549 | ; out: eax - dir or -1 if not straight |
550 | ; ebx - distance |
550 | ; ebx - distance |
551 | push ecx edx |
551 | push ecx edx |
552 | mov ecx,-1 |
552 | mov ecx,-1 |
553 | mov edx,[cell_count] |
553 | mov edx,[cell_count] |
554 | cmp eax,edx |
554 | cmp eax,edx |
555 | jae .ex |
555 | jae .ex |
556 | cmp ebx,edx |
556 | cmp ebx,edx |
557 | jae .ex |
557 | jae .ex |
558 | mov [pack],eax |
558 | mov [pack],eax |
559 | call get_pxy |
559 | call get_pxy |
560 | mov eax,[pack] |
560 | mov eax,[pack] |
561 | mov [pack],ebx |
561 | mov [pack],ebx |
562 | call get_pxy |
562 | call get_pxy |
563 | mov ebx,[pack] |
563 | mov ebx,[pack] |
564 | cmp ah,bh ; compare X |
564 | cmp ah,bh ; compare X |
565 | jne .noX |
565 | jne .noX |
566 | mov ecx,1 |
566 | mov ecx,1 |
567 | sub bl,al |
567 | sub bl,al |
568 | ja .ok |
568 | ja .ok |
569 | inc ecx |
569 | inc ecx |
570 | .ok2: |
570 | .ok2: |
571 | neg bl |
571 | neg bl |
572 | jmp .ok |
572 | jmp .ok |
573 | .noX: |
573 | .noX: |
574 | cmp al,bl ; compare Y |
574 | cmp al,bl ; compare Y |
575 | jne .ex |
575 | jne .ex |
576 | inc ecx |
576 | inc ecx |
577 | sub bh,ah |
577 | sub bh,ah |
578 | mov bl,bh |
578 | mov bl,bh |
579 | jb .ok2 |
579 | jb .ok2 |
580 | add ecx,3 |
580 | add ecx,3 |
581 | .ok: |
581 | .ok: |
582 | movzx ebx,bl |
582 | movzx ebx,bl |
583 | .ex: |
583 | .ex: |
584 | mov eax,ecx |
584 | mov eax,ecx |
585 | pop edx ecx |
585 | pop edx ecx |
586 | ret |
586 | ret |
587 | 587 | ||
588 | show_help: |
588 | show_help: |
589 | mov ebp,[pack] |
589 | mov ebp,[pack] |
590 | .red: |
590 | .red: |
591 | mcall 12,1 |
591 | mcall 12,1 |
592 | mov ebx,[prc_info.x_start] |
592 | mov ebx,[prc_info.x_start] |
593 | add ebx,[prc_info.x_size] |
593 | add ebx,[prc_info.x_size] |
594 | shl ebx,16 |
594 | shl ebx,16 |
595 | add ebx,310 |
595 | add ebx,310 |
596 | mov ecx,[prc_info.y_start] |
596 | mov ecx,[prc_info.y_start] |
597 | shl ecx,16 |
597 | shl ecx,16 |
598 | add ecx,220 |
598 | add ecx,220 |
599 | mcall 0,,,0x03c0c0c0 |
599 | mcall 0,,,0x03c0c0c0 |
600 | mcall 4,<8,8>,0x00ffffff,help_hdr,help_hdr.size |
600 | mcall 4,<8,8>,0x00ffffff,help_hdr,help_hdr.size |
601 | mov ecx,ebp |
601 | mov ecx,ebp |
602 | mov edx,game_names+4 |
602 | mov edx,game_names+4 |
603 | call get_mstr |
603 | call get_mstr |
604 | sub esi,2 |
604 | sub esi,2 |
605 | mcall 4,<6*help_hdr.size+15,8>,0x00ffffff |
605 | mcall 4,<6*help_hdr.size+15,8>,0x00ffffff |
606 | 606 | ||
607 | mov edx,[help_msg+ebp*4] |
607 | mov edx,[help_msg+ebp*4] |
608 | add edx,4 |
608 | add edx,4 |
609 | xor ecx,ecx |
609 | xor ecx,ecx |
610 | mov ebx,10 shl 16+30 |
610 | mov ebx,10 shl 16+30 |
611 | .nxt: |
611 | .nxt: |
612 | mov esi,[edx-4] |
612 | mov esi,[edx-4] |
613 | jecxz .drw |
613 | jecxz .drw |
614 | dec ecx |
614 | dec ecx |
615 | lea edx,[edx+esi+4] |
615 | lea edx,[edx+esi+4] |
616 | jmp .nxt |
616 | jmp .nxt |
617 | .drw: |
617 | .drw: |
618 | cmp esi,-1 |
618 | cmp esi,-1 |
619 | je .edraw |
619 | je .edraw |
620 | mcall ,,0x000000ff |
620 | mcall ,,0x000000ff |
621 | mov ecx,1 |
621 | mov ecx,1 |
622 | add ebx,12 |
622 | add ebx,12 |
623 | jmp .nxt |
623 | jmp .nxt |
624 | .edraw: |
624 | .edraw: |
625 | mcall 12,2 |
625 | mcall 12,2 |
626 | .still: |
626 | .still: |
627 | mcall 10 |
627 | mcall 10 |
628 | cmp eax,2 |
628 | cmp eax,2 |
629 | jne .nokey |
629 | jne .nokey |
630 | mcall |
630 | mcall |
631 | jmp .close |
631 | jmp .close |
632 | .nokey: |
632 | .nokey: |
633 | cmp eax,1 ; redraw request ? |
633 | cmp eax,1 ; redraw request ? |
634 | je .red |
634 | je .red |
635 | cmp eax,3 ; button in buffer ? |
635 | cmp eax,3 ; button in buffer ? |
636 | jne .still |
636 | jne .still |
637 | mcall 17 |
637 | mcall 17 |
638 | cmp ah,1 |
638 | cmp ah,1 |
639 | jne .still |
639 | jne .still |
640 | .close: |
640 | .close: |
641 | and [child],0 |
641 | and [child],0 |
642 | mcall -1 |
642 | mcall -1 |
643 | 643 | ||
644 | getline: |
644 | getline: |
645 | ; in: esi,edi |
645 | ; in: esi,edi |
646 | pusha |
646 | pusha |
647 | mov eax,esi |
647 | mov eax,esi |
648 | call get_xy |
648 | call get_xy |
649 | mov ebx,[lx] |
649 | mov ebx,[lx] |
650 | mov ecx,[ly] |
650 | mov ecx,[ly] |
651 | mov eax,edi |
651 | mov eax,edi |
652 | call get_xy |
652 | call get_xy |
653 | mov bx,word[lx+2] |
653 | mov bx,word[lx+2] |
654 | mov cx,word[ly+2] |
654 | mov cx,word[ly+2] |
655 | mov eax,[Ces] |
655 | mov eax,[Ces] |
656 | shr eax,1 |
656 | shr eax,1 |
657 | sub eax,[sq_size] |
657 | sub eax,[sq_size] |
658 | add ebx,eax |
658 | add ebx,eax |
659 | add ecx,eax |
659 | add ecx,eax |
660 | shl eax,16 |
660 | shl eax,16 |
661 | add ebx,eax |
661 | add ebx,eax |
662 | add ecx,eax |
662 | add ecx,eax |
663 | mov [lx],ebx |
663 | mov [lx],ebx |
664 | mov [ly],ecx |
664 | mov [ly],ecx |
665 | mcall 38 |
665 | mcall 38 |
666 | popa |
666 | popa |
667 | ret |
667 | ret |
668 | 668 | ||
669 | bold_line: |
669 | bold_line: |
670 | WGSPC equ 1 |
670 | WGSPC equ 1 |
671 | pusha |
671 | pusha |
672 | mov edi,WGSPC shl 16+WGSPC |
672 | mov edi,WGSPC shl 16+WGSPC |
673 | add [lx],edi |
673 | add [lx],edi |
674 | add [ly],edi |
674 | add [ly],edi |
675 | mcall 38,[lx],[ly] |
675 | mcall 38,[lx],[ly] |
676 | shl edi,1 |
676 | shl edi,1 |
677 | sub ebx,edi |
677 | sub ebx,edi |
678 | sub ecx,edi |
678 | sub ecx,edi |
679 | mcall |
679 | mcall |
680 | popa |
680 | popa |
681 | ret |
681 | ret |
682 | 682 | ||
683 | get_rnd: |
683 | get_rnd: |
684 | mov eax, [generator] |
684 | mov eax, [generator] |
685 | sub eax,0x43ab45b5 ; next random number |
685 | sub eax,0x43ab45b5 ; next random number |
686 | ror eax,1 |
686 | ror eax,1 |
687 | xor eax,0x32c4324f |
687 | xor eax,0x32c4324f |
688 | ror eax,1 |
688 | ror eax,1 |
689 | mov [generator],eax |
689 | mov [generator],eax |
690 | ret |
690 | ret |
691 | 691 | ||
692 | drwfld: |
692 | drwfld: |
693 | pusha |
693 | pusha |
694 | mov ebx,[fx] |
694 | mov ebx,[fx] |
695 | imul ebx,[Ces] |
695 | imul ebx,[Ces] |
696 | add ebx,XFOFS shl 16 |
696 | add ebx,XFOFS shl 16 |
697 | mov ecx,[fy] |
697 | mov ecx,[fy] |
698 | imul ecx,[Ces] |
698 | imul ecx,[Ces] |
699 | add ecx,YFOFS shl 16 |
699 | add ecx,YFOFS shl 16 |
700 | mcall 13,,,WNDCOLOR |
700 | mcall 13,,,WNDCOLOR |
701 | add ebx,26 shl 16-26 |
701 | add ebx,26 shl 16-26 |
702 | sub ecx,16 shl 16 |
702 | sub ecx,16 shl 16 |
703 | mov cx,16 |
703 | mov cx,16 |
704 | mcall |
704 | mcall |
705 | icall draw_field |
705 | icall draw_field |
706 | icall draw_more |
706 | icall draw_more |
707 | cmp [win_flag],0 |
707 | cmp [win_flag],0 |
708 | jz .edraw |
708 | jz .edraw |
709 | movzx ecx,[win_flag] |
709 | movzx ecx,[win_flag] |
710 | mov edx,msgs+4 |
710 | mov edx,msgs+4 |
711 | call get_mstr |
711 | call get_mstr |
712 | mcall 4, |
712 | mcall 4, |
713 | .edraw: |
713 | .edraw: |
714 | popa |
714 | popa |
715 | ret |
715 | ret |
716 | 716 | ||
717 | resize: |
717 | resize: |
718 | mov eax,[Ces] |
718 | mov eax,[Ces] |
719 | mov edi,dir_ofs+4 |
719 | mov edi,dir_ofs+4 |
720 | stosd |
720 | stosd |
721 | stosd |
721 | stosd |
722 | stosw |
722 | stosw |
723 | stosw |
723 | stosw |
724 | mov [edi+4],eax |
724 | mov [edi+4],eax |
725 | ret |
725 | ret |
726 | 726 | ||
727 | need_image: |
727 | need_image: |
728 | ; in: eax - gif pointer |
728 | ; in: eax - gif pointer |
729 | cmp [gif_unp],0 |
729 | cmp [gif_unp],0 |
730 | jne .skip |
730 | jne .skip |
731 | push esi edi |
731 | push esi edi |
732 | mov esi,eax |
732 | mov esi,eax |
733 | mov eax,field |
733 | mov eax,field |
734 | mov edi,raw_area |
734 | mov edi,raw_area |
735 | call ReadGIF |
735 | call ReadGIF |
736 | mov [gif_unp],1 |
736 | mov [gif_unp],1 |
737 | pop edi esi |
737 | pop edi esi |
738 | .skip: |
738 | .skip: |
739 | ret |
739 | ret |
740 | 740 | ||
741 | out_image: |
741 | out_image: |
742 | ; in: eax - coord, ebx - image # |
742 | ; in: eax - coord, ebx - image # |
743 | 743 | ||
744 | STRIP2 = STRIP-2 |
744 | STRIP2 = STRIP-2 |
745 | pusha |
745 | pusha |
746 | call get_xy |
746 | call get_xy |
747 | mov edx,[lx] |
747 | mov edx,[lx] |
748 | mov dx,word[ly+2] |
748 | mov dx,word[ly+2] |
749 | add edx,1 shl 16+1 |
749 | add edx,1 shl 16+1 |
750 | imul ebx,STRIP2*STRIP2*3 |
750 | imul ebx,STRIP2*STRIP2*3 |
751 | add ebx,raw_area+12 |
751 | add ebx,raw_area+12 |
752 | mcall 7,,STRIP2 shl 16+STRIP2 |
752 | mcall 7,,STRIP2 shl 16+STRIP2 |
753 | popa |
753 | popa |
754 | ret |
754 | ret |
755 | 755 | ||
756 | OR_strip: |
756 | OR_strip: |
757 | ;file 'orient2.gif' |
757 | ;file 'orient2.gif' |
758 | file 'orientg2.gif' |
758 | file 'orientg2.gif' |
759 | rd 2 |
759 | rd 2 |
760 | gif_unp dd 0 |
760 | gif_unp dd 0 |
761 | 761 | ||
762 | ; DATA AREA |
762 | ; DATA AREA |
763 | help_hdr db 'MegaMaze Help -' |
763 | help_hdr db 'MegaMaze Help -' |
764 | .size=$-help_hdr |
764 | .size=$-help_hdr |
765 | 765 | ||
766 | dirs dd -1,0,0,1 |
766 | dirs dd -1,0,0,1 |
767 | dir_ofs dd 0, 1, 1, 1 shl 16+1, 0, 1 |
767 | dir_ofs dd 0, 1, 1, 1 shl 16+1, 0, 1 |
768 | 768 | ||
769 | dir_rotate db 2,0,3,1,1,3,0,2 |
769 | dir_rotate db 2,0,3,1,1,3,0,2 |
770 | 770 | ||
771 | w_colors dd 0x0404CA,0xCC0404,0x00CC00 |
771 | w_colors dd 0x0404CA,0xCC0404,0x00CC00 |
772 | f_colors dd 0x9494FC,0xFC9494,0x99FF99,0xFFFF00 |
772 | f_colors dd 0x9494FC,0xFC9494,0x99FF99,0xFFFF00 |
773 | 773 | ||
774 | levnum dd LEVNUM |
774 | levnum dd LEVNUM |
775 | 775 | ||
776 | prepare_level dd TM_levelp,SMZ_levelp,TILT_levelp,TILT2_levelp,FH_levelp,\ |
776 | prepare_level dd TM_levelp,SMZ_levelp,TILT_levelp,TILT2_levelp,FH_levelp,\ |
777 | LP_levelp,WG_levelp,BB_levelp,MAR_levelp,TM_levelp,OR_levelp,NLT_levelp,\ |
777 | LP_levelp,WG_levelp,BB_levelp,MAR_levelp,TM_levelp,OR_levelp,NLT_levelp,\ |
778 | CZ_levelp |
778 | CZ_levelp |
779 | key_handler dd TM_key,SMZ_key,TILT_key,TILT2_key,FH_key,LP_key,WG_key,BB_key,\ |
779 | key_handler dd TM_key,SMZ_key,TILT_key,TILT2_key,FH_key,LP_key,WG_key,BB_key,\ |
780 | MAR_key,CSTEP_key,OR_key,NLT_key,CZ_key |
780 | MAR_key,CSTEP_key,OR_key,NLT_key,CZ_key |
781 | draw_more dd TM_drawm,SMZ_drawm,TILT_drawm,TILT2_drawm,FH_drawm,LP_drawm,\ |
781 | draw_more dd TM_drawm,SMZ_drawm,TILT_drawm,TILT2_drawm,FH_drawm,LP_drawm,\ |
782 | WG_drawm,BB_drawm,MAR_drawm,CSTEP_drawm,OR_drawm,NLT_drawm,CZ_drawm |
782 | WG_drawm,BB_drawm,MAR_drawm,CSTEP_drawm,OR_drawm,NLT_drawm,CZ_drawm |
783 | draw_field dd maze_field,maze_field,maze_field,maze_field,grid_field,\ |
783 | draw_field dd maze_field,maze_field,maze_field,maze_field,grid_field,\ |
784 | grid_field,grid_field,grid_field,maze_field,maze_field,OR_drawf,maze_field,\ |
784 | grid_field,grid_field,grid_field,maze_field,maze_field,OR_drawf,maze_field,\ |
785 | grid_field |
785 | grid_field |
786 | levels dd TM_level,SMZ_level,TILT_level,TILT2_level,FH_level,LP_level,\ |
786 | levels dd TM_level,SMZ_level,TILT_level,TILT2_level,FH_level,LP_level,\ |
787 | WG_level,BB_level,MAR_level,CSTEP_level,OR_level,NLT_level,CZ_level |
787 | WG_level,BB_level,MAR_level,CSTEP_level,OR_level,NLT_level,CZ_level |
788 | help_msg dd TM_help,SMZ_help,TILT_help,TILT2_help,FH_help,LP_help,WG_help,\ |
788 | help_msg dd TM_help,SMZ_help,TILT_help,TILT2_help,FH_help,LP_help,WG_help,\ |
789 | BB_help,MAR_help,CSTEP_help,OR_help,NLT_help,CZ_help |
789 | BB_help,MAR_help,CSTEP_help,OR_help,NLT_help,CZ_help |
790 | 790 | ||
791 | if lang eq ru |
791 | if lang eq ru |
792 | header db 'Mega Maze' |
792 | header db 'Mega Maze' |
793 | else |
793 | else |
794 | header db 'Mega Maze' |
794 | header db 'Mega Maze' |
795 | end if |
795 | end if |
796 | .size = $ - header |
796 | .size = $ - header |
797 | 797 | ||
798 | next_msg db '< >' |
798 | next_msg db '< >' |
799 | 799 | ||
800 | game_names mstr \ |
800 | game_names mstr \ |
801 | 'Teseus & Minotaur #',\ |
801 | 'Teseus & Minotaur #',\ |
802 | '1-2-3 Maze #',\ |
802 | '1-2-3 Maze #',\ |
803 | 'Tilt Maze #',\ |
803 | 'Tilt Maze #',\ |
804 | 'Double Tilt #',\ |
804 | 'Double Tilt #',\ |
805 | 'Full-house #',\ |
805 | 'Full-house #',\ |
806 | 'Loops #',\ |
806 | 'Loops #',\ |
807 | 'Wriggle #',\ |
807 | 'Wriggle #',\ |
808 | 'BlackBox #',\ |
808 | 'BlackBox #',\ |
809 | 'Marble #',\ |
809 | 'Marble #',\ |
810 | 'Counter Step #',\ |
810 | 'Counter Step #',\ |
811 | 'Orientation #',\ |
811 | 'Orientation #',\ |
812 | 'No left turn #',\ |
812 | 'No left turn #',\ |
813 | 'Colour-zone #' |
813 | 'Colour-zone #' |
814 | 814 | ||
815 | msgs mstr ' ','You win!!!','Game over.','Start cell?','Dead end!',\ |
815 | msgs mstr ' ','You win!!!','Game over.','Start cell?','Dead end!',\ |
816 | " atoms hidden.",'Ray emerged.','Ray absorbed.','Ray reflected.',\ |
816 | " atoms hidden.",'Ray emerged.','Ray absorbed.','Ray reflected.',\ |
817 | 'Mark exactly guesses','Your score is','Guess mark toggled' |
817 | 'Mark exactly guesses','Your score is','Guess mark toggled' |
818 | 818 | ||
819 | I_END: |
819 | I_END: |
820 | main_pid dd ? |
820 | main_pid dd ? |
821 | child_stack rb 256 |
821 | child_stack rb 256 |
822 | chs_end: |
822 | chs_end: |
823 | drag_flag db ? |
823 | drag_flag db ? |
824 | sq_size dd ? |
824 | sq_size dd ? |
825 | mouse_processed dd ? |
825 | mouse_processed dd ? |
826 | mpress_flag dd ? |
826 | mpress_flag dd ? |
827 | mouse_x dd ? |
827 | mouse_x dd ? |
828 | mouse_y dd ? |
828 | mouse_y dd ? |
829 | 829 | ||
830 | Ces dd ? |
830 | Ces dd ? |
831 | pack dd ? |
831 | pack dd ? |
832 | fy dd ? |
832 | fy dd ? |
833 | fx dd ? |
833 | fx dd ? |
834 | lx dd ? |
834 | lx dd ? |
835 | ly dd ? |
835 | ly dd ? |
836 | generator dd ? |
836 | generator dd ? |
837 | cell_count dd ? |
837 | cell_count dd ? |
838 | levptr dd ? |
838 | levptr dd ? |
839 | levcount dd ? |
839 | levcount dd ? |
840 | 840 | ||
841 | score dd ? |
841 | score dd ? |
842 | player: |
842 | player: |
843 | teseus dd ? |
843 | teseus dd ? |
844 | finish: |
844 | finish: |
845 | minotaur dd ? |
845 | minotaur dd ? |
846 | 846 | ||
847 | stepptr dd ? |
847 | stepptr dd ? |
848 | cur_step dd ? |
848 | cur_step dd ? |
849 | 849 | ||
850 | win_flag db ? |
850 | win_flag db ? |
851 | jump dd ? |
851 | jump dd ? |
852 | pause_time dd ? |
852 | pause_time dd ? |
853 | child dd ? |
853 | child dd ? |
854 | area rb 1024 |
854 | area rb 1024 |
855 | stak rb 1024 |
855 | stak rb 1024 |
856 | stack_end: |
856 | stack_end: |
857 | prc_info process_information |
857 | prc_info process_information |
858 | prc_info2 process_information |
858 | prc_info2 process_information |
859 | field: |
859 | field: |
860 | rb 128*128 |
860 | rb 128*128 |
861 | raw_area: |
861 | raw_area: |
862 | rb STRIP*STRIP*12*3+16 |
862 | rb STRIP*STRIP*12*3+16 |
863 | end_mem:>6*help_hdr.size+15,8>8,8>40,12>25,12>8,8> |
863 | end_mem:>6*help_hdr.size+15,8>8,8>40,12>25,12>8,8> |