149,14 → 149,16 |
|
|
mov ecx,[vheading] |
imul ecx,4 |
add ecx,sinus |
; imul ecx,4 |
; add ecx,sinus |
lea ecx, [sinus+ecx*4] |
mov edi,[ecx] |
|
mov edx,[vheading] |
imul edx,4 |
add edx,sinus |
add edx,3600 |
; imul edx,4 |
; add edx,sinus |
; add edx,3600 |
lea edx, [sinus+3600+edx*4] |
cmp edx,eosinus ;cosinus taken from (sinus plus 900) mod 3600 |
jb ok200 |
sub edx,14400 |
173,8 → 175,9 |
sar esi,16 |
mov ecx,esi |
sal ecx,5 ; equal *32 |
add ecx,edi |
add ecx,grid |
; add ecx,edi |
; add ecx,grid |
lea ecx, [grid+ecx+edi] |
cmp [ecx],byte 0 ; collision check |
jne cannotwalk0 |
mov [vpx],eax |
188,14 → 191,16 |
mov ebx,[vpy] |
|
mov ecx,[vheading] |
imul ecx,4 |
add ecx,sinus |
; imul ecx,4 |
; add ecx,sinus |
lea ecx, [sinus+ecx*4] |
mov edi,[ecx] |
|
mov edx,[vheading] |
imul edx,4 |
add edx,sinus |
add edx,3600 |
; imul edx,4 |
; add edx,sinus |
; add edx,3600 |
lea edx, [sinus+3600+edx*4] |
cmp edx,eosinus ;cosinus taken from (sinus plus 900) mod 3600 |
jb ok201 |
sub edx,14400 |
213,8 → 218,9 |
sar esi,16 |
mov ecx,esi |
sal ecx,5 |
add ecx,edi |
add ecx,grid |
; add ecx,edi |
; add ecx,grid |
lea ecx, [grid+ecx+edi] |
cmp [ecx],byte 0 |
jne cannotwalk1 |
mov [vpx],eax |
363,17 → 369,19 |
ok2: |
|
; get stepx and stepy |
mov ecx,edx |
imul ecx,4 |
add ecx,sinus ; pointer to stepx |
; mov ecx,edx |
; imul ecx,4 |
; add ecx,sinus ; pointer to stepx |
lea ecx, [sinus+edx*4] |
mov esi,[ecx] |
sar esi,4 ; accuracy |
mov [vstepx],esi ; store stepx |
|
mov esi,edx |
imul esi,4 |
add esi,sinus ; pointer to stepy |
add esi,3600 |
; mov esi,edx |
; imul esi,4 |
; add esi,sinus ; pointer to stepy |
; add esi,3600 |
lea esi, [sinus+3600+edx*4] |
cmp esi,eosinus ;cosinus taken from ((sinus plus 900) mod 3600) |
jb ok202 |
sub esi,14400 |
459,8 → 467,10 |
sal edi,8 |
mov esi,[xfrac] |
sal esi,2 |
add edi,esi |
add edi,wall ; in fact its floor, just using the wall texture :) |
; add edi,esi |
; add edi,wall ; in fact its floor, just using the wall texture :) |
lea edi, [wall+edi+esi] |
|
mov edx,[edi] |
mov [remesi],esi |
|
468,10 → 478,13 |
mov esi,[ytemp] |
add esi,240 |
imul esi,1920 |
add esi,[vx1] |
add esi,[vx1] |
add esi,[vx1] |
add esi,0x80000 |
; add esi,[vx1] |
; add esi,[vx1] |
; add esi,[vx1] |
; add esi,0x80000 |
mov eax, [vx1] |
lea eax, [eax+eax*2] |
lea esi, [0x80000+eax+esi] |
|
cmp esi,0x80000+1920*480 |
jg foff0 |
588,8 → 601,10 |
mov edx,ebx |
; imul edx,32 |
shl edx,5 |
add edx,grid |
add edx,eax |
; add edx,grid |
; add edx,eax |
lea edx, [grid+edx+eax] |
|
cmp [edx],byte 0 ; raycaster reached a wall? (0=no) |
jne getout |
cmp edi,10000 ; limit view range |
612,14 → 627,18 |
sub eax,1920 |
add ebx,1920 |
|
mov ecx,0 |
add ecx,[vx1] |
add ecx,[vx1] |
add ecx,[vx1] |
; mov ecx,0 |
; add ecx,[vx1] |
; add ecx,[vx1] |
; add ecx,[vx1] |
mov ecx, [vx1] |
lea ecx, [ecx+ecx*2] |
|
mov edx,ecx |
; mov edx,ecx |
; add ecx,eax |
; add edx,ebx |
lea edx, [ecx+ebx] |
add ecx,eax |
add edx,ebx |
|
mov esi,[edx] |
mov [ecx],esi |
673,7 → 692,8 |
xor edx,edx |
mov eax, edi |
mov ebx,[vdd] |
add ebx,[vdd] |
; add ebx,[vdd] |
add ebx, ebx |
div ebx |
and eax,63 |
mov [ytemp],eax ; get y of texture for wall |
763,12 → 783,16 |
|
; ******* DRAW WALL PIXEL ******* |
mov eax,esi |
sub eax,22 |
; sub eax,22 |
lea eax, [esi-22] |
imul eax,1920 |
add eax,[vx1] |
add eax,[vx1] |
add eax,[vx1] |
add eax,0x80000 |
; add eax,[vx1] |
; add eax,[vx1] |
; add eax,[vx1] |
; add eax,0x80000 |
mov ebx, [vx1] |
lea ebx, [ebx+ebx*2] |
lea eax, [eax+0x80000+ebx] |
|
cmp eax,0x80000+1920*480 |
jg dont_draw |
814,11 → 838,15 |
|
copyfloor2: |
add eax,1920 |
mov ebx,eax |
add ebx,[vx1] |
add ebx,[vx1] |
add ebx,[vx1] |
; mov ebx,eax |
; add ebx,[vx1] |
; add ebx,[vx1] |
; add ebx,[vx1] |
mov ebx,[vx1] |
lea ebx, [ebx+ebx*2] |
add ebx, eax |
|
|
mov ecx,[ebx-15] |
and ecx,0x00FEFEFE |
shr ecx,1 |
988,8 → 1016,9 |
sindiv dd 6553.5 |
textures: |
file 'texture.gif' |
I_END: |
|
align 4 |
|
col1: |
dd ?;- |
; misc raycaster vars: |
1075,5 → 1104,6 |
lasty: |
dd ?;- |
|
I_END: |
sinus rd 360*10 |
eosinus: |