Subversion Repositories Kolibri OS

Rev

Rev 2494 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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