Rev 2494 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2494 | Rev 6249 | ||
---|---|---|---|
1 | ;--------------------------------------------------------------------- |
1 | ;--------------------------------------------------------------------- |
2 | ; Free3D version 0.6 |
2 | ; Free3D version 0.6 |
3 | ; |
3 | ; |
4 | ; last update: 21/02/2011 |
4 | ; last update: 21/02/2011 |
5 | ; written by: Marat Zakiyanov aka Mario79, aka Mario |
5 | ; written by: Marat Zakiyanov aka Mario79, aka Mario |
6 | ; changes: advanced control for mouse |
6 | ; changes: advanced control for mouse |
7 | ; advanced control for keyboard: |
7 | ; advanced control for keyboard: |
8 | ; W,A,S,D adn Arrow UP,Down,Left,Right |
8 | ; W,A,S,D adn Arrow UP,Down,Left,Right |
9 | ;--------------------------------------------------------------------- |
9 | ;--------------------------------------------------------------------- |
10 | ; Free3D version 0.5 |
10 | ; Free3D version 0.5 |
11 | ; |
11 | ; |
12 | ; last update: 20/02/2011 |
12 | ; last update: 20/02/2011 |
13 | ; written by: Marat Zakiyanov aka Mario79, aka Mario |
13 | ; written by: Marat Zakiyanov aka Mario79, aka Mario |
14 | ; changes: PNG textures 128x128 |
14 | ; changes: PNG textures 128x128 |
15 | ; using libraries cnv_png.obj and archiver.obj |
15 | ; using libraries cnv_png.obj and archiver.obj |
16 | ; using dinamically allocation of memory |
16 | ; using dinamically allocation of memory |
17 | ; |
17 | ; |
18 | ;--------------------------------------------------------------------- |
18 | ;--------------------------------------------------------------------- |
19 | ; |
19 | ; |
20 | ; Fisheye Raycasting Engine Etc. FREE3D for MENUETOS by Dieter Marfurt |
20 | ; Fisheye Raycasting Engine Etc. FREE3D for MENUETOS by Dieter Marfurt |
21 | ; Version 0.4 (requires some texture-files to compile (see Data Section)) |
21 | ; Version 0.4 (requires some texture-files to compile (see Data Section)) |
22 | ; dietermarfurt@angelfire.com - www.melog.ch/mos_pub/ |
22 | ; dietermarfurt@angelfire.com - www.melog.ch/mos_pub/ |
23 | ; Don't hit me - I'm an ASM-Newbie... since years :) |
23 | ; Don't hit me - I'm an ASM-Newbie... since years :) |
24 | ; |
24 | ; |
25 | ; Compile with FASM for Menuet (requires .INC files - see DATA Section) |
25 | ; Compile with FASM for Menuet (requires .INC files - see DATA Section) |
26 | ; |
26 | ; |
27 | ; Willow - greatly srinked code size by using GIF texture and FPU to calculate sine table |
27 | ; Willow - greatly srinked code size by using GIF texture and FPU to calculate sine table |
28 | ; |
28 | ; |
29 | ; !!!! Don't use GIF_LITE.INC in your apps - it's modified for FREE3D !!!! |
29 | ; !!!! Don't use GIF_LITE.INC in your apps - it's modified for FREE3D !!!! |
30 | ; |
30 | ; |
31 | ; Heavyiron - new 0-function of drawing window from kolibri (do not work correctly with menuet) |
31 | ; Heavyiron - new 0-function of drawing window from kolibri (do not work correctly with menuet) |
32 | 32 | ||
33 | TEX_SIZE equ 128*128*4 ;64*64*4 ; |
33 | TEX_SIZE equ 128*128*4 ;64*64*4 ; |
34 | 34 | ||
35 | ICON_SIZE_X equ 128 ;64 |
35 | ICON_SIZE_X equ 128 ;64 |
36 | ICON_SIZE_Y equ 128 ;64 |
36 | ICON_SIZE_Y equ 128 ;64 |
37 | 37 | ||
38 | Floors_Height equ 32000 |
38 | Floors_Height equ 32000 |
39 | ;--------------------------------------------------------------------- |
39 | ;--------------------------------------------------------------------- |
40 | use32 |
40 | use32 |
41 | org 0x0 |
41 | org 0x0 |
42 | db 'MENUET01' ; 8 byte id |
42 | db 'MENUET01' ; 8 byte id |
43 | dd 0x01 ; header version |
43 | dd 0x01 ; header version |
44 | dd START ; start of code |
44 | dd START ; start of code |
45 | dd IM_END ; size of image |
45 | dd IM_END ; size of image |
46 | dd I_END ; 0x100000 ; memory for app |
46 | dd I_END ; 0x100000 ; memory for app |
47 | dd stacktop ; 0x100000 ; esp |
47 | dd stacktop ; 0x100000 ; esp |
48 | dd 0x0 |
48 | dd 0x0 |
49 | dd path |
49 | dd path |
50 | ;--------------------------------------------------------------------- |
50 | ;--------------------------------------------------------------------- |
51 | include '../../../macros.inc' |
51 | include '../../../macros.inc' |
52 | ;include 'macros.inc' |
52 | ;include 'macros.inc' |
53 | include '../../../develop/libraries/box_lib/load_lib.mac' |
53 | include '../../../develop/libraries/box_lib/load_lib.mac' |
54 | ;include 'load_lib.mac' |
54 | ;include 'load_lib.mac' |
55 | @use_library |
55 | @use_library |
56 | ;--------------------------------------------------------------------- |
56 | ;--------------------------------------------------------------------- |
57 | START: ; start of execution |
57 | START: ; start of execution |
58 | mcall 68,11 |
58 | mcall 68,11 |
59 | mcall 66,1,1 |
59 | mcall 66,1,1 |
60 | mcall 40,0x27 |
60 | mcall 40,0x27 |
61 | 61 | ||
62 | mcall 9,procinfo,-1 |
62 | mcall 9,procinfo,-1 |
63 | mov ecx,[ebx+30] ; PID |
63 | mov ecx,[ebx+30] ; PID |
64 | mcall 18,21 |
64 | mcall 18,21 |
65 | mov [active_process],eax ; WINDOW SLOT |
65 | mov [active_process],eax ; WINDOW SLOT |
66 | 66 | ||
67 | load_libraries l_libs_start,end_l_libs |
67 | load_libraries l_libs_start,end_l_libs |
68 | test eax,eax |
68 | test eax,eax |
69 | jnz finish |
69 | jnz finish |
70 | 70 | ||
71 | ; unpack deflate |
71 | ; unpack deflate |
72 | mov eax,[unpack_DeflateUnpack2] |
72 | mov eax,[unpack_DeflateUnpack2] |
73 | mov [deflate_unpack],eax |
73 | mov [deflate_unpack],eax |
74 | 74 | ||
75 | call load_icons |
75 | call load_icons |
76 | call convert_icons |
76 | call convert_icons |
77 | 77 | ||
78 | mov esi,sinus |
78 | mov esi,sinus |
79 | mov ecx,360*10 |
79 | mov ecx,360*10 |
80 | fninit |
80 | fninit |
81 | fld [sindegree] |
81 | fld [sindegree] |
82 | ;-------------------------------------- |
82 | ;-------------------------------------- |
83 | .sinlp: |
83 | .sinlp: |
84 | fst st1 |
84 | fst st1 |
85 | fsin |
85 | fsin |
86 | fmul [sindiv] |
86 | fmul [sindiv] |
87 | fistp dword[esi] |
87 | fistp dword[esi] |
88 | add esi,4 |
88 | add esi,4 |
89 | fadd [sininc] |
89 | fadd [sininc] |
90 | loop .sinlp |
90 | loop .sinlp |
91 | ;--------------------------------------------------------------------- |
91 | ;--------------------------------------------------------------------- |
92 | call cursor_to_screen_center |
92 | call cursor_to_screen_center |
93 | call set_new_cursor_skin |
93 | call set_new_cursor_skin |
94 | ;--------------------------------------------------------------------- |
94 | ;--------------------------------------------------------------------- |
95 | align 4 |
95 | align 4 |
96 | red: ; redraw |
96 | red: ; redraw |
97 | call draw_window |
97 | call draw_window |
98 | call draw_stuff |
98 | call draw_stuff |
99 | ;--------------------------------------------------------------------- |
99 | ;--------------------------------------------------------------------- |
100 | align 4 |
100 | align 4 |
101 | still: |
101 | still: |
102 | mcall 10 ; ask no wait for full speed |
102 | mcall 10 ; ask no wait for full speed |
103 | 103 | ||
104 | cmp eax,1 ; window redraw request ? |
104 | cmp eax,1 ; window redraw request ? |
105 | je red |
105 | je red |
106 | 106 | ||
107 | cmp eax,2 ; key in buffer ? |
107 | cmp eax,2 ; key in buffer ? |
108 | je key |
108 | je key |
109 | 109 | ||
110 | cmp eax,3 ; button in buffer ? |
110 | cmp eax,3 ; button in buffer ? |
111 | je button |
111 | je button |
112 | 112 | ||
113 | cmp eax,6 |
113 | cmp eax,6 |
114 | jne still |
114 | jne still |
115 | ;--------------------------------------------------------------------- |
115 | ;--------------------------------------------------------------------- |
116 | mouse: |
116 | mouse: |
117 | mcall 18,7 |
117 | mcall 18,7 |
118 | cmp [active_process],eax |
118 | cmp [active_process],eax |
119 | jne still |
119 | jne still |
120 | 120 | ||
121 | mcall 37,1 |
121 | mcall 37,1 |
122 | 122 | ||
123 | xor ebx,ebx |
123 | xor ebx,ebx |
124 | mov bx,ax ; EBX mouse y |
124 | mov bx,ax ; EBX mouse y |
125 | shr eax,16 ; EAX mouse x |
125 | shr eax,16 ; EAX mouse x |
126 | 126 | ||
127 | mov ecx,[mouse_position_old] |
127 | mov ecx,[mouse_position_old] |
128 | xor edx,edx |
128 | xor edx,edx |
129 | mov dx,cx ; EDX mouse y old |
129 | mov dx,cx ; EDX mouse y old |
130 | shr ecx,16 ; ECX mouse x old |
130 | shr ecx,16 ; ECX mouse x old |
131 | 131 | ||
132 | cmp eax,ecx |
132 | cmp eax,ecx |
133 | je .y ;still |
133 | je .y ;still |
134 | ja .turn_left |
134 | ja .turn_left |
135 | ;--------------------------------------------------------------------- |
135 | ;--------------------------------------------------------------------- |
136 | .turn_right: |
136 | .turn_right: |
137 | xchg eax,ecx |
137 | xchg eax,ecx |
138 | sub eax,ecx |
138 | sub eax,ecx |
139 | mov edi,[vheading] |
139 | mov edi,[vheading] |
140 | add edi,eax |
140 | add edi,eax |
141 | jmp @f |
141 | jmp @f |
142 | ;--------------------------------------------------------------------- |
142 | ;--------------------------------------------------------------------- |
143 | .turn_left: |
143 | .turn_left: |
144 | sub eax,ecx |
144 | sub eax,ecx |
145 | mov edi,[vheading] |
145 | mov edi,[vheading] |
146 | sub edi,eax |
146 | sub edi,eax |
147 | ;-------------------------------------- |
147 | ;-------------------------------------- |
148 | @@: |
148 | @@: |
149 | call check_range |
149 | call check_range |
150 | ;--------------------------------------------------------------------- |
150 | ;--------------------------------------------------------------------- |
151 | .y: |
151 | .y: |
152 | cmp ebx,edx |
152 | cmp ebx,edx |
153 | je .red |
153 | je .red |
154 | ja .walk_down |
154 | ja .walk_down |
155 | ;-------------------------------------- |
155 | ;-------------------------------------- |
156 | .walk_up: |
156 | .walk_up: |
157 | sub edx,ebx |
157 | sub edx,ebx |
158 | mov ecx,edx |
158 | mov ecx,edx |
159 | call prepare_2 |
159 | call prepare_2 |
160 | jz .1 |
160 | jz .1 |
161 | ;-------------------------------------- |
161 | ;-------------------------------------- |
162 | add eax,edi ; newPx |
162 | add eax,edi ; newPx |
163 | add ebx,esi ; newPy |
163 | add ebx,esi ; newPy |
164 | jmp .1 |
164 | jmp .1 |
165 | ;--------------------------------------------------------------------- |
165 | ;--------------------------------------------------------------------- |
166 | .walk_down: |
166 | .walk_down: |
167 | sub ebx,edx |
167 | sub ebx,edx |
168 | mov ecx,ebx |
168 | mov ecx,ebx |
169 | call prepare_2 |
169 | call prepare_2 |
170 | jz .1 |
170 | jz .1 |
171 | 171 | ||
172 | sub eax,edi ; newPx |
172 | sub eax,edi ; newPx |
173 | sub ebx,esi ; newPy |
173 | sub ebx,esi ; newPy |
174 | ;-------------------------------------- |
174 | ;-------------------------------------- |
175 | .1: |
175 | .1: |
176 | mov edi,eax ; newPx / ffff |
176 | mov edi,eax ; newPx / ffff |
177 | mov esi,ebx ; newPy / ffff |
177 | mov esi,ebx ; newPy / ffff |
178 | sar edi,16 |
178 | sar edi,16 |
179 | sar esi,16 |
179 | sar esi,16 |
180 | mov ecx,esi |
180 | mov ecx,esi |
181 | sal ecx,5 |
181 | sal ecx,5 |
182 | lea ecx,[grid+ecx+edi] |
182 | lea ecx,[grid+ecx+edi] |
183 | cmp [ecx],byte 0 |
183 | cmp [ecx],byte 0 |
184 | je @f |
184 | je @f |
185 | 185 | ||
186 | call cursor_to_screen_center |
186 | call cursor_to_screen_center |
187 | jmp still ;cannotwalk |
187 | jmp still ;cannotwalk |
188 | ;--------------------------------------------------------------------- |
188 | ;--------------------------------------------------------------------- |
189 | @@: |
189 | @@: |
190 | mov [vpx],eax |
190 | mov [vpx],eax |
191 | mov [vpy],ebx |
191 | mov [vpy],ebx |
192 | ;-------------------------------------- |
192 | ;-------------------------------------- |
193 | .red: |
193 | .red: |
194 | call cursor_to_screen_center |
194 | call cursor_to_screen_center |
195 | jmp red |
195 | jmp red |
196 | ;--------------------------------------------------------------------- |
196 | ;--------------------------------------------------------------------- |
197 | align 4 |
197 | align 4 |
198 | prepare_2: |
198 | prepare_2: |
199 | shr ecx,4 |
199 | shr ecx,4 |
200 | push ecx |
200 | push ecx |
201 | call prepare_1 |
201 | call prepare_1 |
202 | pop ecx |
202 | pop ecx |
203 | cmp ecx,3 |
203 | cmp ecx,3 |
204 | jb @f |
204 | jb @f |
205 | mov ecx,3 |
205 | mov ecx,3 |
206 | @@: |
206 | @@: |
207 | shl edi,cl |
207 | shl edi,cl |
208 | shl esi,cl |
208 | shl esi,cl |
209 | test ecx,ecx |
209 | test ecx,ecx |
210 | ret |
210 | ret |
211 | ;--------------------------------------------------------------------- |
211 | ;--------------------------------------------------------------------- |
212 | align 4 |
212 | align 4 |
213 | check_range: |
213 | check_range: |
214 | cmp edi,0 |
214 | cmp edi,0 |
215 | jge @f |
215 | jge @f |
216 | 216 | ||
217 | mov edi,3600 |
217 | mov edi,3600 |
218 | jmp .store |
218 | jmp .store |
219 | ;-------------------------------------- |
219 | ;-------------------------------------- |
220 | @@: |
220 | @@: |
221 | cmp edi,3600 |
221 | cmp edi,3600 |
222 | jle @f |
222 | jle @f |
223 | 223 | ||
224 | xor edi,edi |
224 | xor edi,edi |
225 | ;-------------------------------------- |
225 | ;-------------------------------------- |
226 | @@: |
226 | @@: |
227 | .store: |
227 | .store: |
228 | mov [vheading],edi |
228 | mov [vheading],edi |
229 | ret |
229 | ret |
230 | ;--------------------------------------------------------------------- |
230 | ;--------------------------------------------------------------------- |
231 | align 4 |
231 | align 4 |
232 | cursor_to_screen_center: |
232 | cursor_to_screen_center: |
233 | mcall 18,15 |
233 | mcall 18,15 |
234 | mcall 37,1 |
234 | mcall 37,1 |
235 | mov [mouse_position_old],eax |
235 | mov [mouse_position_old],eax |
236 | ret |
236 | ret |
237 | ;--------------------------------------------------------------------- |
237 | ;--------------------------------------------------------------------- |
238 | set_new_cursor_skin: |
238 | set_new_cursor_skin: |
239 | mcall 68,12,32*32*4 |
239 | mcall 68,12,32*32*4 |
240 | mov ecx,eax |
240 | mov ecx,eax |
241 | mcall 37,4,,2 |
241 | mcall 37,4,,2 |
242 | mov ecx,eax |
242 | mov ecx,eax |
243 | mcall 37,5 |
243 | mcall 37,5 |
244 | ret |
244 | ret |
245 | ;--------------------------------------------------------------------- |
245 | ;--------------------------------------------------------------------- |
246 | align 4 |
246 | align 4 |
247 | key: ; key |
247 | key: ; key |
248 | mcall 2 |
248 | mcall 2 |
249 | cmp [extended_key],1 |
249 | cmp [extended_key],1 |
250 | je .extended_key |
250 | je .extended_key |
251 | test al, al |
251 | test al, al |
252 | jnz still |
252 | jnz still |
253 | 253 | ||
254 | cmp ah, 0xE0 |
254 | cmp ah, 0xE0 |
255 | jne @f |
255 | jne @f |
256 | 256 | ||
257 | mov [extended_key],1 |
257 | mov [extended_key],1 |
258 | jmp still |
258 | jmp still |
259 | ;--------------------------------------------------------------------- |
259 | ;--------------------------------------------------------------------- |
260 | @@: |
260 | @@: |
261 | cmp ah,1 ; Esc |
261 | cmp ah,1 ; Esc |
262 | je finish |
262 | je finish |
263 | 263 | ||
264 | cmp ah,17 ; W up |
264 | cmp ah,17 ; W up |
265 | je s_up |
265 | je s_up |
266 | 266 | ||
267 | cmp ah,31 ; S down |
267 | cmp ah,31 ; S down |
268 | je s_down |
268 | je s_down |
269 | 269 | ||
270 | cmp ah,30 ; A left |
270 | cmp ah,30 ; A left |
271 | je w_left ;s_left |
271 | je w_left ;s_left |
272 | 272 | ||
273 | cmp ah,32 ; D right |
273 | cmp ah,32 ; D right |
274 | je w_right ;s_right |
274 | je w_right ;s_right |
275 | 275 | ||
276 | jmp still |
276 | jmp still |
277 | ;--------------------------------------------------------------------- |
277 | ;--------------------------------------------------------------------- |
278 | .extended_key: |
278 | .extended_key: |
279 | mov [extended_key],0 |
279 | mov [extended_key],0 |
280 | mov [current_key_code],ah |
280 | mov [current_key_code],ah |
281 | 281 | ||
282 | cmp ah,27 ; esc=End App |
282 | cmp ah,27 ; esc=End App |
283 | je finish |
283 | je finish |
284 | 284 | ||
285 | cmp ah,72 ; up arrow |
285 | cmp ah,72 ; up arrow |
286 | je s_up |
286 | je s_up |
287 | 287 | ||
288 | cmp ah,80 ; down arrow |
288 | cmp ah,80 ; down arrow |
289 | je s_down |
289 | je s_down |
290 | 290 | ||
291 | cmp ah,75 ; left arrow |
291 | cmp ah,75 ; left arrow |
292 | je s_left |
292 | je s_left |
293 | 293 | ||
294 | cmp ah,77 ; right arrow |
294 | cmp ah,77 ; right arrow |
295 | je s_right |
295 | je s_right |
296 | 296 | ||
297 | jmp still |
297 | jmp still |
298 | ;--------------------------------------------------------------------- |
298 | ;--------------------------------------------------------------------- |
299 | align 4 |
299 | align 4 |
300 | smart_clr_key_buf: |
300 | smart_clr_key_buf: |
301 | mov al,[old_key_code] |
301 | mov al,[old_key_code] |
302 | mov ah,[current_key_code] |
302 | mov ah,[current_key_code] |
303 | mov [old_key_code],ah |
303 | mov [old_key_code],ah |
304 | cmp al,ah |
304 | cmp al,ah |
305 | jne .end |
305 | jne .end |
306 | ;-------------------------------------- |
306 | ;-------------------------------------- |
307 | .still: |
307 | .still: |
308 | mcall 2 |
308 | mcall 2 |
309 | cmp [extended_key],1 |
309 | cmp [extended_key],1 |
310 | je .extended_key |
310 | je .extended_key |
311 | 311 | ||
312 | test al, al |
312 | test al, al |
313 | jnz .end |
313 | jnz .end |
314 | 314 | ||
315 | cmp ah, 0xE0 |
315 | cmp ah, 0xE0 |
316 | jne .end |
316 | jne .end |
317 | 317 | ||
318 | mov [extended_key],1 |
318 | mov [extended_key],1 |
319 | jmp .still |
319 | jmp .still |
320 | .end: |
320 | .end: |
321 | call draw_stuff |
321 | call draw_stuff |
322 | jmp still |
322 | jmp still |
323 | ;--------------------------------------------------------------------- |
323 | ;--------------------------------------------------------------------- |
324 | .extended_key: |
324 | .extended_key: |
325 | mov [extended_key],0 |
325 | mov [extended_key],0 |
326 | mov [current_key_code],ah |
326 | mov [current_key_code],ah |
327 | jmp smart_clr_key_buf |
327 | jmp smart_clr_key_buf |
328 | ;--------------------------------------------------------------------- |
328 | ;--------------------------------------------------------------------- |
329 | align 4 |
329 | align 4 |
330 | w_left: ; walk left |
330 | w_left: ; walk left |
331 | call prepare_1 |
331 | call prepare_1 |
332 | add eax,esi ; newPx |
332 | add eax,esi ; newPx |
333 | sub ebx,edi ; newPy |
333 | sub ebx,edi ; newPy |
334 | jmp s_down.1 |
334 | jmp s_down.1 |
335 | ;--------------------------------------------------------------------- |
335 | ;--------------------------------------------------------------------- |
336 | align 4 |
336 | align 4 |
337 | w_right: ; walk right |
337 | w_right: ; walk right |
338 | call prepare_1 |
338 | call prepare_1 |
339 | sub eax,esi ; newPx |
339 | sub eax,esi ; newPx |
340 | add ebx,edi ; newPy |
340 | add ebx,edi ; newPy |
341 | jmp s_down.1 |
341 | jmp s_down.1 |
342 | ;--------------------------------------------------------------------- |
342 | ;--------------------------------------------------------------------- |
343 | align 4 |
343 | align 4 |
344 | s_up: ; walk forward (key or mouse) |
344 | s_up: ; walk forward (key or mouse) |
345 | call prepare_1 |
345 | call prepare_1 |
346 | ; sal esi,1 ; edit walking speed here |
346 | ; sal esi,1 ; edit walking speed here |
347 | ; sal edi,1 |
347 | ; sal edi,1 |
348 | add eax,edi ; newPx |
348 | add eax,edi ; newPx |
349 | add ebx,esi ; newPy |
349 | add ebx,esi ; newPy |
350 | jmp s_down.1 |
350 | jmp s_down.1 |
351 | ;--------------------------------------------------------------------- |
351 | ;--------------------------------------------------------------------- |
352 | align 4 |
352 | align 4 |
353 | s_down: ; walk backward |
353 | s_down: ; walk backward |
354 | call prepare_1 |
354 | call prepare_1 |
355 | ; sal esi,1 ; edit walking speed here |
355 | ; sal esi,1 ; edit walking speed here |
356 | ; sal edi,1 |
356 | ; sal edi,1 |
357 | sub eax,edi ; newPx |
357 | sub eax,edi ; newPx |
358 | sub ebx,esi ; newPy |
358 | sub ebx,esi ; newPy |
359 | .1: |
359 | .1: |
360 | mov edi,eax ; newPx / ffff |
360 | mov edi,eax ; newPx / ffff |
361 | mov esi,ebx ; newPy / ffff |
361 | mov esi,ebx ; newPy / ffff |
362 | sar edi,16 |
362 | sar edi,16 |
363 | sar esi,16 |
363 | sar esi,16 |
364 | mov ecx,esi |
364 | mov ecx,esi |
365 | sal ecx,5 |
365 | sal ecx,5 |
366 | lea ecx,[grid+ecx+edi] |
366 | lea ecx,[grid+ecx+edi] |
367 | cmp [ecx],byte 0 |
367 | cmp [ecx],byte 0 |
368 | jne smart_clr_key_buf ;cannotwalk |
368 | jne smart_clr_key_buf ;cannotwalk |
369 | 369 | ||
370 | mov [vpx],eax |
370 | mov [vpx],eax |
371 | mov [vpy],ebx |
371 | mov [vpy],ebx |
372 | jmp smart_clr_key_buf |
372 | jmp smart_clr_key_buf |
373 | ;--------------------------------------------------------------------- |
373 | ;--------------------------------------------------------------------- |
374 | align 4 |
374 | align 4 |
375 | prepare_1: |
375 | prepare_1: |
376 | mov eax,[vpx] |
376 | mov eax,[vpx] |
377 | mov ebx,[vpy] |
377 | mov ebx,[vpy] |
378 | mov ecx,[vheading] |
378 | mov ecx,[vheading] |
379 | mov edx,ecx |
379 | mov edx,ecx |
380 | mov edi,[sinus+ecx*4] |
380 | mov edi,[sinus+ecx*4] |
381 | lea edx,[sinus+3600+edx*4] |
381 | lea edx,[sinus+3600+edx*4] |
382 | cmp edx,eosinus ; cosinus taken from (sinus plus 900) mod 3600 |
382 | cmp edx,eosinus ; cosinus taken from (sinus plus 900) mod 3600 |
383 | jb @f |
383 | jb @f |
384 | 384 | ||
385 | sub edx,14400 |
385 | sub edx,14400 |
386 | ;-------------------------------------- |
386 | ;-------------------------------------- |
387 | @@: |
387 | @@: |
388 | mov esi,[edx] |
388 | mov esi,[edx] |
389 | ret |
389 | ret |
390 | ;--------------------------------------------------------------------- |
390 | ;--------------------------------------------------------------------- |
391 | align 4 |
391 | align 4 |
392 | s_left: ; turn left (key) |
392 | s_left: ; turn left (key) |
393 | mov edi,[vheading] |
393 | mov edi,[vheading] |
394 | add edi,50 |
394 | add edi,50 |
395 | jmp s_right.1 |
395 | jmp s_right.1 |
396 | ;--------------------------------------------------------------------- |
396 | ;--------------------------------------------------------------------- |
397 | align 4 |
397 | align 4 |
398 | s_right: ; turn right |
398 | s_right: ; turn right |
399 | mov edi,[vheading] |
399 | mov edi,[vheading] |
400 | sub edi,50 |
400 | sub edi,50 |
401 | .1: |
401 | .1: |
402 | call check_range |
402 | call check_range |
403 | jmp smart_clr_key_buf |
403 | jmp smart_clr_key_buf |
404 | ;--------------------------------------------------------------------- |
404 | ;--------------------------------------------------------------------- |
405 | align 4 |
405 | align 4 |
406 | button: ; button |
406 | button: ; button |
407 | mcall 17 |
407 | mcall 17 |
408 | cmp ah,1 ; button id=1 ? |
408 | cmp ah,1 ; button id=1 ? |
409 | jne still ;gamestart |
409 | jne still ;gamestart |
410 | ;-------------------------------------- |
410 | ;-------------------------------------- |
411 | finish: |
411 | finish: |
412 | mcall -1 ; close this program |
412 | mcall -1 ; close this program |
413 | ;--------------------------------------------------------------------- |
413 | ;--------------------------------------------------------------------- |
414 | ; ********************************************* |
414 | ; ********************************************* |
415 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
415 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
416 | ; ********************************************* |
416 | ; ********************************************* |
417 | align 4 |
417 | align 4 |
418 | draw_window: |
418 | draw_window: |
419 | mcall 12,1 |
419 | mcall 12,1 |
420 | - | ||
421 | mcall 48, 4 |
- | |
422 | lea ecx, [50*65536+484+eax]; [y start] *65536 + [y size] + [skin_height] |
420 | |
423 | mcall 0,<50,649>,,0x34,,title |
421 | mcall 0,<50,649>,<50,484>,0x01000000,0x01000000,0x01000000 |
424 | 422 | ||
425 | mcall 12,2 |
423 | mcall 12,2 |
426 | ret |
424 | ret |
427 | ;--------------------------------------------------------------------- |
425 | ;--------------------------------------------------------------------- |
428 | ; ********************************************* |
426 | ; ********************************************* |
429 | ; ******* COMPUTE 3D-VIEW ******** |
427 | ; ******* COMPUTE 3D-VIEW ******** |
430 | ; ********************************************* |
428 | ; ********************************************* |
431 | align 4 |
429 | align 4 |
432 | draw_stuff: |
430 | draw_stuff: |
433 | mov [step1],dword 1 |
431 | mov [step1],dword 1 |
434 | ; mov [step64],dword 64 |
432 | ; mov [step64],dword 64 |
435 | mov esi,[vheading] |
433 | mov esi,[vheading] |
436 | add esi,320 |
434 | add esi,320 |
437 | mov [va],esi |
435 | mov [va],esi |
438 | mov eax,[vheading] |
436 | mov eax,[vheading] |
439 | sub eax,320 |
437 | sub eax,320 |
440 | mov [vacompare],eax |
438 | mov [vacompare],eax |
441 | ;------------------------------------ CAST 640 PIXEL COLUMNS --------------- |
439 | ;------------------------------------ CAST 640 PIXEL COLUMNS --------------- |
442 | ; FOR A=320+heading to -319+heading step -1 (a is stored in [va]) |
440 | ; FOR A=320+heading to -319+heading step -1 (a is stored in [va]) |
443 | ;--------------------------------------------------------------------------- |
441 | ;--------------------------------------------------------------------------- |
444 | ; mov edx,5 |
442 | ; mov edx,5 |
445 | mov [vx1],dword 0 ;5 ;edx ; init x1 ... pixelcolumn |
443 | mov [vx1],dword 0 ;5 ;edx ; init x1 ... pixelcolumn |
446 | ;-------------------------------------- |
444 | ;-------------------------------------- |
447 | align 4 |
445 | align 4 |
448 | for_a: |
446 | for_a: |
449 | mov edx,[vx1] |
447 | mov edx,[vx1] |
450 | mov [vx1b],edx |
448 | mov [vx1b],edx |
451 | sub [vx1b],dword 320 |
449 | sub [vx1b],dword 320 |
452 | mov edx,[va] ; a2 |
450 | mov edx,[va] ; a2 |
453 | cmp edx,-1 ; a2 is a mod 3600 |
451 | cmp edx,-1 ; a2 is a mod 3600 |
454 | jg ok1 |
452 | jg ok1 |
455 | 453 | ||
456 | add edx,3600 |
454 | add edx,3600 |
457 | ;-------------------------------------- |
455 | ;-------------------------------------- |
458 | ok1: |
456 | ok1: |
459 | cmp edx,3600 |
457 | cmp edx,3600 |
460 | jb ok2 |
458 | jb ok2 |
461 | 459 | ||
462 | sub edx,3600 |
460 | sub edx,3600 |
463 | ;-------------------------------------- |
461 | ;-------------------------------------- |
464 | ok2: |
462 | ok2: |
465 | ; get stepx and stepy |
463 | ; get stepx and stepy |
466 | ; pointer to stepx |
464 | ; pointer to stepx |
467 | lea ecx,[sinus+edx*4] |
465 | lea ecx,[sinus+edx*4] |
468 | mov esi,[ecx] |
466 | mov esi,[ecx] |
469 | sar esi,4 ; accuracy |
467 | sar esi,4 ; accuracy |
470 | mov [vstepx],esi ; store stepx |
468 | mov [vstepx],esi ; store stepx |
471 | lea esi,[sinus+3600+edx*4] |
469 | lea esi,[sinus+3600+edx*4] |
472 | cmp esi,eosinus ;cosinus taken from ((sinus plus 900) mod 3600) |
470 | cmp esi,eosinus ;cosinus taken from ((sinus plus 900) mod 3600) |
473 | jb ok202 |
471 | jb ok202 |
474 | 472 | ||
475 | sub esi,14400 |
473 | sub esi,14400 |
476 | ;-------------------------------------- |
474 | ;-------------------------------------- |
477 | ok202: |
475 | ok202: |
478 | mov ecx,[esi] |
476 | mov ecx,[esi] |
479 | sar ecx,4 |
477 | sar ecx,4 |
480 | mov [vstepy],ecx ; store stepy |
478 | mov [vstepy],ecx ; store stepy |
481 | 479 | ||
482 | mov eax,[vpx] ; get Camera Position |
480 | mov eax,[vpx] ; get Camera Position |
483 | mov ebx,[vpy] |
481 | mov ebx,[vpy] |
484 | mov [vxx],eax ; init caster position |
482 | mov [vxx],eax ; init caster position |
485 | mov [vyy],ebx |
483 | mov [vyy],ebx |
486 | 484 | ||
487 | mov edi,0 ; init L (number of raycsting-steps) |
485 | mov edi,0 ; init L (number of raycsting-steps) |
488 | mov [step1],dword 1 ; init Caster stepwidth for L. |
486 | mov [step1],dword 1 ; init Caster stepwidth for L. |
489 | ;-------------------------------------- |
487 | ;-------------------------------------- |
490 | ; raycast a pixel column |
488 | ; raycast a pixel column |
491 | align 4 |
489 | align 4 |
492 | raycast: |
490 | raycast: |
493 | add edi,[step1] ; count caster steps |
491 | add edi,[step1] ; count caster steps |
494 | jmp nodouble ; use this to prevent blinking/wobbling textures: much slower! |
492 | jmp nodouble ; use this to prevent blinking/wobbling textures: much slower! |
495 | 493 | ||
496 | ; cmp edi,32 |
494 | ; cmp edi,32 |
497 | ; je double |
495 | ; je double |
498 | 496 | ||
499 | ; cmp edi,512 |
497 | ; cmp edi,512 |
500 | ; je double |
498 | ; je double |
501 | 499 | ||
502 | ; cmp edi,1024 |
500 | ; cmp edi,1024 |
503 | ; je double |
501 | ; je double |
504 | 502 | ||
505 | ; jmp nodouble |
503 | ; jmp nodouble |
506 | ;--------------------------------------------------------------------- |
504 | ;--------------------------------------------------------------------- |
507 | ;double: |
505 | ;double: |
508 | ; mov edx,[step1] |
506 | ; mov edx,[step1] |
509 | ; sal edx,1 |
507 | ; sal edx,1 |
510 | ; mov [step1],edx |
508 | ; mov [step1],edx |
511 | 509 | ||
512 | ; mov edx,[vstepx] |
510 | ; mov edx,[vstepx] |
513 | ; sal edx,1 |
511 | ; sal edx,1 |
514 | ; mov [vstepx],edx |
512 | ; mov [vstepx],edx |
515 | 513 | ||
516 | ; mov edx,[vstepy] |
514 | ; mov edx,[vstepy] |
517 | ; sal edx,1 |
515 | ; sal edx,1 |
518 | ; mov [vstepy],edx |
516 | ; mov [vstepy],edx |
519 | ;-------------------------------------- |
517 | ;-------------------------------------- |
520 | nodouble: |
518 | nodouble: |
521 | mov eax,Floors_Height ;32000 ; 3600 ; determine Floors Height based on distance |
519 | mov eax,Floors_Height ;32000 ; 3600 ; determine Floors Height based on distance |
522 | xor edx,edx |
520 | xor edx,edx |
523 | mov ebx,edi |
521 | mov ebx,edi |
524 | 522 | ||
525 | div ebx |
523 | div ebx |
526 | 524 | ||
527 | shl edx,1 |
525 | shl edx,1 |
528 | cmp ebx,edx |
526 | cmp ebx,edx |
529 | jae @f |
527 | jae @f |
530 | inc eax |
528 | inc eax |
531 | @@: |
529 | @@: |
532 | 530 | ||
533 | mov esi,eax |
531 | mov esi,eax |
534 | mov [vdd],esi |
532 | mov [vdd],esi |
535 | mov edx,260 |
533 | mov edx,260 |
536 | sub edx,esi |
534 | sub edx,esi |
537 | mov [vh],edx |
535 | mov [vh],edx |
538 | 536 | ||
539 | cmp edx,22 |
537 | cmp edx,22 |
540 | jb no_nu_pixel |
538 | jb no_nu_pixel |
541 | 539 | ||
542 | cmp edx,259 |
540 | cmp edx,259 |
543 | jg no_nu_pixel ; draw only new pixels |
541 | jg no_nu_pixel ; draw only new pixels |
544 | 542 | ||
545 | cmp edx,[h_old] |
543 | cmp edx,[h_old] |
546 | je no_nu_pixel |
544 | je no_nu_pixel |
547 | 545 | ||
548 | mov eax,[vxx] ; calc floor pixel |
546 | mov eax,[vxx] ; calc floor pixel |
549 | mov ebx,[vyy] |
547 | mov ebx,[vyy] |
550 | 548 | ||
551 | and eax,0x0000FFFF |
549 | and eax,0x0000FFFF |
552 | and ebx,0x0000FFFF |
550 | and ebx,0x0000FFFF |
553 | 551 | ||
554 | shr eax,10 |
552 | shr eax,10 |
555 | shr ebx,10 ; pixel coords inside Texture x,y 64*64 |
553 | shr ebx,10 ; pixel coords inside Texture x,y 64*64 |
556 | mov [xfrac],eax |
554 | mov [xfrac],eax |
557 | mov [yfrac],ebx |
555 | mov [yfrac],ebx |
558 | ; plot floor pixel !!!! |
556 | ; plot floor pixel !!!! |
559 | mov [vl],edi ; save L |
557 | mov [vl],edi ; save L |
560 | mov [ytemp],esi ; remember L bzw. H |
558 | mov [ytemp],esi ; remember L bzw. H |
561 | 559 | ||
562 | mov edi,[yfrac] ; get pixel color of this floor pixel |
560 | mov edi,[yfrac] ; get pixel color of this floor pixel |
563 | sal edi,9 ;8 - for 64x64 |
561 | sal edi,9 ;8 - for 64x64 |
564 | mov esi,[xfrac] |
562 | mov esi,[xfrac] |
565 | sal esi,3 ;2 - for 64x64 |
563 | sal esi,3 ;2 - for 64x64 |
566 | ; in fact its floor, just using the wall texture :) |
564 | ; in fact its floor, just using the wall texture :) |
567 | ; lea edi,[wall+edi+esi] |
565 | ; lea edi,[wall+edi+esi] |
568 | add edi,[wall1] |
566 | add edi,[wall1] |
569 | add edi,esi |
567 | add edi,esi |
570 | mov edx,[edi] |
568 | mov edx,[edi] |
571 | mov [remesi],esi |
569 | mov [remesi],esi |
572 | ;**** calculate pixel adress:**** |
570 | ;**** calculate pixel adress:**** |
573 | mov esi,[ytemp] |
571 | mov esi,[ytemp] |
574 | add esi,240 |
572 | add esi,240 |
575 | imul esi,1920 |
573 | imul esi,1920 |
576 | mov eax,[vx1] |
574 | mov eax,[vx1] |
577 | lea eax,[eax+eax*2] |
575 | lea eax,[eax+eax*2] |
578 | lea esi,[screen_buffer+eax+esi] |
576 | lea esi,[screen_buffer+eax+esi] |
579 | 577 | ||
580 | cmp esi,screen_buffer+1920*480 |
578 | cmp esi,screen_buffer+1920*480 |
581 | jg foff0 |
579 | jg foff0 |
582 | 580 | ||
583 | cmp esi,screen_buffer |
581 | cmp esi,screen_buffer |
584 | jb foff0 |
582 | jb foff0 |
585 | ; now we have the adress of the floor-pixel color in edi |
583 | ; now we have the adress of the floor-pixel color in edi |
586 | ; and the adress of the pixel in the image in esi |
584 | ; and the adress of the pixel in the image in esi |
587 | mov edx,[edi] |
585 | mov edx,[edi] |
588 | ;******************** custom distance DARKEN Floor |
586 | ;******************** custom distance DARKEN Floor |
589 | mov eax,[vdd] |
587 | mov eax,[vdd] |
590 | ; jmp nodark0 ; use this to deactivate darkening floor (a bit faster) |
588 | ; jmp nodark0 ; use this to deactivate darkening floor (a bit faster) |
591 | 589 | ||
592 | cmp eax,80 |
590 | cmp eax,80 |
593 | jg nodark0 |
591 | jg nodark0 |
594 | ; split rgb |
592 | ; split rgb |
595 | mov [blue_color],edx |
593 | mov [blue_color],edx |
596 | and [blue_color],dword 255 |
594 | and [blue_color],dword 255 |
597 | 595 | ||
598 | shr edx,8 |
596 | shr edx,8 |
599 | mov [green_color],edx |
597 | mov [green_color],edx |
600 | and [green_color],dword 255 |
598 | and [green_color],dword 255 |
601 | 599 | ||
602 | shr edx,8 |
600 | shr edx,8 |
603 | mov [red_color],edx |
601 | mov [red_color],edx |
604 | and [red_color],dword 255 |
602 | and [red_color],dword 255 |
605 | 603 | ||
606 | mov eax,81 ; darkness parameter |
604 | mov eax,81 ; darkness parameter |
607 | sub eax,[vdd] |
605 | sub eax,[vdd] |
608 | sal eax,1 |
606 | sal eax,1 |
609 | ; reduce rgb |
607 | ; reduce rgb |
610 | sub [red_color],eax |
608 | sub [red_color],eax |
611 | cmp [red_color],dword 0 |
609 | cmp [red_color],dword 0 |
612 | jg notblack10 |
610 | jg notblack10 |
613 | 611 | ||
614 | mov [red_color],dword 0 |
612 | mov [red_color],dword 0 |
615 | ;-------------------------------------- |
613 | ;-------------------------------------- |
616 | notblack10: |
614 | notblack10: |
617 | sub [green_color],eax |
615 | sub [green_color],eax |
618 | cmp [green_color],dword 0 |
616 | cmp [green_color],dword 0 |
619 | jg notblack20 |
617 | jg notblack20 |
620 | 618 | ||
621 | mov [green_color],dword 0 |
619 | mov [green_color],dword 0 |
622 | ;-------------------------------------- |
620 | ;-------------------------------------- |
623 | notblack20: |
621 | notblack20: |
624 | mov edx,[blue_color] |
622 | mov edx,[blue_color] |
625 | sub [blue_color],eax |
623 | sub [blue_color],eax |
626 | cmp [blue_color],dword 0 |
624 | cmp [blue_color],dword 0 |
627 | jg notblack30 |
625 | jg notblack30 |
628 | 626 | ||
629 | mov [blue_color],dword 0 |
627 | mov [blue_color],dword 0 |
630 | ;-------------------------------------- |
628 | ;-------------------------------------- |
631 | notblack30: |
629 | notblack30: |
632 | shl dword [red_color],16 ; reassemble rgb |
630 | shl dword [red_color],16 ; reassemble rgb |
633 | shl dword [green_color],8 |
631 | shl dword [green_color],8 |
634 | mov edx,[red_color] |
632 | mov edx,[red_color] |
635 | or edx,[green_color] |
633 | or edx,[green_color] |
636 | or edx,[blue_color] |
634 | or edx,[blue_color] |
637 | ;-------------------------------------- |
635 | ;-------------------------------------- |
638 | nodark0: |
636 | nodark0: |
639 | ; eo custom darken floor |
637 | ; eo custom darken floor |
640 | mov eax,edx |
638 | mov eax,edx |
641 | 639 | ||
642 | ; cmp esi,screen_buffer+1920*480 |
640 | ; cmp esi,screen_buffer+1920*480 |
643 | ; ja foff0 |
641 | ; ja foff0 |
644 | 642 | ||
645 | ; cmp esi,screen_buffer |
643 | ; cmp esi,screen_buffer |
646 | ; jb foff0 |
644 | ; jb foff0 |
647 | 645 | ||
648 | mov [esi],eax ; actually draw the floor pixel |
646 | mov [esi],eax ; actually draw the floor pixel |
649 | ; paint "forgotten" pixels |
647 | ; paint "forgotten" pixels |
650 | mov edx,[lasty] |
648 | mov edx,[lasty] |
651 | sub edx,1920 |
649 | sub edx,1920 |
652 | cmp esi,edx |
650 | cmp esi,edx |
653 | je foff0 |
651 | je foff0 |
654 | 652 | ||
655 | mov [esi+1920],eax |
653 | mov [esi+1920],eax |
656 | sub edx,1920 |
654 | sub edx,1920 |
657 | cmp esi,edx |
655 | cmp esi,edx |
658 | je foff0 |
656 | je foff0 |
659 | 657 | ||
660 | mov [edx+1920],eax |
658 | mov [edx+1920],eax |
661 | sub edx,1920 |
659 | sub edx,1920 |
662 | cmp esi,edx |
660 | cmp esi,edx |
663 | je foff0 |
661 | je foff0 |
664 | 662 | ||
665 | mov [edx+1920],eax |
663 | mov [edx+1920],eax |
666 | ;-------------------------------------- |
664 | ;-------------------------------------- |
667 | align 4 |
665 | align 4 |
668 | foff0: |
666 | foff0: |
669 | mov [lasty],esi |
667 | mov [lasty],esi |
670 | ;**** end of draw floor pixel **** |
668 | ;**** end of draw floor pixel **** |
671 | mov esi,[remesi] |
669 | mov esi,[remesi] |
672 | mov edi,[vl] ; restore L |
670 | mov edi,[vl] ; restore L |
673 | ;-------------------------------------- |
671 | ;-------------------------------------- |
674 | no_nu_pixel: |
672 | no_nu_pixel: |
675 | mov esi,[vh] |
673 | mov esi,[vh] |
676 | mov [h_old],esi |
674 | mov [h_old],esi |
677 | 675 | ||
678 | mov eax,[vxx] |
676 | mov eax,[vxx] |
679 | mov ebx,[vyy] |
677 | mov ebx,[vyy] |
680 | 678 | ||
681 | add eax,[vstepx] ; casting... |
679 | add eax,[vstepx] ; casting... |
682 | add ebx,[vstepy] |
680 | add ebx,[vstepy] |
683 | 681 | ||
684 | mov [vxx],eax |
682 | mov [vxx],eax |
685 | mov [vyy],ebx |
683 | mov [vyy],ebx |
686 | 684 | ||
687 | sar eax,16 |
685 | sar eax,16 |
688 | sar ebx,16 |
686 | sar ebx,16 |
689 | 687 | ||
690 | mov [vpxi],eax ; casters position in Map Grid |
688 | mov [vpxi],eax ; casters position in Map Grid |
691 | mov [vpyi],ebx |
689 | mov [vpyi],ebx |
692 | 690 | ||
693 | mov edx,ebx |
691 | mov edx,ebx |
694 | shl edx,5 |
692 | shl edx,5 |
695 | lea edx,[grid+edx+eax] |
693 | lea edx,[grid+edx+eax] |
696 | 694 | ||
697 | cmp [edx],byte 0 ; raycaster reached a wall? (0=no) |
695 | cmp [edx],byte 0 ; raycaster reached a wall? (0=no) |
698 | jne getout |
696 | jne getout |
699 | 697 | ||
700 | cmp edi,10000 ; limit view range |
698 | cmp edi,10000 ; limit view range |
701 | jb raycast |
699 | jb raycast |
702 | ;-------------------------------------- |
700 | ;-------------------------------------- |
703 | getout: |
701 | getout: |
704 | mov eax,[edx] ; store Grid Wall Value for Texture Selection |
702 | mov eax,[edx] ; store Grid Wall Value for Texture Selection |
705 | mov [vk],eax |
703 | mov [vk],eax |
706 | call blur ; deactivate this (blurs the near floor) : a bit faster |
704 | call blur ; deactivate this (blurs the near floor) : a bit faster |
707 | 705 | ||
708 | ; simply copy floor to ceil pixel column here |
706 | ; simply copy floor to ceil pixel column here |
709 | ; jmp nocopy ; use this for test purposes |
707 | ; jmp nocopy ; use this for test purposes |
710 | pusha |
708 | pusha |
711 | mov eax,screen_buffer+1920*240 |
709 | mov eax,screen_buffer+1920*240 |
712 | mov ebx,eax ;screen_buffer+1920*240 |
710 | mov ebx,eax ;screen_buffer+1920*240 |
713 | ;-------------------------------------- |
711 | ;-------------------------------------- |
714 | align 4 |
712 | align 4 |
715 | copyfloor: |
713 | copyfloor: |
716 | sub eax,1920 |
714 | sub eax,1920 |
717 | add ebx,1920 |
715 | add ebx,1920 |
718 | mov ecx,[vx1] |
716 | mov ecx,[vx1] |
719 | lea ecx,[ecx+ecx*2] |
717 | lea ecx,[ecx+ecx*2] |
720 | lea edx,[ecx+ebx] |
718 | lea edx,[ecx+ebx] |
721 | add ecx,eax |
719 | add ecx,eax |
722 | mov esi,[edx] |
720 | mov esi,[edx] |
723 | mov [ecx],esi |
721 | mov [ecx],esi |
724 | cmp eax,screen_buffer |
722 | cmp eax,screen_buffer |
725 | jg copyfloor |
723 | jg copyfloor |
726 | ;@@: |
724 | ;@@: |
727 | popa |
725 | popa |
728 | ; *** end of copy floor to ceil |
726 | ; *** end of copy floor to ceil |
729 | ;nocopy: |
727 | ;nocopy: |
730 | ;-------------------------------------- |
728 | ;-------------------------------------- |
731 | ; draw this pixelrows wall |
729 | ; draw this pixelrows wall |
732 | mov [vl],edi |
730 | mov [vl],edi |
733 | mov edi,260 |
731 | mov edi,260 |
734 | sub edi,[vdd] |
732 | sub edi,[vdd] |
735 | cmp edi,0 |
733 | cmp edi,0 |
736 | jg ok3 |
734 | jg ok3 |
737 | 735 | ||
738 | xor edi,edi |
736 | xor edi,edi |
739 | ;-------------------------------------- |
737 | ;-------------------------------------- |
740 | ok3: |
738 | ok3: |
741 | mov [vbottom],edi ; end wall ceil (or window top) |
739 | mov [vbottom],edi ; end wall ceil (or window top) |
742 | mov esi,262 |
740 | mov esi,262 |
743 | add esi,[vdd] ; start wall floor |
741 | add esi,[vdd] ; start wall floor |
744 | xor edi,edi |
742 | xor edi,edi |
745 | ; somethin is wrong with xfrac,so recalc... |
743 | ; somethin is wrong with xfrac,so recalc... |
746 | mov eax,[vxx] |
744 | mov eax,[vxx] |
747 | and eax,0x0000FFFF |
745 | and eax,0x0000FFFF |
748 | shr eax,10 |
746 | shr eax,10 |
749 | mov [xfrac],eax |
747 | mov [xfrac],eax |
750 | 748 | ||
751 | mov eax,[vyy] |
749 | mov eax,[vyy] |
752 | and eax,0x0000FFFF |
750 | and eax,0x0000FFFF |
753 | shr eax,10 |
751 | shr eax,10 |
754 | mov [yfrac],eax |
752 | mov [yfrac],eax |
755 | ;-------------------------------------- |
753 | ;-------------------------------------- |
756 | pixelrow: |
754 | pixelrow: |
757 | ; find each pixels color: |
755 | ; find each pixels color: |
758 | add edi,ICON_SIZE_Y |
756 | add edi,ICON_SIZE_Y |
759 | sub esi,1 |
757 | sub esi,1 |
760 | cmp esi,502 ; dont calc offscreen-pixels |
758 | cmp esi,502 ; dont calc offscreen-pixels |
761 | jg speedup |
759 | jg speedup |
762 | 760 | ||
763 | xor edx,edx |
761 | xor edx,edx |
764 | mov eax,edi |
762 | mov eax,edi |
765 | mov ebx,[vdd] |
763 | mov ebx,[vdd] |
766 | ; add ebx,ebx |
764 | ; add ebx,ebx |
767 | shl ebx,1 |
765 | shl ebx,1 |
768 | div ebx |
766 | div ebx |
769 | 767 | ||
770 | shl edx,1 |
768 | shl edx,1 |
771 | cmp ebx,edx |
769 | cmp ebx,edx |
772 | jae @f |
770 | jae @f |
773 | inc eax |
771 | inc eax |
774 | @@: |
772 | @@: |
775 | and eax,ICON_SIZE_Y-1 |
773 | and eax,ICON_SIZE_Y-1 |
776 | mov [ytemp],eax ; get y of texture for wall |
774 | mov [ytemp],eax ; get y of texture for wall |
777 | 775 | ||
778 | mov eax,[xfrac] |
776 | mov eax,[xfrac] |
779 | add eax,[yfrac] |
777 | add eax,[yfrac] |
780 | and eax,ICON_SIZE_X-1 |
778 | and eax,ICON_SIZE_X-1 |
781 | mov [xtemp],eax ; get x of texture for wall |
779 | mov [xtemp],eax ; get x of texture for wall |
782 | ; now prepare to plot that wall-pixel... |
780 | ; now prepare to plot that wall-pixel... |
783 | mov [remedi],edi |
781 | mov [remedi],edi |
784 | mov edi,[ytemp] |
782 | mov edi,[ytemp] |
785 | sal edi,9 ;8 - for 64x64 |
783 | sal edi,9 ;8 - for 64x64 |
786 | mov edx,[xtemp] |
784 | mov edx,[xtemp] |
787 | sal edx,3 ;2 - for 64x64 |
785 | sal edx,3 ;2 - for 64x64 |
788 | add edi,edx |
786 | add edi,edx |
789 | mov eax,[vk] ; determine which texture should be used |
787 | mov eax,[vk] ; determine which texture should be used |
790 | and eax,255 |
788 | and eax,255 |
791 | 789 | ||
792 | cmp eax,1 |
790 | cmp eax,1 |
793 | jne checkmore1 |
791 | jne checkmore1 |
794 | 792 | ||
795 | add edi,[wall0] ;ceil |
793 | add edi,[wall0] ;ceil |
796 | jmp foundtex |
794 | jmp foundtex |
797 | ;--------------------------------------------------------------------- |
795 | ;--------------------------------------------------------------------- |
798 | align 4 |
796 | align 4 |
799 | checkmore1: |
797 | checkmore1: |
800 | cmp eax,2 |
798 | cmp eax,2 |
801 | jne checkmore2 |
799 | jne checkmore2 |
802 | 800 | ||
803 | add edi,[wall1] |
801 | add edi,[wall1] |
804 | jmp foundtex |
802 | jmp foundtex |
805 | ;--------------------------------------------------------------------- |
803 | ;--------------------------------------------------------------------- |
806 | align 4 |
804 | align 4 |
807 | checkmore2: |
805 | checkmore2: |
808 | cmp eax,3 |
806 | cmp eax,3 |
809 | jne checkmore3 |
807 | jne checkmore3 |
810 | 808 | ||
811 | add edi,[wall2] |
809 | add edi,[wall2] |
812 | jmp foundtex |
810 | jmp foundtex |
813 | ;--------------------------------------------------------------------- |
811 | ;--------------------------------------------------------------------- |
814 | align 4 |
812 | align 4 |
815 | checkmore3: |
813 | checkmore3: |
816 | cmp eax,4 |
814 | cmp eax,4 |
817 | jne checkmore4 |
815 | jne checkmore4 |
818 | 816 | ||
819 | add edi,[wall3] |
817 | add edi,[wall3] |
820 | jmp foundtex |
818 | jmp foundtex |
821 | ;--------------------------------------------------------------------- |
819 | ;--------------------------------------------------------------------- |
822 | align 4 |
820 | align 4 |
823 | checkmore4: |
821 | checkmore4: |
824 | cmp eax,5 |
822 | cmp eax,5 |
825 | jne checkmore5 |
823 | jne checkmore5 |
826 | 824 | ||
827 | add edi,[wall4] |
825 | add edi,[wall4] |
828 | jmp foundtex |
826 | jmp foundtex |
829 | ;--------------------------------------------------------------------- |
827 | ;--------------------------------------------------------------------- |
830 | align 4 |
828 | align 4 |
831 | checkmore5: |
829 | checkmore5: |
832 | cmp eax,6 |
830 | cmp eax,6 |
833 | jne checkmore6 |
831 | jne checkmore6 |
834 | 832 | ||
835 | add edi,[wall5] |
833 | add edi,[wall5] |
836 | jmp foundtex |
834 | jmp foundtex |
837 | ;--------------------------------------------------------------------- |
835 | ;--------------------------------------------------------------------- |
838 | align 4 |
836 | align 4 |
839 | checkmore6: |
837 | checkmore6: |
840 | cmp eax,7 |
838 | cmp eax,7 |
841 | jne checkmore7 |
839 | jne checkmore7 |
842 | 840 | ||
843 | add edi,[wall6] |
841 | add edi,[wall6] |
844 | jmp foundtex |
842 | jmp foundtex |
845 | ;--------------------------------------------------------------------- |
843 | ;--------------------------------------------------------------------- |
846 | align 4 |
844 | align 4 |
847 | checkmore7: |
845 | checkmore7: |
848 | cmp eax,8 |
846 | cmp eax,8 |
849 | jne checkmore8 |
847 | jne checkmore8 |
850 | 848 | ||
851 | add edi,[wall7] |
849 | add edi,[wall7] |
852 | jmp foundtex |
850 | jmp foundtex |
853 | ;--------------------------------------------------------------------- |
851 | ;--------------------------------------------------------------------- |
854 | align 4 |
852 | align 4 |
855 | checkmore8: |
853 | checkmore8: |
856 | foundtex: |
854 | foundtex: |
857 | mov edx,[edi] ; get pixel color inside texture |
855 | mov edx,[edi] ; get pixel color inside texture |
858 | ; ***pseudoshade south-west |
856 | ; ***pseudoshade south-west |
859 | ; jmp east ; activate this for southwest pseudoshade : a bit slower + blink-bug |
857 | ; jmp east ; activate this for southwest pseudoshade : a bit slower + blink-bug |
860 | ;--------------------------------------------------------------------- |
858 | ;--------------------------------------------------------------------- |
861 | ; mov edi,[yfrac] |
859 | ; mov edi,[yfrac] |
862 | ; mov [pseudo],dword 0 ; store flag for custom distance darkening |
860 | ; mov [pseudo],dword 0 ; store flag for custom distance darkening |
863 | ; cmp edi,[xfrac] |
861 | ; cmp edi,[xfrac] |
864 | ; jge east |
862 | ; jge east |
865 | 863 | ||
866 | ; and edx,0x00FEFEFE |
864 | ; and edx,0x00FEFEFE |
867 | ; shr edx,1 |
865 | ; shr edx,1 |
868 | ; mov [pseudo],dword 1 |
866 | ; mov [pseudo],dword 1 |
869 | ;-------------------------------------- |
867 | ;-------------------------------------- |
870 | east: |
868 | east: |
871 | call dark_distance ; deactivate wall distance darkening: a bit faster |
869 | call dark_distance ; deactivate wall distance darkening: a bit faster |
872 | ; ******* DRAW WALL PIXEL ******* |
870 | ; ******* DRAW WALL PIXEL ******* |
873 | mov eax,esi |
871 | mov eax,esi |
874 | lea eax,[esi-22] |
872 | lea eax,[esi-22] |
875 | imul eax,1920 |
873 | imul eax,1920 |
876 | mov ebx,[vx1] |
874 | mov ebx,[vx1] |
877 | lea ebx,[ebx+ebx*2] |
875 | lea ebx,[ebx+ebx*2] |
878 | lea eax,[eax+screen_buffer+ebx] |
876 | lea eax,[eax+screen_buffer+ebx] |
879 | 877 | ||
880 | cmp eax,screen_buffer+1920*480 |
878 | cmp eax,screen_buffer+1920*480 |
881 | ja dont_draw |
879 | ja dont_draw |
882 | 880 | ||
883 | cmp eax,screen_buffer |
881 | cmp eax,screen_buffer |
884 | jb dont_draw |
882 | jb dont_draw |
885 | 883 | ||
886 | mov [eax],edx ; actually set the pixel in the image |
884 | mov [eax],edx ; actually set the pixel in the image |
887 | ;-------------------------------------- |
885 | ;-------------------------------------- |
888 | ; *** eo draw wall pixel |
886 | ; *** eo draw wall pixel |
889 | dont_draw: |
887 | dont_draw: |
890 | mov edi,[remedi] |
888 | mov edi,[remedi] |
891 | ;-------------------------------------- |
889 | ;-------------------------------------- |
892 | speedup: |
890 | speedup: |
893 | cmp esi,[vbottom] ; end of this column? |
891 | cmp esi,[vbottom] ; end of this column? |
894 | jg pixelrow |
892 | jg pixelrow |
895 | 893 | ||
896 | mov edi,[vl] ; restoring |
894 | mov edi,[vl] ; restoring |
897 | mov eax,[vx1] ; inc X1 |
895 | mov eax,[vx1] ; inc X1 |
898 | add eax,1 |
896 | add eax,1 |
899 | mov [vx1],eax |
897 | mov [vx1],eax |
900 | ;*** NEXT A *** |
898 | ;*** NEXT A *** |
901 | mov esi,[va] |
899 | mov esi,[va] |
902 | sub esi,1 |
900 | sub esi,1 |
903 | mov [va],esi |
901 | mov [va],esi |
904 | cmp esi,[vacompare] |
902 | cmp esi,[vacompare] |
905 | jg for_a |
903 | jg for_a |
906 | ;*** EO NEXT A *** |
904 | ;*** EO NEXT A *** |
907 | ;-------------------------------------- |
905 | ;-------------------------------------- |
908 | ; **** put image !!!!!**** |
906 | ; **** put image !!!!!**** |
909 | xor edx,edx |
907 | xor edx,edx |
910 | mcall 7,screen_buffer,<640,480> |
908 | mcall 7,screen_buffer,<640,480> |
911 | ret |
909 | ret |
912 | ;--------------------------------------------------------------------- |
910 | ;--------------------------------------------------------------------- |
913 | align 4 |
911 | align 4 |
914 | blur: |
912 | blur: |
915 | pusha |
913 | pusha |
916 | mov eax,screen_buffer+360*1920 |
914 | mov eax,screen_buffer+360*1920 |
917 | ;-------------------------------------- |
915 | ;-------------------------------------- |
918 | align 4 |
916 | align 4 |
919 | copyfloor2: |
917 | copyfloor2: |
920 | add eax,1920 |
918 | add eax,1920 |
921 | mov ebx,[vx1] |
919 | mov ebx,[vx1] |
922 | lea ebx,[ebx+ebx*2] |
920 | lea ebx,[ebx+ebx*2] |
923 | add ebx,eax |
921 | add ebx,eax |
924 | 922 | ||
925 | mov ecx,[ebx-15] |
923 | mov ecx,[ebx-15] |
926 | and ecx,0x00FEFEFE |
924 | and ecx,0x00FEFEFE |
927 | shr ecx,1 |
925 | shr ecx,1 |
928 | 926 | ||
929 | mov edx,[ebx-12] |
927 | mov edx,[ebx-12] |
930 | and edx,0x00FEFEFE |
928 | and edx,0x00FEFEFE |
931 | shr edx,1 |
929 | shr edx,1 |
932 | add edx,ecx |
930 | add edx,ecx |
933 | and edx,0x00FEFEFE |
931 | and edx,0x00FEFEFE |
934 | shr edx,1 |
932 | shr edx,1 |
935 | 933 | ||
936 | mov ecx,[ebx-9] |
934 | mov ecx,[ebx-9] |
937 | and ecx,0x00FEFEFE |
935 | and ecx,0x00FEFEFE |
938 | shr ecx,1 |
936 | shr ecx,1 |
939 | add edx,ecx |
937 | add edx,ecx |
940 | 938 | ||
941 | and edx,0x00FEFEFE |
939 | and edx,0x00FEFEFE |
942 | shr edx,1 |
940 | shr edx,1 |
943 | 941 | ||
944 | mov ecx,[ebx-6] |
942 | mov ecx,[ebx-6] |
945 | and ecx,0x00FEFEFE |
943 | and ecx,0x00FEFEFE |
946 | shr ecx,1 |
944 | shr ecx,1 |
947 | add edx,ecx |
945 | add edx,ecx |
948 | 946 | ||
949 | and edx,0x00FEFEFE |
947 | and edx,0x00FEFEFE |
950 | shr edx,1 |
948 | shr edx,1 |
951 | 949 | ||
952 | mov ecx,[ebx-3] |
950 | mov ecx,[ebx-3] |
953 | and ecx,0x00FEFEFE |
951 | and ecx,0x00FEFEFE |
954 | shr ecx,1 |
952 | shr ecx,1 |
955 | add edx,ecx |
953 | add edx,ecx |
956 | 954 | ||
957 | and edx,0x00FEFEFE |
955 | and edx,0x00FEFEFE |
958 | shr edx,1 |
956 | shr edx,1 |
959 | 957 | ||
960 | mov ecx,[ebx] |
958 | mov ecx,[ebx] |
961 | and ecx,0x00FEFEFE |
959 | and ecx,0x00FEFEFE |
962 | shr ecx,1 |
960 | shr ecx,1 |
963 | add edx,ecx |
961 | add edx,ecx |
964 | 962 | ||
965 | mov [ebx],edx |
963 | mov [ebx],edx |
966 | 964 | ||
967 | cmp eax,screen_buffer+478*1920 |
965 | cmp eax,screen_buffer+478*1920 |
968 | jb copyfloor2 |
966 | jb copyfloor2 |
969 | 967 | ||
970 | popa |
968 | popa |
971 | ret |
969 | ret |
972 | ;--------------------------------------------------------------------- |
970 | ;--------------------------------------------------------------------- |
973 | ; ******* Darken by Distance ******* |
971 | ; ******* Darken by Distance ******* |
974 | align 4 |
972 | align 4 |
975 | dark_distance: |
973 | dark_distance: |
976 | ; color must be in edx, wall height in [vdd] |
974 | ; color must be in edx, wall height in [vdd] |
977 | mov eax,[vdd] |
975 | mov eax,[vdd] |
978 | cmp eax,50 |
976 | cmp eax,50 |
979 | jg nodark |
977 | jg nodark |
980 | ; split rgb |
978 | ; split rgb |
981 | mov [blue_color],edx |
979 | mov [blue_color],edx |
982 | and [blue_color],dword 255 |
980 | and [blue_color],dword 255 |
983 | 981 | ||
984 | shr edx,8 |
982 | shr edx,8 |
985 | mov [green_color],edx |
983 | mov [green_color],edx |
986 | and [green_color],dword 255 |
984 | and [green_color],dword 255 |
987 | 985 | ||
988 | shr edx,8 |
986 | shr edx,8 |
989 | mov [red_color],edx |
987 | mov [red_color],edx |
990 | and [red_color],dword 255 |
988 | and [red_color],dword 255 |
991 | 989 | ||
992 | mov eax,51 ; darkness parameter |
990 | mov eax,51 ; darkness parameter |
993 | sub eax,[vdd] |
991 | sub eax,[vdd] |
994 | cmp [pseudo],dword 1 |
992 | cmp [pseudo],dword 1 |
995 | je isdarkside |
993 | je isdarkside |
996 | 994 | ||
997 | sal eax,2 |
995 | sal eax,2 |
998 | ;-------------------------------------- |
996 | ;-------------------------------------- |
999 | align 4 |
997 | align 4 |
1000 | isdarkside: |
998 | isdarkside: |
1001 | ; reduce rgb |
999 | ; reduce rgb |
1002 | sub [red_color],eax |
1000 | sub [red_color],eax |
1003 | cmp [red_color],dword 0 |
1001 | cmp [red_color],dword 0 |
1004 | jg notblack10b |
1002 | jg notblack10b |
1005 | 1003 | ||
1006 | mov [red_color],dword 0 |
1004 | mov [red_color],dword 0 |
1007 | ;-------------------------------------- |
1005 | ;-------------------------------------- |
1008 | align 4 |
1006 | align 4 |
1009 | notblack10b: |
1007 | notblack10b: |
1010 | sub [green_color],eax |
1008 | sub [green_color],eax |
1011 | cmp [green_color],dword 0 |
1009 | cmp [green_color],dword 0 |
1012 | jg notblack20b |
1010 | jg notblack20b |
1013 | 1011 | ||
1014 | mov [green_color],dword 0 |
1012 | mov [green_color],dword 0 |
1015 | ;-------------------------------------- |
1013 | ;-------------------------------------- |
1016 | align 4 |
1014 | align 4 |
1017 | notblack20b: |
1015 | notblack20b: |
1018 | mov edx,[blue_color] |
1016 | mov edx,[blue_color] |
1019 | sub [blue_color],eax |
1017 | sub [blue_color],eax |
1020 | cmp [blue_color],dword 0 |
1018 | cmp [blue_color],dword 0 |
1021 | jg notblack30b |
1019 | jg notblack30b |
1022 | 1020 | ||
1023 | mov [blue_color],dword 0 |
1021 | mov [blue_color],dword 0 |
1024 | ;-------------------------------------- |
1022 | ;-------------------------------------- |
1025 | align 4 |
1023 | align 4 |
1026 | notblack30b: |
1024 | notblack30b: |
1027 | shl dword [red_color],16 ; reassemble rgb |
1025 | shl dword [red_color],16 ; reassemble rgb |
1028 | shl dword [green_color],8 |
1026 | shl dword [green_color],8 |
1029 | mov edx,[red_color] |
1027 | mov edx,[red_color] |
1030 | or edx,[green_color] |
1028 | or edx,[green_color] |
1031 | or edx,[blue_color] |
1029 | or edx,[blue_color] |
1032 | mov eax,edx |
1030 | mov eax,edx |
1033 | ;-------------------------------------- |
1031 | ;-------------------------------------- |
1034 | align 4 |
1032 | align 4 |
1035 | nodark: |
1033 | nodark: |
1036 | ret |
1034 | ret |
1037 | ;--------------------------------------------------------------------- |
1035 | ;--------------------------------------------------------------------- |
1038 | load_icons: |
1036 | load_icons: |
1039 | mov ebx,icons_file_name |
1037 | mov ebx,icons_file_name |
1040 | mov esi,path |
1038 | mov esi,path |
1041 | mov edi,file_name |
1039 | mov edi,file_name |
1042 | call copy_file_path |
1040 | call copy_file_path |
1043 | 1041 | ||
1044 | mov [fileinfo.subfunction],dword 5 |
1042 | mov [fileinfo.subfunction],dword 5 |
1045 | mov [fileinfo.size],dword 0 |
1043 | mov [fileinfo.size],dword 0 |
1046 | mov [fileinfo.return],dword file_info |
1044 | mov [fileinfo.return],dword file_info |
1047 | mcall 70,fileinfo |
1045 | mcall 70,fileinfo |
1048 | test eax,eax |
1046 | test eax,eax |
1049 | jnz .error |
1047 | jnz .error |
1050 | 1048 | ||
1051 | mov [fileinfo.subfunction],dword 0 |
1049 | mov [fileinfo.subfunction],dword 0 |
1052 | 1050 | ||
1053 | mov ecx,[file_info+32] |
1051 | mov ecx,[file_info+32] |
1054 | mov [fileinfo.size],ecx |
1052 | mov [fileinfo.size],ecx |
1055 | mov [img_size],ecx |
1053 | mov [img_size],ecx |
1056 | 1054 | ||
1057 | mcall 68,12 |
1055 | mcall 68,12 |
1058 | test eax,eax |
1056 | test eax,eax |
1059 | jz finish ;memory_get_error |
1057 | jz finish ;memory_get_error |
1060 | 1058 | ||
1061 | mov [fileinfo.return],eax |
1059 | mov [fileinfo.return],eax |
1062 | mov [image_file],eax |
1060 | mov [image_file],eax |
1063 | 1061 | ||
1064 | mcall 70,fileinfo |
1062 | mcall 70,fileinfo |
1065 | test eax,eax |
1063 | test eax,eax |
1066 | jnz .error |
1064 | jnz .error |
1067 | ret |
1065 | ret |
1068 | .error: |
1066 | .error: |
1069 | ; mov [N_error],2 |
1067 | ; mov [N_error],2 |
1070 | ; mov [error_type],eax |
1068 | ; mov [error_type],eax |
1071 | jmp finish |
1069 | jmp finish |
1072 | ;--------------------------------------------------------------------- |
1070 | ;--------------------------------------------------------------------- |
1073 | copy_file_path: |
1071 | copy_file_path: |
1074 | xor eax,eax |
1072 | xor eax,eax |
1075 | cld |
1073 | cld |
1076 | @@: |
1074 | @@: |
1077 | lodsb |
1075 | lodsb |
1078 | stosb |
1076 | stosb |
1079 | test eax,eax |
1077 | test eax,eax |
1080 | jnz @b |
1078 | jnz @b |
1081 | mov esi,edi |
1079 | mov esi,edi |
1082 | dec esi |
1080 | dec esi |
1083 | std |
1081 | std |
1084 | @@: |
1082 | @@: |
1085 | lodsb |
1083 | lodsb |
1086 | cmp al,'/' |
1084 | cmp al,'/' |
1087 | jnz @b |
1085 | jnz @b |
1088 | mov edi,esi |
1086 | mov edi,esi |
1089 | add edi,2 |
1087 | add edi,2 |
1090 | mov esi,ebx |
1088 | mov esi,ebx |
1091 | cld |
1089 | cld |
1092 | @@: |
1090 | @@: |
1093 | lodsb |
1091 | lodsb |
1094 | stosb |
1092 | stosb |
1095 | test eax,eax |
1093 | test eax,eax |
1096 | jnz @b |
1094 | jnz @b |
1097 | ret |
1095 | ret |
1098 | ;--------------------------------------------------------------------- |
1096 | ;--------------------------------------------------------------------- |
1099 | convert_icons: |
1097 | convert_icons: |
1100 | xor eax,eax |
1098 | xor eax,eax |
1101 | mov [return_code],eax |
1099 | mov [return_code],eax |
1102 | push image_file |
1100 | push image_file |
1103 | call [cnv_png_import.Start] |
1101 | call [cnv_png_import.Start] |
1104 | 1102 | ||
1105 | mov ecx,[image_file] |
1103 | mov ecx,[image_file] |
1106 | mcall 68,13, |
1104 | mcall 68,13, |
1107 | test eax,eax |
1105 | test eax,eax |
1108 | jz finish ;memory_free_error |
1106 | jz finish ;memory_free_error |
1109 | 1107 | ||
1110 | cmp [return_code],dword 0 |
1108 | cmp [return_code],dword 0 |
1111 | ; je @f |
1109 | ; je @f |
1112 | ; mov [N_error],6 |
1110 | ; mov [N_error],6 |
1113 | ; jmp button.exit |
1111 | ; jmp button.exit |
1114 | ;@@: |
1112 | ;@@: |
1115 | jne finish |
1113 | jne finish |
1116 | 1114 | ||
1117 | mcall 68,20,ICON_SIZE_X*ICON_SIZE_Y*4*8+44,[raw_pointer] |
1115 | mcall 68,20,ICON_SIZE_X*ICON_SIZE_Y*4*8+44,[raw_pointer] |
1118 | mov [raw_pointer],eax |
1116 | mov [raw_pointer],eax |
1119 | 1117 | ||
1120 | mov ebx,[raw_pointer] |
1118 | mov ebx,[raw_pointer] |
1121 | ; set RAW area for icon |
1119 | ; set RAW area for icon |
1122 | mov eax,[ebx+28] |
1120 | mov eax,[ebx+28] |
1123 | add eax,ebx |
1121 | add eax,ebx |
1124 | mov edi,eax |
1122 | mov edi,eax |
1125 | mov esi,eax |
1123 | mov esi,eax |
1126 | add esi,ICON_SIZE_X*ICON_SIZE_Y*8*3-1 |
1124 | add esi,ICON_SIZE_X*ICON_SIZE_Y*8*3-1 |
1127 | add edi,ICON_SIZE_X*ICON_SIZE_Y*8*4-4 |
1125 | add edi,ICON_SIZE_X*ICON_SIZE_Y*8*4-4 |
1128 | 1126 | ||
1129 | ; add eax,TEX_SIZE |
1127 | ; add eax,TEX_SIZE |
1130 | mov [wall0],eax |
1128 | mov [wall0],eax |
1131 | add eax,TEX_SIZE |
1129 | add eax,TEX_SIZE |
1132 | mov [wall1],eax |
1130 | mov [wall1],eax |
1133 | add eax,TEX_SIZE |
1131 | add eax,TEX_SIZE |
1134 | mov [wall2],eax |
1132 | mov [wall2],eax |
1135 | add eax,TEX_SIZE |
1133 | add eax,TEX_SIZE |
1136 | mov [wall3],eax |
1134 | mov [wall3],eax |
1137 | add eax,TEX_SIZE |
1135 | add eax,TEX_SIZE |
1138 | mov [wall4],eax |
1136 | mov [wall4],eax |
1139 | add eax,TEX_SIZE |
1137 | add eax,TEX_SIZE |
1140 | mov [wall5],eax |
1138 | mov [wall5],eax |
1141 | add eax,TEX_SIZE |
1139 | add eax,TEX_SIZE |
1142 | mov [wall6],eax |
1140 | mov [wall6],eax |
1143 | add eax,TEX_SIZE |
1141 | add eax,TEX_SIZE |
1144 | mov [wall7],eax |
1142 | mov [wall7],eax |
1145 | add eax,TEX_SIZE |
1143 | add eax,TEX_SIZE |
1146 | ; conversion 24b to 32 b |
1144 | ; conversion 24b to 32 b |
1147 | mov ecx,ICON_SIZE_X*ICON_SIZE_Y*8 |
1145 | mov ecx,ICON_SIZE_X*ICON_SIZE_Y*8 |
1148 | std |
1146 | std |
1149 | @@: |
1147 | @@: |
1150 | xor eax,eax |
1148 | xor eax,eax |
1151 | lodsb |
1149 | lodsb |
1152 | rol eax,8 |
1150 | rol eax,8 |
1153 | lodsb |
1151 | lodsb |
1154 | rol eax,8 |
1152 | rol eax,8 |
1155 | lodsb |
1153 | lodsb |
1156 | ; ror eax,16 |
1154 | ; ror eax,16 |
1157 | stosd |
1155 | stosd |
1158 | dec ecx |
1156 | dec ecx |
1159 | jnz @b |
1157 | jnz @b |
1160 | cld |
1158 | cld |
1161 | ret |
1159 | ret |
1162 | ;--------------------------------------------------------------------- |
1160 | ;--------------------------------------------------------------------- |
1163 | ; DATA AREA |
1161 | ; DATA AREA |
1164 | ;ceil=ceil |
1162 | ;ceil=ceil |
1165 | ;wall=wall floor |
1163 | ;wall=wall floor |
1166 | ;2 corner stone |
1164 | ;2 corner stone |
1167 | ;3 leaf mosaic |
1165 | ;3 leaf mosaic |
1168 | ;4 closed window |
1166 | ;4 closed window |
1169 | ;5 greek mosaic |
1167 | ;5 greek mosaic |
1170 | ;6 old street stones |
1168 | ;6 old street stones |
1171 | ;7 maya wall |
1169 | ;7 maya wall |
1172 | ;--------------------------------------------------------------------- |
1170 | ;--------------------------------------------------------------------- |
1173 | align 4 |
1171 | align 4 |
1174 | grid: ; 32*32 Blocks, Map: 0 = Air, 1 to 8 = Wall |
1172 | grid: ; 32*32 Blocks, Map: 0 = Air, 1 to 8 = Wall |
1175 | db 2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 |
1173 | db 2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 |
1176 | db 1,0,0,0,1,0,0,0,0,0,0,3,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8 |
1174 | db 1,0,0,0,1,0,0,0,0,0,0,3,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8 |
1177 | db 5,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8 |
1175 | db 5,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8 |
1178 | db 1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,3,3,3,3,0,0,0,0,0,0,8 |
1176 | db 1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,3,3,3,3,0,0,0,0,0,0,8 |
1179 | db 5,0,1,2,3,4,5,6,7,8,2,1,3,3,3,0,5,0,2,1,2,3,0,0,0,0,0,0,0,0,0,8 |
1177 | db 5,0,1,2,3,4,5,6,7,8,2,1,3,3,3,0,5,0,2,1,2,3,0,0,0,0,0,0,0,0,0,8 |
1180 | db 1,0,0,0,0,0,0,0,0,0,2,3,0,0,0,0,5,0,0,0,0,3,0,0,0,0,0,0,0,0,0,8 |
1178 | db 1,0,0,0,0,0,0,0,0,0,2,3,0,0,0,0,5,0,0,0,0,3,0,0,0,0,0,0,0,0,0,8 |
1181 | db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,5,0,0,0,0,3,3,0,3,3,0,0,0,0,0,8 |
1179 | db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,5,0,0,0,0,3,3,0,3,3,0,0,0,0,0,8 |
1182 | db 1,1,0,1,1,1,1,4,1,0,1,3,0,0,0,0,5,2,1,2,0,3,0,0,0,3,0,0,0,0,0,8 |
1180 | db 1,1,0,1,1,1,1,4,1,0,1,3,0,0,0,0,5,2,1,2,0,3,0,0,0,3,0,0,0,0,0,8 |
1183 | db 5,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,5,0,0,0,0,3,0,0,0,3,0,0,0,0,0,8 |
1181 | db 5,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,5,0,0,0,0,3,0,0,0,3,0,0,0,0,0,8 |
1184 | db 1,0,0,0,1,0,0,5,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,3,0,0,0,0,0,8 |
1182 | db 1,0,0,0,1,0,0,5,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,3,0,0,0,0,0,8 |
1185 | db 5,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,5,0,0,0,0,3,0,0,0,0,0,0,0,0,0,8 |
1183 | db 5,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,5,0,0,0,0,3,0,0,0,0,0,0,0,0,0,8 |
1186 | db 1,4,4,4,4,4,4,4,4,4,4,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,8,8 |
1184 | db 1,4,4,4,4,4,4,4,4,4,4,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,8,8 |
1187 | db 2,2,2,2,2,2,8,8,8,8,8,8,8,8,8,0,0,0,6,6,0,7,7,7,7,7,7,7,7,7,8,8 |
1185 | db 2,2,2,2,2,2,8,8,8,8,8,8,8,8,8,0,0,0,6,6,0,7,7,7,7,7,7,7,7,7,8,8 |
1188 | db 1,0,0,0,1,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1 |
1186 | db 1,0,0,0,1,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1 |
1189 | db 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,2,2,2,2,0,0,0,0,3,3,3,3,3,1 |
1187 | db 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,2,2,2,2,0,0,0,0,3,3,3,3,3,1 |
1190 | db 1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,6,0,0,0,0,2,0,0,0,0,3,0,0,0,0,1 |
1188 | db 1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,6,0,0,0,0,2,0,0,0,0,3,0,0,0,0,1 |
1191 | db 5,0,2,3,2,3,2,3,2,3,2,1,0,0,0,0,6,0,2,2,0,2,0,0,0,0,3,0,5,5,0,1 |
1189 | db 5,0,2,3,2,3,2,3,2,3,2,1,0,0,0,0,6,0,2,2,0,2,0,0,0,0,3,0,5,5,0,1 |
1192 | db 1,0,0,0,0,0,0,4,0,0,0,3,0,0,0,0,6,0,0,2,0,2,0,2,0,0,3,0,0,0,0,1 |
1190 | db 1,0,0,0,0,0,0,4,0,0,0,3,0,0,0,0,6,0,0,2,0,2,0,2,0,0,3,0,0,0,0,1 |
1193 | db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,6,0,0,2,2,2,0,2,0,0,3,3,3,3,0,1 |
1191 | db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,6,0,0,2,2,2,0,2,0,0,3,3,3,3,0,1 |
1194 | db 1,1,0,1,1,1,1,4,1,0,1,3,7,7,7,0,6,0,0,0,0,0,0,2,0,0,0,0,0,3,0,1 |
1192 | db 1,1,0,1,1,1,1,4,1,0,1,3,7,7,7,0,6,0,0,0,0,0,0,2,0,0,0,0,0,3,0,1 |
1195 | db 5,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,6,0,0,0,0,2,2,2,0,0,0,0,0,3,0,1 |
1193 | db 5,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,6,0,0,0,0,2,2,2,0,0,0,0,0,3,0,1 |
1196 | db 1,0,0,0,1,0,0,5,0,0,0,3,0,0,0,0,6,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1 |
1194 | db 1,0,0,0,1,0,0,5,0,0,0,3,0,0,0,0,6,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1 |
1197 | db 5,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,6,0,5,1,0,2,0,0,4,4,0,4,4,0,0,1 |
1195 | db 5,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,6,0,5,1,0,2,0,0,4,4,0,4,4,0,0,1 |
1198 | db 1,4,1,4,1,4,1,4,1,4,1,3,0,0,0,0,6,0,0,5,0,2,0,0,0,4,0,4,0,0,0,1 |
1196 | db 1,4,1,4,1,4,1,4,1,4,1,3,0,0,0,0,6,0,0,5,0,2,0,0,0,4,0,4,0,0,0,1 |
1199 | db 1,0,0,0,0,0,0,4,0,0,0,3,0,3,3,3,6,0,0,1,0,1,0,0,4,4,0,4,4,0,0,1 |
1197 | db 1,0,0,0,0,0,0,4,0,0,0,3,0,3,3,3,6,0,0,1,0,1,0,0,4,4,0,4,4,0,0,1 |
1200 | db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,6,0,0,5,0,1,0,4,4,0,0,0,4,4,0,1 |
1198 | db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,6,0,0,5,0,1,0,4,4,0,0,0,4,4,0,1 |
1201 | db 1,1,0,1,1,1,1,4,1,0,1,3,0,0,0,0,6,0,0,1,0,1,0,4,0,0,0,0,0,4,0,1 |
1199 | db 1,1,0,1,1,1,1,4,1,0,1,3,0,0,0,0,6,0,0,1,0,1,0,4,0,0,0,0,0,4,0,1 |
1202 | db 5,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,6,0,0,5,0,1,0,4,0,0,0,0,0,4,0,1 |
1200 | db 5,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,6,0,0,5,0,1,0,4,0,0,0,0,0,4,0,1 |
1203 | db 1,0,0,0,1,0,0,5,0,0,0,3,0,0,0,0,6,1,5,1,0,1,0,4,4,0,0,0,4,4,0,1 |
1201 | db 1,0,0,0,1,0,0,5,0,0,0,3,0,0,0,0,6,1,5,1,0,1,0,4,4,0,0,0,4,4,0,1 |
1204 | db 5,0,0,0,0,0,0,5,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,4,4,4,4,4,0,0,1 |
1202 | db 5,0,0,0,0,0,0,5,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,4,4,4,4,4,0,0,1 |
1205 | db 1,4,1,4,1,4,1,4,1,4,1,3,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1 |
1203 | db 1,4,1,4,1,4,1,4,1,4,1,3,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1 |
1206 | db 2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
1204 | db 2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
1207 | ;--------------------------------------------------------------------- |
1205 | ;--------------------------------------------------------------------- |
1208 | vpx: |
1206 | vpx: |
1209 | dd 0x0001FFFF ; initial player position * 0xFFFF |
1207 | dd 0x0001FFFF ; initial player position * 0xFFFF |
1210 | vpy: |
1208 | vpy: |
1211 | dd 0x0001FFFF |
1209 | dd 0x0001FFFF |
1212 | 1210 | ||
1213 | title db 'Free3D v0.6 - fisheye raycasting engine etc.',0 |
1211 | title db 'Free3D v0.6 - fisheye raycasting engine etc.',0 |
1214 | 1212 | ||
1215 | sindegree dd 0.0 |
1213 | sindegree dd 0.0 |
1216 | sininc dd 0.0017453292519943295769236907684886 |
1214 | sininc dd 0.0017453292519943295769236907684886 |
1217 | sindiv dd 6553.5 |
1215 | sindiv dd 6553.5 |
1218 | ;textures: |
1216 | ;textures: |
1219 | ;file 'texture.gif' |
1217 | ;file 'texture.gif' |
1220 | current_key_code db 0 |
1218 | current_key_code db 0 |
1221 | old_key_code db 0 |
1219 | old_key_code db 0 |
1222 | extended_key db 0 |
1220 | extended_key db 0 |
1223 | ;--------------------------------------------------------------------- |
1221 | ;--------------------------------------------------------------------- |
1224 | align 4 |
1222 | align 4 |
1225 | fileinfo: |
1223 | fileinfo: |
1226 | .subfunction dd 5 |
1224 | .subfunction dd 5 |
1227 | .Offset dd 0 |
1225 | .Offset dd 0 |
1228 | .Offset_1 dd 0 |
1226 | .Offset_1 dd 0 |
1229 | .size dd 0 |
1227 | .size dd 0 |
1230 | .return dd file_info |
1228 | .return dd file_info |
1231 | db 0 |
1229 | db 0 |
1232 | .name: dd file_name |
1230 | .name: dd file_name |
1233 | ;--------------------------------------------------------------------- |
1231 | ;--------------------------------------------------------------------- |
1234 | icons_file_name db 'texture_24b.png',0 |
1232 | icons_file_name db 'texture_24b.png',0 |
1235 | ;--------------------------------------------------------------------- |
1233 | ;--------------------------------------------------------------------- |
1236 | plugins_directory db 0 |
1234 | plugins_directory db 0 |
1237 | 1235 | ||
1238 | system_dir_Boxlib db '/sys/lib/box_lib.obj',0 |
1236 | system_dir_Boxlib db '/sys/lib/box_lib.obj',0 |
1239 | system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0 |
1237 | system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0 |
1240 | system_dir_Sort db '/sys/lib/sort.obj',0 |
1238 | system_dir_Sort db '/sys/lib/sort.obj',0 |
1241 | system_dir_UNPACK db '/sys/lib/archiver.obj',0 |
1239 | system_dir_UNPACK db '/sys/lib/archiver.obj',0 |
1242 | 1240 | ||
1243 | ihead_f_i: |
1241 | ihead_f_i: |
1244 | ihead_f_l db 'System error',0 |
1242 | ihead_f_l db 'System error',0 |
1245 | 1243 | ||
1246 | er_message_found_lib1 db 'cnv_png.obj - Not found!',0 |
1244 | er_message_found_lib1 db 'cnv_png.obj - Not found!',0 |
1247 | er_message_import1 db 'cnv_png.obj - Wrong import!',0 |
1245 | er_message_import1 db 'cnv_png.obj - Wrong import!',0 |
1248 | 1246 | ||
1249 | err_message_found_lib2 db 'archiver.obj - Not found!',0 |
1247 | err_message_found_lib2 db 'archiver.obj - Not found!',0 |
1250 | err_message_import2 db 'archiver.obj - Wrong import!',0 |
1248 | err_message_import2 db 'archiver.obj - Wrong import!',0 |
1251 | 1249 | ||
1252 | 1250 | ||
1253 | align 4 |
1251 | align 4 |
1254 | l_libs_start: |
1252 | l_libs_start: |
1255 | library01 l_libs system_dir_CnvPNG+9,path,file_name,system_dir_CnvPNG,\ |
1253 | library01 l_libs system_dir_CnvPNG+9,path,file_name,system_dir_CnvPNG,\ |
1256 | er_message_found_lib1,ihead_f_l,cnv_png_import,er_message_import1,ihead_f_i,plugins_directory |
1254 | er_message_found_lib1,ihead_f_l,cnv_png_import,er_message_import1,ihead_f_i,plugins_directory |
1257 | 1255 | ||
1258 | library02 l_libs system_dir_UNPACK+9,path,file_name,system_dir_UNPACK,\ |
1256 | library02 l_libs system_dir_UNPACK+9,path,file_name,system_dir_UNPACK,\ |
1259 | err_message_found_lib2,ihead_f_l,UNPACK_import,err_message_import2,ihead_f_i,plugins_directory |
1257 | err_message_found_lib2,ihead_f_l,UNPACK_import,err_message_import2,ihead_f_i,plugins_directory |
1260 | 1258 | ||
1261 | end_l_libs: |
1259 | end_l_libs: |
1262 | ;--------------------------------------------------------------------- |
1260 | ;--------------------------------------------------------------------- |
1263 | align 4 |
1261 | align 4 |
1264 | cnv_png_import: |
1262 | cnv_png_import: |
1265 | .Start dd aCP_Start |
1263 | .Start dd aCP_Start |
1266 | .Version dd aCP_Version |
1264 | .Version dd aCP_Version |
1267 | .Check dd aCP_Check |
1265 | .Check dd aCP_Check |
1268 | .Assoc dd aCP_Assoc |
1266 | .Assoc dd aCP_Assoc |
1269 | dd 0 |
1267 | dd 0 |
1270 | dd 0 |
1268 | dd 0 |
1271 | aCP_Start db 'START',0 |
1269 | aCP_Start db 'START',0 |
1272 | aCP_Version db 'version',0 |
1270 | aCP_Version db 'version',0 |
1273 | aCP_Check db 'Check_Header',0 |
1271 | aCP_Check db 'Check_Header',0 |
1274 | aCP_Assoc db 'Associations',0 |
1272 | aCP_Assoc db 'Associations',0 |
1275 | ;--------------------------------------------------------------------- |
1273 | ;--------------------------------------------------------------------- |
1276 | align 4 |
1274 | align 4 |
1277 | UNPACK_import: |
1275 | UNPACK_import: |
1278 | ;unpack_Version dd aUnpack_Version |
1276 | ;unpack_Version dd aUnpack_Version |
1279 | ;unpack_PluginLoad dd aUnpack_PluginLoad |
1277 | ;unpack_PluginLoad dd aUnpack_PluginLoad |
1280 | ;unpack_OpenFilePlugin dd aUnpack_OpenFilePlugin |
1278 | ;unpack_OpenFilePlugin dd aUnpack_OpenFilePlugin |
1281 | ;unpack_ClosePlugin dd aUnpack_ClosePlugin |
1279 | ;unpack_ClosePlugin dd aUnpack_ClosePlugin |
1282 | ;unpack_ReadFolder dd aUnpack_ReadFolder |
1280 | ;unpack_ReadFolder dd aUnpack_ReadFolder |
1283 | ;unpack_SetFolder dd aUnpack_SetFolder |
1281 | ;unpack_SetFolder dd aUnpack_SetFolder |
1284 | ;unpack_GetFiles dd aUnpack_GetFiles |
1282 | ;unpack_GetFiles dd aUnpack_GetFiles |
1285 | ;unpack_GetOpenPluginInfo dd aUnpack_GetOpenPluginInfo |
1283 | ;unpack_GetOpenPluginInfo dd aUnpack_GetOpenPluginInfo |
1286 | ;unpack_Getattr dd aUnpack_Getattr |
1284 | ;unpack_Getattr dd aUnpack_Getattr |
1287 | ;unpack_Open dd aUnpack_Open |
1285 | ;unpack_Open dd aUnpack_Open |
1288 | ;unpack_Read dd aUnpack_Read |
1286 | ;unpack_Read dd aUnpack_Read |
1289 | ;unpack_Setpos dd aUnpack_Setpos |
1287 | ;unpack_Setpos dd aUnpack_Setpos |
1290 | ;unpack_Close dd aUnpack_Close |
1288 | ;unpack_Close dd aUnpack_Close |
1291 | ;unpack_DeflateUnpack dd aUnpack_DeflateUnpack |
1289 | ;unpack_DeflateUnpack dd aUnpack_DeflateUnpack |
1292 | unpack_DeflateUnpack2 dd aUnpack_DeflateUnpack2 |
1290 | unpack_DeflateUnpack2 dd aUnpack_DeflateUnpack2 |
1293 | dd 0 |
1291 | dd 0 |
1294 | dd 0 |
1292 | dd 0 |
1295 | 1293 | ||
1296 | ;aUnpack_Version db 'version',0 |
1294 | ;aUnpack_Version db 'version',0 |
1297 | ;aUnpack_PluginLoad db 'plugin_load',0 |
1295 | ;aUnpack_PluginLoad db 'plugin_load',0 |
1298 | ;aUnpack_OpenFilePlugin db 'OpenFilePlugin',0 |
1296 | ;aUnpack_OpenFilePlugin db 'OpenFilePlugin',0 |
1299 | ;aUnpack_ClosePlugin db 'ClosePlugin',0 |
1297 | ;aUnpack_ClosePlugin db 'ClosePlugin',0 |
1300 | ;aUnpack_ReadFolder db 'ReadFolder',0 |
1298 | ;aUnpack_ReadFolder db 'ReadFolder',0 |
1301 | ;aUnpack_SetFolder db 'SetFolder',0 |
1299 | ;aUnpack_SetFolder db 'SetFolder',0 |
1302 | ;aUnpack_GetFiles db 'GetFiles',0 |
1300 | ;aUnpack_GetFiles db 'GetFiles',0 |
1303 | ;aUnpack_GetOpenPluginInfo db 'GetOpenPluginInfo',0 |
1301 | ;aUnpack_GetOpenPluginInfo db 'GetOpenPluginInfo',0 |
1304 | ;aUnpack_Getattr db 'getattr',0 |
1302 | ;aUnpack_Getattr db 'getattr',0 |
1305 | ;aUnpack_Open db 'open',0 |
1303 | ;aUnpack_Open db 'open',0 |
1306 | ;aUnpack_Read db 'read',0 |
1304 | ;aUnpack_Read db 'read',0 |
1307 | ;aUnpack_Setpos db 'setpos',0 |
1305 | ;aUnpack_Setpos db 'setpos',0 |
1308 | ;aUnpack_Close db 'close',0 |
1306 | ;aUnpack_Close db 'close',0 |
1309 | ;aUnpack_DeflateUnpack db 'deflate_unpack',0 |
1307 | ;aUnpack_DeflateUnpack db 'deflate_unpack',0 |
1310 | aUnpack_DeflateUnpack2 db 'deflate_unpack2',0 |
1308 | aUnpack_DeflateUnpack2 db 'deflate_unpack2',0 |
1311 | 1309 | ||
1312 | ;--------------------------------------------------------------------- |
1310 | ;--------------------------------------------------------------------- |
1313 | IM_END: |
1311 | IM_END: |
1314 | ;--------------------------------------------------------------------- |
1312 | ;--------------------------------------------------------------------- |
1315 | ; not change this section!!! |
1313 | ; not change this section!!! |
1316 | ; start section |
1314 | ; start section |
1317 | ;--------------------------------------------------------------------- |
1315 | ;--------------------------------------------------------------------- |
1318 | align 4 |
1316 | align 4 |
1319 | image_file rd 1 |
1317 | image_file rd 1 |
1320 | raw_pointer rd 1 |
1318 | raw_pointer rd 1 |
1321 | return_code rd 1 |
1319 | return_code rd 1 |
1322 | img_size rd 1 |
1320 | img_size rd 1 |
1323 | deflate_unpack rd 1 |
1321 | deflate_unpack rd 1 |
1324 | raw_pointer_2 rd 1 ;+20 |
1322 | raw_pointer_2 rd 1 ;+20 |
1325 | ;--------------------------------------------------------------------- |
1323 | ;--------------------------------------------------------------------- |
1326 | ; end section |
1324 | ; end section |
1327 | ;--------------------------------------------------------------------- |
1325 | ;--------------------------------------------------------------------- |
1328 | align 4 |
1326 | align 4 |
1329 | ;--------------------------------------------------------------------- |
1327 | ;--------------------------------------------------------------------- |
1330 | wall0 rd 1 |
1328 | wall0 rd 1 |
1331 | wall1 rd 1 |
1329 | wall1 rd 1 |
1332 | wall2 rd 1 |
1330 | wall2 rd 1 |
1333 | wall3 rd 1 |
1331 | wall3 rd 1 |
1334 | wall4 rd 1 |
1332 | wall4 rd 1 |
1335 | wall5 rd 1 |
1333 | wall5 rd 1 |
1336 | wall6 rd 1 |
1334 | wall6 rd 1 |
1337 | wall7 rd 1 |
1335 | wall7 rd 1 |
1338 | ;screen_buffer rd 1 |
1336 | ;screen_buffer rd 1 |
1339 | active_process rd 1 |
1337 | active_process rd 1 |
1340 | 1338 | ||
1341 | ;mouse_position rd 1 |
1339 | ;mouse_position rd 1 |
1342 | mouse_position_old rd 1 |
1340 | mouse_position_old rd 1 |
1343 | ;--------------------------------------------------------------------- |
1341 | ;--------------------------------------------------------------------- |
1344 | align 4 |
1342 | align 4 |
1345 | col1: |
1343 | col1: |
1346 | dd ? ;- |
1344 | dd ? ;- |
1347 | ; misc raycaster vars: |
1345 | ; misc raycaster vars: |
1348 | vxx: |
1346 | vxx: |
1349 | dd ? ;- |
1347 | dd ? ;- |
1350 | vyy: |
1348 | vyy: |
1351 | dd ? ;- |
1349 | dd ? ;- |
1352 | vl: |
1350 | vl: |
1353 | dd ? ;- |
1351 | dd ? ;- |
1354 | vstepx: |
1352 | vstepx: |
1355 | dd ? ;- |
1353 | dd ? ;- |
1356 | vstepy: |
1354 | vstepy: |
1357 | dd ? ;- |
1355 | dd ? ;- |
1358 | vxxint: |
1356 | vxxint: |
1359 | dd ? ;- |
1357 | dd ? ;- |
1360 | vyyint: |
1358 | vyyint: |
1361 | dd ? ;- |
1359 | dd ? ;- |
1362 | vk: |
1360 | vk: |
1363 | dd ? ;- |
1361 | dd ? ;- |
1364 | va: |
1362 | va: |
1365 | dd ? ;- |
1363 | dd ? ;- |
1366 | va2: |
1364 | va2: |
1367 | dd ? ;- |
1365 | dd ? ;- |
1368 | vdd: |
1366 | vdd: |
1369 | dd ? ;- |
1367 | dd ? ;- |
1370 | vx1: |
1368 | vx1: |
1371 | dd ? ;- |
1369 | dd ? ;- |
1372 | vx1b: |
1370 | vx1b: |
1373 | dd ? ;- |
1371 | dd ? ;- |
1374 | vh: |
1372 | vh: |
1375 | dd ? ;- |
1373 | dd ? ;- |
1376 | vdt: |
1374 | vdt: |
1377 | dd ? ;- |
1375 | dd ? ;- |
1378 | vheading: ; initial heading: 0 to 3599 |
1376 | vheading: ; initial heading: 0 to 3599 |
1379 | dd ? ;- |
1377 | dd ? ;- |
1380 | vacompare: |
1378 | vacompare: |
1381 | dd ? ;- |
1379 | dd ? ;- |
1382 | vpxi: |
1380 | vpxi: |
1383 | dd ? ;- |
1381 | dd ? ;- |
1384 | vpyi: |
1382 | vpyi: |
1385 | dd ? ;- |
1383 | dd ? ;- |
1386 | wtolong: |
1384 | wtolong: |
1387 | dw ?,? ;-,?;- |
1385 | dw ?,? ;-,?;- |
1388 | 1386 | ||
1389 | xtemp: |
1387 | xtemp: |
1390 | dd ? ;- |
1388 | dd ? ;- |
1391 | ytemp: |
1389 | ytemp: |
1392 | dd ? ;- |
1390 | dd ? ;- |
1393 | xfrac: |
1391 | xfrac: |
1394 | dd ? ;- |
1392 | dd ? ;- |
1395 | yfrac: |
1393 | yfrac: |
1396 | dd ? ;- |
1394 | dd ? ;- |
1397 | h_old: |
1395 | h_old: |
1398 | dd ? ;- |
1396 | dd ? ;- |
1399 | vbottom: |
1397 | vbottom: |
1400 | dd ? ;- |
1398 | dd ? ;- |
1401 | ;mouseya: |
1399 | ;mouseya: |
1402 | ; dd ? ;- |
1400 | ; dd ? ;- |
1403 | remeax: |
1401 | remeax: |
1404 | dd ? ;- |
1402 | dd ? ;- |
1405 | remebx: |
1403 | remebx: |
1406 | dd ? ;- |
1404 | dd ? ;- |
1407 | remecx: |
1405 | remecx: |
1408 | dd ? ;- |
1406 | dd ? ;- |
1409 | remedx: |
1407 | remedx: |
1410 | dd ? ;- |
1408 | dd ? ;- |
1411 | remedi: |
1409 | remedi: |
1412 | dd ? ;- |
1410 | dd ? ;- |
1413 | remesi: |
1411 | remesi: |
1414 | dd ? ;- |
1412 | dd ? ;- |
1415 | red_color: |
1413 | red_color: |
1416 | dd ? ;- |
1414 | dd ? ;- |
1417 | green_color: |
1415 | green_color: |
1418 | dd ? ;- |
1416 | dd ? ;- |
1419 | blue_color: |
1417 | blue_color: |
1420 | dd ? ;- |
1418 | dd ? ;- |
1421 | pseudo: |
1419 | pseudo: |
1422 | dd ? ;- |
1420 | dd ? ;- |
1423 | step1: |
1421 | step1: |
1424 | dd ? ;- |
1422 | dd ? ;- |
1425 | ;step64: |
1423 | ;step64: |
1426 | ; dd ? ;- |
1424 | ; dd ? ;- |
1427 | lasty: |
1425 | lasty: |
1428 | dd ? ;- |
1426 | dd ? ;- |
1429 | ;--------------------------------------------------------------------- |
1427 | ;--------------------------------------------------------------------- |
1430 | ;I_END: |
1428 | ;I_END: |
1431 | IncludeUGlobals |
1429 | IncludeUGlobals |
1432 | align 4 |
1430 | align 4 |
1433 | sinus rd 360*10 |
1431 | sinus rd 360*10 |
1434 | eosinus: |
1432 | eosinus: |
1435 | ; rd 16*1024*4 |
1433 | ; rd 16*1024*4 |
1436 | ;--------------------------------------------------------------------- |
1434 | ;--------------------------------------------------------------------- |
1437 | align 4 |
1435 | align 4 |
1438 | rb 4096 |
1436 | rb 4096 |
1439 | stacktop: |
1437 | stacktop: |
1440 | ;--------------------------------------------------------------------- |
1438 | ;--------------------------------------------------------------------- |
1441 | procinfo: |
1439 | procinfo: |
1442 | rb 1024 |
1440 | rb 1024 |
1443 | ;--------------------------------------------------------------------- |
1441 | ;--------------------------------------------------------------------- |
1444 | path: |
1442 | path: |
1445 | rb 4096 |
1443 | rb 4096 |
1446 | ;--------------------------------------------------------------------- |
1444 | ;--------------------------------------------------------------------- |
1447 | file_name: |
1445 | file_name: |
1448 | rb 4096 |
1446 | rb 4096 |
1449 | ;--------------------------------------------------------------------- |
1447 | ;--------------------------------------------------------------------- |
1450 | file_info: |
1448 | file_info: |
1451 | rb 40 |
1449 | rb 40 |
1452 | ;--------------------------------------------------------------------- |
1450 | ;--------------------------------------------------------------------- |
1453 | screen_buffer: |
1451 | screen_buffer: |
1454 | rb 640*480*3 *3/2 |
1452 | rb 640*480*3 *3/2 |
1455 | ;--------------------------------------------------------------------- |
1453 | ;--------------------------------------------------------------------- |
1456 | I_END: |
1454 | I_END: |
1457 | ;---------------------------------------------------------------------640,480>50,649> |
1455 | ;---------------------------------------------------------------------640,480>50,484>50,649> |