Upload
This commit is contained in:
commit
43352ff262
1291 changed files with 220976 additions and 0 deletions
158
COMAN/ASM
Normal file
158
COMAN/ASM
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
PUBLIC _docol,_docolset
|
||||
|
||||
PUBLIC _docol_mapc,_docol_maph,_docol_ycd
|
||||
PUBLIC _docol_hig,_docol_higr,_docol_higrr,_docol_higrrr
|
||||
PUBLIC _docol_bailout,_docol_debug
|
||||
PUBLIC _docol_avg
|
||||
|
||||
BAILOUT equ 256
|
||||
|
||||
ALIGN 16
|
||||
_docol_hig dd 256 dup(0)
|
||||
_docol_higr dd 256 dup(0)
|
||||
_docol_higrr dd 256 dup(0)
|
||||
_docol_higrrr dd 256 dup(0)
|
||||
_docol_ycd dd 200 dup(0)
|
||||
_docol_bailout dw BAILOUT
|
||||
_docol_mapc dw 0,0
|
||||
_docol_maph dw 0,0
|
||||
_docol_avg dw 0,0
|
||||
_docol_debug dd 0
|
||||
|
||||
_docolset PROC FAR
|
||||
CBEG
|
||||
movpar ax,0
|
||||
mov cx,(slf1-slf0)/BAILOUT
|
||||
mul cx
|
||||
add ax,OFFSET slf0
|
||||
mov bx,ax
|
||||
movpar ax,1
|
||||
movpar dx,2
|
||||
mov cs:[bx+10+2],ax
|
||||
mov cs:[bx+10+4],dx
|
||||
CEND
|
||||
_docolset ENDP
|
||||
|
||||
public _doavg
|
||||
_doavg PROC FAR
|
||||
CBEG
|
||||
mov ax,SEG _vbuf
|
||||
mov es,ax
|
||||
mov ds,cs:_docol_avg[2]
|
||||
movpar di,0
|
||||
|
||||
add di,80*320
|
||||
mov cx,200-80
|
||||
@@1: mov bl,es:[di]
|
||||
diadd=2
|
||||
REPT 159
|
||||
mov bh,es:[di+diadd]
|
||||
mov al,ds:[bx]
|
||||
mov bl,bh
|
||||
mov es:[di+diadd-1],al
|
||||
diadd=diadd+2
|
||||
ENDM
|
||||
add di,320
|
||||
dec cx
|
||||
jz @@2
|
||||
jmp @@1
|
||||
@@2:
|
||||
CEND
|
||||
_doavg ENDP
|
||||
|
||||
_docol PROC FAR
|
||||
CBEG
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
|
||||
push bp ;store C parameter start
|
||||
|
||||
mov fs,ds:_docol_maph[2]
|
||||
mov gs,ds:_docol_mapc[2]
|
||||
|
||||
movpar ax,1
|
||||
shl ax,7
|
||||
movpar si,0
|
||||
movzx esi,si
|
||||
add si,ax ;basepos
|
||||
|
||||
xor ebx,ebx
|
||||
;movpar ax,3 ;screen pos
|
||||
;and ax,3
|
||||
;mov bh,al ;scatterer
|
||||
|
||||
movpar dx,2
|
||||
movsx edx,dx
|
||||
shl edx,7
|
||||
rol edx,16
|
||||
mov bp,dx
|
||||
add bp,-128 ;baseadd
|
||||
xor dx,dx
|
||||
|
||||
;selfmod: vram/pos, docol_ycd/pos
|
||||
;eax - -
|
||||
;ebx indexer-tmp (+scatterpos)
|
||||
;ecx - -
|
||||
;edx xaddl 0
|
||||
;esi xl x
|
||||
;edi - -
|
||||
;ebp - xaddh
|
||||
;ds code
|
||||
;es -
|
||||
;fs maph
|
||||
;gs mapc
|
||||
diadd=OFFSET slf0
|
||||
REPT BAILOUT
|
||||
and si,16383
|
||||
mov bl,fs:[si]
|
||||
mov eax,ds:_docol_hig[ebx*4]
|
||||
mov dword ptr ds:[diadd+0+2],eax ;set compare
|
||||
add esi,edx
|
||||
mov al,gs:[si]
|
||||
mov byte ptr ds:[diadd+8+1],al ;set color
|
||||
adc si,bp
|
||||
diadd=diadd+(slf1-slf0)/BAILOUT
|
||||
ENDM
|
||||
|
||||
jmp @@flsh
|
||||
@@flsh: pop bp ;restore C parameter start
|
||||
|
||||
mov ax,SEG _vbuf
|
||||
mov es,ax
|
||||
movpar ax,3
|
||||
mov bp,ax
|
||||
mov di,OFFSET _docol_ycd+199*4
|
||||
mov ecx,ds:[di]
|
||||
xor eax,eax
|
||||
|
||||
;selfmod: vram/pos, docol_ycd/pos
|
||||
;eax yc ycl
|
||||
;ebx - -
|
||||
;ecx ycaddh ycaddl
|
||||
;edx - -
|
||||
;esi - -
|
||||
;edi - offset to ycd
|
||||
;ebp - offset to vram
|
||||
;ds code
|
||||
;es vram
|
||||
|
||||
int 3
|
||||
|
||||
slf0: siadd=0
|
||||
REPT BAILOUT
|
||||
local l1,l2,l3
|
||||
l3: cmp eax,12345678h ;@0 compare ray / scene
|
||||
jge short l1 ;@6 hit?
|
||||
mov cl,12h ;@8 load color
|
||||
l2: sub eax,12345678h ;@10 adjust next ray pos
|
||||
mov es:[bp+0],cl ; store color
|
||||
sub di,4 ; adjust raytable pointer
|
||||
sub bp,320 ; next screen pos
|
||||
cmp dword ptr ds:l3[2],eax ; next ray hits too?
|
||||
jge short l2 ; yup.
|
||||
mov ecx,ds:[di] ; next ray direction
|
||||
l1: add eax,ecx ; on we go in Z
|
||||
siadd=siadd+4
|
||||
ENDM
|
||||
slf1: CEND
|
||||
_docol ENDP
|
||||
239
COMAN/ASM.ASM
Normal file
239
COMAN/ASM.ASM
Normal file
|
|
@ -0,0 +1,239 @@
|
|||
EXTRN theloop:far
|
||||
|
||||
code SEGMENT para public 'CODE'
|
||||
ASSUME cs:code
|
||||
.386
|
||||
LOCALS
|
||||
|
||||
PUBLIC _wave1,_wave2,_vbuf,_cameralevel
|
||||
_wave1 dw 0,0
|
||||
_wave2 dw 0,0
|
||||
_vbuf dw 0,0
|
||||
_cameralevel dw 0
|
||||
|
||||
PUBLIC _sin1024
|
||||
include sin1024.inc
|
||||
|
||||
PUBLIC _combguse
|
||||
_combguse db 90*160 dup(0)
|
||||
|
||||
PUBLIC _setborder
|
||||
_setborder PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
mov dx,3dah
|
||||
in al,dx
|
||||
mov dx,3c0h
|
||||
mov al,11h+32
|
||||
out dx,al
|
||||
mov al,[bp+6]
|
||||
out dx,al
|
||||
pop bp
|
||||
ret
|
||||
_setborder ENDP
|
||||
|
||||
PUBLIC _inittwk
|
||||
_inittwk PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
;clear palette
|
||||
mov dx,3c8h
|
||||
xor al,al
|
||||
out dx,al
|
||||
inc dx
|
||||
mov cx,768
|
||||
@@1: out dx,al
|
||||
loop @@1
|
||||
mov dx,3d4h
|
||||
;400 rows
|
||||
;mov ax,00009h
|
||||
;out dx,ax
|
||||
;tweak
|
||||
mov ax,00014h
|
||||
out dx,ax
|
||||
mov ax,0e317h
|
||||
out dx,ax
|
||||
mov dx,3c4h
|
||||
mov ax,0604h
|
||||
out dx,ax
|
||||
;
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
xor di,di
|
||||
mov cx,32768
|
||||
xor ax,ax
|
||||
rep stosw
|
||||
;
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_inittwk ENDP
|
||||
|
||||
PUBLIC _setpalarea
|
||||
_setpalarea PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
lds si,[bp+6]
|
||||
mov ax,[bp+10]
|
||||
mov dx,3c8h
|
||||
out dx,al
|
||||
mov cx,[bp+12]
|
||||
mov ax,cx
|
||||
shl cx,1
|
||||
add cx,ax
|
||||
inc dx
|
||||
rep outsb
|
||||
sti
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_setpalarea ENDP
|
||||
|
||||
PUBLIC _docol
|
||||
_docol PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
mov es,cs:_vbuf[2]
|
||||
mov fs,cs:_wave1[2]
|
||||
mov gs,cs:_wave2[2]
|
||||
mov ax,not 1
|
||||
mov si,[bp+6]
|
||||
and si,ax
|
||||
mov di,[bp+8]
|
||||
and di,ax
|
||||
mov cx,[bp+10]
|
||||
and cx,ax
|
||||
mov dx,[bp+12]
|
||||
and dx,ax
|
||||
mov bp,[bp+14]
|
||||
mov ax,cs:_cameralevel
|
||||
call theloop
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_docol ENDP
|
||||
|
||||
PUBLIC _docopy
|
||||
_docopy PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
mov es,[bp+6]
|
||||
|
||||
IFDEF PXLSUX
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
mov si,OFFSET _combguse
|
||||
mov di,0
|
||||
mov cx,60
|
||||
;
|
||||
@@7: mov dx,3c4h
|
||||
mov ax,0302h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 20
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
mov dx,3c4h
|
||||
mov ax,0C02h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 20
|
||||
mov eax,ds:[si+zzz+80]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add si,160
|
||||
add di,80
|
||||
dec cx
|
||||
jnz @@7
|
||||
ENDIF
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
mov es,[bp+6]
|
||||
mov ds,cs:_vbuf[2]
|
||||
mov si,60*160
|
||||
mov di,52*80
|
||||
mov cx,18*80/4
|
||||
xor eax,eax
|
||||
rep stosd
|
||||
mov cx,140
|
||||
mov bl,255
|
||||
mov bh,bl
|
||||
mov ax,bx
|
||||
shl ebx,16
|
||||
mov bx,ax
|
||||
;
|
||||
@@1: mov dx,3c4h
|
||||
mov ax,0302h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 20
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
mov dx,3c4h
|
||||
mov ax,0C02h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 20
|
||||
mov eax,ds:[si+zzz+80]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add si,160
|
||||
add di,80
|
||||
dec cx
|
||||
jnz @@1
|
||||
|
||||
; mov ax,cs
|
||||
; mov ds,ax
|
||||
; mov si,OFFSET _combguse+60*160
|
||||
xor eax,eax
|
||||
mov es,cs:_vbuf[2]
|
||||
mov di,68*160
|
||||
mov cx,30*160/4/4
|
||||
@@cl1: mov es:[di],eax
|
||||
add di,4
|
||||
mov es:[di],eax
|
||||
add di,4
|
||||
mov es:[di],eax
|
||||
add di,4
|
||||
mov es:[di],eax
|
||||
add di,4
|
||||
dec cx
|
||||
jnz @@cl1
|
||||
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_docopy ENDP
|
||||
|
||||
code ENDS
|
||||
END
|
||||
BIN
COMAN/ASM.OBJ
Normal file
BIN
COMAN/ASM.OBJ
Normal file
Binary file not shown.
207
COMAN/ASM1.ASM
Normal file
207
COMAN/ASM1.ASM
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
EXTRN theloop:far
|
||||
|
||||
code SEGMENT para public 'CODE'
|
||||
ASSUME cs:code
|
||||
.386
|
||||
LOCALS
|
||||
|
||||
PUBLIC _wave1,_wave2,_vbuf,_cameralevel
|
||||
_wave1 dw 0,0
|
||||
_wave2 dw 0,0
|
||||
_vbuf dw 0,0
|
||||
_cameralevel dw 0
|
||||
|
||||
PUBLIC _sin1024
|
||||
include sin1024.inc
|
||||
|
||||
PUBLIC _setborder
|
||||
_setborder PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
mov dx,3dah
|
||||
in al,dx
|
||||
mov dx,3c0h
|
||||
mov al,11h+32
|
||||
out dx,al
|
||||
mov al,[bp+6]
|
||||
out dx,al
|
||||
pop bp
|
||||
ret
|
||||
_setborder ENDP
|
||||
|
||||
PUBLIC _inittwk
|
||||
_inittwk PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
;clear palette
|
||||
mov dx,3c8h
|
||||
xor al,al
|
||||
out dx,al
|
||||
inc dx
|
||||
mov cx,768
|
||||
@@1: out dx,al
|
||||
loop @@1
|
||||
mov dx,3d4h
|
||||
;400 rows
|
||||
;mov ax,00009h
|
||||
;out dx,ax
|
||||
;tweak
|
||||
mov ax,00014h
|
||||
out dx,ax
|
||||
mov ax,0e317h
|
||||
out dx,ax
|
||||
mov dx,3c4h
|
||||
mov ax,0604h
|
||||
out dx,ax
|
||||
;
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
xor di,di
|
||||
mov cx,32768
|
||||
xor ax,ax
|
||||
rep stosw
|
||||
;
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_inittwk ENDP
|
||||
|
||||
PUBLIC _setpalarea
|
||||
_setpalarea PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
lds si,[bp+6]
|
||||
mov ax,[bp+10]
|
||||
mov dx,3c8h
|
||||
out dx,al
|
||||
mov cx,[bp+12]
|
||||
mov ax,cx
|
||||
shl cx,1
|
||||
add cx,ax
|
||||
inc dx
|
||||
rep outsb
|
||||
sti
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_setpalarea ENDP
|
||||
|
||||
PUBLIC _docol
|
||||
_docol PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
mov es,cs:_vbuf[2]
|
||||
mov fs,cs:_wave1[2]
|
||||
mov gs,cs:_wave2[2]
|
||||
mov si,[bp+6]
|
||||
mov di,[bp+8]
|
||||
mov cx,[bp+10]
|
||||
add cx,cx
|
||||
mov dx,[bp+12]
|
||||
add dx,dx
|
||||
mov bp,[bp+14]
|
||||
mov ax,cs:_cameralevel
|
||||
int 3
|
||||
call theloop
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_docol ENDP
|
||||
|
||||
PUBLIC _docopy
|
||||
_docopy PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
mov es,[bp+6]
|
||||
mov ds,cs:_vbuf[2]
|
||||
mov si,50*160
|
||||
mov di,50*80
|
||||
mov cx,150
|
||||
mov bl,255
|
||||
mov bh,bl
|
||||
mov ax,bx
|
||||
shl ebx,16
|
||||
mov bx,ax
|
||||
@@1: cmp cx,100
|
||||
jge @@2
|
||||
mov dx,3c4h
|
||||
mov ax,0302h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 20
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
mov dx,3c4h
|
||||
mov ax,0C02h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 20
|
||||
mov eax,ds:[si+zzz+80]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add si,160
|
||||
add di,80
|
||||
dec cx
|
||||
jnz @@1
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
@@2: ;this loop also clears
|
||||
mov dx,3c4h
|
||||
mov ax,0302h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 20
|
||||
mov eax,ds:[si+zzz]
|
||||
mov ds:[si+zzz],ebx
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
mov dx,3c4h
|
||||
mov ax,0C02h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 20
|
||||
mov eax,ds:[si+zzz+80]
|
||||
mov ds:[si+zzz+80],ebx
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
sub ebx,01010101h
|
||||
cmp bl,192
|
||||
jge @@3
|
||||
mov ebx,0c0c0c0c0h
|
||||
@@3: add si,160
|
||||
add di,80
|
||||
dec cx
|
||||
jmp @@1
|
||||
_docopy ENDP
|
||||
|
||||
code ENDS
|
||||
END
|
||||
BIN
COMAN/C.EXE
Normal file
BIN
COMAN/C.EXE
Normal file
Binary file not shown.
BIN
COMAN/COMBG.LBM
Normal file
BIN
COMAN/COMBG.LBM
Normal file
Binary file not shown.
BIN
COMAN/COMBG.UH
Normal file
BIN
COMAN/COMBG.UH
Normal file
Binary file not shown.
BIN
COMAN/COMBG.X
Normal file
BIN
COMAN/COMBG.X
Normal file
Binary file not shown.
129
COMAN/DOLOOP.1
Normal file
129
COMAN/DOLOOP.1
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int depth=2;
|
||||
int bail=150;
|
||||
int group=3;
|
||||
|
||||
FILE *f1;
|
||||
|
||||
void P(char *str,...)
|
||||
{
|
||||
char out[256];
|
||||
va_list argp;
|
||||
va_start(argp,str);
|
||||
vsprintf(out,str,argp);
|
||||
fprintf(f1,"%s\n",out);
|
||||
va_end(argp);
|
||||
}
|
||||
|
||||
long weirdflip(unsigned long l)
|
||||
{
|
||||
long m,lo,hi;
|
||||
lo=l&0xffff;
|
||||
hi=l>>16;
|
||||
m=(lo<<16)+hi;
|
||||
return(m);
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
int i,j,jm,y,a;
|
||||
long l;
|
||||
f1=fopen("theloop.inc","wt");
|
||||
|
||||
P(";Register usage: ");
|
||||
P(";eax low... ray heigth ");
|
||||
P(";ebx - p->screen ");
|
||||
P(";ecx low... ray direction (always negative)");
|
||||
P(";edx - scenary heigth ");
|
||||
P(";esi - xsin ");
|
||||
P(";edi - ysin ");
|
||||
P(";ebp - p->ray_dir_table");
|
||||
P(";ds ->codesegment");
|
||||
P(";es ->screenbuffer");
|
||||
P(";fs ->wavetable");
|
||||
P(";gs -");
|
||||
P("");
|
||||
P("ALIGN 16 ;following should stay in cache");
|
||||
P("theloop_waveseg dw 0");
|
||||
P("theloop_xsina dw 0");
|
||||
P("theloop_ysina dw 0");
|
||||
P("theloop_heigth dw 0");
|
||||
P("theloop_raydir LABEL DWORD");
|
||||
for(y=0;y<200;y++)
|
||||
{
|
||||
a=(199-y)-100;
|
||||
l=-(long)a*10L*256L*depth;
|
||||
l=weirdflip(l);
|
||||
P("dd 0%08lXh",l);
|
||||
}
|
||||
P("");
|
||||
P(";entry: es=videbuf");
|
||||
P("; bp=pointer to bottom of current column in videbuf");
|
||||
P("; fs=waveXsegment");
|
||||
P("; gs=waveYsegment");
|
||||
P("; si=waveXpos");
|
||||
P("; di=waveYpos");
|
||||
P("; cx=waveXadd");
|
||||
P("; dx=waveYadd");
|
||||
P("; ax=camera heigth adder");
|
||||
P("theloop PROC FAR");
|
||||
P("mov bx,bp");
|
||||
P("mov cs:theloop_xsina,cx");
|
||||
P("mov cs:theloop_ysina,dx");
|
||||
P("mov cs:theloop_heigth,ax");
|
||||
P("mov bp,OFFSET theloop_raydir");
|
||||
P("mov ax,cs");
|
||||
P("mov ds,ax");
|
||||
P("xor eax,eax");
|
||||
P("mov ecx,ds:[bp]");
|
||||
P("add bp,4");
|
||||
for(i=0;i<bail;i+=group)
|
||||
{
|
||||
printf("%i\r",i);
|
||||
jm=i+group; if(jm>bail) jm=bail;
|
||||
for(j=i;j<jm;j++)
|
||||
{
|
||||
P("_@seek%i:",j);
|
||||
P("add si,ds:theloop_xsina");
|
||||
P("xor dh,dh");
|
||||
P("mov dl,fs:[si]");
|
||||
P("add di,ds:theloop_ysina");
|
||||
P("add dl,gs:[di]");
|
||||
P("add dx,ds:theloop_heigth");
|
||||
P("cmp ax,dx");
|
||||
P("jl short _@hit%i",j);
|
||||
P("_@seekr%i:",j);
|
||||
P("add eax,ecx");
|
||||
P("adc ax,-1");
|
||||
}
|
||||
if(jm>=bail)
|
||||
{
|
||||
P("_@seek%i:",bail);
|
||||
P("_@seekr%i:",bail);
|
||||
P("ret");
|
||||
}
|
||||
else P("jmp _@seek%i",jm);
|
||||
for(j=i;j<jm;j++)
|
||||
{
|
||||
l=j*10L*256;
|
||||
l=weirdflip(l);
|
||||
P("_@hit%i:",j);
|
||||
P("add eax,0%08lXh",l*depth);
|
||||
P("adc ax,0");
|
||||
P("mov es:[bx],dl");
|
||||
P("add bp,4");
|
||||
P("sub bx,320");
|
||||
P("cmp ax,dx");
|
||||
P("jle short _@hit%i",j);
|
||||
P("mov ecx,ds:[bp]");
|
||||
P("jmp short _@seekr%i",j+1);
|
||||
}
|
||||
}
|
||||
P("theloop ENDP");
|
||||
printf(" \r",i);
|
||||
|
||||
fclose(f1);
|
||||
}
|
||||
165
COMAN/DOLOOP.C
Normal file
165
COMAN/DOLOOP.C
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <conio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int horizony=70;
|
||||
int bailstart=0; // must be divisible by 2
|
||||
int bail=192;
|
||||
int bailhalve=64;
|
||||
int group=500;
|
||||
int zwave[1024];
|
||||
|
||||
FILE *f1;
|
||||
|
||||
void P(char *str,...)
|
||||
{
|
||||
char out[256];
|
||||
va_list argp;
|
||||
va_start(argp,str);
|
||||
vsprintf(out,str,argp);
|
||||
fprintf(f1,"%s\n",out);
|
||||
va_end(argp);
|
||||
}
|
||||
|
||||
long wflip(unsigned long l)
|
||||
{
|
||||
long m,lo,hi;
|
||||
lo=l&0xffff;
|
||||
hi=l>>16;
|
||||
m=(lo<<16)+hi;
|
||||
return(m);
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
int i,j,jm,y,a;
|
||||
int sina=1;
|
||||
long l,firstraydir;
|
||||
f1=fopen("theloop.inc","wt");
|
||||
|
||||
for(i=0;i<bail;i++)
|
||||
{
|
||||
zwave[i]=16.0*sin((double)i*3.1415926535*2.0*3.0/(double)bail);
|
||||
}
|
||||
|
||||
P(";Register usage: ");
|
||||
P(";eax low... ray heigth ");
|
||||
P(";ebx - scenary heigth ");
|
||||
P(";ecx low... ray direction (always negative)");
|
||||
P(";edx - tmp ");
|
||||
P(";esi - xsin ");
|
||||
P(";edi - ysin ");
|
||||
P(";ebp - p->screen ");
|
||||
P(";ds ->codesegment");
|
||||
P(";es ->screenbuffer");
|
||||
P(";fs ->wavetablex");
|
||||
P(";gs ->wavetabley");
|
||||
P("");
|
||||
P("ALIGN 16 ;following should stay in cache");
|
||||
P("theloop_waveseg dw 0");
|
||||
P("theloop_xsina1 dw 0");
|
||||
P("theloop_ysina1 dw 0");
|
||||
P("theloop_xsina2 dw 0");
|
||||
P("theloop_ysina2 dw 0");
|
||||
P("theloop_heigth dw 0");
|
||||
firstraydir=-(200-horizony)*2560L;
|
||||
P("");
|
||||
P(";entry: es=videbuf");
|
||||
P("; bp=pointer to bottom of current column in videbuf");
|
||||
P("; fs=waveXsegment");
|
||||
P("; gs=waveYsegment");
|
||||
P("; si=waveXpos");
|
||||
P("; di=waveYpos");
|
||||
P("; cx=waveXadd");
|
||||
P("; dx=waveYadd");
|
||||
P("; ax=camera heigth adder");
|
||||
P("theloop PROC FAR");
|
||||
P("mov cs:theloop_xsina1,cx");
|
||||
P("mov cs:theloop_ysina1,dx");
|
||||
P("add cx,cx");
|
||||
P("mov cs:theloop_xsina2,cx");
|
||||
P("add dx,dx");
|
||||
P("mov cs:theloop_ysina2,dx");
|
||||
P("mov cs:theloop_heigth,ax");
|
||||
P("mov ax,cs");
|
||||
P("mov ds,ax");
|
||||
P("xor eax,eax");
|
||||
P("mov ecx,0%08lXh",wflip(firstraydir));
|
||||
for(i=bailstart;i<bail;i+=group)
|
||||
{
|
||||
jm=i+group; if(jm>bail) jm=bail;
|
||||
for(j=i;j<jm;j++)
|
||||
{
|
||||
printf("%i\r",j);
|
||||
|
||||
if(j==bailhalve)
|
||||
{
|
||||
sina=2;
|
||||
}
|
||||
|
||||
P("_@seek%i:",j);
|
||||
P("add si,ds:theloop_xsina%i",sina);
|
||||
P("mov bx,fs:[si]");
|
||||
P("add di,ds:theloop_ysina%i",sina);
|
||||
P("add bx,gs:[di]");
|
||||
P("add bx,%i",zwave[j]-240);
|
||||
P("cmp ax,bx");
|
||||
P("jge short _@seeko%i",j);
|
||||
|
||||
P("lea dx,[bx+%i]",120-j/8);
|
||||
P("shr dl,1");
|
||||
P("_@hit%i:",j);
|
||||
l=(long)(j)*2560L;
|
||||
l=wflip(l);
|
||||
/**/
|
||||
P("add eax,0%08lXh",l);
|
||||
P("adc ax,0");
|
||||
P("mov es:[bp],dl");
|
||||
P("cmp ax,bx");
|
||||
P("jge short _@seek1a%i",j);
|
||||
P("add eax,0%08lXh",l);
|
||||
P("adc ax,0");
|
||||
P("mov es:[bp-160],dl");
|
||||
P("cmp ax,bx");
|
||||
P("jge short _@seek2a%i",j);
|
||||
P("add eax,0%08lXh",l);
|
||||
P("adc ax,0");
|
||||
P("mov es:[bp-320],dl");
|
||||
/**/
|
||||
P("add ecx,0%08lXh",wflip(3L*2560L));
|
||||
P("adc cx,0");
|
||||
P("sub bp,160*3");
|
||||
/**/
|
||||
P("cmp ax,bx");
|
||||
P("jge short _@seeko%i",j);
|
||||
P("jmp _@hit%i",j);
|
||||
|
||||
P("_@seek2a%i:",j);
|
||||
P("sub bp,160");
|
||||
P("add ecx,0%08lXh",wflip(2560L));
|
||||
P("_@seek1a%i:",j); // carry=0 when jmp here!
|
||||
P("adc ecx,0%08lXh",wflip(2560L));
|
||||
P("adc cx,0");
|
||||
P("sub bp,160");
|
||||
|
||||
P("_@seeko%i:",j);
|
||||
P("add eax,ecx");
|
||||
if(sina==2) P("adc eax,ecx");
|
||||
P("adc ax,-1");
|
||||
|
||||
if(sina==2) j++;
|
||||
}
|
||||
if(jm>=bail)
|
||||
{
|
||||
P("_@seek%i:",bail);
|
||||
P("_@seekr%i:",bail);
|
||||
P("ret");
|
||||
}
|
||||
else P("jmp _@seek%i",jm);
|
||||
}
|
||||
P("theloop ENDP");
|
||||
printf(" \r",i);
|
||||
|
||||
fclose(f1);
|
||||
}
|
||||
BIN
COMAN/DOLOOP.EXE
Normal file
BIN
COMAN/DOLOOP.EXE
Normal file
Binary file not shown.
BIN
COMAN/DOLOOP.OBJ
Normal file
BIN
COMAN/DOLOOP.OBJ
Normal file
Binary file not shown.
155
COMAN/DOLOOP.OK
Normal file
155
COMAN/DOLOOP.OK
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int depth=2;
|
||||
int bail=150;
|
||||
int group=150;
|
||||
|
||||
FILE *f1;
|
||||
|
||||
void P(char *str,...)
|
||||
{
|
||||
char out[256];
|
||||
va_list argp;
|
||||
va_start(argp,str);
|
||||
vsprintf(out,str,argp);
|
||||
fprintf(f1,"%s\n",out);
|
||||
va_end(argp);
|
||||
}
|
||||
|
||||
long weirdflip(unsigned long l)
|
||||
{
|
||||
long m,lo,hi;
|
||||
lo=l&0xffff;
|
||||
hi=l>>16;
|
||||
m=(lo<<16)+hi;
|
||||
return(m);
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
int i,j,jm,y,a;
|
||||
long l;
|
||||
f1=fopen("theloop.inc","wt");
|
||||
|
||||
P(";Register usage: ");
|
||||
P(";eax low... ray heigth ");
|
||||
P(";ebx - p->screen ");
|
||||
P(";ecx low... ray direction (always negative)");
|
||||
P(";edx - scenary heigth ");
|
||||
P(";esi - xsin ");
|
||||
P(";edi - ysin ");
|
||||
P(";ebp - p->ray_dir_table");
|
||||
P(";ds ->codesegment");
|
||||
P(";es ->screenbuffer");
|
||||
P(";fs ->wavetable");
|
||||
P(";gs -");
|
||||
P("");
|
||||
P("ALIGN 16 ;following should stay in cache");
|
||||
P("theloop_waveseg dw 0");
|
||||
P("theloop_xsina dw 0");
|
||||
P("theloop_ysina dw 0");
|
||||
P("theloop_heigth dw 0");
|
||||
P("theloop_raydir LABEL DWORD");
|
||||
for(y=0;y<200;y++)
|
||||
{
|
||||
a=(199-y)-100;
|
||||
l=-(long)a*10L*256L*depth;
|
||||
l=weirdflip(l);
|
||||
P("dd 0%08lXh",l);
|
||||
}
|
||||
P("");
|
||||
P(";entry: es=videbuf");
|
||||
P("; bp=pointer to bottom of current column in videbuf");
|
||||
P("; fs=waveXsegment");
|
||||
P("; gs=waveYsegment");
|
||||
P("; si=waveXpos");
|
||||
P("; di=waveYpos");
|
||||
P("; cx=waveXadd");
|
||||
P("; dx=waveYadd");
|
||||
P("; ax=camera heigth adder");
|
||||
P("theloop PROC FAR");
|
||||
P("mov bx,bp");
|
||||
P("mov cs:theloop_xsina,cx");
|
||||
P("mov cs:theloop_ysina,dx");
|
||||
P("mov cs:theloop_heigth,ax");
|
||||
P("mov bp,OFFSET theloop_raydir");
|
||||
P("mov ax,cs");
|
||||
P("mov ds,ax");
|
||||
P("xor eax,eax");
|
||||
P("mov ecx,ds:[bp]");
|
||||
P("add bp,4");
|
||||
for(i=0;i<bail;i+=group)
|
||||
{
|
||||
jm=i+group; if(jm>bail) jm=bail;
|
||||
for(j=i;j<jm;j++)
|
||||
{
|
||||
printf("%i\r",j);
|
||||
|
||||
P("_@seek%i:",j);
|
||||
P("add si,ds:theloop_xsina");
|
||||
P("xor dh,dh");
|
||||
P("mov dl,fs:[si]");
|
||||
P("add di,ds:theloop_ysina");
|
||||
P("add dl,gs:[di]");
|
||||
P("add dx,ds:theloop_heigth");
|
||||
P("cmp ax,dx");
|
||||
P("jge short _@seeko%i",j);
|
||||
|
||||
l=j*10L*256*depth;
|
||||
l=weirdflip(l);
|
||||
P("_@hit%i:",j);
|
||||
P("add eax,0%08lXh",l);
|
||||
P("adc ax,0");
|
||||
P("mov es:[bx],dl");
|
||||
P("cmp ax,dx");
|
||||
P("jge short _@seek1a%i",j);
|
||||
P("add eax,0%08lXh",l);
|
||||
P("adc ax,0");
|
||||
P("mov es:[bx-320],dl");
|
||||
P("cmp ax,dx");
|
||||
P("jge short _@seek2a%i",j);
|
||||
P("add eax,0%08lXh",l);
|
||||
P("adc ax,0");
|
||||
P("mov es:[bx-640],dl");
|
||||
P("cmp ax,dx");
|
||||
P("jge short _@seek3a%i",j);
|
||||
P("add eax,0%08lXh",l);
|
||||
P("adc ax,0");
|
||||
P("mov es:[bx-960],dl");
|
||||
P("add bp,4*4");
|
||||
P("sub bx,320*4");
|
||||
P("cmp ax,dx");
|
||||
P("jge short _@seek0a%i",j);
|
||||
P("jmp _@hit%i",j);
|
||||
|
||||
P("_@seek3a%i:",j);
|
||||
P("add bp,4");
|
||||
P("sub bx,320");
|
||||
P("_@seek2a%i:",j);
|
||||
P("add bp,4");
|
||||
P("sub bx,320");
|
||||
P("_@seek1a%i:",j);
|
||||
P("add bp,4");
|
||||
P("sub bx,320");
|
||||
P("_@seek0a%i:",j);
|
||||
P("mov ecx,ds:[bp]");
|
||||
|
||||
P("_@seeko%i:",j);
|
||||
P("add eax,ecx");
|
||||
P("adc ax,-1");
|
||||
}
|
||||
if(jm>=bail)
|
||||
{
|
||||
P("_@seek%i:",bail);
|
||||
P("_@seekr%i:",bail);
|
||||
P("ret");
|
||||
}
|
||||
else P("jmp _@seek%i",jm);
|
||||
}
|
||||
P("theloop ENDP");
|
||||
printf(" \r",i);
|
||||
|
||||
fclose(f1);
|
||||
}
|
||||
185
COMAN/DOLOOP1.C
Normal file
185
COMAN/DOLOOP1.C
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <conio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int horizony=70;
|
||||
int bailstart=0; // must be divisible by 2
|
||||
int bail=192;
|
||||
int bailhalve=64;
|
||||
int group=150;
|
||||
int zwave[1024];
|
||||
|
||||
FILE *f1;
|
||||
|
||||
void P(char *str,...)
|
||||
{
|
||||
char out[256];
|
||||
va_list argp;
|
||||
va_start(argp,str);
|
||||
vsprintf(out,str,argp);
|
||||
fprintf(f1,"%s\n",out);
|
||||
va_end(argp);
|
||||
}
|
||||
|
||||
long wflip(unsigned long l)
|
||||
{
|
||||
long m,lo,hi;
|
||||
lo=l&0xffff;
|
||||
hi=l>>16;
|
||||
m=(lo<<16)+hi;
|
||||
return(m);
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
int i,j,jm,y,a;
|
||||
int sina=1;
|
||||
long l,firstraydir;
|
||||
f1=fopen("theloop.inc","wt");
|
||||
|
||||
for(i=0;i<bail;i++)
|
||||
{
|
||||
zwave[i]=16.0*sin((double)i*3.1415926535*2.0*3.0/(double)bail);
|
||||
}
|
||||
|
||||
P(";Register usage: ");
|
||||
P(";eax low... ray heigth ");
|
||||
P(";ebx - p->screen ");
|
||||
P(";ecx low... ray direction (always negative)");
|
||||
P(";edx - scenary heigth ");
|
||||
P(";esi - xsin ");
|
||||
P(";edi - ysin ");
|
||||
P(";ebp - - ");
|
||||
P(";ds ->codesegment");
|
||||
P(";es ->screenbuffer");
|
||||
P(";fs ->wavetablex");
|
||||
P(";gs ->wavetabley");
|
||||
P("");
|
||||
P("ALIGN 16 ;following should stay in cache");
|
||||
P("theloop_waveseg dw 0");
|
||||
P("theloop_xsina1 dw 0");
|
||||
P("theloop_ysina1 dw 0");
|
||||
P("theloop_xsina2 dw 0");
|
||||
P("theloop_ysina2 dw 0");
|
||||
P("theloop_heigth dw 0");
|
||||
firstraydir=-(200-horizony)*2560L;
|
||||
P("");
|
||||
P(";entry: es=videbuf");
|
||||
P("; bp=pointer to bottom of current column in videbuf");
|
||||
P("; fs=waveXsegment");
|
||||
P("; gs=waveYsegment");
|
||||
P("; si=waveXpos");
|
||||
P("; di=waveYpos");
|
||||
P("; cx=waveXadd");
|
||||
P("; dx=waveYadd");
|
||||
P("; ax=camera heigth adder");
|
||||
P("theloop PROC FAR");
|
||||
P("mov bx,bp");
|
||||
P("mov cs:theloop_xsina1,cx");
|
||||
P("mov cs:theloop_ysina1,dx");
|
||||
P("add cx,cx");
|
||||
P("mov cs:theloop_xsina2,cx");
|
||||
P("add dx,dx");
|
||||
P("mov cs:theloop_ysina2,dx");
|
||||
P("mov cs:theloop_heigth,ax");
|
||||
//P("mov bp,OFFSET theloop_raydir");
|
||||
P("mov ax,cs");
|
||||
P("mov ds,ax");
|
||||
P("xor eax,eax");
|
||||
P("mov ecx,0%08lXh",wflip(firstraydir));
|
||||
for(i=0;i<bailstart/2;i++)
|
||||
{
|
||||
P("add si,cx");
|
||||
P("add si,dx");
|
||||
P("add eax,0%08lXh",wflip(firstraydir*2L));
|
||||
P("adc ax,-1");
|
||||
}
|
||||
for(i=bailstart;i<bail;i+=group)
|
||||
{
|
||||
jm=i+group; if(jm>bail) jm=bail;
|
||||
for(j=i;j<jm;j++)
|
||||
{
|
||||
printf("%i\r",j);
|
||||
|
||||
/*
|
||||
if(j==bailhalve)
|
||||
{
|
||||
P("add ecx,ecx");
|
||||
sina=2;
|
||||
}
|
||||
*/
|
||||
|
||||
P("_@seek%i:",j);
|
||||
P("add si,ds:theloop_xsina%i",sina);
|
||||
P("mov dl,fs:[si]");
|
||||
P("xor dh,dh");
|
||||
P("add di,ds:theloop_ysina%i",sina);
|
||||
P("add dl,gs:[di]");
|
||||
P("add dx,%i",zwave[j]+30-j/4+(-260));
|
||||
//P("add dx,ds:theloop_heigth");
|
||||
P("cmp ax,dx");
|
||||
P("jge short _@seeko%i",j);
|
||||
|
||||
l=(long)j*2560L;
|
||||
l=wflip(l);
|
||||
P("_@hit%i:",j);
|
||||
if(l)
|
||||
{
|
||||
P("add eax,0%08lXh",l);
|
||||
P("adc ax,0");
|
||||
}
|
||||
P("mov es:[bx],dl");
|
||||
P("cmp ax,dx");
|
||||
P("jge short _@seek1a%i",j);
|
||||
if(l)
|
||||
{
|
||||
P("add eax,0%08lXh",l);
|
||||
P("adc ax,0");
|
||||
}
|
||||
P("mov es:[bx-160],dl");
|
||||
P("cmp ax,dx");
|
||||
P("jge short _@seek2a%i",j);
|
||||
if(l)
|
||||
{
|
||||
P("add eax,0%08lXh",l);
|
||||
P("adc ax,0");
|
||||
}
|
||||
P("mov es:[bx-320],dl");
|
||||
/**/
|
||||
P("add ecx,0%08lXh",wflip((long)sina*3L*2560L));
|
||||
P("adc cx,0");
|
||||
P("sub bx,160*3");
|
||||
/**/
|
||||
P("cmp ax,dx");
|
||||
P("jge short _@seeko%i",j);
|
||||
P("jmp _@hit%i",j);
|
||||
|
||||
P("_@seek2a%i:",j);
|
||||
P("add ecx,0%08lXh",wflip((long)sina*2560L));
|
||||
P("adc cx,0");
|
||||
P("sub bx,160");
|
||||
P("_@seek1a%i:",j);
|
||||
P("add ecx,0%08lXh",wflip((long)sina*2560L));
|
||||
P("adc cx,0");
|
||||
P("sub bx,160");
|
||||
|
||||
P("_@seeko%i:",j);
|
||||
P("add eax,ecx");
|
||||
P("adc ax,-1");
|
||||
|
||||
if(sina==2) j++;
|
||||
}
|
||||
if(jm>=bail)
|
||||
{
|
||||
P("_@seek%i:",bail);
|
||||
P("_@seekr%i:",bail);
|
||||
P("ret");
|
||||
}
|
||||
else P("jmp _@seek%i",jm);
|
||||
}
|
||||
P("theloop ENDP");
|
||||
printf(" \r",i);
|
||||
|
||||
fclose(f1);
|
||||
}
|
||||
131
COMAN/DOLOOP2.C
Normal file
131
COMAN/DOLOOP2.C
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <conio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int horizony=70;
|
||||
int bail=192;
|
||||
int bailhalve=64;
|
||||
int group=150;
|
||||
int zwave[1024];
|
||||
|
||||
FILE *f1;
|
||||
|
||||
void P(char *str,...)
|
||||
{
|
||||
char out[256];
|
||||
va_list argp;
|
||||
va_start(argp,str);
|
||||
vsprintf(out,str,argp);
|
||||
fprintf(f1,"%s\n",out);
|
||||
va_end(argp);
|
||||
}
|
||||
|
||||
long wflip(unsigned long l)
|
||||
{
|
||||
long m,lo,hi;
|
||||
lo=l&0xffff;
|
||||
hi=l>>16;
|
||||
m=(lo<<16)+hi;
|
||||
return(m);
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
int i,j,k,jm,y,a;
|
||||
int sina=1;
|
||||
long l,firstraydir;
|
||||
f1=fopen("theloop.inc","wt");
|
||||
|
||||
for(i=0;i<bail;i++)
|
||||
{
|
||||
zwave[i]=(int)(16.0*sin((double)i*3.1415926535*2.0*3.0/(double)bail));
|
||||
}
|
||||
|
||||
P(";Register usage: ");
|
||||
P(";eax low... ray heigth ");
|
||||
P(";ebx - ! ");
|
||||
P(";ecx low... ray direction (always negative)");
|
||||
P(";edx bail scenary heigth ");
|
||||
P(";esi - xsin ");
|
||||
P(";edi - ysin ");
|
||||
P(";ebp - p->screen ");
|
||||
P(";ds ->codesegment");
|
||||
P(";es ->screenbuffer");
|
||||
P(";fs ->wavetablex");
|
||||
P(";gs ->wavetabley");
|
||||
P("");
|
||||
P("ALIGN 16 ;following should stay in cache");
|
||||
P("theloop_waveseg dw 0");
|
||||
P("theloop_xsina1 dw 0");
|
||||
P("theloop_ysina1 dw 0");
|
||||
P("theloop_xsina2 dw 0");
|
||||
P("theloop_ysina2 dw 0");
|
||||
P("theloop_heigth dw 0");
|
||||
firstraydir=-(200-horizony)*2560L;
|
||||
P("");
|
||||
P(";entry: es=videbuf");
|
||||
P("; bp=pointer to bottom of current column in videbuf");
|
||||
P("; fs=waveXsegment");
|
||||
P("; gs=waveYsegment");
|
||||
P("; si=waveXpos");
|
||||
P("; di=waveYpos");
|
||||
P("; cx=waveXadd");
|
||||
P("; dx=waveYadd");
|
||||
P("; ax=camera heigth adder");
|
||||
P("theloop PROC FAR");
|
||||
P("mov cs:theloop_xsina1,cx");
|
||||
P("mov cs:theloop_ysina1,dx");
|
||||
P("add cx,cx");
|
||||
P("mov cs:theloop_xsina2,cx");
|
||||
P("add dx,dx");
|
||||
P("mov cs:theloop_ysina2,dx");
|
||||
P("mov cs:theloop_heigth,ax");
|
||||
P("mov bx,cs:theloop_xsina1");
|
||||
//P("mov bp,OFFSET theloop_raydir");
|
||||
P("mov ax,cs");
|
||||
P("mov ds,ax");
|
||||
P("mov edx,10000h*(%i/3)",-bail);
|
||||
P("xor eax,eax");
|
||||
P("xor ecx,ecx");
|
||||
for(i=199;i>=horizony;i--)
|
||||
{
|
||||
j=i;
|
||||
printf("%i \r",j);
|
||||
|
||||
// seek until scene hits row i
|
||||
P("_@seek%i:",j);
|
||||
for(k=0;k<3;k++)
|
||||
{
|
||||
P("add si,ds:theloop_xsina1");
|
||||
P("mov dx,fs:[si]");
|
||||
P("add di,ds:theloop_ysina1");
|
||||
P("add dx,gs:[di]");
|
||||
P("add dx,%i",-100);
|
||||
l=(i-horizony)*2560L;
|
||||
P("add ecx,0%08lXh",wflip(2560L));
|
||||
P("adc cx,0");
|
||||
P("sub eax,0%08lXh",wflip(l));
|
||||
P("sbb ax,0");
|
||||
P("cmp ax,dx");
|
||||
P("jl short _@seek%im",j);
|
||||
}
|
||||
P("add edx,00010000h");
|
||||
P("jnc _@seek%i",j);
|
||||
P("ret");
|
||||
|
||||
// hit, draw pixel & advance rays
|
||||
P("_@seek%im:",j);
|
||||
P("mov es:[bp+%i],dl",-(199-j)*160);
|
||||
P("add eax,ecx");
|
||||
P("adc ax,0");
|
||||
P("cmp ax,dx");
|
||||
P("jl short _@seek%im",j-1);
|
||||
}
|
||||
P("_@seek%im:",j-1);
|
||||
P("ret");
|
||||
P("theloop ENDP");
|
||||
printf(" \r",i);
|
||||
|
||||
fclose(f1);
|
||||
}
|
||||
12
COMAN/DOOBJS.BAT
Normal file
12
COMAN/DOOBJS.BAT
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
getslice w1dta.bin 0 32768 w1dta1.bin
|
||||
getslice w1dta.bin 32768 32768 w1dta2.bin
|
||||
doobj w1dta1.bin _w1dta _w1dta1.obj
|
||||
doobj w1dta2.bin _w1dta_ _w1dta2.obj
|
||||
del w1dta1.bin
|
||||
del w1dta2.bin
|
||||
getslice w2dta.bin 0 32768 w2dta1.bin
|
||||
getslice w2dta.bin 32768 32768 w2dta2.bin
|
||||
doobj w2dta1.bin _w2dta _w2dta1.obj
|
||||
doobj w2dta2.bin _w2dta_ _w2dta2.obj
|
||||
del w2dta1.bin
|
||||
del w2dta2.bin
|
||||
2
COMAN/DOPIC.BAT
Normal file
2
COMAN/DOPIC.BAT
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
lbm2u combg.lbm combg.uh
|
||||
doobj combg.uh _combg _combg.obk
|
||||
1
COMAN/DP.BAT
Normal file
1
COMAN/DP.BAT
Normal file
|
|
@ -0,0 +1 @@
|
|||
c:\others\dp\del_pain
|
||||
BIN
COMAN/DP_PREFS
Normal file
BIN
COMAN/DP_PREFS
Normal file
Binary file not shown.
38
COMAN/KOE.C
Normal file
38
COMAN/KOE.C
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
int table[1024];
|
||||
|
||||
char *vram=(char *)0xa0000000L;
|
||||
|
||||
main()
|
||||
{
|
||||
int x,y;
|
||||
double f,g;
|
||||
_asm mov ax,13h
|
||||
_asm int 10h
|
||||
for(x=0;x<1024;x++)
|
||||
{
|
||||
f=(double)x*3.1415926535*3.0/1024.0;
|
||||
f=sin(f);
|
||||
g=(double)x/700;
|
||||
if(g>1) g=2-g;
|
||||
f=f*g*g;
|
||||
y=(int)(f*400.0);
|
||||
table[x]=y;
|
||||
vram[x/4+(y/4+100)*320]=9;
|
||||
}
|
||||
getch();
|
||||
_asm mov ax,3h
|
||||
_asm int 10h
|
||||
for(x=0;x<1024;x++)
|
||||
{
|
||||
if(!x) printf("{%i",table[x]);
|
||||
else printf(",%i",table[x]);
|
||||
if(!(x&15))
|
||||
{
|
||||
printf(" \\\n");
|
||||
}
|
||||
}
|
||||
printf("};\n");
|
||||
}
|
||||
228
COMAN/MAIN.C
Normal file
228
COMAN/MAIN.C
Normal file
|
|
@ -0,0 +1,228 @@
|
|||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <malloc.h>
|
||||
#include "..\dis\dis.h"
|
||||
|
||||
#define noCALCW12
|
||||
|
||||
char combg[16];
|
||||
|
||||
#ifndef CALCW12
|
||||
extern int w1dta[];
|
||||
extern int w2dta[];
|
||||
#endif
|
||||
|
||||
extern char combg[];
|
||||
extern char combguse[];
|
||||
|
||||
int flip;
|
||||
|
||||
int wavesin[]=
|
||||
#include "wave.h"
|
||||
|
||||
extern int *wave1;
|
||||
extern int *wave2;
|
||||
extern unsigned char *vbuf;
|
||||
extern int cameralevel;
|
||||
|
||||
char far *vram=(char far *)0xa0000000L;
|
||||
char far *vram2=(char far *)0xa8000000L;
|
||||
|
||||
extern int sin1024[];
|
||||
|
||||
char palette[768];
|
||||
|
||||
char *shiftstatus=(char *)0x0417;
|
||||
int waitb()
|
||||
{
|
||||
//if(*shiftstatus&16) setborder(0);
|
||||
while(!(inp(0x3da)&8));
|
||||
while((inp(0x3da)&8));
|
||||
//if(*shiftstatus&16) setborder(127);
|
||||
return(1);
|
||||
}
|
||||
|
||||
void doit(void)
|
||||
{
|
||||
unsigned int u,v,uc;
|
||||
int startrise=160,frepeat=1;
|
||||
int a,b,x,y,xa,ya,j,xw,yw,d,r;
|
||||
int rot2=0,rot=0,rsin,rcos,xwav=0,ywav=0,zwav=0;
|
||||
int rsin2,rcos2;
|
||||
int frame=0;
|
||||
rot=0; rot2=0;
|
||||
cameralevel=-270;
|
||||
dis_waitb();
|
||||
while(!dis_exit() && dis_musplus()<0);
|
||||
while(!dis_exit() && frame<4444)
|
||||
{
|
||||
a=dis_musplus();
|
||||
if(a>-8 && a<0) break;
|
||||
while(frepeat--)
|
||||
{
|
||||
if(a>-30 && a<0)
|
||||
{
|
||||
if(startrise<160) startrise+=1;
|
||||
}
|
||||
if(frame<400 && startrise>0)
|
||||
{
|
||||
if(frame==4)
|
||||
{
|
||||
dis_waitb();
|
||||
setpalarea(palette,0,256);
|
||||
}
|
||||
if(startrise>0) startrise-=1;
|
||||
}
|
||||
}
|
||||
rot2+=4;
|
||||
rot+=(sin1024[rot2&1023])/15;
|
||||
r=rot>>3;
|
||||
rsin=sin1024[r&1023];
|
||||
rcos=sin1024[(r+256)&1023];
|
||||
rsin2=sin1024[(r+177)&1023];
|
||||
rcos2=sin1024[(r+177+256)&1023];
|
||||
xw=xwav; yw=ywav;
|
||||
for(a=0;a<160;a++)
|
||||
{
|
||||
x=(a-80);
|
||||
y=160;
|
||||
xa=(int)(((long)x*(long)rcos+(long)y*(long)rsin)/256L);
|
||||
ya=(int)(((long)y*(long)rcos2-(long)x*(long)rsin2)/256L);
|
||||
b=(a&1)*80+(a>>1)+199*160;
|
||||
docol(xw,yw,xa,ya,b);
|
||||
if(a==80)
|
||||
{
|
||||
xwav+=xa*4;
|
||||
ywav+=ya*4;
|
||||
}
|
||||
}
|
||||
flip++; if(flip>1) flip=0;
|
||||
switch(flip)
|
||||
{
|
||||
case 0 :
|
||||
outp(0x3d4,0x0c);
|
||||
outp(0x3d5,0x80);
|
||||
frame+=(frepeat=dis_waitb());
|
||||
docopy(0xa000+5*startrise);
|
||||
break;
|
||||
case 1 :
|
||||
outp(0x3d4,0x0c);
|
||||
outp(0x3d5,0x00);
|
||||
frame+=(frepeat=dis_waitb());
|
||||
docopy(0xa800+5*startrise);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
unsigned int u,v,uc;
|
||||
int a,b,x,y,xa,ya,j,k,xw,yw;
|
||||
int rot=0,rsin,rcos,xwav=0,ywav=0;
|
||||
dis_partstart();
|
||||
_asm mov ax,13h
|
||||
_asm int 10h
|
||||
|
||||
for(a=0;a<256;a++)
|
||||
{
|
||||
uc=(223-a*22/26)*3;
|
||||
b=(230-a)/4;
|
||||
b+=sin1024[a*4&1023]/32;
|
||||
if(b<0) b=0;
|
||||
if(b>63) b=63;
|
||||
palette[uc+1]=b;
|
||||
b=(255-a)/3;
|
||||
if(b>63) b=63;
|
||||
palette[uc+2]=b;
|
||||
b=a-220; if(b<0) b=-b;
|
||||
if(b>40) b=40;
|
||||
b=40-b;
|
||||
palette[uc+0]=b/3;
|
||||
//if(!dis_indemo()) vram[a+640]=a;
|
||||
}
|
||||
for(a=0;a<768-16*3;a++)
|
||||
{
|
||||
b=palette[a];
|
||||
b=b*9/6; if(b>63) b=63;
|
||||
palette[a]=b;
|
||||
}
|
||||
for(a=0;a<24;a++)
|
||||
{
|
||||
uc=(255-a)*3;
|
||||
b=a-4; if(b<0) b=0;
|
||||
palette[uc+0]=b/2;
|
||||
palette[uc+1]=0;
|
||||
palette[uc+2]=0;
|
||||
}
|
||||
palette[0]=0;
|
||||
palette[1]=0;
|
||||
palette[2]=0;
|
||||
for(x=(256-16)*3;x<768;x++)
|
||||
{
|
||||
palette[x]=combg[16+x];
|
||||
}
|
||||
vbuf=halloc(16384,4);
|
||||
for(y=0;y<90;y++)
|
||||
{
|
||||
for(x=0;x<80;x++)
|
||||
{
|
||||
combguse[x+y*160]=combg[x*4+y*320+768+16];
|
||||
}
|
||||
for(x=0;x<80;x++)
|
||||
{
|
||||
combguse[x+80+y*160]=combg[x*4+y*320+2+768+16];
|
||||
}
|
||||
}
|
||||
dis_waitb();
|
||||
setpalarea(palette,0,256);
|
||||
#ifdef CALCW12
|
||||
wave1=halloc(16384,4);
|
||||
wave2=halloc(16384,4);
|
||||
for(b=u=v=0;b<128;b++)
|
||||
{
|
||||
for(a=0;a<256;a++)
|
||||
{
|
||||
k=((long)u*1024L*7L)>>15;
|
||||
j=wavesin[k&1023]/8;
|
||||
k=((long)u*1024L*3L)>>15;
|
||||
j+=wavesin[k&1023]/7+((rand()&7)*a/256);
|
||||
wave1[u]=j*5/9;
|
||||
k=((long)u*1024L*5L)>>15;
|
||||
j=wavesin[k&1023]/5;
|
||||
k=((long)u*1024L*2L)>>15;
|
||||
j+=wavesin[k&1023]/6;
|
||||
wave2[u]=j*7/9;
|
||||
u++;
|
||||
}
|
||||
if(!dis_indemo()) vram[b*2]=127;
|
||||
}
|
||||
{
|
||||
FILE *f1;
|
||||
f1=fopen("w1dta.bin","wb");
|
||||
fwrite(wave1,2,16384,f1);
|
||||
fwrite(wave1+16384,2,16384,f1);
|
||||
fclose(f1);
|
||||
f1=fopen("w2dta.bin","wb");
|
||||
fwrite(wave2,2,16384,f1);
|
||||
fwrite(wave2+16384,2,16384,f1);
|
||||
fclose(f1);
|
||||
}
|
||||
#else
|
||||
wave1=w1dta;
|
||||
wave2=w2dta;
|
||||
#endif
|
||||
inittwk();
|
||||
memset(vram,0,64000);
|
||||
dis_waitb();
|
||||
setpalarea(palette,0,256);
|
||||
|
||||
doit();
|
||||
|
||||
if(!dis_indemo())
|
||||
{
|
||||
_asm mov ax,3h
|
||||
_asm int 10h
|
||||
}
|
||||
}
|
||||
|
||||
BIN
COMAN/MAIN.OBJ
Normal file
BIN
COMAN/MAIN.OBJ
Normal file
Binary file not shown.
161
COMAN/MAIN1.C
Normal file
161
COMAN/MAIN1.C
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <malloc.h>
|
||||
#include "..\dis\dis.h"
|
||||
|
||||
int flip;
|
||||
|
||||
int wavesin[]=
|
||||
#include "wave.h"
|
||||
|
||||
extern unsigned char *wave1;
|
||||
extern unsigned char *wave2;
|
||||
extern unsigned char *vbuf;
|
||||
extern int cameralevel;
|
||||
|
||||
char far *vram=(char far *)0xa0000000L;
|
||||
char far *vram2=(char far *)0xa8000000L;
|
||||
|
||||
extern int sin1024[];
|
||||
|
||||
char palette[768];
|
||||
|
||||
char *shiftstatus=(char *)0x0417;
|
||||
int waitb()
|
||||
{
|
||||
if(*shiftstatus&16) setborder(0);
|
||||
while(!(inp(0x3da)&8));
|
||||
while((inp(0x3da)&8));
|
||||
if(*shiftstatus&16) setborder(127);
|
||||
return(1);
|
||||
}
|
||||
|
||||
void doit(void)
|
||||
{
|
||||
unsigned int u,v,uc;
|
||||
int startrise=160;
|
||||
int a,b,x,y,xa,ya,j,xw,yw,d;
|
||||
int rot2=0,rot=0,rsin,rcos,xwav=0,ywav=0,zwav=0;
|
||||
int rsin2,rcos2;
|
||||
int frame=0;
|
||||
rot=200; rot2=0;
|
||||
cameralevel=-270;
|
||||
while(!kbhit() && frame<444)
|
||||
{
|
||||
if(frame<50)
|
||||
{
|
||||
if(frame==4)
|
||||
{
|
||||
setpalarea(palette,0,256);
|
||||
}
|
||||
if(startrise>0) startrise-=4;
|
||||
}
|
||||
rsin=sin1024[rot&1023];
|
||||
rcos=sin1024[(rot+256)&1023];
|
||||
rsin2=sin1024[(rot+177)&1023];
|
||||
rcos2=sin1024[(rot+177+256)&1023];
|
||||
zwav+=1;
|
||||
rot2+=2;
|
||||
rot+=3*(sin1024[rot2&1023]+64)/256;
|
||||
xw=xwav; yw=ywav;
|
||||
for(a=0;a<160;a++)
|
||||
{
|
||||
x=(a-80);
|
||||
y=160;
|
||||
xa=(int)(((long)x*(long)rcos+(long)y*(long)rsin)/256L);
|
||||
ya=(int)(((long)y*(long)rcos2-(long)x*(long)rsin2)/256L);
|
||||
b=(a&1)*80+(a>>1)+199*160;
|
||||
docol(xw,yw,xa,ya,b);
|
||||
if(a==80)
|
||||
{
|
||||
xwav+=xa*4+ya/2;
|
||||
ywav+=ya*4;
|
||||
}
|
||||
}
|
||||
flip++; if(flip>1) flip=0;
|
||||
switch(flip)
|
||||
{
|
||||
case 0 :
|
||||
outp(0x3d4,0x0c);
|
||||
outp(0x3d5,0x80);
|
||||
frame+=waitb();
|
||||
docopy(0xa000+5*startrise);
|
||||
break;
|
||||
case 1 :
|
||||
outp(0x3d4,0x0c);
|
||||
outp(0x3d5,0x00);
|
||||
frame+=waitb();
|
||||
docopy(0xa800+5*startrise);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
unsigned int u,v,uc;
|
||||
int a,b,x,y,xa,ya,j,k,xw,yw;
|
||||
int rot=0,rsin,rcos,xwav=0,ywav=0;
|
||||
dis_partstart();
|
||||
_asm mov ax,13h
|
||||
_asm int 10h
|
||||
if(!dis_indemo()) printf("\nShaded 3D sinusfield < Lanscape?\n");
|
||||
for(a=0;a<256;a++)
|
||||
{
|
||||
uc=(223-a*22/26)*3;
|
||||
b=(230-a)/4;
|
||||
if(b<0) b=0;
|
||||
if(b>63) b=63;
|
||||
palette[uc+1]=b;
|
||||
b=(255-a)/4;
|
||||
if(b>63) b=63;
|
||||
palette[uc+2]=b;
|
||||
palette[uc+0]=0;
|
||||
vram[a+640]=a;
|
||||
}
|
||||
for(a=0;a<32;a++)
|
||||
{
|
||||
uc=(255-a)*3;
|
||||
palette[uc+0]=a;
|
||||
palette[uc+1]=0;
|
||||
palette[uc+2]=0;
|
||||
}
|
||||
palette[0]=0;
|
||||
palette[1]=0;
|
||||
palette[2]=0;
|
||||
wave1=halloc(16384,4);
|
||||
wave2=halloc(16384,4);
|
||||
vbuf=halloc(16384,4);
|
||||
setpalarea(palette,0,256);
|
||||
for(b=u=v=0;b<256;b++)
|
||||
{
|
||||
for(a=0;a<256;a++)
|
||||
{
|
||||
k=((long)u*1024L*7L)/65536L;
|
||||
j=wavesin[k&1023]/8;
|
||||
k=((long)u*1024L*3L)/65536L;
|
||||
j+=wavesin[k&1023]/7;
|
||||
wave1[u]=(j/3)+120/2;
|
||||
k=((long)u*1024L*5L)/65536L;
|
||||
j=wavesin[k&1023]/6;
|
||||
k=((long)u*1024L*2L)/65536L;
|
||||
j+=wavesin[k&1023]/5;
|
||||
wave2[u]=(j/3)+120/2;
|
||||
u++;
|
||||
}
|
||||
if(!dis_indemo()) vram[b]=127;
|
||||
}
|
||||
inittwk();
|
||||
memset(vram,0,64000);
|
||||
setpalarea(palette,0,256);
|
||||
|
||||
doit();
|
||||
if(kbhit()) getch();
|
||||
|
||||
if(!dis_indemo())
|
||||
{
|
||||
_asm mov ax,3h
|
||||
_asm int 10h
|
||||
}
|
||||
}
|
||||
|
||||
24
COMAN/MAKEFILE
Normal file
24
COMAN/MAKEFILE
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
all : doloop.exe c.exe
|
||||
|
||||
objs=main.obj asm.obj theloop.obj ..\dis\disc.obj
|
||||
dobjs=_w1dta1.obj _w1dta2.obj _w2dta1.obj _w2dta2.obj
|
||||
|
||||
asm_f = /ML /m2 /s /JJUMPS
|
||||
#c_f = /AL /c /W1 /qc
|
||||
c_f = /AL /c /W1 /Oxaz
|
||||
|
||||
.asm.obj :
|
||||
tasm $(asm_f) $<
|
||||
|
||||
.c.obj :
|
||||
cl $(c_f) $<
|
||||
|
||||
c.exe : $(objs)
|
||||
link /E $(objs)+$(dobjs),c.exe,nul;
|
||||
copy c.exe ..\main\data\3dsinfld.exe
|
||||
|
||||
doloop.exe : doloop.c
|
||||
mkc doloop
|
||||
doloop
|
||||
|
||||
theloop.asm : theloop.inc
|
||||
33
COMAN/SIN1024.INC
Normal file
33
COMAN/SIN1024.INC
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
_sin1024 LABEL WORD
|
||||
dw 0,1,3,4,6,7,9,10,12,14,15,17,18,20,21,23,25,26,28,29,31,32,34,36,37,39,40,42,43,45,46,48
|
||||
dw 49,51,53,54,56,57,59,60,62,63,65,66,68,69,71,72,74,75,77,78,80,81,83,84,86,87,89,90,92,93,95,96
|
||||
dw 97,99,100,102,103,105,106,108,109,110,112,113,115,116,117,119,120,122,123,124,126,127,128,130,131,132,134,135,136,138,139,140
|
||||
dw 142,143,144,146,147,148,149,151,152,153,155,156,157,158,159,161,162,163,164,166,167,168,169,170,171,173,174,175,176,177,178,179
|
||||
dw 181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,211
|
||||
dw 212,213,214,215,216,217,217,218,219,220,221,221,222,223,224,225,225,226,227,227,228,229,230,230,231,232,232,233,234,234,235,235
|
||||
dw 236,237,237,238,238,239,239,240,241,241,242,242,243,243,244,244,244,245,245,246,246,247,247,247,248,248,249,249,249,250,250,250
|
||||
dw 251,251,251,251,252,252,252,252,253,253,253,253,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255
|
||||
dw 256,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,254,254,254,253,253,253,253,252,252,252,252,251,251,251
|
||||
dw 251,250,250,250,249,249,249,248,248,247,247,247,246,246,245,245,244,244,244,243,243,242,242,241,241,240,239,239,238,238,237,237
|
||||
dw 236,235,235,234,234,233,232,232,231,230,230,229,228,227,227,226,225,225,224,223,222,221,221,220,219,218,217,217,216,215,214,213
|
||||
dw 212,211,211,210,209,208,207,206,205,204,203,202,201,200,199,198,197,196,195,194,193,192,191,190,189,188,187,186,185,184,183,182
|
||||
dw 181,179,178,177,176,175,174,173,171,170,169,168,167,166,164,163,162,161,159,158,157,156,155,153,152,151,149,148,147,146,144,143
|
||||
dw 142,140,139,138,136,135,134,132,131,130,128,127,126,124,123,122,120,119,117,116,115,113,112,110,109,108,106,105,103,102,100,99
|
||||
dw 97,96,95,93,92,90,89,87,86,84,83,81,80,78,77,75,74,72,71,69,68,66,65,63,62,60,59,57,56,54,53,51
|
||||
dw 49,48,46,45,43,42,40,39,37,36,34,32,31,29,28,26,25,23,21,20,18,17,15,14,12,10,9,7,6,4,3,1
|
||||
dw 0,-1,-3,-4,-6,-7,-9,-10,-12,-14,-15,-17,-18,-20,-21,-23,-25,-26,-28,-29,-31,-32,-34,-36,-37,-39,-40,-42,-43,-45,-46,-48
|
||||
dw -49,-51,-53,-54,-56,-57,-59,-60,-62,-63,-65,-66,-68,-69,-71,-72,-74,-75,-77,-78,-80,-81,-83,-84,-86,-87,-89,-90,-92,-93,-95,-96
|
||||
dw -97,-99,-100,-102,-103,-105,-106,-108,-109,-110,-112,-113,-115,-116,-117,-119,-120,-122,-123,-124,-126,-127,-128,-130,-131,-132,-134,-135,-136,-138,-139,-140
|
||||
dw -142,-143,-144,-146,-147,-148,-149,-151,-152,-153,-155,-156,-157,-158,-159,-161,-162,-163,-164,-166,-167,-168,-169,-170,-171,-173,-174,-175,-176,-177,-178,-179
|
||||
dw -181,-182,-183,-184,-185,-186,-187,-188,-189,-190,-191,-192,-193,-194,-195,-196,-197,-198,-199,-200,-201,-202,-203,-204,-205,-206,-207,-208,-209,-210,-211,-211
|
||||
dw -212,-213,-214,-215,-216,-217,-217,-218,-219,-220,-221,-221,-222,-223,-224,-225,-225,-226,-227,-227,-228,-229,-230,-230,-231,-232,-232,-233,-234,-234,-235,-235
|
||||
dw -236,-237,-237,-238,-238,-239,-239,-240,-241,-241,-242,-242,-243,-243,-244,-244,-244,-245,-245,-246,-246,-247,-247,-247,-248,-248,-249,-249,-249,-250,-250,-250
|
||||
dw -251,-251,-251,-251,-252,-252,-252,-252,-253,-253,-253,-253,-254,-254,-254,-254,-254,-254,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255
|
||||
dw -256,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-254,-254,-254,-254,-254,-254,-253,-253,-253,-253,-252,-252,-252,-252,-251,-251,-251
|
||||
dw -251,-250,-250,-250,-249,-249,-249,-248,-248,-247,-247,-247,-246,-246,-245,-245,-244,-244,-244,-243,-243,-242,-242,-241,-241,-240,-239,-239,-238,-238,-237,-237
|
||||
dw -236,-235,-235,-234,-234,-233,-232,-232,-231,-230,-230,-229,-228,-227,-227,-226,-225,-225,-224,-223,-222,-221,-221,-220,-219,-218,-217,-217,-216,-215,-214,-213
|
||||
dw -212,-211,-211,-210,-209,-208,-207,-206,-205,-204,-203,-202,-201,-200,-199,-198,-197,-196,-195,-194,-193,-192,-191,-190,-189,-188,-187,-186,-185,-184,-183,-182
|
||||
dw -181,-179,-178,-177,-176,-175,-174,-173,-171,-170,-169,-168,-167,-166,-164,-163,-162,-161,-159,-158,-157,-156,-155,-153,-152,-151,-149,-148,-147,-146,-144,-143
|
||||
dw -142,-140,-139,-138,-136,-135,-134,-132,-131,-130,-128,-127,-126,-124,-123,-122,-120,-119,-117,-116,-115,-113,-112,-110,-109,-108,-106,-105,-103,-102,-100,-99
|
||||
dw -97,-96,-95,-93,-92,-90,-89,-87,-86,-84,-83,-81,-80,-78,-77,-75,-74,-72,-71,-69,-68,-66,-65,-63,-62,-60,-59,-57,-56,-54,-53,-51
|
||||
dw -49,-48,-46,-45,-43,-42,-40,-39,-37,-36,-34,-32,-31,-29,-28,-26,-25,-23,-21,-20,-18,-17,-15,-14,-12,-10,-9,-7,-6,-4,-3,-1
|
||||
11
COMAN/THELOOP.ASM
Normal file
11
COMAN/THELOOP.ASM
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
thecode SEGMENT para public 'CODE'
|
||||
ASSUME cs:thecode
|
||||
.386
|
||||
LOCALS
|
||||
NOJUMPS
|
||||
|
||||
PUBLIC theloop
|
||||
include theloop.inc
|
||||
|
||||
thecode ENDS
|
||||
END
|
||||
5230
COMAN/THELOOP.INC
Normal file
5230
COMAN/THELOOP.INC
Normal file
File diff suppressed because it is too large
Load diff
BIN
COMAN/THELOOP.OBJ
Normal file
BIN
COMAN/THELOOP.OBJ
Normal file
Binary file not shown.
29
COMAN/TMP
Normal file
29
COMAN/TMP
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
@@2: ;this loop also clears
|
||||
mov dx,3c4h
|
||||
mov ax,0302h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 20
|
||||
mov eax,ds:[si+zzz]
|
||||
mov ds:[si+zzz],ebx
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
mov dx,3c4h
|
||||
mov ax,0C02h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 20
|
||||
mov eax,ds:[si+zzz+80]
|
||||
mov ds:[si+zzz+80],ebx
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
sub ebx,01010101h
|
||||
cmp bl,256-31
|
||||
jae @@3
|
||||
mov ebx,0e1e1e1e1h
|
||||
@@3: add si,160
|
||||
add di,80
|
||||
dec cx
|
||||
jmp @@1
|
||||
BIN
COMAN/W1DTA.BIN
Normal file
BIN
COMAN/W1DTA.BIN
Normal file
Binary file not shown.
BIN
COMAN/W2DTA.BIN
Normal file
BIN
COMAN/W2DTA.BIN
Normal file
Binary file not shown.
65
COMAN/WAVE.H
Normal file
65
COMAN/WAVE.H
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
{0 \
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \
|
||||
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \
|
||||
,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1 \
|
||||
,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3 \
|
||||
,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5 \
|
||||
,5,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8 \
|
||||
,8,9,9,9,9,10,10,10,10,10,11,11,11,11,12,12 \
|
||||
,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16 \
|
||||
,16,16,17,17,17,18,18,18,18,19,19,19,19,20,20,20 \
|
||||
,21,21,21,21,22,22,22,23,23,23,23,24,24,24,24,25 \
|
||||
,25,25,26,26,26,26,27,27,27,27,28,28,28,29,29,29 \
|
||||
,29,30,30,30,30,30,31,31,31,31,32,32,32,32,33,33 \
|
||||
,33,33,33,34,34,34,34,34,34,35,35,35,35,35,35,36 \
|
||||
,36,36,36,36,36,36,37,37,37,37,37,37,37,37,37,37 \
|
||||
,37,37,37,37,37,37,38,38,38,38,38,37,37,37,37,37 \
|
||||
,37,37,37,37,37,37,37,37,37,36,36,36,36,36,36,35 \
|
||||
,35,35,35,35,34,34,34,34,33,33,33,33,32,32,32,31 \
|
||||
,31,31,30,30,30,29,29,28,28,28,27,27,26,26,25,25 \
|
||||
,24,24,23,23,22,22,21,21,20,20,19,18,18,17,16,16 \
|
||||
,15,14,14,13,12,12,11,10,10,9,8,7,6,6,5,4 \
|
||||
,3,2,2,1,0,0,-1,-2,-3,-4,-5,-6,-7,-7,-8,-9 \
|
||||
,-10,-11,-12,-13,-14,-15,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26 \
|
||||
,-27,-29,-30,-31,-32,-33,-35,-36,-37,-38,-39,-41,-42,-43,-44,-46 \
|
||||
,-47,-48,-49,-51,-52,-53,-55,-56,-57,-59,-60,-61,-63,-64,-65,-67 \
|
||||
,-68,-69,-71,-72,-74,-75,-76,-78,-79,-81,-82,-83,-85,-86,-88,-89 \
|
||||
,-91,-92,-93,-95,-96,-98,-99,-101,-102,-104,-105,-107,-108,-109,-111,-112 \
|
||||
,-114,-115,-117,-118,-120,-121,-123,-124,-126,-127,-128,-130,-131,-133,-134,-136 \
|
||||
,-137,-139,-140,-141,-143,-144,-146,-147,-149,-150,-151,-153,-154,-156,-157,-158 \
|
||||
,-160,-161,-162,-164,-165,-167,-168,-169,-170,-172,-173,-174,-176,-177,-178,-179 \
|
||||
,-181,-182,-183,-184,-186,-187,-188,-189,-190,-191,-193,-194,-195,-196,-197,-198 \
|
||||
,-199,-200,-201,-202,-203,-204,-205,-206,-207,-208,-209,-210,-211,-212,-213,-213 \
|
||||
,-214,-215,-216,-217,-217,-218,-219,-220,-220,-221,-222,-222,-223,-223,-224,-225 \
|
||||
,-225,-226,-226,-227,-227,-228,-228,-228,-229,-229,-229,-230,-230,-230,-230,-231 \
|
||||
,-231,-231,-231,-231,-231,-231,-232,-232,-232,-232,-232,-231,-231,-231,-231,-231 \
|
||||
,-231,-231,-230,-230,-230,-229,-229,-229,-228,-228,-227,-227,-226,-226,-225,-225 \
|
||||
,-224,-223,-223,-222,-221,-221,-220,-219,-218,-217,-216,-215,-215,-214,-213,-211 \
|
||||
,-210,-209,-208,-207,-206,-205,-203,-202,-201,-200,-198,-197,-195,-194,-192,-191 \
|
||||
,-189,-188,-186,-185,-183,-181,-180,-178,-176,-174,-172,-171,-169,-167,-165,-163 \
|
||||
,-161,-159,-157,-155,-153,-150,-148,-146,-144,-142,-139,-137,-135,-132,-130,-127 \
|
||||
,-125,-123,-120,-117,-115,-112,-110,-107,-104,-102,-99,-96,-93,-91,-88,-85 \
|
||||
,-82,-79,-76,-73,-70,-67,-64,-61,-58,-55,-52,-49,-45,-42,-39,-36 \
|
||||
,-32,-29,-26,-22,-19,-16,-12,-9,-5,-2,1,4,8,11,15,18 \
|
||||
,22,26,29,33,37,40,44,48,52,55,59,63,66,70,73,77 \
|
||||
,80,83,87,90,93,96,99,103,106,109,112,115,118,121,124,127 \
|
||||
,130,132,135,138,141,144,146,149,152,154,157,159,162,164,167,169 \
|
||||
,172,174,176,179,181,183,185,187,190,192,194,196,198,200,202,204 \
|
||||
,206,207,209,211,213,215,216,218,220,221,223,224,226,227,229,230 \
|
||||
,231,233,234,235,237,238,239,240,241,242,243,244,245,246,247,248 \
|
||||
,249,250,251,252,252,253,254,254,255,256,256,257,257,258,258,259 \
|
||||
,259,259,260,260,260,261,261,261,261,261,261,262,262,262,262,262 \
|
||||
,262,262,261,261,261,261,261,261,260,260,260,259,259,259,258,258 \
|
||||
,257,257,256,256,255,255,254,254,253,252,252,251,250,249,249,248 \
|
||||
,247,246,245,245,244,243,242,241,240,239,238,237,236,235,234,233 \
|
||||
,232,231,230,228,227,226,225,224,223,221,220,219,218,216,215,214 \
|
||||
,212,211,210,208,207,205,204,203,201,200,198,197,196,194,193,191 \
|
||||
,190,188,187,185,184,182,180,179,177,176,174,173,171,169,168,166 \
|
||||
,165,163,161,160,158,157,155,153,152,150,148,147,145,143,142,140 \
|
||||
,138,137,135,133,132,130,128,127,125,123,122,120,118,117,115,113 \
|
||||
,112,110,109,107,105,104,102,100,99,97,95,94,92,91,89,87 \
|
||||
,86,84,82,81,79,78,76,75,73,71,70,68,67,65,64,62 \
|
||||
,61,59,58,56,55,53,52,50,49,47,46,45,43,42,40,39 \
|
||||
,38,36,35,33,32,31,29,28,27,26,24,23,22,20,19,18 \
|
||||
,17,15,14,13,12,11,10,8,7,6,5,4,3,2,1};
|
||||
BIN
COMAN/_COMBG.OBK
Normal file
BIN
COMAN/_COMBG.OBK
Normal file
Binary file not shown.
BIN
COMAN/_W1DTA.OBJ
Normal file
BIN
COMAN/_W1DTA.OBJ
Normal file
Binary file not shown.
BIN
COMAN/_W1DTA1.OBJ
Normal file
BIN
COMAN/_W1DTA1.OBJ
Normal file
Binary file not shown.
BIN
COMAN/_W1DTA2.OBJ
Normal file
BIN
COMAN/_W1DTA2.OBJ
Normal file
Binary file not shown.
BIN
COMAN/_W2DTA.OBJ
Normal file
BIN
COMAN/_W2DTA.OBJ
Normal file
Binary file not shown.
BIN
COMAN/_W2DTA1.OBJ
Normal file
BIN
COMAN/_W2DTA1.OBJ
Normal file
Binary file not shown.
BIN
COMAN/_W2DTA2.OBJ
Normal file
BIN
COMAN/_W2DTA2.OBJ
Normal file
Binary file not shown.
Loading…
Reference in a new issue