Upload
This commit is contained in:
commit
43352ff262
1291 changed files with 220976 additions and 0 deletions
BIN
HARD/AN_PREFS
Normal file
BIN
HARD/AN_PREFS
Normal file
Binary file not shown.
545
HARD/ASM.A
Normal file
545
HARD/ASM.A
Normal file
|
|
@ -0,0 +1,545 @@
|
|||
;FIND "386opt" TO FIND OPTIMIZABLE PLACES NOTED
|
||||
include clink.inc
|
||||
|
||||
extrn _everyframe:far
|
||||
extrn _fromasmdraw:far
|
||||
extrn _toasmdraw:far
|
||||
|
||||
;----------------------------------------------------------------
|
||||
data_seg SEGMENT para public 'DATA'
|
||||
|
||||
public sintable16
|
||||
public costable16
|
||||
public tantable32
|
||||
include calcsin.inc
|
||||
|
||||
public _splinecoef
|
||||
_splinecoef LABEL WORD
|
||||
include spline.inc
|
||||
|
||||
ALIGN 16 ;temporary working area, used by:
|
||||
;- polyn() for scanline min/mix storage
|
||||
public workarea
|
||||
public borders
|
||||
workarea LABEL WORD
|
||||
borders LABEL WORD ;should be enough for 680 normal hlines in group
|
||||
db 8192 dup(0)
|
||||
workareaoverflow dw 012fch
|
||||
|
||||
data_seg ENDS
|
||||
;----------------------------------------------------------------
|
||||
|
||||
extrn _worldroot
|
||||
asm_objs SEGMENT para public 'DATA'
|
||||
;contents in obj.asm
|
||||
asm_objs ENDS
|
||||
|
||||
asm_text SEGMENT para public 'CODE'
|
||||
ASSUME cs:asm_text
|
||||
ASSUME gs:data_seg ;when data used, generally in gs
|
||||
.386
|
||||
|
||||
;****************************************************************
|
||||
;PUBLICS
|
||||
;****************************************************************
|
||||
PUBLIC _asminit,_asmdeinit,_asm,_asmclear
|
||||
PUBLIC _testinit
|
||||
PUBLIC _setborder
|
||||
|
||||
PUBLIC _borders
|
||||
PUBLIC _autofly
|
||||
|
||||
PUBLIC _horizon
|
||||
|
||||
;****************************************************************
|
||||
;GLOBAL VARIABLES
|
||||
;****************************************************************
|
||||
|
||||
MAXY equ 159
|
||||
MAXX equ 319
|
||||
|
||||
;vector window coordinates (for clipping)
|
||||
public _vecwindow
|
||||
_vecwindow label word
|
||||
WMINX dw 4
|
||||
WMINY dw 4
|
||||
WMAXX dw 315
|
||||
WMAXY dw 155
|
||||
|
||||
videot LABEL WORD
|
||||
dw OFFSET v320x200x256
|
||||
dw OFFSET v320x240x256
|
||||
dw OFFSET v320x350x256
|
||||
dw OFFSET v320x350x256unr
|
||||
dw OFFSET vtseng640x400x256
|
||||
dw OFFSET valien ;5
|
||||
|
||||
video LABEL WORD
|
||||
vvinit = cs:video[0]
|
||||
dw 0 ;init screen
|
||||
vvswitch = cs:video[2]
|
||||
dw 0 ;switch pages
|
||||
vvclear = cs:video[4]
|
||||
dw 0 ;clear
|
||||
;all following gfx routines require:
|
||||
;es=vram; OUT 3C4,2
|
||||
vvpset = cs:video[6]
|
||||
dw 0 ;pset (DX,BX),CS:COLOR - plot a plot. Saves DS:SI/CX
|
||||
vvlineto = cs:video[8]
|
||||
dw 0 ;lineto - (CX,AX)->(DX,BX),CS:COLOR - draw a line - OPTIMIZE ME!-)
|
||||
vvhline = cs:video[10]
|
||||
dw 0 ;hline - (AX,BX)->(DX,BX),CS:COLOR - draw a horizontal line
|
||||
vvhlinegroup = cs:video[12]
|
||||
dw 0 ;hlinegroup - GS:SI->list of hlines:
|
||||
;word:start row
|
||||
;REPT
|
||||
;word:X1 (-32767=end of list)
|
||||
;word:X2
|
||||
;ENDM
|
||||
vvthlinegroup = cs:video[14]
|
||||
dw 0 ;thlinegroup - GS:SI->list of hline, FS=texture segment
|
||||
;word:start row
|
||||
;REPT
|
||||
;word:X1 (-32767=end of list)
|
||||
;word:X2
|
||||
;word:TextureX1Y1
|
||||
;word:TextureX2Y2
|
||||
;ENDM
|
||||
video9 LABEL WORD
|
||||
public _framebuf ;used by nrm modes (=>vram)
|
||||
_framebuf dw 0,0
|
||||
|
||||
PUBLIC _framemul
|
||||
_framemul dw 0
|
||||
|
||||
supervga db 1
|
||||
db 0
|
||||
|
||||
ALIGN 4
|
||||
rows dw 512 dup(0)
|
||||
rowsadd dw 0
|
||||
truerowsadd dw 0
|
||||
vecvram dw ? ;used by vector drawer
|
||||
public _asmvramseg
|
||||
_asmvramseg LABEL WORD
|
||||
truevram dw ?
|
||||
vram dw 0a5f0h ;-"- old
|
||||
|
||||
|
||||
PUBLIC _texture
|
||||
_texture dw 0,0
|
||||
|
||||
|
||||
color LABEL WORD
|
||||
color1 db 0
|
||||
color2 db 0
|
||||
colorl dw 0
|
||||
PUBLIC _asmexit
|
||||
_asmexit db 0
|
||||
fatalss dw 0
|
||||
fatalsp dw 0
|
||||
PUBLIC _inunreal
|
||||
_inunreal db 0
|
||||
PUBLIC _framestaken
|
||||
_framestaken dw 0
|
||||
PUBLIC _subpart
|
||||
_subpart db 2
|
||||
PUBLIC _wireframe,_nohidden,_curlist
|
||||
_wireframe db 0
|
||||
_nohidden db 0
|
||||
_curlist dw 0
|
||||
PUBLIC _mousedotx,_mousedoty
|
||||
PUBLIC _mouse0dotx,_mouse0doty
|
||||
_mousedotx dw 160
|
||||
_mousedoty dw 80
|
||||
_mouse0dotx dw 160
|
||||
_mouse0doty dw 80
|
||||
|
||||
public _font3x5
|
||||
_font3x5 dw 0,0
|
||||
|
||||
_horizon dw 0,0
|
||||
_horizonenabled db 1
|
||||
|
||||
nowaitborder db 0
|
||||
_borders db 0 ;1=show bordertimings
|
||||
_autofly db 0
|
||||
|
||||
ALIGN 2
|
||||
dataseg dw data_seg
|
||||
cdataseg dw 0 ;DS of the C routines
|
||||
public _depthtable
|
||||
_depthtable dw 0
|
||||
depthseg dw 0
|
||||
|
||||
public _asmdebugmode,_asmvideomode
|
||||
_asmvideomode dw 0
|
||||
_asmdebugmode dw 0
|
||||
public _debugw
|
||||
|
||||
;****************************************************************
|
||||
;SCREEN ROUTINES:
|
||||
;waitborder
|
||||
;LOW LEVEL ROUTINES:
|
||||
;hline1 (AX,BX)-(DX,BX), color REQ: color1=color2, ds=cs,
|
||||
; es=vram, OUT 3C4,2, EAXhi=0
|
||||
;pset (DX,BX), color REQ: ds=cs, es=vram, OUT 3C4,2
|
||||
;?line (DX,BX), color
|
||||
;****************************************************************
|
||||
include vid.asm
|
||||
;INITIALIZATION ROUTINES & COPPER EMULATION:
|
||||
include copper.asm ;calls copper_doit() every frame
|
||||
.386 ;for copper.asm sets .286
|
||||
|
||||
;****************************************************************
|
||||
;POLYGONS: call poly
|
||||
;polygon with 1 sides is a dot
|
||||
;polygon with 2 sides is a line
|
||||
;following variables must be set (used as parameters)
|
||||
;****************************************************************
|
||||
include poly.asm
|
||||
|
||||
;****************************************************************
|
||||
;VECTOR ROUTINES:
|
||||
;doobject
|
||||
;MACRO sinbx2ax ;ax=sin(bx) req: ds=cs
|
||||
;MACRO cosbx2ax ;ax=cos(bx) req: ds=cs
|
||||
;****************************************************************
|
||||
include calc.asm
|
||||
include spline.asm
|
||||
include vec.asm
|
||||
include matrix.asm
|
||||
include horiz.asm
|
||||
|
||||
;****************************************************************
|
||||
;(OBJECT) MEMORY MANAGEMENT
|
||||
;****************************************************************
|
||||
include omem.asm
|
||||
|
||||
;****************************************************************
|
||||
;C-interface
|
||||
;****************************************************************
|
||||
|
||||
copper_doit PROC NEAR
|
||||
;called every frame by copper, must save all but AX/BX/CX/DX
|
||||
sti
|
||||
pushad
|
||||
push ds
|
||||
push es
|
||||
;call dos timer
|
||||
pushf
|
||||
call cs:oldint8 ;from copper
|
||||
mov ds,cs:cdataseg
|
||||
cmp cs:_inunreal,0
|
||||
je nodoni
|
||||
mov ah,9
|
||||
int 60h ;musicmixer
|
||||
nodoni: ;call _everyframe ;if uses scrn, should restore all VGA regs
|
||||
pop es
|
||||
pop ds
|
||||
popad
|
||||
cli
|
||||
ret
|
||||
copper_doit ENDP
|
||||
|
||||
_testinit PROC FAR
|
||||
CBEG
|
||||
CEND
|
||||
_testinit ENDP
|
||||
|
||||
_asmclear PROC FAR
|
||||
CBEG
|
||||
call vvclear
|
||||
CEND
|
||||
_asmclear ENDP
|
||||
|
||||
ALIGN 2
|
||||
INTER equ 0h
|
||||
oldint dd ?
|
||||
_asminit PROC FAR
|
||||
CBEG
|
||||
mov cs:cdataseg,ds
|
||||
;
|
||||
mov si,cs:_asmvideomode
|
||||
shl si,1
|
||||
mov si,cs:videot[si]
|
||||
mov di,OFFSET video
|
||||
cld
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
mov es,ax
|
||||
mov cx,(video9-video)/2
|
||||
rep movsw
|
||||
;
|
||||
call vvinit
|
||||
call vvclear
|
||||
call vvswitch
|
||||
cmp cs:_asmdebugmode,0
|
||||
je noadm
|
||||
call tweak320x200
|
||||
noadm:
|
||||
cli
|
||||
mov ax,0
|
||||
mov es,ax
|
||||
mov ax,es:[INTER*4]
|
||||
mov WORD PTR cs:[oldint+0],ax
|
||||
mov ax,es:[INTER*4+2]
|
||||
mov WORD PTR cs:[oldint+0+2],ax
|
||||
mov ax,OFFSET intti
|
||||
mov es:[INTER*4],ax
|
||||
mov word ptr es:[INTER*4+2],cs
|
||||
sti
|
||||
|
||||
call clearpal
|
||||
|
||||
;call testmem
|
||||
CEND
|
||||
_asminit ENDP
|
||||
|
||||
_asmdeinit PROC FAR
|
||||
CBEG
|
||||
cli
|
||||
mov ax,0
|
||||
mov es,ax
|
||||
mov ax,WORD PTR cs:[oldint+0]
|
||||
mov es:[INTER*4],ax
|
||||
mov ax,WORD PTR cs:[oldint+0+2]
|
||||
mov es:[INTER*4+2],ax
|
||||
sti
|
||||
;mov ax,3
|
||||
;int 10h
|
||||
CEND
|
||||
_asmdeinit ENDP
|
||||
|
||||
m_diverror db 'FATAL: divide overflow',0
|
||||
m_workflow db 'FATAL: work area overflow',0
|
||||
m_oldpoly db 'FATAL: old style polygons no longer supported',0
|
||||
m_outofvx db 'FATAL: too many vertices in object',0
|
||||
m_press db ' Press ESC to return to dos ',0
|
||||
|
||||
dosmsgp dw 0
|
||||
dosmsg PROC NEAR
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
mov ax,0b800h
|
||||
mov es,ax
|
||||
mov di,ds:dosmsgp
|
||||
mov ah,4eh
|
||||
doe2: lodsb
|
||||
cmp al,0
|
||||
je doe1
|
||||
stosw
|
||||
jmp doe2
|
||||
doe1: add ds:dosmsgp,di
|
||||
ret
|
||||
dosmsg ENDP
|
||||
|
||||
intti PROC FAR
|
||||
;DIVIDE OVERFLOW
|
||||
sti
|
||||
mov si,OFFSET m_diverror
|
||||
jmp fatalexit
|
||||
fatalexit:
|
||||
mov ax,3
|
||||
int 10h
|
||||
call dosmsg
|
||||
mov si,OFFSET m_press
|
||||
call dosmsg
|
||||
iiia: mov ax,0
|
||||
int 16h
|
||||
cmp al,27
|
||||
jne iiia
|
||||
mov cs:_asmexit,1
|
||||
mov ss,cs:fatalss
|
||||
mov sp,cs:fatalsp
|
||||
CEND
|
||||
intti ENDP
|
||||
|
||||
public _camera,_tmpxyz
|
||||
_camera LABEL WORD
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
dw ?,?,?
|
||||
dw 0
|
||||
dw 0
|
||||
dw 0
|
||||
_tmpxyz dd -200000000,0,0
|
||||
|
||||
lastcoppercount dw 0
|
||||
clearit dw 1
|
||||
|
||||
PUBLIC _doclear
|
||||
_doclear PROC FAR
|
||||
CBEG
|
||||
call doclear
|
||||
CEND
|
||||
_doclear ENDP
|
||||
|
||||
doclear PROC NEAR
|
||||
ret
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
xor di,di
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
mov cx,65535
|
||||
xor ax,ax
|
||||
doc1: mov es:[di],al
|
||||
nop
|
||||
inc di
|
||||
loop doc1
|
||||
ret
|
||||
doclear ENDP
|
||||
|
||||
_asm PROC FAR
|
||||
CBEG
|
||||
mov cs:fatalss,ss
|
||||
mov cs:fatalsp,sp
|
||||
sti
|
||||
|
||||
cmp cs:_asmvideomode,5
|
||||
je nothis1
|
||||
mov ds,cs:cdataseg
|
||||
call _toasmdraw
|
||||
nothis1:
|
||||
call cs:video[2] ;switchpages, returns cs:vram
|
||||
mov ax,cs:vram
|
||||
mov cs:vecvram,ax
|
||||
|
||||
;mov ax,cs:vram
|
||||
;add ax,02dh ;add 8 rows
|
||||
;mov ax,asm_framebuf
|
||||
;mov ax,asm_framebuf
|
||||
;mov cs:vecvram,ax
|
||||
;mov ax,0a000h
|
||||
;mov cs:vram,ax
|
||||
|
||||
cmp cs:nowaitborder,0
|
||||
jne asm1b
|
||||
|
||||
cmp cs:_inunreal,0
|
||||
je asmnormal
|
||||
;waitborder with copper
|
||||
asm2: mov ah,10
|
||||
int 60h
|
||||
cmp ax,cs:lastcoppercount
|
||||
je asm2
|
||||
asm1: mov bx,ax
|
||||
sub bx,cs:lastcoppercount
|
||||
mov cs:_framestaken,bx
|
||||
mov cs:lastcoppercount,ax
|
||||
jmp asmunr
|
||||
|
||||
asmnormal:
|
||||
;waitborder with copper
|
||||
asm2b: mov ax,cs:coppercount
|
||||
cmp ax,cs:lastcoppercount
|
||||
je asm2b
|
||||
asm1b: mov bx,ax
|
||||
sub bx,cs:lastcoppercount
|
||||
mov cs:_framestaken,bx
|
||||
mov cs:lastcoppercount,ax
|
||||
|
||||
asmunr: setborder 1
|
||||
;mov cs:color,0000h
|
||||
;call vecclearscreen
|
||||
;enable all planes for debugdots
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
;do the vecs
|
||||
;call dofirstnew
|
||||
setborder 2
|
||||
call dofirstnrs
|
||||
setborder 0
|
||||
;do the mousedot
|
||||
IFDEF MOUSEDOT
|
||||
mov dx,3c4h
|
||||
mov al,2
|
||||
out dx,al
|
||||
mov ax,cs:vecvram
|
||||
mov es,ax
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
mov dx,cs:_mouse0dotx
|
||||
mov bx,cs:_mouse0doty
|
||||
mov cs:color1,15
|
||||
call pset1
|
||||
mov dx,cs:_mousedotx
|
||||
mov bx,cs:_mousedoty
|
||||
mov cs:color1,14
|
||||
call pset1
|
||||
ENDIF
|
||||
;check workareaoverflow
|
||||
mov gs,cs:dataseg
|
||||
cmp gs:workareaoverflow,012fch
|
||||
je workok
|
||||
mov si,OFFSET m_workflow
|
||||
jmp fatalexit
|
||||
workok: ;done
|
||||
|
||||
cmp cs:_asmvideomode,5
|
||||
je nothis2
|
||||
mov ds,cs:cdataseg
|
||||
call _fromasmdraw
|
||||
nothis2:
|
||||
CEND
|
||||
_asm ENDP
|
||||
|
||||
public _softice
|
||||
_softice PROC FAR
|
||||
CBEG
|
||||
mov ah,9
|
||||
mov al,11h
|
||||
mov si,'FG'
|
||||
mov di,'JM'
|
||||
movpar ds,1
|
||||
movpar dx,0
|
||||
int 3
|
||||
CEND
|
||||
_softice ENDP
|
||||
|
||||
copybmap PROC NEAR
|
||||
;enable all planes for debugdots
|
||||
mov ax,OFFSET cbj2
|
||||
mov cs:bmapjmp,ax
|
||||
mov bx,cs:bmapwid
|
||||
shr bx,1
|
||||
cbm3: mov cs:bmapdi,di
|
||||
mov dx,3c4h
|
||||
mov ax,0102h
|
||||
cbm4: push ax
|
||||
push si
|
||||
out dx,ax
|
||||
mov cx,bx
|
||||
jmp cs:bmapjmp
|
||||
cbmb: mov di,cs:bmapdi
|
||||
pop si
|
||||
pop ax
|
||||
shl ah,1
|
||||
add si,80
|
||||
cmp ah,16
|
||||
jb cbm4
|
||||
sub si,320
|
||||
ret
|
||||
cbj1: rep movsw
|
||||
jmp cbmb
|
||||
cbj2: movsb
|
||||
dec cx
|
||||
rep movsw
|
||||
movsb
|
||||
jmp cbmb
|
||||
cbj3: rep movsw
|
||||
movsb
|
||||
jmp cbmb
|
||||
cbj4: movsb
|
||||
rep movsw
|
||||
jmp cbmb
|
||||
copybmap ENDP
|
||||
|
||||
.8086
|
||||
asm_text ENDS
|
||||
END
|
||||
|
||||
339
HARD/B.C
Normal file
339
HARD/B.C
Normal file
|
|
@ -0,0 +1,339 @@
|
|||
/* blue screen dots */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include "..\dis\dis.h"
|
||||
|
||||
#define NEXTMODE { count=-1; mode++; }
|
||||
|
||||
extern int rows[200];
|
||||
extern int dotxyz[];
|
||||
extern int dodots(char *,char *);
|
||||
extern int sin1024[];
|
||||
|
||||
unsigned char far *vram=(char far *)0xa2d00000L;
|
||||
unsigned char far *vram0=(char far *)0xa0000000L;
|
||||
|
||||
char pal[768];
|
||||
char pal2[768];
|
||||
char defpal[768];
|
||||
|
||||
char *background;
|
||||
|
||||
int mode=0,count=-1,border=0;
|
||||
|
||||
extern int grid1[]; /* _grid1.obj */
|
||||
extern char dots1[]; /* _dots1.obj */
|
||||
extern char dots2[]; /* _dots1.obj */
|
||||
extern char dots3[]; /* _dots1.obj */
|
||||
extern char dots4[]; /* _dots1.obj */
|
||||
char *dotspnt;
|
||||
int dotsp;
|
||||
|
||||
int setborder(int c)
|
||||
{
|
||||
if(!border) return(0);
|
||||
_asm
|
||||
{
|
||||
mov dx,3dah
|
||||
in al,dx
|
||||
mov dx,3c0h
|
||||
mov al,11h+20h
|
||||
out dx,al
|
||||
mov al,byte ptr c
|
||||
out dx,al
|
||||
}
|
||||
}
|
||||
|
||||
int waitb(void)
|
||||
{
|
||||
dis_waitb();
|
||||
#if 0
|
||||
_asm
|
||||
{
|
||||
mov dx,3dah
|
||||
l1: in al,dx
|
||||
test al,8
|
||||
jz l1
|
||||
l2: in al,dx
|
||||
test al,8
|
||||
jnz l2
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int loadpal(char *pal,int cnt)
|
||||
{
|
||||
_asm
|
||||
{
|
||||
push ds
|
||||
lds si,pal
|
||||
mov dx,3c8h
|
||||
xor al,al
|
||||
out dx,al
|
||||
inc dx
|
||||
mov cx,cnt
|
||||
rep outsb
|
||||
pop ds
|
||||
}
|
||||
}
|
||||
|
||||
void adddot(int a,int b,int x,int y,int c)
|
||||
{
|
||||
static int doti=0,sc=0;
|
||||
if(!c) dotxyz[doti*6+5]=dotxyz[doti*6+4]=0x100;
|
||||
else
|
||||
{
|
||||
dotxyz[doti*6+0]=x*64+32-(a-x);
|
||||
dotxyz[doti*6+1]=y*64+32-(b-y);
|
||||
dotxyz[doti*6+2]=(a-x);
|
||||
dotxyz[doti*6+3]=(b-y);
|
||||
dotxyz[doti*6+4]=c+(66)*256;
|
||||
dotxyz[doti*6+5]=x+y*320;
|
||||
}
|
||||
doti++; doti&=2047; /* 2048 */
|
||||
}
|
||||
|
||||
int doit1(int x,int y,int col)
|
||||
{
|
||||
int a,x2,y2;
|
||||
static int flag=0;
|
||||
flag^=1;
|
||||
if(flag&1) { x2=x*4; y2=y*4; }
|
||||
else { x2=x*3; y2=y*3; }
|
||||
x2+=(rand()&31)-15;
|
||||
y2+=(rand()&31)-15;
|
||||
adddot(x+160,y+64,x2+160,y2+64,col);
|
||||
}
|
||||
|
||||
int doit2(int x,int y,int col)
|
||||
{
|
||||
int a,x2,y2;
|
||||
static int gx=0;
|
||||
x2=grid1[gx+0];
|
||||
y2=grid1[gx+1];
|
||||
gx+=2;
|
||||
if(gx>=200) gx=0;
|
||||
adddot(x2,y2,x+160,y+64,col);
|
||||
}
|
||||
|
||||
#include "bp.c"
|
||||
|
||||
main(int argc,char *argv[])
|
||||
{
|
||||
int endcnt=0;
|
||||
FILE *f1;
|
||||
unsigned u;
|
||||
int a,b,c,d,e,x,y,x2,y2,y1;
|
||||
dis_partstart();
|
||||
{
|
||||
_asm mov ax,13h
|
||||
_asm int 10h
|
||||
}
|
||||
waitb();
|
||||
memset(vram0,15,64000);
|
||||
while(dis_muscode(1)!=1 && !dis_exit());
|
||||
waitb();
|
||||
waitb();
|
||||
waitb();
|
||||
waitb();
|
||||
for(x=319;x>=0;x--)
|
||||
{
|
||||
vram0[x+100*320]=0;
|
||||
if(!(x&15)) waitb();
|
||||
}
|
||||
y1=100; a=100*64; b=0;
|
||||
while(y1<200)
|
||||
{
|
||||
b+=16;
|
||||
a+=b;
|
||||
y2=a/64;
|
||||
if(y2>200) y2=200;
|
||||
for(y=y1;y<y2;y++)
|
||||
{
|
||||
memset(vram0+y*320,0,320);
|
||||
}
|
||||
y1=y2;
|
||||
waitb();
|
||||
}
|
||||
for(a=0;a<70 && !dis_exit();a++) dis_waitb();
|
||||
|
||||
memset(defpal,0,768);
|
||||
loadpal(defpal,768);
|
||||
outp(0x3c0,0x11+0x20);
|
||||
outp(0x3c0,255);
|
||||
memset(vram0+0*320,255,35*320);
|
||||
memset(vram0+35*320,254,1*320);
|
||||
memset(vram0+36*320,0,128*320);
|
||||
memset(vram0+164*320,254,1*320);
|
||||
memset(vram0+165*320,255,35*320);
|
||||
defpal[0*3+0]=0;
|
||||
defpal[0*3+1]=0;
|
||||
defpal[0*3+2]=20;
|
||||
defpal[254*3+0]=45;
|
||||
defpal[254*3+1]=45;
|
||||
defpal[254*3+2]=45;
|
||||
defpal[255*3+0]=0;
|
||||
defpal[255*3+1]=0;
|
||||
defpal[255*3+2]=0;
|
||||
loadpal(defpal,768);
|
||||
for(a=0;a<200;a++) rows[a]=a*320;
|
||||
background=halloc(16384L,4L);
|
||||
memset(background,0,64000);
|
||||
dotspnt=dots1;
|
||||
if(argc==2)
|
||||
{
|
||||
switch(*argv[1])
|
||||
{
|
||||
case '1' : dotspnt=dots4; break;
|
||||
case '2' : mode=5; break;
|
||||
case '3' : mode=6; break;
|
||||
}
|
||||
for(a=0;a<256;a++) vram0[a]=vram0[a+320]=a;
|
||||
border=1;
|
||||
}
|
||||
x=y=c=0;
|
||||
|
||||
for(a=0;a<256;a++) vram0[a]=vram0[a+320]=255;
|
||||
border=0;
|
||||
|
||||
while(!dis_exit() && mode!=-1)
|
||||
{
|
||||
count++;
|
||||
setborder(255);
|
||||
waitb();
|
||||
if(mode==4 && count>0) loadpal(pal,768);
|
||||
if(mode==5 && count>500-17) loadpal(pal,768-6);
|
||||
if(mode==6 && count>0 && count<20) loadpal(pal,768-6);
|
||||
setborder(0);
|
||||
if(mode<4) dodots(background,vram);
|
||||
else if(mode==4) dodots2(background,vram);
|
||||
switch(mode)
|
||||
{
|
||||
case 0:
|
||||
if(count>32)
|
||||
{
|
||||
NEXTMODE;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(!count)
|
||||
{
|
||||
x=0;
|
||||
part1init();
|
||||
}
|
||||
else part1();
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
NEXTMODE;
|
||||
if(dotspnt==dots1) { mode=1; dotspnt=dots2; }
|
||||
else if(dotspnt==dots2) { mode=1; dotspnt=dots3; }
|
||||
else if(dotspnt==dots3) { mode=1; dotspnt=dots4; }
|
||||
else for(a=0;a<2048;a++) adddot(0,0,0,0,0);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(count>40) NEXTMODE;
|
||||
break;
|
||||
case 4:
|
||||
if(count>400)
|
||||
{
|
||||
NEXTMODE;
|
||||
}
|
||||
if(!count)
|
||||
{
|
||||
pal1colp=1;
|
||||
memset(background,0,64000);
|
||||
for(dotsp=a=0;a<2048;a++)
|
||||
{
|
||||
dotsp+=4;
|
||||
switch(dotspnt[dotsp])
|
||||
{
|
||||
case 1 :
|
||||
case 2 :
|
||||
case 3 : doit2(dotspnt[dotsp+2],dotspnt[dotsp+3],254); break;
|
||||
default : dotsp=0; break;
|
||||
}
|
||||
}
|
||||
for(a=3;a<32*3;a+=3)
|
||||
{
|
||||
pal[a+0]=0;
|
||||
pal[a+1]=0;
|
||||
pal[a+2]=20;
|
||||
}
|
||||
}
|
||||
a=252-pal1colp;
|
||||
d=a+66; if(d>254) d=254;
|
||||
c=63;
|
||||
for(;a<d;a++,c-=4)
|
||||
{
|
||||
if(c<0) c=0;
|
||||
b=c*c/64;
|
||||
pal[a*3+0]=b;
|
||||
pal[a*3+1]=b;
|
||||
pal[a*3+2]=b<20?20:b;
|
||||
}
|
||||
a=(254-65);
|
||||
pal[a*3+0]=63;
|
||||
pal[a*3+1]=63;
|
||||
pal[a*3+2]=63;
|
||||
pal[1*3+0]=63;
|
||||
pal[1*3+1]=63;
|
||||
pal[1*3+2]=63;
|
||||
pal1colp++;
|
||||
if(count>100)
|
||||
{
|
||||
for(a=0;a<2048;a++) adddot(0,0,0,0,0);
|
||||
NEXTMODE;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if(!count)
|
||||
{
|
||||
for(u=0;u<128*320;u++)
|
||||
{
|
||||
if(vram[u]==254-65) vram[u]=1;
|
||||
else vram[u]=0;
|
||||
}
|
||||
part2init();
|
||||
}
|
||||
else part2();
|
||||
break;
|
||||
case 6:
|
||||
if(!count)
|
||||
{
|
||||
part3init();
|
||||
}
|
||||
else part3();
|
||||
break;
|
||||
case 7:
|
||||
NEXTMODE;
|
||||
if(count>100)
|
||||
{
|
||||
NEXTMODE;
|
||||
}
|
||||
break;
|
||||
default :
|
||||
mode=-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!dis_indemo())
|
||||
{
|
||||
_asm mov ax,3h
|
||||
_asm int 10h
|
||||
}
|
||||
/*
|
||||
for(a=0;a<16;a++)
|
||||
{
|
||||
printf("%i: %i %i %i\n",a,
|
||||
points3[2+a*8+0],
|
||||
points3[2+a*8+1],
|
||||
points3[2+a*8+4]);
|
||||
}
|
||||
*/
|
||||
}
|
||||
BIN
HARD/B.EXE
Normal file
BIN
HARD/B.EXE
Normal file
Binary file not shown.
284
HARD/BA.ASM
Normal file
284
HARD/BA.ASM
Normal file
|
|
@ -0,0 +1,284 @@
|
|||
text_wa SEGMENT para public 'CODE'
|
||||
ASSUME cs:text_wa
|
||||
|
||||
.386
|
||||
LOCALS
|
||||
|
||||
NUM equ 2048
|
||||
public _rows,_dotxyz
|
||||
_rows dw 200 dup(0)
|
||||
dw 4 dup(64000)
|
||||
_dotxyz dw NUM dup(0,32767,0,0,100h,0)
|
||||
;dotmode=1: x,y,xa,ya,bytes:color/count,last
|
||||
|
||||
public _sin1024
|
||||
include sin1024.inc
|
||||
|
||||
public _dodots
|
||||
_dodots PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
|
||||
mov es,[bp+12]
|
||||
mov ds,[bp+8]
|
||||
call dot3d
|
||||
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_dodots ENDP
|
||||
|
||||
public _dodots2
|
||||
_dodots2 PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
|
||||
mov es,[bp+12]
|
||||
mov ds,[bp+8]
|
||||
call dot3d2
|
||||
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_dodots2 ENDP
|
||||
|
||||
public _do3dots
|
||||
_do3dots PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
|
||||
mov es,[bp+12]
|
||||
mov si,[bp+6]
|
||||
mov ds,[bp+8]
|
||||
call do3dots
|
||||
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_do3dots ENDP
|
||||
|
||||
dot3d PROC NEAR
|
||||
mov cx,NUM
|
||||
mov si,OFFSET _dotxyz
|
||||
xor bx,bx
|
||||
|
||||
a1: mov dx,cs:[si+8]
|
||||
cmp dl,0
|
||||
jne a4
|
||||
add si,12
|
||||
loop a1
|
||||
ret
|
||||
|
||||
a2: mov bx,cs:[si+10]
|
||||
mov byte ptr ds:[bx],dl
|
||||
mov byte ptr es:[bx],dl
|
||||
mov word ptr cs:[si+8],0100h
|
||||
add si,12
|
||||
loop a1
|
||||
ret
|
||||
|
||||
a4: ;dec dl
|
||||
dec dh
|
||||
jz a2
|
||||
mov cs:[si+8],dx
|
||||
mov bx,cs:[si+10]
|
||||
mov al,ds:[bx]
|
||||
mov es:[bx],al
|
||||
mov bx,cs:[si+2]
|
||||
add bx,cs:[si+6]
|
||||
mov cs:[si+2],bx
|
||||
sar bx,6
|
||||
cmp bx,127
|
||||
ja a5
|
||||
shl bx,1
|
||||
mov bx,cs:_rows[bx]
|
||||
mov ax,cs:[si+0]
|
||||
add ax,cs:[si+4]
|
||||
mov cs:[si+0],ax
|
||||
sar ax,6
|
||||
cmp ax,319
|
||||
ja a5
|
||||
add bx,ax
|
||||
mov es:[bx],dl
|
||||
mov cs:[si+10],bx
|
||||
a5: add si,12
|
||||
loop a1
|
||||
ret
|
||||
dot3d ENDP
|
||||
|
||||
dot3d2 PROC NEAR
|
||||
mov cx,NUM
|
||||
mov si,OFFSET _dotxyz
|
||||
xor bx,bx
|
||||
|
||||
@@1: mov dx,cs:[si+8]
|
||||
cmp dl,0
|
||||
jne @@4
|
||||
add si,12
|
||||
loop @@1
|
||||
ret
|
||||
|
||||
@@2: ;mov bx,cs:[si+10]
|
||||
;mov byte ptr ds:[bx],dl
|
||||
;mov byte ptr es:[bx],dl
|
||||
mov word ptr cs:[si+8],0100h
|
||||
add si,12
|
||||
loop @@1
|
||||
ret
|
||||
|
||||
@@4: dec dl
|
||||
dec dh
|
||||
jz @@2
|
||||
mov cs:[si+8],dx
|
||||
; mov bx,cs:[si+10]
|
||||
; mov al,ds:[bx]
|
||||
; mov es:[bx],al
|
||||
mov bx,cs:[si+2]
|
||||
add bx,cs:[si+6]
|
||||
mov cs:[si+2],bx
|
||||
sar bx,6
|
||||
cmp bx,127
|
||||
ja @@5
|
||||
shl bx,1
|
||||
mov bx,cs:_rows[bx]
|
||||
mov ax,cs:[si+0]
|
||||
add ax,cs:[si+4]
|
||||
mov cs:[si+0],ax
|
||||
sar ax,6
|
||||
cmp ax,319
|
||||
ja @@5
|
||||
add bx,ax
|
||||
mov es:[bx],dl
|
||||
; mov word ptr cs:[si+10],0
|
||||
@@5: add si,12
|
||||
loop @@1
|
||||
ret
|
||||
dot3d2 ENDP
|
||||
|
||||
tmpblue db 0
|
||||
PUBLIC _fadepal
|
||||
_fadepal PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
mov di,[bp+6]
|
||||
mov es,[bp+8]
|
||||
mov si,[bp+10]
|
||||
mov ds,[bp+12]
|
||||
mov dx,[bp+14]
|
||||
xor bx,bx
|
||||
cmp dx,256
|
||||
jb @@1
|
||||
mov dx,255
|
||||
@@1: mov dh,255
|
||||
sub dh,dl
|
||||
mov al,20
|
||||
mul dh
|
||||
mov cs:tmpblue,ah
|
||||
mov cx,256
|
||||
@@3: mov al,ds:[si+bx]
|
||||
mul dl
|
||||
mov es:[di+bx],ah
|
||||
inc bx
|
||||
mov al,ds:[si+bx]
|
||||
mul dl
|
||||
mov es:[di+bx],ah
|
||||
inc bx
|
||||
mov al,ds:[si+bx]
|
||||
mul dl
|
||||
add ah,cs:tmpblue
|
||||
mov es:[di+bx],ah
|
||||
inc bx
|
||||
loop @@3
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_fadepal ENDP
|
||||
|
||||
ALIGN 2
|
||||
shadowcx dw 250
|
||||
shadowcy dw 150
|
||||
mul10000 dw 3000
|
||||
PUBLIC _depthcol
|
||||
_depthcol db 8192 dup(0)
|
||||
|
||||
do3dots PROC NEAR
|
||||
mov cx,ds:[si]
|
||||
add si,4
|
||||
@@1: mov bx,ds:[si+6]
|
||||
mov byte ptr es:[bx],0
|
||||
mov bx,ds:[si+12]
|
||||
mov word ptr es:[bx],0
|
||||
mov word ptr es:[bx+320],0
|
||||
mov bp,ds:[si+8]
|
||||
cmp bp,3000
|
||||
jg @@2
|
||||
jmp @@4
|
||||
mov bx,ds:[si]
|
||||
mov ax,bx
|
||||
sub ax,cs:shadowcx
|
||||
imul cs:mul10000
|
||||
idiv bp
|
||||
add ax,cs:shadowcx
|
||||
push ax
|
||||
mov bx,ds:[si+2]
|
||||
mov ax,bx
|
||||
sub ax,cs:shadowcy
|
||||
imul cs:mul10000
|
||||
idiv bp
|
||||
add ax,cs:shadowcy
|
||||
mov bx,ax
|
||||
pop ax
|
||||
cmp ax,318
|
||||
ja @@3
|
||||
cmp bx,126
|
||||
ja @@3
|
||||
shl bx,1
|
||||
mov bx,cs:_rows[bx]
|
||||
add bx,ax
|
||||
mov ds:[si+12],bx
|
||||
mov word ptr es:[bx],0ffffh
|
||||
mov word ptr es:[bx+320],0ffffh
|
||||
|
||||
@@4: mov al,cs:_depthcol[bp]
|
||||
mov bx,ds:[si+2]
|
||||
cmp bx,127
|
||||
ja @@2
|
||||
shl bx,1
|
||||
mov bx,cs:_rows[bx]
|
||||
add bx,ds:[si]
|
||||
mov ds:[si+6],bx
|
||||
mov byte ptr es:[bx],al
|
||||
add si,16
|
||||
loop @@1
|
||||
ret
|
||||
@@3: mov word ptr ds:[si+12],0
|
||||
jmp @@4
|
||||
@@2: mov word ptr ds:[si+6],0
|
||||
add si,16
|
||||
loop @@1
|
||||
ret
|
||||
do3dots ENDP
|
||||
|
||||
text_wa ENDS
|
||||
END
|
||||
|
||||
1
HARD/BACKX.BAT
Normal file
1
HARD/BACKX.BAT
Normal file
|
|
@ -0,0 +1 @@
|
|||
pkzip %1 %2 -Pr -x*.exe -x*.obj -x*.~* -x*.ob
|
||||
BIN
HARD/BBAK.EXE
Normal file
BIN
HARD/BBAK.EXE
Normal file
Binary file not shown.
42
HARD/BDO.C
Normal file
42
HARD/BDO.C
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#include <stdio.h>
|
||||
|
||||
unsigned char logodat[64000];
|
||||
|
||||
void doit(char *name,int ybase)
|
||||
{
|
||||
int x,y;
|
||||
FILE *f2;
|
||||
unsigned u,c;
|
||||
printf("%s : ",name);
|
||||
f2=fopen(name,"wb");
|
||||
for(c=x=0;x<320;x++) for(y=0;y<40;y++)
|
||||
{
|
||||
u=x+y*320+ybase*320;
|
||||
if(logodat[u]<4 && logodat[u])
|
||||
{
|
||||
c++;
|
||||
putc(logodat[u],f2);
|
||||
putc(0,f2);
|
||||
putc(x-160,f2);
|
||||
putc(y-20,f2);
|
||||
}
|
||||
}
|
||||
putc(0,f2);
|
||||
printf("%i dots.\n",c);
|
||||
fclose(f2);
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
FILE *f1;
|
||||
printf("Creating movement tables for FC logo...\n");
|
||||
|
||||
f1=fopen("fcrz.u","rb");
|
||||
fread(logodat,320,200,f1);
|
||||
fclose(f1);
|
||||
|
||||
doit("_dots1.tmp",0);
|
||||
doit("_dots2.tmp",40);
|
||||
doit("_dots3.tmp",80);
|
||||
doit("_dots4.tmp",120);
|
||||
}
|
||||
BIN
HARD/BDO.EXE
Normal file
BIN
HARD/BDO.EXE
Normal file
Binary file not shown.
38
HARD/BDOOLD.C
Normal file
38
HARD/BDOOLD.C
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#include <stdio.h>
|
||||
|
||||
unsigned char logodat[64000];
|
||||
|
||||
main()
|
||||
{
|
||||
int x,y;
|
||||
FILE *f1,*f2;
|
||||
unsigned u,c;
|
||||
printf("Creating movement tables for FC logo...\n");
|
||||
|
||||
f2=fopen("_dots1.tmp","wb");
|
||||
f1=fopen("fckoe3.u","rb");
|
||||
fread(logodat,320,200,f1);
|
||||
fclose(f1);
|
||||
|
||||
#if 0
|
||||
for(c=x=0;x<320;x++) for(y=0;y<200;y++)
|
||||
{
|
||||
u=(x+y*320); if(logodat[u]) c++;
|
||||
}
|
||||
#endif
|
||||
|
||||
for(x=0;x<320;x++) for(y=0;y<200;y++)
|
||||
{
|
||||
u=x+y*320;
|
||||
if(logodat[u]==2 || logodat[u]==1)
|
||||
{
|
||||
putc(logodat[u],f2);
|
||||
putc(0,f2);
|
||||
putc(x-160,f2);
|
||||
putc(y-32,f2);
|
||||
}
|
||||
}
|
||||
putc(0,f2);
|
||||
|
||||
fclose(f2);
|
||||
}
|
||||
299
HARD/BP.C
Normal file
299
HARD/BP.C
Normal file
|
|
@ -0,0 +1,299 @@
|
|||
/* parts */
|
||||
|
||||
char pal1[768];
|
||||
int pal1colp=0;
|
||||
|
||||
void part1init(void)
|
||||
{
|
||||
int a,b,c;
|
||||
if(!pal1colp) memcpy(pal,defpal,768);
|
||||
for(c=(16)*3,a=0;a<64;a++)
|
||||
{
|
||||
b=64-a; b=b*b/64;
|
||||
if(b<0) b=0; else if(b>63) b=63;
|
||||
pal1[a*3+c+0]=b;
|
||||
pal1[a*3+c+64*3+0]=b*2/3;
|
||||
pal1[a*3+c+128*3+0]=b*1/3;
|
||||
b=64-a; b=b*b/64;
|
||||
if(b<0) b=0; else if(b>63) b=63;
|
||||
pal1[a*3+c+1]=b;
|
||||
pal1[a*3+c+64*3+1]=b*2/3;
|
||||
pal1[a*3+c+128*3+1]=b*1/3;
|
||||
b=64-a;
|
||||
b=b*4/6;
|
||||
if(b<0) b=0; else if(b>63) b=63;
|
||||
pal1[a*3+c+2]=b+20;
|
||||
pal1[a*3+c+64*3+2]=b*2/3+20;
|
||||
pal1[a*3+c+128*3+2]=b*1/3+20;
|
||||
}
|
||||
waitb();
|
||||
inp(0x3da);
|
||||
dotsp=0;
|
||||
pal1colp+=4;
|
||||
}
|
||||
|
||||
void part1(void)
|
||||
{
|
||||
int a,b;
|
||||
b=count-6; if(b<0) b=0; else if(b>63) b=63;
|
||||
b=b*3+16*3;
|
||||
pal[-3*4+pal1colp*3+1*3+0]=pal1[0*3+b+0];
|
||||
pal[-3*4+pal1colp*3+1*3+1]=pal1[0*3+b+1];
|
||||
pal[-3*4+pal1colp*3+1*3+2]=pal1[0*3+b+2];
|
||||
pal[-3*4+pal1colp*3+2*3+0]=pal1[64*3+b+0];
|
||||
pal[-3*4+pal1colp*3+2*3+1]=pal1[64*3+b+1];
|
||||
pal[-3*4+pal1colp*3+2*3+2]=pal1[64*3+b+2];
|
||||
pal[-3*4+pal1colp*3+3*3+0]=pal1[128*3+b+0];
|
||||
pal[-3*4+pal1colp*3+3*3+1]=pal1[128*3+b+1];
|
||||
pal[-3*4+pal1colp*3+3*3+2]=pal1[128*3+b+2];
|
||||
b=(64-(count>64?64:count))*3+16*3;
|
||||
pal[pal1colp*3+1*3+0]=pal1[0*3+b+0];
|
||||
pal[pal1colp*3+1*3+1]=pal1[0*3+b+1];
|
||||
pal[pal1colp*3+1*3+2]=pal1[0*3+b+2];
|
||||
pal[pal1colp*3+2*3+0]=pal1[64*3+b+0];
|
||||
pal[pal1colp*3+2*3+1]=pal1[64*3+b+1];
|
||||
pal[pal1colp*3+2*3+2]=pal1[64*3+b+2];
|
||||
pal[pal1colp*3+3*3+0]=pal1[128*3+b+0];
|
||||
pal[pal1colp*3+3*3+1]=pal1[128*3+b+1];
|
||||
pal[pal1colp*3+3*3+2]=pal1[128*3+b+2];
|
||||
loadpal(pal,32*3);
|
||||
if(count<8) for(a=0;a<2048/8;a++)
|
||||
{
|
||||
dotsp+=4;
|
||||
switch(dotspnt[dotsp])
|
||||
{
|
||||
case 1 : doit1(dotspnt[dotsp+2],dotspnt[dotsp+3],3+pal1colp); break;
|
||||
case 2 : doit1(dotspnt[dotsp+2],dotspnt[dotsp+3],2+pal1colp); break;
|
||||
case 3 : doit1(dotspnt[dotsp+2],dotspnt[dotsp+3],1+pal1colp); break;
|
||||
default : dotsp=0; break;
|
||||
}
|
||||
}
|
||||
else if(count>=72) NEXTMODE;
|
||||
}
|
||||
|
||||
/*################################################################*/
|
||||
|
||||
extern int csetmatrix(int *,long,long,long);
|
||||
extern int crotlist(long *,long *);
|
||||
extern int cclipedges(int *,int *,long *); // modifies given point list
|
||||
extern int cprojlist(long *,long *);
|
||||
extern int cdrawpolylist(int *);
|
||||
extern int cmatrix_yxz(int,int,int,int *);
|
||||
extern int cpolylist(int *polylist,int *polys,int *edges,long *points3);
|
||||
extern int ceasypolylist(int *polylist,int *polys,long *points3);
|
||||
|
||||
long cubepoints[]={8,
|
||||
-510,-510,-510,
|
||||
410,-510,-510,
|
||||
410,410,-510,
|
||||
-510,410,-510,
|
||||
-510,-510,410,
|
||||
410,-510,410,
|
||||
410,410,410,
|
||||
-510,410,410
|
||||
};
|
||||
int cubepolys[]={
|
||||
4,0x4001,3,2,1,0,
|
||||
4,0x4002,4,5,6,7,
|
||||
4,0x4004,0,1,5,4,
|
||||
4,0x4008,1,2,6,5,
|
||||
4,0x4010,2,3,7,6,
|
||||
4,0x4020,3,0,4,7,
|
||||
0};
|
||||
int cubepolyss[]={
|
||||
4,0x4040,3+8,2+8,1+8,0+8,
|
||||
4,0x4040,4+8,5+8,6+8,7+8,
|
||||
4,0x4040,0+8,1+8,5+8,4+8,
|
||||
4,0x4040,1+8,2+8,6+8,5+8,
|
||||
4,0x4040,2+8,3+8,7+8,6+8,
|
||||
4,0x4040,3+8,0+8,4+8,7+8,
|
||||
0};
|
||||
|
||||
long gridpoints[1010*3];
|
||||
|
||||
int polylist[256];
|
||||
long points2[1010*3];
|
||||
int points3[1010*8];
|
||||
|
||||
int rx=0,ry=0,rz=0,zp=5600;
|
||||
|
||||
int matrix[9];
|
||||
|
||||
extern char depthcol[];
|
||||
|
||||
void part2init(void)
|
||||
{
|
||||
int a,r,g,b,x,y,z,d;
|
||||
|
||||
for(a=0;a<3100;a++)
|
||||
{
|
||||
if(a<1000 || b>=3000) b=127;
|
||||
else b=127-(a-1000)/32;
|
||||
depthcol[a]=b;
|
||||
}
|
||||
|
||||
memcpy(pal,defpal,768);
|
||||
pal[1*3+0]=63;
|
||||
pal[1*3+1]=63;
|
||||
pal[1*3+2]=63;
|
||||
pal[250*3+0]=0;
|
||||
pal[250*3+1]=0;
|
||||
pal[250*3+2]=40;
|
||||
d=64;
|
||||
for(a=0;a<64;a++)
|
||||
{
|
||||
b=a+d; if(b>63) b=63;
|
||||
pal[64*3+a*3+0]=a;
|
||||
b=a+20+d; if(b>63) b=63;
|
||||
pal[64*3+a*3+1]=b;
|
||||
b=a+40+d; if(b>63) b=63;
|
||||
pal[64*3+a*3+2]=b;
|
||||
if(d>0) d-=8;
|
||||
}
|
||||
loadpal(pal,768);
|
||||
memcpy(pal2,pal,768);
|
||||
|
||||
a=1;
|
||||
for(x=0;x<10;x++) for(y=0;y<10;y++) for(z=0;z<10;z++)
|
||||
if(!x || !y || !z || x==9 || y==9 || z==9)
|
||||
{
|
||||
gridpoints[a++]=(x-5)*100;
|
||||
gridpoints[a++]=(y-5)*100;
|
||||
gridpoints[a++]=(z-5)*100;
|
||||
}
|
||||
gridpoints[0]=(a-1)/3;
|
||||
|
||||
zp=3500;
|
||||
}
|
||||
|
||||
void part2(void)
|
||||
{
|
||||
int a,x,y;
|
||||
if(count>=500) NEXTMODE;
|
||||
if(count>500-16)
|
||||
{
|
||||
a=(500-16)-count;
|
||||
fadepal(pal,pal2,a*16);
|
||||
}
|
||||
|
||||
setborder(0);
|
||||
cmatrix_yxz(rx,ry,rz,matrix);
|
||||
csetmatrix(matrix,0,0,zp);
|
||||
setborder(1);
|
||||
points3[0]=0; crotprojlist(points3,gridpoints);
|
||||
setborder(250);
|
||||
do3dots(points3,vram);
|
||||
#if 0
|
||||
if(count==2)
|
||||
{
|
||||
FILE *f1;
|
||||
f1=fopen("_grid1.tmp","wb");
|
||||
for(a=0;a<points3[0];a++) if(points3[2+a*8+4]<=3000)
|
||||
{
|
||||
x=points3[2+a*8+0];
|
||||
y=points3[2+a*8+1];
|
||||
putw(x,f1);
|
||||
putw(y,f1);
|
||||
}
|
||||
fclose(f1);
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
for(a=0;a<1000;a++)
|
||||
{
|
||||
x=points3[2+a*8+0];
|
||||
y=points3[2+a*8+1];
|
||||
vram[x+y*320]++;
|
||||
}
|
||||
#endif
|
||||
if(count>1)
|
||||
{
|
||||
rx+=9; ry+=10; rz+=11;
|
||||
if(zp>2000) zp-=10;
|
||||
}
|
||||
setborder(255);
|
||||
}
|
||||
|
||||
/*################################################################*/
|
||||
|
||||
|
||||
void part3init(void)
|
||||
{
|
||||
int a,r,g,b;
|
||||
memcpy(pal,defpal,768);
|
||||
for(a=1;a<128;a++)
|
||||
{
|
||||
r=g=0; b=20;
|
||||
if(a&0x1) { g+=20; r+=20; }
|
||||
if(a&0x2) { g+=22; r+=22; }
|
||||
if(a&0x4) { g+=24; r+=24; }
|
||||
if(a&0x8) { g+=26; r+=26; }
|
||||
if(a&0x10) { g+=28; r+=28; }
|
||||
if(a&0x20) { g+=30; r+=30; }
|
||||
if(a&0x40) { b=15; }
|
||||
if(r>63) r=63;
|
||||
if(g>63) g=63;
|
||||
if(b>63) b=63;
|
||||
pal2[a*3+0]=r;
|
||||
pal2[a*3+1]=g;
|
||||
pal2[a*3+2]=b;
|
||||
}
|
||||
for(a=2;a<254;a++)
|
||||
{
|
||||
pal[a*3+0]=0;
|
||||
pal[a*3+1]=0;
|
||||
pal[a*3+2]=20;
|
||||
}
|
||||
loadpal(pal,768);
|
||||
/*
|
||||
rx=0;
|
||||
ry=0;
|
||||
rz=0;
|
||||
zp=5600;
|
||||
*/
|
||||
}
|
||||
|
||||
void part3(void)
|
||||
{
|
||||
int a,b,c,x,y;
|
||||
int liy=80,lix=190;
|
||||
static int ct2=0;
|
||||
long lz,z;
|
||||
if(count>=800) NEXTMODE;
|
||||
if(dis_muscode(0xff)==0xff) NEXTMODE;
|
||||
|
||||
ct2+=4;
|
||||
lix=sin1024[ct2&1023]/2+160;
|
||||
liy=sin1024[(ct2+256)&1023]/2+64;
|
||||
|
||||
setborder(0);
|
||||
cglenzinit();
|
||||
cmatrix_yxz(rx,ry,rz,matrix);
|
||||
csetmatrix(matrix,0,0,zp);
|
||||
points2[0]=0; crotlist(points2,cubepoints);
|
||||
points3[0]=0; cprojlist((long *)points3,points2);
|
||||
points3[0]+=8;
|
||||
for(a=0;a<8*8;a+=8)
|
||||
{
|
||||
x=points3[2+a+0];
|
||||
y=points3[2+a+1];
|
||||
z=points3[2+a+4];
|
||||
z+=2000;
|
||||
lz=3000+2000;
|
||||
x=(long)(x-lix)*lz/(long)z+lix;
|
||||
y=(long)(y-liy)*lz/(long)z+liy;
|
||||
points3[8*8+2+a+0]=x;
|
||||
points3[8*8+2+a+1]=y;
|
||||
points3[8*8+2+a+4]=3000;
|
||||
}
|
||||
ceasymode(0);
|
||||
cclipeasypolylist(polylist,cubepolyss,(long *)points3);
|
||||
cglenzpolylist(polylist);
|
||||
ceasymode(1);
|
||||
cclipeasypolylist(polylist,cubepolys,(long *)points3);
|
||||
cglenzpolylist(polylist);
|
||||
cglenzdone();
|
||||
setborder(255);
|
||||
rx+=9; ry+=10; rz+=11;
|
||||
if(count<20) fadepal(pal,pal2,count*16);
|
||||
}
|
||||
27
HARD/CUT
Normal file
27
HARD/CUT
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
checkhiddenbx PROC NEAR
|
||||
push si
|
||||
mov ax,es:[bx]
|
||||
mov si,es:[bx+2]
|
||||
sub ax,es:[bx+4]
|
||||
sub si,es:[bx+8+2]
|
||||
imul si
|
||||
push ax
|
||||
push dx
|
||||
mov ax,es:[bx+2]
|
||||
mov si,es:[bx]
|
||||
sub ax,es:[bx+4+2]
|
||||
sub si,es:[bx+8]
|
||||
imul si
|
||||
pop cx
|
||||
pop si
|
||||
sub ax,si
|
||||
sbb dx,cx
|
||||
pop si
|
||||
cmp dx,0
|
||||
jl @@1
|
||||
clc
|
||||
ret
|
||||
@@1: stc
|
||||
ret
|
||||
checkhiddenbx ENDP
|
||||
|
||||
34
HARD/DOC
Normal file
34
HARD/DOC
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
pointlist:
|
||||
word points in list
|
||||
word -
|
||||
dword x,y,z
|
||||
...
|
||||
|
||||
projectedpointlist:
|
||||
word points in list
|
||||
word -
|
||||
.
|
||||
word sx 0
|
||||
word sy 2
|
||||
word fl 4
|
||||
word - 6
|
||||
dword z 8
|
||||
word x 12 ;these could overflow :-( since the actual ones are 32 bits
|
||||
word y 14 ;-"-
|
||||
|
||||
polygroup:
|
||||
word sides (0=end)
|
||||
word color
|
||||
word x,y
|
||||
...
|
||||
|
||||
edgelist:
|
||||
word edges
|
||||
word -
|
||||
.
|
||||
word v1,v2,f,0 f&8000:hidden edge
|
||||
|
||||
hline list:
|
||||
word starty
|
||||
...
|
||||
word x1(-32767=end),x2
|
||||
89
HARD/DOLINE.C
Normal file
89
HARD/DOLINE.C
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
// create code for line blitter
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
char *vram=(char *)0xa0000000L;
|
||||
|
||||
FILE *out;
|
||||
|
||||
|
||||
void line(int x1,int y1,int x2,int y2)
|
||||
{
|
||||
int xd=x2-x1;
|
||||
int yd=y2-y1;
|
||||
int a,d,x,y;
|
||||
memset(vram,0,16*320);
|
||||
if(xd>yd)
|
||||
{
|
||||
d=-xd/2;
|
||||
while(x1<x2 || y1<y2)
|
||||
{
|
||||
vram[x1+y1*320]=2;
|
||||
x1++;
|
||||
d+=yd;
|
||||
if(d>0)
|
||||
{
|
||||
d-=xd;
|
||||
y1++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
d=-yd/2;
|
||||
while(x1<x2 || y1<y2)
|
||||
{
|
||||
vram[x1+y1*320]=2;
|
||||
y1++;
|
||||
d+=xd;
|
||||
if(d>0)
|
||||
{
|
||||
d-=yd;
|
||||
x1++;
|
||||
}
|
||||
}
|
||||
}
|
||||
//vram[x2+y2*320]=1;
|
||||
for(y=0;y<16;y++) for(x=0;x<16;x++) if(vram[x+y*320])
|
||||
{
|
||||
if(vram[x+y*320+1])
|
||||
{
|
||||
fprintf(out,"mov es:[di+%i],ax\n",x+y*320);
|
||||
vram[x+y*320]=vram[x+y*320+1]=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(out,"mov es:[di+%i],al\n",x+y*320);
|
||||
vram[x+y*320]=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
int x,y;
|
||||
_asm mov ax,13h
|
||||
_asm int 10h
|
||||
out=fopen("lineblit.inc","wt");
|
||||
fprintf(out,";LineBlitter core - created by doline.c\n");
|
||||
fprintf(out,"lblt_table LABEL WORD\n");
|
||||
for(x=0;x<16;x++)
|
||||
{
|
||||
for(y=0;y<16;y++)
|
||||
{
|
||||
fprintf(out,"dw OFFSET lblt_%i_%i\n",x,y);
|
||||
}
|
||||
}
|
||||
for(x=0;x<16;x++)
|
||||
{
|
||||
for(y=0;y<16;y++)
|
||||
{
|
||||
fprintf(out,"lblt_%i_%i:\n",x,y);
|
||||
line(0,0,x,y);
|
||||
fprintf(out,"ret\n",x,y);
|
||||
}
|
||||
}
|
||||
fclose(out);
|
||||
_asm mov ax,3h
|
||||
_asm int 10h
|
||||
}
|
||||
BIN
HARD/DOLINE.EXE
Normal file
BIN
HARD/DOLINE.EXE
Normal file
Binary file not shown.
BIN
HARD/DP_PREFS
Normal file
BIN
HARD/DP_PREFS
Normal file
Binary file not shown.
176
HARD/EDGE.BBK
Normal file
176
HARD/EDGE.BBK
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
#include <stdio.h>
|
||||
#include <graph.h>
|
||||
|
||||
char far *vram=(char far *)0xa0000000L;
|
||||
|
||||
int edge[256];
|
||||
|
||||
int ep[200];
|
||||
int ec;
|
||||
struct
|
||||
{
|
||||
int c,next;
|
||||
int y1,y2;
|
||||
long x1,x; // x used, x1=original
|
||||
long dx;
|
||||
} e[256];
|
||||
|
||||
int list[256],listc;
|
||||
|
||||
unsigned draworders[32000],dop;
|
||||
|
||||
void pass3(void)
|
||||
{
|
||||
unsigned int u,ut,i,c;
|
||||
for(i=c=u=0;i<dop;i+=2)
|
||||
{
|
||||
ut=draworders[i+0];
|
||||
while(u<ut) vram[u++]=c;
|
||||
c^=draworders[i+1];
|
||||
}
|
||||
|
||||
#if 0
|
||||
{
|
||||
for(u=0;u<64000;u+=320)
|
||||
{
|
||||
c=0;
|
||||
for(x=0;x<320;x++)
|
||||
{
|
||||
c^=vram[x+u]&0x7;
|
||||
vram[x+u]=c;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void pass2(void)
|
||||
{
|
||||
int j,k,i,y,c;
|
||||
long x,lx;
|
||||
listc=0;
|
||||
dop=0;
|
||||
for(y=0;y<200;y++)
|
||||
{
|
||||
// add new ones this row
|
||||
i=ep[y];
|
||||
while(i)
|
||||
{
|
||||
list[listc++]=i;
|
||||
e[i].x=e[i].x1;
|
||||
i=e[i].next;
|
||||
}
|
||||
// sort list
|
||||
for(k=1;k<listc;k++)
|
||||
{
|
||||
x=e[i=list[k]].x;
|
||||
for(j=k-1;j>=0 && x<e[list[j]].x;j--)
|
||||
list[j+1]=list[j];
|
||||
list[j+1]=i;
|
||||
}
|
||||
// do list & kill completed ones
|
||||
for(k=j=0;j<listc;j++)
|
||||
{
|
||||
i=list[j];
|
||||
if(y>=e[i].y2) continue;
|
||||
if(k!=j) list[k]=i;
|
||||
k++;
|
||||
x=e[i].x;
|
||||
if(lx==x) draworders[dop-1]^=e[i].c;
|
||||
else
|
||||
{
|
||||
draworders[dop++]=y*320+(lx=(e[i].x>>16));
|
||||
draworders[dop++]=e[i].c;
|
||||
}
|
||||
//vram[(e[i].x>>16)+y*320]=k; // e[i].c;
|
||||
e[i].x+=e[i].dx;
|
||||
}
|
||||
listc=k;
|
||||
}
|
||||
printf("%i\n",dop);
|
||||
}
|
||||
|
||||
void pass1(int *edge)
|
||||
{
|
||||
int dy,y1,y2,x1,x2,a;
|
||||
ec=1; memset(ep,0,200*2);
|
||||
while(*edge!=0x8000)
|
||||
{
|
||||
e[ec].c=edge[0];
|
||||
y1=edge[3];
|
||||
y2=edge[5];
|
||||
if(y1>y2)
|
||||
{
|
||||
x1=y1; y1=y2; y2=x1; // y1<=>y2
|
||||
x1=edge[4];
|
||||
x2=edge[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
x1=edge[2];
|
||||
x2=edge[4];
|
||||
}
|
||||
e[ec].x1=(long)x1<<16;
|
||||
e[ec].dx=((long)(x2-x1)<<16)/(y2-y1);
|
||||
// if y1<0 clip
|
||||
e[ec].y1=y1;
|
||||
e[ec].y2=y2;
|
||||
if(a=ep[y1])
|
||||
{ // add
|
||||
ep[y1]=ec;
|
||||
e[ec].next=a;
|
||||
}
|
||||
else
|
||||
{ // first
|
||||
ep[y1]=ec;
|
||||
e[ec].next=0;
|
||||
}
|
||||
#if 0
|
||||
_setcolor(8);
|
||||
_moveto(0,y1);
|
||||
_lineto(319,y1);
|
||||
_setcolor(15);
|
||||
_setpixel(x1,y1);
|
||||
#endif
|
||||
ec++;
|
||||
edge+=6;
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
int a,b,c,x,y;
|
||||
_setvideomode(_MRES256COLOR);
|
||||
x=100; y=100; for(a=0;a<60;a++) rand();
|
||||
for(a=b=0;a<8;a++)
|
||||
{
|
||||
edge[b++]=2; // color
|
||||
b++;
|
||||
edge[b++]=x; // X1
|
||||
edge[b++]=y; // Y1
|
||||
x=edge[b++]=rand()%320; // X2
|
||||
y=edge[b++]=rand()%200; // Y2
|
||||
}
|
||||
edge[b++]=2; // color
|
||||
b++;
|
||||
edge[b++]=x; // X1
|
||||
edge[b++]=y; // Y1
|
||||
edge[b++]=100; // X2
|
||||
edge[b++]=100; // Y2
|
||||
edge[b++]=0x8000; // end of list
|
||||
#if 0
|
||||
_setcolor(8);
|
||||
for(b=0;edge[b]!=0x8000;b+=6)
|
||||
{
|
||||
_moveto(edge[b+2],edge[b+3]);
|
||||
_lineto(edge[b+4],edge[b+5]);
|
||||
}
|
||||
#endif
|
||||
pass1(edge);
|
||||
//getch();
|
||||
pass2();
|
||||
getch();
|
||||
pass3();
|
||||
getch();
|
||||
_setvideomode(_DEFAULTMODE);
|
||||
}
|
||||
159
HARD/EDGE.C
Normal file
159
HARD/EDGE.C
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
#include <stdio.h>
|
||||
#include <graph.h>
|
||||
|
||||
char far *vram=(char far *)0xa0000000L;
|
||||
|
||||
int edge[512];
|
||||
|
||||
int ep[200];
|
||||
int ec;
|
||||
struct
|
||||
{
|
||||
int c,next;
|
||||
int y1,y2;
|
||||
long x1,x; // x used, x1=original
|
||||
long dx;
|
||||
} e[256];
|
||||
|
||||
int list[256],listc;
|
||||
|
||||
unsigned draworders[32000],dop;
|
||||
|
||||
void pass3(void)
|
||||
{
|
||||
unsigned int u,ut,i,c;
|
||||
for(i=c=u=0;i<dop;i+=2)
|
||||
{
|
||||
ut=draworders[i+0];
|
||||
while(u<ut) vram[u++]=c;
|
||||
c^=draworders[i+1];
|
||||
}
|
||||
}
|
||||
|
||||
void pass2(void)
|
||||
{
|
||||
int j,k,i,y,c;
|
||||
long x,lx;
|
||||
listc=0;
|
||||
dop=0;
|
||||
for(y=0;y<200;y++)
|
||||
{
|
||||
// add new ones this row
|
||||
i=ep[y];
|
||||
while(i)
|
||||
{
|
||||
list[listc++]=i;
|
||||
e[i].x=e[i].x1;
|
||||
i=e[i].next;
|
||||
}
|
||||
// sort list
|
||||
for(k=1;k<listc;k++)
|
||||
{
|
||||
x=e[i=list[k]].x;
|
||||
for(j=k-1;j>=0 && x<e[list[j]].x;j--)
|
||||
list[j+1]=list[j];
|
||||
list[j+1]=i;
|
||||
}
|
||||
// do list & kill completed ones
|
||||
for(k=j=0;j<listc;j++)
|
||||
{
|
||||
i=list[j];
|
||||
if(y>=e[i].y2) continue;
|
||||
if(k!=j) list[k]=i;
|
||||
k++;
|
||||
x=e[i].x;
|
||||
if(lx==x) draworders[dop-1]^=e[i].c;
|
||||
else
|
||||
{
|
||||
draworders[dop++]=y*320+(lx=(e[i].x>>16));
|
||||
draworders[dop++]=e[i].c;
|
||||
}
|
||||
vram[(e[i].x>>16)+y*320]=e[i].c;
|
||||
e[i].x+=e[i].dx;
|
||||
}
|
||||
listc=k;
|
||||
}
|
||||
}
|
||||
|
||||
void pass1(int *edge)
|
||||
{
|
||||
int dy,y1,y2,x1,x2,a;
|
||||
ec=1; memset(ep,0,200*2);
|
||||
while(*edge!=0x8000)
|
||||
{
|
||||
e[ec].c=edge[0];
|
||||
y1=edge[3];
|
||||
y2=edge[5];
|
||||
if(y1>y2)
|
||||
{
|
||||
x1=y1; y1=y2; y2=x1; // y1<=>y2
|
||||
x1=edge[4];
|
||||
x2=edge[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
x1=edge[2];
|
||||
x2=edge[4];
|
||||
}
|
||||
e[ec].x1=(long)x1<<16;
|
||||
e[ec].dx=((long)(x2-x1)<<16)/(y2-y1);
|
||||
// if y1<0 clip
|
||||
e[ec].y1=y1;
|
||||
e[ec].y2=y2;
|
||||
if(a=ep[y1])
|
||||
{ // add
|
||||
ep[y1]=ec;
|
||||
e[ec].next=a;
|
||||
}
|
||||
else
|
||||
{ // first
|
||||
ep[y1]=ec;
|
||||
e[ec].next=0;
|
||||
}
|
||||
ec++;
|
||||
edge+=6;
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
int a,b,c,x,y;
|
||||
_setvideomode(_MRES256COLOR);
|
||||
for(a=0;a<60;a++) rand();
|
||||
b=0;
|
||||
for(c=1;c<=4;c<<=1)
|
||||
{
|
||||
x=100+c*10; y=100+c*10;
|
||||
for(a=0;a<8;a++)
|
||||
{
|
||||
edge[b++]=c; // color
|
||||
b++;
|
||||
edge[b++]=x; // X1
|
||||
edge[b++]=y; // Y1
|
||||
x=edge[b++]=rand()%320; // X2
|
||||
y=edge[b++]=rand()%200; // Y2
|
||||
}
|
||||
edge[b++]=c; // color
|
||||
b++;
|
||||
edge[b++]=x; // X1
|
||||
edge[b++]=y; // Y1
|
||||
edge[b++]=100+c*10; // X2
|
||||
edge[b++]=100+c*10; // Y2
|
||||
}
|
||||
edge[b++]=0x8000; // end of list
|
||||
|
||||
#if 0
|
||||
_setcolor(8);
|
||||
for(b=0;edge[b]!=0x8000;b+=6)
|
||||
{
|
||||
_moveto(edge[b+2],edge[b+3]);
|
||||
_lineto(edge[b+4],edge[b+5]);
|
||||
}
|
||||
#endif
|
||||
pass1(edge);
|
||||
pass2();
|
||||
getch();
|
||||
pass3();
|
||||
getch();
|
||||
_setvideomode(_DEFAULTMODE);
|
||||
}
|
||||
BIN
HARD/EDGE.EXE
Normal file
BIN
HARD/EDGE.EXE
Normal file
Binary file not shown.
BIN
HARD/FCKOE3.PAL
Normal file
BIN
HARD/FCKOE3.PAL
Normal file
Binary file not shown.
BIN
HARD/FCKOE3.U
Normal file
BIN
HARD/FCKOE3.U
Normal file
Binary file not shown.
BIN
HARD/FCLOGOS.LBM
Normal file
BIN
HARD/FCLOGOS.LBM
Normal file
Binary file not shown.
BIN
HARD/FCRZ.U
Normal file
BIN
HARD/FCRZ.U
Normal file
Binary file not shown.
BIN
HARD/GL10.LIB
Normal file
BIN
HARD/GL10.LIB
Normal file
Binary file not shown.
394
HARD/GMAIN.C
Normal file
394
HARD/GMAIN.C
Normal file
|
|
@ -0,0 +1,394 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
char far *vram=(char far *)0xa0000000L;
|
||||
|
||||
extern char lightshift;
|
||||
|
||||
extern int _ndebug1;
|
||||
|
||||
extern char asmtestmode;
|
||||
|
||||
extern int csetmatrix(int *,long,long,long);
|
||||
extern int crotlist(long *,long *);
|
||||
extern int cclipedges(int *,int *,long *); // modifies given point list
|
||||
extern int cprojlist(long *,long *);
|
||||
extern int cdrawpolylist(int *);
|
||||
extern int cmatrix_yxz(int,int,int,int *);
|
||||
extern int cpolylist(int *polylist,int *polys,int *edges,long *points3);
|
||||
extern int ceasypolylist(int *polylist,int *polys,long *points3);
|
||||
|
||||
long cubepoints[]={8,
|
||||
-666,-666,-666,
|
||||
666,-666,-666,
|
||||
666,666,-666,
|
||||
-666,666,-666,
|
||||
-666,-666,666,
|
||||
666,-666,666,
|
||||
666,666,666,
|
||||
-666,666,666
|
||||
};
|
||||
int cubeepolys[]={
|
||||
4,0x4002,0,1,2,3,
|
||||
4,0x4004,4,5,6,7,
|
||||
4,0x4006,0,1,5,4,
|
||||
4,0x4008,1,2,6,5,
|
||||
4,0x4003,2,3,7,6,
|
||||
4,0x4005,3,0,4,7,
|
||||
0};
|
||||
|
||||
long points[64]={14,
|
||||
-1000,-1000,-1000,
|
||||
1000,-1000,-1000,
|
||||
1000,1000,-1000,
|
||||
-1000,1000,-1000,
|
||||
-1000,-1000,1000,
|
||||
1000,-1000,1000,
|
||||
1000,1000,1000,
|
||||
-1000,1000,1000,
|
||||
0,0,-1700,
|
||||
0,0,1700,
|
||||
1700,0,0,
|
||||
-1700,0,0,
|
||||
0,1700,0,
|
||||
0,-1700,0};
|
||||
long pointsb[64]={14,
|
||||
-600,-600,-600,
|
||||
600,-600,-600,
|
||||
600,600,-600,
|
||||
-600,600,-600,
|
||||
-600,-600,600,
|
||||
600,-600,600,
|
||||
600,600,600,
|
||||
-600,600,600,
|
||||
0,0,-900,
|
||||
0,0,900,
|
||||
900,0,0,
|
||||
-900,0,0,
|
||||
0,900,0,
|
||||
0,-900,0};
|
||||
long points2[256];
|
||||
int points3[256*2];
|
||||
int edges[64]={12,0,
|
||||
0,1,0,0,
|
||||
1,2,0,0,
|
||||
2,3,0,0,
|
||||
3,0,0,0,
|
||||
4,5,0,0, // 4
|
||||
5,6,0,0,
|
||||
6,7,0,0,
|
||||
7,4,0,0,
|
||||
0,4,0,0, // 8
|
||||
1,5,0,0,
|
||||
2,6,0,0,
|
||||
3,7,0,0};
|
||||
int edges2[64];
|
||||
int polys[64]={
|
||||
4,0x4010,0,1,2,3,
|
||||
4,0x4008,0,8,4,9,
|
||||
4,0x4010,1,9,5,10,
|
||||
4,0x4020,2,10,6,11,
|
||||
4,0x4040,3,11,7,12,
|
||||
4,0x4080,4,5,6,7,
|
||||
0};
|
||||
int epolys[]={
|
||||
3,0x4008,0,1,8,
|
||||
3,0x4010,1,2,8,
|
||||
3,0x4018,2,3,8,
|
||||
3,0x4020,3,0,8,
|
||||
|
||||
3,0x4028,2,1,10,
|
||||
3,0x4030,1,5,10,
|
||||
3,0x4038,5,6,10,
|
||||
3,0x4040,6,2,10,
|
||||
|
||||
3,0x4048,2,6,12,
|
||||
3,0x4050,6,7,12,
|
||||
3,0x4058,7,3,12,
|
||||
3,0x4060,3,2,12,
|
||||
|
||||
3,0x4068,0,3,11,
|
||||
3,0x4070,3,7,11,
|
||||
3,0x4078,7,4,11,
|
||||
3,0x4080,4,0,11,
|
||||
|
||||
3,0x4088,5,1,13,
|
||||
3,0x4090,1,0,13,
|
||||
3,0x4098,0,4,13,
|
||||
3,0x40a0,4,5,13,
|
||||
|
||||
3,0x40a8,5,4,9,
|
||||
3,0x40b0,4,7,9,
|
||||
3,0x40b8,7,6,9,
|
||||
3,0x40c0,6,5,9,
|
||||
|
||||
0};
|
||||
int epolys1[]={
|
||||
3,0x4008,0,1,8,
|
||||
3,0x4010,1,2,8,
|
||||
3,0x4018,2,3,8,
|
||||
3,0x4020,3,0,8,
|
||||
/*
|
||||
3,0x4028,2,1,10,
|
||||
3,0x4030,1,5,10,
|
||||
3,0x4038,5,6,10,
|
||||
3,0x4040,6,2,10,
|
||||
*/
|
||||
/*3,0x4048,2,6,12,*/
|
||||
/*3,0x4050,6,7,12,*/
|
||||
3,0x4058,7,3,12,
|
||||
3,0x4060,3,2,12,
|
||||
|
||||
3,0x4068,0,3,11,
|
||||
3,0x4070,3,7,11,
|
||||
3,0x4078,7,4,11,
|
||||
3,0x4080,4,0,11,
|
||||
|
||||
/*3,0x4088,5,1,13,*/
|
||||
3,0x4090,1,0,13,
|
||||
3,0x4098,0,4,13,
|
||||
/*3,0x40a0,4,5,13,*/
|
||||
/*
|
||||
3,0x40a8,5,4,9,
|
||||
3,0x40b0,4,7,9,
|
||||
3,0x40b8,7,6,9,
|
||||
3,0x40c0,6,5,9,
|
||||
*/
|
||||
0};
|
||||
int epolys2[]={
|
||||
/*
|
||||
3,0x4008,0,1,8,
|
||||
3,0x4010,1,2,8,
|
||||
3,0x4018,2,3,8,
|
||||
3,0x4020,3,0,8,
|
||||
*/
|
||||
3,0x4028,2,1,10,
|
||||
3,0x4030,1,5,10,
|
||||
3,0x4038,5,6,10,
|
||||
3,0x4040,6,2,10,
|
||||
|
||||
3,0x4048,2,6,12,
|
||||
3,0x4050,6,7,12,
|
||||
/*3,0x4058,7,3,12,*/
|
||||
/*3,0x4060,3,2,12,*/
|
||||
/*
|
||||
3,0x4068,0,3,11,
|
||||
3,0x4070,3,7,11,
|
||||
3,0x4078,7,4,11,
|
||||
3,0x4080,4,0,11,
|
||||
*/
|
||||
3,0x4088,5,1,13,
|
||||
/*3,0x4090,1,0,13,*/
|
||||
/*3,0x4098,0,4,13,*/
|
||||
3,0x40a0,4,5,13,
|
||||
|
||||
3,0x40a8,5,4,9,
|
||||
3,0x40b0,4,7,9,
|
||||
3,0x40b8,7,6,9,
|
||||
3,0x40c0,6,5,9,
|
||||
|
||||
0};
|
||||
int epolysb[]={
|
||||
3,0x4004,0,1,8,
|
||||
3,0x4002,1,2,8,
|
||||
3,0x4004,2,3,8,
|
||||
3,0x4002,3,0,8,
|
||||
|
||||
3,0x4004,2,1,10,
|
||||
3,0x4002,1,5,10,
|
||||
3,0x4004,5,6,10,
|
||||
3,0x4002,6,2,10,
|
||||
|
||||
3,0x4004,2,6,12,
|
||||
3,0x4002,6,7,12,
|
||||
3,0x4004,7,3,12,
|
||||
3,0x4002,3,2,12,
|
||||
|
||||
3,0x4004,0,3,11,
|
||||
3,0x4002,3,7,11,
|
||||
3,0x4004,7,4,11,
|
||||
3,0x4002,4,0,11,
|
||||
|
||||
3,0x4004,5,1,13,
|
||||
3,0x4002,1,0,13,
|
||||
3,0x4004,0,4,13,
|
||||
3,0x4002,4,5,13,
|
||||
|
||||
3,0x4004,5,4,9,
|
||||
3,0x4002,4,7,9,
|
||||
3,0x4004,7,6,9,
|
||||
3,0x4002,6,5,9,
|
||||
|
||||
0};
|
||||
int polylist[256];
|
||||
int matrix[9];
|
||||
|
||||
int testlist[]={
|
||||
3,16, 190,100, 90,50, 110,150,
|
||||
3,20, 10,100, 90,50, 99,150,
|
||||
0};
|
||||
|
||||
main()
|
||||
{
|
||||
int a,b,c,x,y,rx,ry,rz,n=8,p1,p2,r,g,zpos=7000;
|
||||
testasm();
|
||||
//initnewgroup();
|
||||
outp(0x3c8,0);
|
||||
for(a=0;a<64;a++)
|
||||
{
|
||||
r=g=b=0;
|
||||
c=a&31;
|
||||
r=16+c;
|
||||
g=c*2;
|
||||
b=c;
|
||||
if(a&0x20) r+=20; g+=20; b+=20;
|
||||
/*
|
||||
if(a&0x01) { r+=40; }
|
||||
if(a&0x02) { g+=40; r+=40; b+=40; }
|
||||
if(a&0x04) { r+=0; }
|
||||
if(a&0x08) { g+=10; r+=10; b+=10; }
|
||||
if(a&0x10) { b+=40; }
|
||||
if(a&0x20) { g+=40; r+=40; b+=40; }
|
||||
if(a&0x40) { b+=0; }
|
||||
if(a&0x80) { g+=10; r+=10; b+=10; }
|
||||
r=r*4/6;
|
||||
g=g*4/6;
|
||||
b=b*4/6;
|
||||
*/
|
||||
if(r>63) r=63;
|
||||
if(g>63) g=63;
|
||||
if(b>63) b=63;
|
||||
r=g=b=0;
|
||||
outp(0x3c9,r);
|
||||
outp(0x3c9,g);
|
||||
outp(0x3c9,b);
|
||||
}
|
||||
for(a=0;a<256;a++) vram[a]=a;
|
||||
lightshift=8;
|
||||
rx=ry=rz=0;
|
||||
for(;;)
|
||||
{
|
||||
if(kbhit())
|
||||
{
|
||||
a=getch();
|
||||
if(a==27) break;
|
||||
if(a=='l') lightshift=2;
|
||||
if(a=='+') zpos+=200;
|
||||
if(a=='-') zpos-=200;
|
||||
if(a=='<') lightshift--;
|
||||
if(a=='>') lightshift++;
|
||||
if(a=='t') asmtestmode=1;
|
||||
if(a=='c') { if(zpos==3200) { lightshift=8; zpos=7000; } else { zpos=3200; lightshift=11; } }
|
||||
if(a=='8') ry-=16;
|
||||
if(a=='2') ry+=16;
|
||||
if(a=='4') rz-=16;
|
||||
if(a=='6') rz+=16;
|
||||
}
|
||||
asm();
|
||||
setborder(1);
|
||||
//rx+=16; ry+=9; rz+=7;
|
||||
rx+=32; ry+=8;
|
||||
rx%=3600; ry%=3600; rz%=3600;
|
||||
//if(rz==0) printf(".");
|
||||
/*
|
||||
a=0;
|
||||
while(polylist[a])
|
||||
{
|
||||
a+=polylist[a]*2+2;
|
||||
}
|
||||
polylist[a++]=4;
|
||||
polylist[a++]=19;
|
||||
polylist[a++]=160-60; polylist[a++]=100-40;
|
||||
polylist[a++]=160+60; polylist[a++]=100-40;
|
||||
polylist[a++]=160+60; polylist[a++]=100+40;
|
||||
polylist[a++]=160-60; polylist[a++]=100+40;
|
||||
polylist[a++]=0;
|
||||
*/
|
||||
cglenzinit();
|
||||
|
||||
cmatrix_yxz(rx,ry,rz,matrix);
|
||||
csetmatrix(matrix,0,0,zpos);
|
||||
points2[0]=0; crotlist(points2,points);
|
||||
//cclipedges(edges2,edges,points2);
|
||||
points3[0]=0; cprojlist((long *)points3,points2);
|
||||
//cpolylist(polylist,polys,edges,points3);
|
||||
ceasypolylist(polylist,epolys,points3);
|
||||
|
||||
cglenzpolylist(polylist);
|
||||
/*
|
||||
cmatrix_yxz(rx,-450,900+ry,matrix);
|
||||
csetmatrix(matrix,0,0,zpos);
|
||||
points2[0]=0; crotlist(points2,points);
|
||||
//cclipedges(edges2,edges,points2);
|
||||
points3[0]=0; cprojlist((long *)points3,points2);
|
||||
//cpolylist(polylist,polys,edges,points3);
|
||||
ceasypolylist(polylist,epolys1,points3);
|
||||
|
||||
cglenzpolylist(polylist);
|
||||
|
||||
cmatrix_yxz(-rx,-450,900+ry,matrix);
|
||||
csetmatrix(matrix,0,0,zpos);
|
||||
points2[0]=0; crotlist(points2,points);
|
||||
//cclipedges(edges2,edges,points2);
|
||||
points3[0]=0; cprojlist((long *)points3,points2);
|
||||
//cpolylist(polylist,polys,edges,points3);
|
||||
ceasypolylist(polylist,epolys2,points3);
|
||||
|
||||
cglenzpolylist(polylist);
|
||||
*/
|
||||
|
||||
cmatrix_yxz(-rx,-ry,-rz,matrix);
|
||||
csetmatrix(matrix,0,0,zpos);
|
||||
points2[0]=0; crotlist(points2,pointsb);
|
||||
//cclipedges(edges2,edges,points2);
|
||||
points3[0]=0; cprojlist((long *)points3,points2);
|
||||
//cpolylist(polylist,polys,edges,points3);
|
||||
ceasypolylist(polylist,epolysb,points3);
|
||||
|
||||
cglenzpolylist(polylist);
|
||||
|
||||
// //cmatrix_yxz(rx*2,-ry,rz*2,matrix);
|
||||
// //csetmatrix(matrix,0,0,zpos);
|
||||
// //points2[0]=0; crotlist(points2,cubepoints);
|
||||
// //points3[0]=0; cprojlist((long *)points3,points2);
|
||||
// //ceasypolylist(polylist,cubeepolys,points3);
|
||||
|
||||
cglenzdone();
|
||||
//cdrawpolylist(polylist);
|
||||
//cdrawpolylist(testlist);
|
||||
//setborder(3);
|
||||
//drawnewgroup();
|
||||
#if 0
|
||||
n=edges[0];
|
||||
for(a=2,b=0;b<n;b++)
|
||||
{
|
||||
p1=edges[a++];
|
||||
p2=edges[a++];
|
||||
a+=2;
|
||||
testline(points3[p1*6+2],points3[p1*6+3],points3[p2*6+2],points3[p2*6+3],63);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
_asm mov ax,3
|
||||
_asm int 10h
|
||||
#if 0
|
||||
for(a=0;a<100;)
|
||||
{
|
||||
b=polylist[a++];
|
||||
c=polylist[a++];
|
||||
if(!b) break;
|
||||
printf("s:%i c:%i v:",b,c);
|
||||
for(x=0;x<b;x++)
|
||||
{
|
||||
printf("%i,%i ",polylist[a+0],polylist[a+1]);
|
||||
a+=2;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
printf("points2: %Fp\n",points2);
|
||||
#endif
|
||||
printf("%i,%i,%i Z:%i LS:%i \n",rx,ry,rz,zpos,lightshift);
|
||||
}
|
||||
14
HARD/KOE.C
Normal file
14
HARD/KOE.C
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
main()
|
||||
{
|
||||
int a=0;
|
||||
_asm mov ax,13h
|
||||
_asm int 10h
|
||||
while(!kbhit())
|
||||
{
|
||||
printf(".");
|
||||
while(!(inp(0x3da)&8));
|
||||
printf(".");
|
||||
while((inp(0x3da)&8));
|
||||
printf("%i\r",a++);
|
||||
}
|
||||
}
|
||||
BIN
HARD/KOE.EXE
Normal file
BIN
HARD/KOE.EXE
Normal file
Binary file not shown.
2921
HARD/LINEBLIT.INC
Normal file
2921
HARD/LINEBLIT.INC
Normal file
File diff suppressed because it is too large
Load diff
3
HARD/LINK.TMP
Normal file
3
HARD/LINK.TMP
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
asm.obj vec.obj +
|
||||
b.obj ba.obj +
|
||||
_dots1.obj _dots2.obj _dots3.obj _dots4.obj _grid1.obj ..\dis\disc.obj,b.exe,nul;
|
||||
45
HARD/MAKEFILE
Normal file
45
HARD/MAKEFILE
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
all : b.exe edge.exe bdo.exe
|
||||
|
||||
objs1=asm.obj vec.obj
|
||||
objs2=b.obj ba.obj
|
||||
|
||||
objs=main.obj $(objs1)
|
||||
|
||||
odata=_dots1.obj _dots2.obj _dots3.obj _dots4.obj _grid1.obj
|
||||
|
||||
asm_f = /ML /m2 /s /JJUMPS
|
||||
c_f = /AL /c /G2
|
||||
|
||||
.asm.obj :
|
||||
tasm $(asm_f) $<
|
||||
|
||||
.c.obj :
|
||||
cl /qc $(c_f) $<
|
||||
|
||||
v.exe : $(objs)
|
||||
link /E $(objs),v.exe,nul,gl10.lib;
|
||||
|
||||
b.exe : $(objs2) $(objs1)
|
||||
@echo $(objs1) + > link.tmp
|
||||
@echo $(objs2) + >> link.tmp
|
||||
@echo $(odata) ..\dis\disc.obj,b.exe,nul; >> link.tmp
|
||||
link /E @link.tmp
|
||||
|
||||
bdo.exe : bdo.c
|
||||
cl /QC /AL bdo.c
|
||||
|
||||
odata : bdo.exe
|
||||
bdo
|
||||
doobj _dots1.tmp _dots1 _dots1.obj
|
||||
doobj _dots2.tmp _dots2 _dots2.obj
|
||||
doobj _dots3.tmp _dots3 _dots3.obj
|
||||
doobj _dots4.tmp _dots4 _dots4.obj
|
||||
del *.tmp
|
||||
|
||||
b.c : bp.c
|
||||
|
||||
vec.asm : vnew.asm vmath.asm vdata.asm vasm.inc
|
||||
|
||||
edge.exe : edge.c
|
||||
cl /qc /AL edge.c
|
||||
|
||||
306
HARD/NEW.9
Normal file
306
HARD/NEW.9
Normal file
|
|
@ -0,0 +1,306 @@
|
|||
;!!!!!! TRANSPARENT NEW COPPER !!!!!!
|
||||
|
||||
FREELINE equ 200
|
||||
|
||||
PUBLIC _newsinus,_newsinusx
|
||||
_newsinus dw 512 dup(0)
|
||||
_newsinusx dw -1
|
||||
|
||||
newgroup PROC NEAR
|
||||
;hline list in gs:si
|
||||
push ds
|
||||
mov ax,SEG newdata
|
||||
mov ds,ax
|
||||
mov bx,gs:[si]
|
||||
add si,2
|
||||
@@1: mov ax,gs:[si]
|
||||
add si,2
|
||||
cmp ax,-32767
|
||||
je @@2
|
||||
mov dx,gs:[si]
|
||||
add si,2
|
||||
cmp bx,7eh
|
||||
jne @@z
|
||||
@@z: push bx
|
||||
;hline ax..dx,bx with gs:color
|
||||
cmp ax,dx
|
||||
jle @@3
|
||||
xchg ax,dx
|
||||
@@3: ;
|
||||
mov cx,cs:_newsinusx
|
||||
cmp cx,-1
|
||||
je @@nosin
|
||||
push bx
|
||||
add bx,cx
|
||||
shl bx,1
|
||||
add ax,cs:_newsinus[bx]
|
||||
add dx,cs:_newsinus[bx]
|
||||
pop bx
|
||||
@@nosin:;
|
||||
cmp ax,0
|
||||
jge @@11
|
||||
xor ax,ax
|
||||
cmp dx,0
|
||||
jl @@0
|
||||
@@11: cmp dx,320
|
||||
jle @@12
|
||||
mov dx,320
|
||||
cmp ax,320
|
||||
jg @@0
|
||||
@@12: push dx
|
||||
shl bx,1
|
||||
mov dx,ds:[bx]
|
||||
mov bp,ds:[FREELINE*2]
|
||||
mov ds:[bx],bp
|
||||
mov ds:[FREELINE*2],dx
|
||||
mov bx,dx
|
||||
;modify list bx=>bp (edx/hi=last color)
|
||||
;copy blocks < hline start
|
||||
xor edx,edx
|
||||
@@b: mov ecx,ds:[bx]
|
||||
cmp cx,ax
|
||||
jae @@a ;[bx] bigger..
|
||||
add bx,4
|
||||
mov ds:[bp],ecx
|
||||
add bp,4
|
||||
jmp @@b
|
||||
@@a: ;add hline start
|
||||
jne @@aa
|
||||
mov ds:[bp],ax
|
||||
mov ax,gs:color
|
||||
ror ecx,16
|
||||
xor ax,cx
|
||||
mov ds:[bp+2],ax
|
||||
add bp,4
|
||||
add bx,4
|
||||
mov ecx,ds:[bx]
|
||||
pop ax
|
||||
jmp @@d
|
||||
@@aa: rol eax,16
|
||||
mov ax,gs:color
|
||||
rol eax,16
|
||||
mov ds:[bp],eax
|
||||
add bp,4
|
||||
;copy blocks < hline end
|
||||
pop ax
|
||||
@@d: cmp cx,ax
|
||||
jae @@c
|
||||
add bx,4
|
||||
mov ds:[bp],ecx
|
||||
add bp,4
|
||||
mov edx,ecx
|
||||
mov ecx,ds:[bx]
|
||||
jmp @@d
|
||||
@@c: ;add hline end
|
||||
jne @@ca
|
||||
mov ds:[bp],ax
|
||||
mov ax,gs:color
|
||||
ror ecx,16
|
||||
xor ax,cx
|
||||
mov ds:[bp+2],ax
|
||||
add bp,4
|
||||
add bx,4
|
||||
mov ecx,ds:[bx]
|
||||
jmp @@f
|
||||
@@ca: mov ds:[bp],ax
|
||||
mov ax,gs:color
|
||||
mov ds:[bp+2],ax
|
||||
add bp,4
|
||||
;copy rest of the list
|
||||
@@f: cmp cx,32767
|
||||
je @@e
|
||||
add bx,4
|
||||
mov ds:[bp],ecx
|
||||
add bp,4
|
||||
mov ecx,ds:[bx]
|
||||
jmp @@f
|
||||
@@e: ;last
|
||||
mov ds:[bp],ecx
|
||||
@@0: pop bx
|
||||
inc bx
|
||||
jmp @@1
|
||||
@@2: pop ds
|
||||
ret
|
||||
newgroup ENDP
|
||||
|
||||
grouppage dw 1024
|
||||
|
||||
PUBLIC _initnewgroup
|
||||
_initnewgroup PROC FAR
|
||||
CBEG
|
||||
mov ax,SEG newdata
|
||||
mov ds,ax
|
||||
mov dx,cs:grouppage
|
||||
xor dx,32768
|
||||
mov cs:grouppage,dx
|
||||
mov cx,201
|
||||
xor bx,bx
|
||||
@@2: mov ax,ds:[bx]
|
||||
mov ds:[bx],dx
|
||||
mov ds:[bx+256*2],ax
|
||||
add dx,128
|
||||
add bx,2
|
||||
loop @@2
|
||||
mov cx,200
|
||||
mov eax,32767
|
||||
mov bx,cs:grouppage
|
||||
@@1: mov ds:[bx],eax
|
||||
add bx,128
|
||||
loop @@1
|
||||
CEND
|
||||
_initnewgroup ENDP
|
||||
|
||||
ALIGN 2
|
||||
dng_bgcolor dw 0
|
||||
dng_rowbase dw 0
|
||||
dng_random dw 0
|
||||
|
||||
PUBLIC _drawnewgroup
|
||||
_drawnewgroup PROC FAR
|
||||
CBEG
|
||||
LOADDS
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
mov es,ds:vram
|
||||
mov ax,SEG newdata
|
||||
mov gs,ax
|
||||
mov cx,200
|
||||
xor bx,bx
|
||||
xor di,di
|
||||
@@3: push bx
|
||||
push cx
|
||||
push di
|
||||
shl bx,1
|
||||
mov si,gs:[bx]
|
||||
mov di,gs:[bx+512] ;last time row (for sorting out differences)
|
||||
mov bp,32768
|
||||
;si=thistime
|
||||
;di=lasttime
|
||||
;dl=thiscolor
|
||||
;dh=lastcolor
|
||||
;cx=thisX
|
||||
;bx=lastX
|
||||
;ax=X
|
||||
;bp=tmpdest
|
||||
mov dx,cs:dng_bgcolor
|
||||
mov dh,dl
|
||||
xor ax,ax
|
||||
mov cx,gs:[si]
|
||||
mov bx,gs:[di]
|
||||
@@1: cmp bx,cx
|
||||
je @@10
|
||||
jl @@2
|
||||
;cx..bx
|
||||
cmp dl,dh
|
||||
je @@5
|
||||
;ax..cx color dl
|
||||
mov gs:[bp],ax
|
||||
mov gs:[bp+2],cx
|
||||
add bp,6
|
||||
mov gs:[bp+4-6],dx
|
||||
@@5: mov ax,cx
|
||||
xor dl,gs:[si+2]
|
||||
add si,4
|
||||
mov cx,gs:[si]
|
||||
jmp @@1
|
||||
@@10: ;bx=cx
|
||||
cmp bx,32767
|
||||
je @@7
|
||||
cmp dl,dh
|
||||
je @@11
|
||||
;ax..bx color dl
|
||||
mov gs:[bp],ax
|
||||
mov gs:[bp+2],bx
|
||||
add bp,6
|
||||
mov gs:[bp+4-6],dx
|
||||
@@11: mov ax,bx
|
||||
xor dh,gs:[di+2]
|
||||
add di,4
|
||||
mov bx,gs:[di]
|
||||
xor dl,gs:[si+2]
|
||||
add si,4
|
||||
mov cx,gs:[si]
|
||||
jmp @@1
|
||||
@@2: ;bx..cx
|
||||
cmp dl,dh
|
||||
je @@4
|
||||
;ax..bx color dl
|
||||
mov gs:[bp],ax
|
||||
mov gs:[bp+2],bx
|
||||
mov gs:[bp+4],dx
|
||||
add bp,6
|
||||
@@4: mov ax,bx
|
||||
xor dh,gs:[di+2]
|
||||
add di,4
|
||||
mov bx,gs:[di]
|
||||
jmp @@1
|
||||
@@7: pop di
|
||||
;this line data in 8000h..bp
|
||||
mov si,32768
|
||||
cmp si,bp
|
||||
je @@8
|
||||
@@6: mov edx,gs:[si]
|
||||
mov bx,dx
|
||||
shr edx,16
|
||||
mov ch,gs:[si+4]
|
||||
;
|
||||
mov cl,bl
|
||||
and cl,3
|
||||
mov al,00fh
|
||||
rol al,cl
|
||||
mov cl,dl
|
||||
and cl,3
|
||||
mov ah,0f0h
|
||||
rol ah,cl
|
||||
|
||||
shr bx,2
|
||||
shr dx,2
|
||||
cmp bx,dx
|
||||
jne @@h1
|
||||
|
||||
and al,ah
|
||||
mov dx,3c5h
|
||||
out dx,al
|
||||
mov es:[di+bx],ch
|
||||
jmp @@h0
|
||||
|
||||
@@h1: inc bx
|
||||
cmp bx,dx
|
||||
jne @@h2
|
||||
mov dx,3c5h
|
||||
out dx,al
|
||||
mov es:[di+bx-1],ch
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov es:[di+bx],ch
|
||||
jmp @@h0
|
||||
|
||||
@@h2: push di
|
||||
mov cl,dl
|
||||
sub cl,bl
|
||||
add di,bx
|
||||
mov dx,3c5h
|
||||
out dx,al
|
||||
mov es:[di-1],ch
|
||||
mov al,0fh
|
||||
out dx,al
|
||||
mov al,ch
|
||||
xor ch,ch
|
||||
rep stosb
|
||||
xchg al,ah
|
||||
out dx,al
|
||||
mov es:[di],ah
|
||||
pop di
|
||||
@@h0: ;
|
||||
add si,6
|
||||
cmp si,bp
|
||||
jb @@6
|
||||
@@8: pop cx
|
||||
pop bx
|
||||
add di,80
|
||||
inc bx
|
||||
loop @@3
|
||||
CEND
|
||||
_drawnewgroup ENDP
|
||||
|
||||
BIN
HARD/PIC001.LBM
Normal file
BIN
HARD/PIC001.LBM
Normal file
Binary file not shown.
33
HARD/SIN1024.INC
Normal file
33
HARD/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
|
||||
1
HARD/TMP
Normal file
1
HARD/TMP
Normal file
|
|
@ -0,0 +1 @@
|
|||
-157,-464,1030 Z:7000 LS:8
|
||||
3
HARD/TMP.LNK
Normal file
3
HARD/TMP.LNK
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
asm.obj vec.obj +
|
||||
b.obj ba.obj +
|
||||
_dots1.obj _dots2.obj _dots3.obj _dots4.obj ..\dis\disc.obj,b.exe,nul;
|
||||
BIN
HARD/V.EXE
Normal file
BIN
HARD/V.EXE
Normal file
Binary file not shown.
98
HARD/VASM.INC
Normal file
98
HARD/VASM.INC
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ADATA.INC ±±±±±±±±±±±±±±±±±±±±±±±±±±±
|
||||
|
||||
global newdata1:word
|
||||
|
||||
global projxmul:dword
|
||||
global projymul:dword
|
||||
global projxadd:word
|
||||
global projyadd:word
|
||||
global projminz:dword
|
||||
global projminzshr:word
|
||||
global wminx:word
|
||||
global wminy:word
|
||||
global wmaxx:word
|
||||
global wmaxy:word
|
||||
global vram:word
|
||||
global rowsadd:word
|
||||
global truerowsadd:word
|
||||
global truevram:word
|
||||
global rows:word
|
||||
global framerate10:word
|
||||
global color:word
|
||||
global color1:byte
|
||||
global color2:byte
|
||||
global video:dword
|
||||
global borders:word
|
||||
|
||||
global xadd:dword
|
||||
global yadd:dword
|
||||
global zadd:dword
|
||||
|
||||
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± AOBJ.INC ±±±±±±±±±±±±±±±±±±±±±±±±±±±
|
||||
|
||||
vobj struc
|
||||
xyz dd 3 dup(0)
|
||||
matrix dw 9 dup(0)
|
||||
element dd 0
|
||||
vobj ends
|
||||
|
||||
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± CINK.INC ±±±±±±±±±±±±±±±±±±±±±±±±±±±
|
||||
|
||||
INT3 MACRO
|
||||
int 3
|
||||
ENDM
|
||||
|
||||
LOADDS MACRO
|
||||
mov ax,SEG rows
|
||||
mov ds,ax
|
||||
ENDM
|
||||
|
||||
LOADGS MACRO
|
||||
mov ax,SEG rows
|
||||
mov gs,ax
|
||||
ENDM
|
||||
|
||||
movpar MACRO reg,par ;loads parameter [par(0..)] to register [reg]
|
||||
mov reg,word ptr [bp+par*2+6]
|
||||
ENDM
|
||||
|
||||
CBEG MACRO ;C/Assembler procedure begin
|
||||
push bp
|
||||
mov bp,sp
|
||||
push si
|
||||
push di
|
||||
push ds
|
||||
ENDM
|
||||
|
||||
CEND MACRO ;C/Assembler procedure end
|
||||
pop ds
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
ENDM
|
||||
|
||||
setborder MACRO col
|
||||
mov al,col
|
||||
push ax
|
||||
call _setborder
|
||||
add sp,2
|
||||
ENDM
|
||||
|
||||
LOCALS
|
||||
|
||||
;VID.ASM
|
||||
global setvmode:far
|
||||
global _setborder:far
|
||||
VIDINIT equ ds:video[0]
|
||||
VIDSWITCH equ ds:video[4]
|
||||
VIDCLEAR64 equ ds:video[8]
|
||||
VIDPSET equ ds:video[12]
|
||||
VIDLINE equ ds:video[16]
|
||||
VIDHLINE equ ds:video[20]
|
||||
VIDHGROUP equ ds:video[24]
|
||||
VIDTHGROUP equ ds:video[28]
|
||||
VIDPOLYGROUP equ ds:video[32]
|
||||
VIDCLEAR equ ds:video[36]
|
||||
VIDWAITB equ ds:video[40]
|
||||
VIDNEWPOLYGROUP equ ds:video[44]
|
||||
55
HARD/VDATA.ASM
Normal file
55
HARD/VDATA.ASM
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
data_new1 SEGMENT para public 'FARDATA'
|
||||
PUBLIC newdata1
|
||||
newdata1 LABEL WORD
|
||||
db 0fff0h dup(0)
|
||||
data_new1 ENDS
|
||||
|
||||
data_v SEGMENT para public 'DATA'
|
||||
|
||||
PUBLIC rows
|
||||
rows LABEL WORD
|
||||
dw 512 dup(0)
|
||||
|
||||
PUBLIC wminx,wminy,wmaxx,wmaxy
|
||||
wminx dw 0
|
||||
wminy dw 0
|
||||
wmaxx dw 100
|
||||
wmaxy dw 100
|
||||
|
||||
PUBLIC video,vram,rowsadd,framerate10,truevram,truerowsadd
|
||||
video LABEL DWORD
|
||||
dd 16 dup(0) ;far offsets to vid routines
|
||||
vram dw 0a2d0h
|
||||
rowsadd dw 320
|
||||
truevram dw 0a000h
|
||||
truerowsadd dw 320
|
||||
framerate10 dw 70
|
||||
|
||||
ALIGN 4
|
||||
PUBLIC projxmul,projymul,projxadd,projyadd,projminz,projminzshr
|
||||
projxmul dd 240
|
||||
projymul dd 200
|
||||
projxadd dw 160
|
||||
projyadd dw 64
|
||||
projminz dd 512
|
||||
projminzshr dw 9
|
||||
|
||||
PUBLIC color,color1,color2
|
||||
color LABEL WORD
|
||||
color1 db 0
|
||||
color2 db 0
|
||||
|
||||
ALIGN 4
|
||||
PUBLIC xadd,yadd,zadd
|
||||
xadd dd 0
|
||||
yadd dd 0
|
||||
zadd dd 0
|
||||
|
||||
ALIGN 16 ;TEMPORARY WORK AREA FOR:
|
||||
PUBLIC borders
|
||||
borders LABEL WORD ;polygon drawing
|
||||
db 8192 dup(0)
|
||||
workoverflow dw 00fch
|
||||
|
||||
data_v ENDS
|
||||
1601
HARD/VEC.A
Normal file
1601
HARD/VEC.A
Normal file
File diff suppressed because it is too large
Load diff
920
HARD/VEC.ASM
Normal file
920
HARD/VEC.ASM
Normal file
|
|
@ -0,0 +1,920 @@
|
|||
include vasm.inc
|
||||
|
||||
;±±±±±±±±±±±±±±±±±±±±±±± DATA ±±±±±±±±±±±±±±±±±±±±±±±
|
||||
|
||||
include vdata.asm
|
||||
|
||||
;±±±±±±±±±±±±±±±±±±±±±±± CODE ±±±±±±±±±±±±±±±±±±±±±±±
|
||||
|
||||
text__vec SEGMENT para public 'CODE'
|
||||
ASSUME cs:text__vec
|
||||
|
||||
.386
|
||||
|
||||
include vnew.asm
|
||||
include vmath.asm ;includes vmathsin.asm
|
||||
|
||||
PUBLIC _lightshift
|
||||
_lightshift db 0
|
||||
|
||||
PUBLIC _csetmatrix
|
||||
_csetmatrix PROC FAR
|
||||
CBEG
|
||||
LOADDS
|
||||
mov eax,[bp+10]
|
||||
mov ds:xadd,eax
|
||||
mov eax,[bp+14]
|
||||
mov ds:yadd,eax
|
||||
mov eax,[bp+18]
|
||||
mov ds:zadd,eax
|
||||
mov si,[bp+6]
|
||||
mov ds,word ptr [bp+8]
|
||||
call setmatrix
|
||||
CEND
|
||||
_csetmatrix ENDP
|
||||
|
||||
PUBLIC _crotlist
|
||||
_crotlist PROC FAR
|
||||
CBEG
|
||||
mov si,[bp+10]
|
||||
mov ds,word ptr [bp+12]
|
||||
mov di,[bp+6]
|
||||
mov es,word ptr [bp+8]
|
||||
call rotlist
|
||||
CEND
|
||||
_crotlist ENDP
|
||||
|
||||
PUBLIC _crotprojlist
|
||||
_crotprojlist PROC FAR
|
||||
CBEG
|
||||
mov si,[bp+10]
|
||||
mov ds,word ptr [bp+12]
|
||||
mov di,[bp+6]
|
||||
mov es,word ptr [bp+8]
|
||||
call rotprojlist
|
||||
CEND
|
||||
_crotprojlist ENDP
|
||||
|
||||
PUBLIC _cprojlist
|
||||
_cprojlist PROC FAR
|
||||
CBEG
|
||||
mov si,[bp+10]
|
||||
mov ds,word ptr [bp+12]
|
||||
mov di,[bp+6]
|
||||
mov es,word ptr [bp+8]
|
||||
call projlist
|
||||
CEND
|
||||
_cprojlist ENDP
|
||||
|
||||
PUBLIC setmatrix
|
||||
setmatrix PROC FAR
|
||||
;ds:si=matrix
|
||||
movsx eax,word ptr ds:[si+0]
|
||||
mov dword ptr cs:[2+mtrm00],eax
|
||||
mov dword ptr cs:[2+mtr600],eax
|
||||
movsx eax,word ptr ds:[si+2]
|
||||
mov dword ptr cs:[2+mtrm02],eax
|
||||
mov dword ptr cs:[2+mtr602],eax
|
||||
movsx eax,word ptr ds:[si+4]
|
||||
mov dword ptr cs:[2+mtrm04],eax
|
||||
mov dword ptr cs:[2+mtr604],eax
|
||||
movsx eax,word ptr ds:[si+6]
|
||||
mov dword ptr cs:[2+mtrm06],eax
|
||||
mov dword ptr cs:[2+mtr606],eax
|
||||
movsx eax,word ptr ds:[si+8]
|
||||
mov dword ptr cs:[2+mtrm08],eax
|
||||
mov dword ptr cs:[2+mtr608],eax
|
||||
movsx eax,word ptr ds:[si+10]
|
||||
mov dword ptr cs:[2+mtrm10],eax
|
||||
mov dword ptr cs:[2+mtr610],eax
|
||||
movsx eax,word ptr ds:[si+12]
|
||||
mov dword ptr cs:[2+mtrm12],eax
|
||||
mov dword ptr cs:[2+mtr612],eax
|
||||
movsx eax,word ptr ds:[si+14]
|
||||
mov dword ptr cs:[2+mtrm14],eax
|
||||
mov dword ptr cs:[2+mtr614],eax
|
||||
movsx eax,word ptr ds:[si+16]
|
||||
mov dword ptr cs:[2+mtrm16],eax
|
||||
mov dword ptr cs:[2+mtr616],eax
|
||||
ret
|
||||
setmatrix ENDP
|
||||
|
||||
ALIGN 2
|
||||
count dw 0
|
||||
|
||||
rotlist PROC FAR
|
||||
;pointlist@DS:SI=>pointlist@ES:DI
|
||||
push di
|
||||
LOADGS
|
||||
mov cx,ds:[si]
|
||||
add si,4
|
||||
mov cs:count,cx
|
||||
mov ax,es:[di]
|
||||
add es:[di],cx
|
||||
mov bx,ax
|
||||
shl ax,4
|
||||
add di,ax
|
||||
add di,4
|
||||
|
||||
nrup1: ;rotate with matrix
|
||||
push si
|
||||
push di
|
||||
mov ebp,ds:[si+8]
|
||||
mov edi,ds:[si+4]
|
||||
mov esi,ds:[si+0]
|
||||
mtrm00: mov eax,12345678h
|
||||
imul esi
|
||||
mov ebx,eax
|
||||
mov ecx,edx
|
||||
mtrm02: mov eax,12345678h
|
||||
imul edi
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
mtrm04: mov eax,12345678h
|
||||
imul ebp
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
shld ecx,ebx,17
|
||||
push ecx
|
||||
mtrm06: mov eax,12345678h
|
||||
imul esi
|
||||
mov ebx,eax
|
||||
mov ecx,edx
|
||||
mtrm08: mov eax,12345678h
|
||||
imul edi
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
mtrm10: mov eax,12345678h
|
||||
imul ebp
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
shld ecx,ebx,17
|
||||
push ecx
|
||||
mtrm12: mov eax,12345678h
|
||||
imul esi
|
||||
mov ebx,eax
|
||||
mov ecx,edx
|
||||
mtrm14: mov eax,12345678h
|
||||
imul edi
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
mtrm16: mov eax,12345678h
|
||||
imul ebp
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
shld ecx,ebx,17
|
||||
pop edx
|
||||
pop eax
|
||||
pop di
|
||||
pop si
|
||||
;
|
||||
add ecx,gs:xadd
|
||||
mov es:[di+0],ecx
|
||||
add edx,gs:yadd
|
||||
mov es:[di+4],edx
|
||||
add eax,gs:zadd
|
||||
mov es:[di+8],eax
|
||||
;next point
|
||||
add si,12
|
||||
add di,12
|
||||
dec cs:count
|
||||
jnz nrup1
|
||||
pop di
|
||||
ret
|
||||
rotlist ENDP
|
||||
|
||||
projlist PROC FAR
|
||||
;pointlist@DS:SI=>projectedpointlist@ES:DI
|
||||
push di
|
||||
LOADGS
|
||||
mov cx,ds:[si]
|
||||
add si,4
|
||||
mov cs:count,cx
|
||||
mov ax,es:[di]
|
||||
add es:[di],cx
|
||||
mov bx,ax
|
||||
shl ax,4
|
||||
add di,ax
|
||||
add di,4
|
||||
|
||||
@@1: ;rotate with matrix
|
||||
mov ebx,ds:[si+8]
|
||||
mov eax,ds:[si+4]
|
||||
mov ecx,ds:[si+0]
|
||||
|
||||
;project ebx=z, eax=y, ecx=x
|
||||
|
||||
xor bp,bp
|
||||
mov dword ptr es:[di+8],ebx
|
||||
cmp ebx,gs:projminz
|
||||
jge @@2
|
||||
mov ebx,gs:projminz
|
||||
or bp,16
|
||||
@@2: ;
|
||||
mov es:[di+14],ax
|
||||
imul gs:projymul
|
||||
idiv ebx
|
||||
add ax,gs:projyadd
|
||||
cmp ax,gs:wmaxy
|
||||
jng @@41
|
||||
or bp,8
|
||||
@@41: cmp ax,gs:wminy
|
||||
jnl @@42
|
||||
or bp,4
|
||||
@@42: mov es:[di+2],ax ;store Y
|
||||
;
|
||||
mov es:[di+12],cx
|
||||
mov eax,gs:projxmul
|
||||
imul ecx
|
||||
idiv ebx
|
||||
add ax,gs:projxadd
|
||||
cmp ax,gs:wmaxx
|
||||
jng @@43
|
||||
or bp,2
|
||||
@@43: cmp ax,gs:wminx
|
||||
jnl @@44
|
||||
or bp,1
|
||||
@@44: mov es:[di+0],ax ;store X
|
||||
|
||||
@@5: mov es:[di+4],bp ;store visiblity flags
|
||||
|
||||
;next point
|
||||
add si,12
|
||||
add di,16
|
||||
dec cs:count
|
||||
jnz @@1
|
||||
pop di
|
||||
ret
|
||||
projlist ENDP
|
||||
|
||||
rotprojlist PROC FAR
|
||||
;pointlist@DS:SI=>pointlist@ES:DI
|
||||
push di
|
||||
LOADGS
|
||||
mov cx,ds:[si]
|
||||
add si,4
|
||||
mov cs:count,cx
|
||||
mov ax,es:[di]
|
||||
add es:[di],cx
|
||||
mov bx,ax
|
||||
shl ax,4
|
||||
add di,ax
|
||||
add di,4
|
||||
|
||||
@@1: ;rotate with matrix
|
||||
push si
|
||||
push di
|
||||
mov ebp,ds:[si+8]
|
||||
mov edi,ds:[si+4]
|
||||
mov esi,ds:[si+0]
|
||||
mtr600: mov eax,12345678h
|
||||
imul esi
|
||||
mov ebx,eax
|
||||
mov ecx,edx
|
||||
mtr602: mov eax,12345678h
|
||||
imul edi
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
mtr604: mov eax,12345678h
|
||||
imul ebp
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
shld ecx,ebx,17
|
||||
push ecx
|
||||
mtr606: mov eax,12345678h
|
||||
imul esi
|
||||
mov ebx,eax
|
||||
mov ecx,edx
|
||||
mtr608: mov eax,12345678h
|
||||
imul edi
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
mtr610: mov eax,12345678h
|
||||
imul ebp
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
shld ecx,ebx,17
|
||||
push ecx
|
||||
mtr612: mov eax,12345678h
|
||||
imul esi
|
||||
mov ebx,eax
|
||||
mov ecx,edx
|
||||
mtr614: mov eax,12345678h
|
||||
imul edi
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
mtr616: mov eax,12345678h
|
||||
imul ebp
|
||||
add ebx,eax
|
||||
adc ecx,edx
|
||||
shld ecx,ebx,17
|
||||
pop edx
|
||||
pop eax
|
||||
pop di
|
||||
pop si
|
||||
;
|
||||
add ecx,gs:xadd
|
||||
add edx,gs:yadd
|
||||
add eax,gs:zadd
|
||||
|
||||
mov ebx,eax
|
||||
mov eax,edx
|
||||
mov dword ptr es:[di+8],ebx
|
||||
;ax=y,cx=x,bx=y
|
||||
;
|
||||
;mov es:[di+14],ax
|
||||
imul word ptr gs:projymul
|
||||
idiv bx
|
||||
add ax,gs:projyadd
|
||||
mov es:[di+2],ax ;store Y
|
||||
;
|
||||
;mov es:[di+12],cx
|
||||
mov ax,word ptr gs:projxmul
|
||||
imul cx
|
||||
idiv bx
|
||||
add ax,gs:projxadd
|
||||
mov es:[di+0],ax ;store X
|
||||
|
||||
;next point
|
||||
add si,12
|
||||
add di,16
|
||||
dec cs:count
|
||||
jnz @@1
|
||||
pop di
|
||||
ret
|
||||
rotprojlist ENDP
|
||||
|
||||
ALIGN 2
|
||||
edgesoff dw 0
|
||||
pointsoff dw 0
|
||||
cntoff dw 0
|
||||
|
||||
adddot PROC NEAR
|
||||
cmp ax,bp
|
||||
je @@3
|
||||
mov bp,ax
|
||||
;add dot
|
||||
push bx
|
||||
mov bx,ax
|
||||
shl bx,4
|
||||
add bx,cs:pointsoff
|
||||
mov eax,gs:[bx]
|
||||
stosd
|
||||
pop bx
|
||||
@@3: ret
|
||||
adddot ENDP
|
||||
|
||||
znorm dw 0,0
|
||||
|
||||
checkhiddenbx PROC NEAR
|
||||
mov cx,es:[bx-4]
|
||||
dec cx
|
||||
push bx
|
||||
xor ax,ax
|
||||
mov cs:znorm[0],ax
|
||||
mov cs:znorm[2],ax
|
||||
@@2: mov ax,es:[bx+0+0]
|
||||
mov dx,es:[bx+0+2]
|
||||
sub ax,es:[bx+4+0]
|
||||
add dx,es:[bx+4+2]
|
||||
imul dx
|
||||
add cs:znorm[0],ax
|
||||
adc cs:znorm[2],dx
|
||||
add bx,4
|
||||
loop @@2
|
||||
mov ax,es:[bx+0]
|
||||
mov dx,es:[bx+2]
|
||||
pop bx
|
||||
sub ax,es:[bx+0]
|
||||
add dx,es:[bx+2]
|
||||
imul dx
|
||||
add ax,cs:znorm[0]
|
||||
adc dx,cs:znorm[2]
|
||||
|
||||
cmp dx,0
|
||||
jl @@1
|
||||
clc
|
||||
ret
|
||||
@@1: stc
|
||||
ret
|
||||
checkhiddenbx ENDP
|
||||
|
||||
PUBLIC _cpolylist
|
||||
_cpolylist PROC FAR ;polylist,polys,edges,points3
|
||||
CBEG
|
||||
mov di,[bp+6]
|
||||
mov es,word ptr [bp+8]
|
||||
mov si,[bp+10]
|
||||
mov ds,word ptr [bp+12]
|
||||
mov ax,[bp+14]
|
||||
add ax,4
|
||||
mov cs:edgesoff,ax
|
||||
mov fs,word ptr [bp+16]
|
||||
mov ax,[bp+18]
|
||||
add ax,4
|
||||
mov cs:pointsoff,ax
|
||||
mov gs,word ptr [bp+20]
|
||||
mov bp,-1
|
||||
@@2: lodsw
|
||||
cmp ax,0
|
||||
je @@1
|
||||
add di,2
|
||||
mov cx,ax
|
||||
movsw
|
||||
mov cs:cntoff,di
|
||||
@@3: push cx
|
||||
mov bx,ds:[si]
|
||||
add si,2
|
||||
shl bx,3
|
||||
add bx,cs:edgesoff
|
||||
test word ptr fs:[bx+4],8000h
|
||||
jnz @@7
|
||||
mov ax,fs:[bx+2]
|
||||
cmp ax,bp
|
||||
je @@5
|
||||
mov ax,fs:[bx]
|
||||
call adddot
|
||||
mov ax,fs:[bx+2]
|
||||
call adddot
|
||||
@@7: pop cx
|
||||
loop @@3
|
||||
jmp @@6
|
||||
@@5: mov ax,fs:[bx+2]
|
||||
call adddot
|
||||
mov ax,fs:[bx]
|
||||
call adddot
|
||||
pop cx
|
||||
loop @@3
|
||||
@@6: mov bx,cs:cntoff
|
||||
mov eax,es:[bx]
|
||||
cmp eax,es:[di-4]
|
||||
jne @@4
|
||||
sub di,4
|
||||
@@4: mov ax,di
|
||||
sub ax,cs:cntoff
|
||||
shr ax,2
|
||||
mov es:[bx-4],ax
|
||||
call checkhiddenbx
|
||||
jnc @@2
|
||||
xor word ptr es:[bx-2],8000h
|
||||
jmp @@2
|
||||
@@1: mov word ptr es:[di],0
|
||||
CEND
|
||||
_cpolylist ENDP
|
||||
|
||||
setpalxxx MACRO
|
||||
local l1,l2,l3
|
||||
mov al,cl
|
||||
cmp al,64
|
||||
jb l1
|
||||
mov al,63
|
||||
l1: out dx,al
|
||||
mov al,bl
|
||||
cmp al,64
|
||||
jb l2
|
||||
mov al,63
|
||||
l2: out dx,al
|
||||
mov al,bh
|
||||
cmp al,64
|
||||
jb l3
|
||||
mov al,63
|
||||
l3: out dx,al
|
||||
ENDM
|
||||
|
||||
demo_do dw OFFSET demo_hide
|
||||
|
||||
demo_norm PROC NEAR
|
||||
push ax
|
||||
jc @@7 ;visible
|
||||
mov ax,es:[bx-2]
|
||||
;mov ax,40h
|
||||
mov es:[bx-2],ax
|
||||
pop ax
|
||||
ret
|
||||
@@7: pop ax
|
||||
ret
|
||||
demo_norm ENDP
|
||||
|
||||
demo_hide PROC NEAR
|
||||
push ax
|
||||
jc @@7 ;visible
|
||||
xor ax,ax
|
||||
mov es:[bx-2],ax
|
||||
pop ax
|
||||
ret
|
||||
@@7: pop ax
|
||||
ret
|
||||
demo_hide ENDP
|
||||
|
||||
demo_glz PROC NEAR
|
||||
jnc @@7 ;visible
|
||||
push ax
|
||||
mov ax,es:[bx-2]
|
||||
shr al,3
|
||||
and al,1
|
||||
mov es:[bx-2],ax
|
||||
pop ax
|
||||
ret
|
||||
@@7: mov cl,cs:_lightshift
|
||||
sub cl,2
|
||||
shrd ax,dx,cl
|
||||
cmp ax,0
|
||||
jge @@s1
|
||||
mov ax,0
|
||||
@@s1: cmp ax,63
|
||||
jle @@s2
|
||||
mov ax,63
|
||||
@@s2: mov ah,al
|
||||
;
|
||||
mov dx,3c8h
|
||||
mov al,es:[bx-2]
|
||||
test al,7
|
||||
jnz @@xx
|
||||
out dx,al
|
||||
inc dx
|
||||
mov cl,ah ;R
|
||||
mov bl,ah ;G
|
||||
mov bh,ah ;B
|
||||
;Inner1 Inner2 Back
|
||||
setpalxxx ;- - -
|
||||
|
||||
add cl,16
|
||||
setpalxxx ;- - +
|
||||
sub cl,16
|
||||
|
||||
add cl,16
|
||||
setpalxxx ;- + -
|
||||
sub cl,16
|
||||
|
||||
add cl,16
|
||||
add cl,16
|
||||
setpalxxx ;- + +
|
||||
sub cl,16
|
||||
sub cl,16
|
||||
|
||||
add bh,16
|
||||
setpalxxx ;+ - -
|
||||
sub bh,16
|
||||
|
||||
add cl,16
|
||||
add bh,16
|
||||
setpalxxx ;+ - +
|
||||
sub bh,16
|
||||
sub cl,16
|
||||
|
||||
add cl,16
|
||||
add bh,16
|
||||
setpalxxx ;+ + -
|
||||
sub bh,16
|
||||
sub cl,16
|
||||
|
||||
add cl,16
|
||||
add bl,16
|
||||
add bh,16
|
||||
setpalxxx ;+ + +
|
||||
add bh,16
|
||||
add bl,16
|
||||
sub cl,16
|
||||
|
||||
@@xx: ret
|
||||
demo_glz ENDP
|
||||
|
||||
PUBLIC _ceasypolylist
|
||||
_ceasypolylist PROC FAR ;polylist,polys,points3
|
||||
CBEG
|
||||
mov di,[bp+6]
|
||||
mov es,word ptr [bp+8]
|
||||
mov si,[bp+10]
|
||||
mov ds,word ptr [bp+12]
|
||||
mov ax,[bp+14]
|
||||
add ax,4
|
||||
mov cs:pointsoff,ax
|
||||
mov gs,word ptr [bp+16]
|
||||
mov bp,-1
|
||||
@@2: lodsw
|
||||
cmp ax,0
|
||||
je @@1
|
||||
add di,2
|
||||
mov cx,ax
|
||||
movsw
|
||||
mov cs:cntoff,di
|
||||
@@3: push cx
|
||||
mov ax,ds:[si]
|
||||
add si,2
|
||||
call adddot
|
||||
pop cx
|
||||
loop @@3
|
||||
@@6: mov bx,cs:cntoff
|
||||
mov eax,es:[bx]
|
||||
cmp eax,es:[di-4]
|
||||
jne @@4
|
||||
sub di,4
|
||||
@@4: mov ax,di
|
||||
sub ax,cs:cntoff
|
||||
shr ax,2
|
||||
mov es:[bx-4],ax
|
||||
call checkhiddenbx
|
||||
;;; call demo_glz ;sets colors etc / hidden faces flipped
|
||||
call demo_norm ;sets colors etc / hidden faces flipped
|
||||
jmp @@2
|
||||
@@1: mov word ptr es:[di],0
|
||||
CEND
|
||||
_ceasypolylist ENDP
|
||||
|
||||
PUBLIC _cglenzinit
|
||||
_cglenzinit PROC FAR
|
||||
CBEG
|
||||
LOADDS
|
||||
mov ax,0
|
||||
call __newgroup
|
||||
CEND
|
||||
_cglenzinit ENDP
|
||||
|
||||
PUBLIC _cglenzdone
|
||||
_cglenzdone PROC FAR
|
||||
CBEG
|
||||
LOADDS
|
||||
mov ax,2
|
||||
call __newgroup
|
||||
CEND
|
||||
_cglenzdone ENDP
|
||||
|
||||
PUBLIC _cglenzpolylist
|
||||
_cglenzpolylist PROC FAR
|
||||
CBEG
|
||||
LOADDS
|
||||
movpar di,0
|
||||
movpar es,1
|
||||
mov ax,1
|
||||
call __newgroup
|
||||
CEND
|
||||
_cglenzpolylist ENDP
|
||||
|
||||
PUBLIC _cdrawpolylist
|
||||
_cdrawpolylist PROC FAR
|
||||
CBEG
|
||||
LOADDS
|
||||
movpar di,0
|
||||
mov es,word ptr [bp+8]
|
||||
call VIDPOLYGROUP
|
||||
CEND
|
||||
_cdrawpolylist ENDP
|
||||
|
||||
adddotxy PROC NEAR
|
||||
cmp eax,ebp
|
||||
je @@3
|
||||
mov ebp,eax
|
||||
stosd ;adddot
|
||||
@@3: ret
|
||||
adddotxy ENDP
|
||||
|
||||
ALIGN 2
|
||||
cllastdi dw 0
|
||||
clipz dd 4000
|
||||
|
||||
zclipsidi PROC NEAR ;CLASSIC, clip <cs:clipz
|
||||
;si=point1(end to clip), di=point2
|
||||
;returns new point xy (in eax)
|
||||
mov ax,fs
|
||||
push bx
|
||||
mov eax,fs:[si+8]
|
||||
cmp eax,cs:clipz
|
||||
jl @@1
|
||||
;si is visible, just return it.
|
||||
mov eax,fs:[si+0]
|
||||
pop bx
|
||||
ret
|
||||
@@2: mov eax,080008000h ;both hidden
|
||||
pop bx
|
||||
ret
|
||||
@@1: mov ecx,fs:[di+8]
|
||||
cmp ecx,cs:clipz
|
||||
jl @@2
|
||||
mov edx,ecx
|
||||
sub ecx,eax
|
||||
;cx=length of entire edge
|
||||
sub edx,cs:clipz
|
||||
;dx=length of clipped edge
|
||||
xor eax,eax
|
||||
div ecx
|
||||
shr eax,16
|
||||
mov ecx,eax
|
||||
;ecx=multiplier (0..65535)
|
||||
mov ax,fs:[si+12]
|
||||
sub ax,fs:[di+12]
|
||||
movsx eax,ax
|
||||
imul ecx
|
||||
shld edx,eax,16
|
||||
movsx eax,word ptr fs:[di+12]
|
||||
add edx,eax
|
||||
push edx ;X
|
||||
mov ax,fs:[si+14]
|
||||
sub ax,fs:[di+14]
|
||||
movsx eax,ax
|
||||
imul ecx
|
||||
shld edx,eax,16
|
||||
movsx eax,word ptr fs:[di+14]
|
||||
add edx,eax
|
||||
mov eax,edx ;eax=Y
|
||||
|
||||
;project ebx=z, eax=y, ecx=x
|
||||
|
||||
imul gs:projymul
|
||||
idiv cs:clipz
|
||||
add ax,gs:projyadd
|
||||
mov bx,ax
|
||||
;
|
||||
pop ecx ;ecx=X
|
||||
mov eax,gs:projxmul
|
||||
imul ecx
|
||||
idiv cs:clipz
|
||||
add ax,gs:projxadd
|
||||
|
||||
shl ebx,16
|
||||
mov bx,ax
|
||||
mov eax,ebx
|
||||
|
||||
;eax=xy
|
||||
|
||||
pop bx
|
||||
ret
|
||||
zclipsidi ENDP
|
||||
|
||||
xclipsidi PROC NEAR ;REVERSE, clip >cs:zclip
|
||||
;si=point1(end to clip), di=point2
|
||||
;returns new point xy (in eax)
|
||||
mov ax,fs
|
||||
push bx
|
||||
mov eax,fs:[si+8]
|
||||
cmp eax,cs:clipz
|
||||
jge @@1
|
||||
;si is visible, just return it.
|
||||
mov eax,fs:[si+0]
|
||||
pop bx
|
||||
ret
|
||||
@@2: mov eax,080008000h ;both hidden
|
||||
pop bx
|
||||
ret
|
||||
@@1: mov ecx,fs:[di+8]
|
||||
cmp ecx,cs:clipz
|
||||
jge @@2
|
||||
xchg ecx,eax
|
||||
mov edx,ecx
|
||||
sub ecx,eax
|
||||
;cx=length of entire edge
|
||||
sub edx,cs:clipz
|
||||
;dx=length of clipped edge
|
||||
xor eax,eax
|
||||
div ecx
|
||||
shr eax,16
|
||||
mov ecx,eax
|
||||
;ecx=multiplier (0..65535)
|
||||
mov ax,fs:[di+12]
|
||||
sub ax,fs:[si+12]
|
||||
movsx eax,ax
|
||||
imul ecx
|
||||
shld edx,eax,16
|
||||
movsx eax,word ptr fs:[si+12]
|
||||
add edx,eax
|
||||
push edx ;X
|
||||
mov ax,fs:[di+14]
|
||||
sub ax,fs:[si+14]
|
||||
movsx eax,ax
|
||||
imul ecx
|
||||
shld edx,eax,16
|
||||
movsx eax,word ptr fs:[si+14]
|
||||
add edx,eax
|
||||
mov eax,edx ;eax=Y
|
||||
|
||||
;project ebx=z, eax=y, ecx=x
|
||||
|
||||
imul gs:projymul
|
||||
idiv cs:clipz
|
||||
add ax,gs:projyadd
|
||||
mov bx,ax
|
||||
;
|
||||
pop ecx ;ecx=X
|
||||
mov eax,gs:projxmul
|
||||
imul ecx
|
||||
idiv cs:clipz
|
||||
add ax,gs:projxadd
|
||||
|
||||
shl ebx,16
|
||||
mov bx,ax
|
||||
mov eax,ebx
|
||||
|
||||
;eax=xy
|
||||
|
||||
pop bx
|
||||
ret
|
||||
xclipsidi ENDP
|
||||
|
||||
eclipsidi PROC NEAR
|
||||
shl si,4
|
||||
shl di,4
|
||||
mov ax,cs:pointsoff
|
||||
add si,ax
|
||||
add di,ax
|
||||
;
|
||||
push si
|
||||
push di
|
||||
call xclipsidi
|
||||
pop si
|
||||
pop di
|
||||
push eax
|
||||
call xclipsidi
|
||||
mov edx,eax
|
||||
pop eax
|
||||
;returns: eax=si-end-of-line-xy
|
||||
;returns: edx=di-end-of-line-xy
|
||||
ret
|
||||
eclipsidi ENDP
|
||||
|
||||
PUBLIC _cclipeasypolylist
|
||||
_cclipeasypolylist PROC FAR ;polylist,polys,points3
|
||||
CBEG
|
||||
mov di,[bp+6]
|
||||
mov es,word ptr [bp+8]
|
||||
mov si,[bp+10]
|
||||
mov ds,word ptr [bp+12]
|
||||
mov ax,[bp+14]
|
||||
add ax,4
|
||||
mov cs:pointsoff,ax
|
||||
mov fs,word ptr [bp+16]
|
||||
@@2: lodsw
|
||||
cmp ax,0
|
||||
je @@1
|
||||
add di,2
|
||||
mov cx,ax
|
||||
movsw
|
||||
mov cs:cntoff,di
|
||||
push si
|
||||
add si,cx
|
||||
add si,cx
|
||||
mov ax,ds:[si-2]
|
||||
mov cs:cllastdi,ax
|
||||
pop si
|
||||
mov ebp,-1
|
||||
@@3: push cx
|
||||
mov ax,ds:[si]
|
||||
add si,2
|
||||
push si
|
||||
push di
|
||||
push ebp
|
||||
mov di,ax
|
||||
mov si,cs:cllastdi
|
||||
mov cs:cllastdi,ax
|
||||
call eclipsidi ;eax=first point, edx=second (0x80008000=no point)
|
||||
pop ebp
|
||||
pop di
|
||||
pop si
|
||||
cmp eax,080008000h
|
||||
je @@8
|
||||
call adddotxy ;doesn't destroy edx
|
||||
@@8: cmp edx,080008000h
|
||||
je @@7
|
||||
mov eax,edx
|
||||
call adddotxy
|
||||
@@7: pop cx
|
||||
loop @@3
|
||||
@@6: mov bx,cs:cntoff
|
||||
; mov eax,es:[bx]
|
||||
; cmp eax,es:[di-4]
|
||||
; jne @@4
|
||||
; sub di,4
|
||||
@@4: mov ax,di
|
||||
sub ax,cs:cntoff
|
||||
shr ax,2
|
||||
cmp ax,0
|
||||
jne @@10
|
||||
mov di,cs:cntoff
|
||||
sub di,4
|
||||
jmp @@2
|
||||
@@10: mov es:[bx-4],ax
|
||||
call checkhiddenbx
|
||||
cmc
|
||||
;;; call demo_glz ;sets colors etc / hidden faces flipped
|
||||
;;; call demo_norm ;sets colors etc / hidden faces flipped
|
||||
call cs:demo_do
|
||||
jmp @@2
|
||||
@@1: mov word ptr es:[di],0
|
||||
CEND
|
||||
_cclipeasypolylist ENDP
|
||||
|
||||
PUBLIC _ceasymode
|
||||
_ceasymode PROC FAR
|
||||
push bp
|
||||
mov bp,sp
|
||||
mov ax,[bp+6]
|
||||
mov dx,OFFSET demo_hide
|
||||
cmp ax,1
|
||||
jne @@1
|
||||
mov dx,OFFSET demo_norm
|
||||
@@1: mov cs:demo_do,dx
|
||||
pop bp
|
||||
ret
|
||||
_ceasymode ENDP
|
||||
|
||||
text__vec ENDS
|
||||
END
|
||||
|
||||
173
HARD/VEC.LST
Normal file
173
HARD/VEC.LST
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
Turbo Assembler Version 2.5 02/21/93 18:09:17 Page 1
|
||||
vec.asm
|
||||
|
||||
|
||||
|
||||
1 0000 text__vec SEGMENT para public 'CODE'
|
||||
2 ASSUME cs:text__vec
|
||||
3
|
||||
4 .386
|
||||
5
|
||||
6 PUBLIC setmatrix
|
||||
7 0000 setmatrix PROC FAR
|
||||
8 ;ds:si=matrix
|
||||
9 0000 8B 04 mov ax,ds:[si+0]
|
||||
10 0002 2E: A3 006Fr mov word ptr cs:[1+mtrm00],ax
|
||||
11 0006 8B 44 02 mov ax,ds:[si+2]
|
||||
12 0009 2E: A3 007Cr mov word ptr cs:[1+mtrm02],ax
|
||||
13 000D 8B 44 04 mov ax,ds:[si+4]
|
||||
14 0010 2E: A3 0089r mov word ptr cs:[1+mtrm04],ax
|
||||
15 0014 8B 44 06 mov ax,ds:[si+6]
|
||||
16 0017 2E: A3 009Dr mov word ptr cs:[1+mtrm06],ax
|
||||
17 001B 8B 44 08 mov ax,ds:[si+8]
|
||||
18 001E 2E: A3 00AAr mov word ptr cs:[1+mtrm08],ax
|
||||
19 0022 8B 44 0A mov ax,ds:[si+10]
|
||||
20 0025 2E: A3 00B7r mov word ptr cs:[1+mtrm10],ax
|
||||
21 0029 8B 44 0C mov ax,ds:[si+12]
|
||||
22 002C 2E: A3 00CBr mov word ptr cs:[1+mtrm12],ax
|
||||
23 0030 8B 44 0E mov ax,ds:[si+14]
|
||||
24 0033 2E: A3 00DAr mov word ptr cs:[1+mtrm14],ax
|
||||
25 0037 8B 44 10 mov ax,ds:[si+16]
|
||||
26 003A 2E: A3 00E7r mov word ptr cs:[1+mtrm16],ax
|
||||
27 003E CB ret
|
||||
28 003F setmatrix ENDP
|
||||
29
|
||||
30 003F 90 ALIGN 2
|
||||
31 0040 0000 count dw 0
|
||||
32
|
||||
33 0042 dovertices PROC FAR
|
||||
34 ;normals etc, only rotate
|
||||
35 ;pointlist@DS:SI=>pointlist@ES:DI
|
||||
36 0042 57 push di
|
||||
37 LOADGS
|
||||
**Error** vec.asm(37) Illegal instruction
|
||||
38 0043 8B 0C mov cx,ds:[si]
|
||||
39 0045 83 C6 04 add si,4
|
||||
40 0048 2E: 89 0E 0040r mov cs:count,cx
|
||||
41 004D 26: 8B 05 mov ax,es:[di]
|
||||
42 0050 26: 01 0D add es:[di],cx
|
||||
43 0053 8B D8 mov bx,ax
|
||||
44 0055 D1 E0 shl ax,1
|
||||
45 0057 03 C3 add ax,bx
|
||||
46 0059 C1 E0 02 shl ax,2
|
||||
47 005C 03 F8 add di,ax
|
||||
48 005E 83 C7 04 add di,4
|
||||
49
|
||||
50 0061 nrup1: ;rotate with matrix
|
||||
51 0061 56 push si
|
||||
52 0062 57 push di
|
||||
53 0063 66| 8B 6C 08 mov ebp,ds:[si+8]
|
||||
54 0067 66| 8B 7C 04 mov edi,ds:[si+4]
|
||||
55 006B 66| 8B 34 mov esi,ds:[si+0]
|
||||
56
|
||||
Turbo Assembler Version 2.5 02/21/93 18:09:17 Page 2
|
||||
vec.asm
|
||||
|
||||
|
||||
|
||||
57 006E 66| 69 F6 12345678 mtrm00: imul esi,12345678h
|
||||
58 0075 66| 8B D8 mov ebx,eax
|
||||
59 0078 66| 8B CA mov ecx,edx
|
||||
60 007B 66| 69 FF 12345678 mtrm02: imul edi,12345678h
|
||||
61 0082 66| 03 D8 add ebx,eax
|
||||
62 0085 66| 13 CA adc ecx,edx
|
||||
63 0088 66| 69 ED 12345678 mtrm04: imul ebp,12345678h
|
||||
64 008F 66| 03 D8 add ebx,eax
|
||||
65 0092 66| 13 CA adc ecx,edx
|
||||
66 0095 66| 0F A4 D9 11 shld ecx,ebx,17
|
||||
67 009A 66| 51 push ecx
|
||||
68 009C 66| 69 F6 12345678 mtrm06: imul esi,12345678h
|
||||
69 00A3 66| 8B D8 mov ebx,eax
|
||||
70 00A6 66| 8B CA mov ecx,edx
|
||||
71 00A9 66| 69 FF 12345678 mtrm08: imul edi,12345678h
|
||||
72 00B0 66| 03 D8 add ebx,eax
|
||||
73 00B3 66| 13 CA adc ecx,edx
|
||||
74 00B6 66| 69 ED 12345678 mtrm10: imul ebp,12345678h
|
||||
75 00BD 66| 03 D8 add ebx,eax
|
||||
76 00C0 66| 13 CA adc ecx,edx
|
||||
77 00C3 66| 0F A4 D9 11 shld ecx,ebx,17
|
||||
78 00C8 66| 51 push ecx
|
||||
79 00CA 66| B8 12345678 mtrm12: mov eax,12345678h
|
||||
80 00D0 66| F7 EE imul esi
|
||||
81 00D3 66| 8B D8 mov ebx,eax
|
||||
82 00D6 66| 8B CA mov ecx,edx
|
||||
83 00D9 66| 69 FF 12345678 mtrm14: imul edi,12345678h
|
||||
84 00E0 66| 03 D8 add ebx,eax
|
||||
85 00E3 66| 13 CA adc ecx,edx
|
||||
86 00E6 66| 69 ED 12345678 mtrm16: imul ebp,12345678h
|
||||
87 00ED 66| 03 D8 add ebx,eax
|
||||
88 00F0 66| 13 CA adc ecx,edx
|
||||
89 00F3 66| 0F A4 D9 11 shld ecx,ebx,17
|
||||
90 00F8 66| 5A pop edx
|
||||
91 00FA 66| 58 pop eax
|
||||
92 00FC 5F pop di
|
||||
93 00FD 5E pop si
|
||||
94 ;
|
||||
95 00FE 66| 65: 03 0E 0000 add ecx,gs:xadd
|
||||
**Error** vec.asm(95) Undefined symbol: XADD
|
||||
96 0104 66| 26: 89 0D mov es:[di+0],ecx
|
||||
97 0108 66| 65: 03 0E 0000 add ecx,gs:yadd
|
||||
**Error** vec.asm(97) Undefined symbol: YADD
|
||||
98 010E 66| 26: 89 55 04 mov es:[di+4],edx
|
||||
99 0113 66| 65: 03 06 0000 add eax,gs:zadd
|
||||
**Error** vec.asm(99) Undefined symbol: ZADD
|
||||
100 0119 66| 26: 89 45 08 mov es:[di+8],eax
|
||||
101 ;next point
|
||||
102 011E 83 C6 0C add si,12
|
||||
103 0121 83 C7 0C add di,12
|
||||
104 0124 FF 0E 0040r dec ds:count
|
||||
105 0128 0F 85 FF35 jnz nrup1
|
||||
106 012C 5F pop di
|
||||
107 012D CB ret
|
||||
108 012E dovertices ENDP
|
||||
109
|
||||
110 012E text__vec ENDS
|
||||
Turbo Assembler Version 2.5 02/21/93 18:09:17 Page 3
|
||||
vec.asm
|
||||
|
||||
|
||||
|
||||
111 END
|
||||
Turbo Assembler Version 2.5 02/21/93 18:09:17 Page 4
|
||||
Symbol Table
|
||||
|
||||
|
||||
|
||||
|
||||
Symbol Name Type Value
|
||||
|
||||
??DATE Text "02/21/93"
|
||||
??FILENAME Text "vec "
|
||||
??TIME Text "18:09:13"
|
||||
??VERSION Number 0205
|
||||
@CPU Text 0D0FH
|
||||
@CURSEG Text TEXT__VEC
|
||||
@FILENAME Text VEC
|
||||
@WORDSIZE Text 4
|
||||
COUNT Word TEXT__VEC:0040
|
||||
DOVERTICES Far TEXT__VEC:0042
|
||||
MTRM00 Near TEXT__VEC:006E
|
||||
MTRM02 Near TEXT__VEC:007B
|
||||
MTRM04 Near TEXT__VEC:0088
|
||||
MTRM06 Near TEXT__VEC:009C
|
||||
MTRM08 Near TEXT__VEC:00A9
|
||||
MTRM10 Near TEXT__VEC:00B6
|
||||
MTRM12 Near TEXT__VEC:00CA
|
||||
MTRM14 Near TEXT__VEC:00D9
|
||||
MTRM16 Near TEXT__VEC:00E6
|
||||
NRUP1 Near TEXT__VEC:0061
|
||||
SETMATRIX Far TEXT__VEC:0000
|
||||
|
||||
Groups & Segments Bit Size Align Combine Class
|
||||
|
||||
TEXT__VEC 16 012E Para Public CODE
|
||||
Turbo Assembler Version 2.5 02/21/93 18:09:17 Page 5
|
||||
Error Summary
|
||||
|
||||
|
||||
|
||||
**Error** vec.asm(37) Illegal instruction
|
||||
**Error** vec.asm(95) Undefined symbol: XADD
|
||||
**Error** vec.asm(97) Undefined symbol: YADD
|
||||
**Error** vec.asm(99) Undefined symbol: ZADD
|
||||
|
||||
420
HARD/VMATH.ASM
Normal file
420
HARD/VMATH.ASM
Normal file
|
|
@ -0,0 +1,420 @@
|
|||
.386
|
||||
|
||||
include vmathsin.asm
|
||||
|
||||
;rotate sins/coss
|
||||
rxsin dw 0
|
||||
rxcos dw 0
|
||||
rysin dw 0
|
||||
rycos dw 0
|
||||
rzsin dw 0
|
||||
rzcos dw 0
|
||||
|
||||
checkdeg MACRO reg
|
||||
local l0,l1,l2
|
||||
l0: cmp reg,3600
|
||||
jb l1
|
||||
jl l2
|
||||
;>3600
|
||||
sub reg,3600
|
||||
jmp l0
|
||||
l2: ;<0
|
||||
add reg,3600
|
||||
jmp l0
|
||||
l1: ENDM
|
||||
|
||||
public _cmatrix_yxz
|
||||
_cmatrix_yxz PROC FAR
|
||||
CBEG
|
||||
movpar ds,4
|
||||
movpar si,3
|
||||
mov di,si
|
||||
movpar ax,0 ;rotx
|
||||
mov ds:[si+2],ax
|
||||
movpar ax,1 ;roty
|
||||
mov ds:[si+0],ax
|
||||
movpar ax,2 ;rotz
|
||||
mov ds:[si+4],ax
|
||||
call calcmatrix
|
||||
CEND
|
||||
_cmatrix_yxz ENDP
|
||||
|
||||
calcmatrix PROC NEAR ;rY*rX*rZ
|
||||
;ds:[si+0]=rotx
|
||||
;ds:[si+2]=roty
|
||||
;ds:[si+4]=rotz
|
||||
;dest: ds:[di]
|
||||
;load values, check 'em and calc sin/cos
|
||||
;ROT-X
|
||||
mov bx,ds:[si]
|
||||
checkdeg bx
|
||||
mov ds:[si],bx
|
||||
shl bx,1
|
||||
mov ax,cs:sintable16[bx]
|
||||
mov cs:rxsin,ax
|
||||
mov ax,cs:costable16[bx]
|
||||
mov cs:rxcos,ax
|
||||
;ROT-Y
|
||||
mov bx,ds:[si+2]
|
||||
checkdeg bx
|
||||
mov ds:[si+2],bx
|
||||
shl bx,1
|
||||
mov ax,cs:sintable16[bx]
|
||||
mov cs:rysin,ax
|
||||
mov ax,cs:costable16[bx]
|
||||
mov cs:rycos,ax
|
||||
;ROT-Z
|
||||
mov bx,ds:[si+4]
|
||||
checkdeg bx
|
||||
mov ds:[si+4],bx
|
||||
shl bx,1
|
||||
mov ax,cs:sintable16[bx]
|
||||
mov cs:rzsin,ax
|
||||
mov ax,cs:costable16[bx]
|
||||
mov cs:rzcos,ax
|
||||
|
||||
;matrix equations: rY*rX*rZ
|
||||
; 0=Ycos*Zcos- 2=Xsin*Ysin*Zcos+ 4=-Xcos*Ysin
|
||||
; Xsin*Ysin*Zsin Ycos*Zsin
|
||||
; 6=-Xcos*Zsin 8=Xcos*Zcos 10=Xsin
|
||||
;
|
||||
;12=Xsin*Ycos*Zsin+ 14=Ysin*Zsin- 16=Xcos*Ycos
|
||||
; Ysin*Zcos Xsin*Ycos*Zcos\
|
||||
|
||||
mov ax,cs:rysin
|
||||
imul cs:rzsin
|
||||
shld dx,ax,1
|
||||
mov ds:[di+14],dx ;14a
|
||||
|
||||
mov ax,cs:rycos
|
||||
imul cs:rzcos
|
||||
shld dx,ax,1
|
||||
mov ds:[di+0],dx ;0a
|
||||
|
||||
mov ax,dx
|
||||
imul cs:rxsin
|
||||
shld dx,ax,1
|
||||
sub ds:[di+14],dx ;14b
|
||||
|
||||
mov ax,cs:rxsin
|
||||
imul cs:rysin
|
||||
shld dx,ax,1
|
||||
mov cx,dx
|
||||
|
||||
mov ax,cs:rzsin
|
||||
imul dx
|
||||
shld dx,ax,1
|
||||
sub ds:[di+0],dx ;0b
|
||||
|
||||
mov ax,cs:rzcos
|
||||
imul cx
|
||||
shld dx,ax,1
|
||||
mov ds:[di+2],dx ;2a
|
||||
|
||||
mov ax,cs:rycos
|
||||
imul cs:rzsin
|
||||
shld dx,ax,1
|
||||
add ds:[di+2],dx ;2b
|
||||
|
||||
mov ax,cs:rxsin
|
||||
imul dx
|
||||
shld dx,ax,1
|
||||
mov ds:[di+12],dx ;12a
|
||||
|
||||
mov ax,cs:rysin
|
||||
imul cs:rzcos
|
||||
shld dx,ax,1
|
||||
add ds:[di+12],dx ;12b
|
||||
|
||||
mov ax,cs:rxcos
|
||||
imul cs:rzsin
|
||||
shld dx,ax,1
|
||||
neg dx
|
||||
mov ds:[di+6],dx ;6
|
||||
|
||||
mov ax,cs:rxcos
|
||||
imul cs:rzcos
|
||||
shld dx,ax,1
|
||||
mov ds:[di+8],dx ;8
|
||||
|
||||
mov ax,cs:rxcos
|
||||
imul cs:rysin
|
||||
shld dx,ax,1
|
||||
neg dx
|
||||
mov ds:[di+4],dx ;4
|
||||
|
||||
mov ax,cs:rxcos
|
||||
imul cs:rycos
|
||||
shld dx,ax,1
|
||||
mov ds:[di+16],dx ;16
|
||||
|
||||
mov ax,cs:rxsin
|
||||
mov ds:[di+10],ax ;10
|
||||
|
||||
ret
|
||||
calcmatrix ENDP
|
||||
|
||||
calcmatrixsep PROC NEAR ;calc 3 separate matrices
|
||||
;ds:[si+0]=rotx
|
||||
;ds:[si+2]=roty
|
||||
;ds:[si+4]=rotz
|
||||
;dest: ds:[di]
|
||||
;load values, check 'em and calc sin/cos
|
||||
;ROT-X
|
||||
mov bx,ds:[si]
|
||||
checkdeg bx
|
||||
mov ds:[si],bx
|
||||
shl bx,1
|
||||
mov ax,cs:sintable16[bx]
|
||||
mov cs:rxsin,ax
|
||||
mov ax,cs:costable16[bx]
|
||||
mov cs:rxcos,ax
|
||||
;ROT-Y
|
||||
mov bx,ds:[si+2]
|
||||
checkdeg bx
|
||||
mov ds:[si+2],bx
|
||||
shl bx,1
|
||||
mov ax,cs:sintable16[bx]
|
||||
mov cs:rysin,ax
|
||||
mov ax,cs:costable16[bx]
|
||||
mov cs:rycos,ax
|
||||
;ROT-Z
|
||||
mov bx,ds:[si+4]
|
||||
checkdeg bx
|
||||
mov ds:[si+4],bx
|
||||
shl bx,1
|
||||
mov ax,cs:sintable16[bx]
|
||||
mov cs:rzsin,ax
|
||||
mov ax,cs:costable16[bx]
|
||||
mov cs:rzcos,ax
|
||||
mov bx,0
|
||||
mov cx,32767
|
||||
|
||||
;rX
|
||||
mov ds:[di+0],cx
|
||||
mov ds:[di+2],bx
|
||||
mov ds:[di+4],bx
|
||||
mov ds:[di+6],bx
|
||||
mov ax,cs:rxcos
|
||||
mov ds:[di+8],ax
|
||||
mov ax,cs:rxsin
|
||||
mov ds:[di+10],ax
|
||||
mov ds:[di+12],bx
|
||||
mov ax,cs:rxsin
|
||||
neg ax
|
||||
mov ds:[di+14],ax
|
||||
mov ax,cs:rxcos
|
||||
mov ds:[di+16],ax
|
||||
add di,18
|
||||
|
||||
;rY
|
||||
mov ax,cs:rycos
|
||||
mov ds:[di+0],ax
|
||||
mov ds:[di+2],bx
|
||||
mov ax,cs:rysin
|
||||
neg ax
|
||||
mov ds:[di+4],ax
|
||||
mov ds:[di+6],bx
|
||||
mov ds:[di+8],cx
|
||||
mov ds:[di+10],bx
|
||||
mov ax,cs:rysin
|
||||
mov ds:[di+12],ax
|
||||
mov ds:[di+14],bx
|
||||
mov ax,cs:rycos
|
||||
mov ds:[di+16],ax
|
||||
add di,18
|
||||
|
||||
;rZ
|
||||
mov ax,cs:rzcos
|
||||
mov ds:[di+0],ax
|
||||
mov ax,cs:rzsin
|
||||
mov ds:[di+2],ax
|
||||
mov ds:[di+4],bx
|
||||
mov ax,cs:rzsin
|
||||
neg ax
|
||||
mov ds:[di+6],ax
|
||||
mov ax,cs:rzcos
|
||||
mov ds:[di+8],ax
|
||||
mov ds:[di+10],bx
|
||||
mov ds:[di+12],bx
|
||||
mov ds:[di+14],bx
|
||||
mov ds:[di+16],cx
|
||||
add di,18
|
||||
|
||||
ret
|
||||
calcmatrixsep ENDP
|
||||
|
||||
calcmatrix0 PROC NEAR ;rX*rY*rZ
|
||||
;ds:[si]=rotx
|
||||
;ds:[si]=roty
|
||||
;ds:[si]=rotz
|
||||
;dest: ds:[di]
|
||||
;load values, check 'em and calc sin/cos
|
||||
;ROT-X
|
||||
mov bx,ds:[si]
|
||||
checkdeg bx
|
||||
mov ds:[si],bx
|
||||
shl bx,1
|
||||
mov ax,cs:sintable16[bx]
|
||||
mov cs:rxsin,ax
|
||||
mov ax,cs:costable16[bx]
|
||||
mov cs:rxcos,ax
|
||||
;ROT-Y
|
||||
mov bx,ds:[si+2]
|
||||
checkdeg bx
|
||||
mov ds:[si+2],bx
|
||||
shl bx,1
|
||||
mov ax,cs:sintable16[bx]
|
||||
mov cs:rysin,ax
|
||||
mov ax,cs:costable16[bx]
|
||||
mov cs:rycos,ax
|
||||
;ROT-Z
|
||||
mov bx,ds:[si+4]
|
||||
checkdeg bx
|
||||
mov ds:[si+4],bx
|
||||
shl bx,1
|
||||
mov ax,cs:sintable16[bx]
|
||||
mov cs:rzsin,ax
|
||||
mov ax,cs:costable16[bx]
|
||||
mov cs:rzcos,ax
|
||||
|
||||
;matrix equations: rX*rY*rZ ;rZ*rY*rX
|
||||
; 0=Ycos*Zcos 2=Ycos*Zsin 4=-Ysin
|
||||
; 6=Xsin*Zcos*Ysin 8=Xsin*Ysin*Zsin 10=Ycos*Xsin
|
||||
; -Xcos*Zsin +Xcos*Zcos
|
||||
;12=Xcos*Zcos*Ysin 14=Xcos*Ysin*Zsin 16=Ycos*Xcos
|
||||
; +Xsin*Zsin -Xsin*Zcos
|
||||
|
||||
;calculate rotation matrix
|
||||
;0,2,10,16,4
|
||||
mov bx,cs:rycos
|
||||
mov ax,cs:rzcos
|
||||
imul bx
|
||||
shld dx,ax,1
|
||||
mov ds:[di+0],dx
|
||||
;
|
||||
mov ax,cs:rzsin
|
||||
imul bx
|
||||
shld dx,ax,1
|
||||
mov ds:[di+2],dx
|
||||
;
|
||||
mov ax,cs:rxsin
|
||||
imul bx
|
||||
shld dx,ax,1
|
||||
mov ds:[di+10],dx
|
||||
;
|
||||
mov ax,cs:rxcos
|
||||
imul bx
|
||||
shld dx,ax,1
|
||||
mov ds:[di+16],dx
|
||||
;
|
||||
mov ax,cs:rysin
|
||||
neg ax
|
||||
mov ds:[di+4],ax
|
||||
;6,8
|
||||
mov ax,cs:rxsin
|
||||
imul cs:rysin
|
||||
shld dx,ax,1
|
||||
mov cx,dx
|
||||
;
|
||||
mov ax,cx
|
||||
imul cs:rzcos
|
||||
shld dx,ax,1
|
||||
mov ds:[di+6],dx
|
||||
;
|
||||
mov ax,cx
|
||||
imul cs:rzsin
|
||||
shld dx,ax,1
|
||||
mov ds:[di+8],dx
|
||||
;
|
||||
mov bx,cs:rxcos
|
||||
mov ax,cs:rzsin
|
||||
imul bx
|
||||
shld dx,ax,1
|
||||
sub ds:[di+6],dx
|
||||
;
|
||||
mov ax,cs:rzcos
|
||||
imul bx
|
||||
shld dx,ax,1
|
||||
add ds:[di+8],dx
|
||||
;12,14
|
||||
mov ax,cs:rxcos
|
||||
imul cs:rysin
|
||||
shld dx,ax,1
|
||||
mov cx,dx
|
||||
;
|
||||
mov ax,cx
|
||||
imul cs:rzcos
|
||||
shld dx,ax,1
|
||||
mov ds:[di+12],dx
|
||||
;
|
||||
mov ax,cx
|
||||
imul cs:rzsin
|
||||
shld dx,ax,1
|
||||
mov ds:[di+14],dx
|
||||
;
|
||||
mov bx,cs:rxsin
|
||||
mov ax,cs:rzsin
|
||||
imul bx
|
||||
shld dx,ax,1
|
||||
add ds:[di+12],dx
|
||||
;
|
||||
mov ax,cs:rzcos
|
||||
imul bx
|
||||
shld dx,ax,1
|
||||
sub ds:[di+14],dx
|
||||
|
||||
ret
|
||||
calcmatrix0 ENDP
|
||||
|
||||
mulmacro MACRO row,col
|
||||
mov ax,ds:[si+0+row*6]
|
||||
imul word ptr es:[di+0+col*2]
|
||||
mov cx,dx
|
||||
mov bx,ax
|
||||
mov ax,ds:[si+2+row*6]
|
||||
imul word ptr es:[di+6+col*2]
|
||||
add cx,dx
|
||||
add bx,ax
|
||||
mov ax,ds:[si+4+row*6]
|
||||
imul word ptr es:[di+12+col*2]
|
||||
add cx,dx
|
||||
add bx,ax
|
||||
shld cx,bx,1
|
||||
ENDM
|
||||
|
||||
mulmatrices PROC NEAR
|
||||
;ds:si=matrix1,es:di=matrix2 => ds:si (overwrite)
|
||||
mulmacro 0,0
|
||||
push cx
|
||||
mulmacro 0,1
|
||||
push cx
|
||||
mulmacro 0,2
|
||||
push cx
|
||||
|
||||
mulmacro 1,0
|
||||
push cx
|
||||
mulmacro 1,1
|
||||
push cx
|
||||
mulmacro 1,2
|
||||
push cx
|
||||
|
||||
mulmacro 2,0
|
||||
push cx
|
||||
mulmacro 2,1
|
||||
push cx
|
||||
mulmacro 2,2
|
||||
|
||||
mov ds:[si+4+12],cx
|
||||
pop word ptr ds:[si+2+12]
|
||||
pop word ptr ds:[si+0+12]
|
||||
pop word ptr ds:[si+4+6]
|
||||
pop word ptr ds:[si+2+6]
|
||||
pop word ptr ds:[si+0+6]
|
||||
pop word ptr ds:[si+4]
|
||||
pop word ptr ds:[si+2]
|
||||
pop word ptr ds:[si+0]
|
||||
ret
|
||||
mulmatrices ENDP
|
||||
|
||||
|
||||
547
HARD/VMATHSIN.ASM
Normal file
547
HARD/VMATHSIN.ASM
Normal file
|
|
@ -0,0 +1,547 @@
|
|||
sintable16 LABEL WORD
|
||||
dw 0, 57, 114, 172, 229, 286, 343, 400, 457, 515
|
||||
dw 572, 629, 686, 743, 801, 858, 915, 972, 1029, 1086
|
||||
dw 1144, 1201, 1258, 1315, 1372, 1429, 1486, 1544, 1601, 1658
|
||||
dw 1715, 1772, 1829, 1886, 1943, 2000, 2057, 2115, 2172, 2229
|
||||
dw 2286, 2343, 2400, 2457, 2514, 2571, 2628, 2685, 2742, 2799
|
||||
dw 2856, 2913, 2970, 3027, 3084, 3141, 3197, 3254, 3311, 3368
|
||||
dw 3425, 3482, 3539, 3596, 3653, 3709, 3766, 3823, 3880, 3937
|
||||
dw 3993, 4050, 4107, 4164, 4220, 4277, 4334, 4390, 4447, 4504
|
||||
dw 4560, 4617, 4674, 4730, 4787, 4843, 4900, 4956, 5013, 5069
|
||||
dw 5126, 5182, 5239, 5295, 5352, 5408, 5465, 5521, 5577, 5634
|
||||
dw 5690, 5746, 5803, 5859, 5915, 5971, 6028, 6084, 6140, 6196
|
||||
dw 6252, 6308, 6364, 6421, 6477, 6533, 6589, 6645, 6701, 6757
|
||||
dw 6813, 6869, 6924, 6980, 7036, 7092, 7148, 7204, 7259, 7315
|
||||
dw 7371, 7427, 7482, 7538, 7594, 7649, 7705, 7760, 7816, 7872
|
||||
dw 7927, 7983, 8038, 8093, 8149, 8204, 8260, 8315, 8370, 8425
|
||||
dw 8481, 8536, 8591, 8646, 8701, 8757, 8812, 8867, 8922, 8977
|
||||
dw 9032, 9087, 9142, 9197, 9251, 9306, 9361, 9416, 9471, 9525
|
||||
dw 9580, 9635, 9689, 9744, 9799, 9853, 9908, 9962, 10017, 10071
|
||||
dw 10126, 10180, 10234, 10289, 10343, 10397, 10451, 10506, 10560, 10614
|
||||
dw 10668, 10722, 10776, 10830, 10884, 10938, 10992, 11046, 11099, 11153
|
||||
dw 11207, 11261, 11314, 11368, 11422, 11475, 11529, 11582, 11636, 11689
|
||||
dw 11743, 11796, 11849, 11903, 11956, 12009, 12062, 12115, 12169, 12222
|
||||
dw 12275, 12328, 12381, 12434, 12487, 12539, 12592, 12645, 12698, 12750
|
||||
dw 12803, 12856, 12908, 12961, 13013, 13066, 13118, 13171, 13223, 13275
|
||||
dw 13328, 13380, 13432, 13484, 13536, 13588, 13640, 13692, 13744, 13796
|
||||
dw 13848, 13900, 13952, 14003, 14055, 14107, 14158, 14210, 14261, 14313
|
||||
dw 14364, 14415, 14467, 14518, 14569, 14621, 14672, 14723, 14774, 14825
|
||||
dw 14876, 14927, 14978, 15029, 15079, 15130, 15181, 15231, 15282, 15333
|
||||
dw 15383, 15434, 15484, 15534, 15585, 15635, 15685, 15735, 15786, 15836
|
||||
dw 15886, 15936, 15986, 16036, 16085, 16135, 16185, 16235, 16284, 16334
|
||||
dw 16383, 16433, 16482, 16532, 16581, 16631, 16680, 16729, 16778, 16827
|
||||
dw 16876, 16925, 16974, 17023, 17072, 17121, 17169, 17218, 17267, 17315
|
||||
dw 17364, 17412, 17461, 17509, 17557, 17606, 17654, 17702, 17750, 17798
|
||||
dw 17846, 17894, 17942, 17990, 18038, 18085, 18133, 18181, 18228, 18276
|
||||
dw 18323, 18370, 18418, 18465, 18512, 18559, 18607, 18654, 18701, 18748
|
||||
dw 18794, 18841, 18888, 18935, 18981, 19028, 19074, 19121, 19167, 19214
|
||||
dw 19260, 19306, 19352, 19398, 19445, 19491, 19537, 19582, 19628, 19674
|
||||
dw 19720, 19765, 19811, 19856, 19902, 19947, 19993, 20038, 20083, 20128
|
||||
dw 20173, 20218, 20263, 20308, 20353, 20398, 20443, 20487, 20532, 20576
|
||||
dw 20621, 20665, 20710, 20754, 20798, 20842, 20886, 20931, 20974, 21018
|
||||
dw 21062, 21106, 21150, 21193, 21237, 21280, 21324, 21367, 21411, 21454
|
||||
dw 21497, 21540, 21583, 21626, 21669, 21712, 21755, 21798, 21840, 21883
|
||||
dw 21925, 21968, 22010, 22053, 22095, 22137, 22179, 22221, 22263, 22305
|
||||
dw 22347, 22389, 22431, 22472, 22514, 22555, 22597, 22638, 22679, 22721
|
||||
dw 22762, 22803, 22844, 22885, 22926, 22967, 23007, 23048, 23089, 23129
|
||||
dw 23170, 23210, 23251, 23291, 23331, 23371, 23411, 23451, 23491, 23531
|
||||
dw 23571, 23610, 23650, 23689, 23729, 23768, 23808, 23847, 23886, 23925
|
||||
dw 23964, 24003, 24042, 24081, 24120, 24158, 24197, 24235, 24274, 24312
|
||||
dw 24351, 24389, 24427, 24465, 24503, 24541, 24579, 24617, 24654, 24692
|
||||
dw 24730, 24767, 24804, 24842, 24879, 24916, 24953, 24990, 25027, 25064
|
||||
dw 25101, 25138, 25174, 25211, 25247, 25284, 25320, 25356, 25393, 25429
|
||||
dw 25465, 25501, 25537, 25572, 25608, 25644, 25679, 25715, 25750, 25785
|
||||
dw 25821, 25856, 25891, 25926, 25961, 25996, 26031, 26065, 26100, 26134
|
||||
dw 26169, 26203, 26238, 26272, 26306, 26340, 26374, 26408, 26442, 26475
|
||||
dw 26509, 26543, 26576, 26610, 26643, 26676, 26709, 26742, 26775, 26808
|
||||
dw 26841, 26874, 26907, 26939, 26972, 27004, 27036, 27069, 27101, 27133
|
||||
dw 27165, 27197, 27229, 27261, 27292, 27324, 27355, 27387, 27418, 27450
|
||||
dw 27481, 27512, 27543, 27574, 27605, 27635, 27666, 27697, 27727, 27758
|
||||
dw 27788, 27818, 27848, 27879, 27909, 27938, 27968, 27998, 28028, 28057
|
||||
dw 28087, 28116, 28146, 28175, 28204, 28233, 28262, 28291, 28320, 28348
|
||||
dw 28377, 28406, 28434, 28462, 28491, 28519, 28547, 28575, 28603, 28631
|
||||
dw 28659, 28686, 28714, 28741, 28769, 28796, 28823, 28851, 28878, 28905
|
||||
dw 28932, 28958, 28985, 29012, 29038, 29065, 29091, 29117, 29144, 29170
|
||||
dw 29196, 29222, 29247, 29273, 29299, 29324, 29350, 29375, 29400, 29426
|
||||
dw 29451, 29476, 29501, 29526, 29550, 29575, 29600, 29624, 29648, 29673
|
||||
dw 29697, 29721, 29745, 29769, 29793, 29817, 29840, 29864, 29887, 29911
|
||||
dw 29934, 29957, 29980, 30004, 30026, 30049, 30072, 30095, 30117, 30140
|
||||
dw 30162, 30184, 30207, 30229, 30251, 30273, 30295, 30316, 30338, 30360
|
||||
dw 30381, 30402, 30424, 30445, 30466, 30487, 30508, 30529, 30549, 30570
|
||||
dw 30591, 30611, 30631, 30652, 30672, 30692, 30712, 30732, 30752, 30771
|
||||
dw 30791, 30810, 30830, 30849, 30868, 30888, 30907, 30926, 30944, 30963
|
||||
dw 30982, 31000, 31019, 31037, 31056, 31074, 31092, 31110, 31128, 31146
|
||||
dw 31163, 31181, 31198, 31216, 31233, 31250, 31268, 31285, 31302, 31318
|
||||
dw 31335, 31352, 31368, 31385, 31401, 31418, 31434, 31450, 31466, 31482
|
||||
dw 31498, 31513, 31529, 31545, 31560, 31575, 31591, 31606, 31621, 31636
|
||||
dw 31650, 31665, 31680, 31694, 31709, 31723, 31738, 31752, 31766, 31780
|
||||
dw 31794, 31807, 31821, 31835, 31848, 31862, 31875, 31888, 31901, 31914
|
||||
dw 31927, 31940, 31953, 31965, 31978, 31990, 32003, 32015, 32027, 32039
|
||||
dw 32051, 32063, 32075, 32086, 32098, 32109, 32121, 32132, 32143, 32154
|
||||
dw 32165, 32176, 32187, 32197, 32208, 32218, 32229, 32239, 32249, 32259
|
||||
dw 32269, 32279, 32289, 32299, 32308, 32318, 32327, 32336, 32345, 32355
|
||||
dw 32364, 32372, 32381, 32390, 32399, 32407, 32415, 32424, 32432, 32440
|
||||
dw 32448, 32456, 32464, 32472, 32479, 32487, 32494, 32501, 32509, 32516
|
||||
dw 32523, 32530, 32537, 32543, 32550, 32556, 32563, 32569, 32575, 32581
|
||||
dw 32587, 32593, 32599, 32605, 32611, 32616, 32622, 32627, 32632, 32637
|
||||
dw 32642, 32647, 32652, 32657, 32661, 32666, 32670, 32675, 32679, 32683
|
||||
dw 32687, 32691, 32695, 32699, 32702, 32706, 32709, 32713, 32716, 32719
|
||||
dw 32722, 32725, 32728, 32731, 32733, 32736, 32738, 32741, 32743, 32745
|
||||
dw 32747, 32749, 32751, 32753, 32754, 32756, 32757, 32759, 32760, 32761
|
||||
dw 32762, 32763, 32764, 32765, 32765, 32766, 32766, 32767, 32767, 32767
|
||||
costable16 LABEL WORD
|
||||
dw 32767, 32767, 32767, 32767, 32766, 32766, 32765, 32765, 32764, 32763
|
||||
dw 32762, 32761, 32760, 32759, 32757, 32756, 32754, 32753, 32751, 32749
|
||||
dw 32747, 32745, 32743, 32741, 32738, 32736, 32733, 32731, 32728, 32725
|
||||
dw 32722, 32719, 32716, 32713, 32709, 32706, 32702, 32699, 32695, 32691
|
||||
dw 32687, 32683, 32679, 32675, 32670, 32666, 32661, 32657, 32652, 32647
|
||||
dw 32642, 32637, 32632, 32627, 32622, 32616, 32611, 32605, 32599, 32593
|
||||
dw 32587, 32581, 32575, 32569, 32563, 32556, 32550, 32543, 32537, 32530
|
||||
dw 32523, 32516, 32509, 32501, 32494, 32487, 32479, 32472, 32464, 32456
|
||||
dw 32448, 32440, 32432, 32424, 32415, 32407, 32399, 32390, 32381, 32372
|
||||
dw 32364, 32355, 32345, 32336, 32327, 32318, 32308, 32299, 32289, 32279
|
||||
dw 32269, 32259, 32249, 32239, 32229, 32218, 32208, 32197, 32187, 32176
|
||||
dw 32165, 32154, 32143, 32132, 32121, 32109, 32098, 32086, 32075, 32063
|
||||
dw 32051, 32039, 32027, 32015, 32003, 31990, 31978, 31965, 31953, 31940
|
||||
dw 31927, 31914, 31901, 31888, 31875, 31862, 31848, 31835, 31821, 31807
|
||||
dw 31794, 31780, 31766, 31752, 31738, 31723, 31709, 31694, 31680, 31665
|
||||
dw 31650, 31636, 31621, 31606, 31591, 31575, 31560, 31545, 31529, 31513
|
||||
dw 31498, 31482, 31466, 31450, 31434, 31418, 31401, 31385, 31368, 31352
|
||||
dw 31335, 31318, 31302, 31285, 31268, 31250, 31233, 31216, 31198, 31181
|
||||
dw 31163, 31146, 31128, 31110, 31092, 31074, 31056, 31037, 31019, 31000
|
||||
dw 30982, 30963, 30944, 30926, 30907, 30888, 30868, 30849, 30830, 30810
|
||||
dw 30791, 30771, 30752, 30732, 30712, 30692, 30672, 30652, 30631, 30611
|
||||
dw 30591, 30570, 30549, 30529, 30508, 30487, 30466, 30445, 30424, 30402
|
||||
dw 30381, 30360, 30338, 30316, 30295, 30273, 30251, 30229, 30207, 30184
|
||||
dw 30162, 30140, 30117, 30095, 30072, 30049, 30026, 30004, 29980, 29957
|
||||
dw 29934, 29911, 29887, 29864, 29840, 29817, 29793, 29769, 29745, 29721
|
||||
dw 29697, 29673, 29648, 29624, 29600, 29575, 29550, 29526, 29501, 29476
|
||||
dw 29451, 29426, 29400, 29375, 29350, 29324, 29299, 29273, 29247, 29222
|
||||
dw 29196, 29170, 29144, 29117, 29091, 29065, 29038, 29012, 28985, 28958
|
||||
dw 28932, 28905, 28878, 28851, 28823, 28796, 28769, 28741, 28714, 28686
|
||||
dw 28659, 28631, 28603, 28575, 28547, 28519, 28491, 28462, 28434, 28406
|
||||
dw 28377, 28348, 28320, 28291, 28262, 28233, 28204, 28175, 28146, 28116
|
||||
dw 28087, 28057, 28028, 27998, 27968, 27938, 27909, 27879, 27848, 27818
|
||||
dw 27788, 27758, 27727, 27697, 27666, 27635, 27605, 27574, 27543, 27512
|
||||
dw 27481, 27450, 27418, 27387, 27355, 27324, 27292, 27261, 27229, 27197
|
||||
dw 27165, 27133, 27101, 27069, 27036, 27004, 26972, 26939, 26907, 26874
|
||||
dw 26841, 26808, 26775, 26742, 26709, 26676, 26643, 26610, 26576, 26543
|
||||
dw 26509, 26475, 26442, 26408, 26374, 26340, 26306, 26272, 26238, 26203
|
||||
dw 26169, 26134, 26100, 26065, 26031, 25996, 25961, 25926, 25891, 25856
|
||||
dw 25821, 25785, 25750, 25715, 25679, 25644, 25608, 25572, 25537, 25501
|
||||
dw 25465, 25429, 25393, 25356, 25320, 25284, 25247, 25211, 25174, 25138
|
||||
dw 25101, 25064, 25027, 24990, 24953, 24916, 24879, 24842, 24804, 24767
|
||||
dw 24730, 24692, 24654, 24617, 24579, 24541, 24503, 24465, 24427, 24389
|
||||
dw 24351, 24312, 24274, 24235, 24197, 24158, 24120, 24081, 24042, 24003
|
||||
dw 23964, 23925, 23886, 23847, 23808, 23768, 23729, 23689, 23650, 23610
|
||||
dw 23571, 23531, 23491, 23451, 23411, 23371, 23331, 23291, 23251, 23210
|
||||
dw 23170, 23129, 23089, 23048, 23007, 22967, 22926, 22885, 22844, 22803
|
||||
dw 22762, 22721, 22679, 22638, 22597, 22555, 22514, 22472, 22431, 22389
|
||||
dw 22347, 22305, 22263, 22221, 22179, 22137, 22095, 22053, 22010, 21968
|
||||
dw 21925, 21883, 21840, 21798, 21755, 21712, 21669, 21626, 21583, 21540
|
||||
dw 21497, 21454, 21411, 21367, 21324, 21280, 21237, 21193, 21150, 21106
|
||||
dw 21062, 21018, 20974, 20931, 20886, 20842, 20798, 20754, 20710, 20665
|
||||
dw 20621, 20576, 20532, 20487, 20443, 20398, 20353, 20308, 20263, 20218
|
||||
dw 20173, 20128, 20083, 20038, 19993, 19947, 19902, 19856, 19811, 19765
|
||||
dw 19720, 19674, 19628, 19582, 19537, 19491, 19445, 19398, 19352, 19306
|
||||
dw 19260, 19214, 19167, 19121, 19074, 19028, 18981, 18935, 18888, 18841
|
||||
dw 18794, 18748, 18701, 18654, 18607, 18559, 18512, 18465, 18418, 18370
|
||||
dw 18323, 18276, 18228, 18181, 18133, 18085, 18038, 17990, 17942, 17894
|
||||
dw 17846, 17798, 17750, 17702, 17654, 17606, 17557, 17509, 17461, 17412
|
||||
dw 17364, 17315, 17267, 17218, 17169, 17121, 17072, 17023, 16974, 16925
|
||||
dw 16876, 16827, 16778, 16729, 16680, 16631, 16581, 16532, 16482, 16433
|
||||
dw 16383, 16334, 16284, 16235, 16185, 16135, 16085, 16036, 15986, 15936
|
||||
dw 15886, 15836, 15786, 15735, 15685, 15635, 15585, 15534, 15484, 15434
|
||||
dw 15383, 15333, 15282, 15231, 15181, 15130, 15079, 15029, 14978, 14927
|
||||
dw 14876, 14825, 14774, 14723, 14672, 14621, 14569, 14518, 14467, 14415
|
||||
dw 14364, 14313, 14261, 14210, 14158, 14107, 14055, 14003, 13952, 13900
|
||||
dw 13848, 13796, 13744, 13692, 13640, 13588, 13536, 13484, 13432, 13380
|
||||
dw 13328, 13275, 13223, 13171, 13118, 13066, 13013, 12961, 12908, 12856
|
||||
dw 12803, 12750, 12698, 12645, 12592, 12539, 12487, 12434, 12381, 12328
|
||||
dw 12275, 12222, 12169, 12115, 12062, 12009, 11956, 11903, 11849, 11796
|
||||
dw 11743, 11689, 11636, 11582, 11529, 11475, 11422, 11368, 11314, 11261
|
||||
dw 11207, 11153, 11099, 11046, 10992, 10938, 10884, 10830, 10776, 10722
|
||||
dw 10668, 10614, 10560, 10506, 10451, 10397, 10343, 10289, 10234, 10180
|
||||
dw 10126, 10071, 10017, 9962, 9908, 9853, 9799, 9744, 9689, 9635
|
||||
dw 9580, 9525, 9471, 9416, 9361, 9306, 9251, 9197, 9142, 9087
|
||||
dw 9032, 8977, 8922, 8867, 8812, 8757, 8701, 8646, 8591, 8536
|
||||
dw 8481, 8425, 8370, 8315, 8260, 8204, 8149, 8093, 8038, 7983
|
||||
dw 7927, 7872, 7816, 7760, 7705, 7649, 7594, 7538, 7482, 7427
|
||||
dw 7371, 7315, 7259, 7204, 7148, 7092, 7036, 6980, 6924, 6869
|
||||
dw 6813, 6757, 6701, 6645, 6589, 6533, 6477, 6421, 6364, 6308
|
||||
dw 6252, 6196, 6140, 6084, 6028, 5971, 5915, 5859, 5803, 5746
|
||||
dw 5690, 5634, 5577, 5521, 5465, 5408, 5352, 5295, 5239, 5182
|
||||
dw 5126, 5069, 5013, 4956, 4900, 4843, 4787, 4730, 4674, 4617
|
||||
dw 4560, 4504, 4447, 4390, 4334, 4277, 4220, 4164, 4107, 4050
|
||||
dw 3993, 3937, 3880, 3823, 3766, 3709, 3653, 3596, 3539, 3482
|
||||
dw 3425, 3368, 3311, 3254, 3197, 3141, 3084, 3027, 2970, 2913
|
||||
dw 2856, 2799, 2742, 2685, 2628, 2571, 2514, 2457, 2400, 2343
|
||||
dw 2286, 2229, 2172, 2115, 2057, 2000, 1943, 1886, 1829, 1772
|
||||
dw 1715, 1658, 1601, 1544, 1486, 1429, 1372, 1315, 1258, 1201
|
||||
dw 1144, 1086, 1029, 972, 915, 858, 801, 743, 686, 629
|
||||
dw 572, 515, 457, 400, 343, 286, 229, 172, 114, 57
|
||||
dw 0, -56, -113, -171, -228, -285, -342, -399, -456, -514
|
||||
dw -571, -628, -685, -742, -800, -857, -914, -971, -1028, -1085
|
||||
dw -1143, -1200, -1257, -1314, -1371, -1428, -1485, -1543, -1600, -1657
|
||||
dw -1714, -1771, -1828, -1885, -1942, -1999, -2056, -2114, -2171, -2228
|
||||
dw -2285, -2342, -2399, -2456, -2513, -2570, -2627, -2684, -2741, -2798
|
||||
dw -2855, -2912, -2969, -3026, -3083, -3140, -3196, -3253, -3310, -3367
|
||||
dw -3424, -3481, -3538, -3595, -3652, -3708, -3765, -3822, -3879, -3936
|
||||
dw -3992, -4049, -4106, -4163, -4219, -4276, -4333, -4389, -4446, -4503
|
||||
dw -4559, -4616, -4673, -4729, -4786, -4842, -4899, -4955, -5012, -5068
|
||||
dw -5125, -5181, -5238, -5294, -5351, -5407, -5464, -5520, -5576, -5633
|
||||
dw -5689, -5745, -5802, -5858, -5914, -5970, -6027, -6083, -6139, -6195
|
||||
dw -6251, -6307, -6363, -6420, -6476, -6532, -6588, -6644, -6700, -6756
|
||||
dw -6812, -6868, -6923, -6979, -7035, -7091, -7147, -7203, -7258, -7314
|
||||
dw -7370, -7426, -7481, -7537, -7593, -7648, -7704, -7759, -7815, -7871
|
||||
dw -7926, -7982, -8037, -8092, -8148, -8203, -8259, -8314, -8369, -8424
|
||||
dw -8480, -8535, -8590, -8645, -8700, -8756, -8811, -8866, -8921, -8976
|
||||
dw -9031, -9086, -9141, -9196, -9250, -9305, -9360, -9415, -9470, -9524
|
||||
dw -9579, -9634, -9688, -9743, -9798, -9852, -9907, -9961,-10016,-10070
|
||||
dw -10125,-10179,-10233,-10288,-10342,-10396,-10450,-10505,-10559,-10613
|
||||
dw -10667,-10721,-10775,-10829,-10883,-10937,-10991,-11045,-11098,-11152
|
||||
dw -11206,-11260,-11313,-11367,-11421,-11474,-11528,-11581,-11635,-11688
|
||||
dw -11742,-11795,-11848,-11902,-11955,-12008,-12061,-12114,-12168,-12221
|
||||
dw -12274,-12327,-12380,-12433,-12486,-12538,-12591,-12644,-12697,-12749
|
||||
dw -12802,-12855,-12907,-12960,-13012,-13065,-13117,-13170,-13222,-13274
|
||||
dw -13327,-13379,-13431,-13483,-13535,-13587,-13639,-13691,-13743,-13795
|
||||
dw -13847,-13899,-13951,-14002,-14054,-14106,-14157,-14209,-14260,-14312
|
||||
dw -14363,-14414,-14466,-14517,-14568,-14620,-14671,-14722,-14773,-14824
|
||||
dw -14875,-14926,-14977,-15028,-15078,-15129,-15180,-15230,-15281,-15332
|
||||
dw -15382,-15433,-15483,-15533,-15584,-15634,-15684,-15734,-15785,-15835
|
||||
dw -15885,-15935,-15985,-16035,-16084,-16134,-16184,-16234,-16283,-16333
|
||||
dw -16382,-16432,-16481,-16531,-16580,-16630,-16679,-16728,-16777,-16826
|
||||
dw -16875,-16924,-16973,-17022,-17071,-17120,-17168,-17217,-17266,-17314
|
||||
dw -17363,-17411,-17460,-17508,-17556,-17605,-17653,-17701,-17749,-17797
|
||||
dw -17845,-17893,-17941,-17989,-18037,-18084,-18132,-18180,-18227,-18275
|
||||
dw -18322,-18369,-18417,-18464,-18511,-18558,-18606,-18653,-18700,-18747
|
||||
dw -18793,-18840,-18887,-18934,-18980,-19027,-19073,-19120,-19166,-19213
|
||||
dw -19259,-19305,-19351,-19397,-19444,-19490,-19536,-19581,-19627,-19673
|
||||
dw -19719,-19764,-19810,-19855,-19901,-19946,-19992,-20037,-20082,-20127
|
||||
dw -20172,-20217,-20262,-20307,-20352,-20397,-20442,-20486,-20531,-20575
|
||||
dw -20620,-20664,-20709,-20753,-20797,-20841,-20885,-20930,-20973,-21017
|
||||
dw -21061,-21105,-21149,-21192,-21236,-21279,-21323,-21366,-21410,-21453
|
||||
dw -21496,-21539,-21582,-21625,-21668,-21711,-21754,-21797,-21839,-21882
|
||||
dw -21924,-21967,-22009,-22052,-22094,-22136,-22178,-22220,-22262,-22304
|
||||
dw -22346,-22388,-22430,-22471,-22513,-22554,-22596,-22637,-22678,-22720
|
||||
dw -22761,-22802,-22843,-22884,-22925,-22966,-23006,-23047,-23088,-23128
|
||||
dw -23169,-23209,-23250,-23290,-23330,-23370,-23410,-23450,-23490,-23530
|
||||
dw -23570,-23609,-23649,-23688,-23728,-23767,-23807,-23846,-23885,-23924
|
||||
dw -23963,-24002,-24041,-24080,-24119,-24157,-24196,-24234,-24273,-24311
|
||||
dw -24350,-24388,-24426,-24464,-24502,-24540,-24578,-24616,-24653,-24691
|
||||
dw -24729,-24766,-24803,-24841,-24878,-24915,-24952,-24989,-25026,-25063
|
||||
dw -25100,-25137,-25173,-25210,-25246,-25283,-25319,-25355,-25392,-25428
|
||||
dw -25464,-25500,-25536,-25571,-25607,-25643,-25678,-25714,-25749,-25784
|
||||
dw -25820,-25855,-25890,-25925,-25960,-25995,-26030,-26064,-26099,-26133
|
||||
dw -26168,-26202,-26237,-26271,-26305,-26339,-26373,-26407,-26441,-26474
|
||||
dw -26508,-26542,-26575,-26609,-26642,-26675,-26708,-26741,-26774,-26807
|
||||
dw -26840,-26873,-26906,-26938,-26971,-27003,-27035,-27068,-27100,-27132
|
||||
dw -27164,-27196,-27228,-27260,-27291,-27323,-27354,-27386,-27417,-27449
|
||||
dw -27480,-27511,-27542,-27573,-27604,-27634,-27665,-27696,-27726,-27757
|
||||
dw -27787,-27817,-27847,-27878,-27908,-27937,-27967,-27997,-28027,-28056
|
||||
dw -28086,-28115,-28145,-28174,-28203,-28232,-28261,-28290,-28319,-28347
|
||||
dw -28376,-28405,-28433,-28461,-28490,-28518,-28546,-28574,-28602,-28630
|
||||
dw -28658,-28685,-28713,-28740,-28768,-28795,-28822,-28850,-28877,-28904
|
||||
dw -28931,-28957,-28984,-29011,-29037,-29064,-29090,-29116,-29143,-29169
|
||||
dw -29195,-29221,-29246,-29272,-29298,-29323,-29349,-29374,-29399,-29425
|
||||
dw -29450,-29475,-29500,-29525,-29549,-29574,-29599,-29623,-29647,-29672
|
||||
dw -29696,-29720,-29744,-29768,-29792,-29816,-29839,-29863,-29886,-29910
|
||||
dw -29933,-29956,-29979,-30003,-30025,-30048,-30071,-30094,-30116,-30139
|
||||
dw -30161,-30183,-30206,-30228,-30250,-30272,-30294,-30315,-30337,-30359
|
||||
dw -30380,-30401,-30423,-30444,-30465,-30486,-30507,-30528,-30548,-30569
|
||||
dw -30590,-30610,-30630,-30651,-30671,-30691,-30711,-30731,-30751,-30770
|
||||
dw -30790,-30809,-30829,-30848,-30867,-30887,-30906,-30925,-30943,-30962
|
||||
dw -30981,-30999,-31018,-31036,-31055,-31073,-31091,-31109,-31127,-31145
|
||||
dw -31162,-31180,-31197,-31215,-31232,-31249,-31267,-31284,-31301,-31317
|
||||
dw -31334,-31351,-31367,-31384,-31400,-31417,-31433,-31449,-31465,-31481
|
||||
dw -31497,-31512,-31528,-31544,-31559,-31574,-31590,-31605,-31620,-31635
|
||||
dw -31649,-31664,-31679,-31693,-31708,-31722,-31737,-31751,-31765,-31779
|
||||
dw -31793,-31806,-31820,-31834,-31847,-31861,-31874,-31887,-31900,-31913
|
||||
dw -31926,-31939,-31952,-31964,-31977,-31989,-32002,-32014,-32026,-32038
|
||||
dw -32050,-32062,-32074,-32085,-32097,-32108,-32120,-32131,-32142,-32153
|
||||
dw -32164,-32175,-32186,-32196,-32207,-32217,-32228,-32238,-32248,-32258
|
||||
dw -32268,-32278,-32288,-32298,-32307,-32317,-32326,-32335,-32344,-32354
|
||||
dw -32363,-32371,-32380,-32389,-32398,-32406,-32414,-32423,-32431,-32439
|
||||
dw -32447,-32455,-32463,-32471,-32478,-32486,-32493,-32500,-32508,-32515
|
||||
dw -32522,-32529,-32536,-32542,-32549,-32555,-32562,-32568,-32574,-32580
|
||||
dw -32586,-32592,-32598,-32604,-32610,-32615,-32621,-32626,-32631,-32636
|
||||
dw -32641,-32646,-32651,-32656,-32660,-32665,-32669,-32674,-32678,-32682
|
||||
dw -32686,-32690,-32694,-32698,-32701,-32705,-32708,-32712,-32715,-32718
|
||||
dw -32721,-32724,-32727,-32730,-32732,-32735,-32737,-32740,-32742,-32744
|
||||
dw -32746,-32748,-32750,-32752,-32753,-32755,-32756,-32758,-32759,-32760
|
||||
dw -32761,-32762,-32763,-32764,-32764,-32765,-32765,-32766,-32766,-32766
|
||||
dw -32766,-32766,-32766,-32766,-32765,-32765,-32764,-32764,-32763,-32762
|
||||
dw -32761,-32760,-32759,-32758,-32756,-32755,-32753,-32752,-32750,-32748
|
||||
dw -32746,-32744,-32742,-32740,-32737,-32735,-32732,-32730,-32727,-32724
|
||||
dw -32721,-32718,-32715,-32712,-32708,-32705,-32701,-32698,-32694,-32690
|
||||
dw -32686,-32682,-32678,-32674,-32669,-32665,-32660,-32656,-32651,-32646
|
||||
dw -32641,-32636,-32631,-32626,-32621,-32615,-32610,-32604,-32598,-32592
|
||||
dw -32586,-32580,-32574,-32568,-32562,-32555,-32549,-32542,-32536,-32529
|
||||
dw -32522,-32515,-32508,-32500,-32493,-32486,-32478,-32471,-32463,-32455
|
||||
dw -32447,-32439,-32431,-32423,-32414,-32406,-32398,-32389,-32380,-32371
|
||||
dw -32363,-32354,-32344,-32335,-32326,-32317,-32307,-32298,-32288,-32278
|
||||
dw -32268,-32258,-32248,-32238,-32228,-32217,-32207,-32196,-32186,-32175
|
||||
dw -32164,-32153,-32142,-32131,-32120,-32108,-32097,-32085,-32074,-32062
|
||||
dw -32050,-32038,-32026,-32014,-32002,-31989,-31977,-31964,-31952,-31939
|
||||
dw -31926,-31913,-31900,-31887,-31874,-31861,-31847,-31834,-31820,-31806
|
||||
dw -31793,-31779,-31765,-31751,-31737,-31722,-31708,-31693,-31679,-31664
|
||||
dw -31649,-31635,-31620,-31605,-31590,-31574,-31559,-31544,-31528,-31512
|
||||
dw -31497,-31481,-31465,-31449,-31433,-31417,-31400,-31384,-31367,-31351
|
||||
dw -31334,-31317,-31301,-31284,-31267,-31249,-31232,-31215,-31197,-31180
|
||||
dw -31162,-31145,-31127,-31109,-31091,-31073,-31055,-31036,-31018,-30999
|
||||
dw -30981,-30962,-30943,-30925,-30906,-30887,-30867,-30848,-30829,-30809
|
||||
dw -30790,-30770,-30751,-30731,-30711,-30691,-30671,-30651,-30630,-30610
|
||||
dw -30590,-30569,-30548,-30528,-30507,-30486,-30465,-30444,-30423,-30401
|
||||
dw -30380,-30359,-30337,-30315,-30294,-30272,-30250,-30228,-30206,-30183
|
||||
dw -30161,-30139,-30116,-30094,-30071,-30048,-30025,-30003,-29979,-29956
|
||||
dw -29933,-29910,-29886,-29863,-29839,-29816,-29792,-29768,-29744,-29720
|
||||
dw -29696,-29672,-29647,-29623,-29599,-29574,-29549,-29525,-29500,-29475
|
||||
dw -29450,-29425,-29399,-29374,-29349,-29323,-29298,-29272,-29246,-29221
|
||||
dw -29195,-29169,-29143,-29116,-29090,-29064,-29037,-29011,-28984,-28957
|
||||
dw -28931,-28904,-28877,-28850,-28822,-28795,-28768,-28740,-28713,-28685
|
||||
dw -28658,-28630,-28602,-28574,-28546,-28518,-28490,-28461,-28433,-28405
|
||||
dw -28376,-28347,-28319,-28290,-28261,-28232,-28203,-28174,-28145,-28115
|
||||
dw -28086,-28056,-28027,-27997,-27967,-27937,-27908,-27878,-27847,-27817
|
||||
dw -27787,-27757,-27726,-27696,-27665,-27634,-27604,-27573,-27542,-27511
|
||||
dw -27480,-27449,-27417,-27386,-27354,-27323,-27291,-27260,-27228,-27196
|
||||
dw -27164,-27132,-27100,-27068,-27035,-27003,-26971,-26938,-26906,-26873
|
||||
dw -26840,-26807,-26774,-26741,-26708,-26675,-26642,-26609,-26575,-26542
|
||||
dw -26508,-26474,-26441,-26407,-26373,-26339,-26305,-26271,-26237,-26202
|
||||
dw -26168,-26133,-26099,-26064,-26030,-25995,-25960,-25925,-25890,-25855
|
||||
dw -25820,-25784,-25749,-25714,-25678,-25643,-25607,-25571,-25536,-25500
|
||||
dw -25464,-25428,-25392,-25355,-25319,-25283,-25246,-25210,-25173,-25137
|
||||
dw -25100,-25063,-25026,-24989,-24952,-24915,-24878,-24841,-24803,-24766
|
||||
dw -24729,-24691,-24653,-24616,-24578,-24540,-24502,-24464,-24426,-24388
|
||||
dw -24350,-24311,-24273,-24234,-24196,-24157,-24119,-24080,-24041,-24002
|
||||
dw -23963,-23924,-23885,-23846,-23807,-23767,-23728,-23688,-23649,-23609
|
||||
dw -23570,-23530,-23490,-23450,-23410,-23370,-23330,-23290,-23250,-23209
|
||||
dw -23169,-23128,-23088,-23047,-23006,-22966,-22925,-22884,-22843,-22802
|
||||
dw -22761,-22720,-22678,-22637,-22596,-22554,-22513,-22471,-22430,-22388
|
||||
dw -22346,-22304,-22262,-22220,-22178,-22136,-22094,-22052,-22009,-21967
|
||||
dw -21924,-21882,-21839,-21797,-21754,-21711,-21668,-21625,-21582,-21539
|
||||
dw -21496,-21453,-21410,-21366,-21323,-21279,-21236,-21192,-21149,-21105
|
||||
dw -21061,-21017,-20973,-20930,-20885,-20841,-20797,-20753,-20709,-20664
|
||||
dw -20620,-20575,-20531,-20486,-20442,-20397,-20352,-20307,-20262,-20217
|
||||
dw -20172,-20127,-20082,-20037,-19992,-19946,-19901,-19855,-19810,-19764
|
||||
dw -19719,-19673,-19627,-19581,-19536,-19490,-19444,-19397,-19351,-19305
|
||||
dw -19259,-19213,-19166,-19120,-19073,-19027,-18980,-18934,-18887,-18840
|
||||
dw -18793,-18747,-18700,-18653,-18606,-18558,-18511,-18464,-18417,-18369
|
||||
dw -18322,-18275,-18227,-18180,-18132,-18084,-18037,-17989,-17941,-17893
|
||||
dw -17845,-17797,-17749,-17701,-17653,-17605,-17556,-17508,-17460,-17411
|
||||
dw -17363,-17314,-17266,-17217,-17168,-17120,-17071,-17022,-16973,-16924
|
||||
dw -16875,-16826,-16777,-16728,-16679,-16630,-16580,-16531,-16481,-16432
|
||||
dw -16383,-16333,-16283,-16234,-16184,-16134,-16084,-16035,-15985,-15935
|
||||
dw -15885,-15835,-15785,-15734,-15684,-15634,-15584,-15533,-15483,-15433
|
||||
dw -15382,-15332,-15281,-15230,-15180,-15129,-15078,-15028,-14977,-14926
|
||||
dw -14875,-14824,-14773,-14722,-14671,-14620,-14568,-14517,-14466,-14414
|
||||
dw -14363,-14312,-14260,-14209,-14157,-14106,-14054,-14002,-13951,-13899
|
||||
dw -13847,-13795,-13743,-13691,-13639,-13587,-13535,-13483,-13431,-13379
|
||||
dw -13327,-13274,-13222,-13170,-13117,-13065,-13012,-12960,-12907,-12855
|
||||
dw -12802,-12749,-12697,-12644,-12591,-12538,-12486,-12433,-12380,-12327
|
||||
dw -12274,-12221,-12168,-12114,-12061,-12008,-11955,-11902,-11848,-11795
|
||||
dw -11742,-11688,-11635,-11581,-11528,-11474,-11421,-11367,-11313,-11260
|
||||
dw -11206,-11152,-11098,-11045,-10991,-10937,-10883,-10829,-10775,-10721
|
||||
dw -10667,-10613,-10559,-10505,-10450,-10396,-10342,-10288,-10233,-10179
|
||||
dw -10125,-10070,-10016, -9961, -9907, -9852, -9798, -9743, -9688, -9634
|
||||
dw -9579, -9524, -9470, -9415, -9360, -9305, -9250, -9196, -9141, -9086
|
||||
dw -9031, -8976, -8921, -8866, -8811, -8756, -8700, -8645, -8590, -8535
|
||||
dw -8480, -8424, -8369, -8314, -8259, -8203, -8148, -8092, -8037, -7982
|
||||
dw -7926, -7871, -7815, -7759, -7704, -7648, -7593, -7537, -7481, -7426
|
||||
dw -7370, -7314, -7258, -7203, -7147, -7091, -7035, -6979, -6923, -6868
|
||||
dw -6812, -6756, -6700, -6644, -6588, -6532, -6476, -6420, -6363, -6307
|
||||
dw -6251, -6195, -6139, -6083, -6027, -5970, -5914, -5858, -5802, -5745
|
||||
dw -5689, -5633, -5576, -5520, -5464, -5407, -5351, -5294, -5238, -5181
|
||||
dw -5125, -5068, -5012, -4955, -4899, -4842, -4786, -4729, -4673, -4616
|
||||
dw -4559, -4503, -4446, -4389, -4333, -4276, -4219, -4163, -4106, -4049
|
||||
dw -3992, -3936, -3879, -3822, -3765, -3708, -3652, -3595, -3538, -3481
|
||||
dw -3424, -3367, -3310, -3253, -3196, -3140, -3083, -3026, -2969, -2912
|
||||
dw -2855, -2798, -2741, -2684, -2627, -2570, -2513, -2456, -2399, -2342
|
||||
dw -2285, -2228, -2171, -2114, -2056, -1999, -1942, -1885, -1828, -1771
|
||||
dw -1714, -1657, -1600, -1543, -1485, -1428, -1371, -1314, -1257, -1200
|
||||
dw -1143, -1085, -1028, -971, -914, -857, -800, -742, -685, -628
|
||||
dw -571, -514, -456, -399, -342, -285, -228, -171, -113, -56;(cosine continued)
|
||||
|
||||
dw 0, 57, 114, 172, 229, 286, 343, 400, 457, 515
|
||||
dw 572, 629, 686, 743, 801, 858, 915, 972, 1029, 1086
|
||||
dw 1144, 1201, 1258, 1315, 1372, 1429, 1486, 1544, 1601, 1658
|
||||
dw 1715, 1772, 1829, 1886, 1943, 2000, 2057, 2115, 2172, 2229
|
||||
dw 2286, 2343, 2400, 2457, 2514, 2571, 2628, 2685, 2742, 2799
|
||||
dw 2856, 2913, 2970, 3027, 3084, 3141, 3197, 3254, 3311, 3368
|
||||
dw 3425, 3482, 3539, 3596, 3653, 3709, 3766, 3823, 3880, 3937
|
||||
dw 3993, 4050, 4107, 4164, 4220, 4277, 4334, 4390, 4447, 4504
|
||||
dw 4560, 4617, 4674, 4730, 4787, 4843, 4900, 4956, 5013, 5069
|
||||
dw 5126, 5182, 5239, 5295, 5352, 5408, 5465, 5521, 5577, 5634
|
||||
dw 5690, 5746, 5803, 5859, 5915, 5971, 6028, 6084, 6140, 6196
|
||||
dw 6252, 6308, 6364, 6421, 6477, 6533, 6589, 6645, 6701, 6757
|
||||
dw 6813, 6869, 6924, 6980, 7036, 7092, 7148, 7204, 7259, 7315
|
||||
dw 7371, 7427, 7482, 7538, 7594, 7649, 7705, 7760, 7816, 7872
|
||||
dw 7927, 7983, 8038, 8093, 8149, 8204, 8260, 8315, 8370, 8425
|
||||
dw 8481, 8536, 8591, 8646, 8701, 8757, 8812, 8867, 8922, 8977
|
||||
dw 9032, 9087, 9142, 9197, 9251, 9306, 9361, 9416, 9471, 9525
|
||||
dw 9580, 9635, 9689, 9744, 9799, 9853, 9908, 9962, 10017, 10071
|
||||
dw 10126, 10180, 10234, 10289, 10343, 10397, 10451, 10506, 10560, 10614
|
||||
dw 10668, 10722, 10776, 10830, 10884, 10938, 10992, 11046, 11099, 11153
|
||||
dw 11207, 11261, 11314, 11368, 11422, 11475, 11529, 11582, 11636, 11689
|
||||
dw 11743, 11796, 11849, 11903, 11956, 12009, 12062, 12115, 12169, 12222
|
||||
dw 12275, 12328, 12381, 12434, 12487, 12539, 12592, 12645, 12698, 12750
|
||||
dw 12803, 12856, 12908, 12961, 13013, 13066, 13118, 13171, 13223, 13275
|
||||
dw 13328, 13380, 13432, 13484, 13536, 13588, 13640, 13692, 13744, 13796
|
||||
dw 13848, 13900, 13952, 14003, 14055, 14107, 14158, 14210, 14261, 14313
|
||||
dw 14364, 14415, 14467, 14518, 14569, 14621, 14672, 14723, 14774, 14825
|
||||
dw 14876, 14927, 14978, 15029, 15079, 15130, 15181, 15231, 15282, 15333
|
||||
dw 15383, 15434, 15484, 15534, 15585, 15635, 15685, 15735, 15786, 15836
|
||||
dw 15886, 15936, 15986, 16036, 16085, 16135, 16185, 16235, 16284, 16334
|
||||
dw 16383, 16433, 16482, 16532, 16581, 16631, 16680, 16729, 16778, 16827
|
||||
dw 16876, 16925, 16974, 17023, 17072, 17121, 17169, 17218, 17267, 17315
|
||||
dw 17364, 17412, 17461, 17509, 17557, 17606, 17654, 17702, 17750, 17798
|
||||
dw 17846, 17894, 17942, 17990, 18038, 18085, 18133, 18181, 18228, 18276
|
||||
dw 18323, 18370, 18418, 18465, 18512, 18559, 18607, 18654, 18701, 18748
|
||||
dw 18794, 18841, 18888, 18935, 18981, 19028, 19074, 19121, 19167, 19214
|
||||
dw 19260, 19306, 19352, 19398, 19445, 19491, 19537, 19582, 19628, 19674
|
||||
dw 19720, 19765, 19811, 19856, 19902, 19947, 19993, 20038, 20083, 20128
|
||||
dw 20173, 20218, 20263, 20308, 20353, 20398, 20443, 20487, 20532, 20576
|
||||
dw 20621, 20665, 20710, 20754, 20798, 20842, 20886, 20931, 20974, 21018
|
||||
dw 21062, 21106, 21150, 21193, 21237, 21280, 21324, 21367, 21411, 21454
|
||||
dw 21497, 21540, 21583, 21626, 21669, 21712, 21755, 21798, 21840, 21883
|
||||
dw 21925, 21968, 22010, 22053, 22095, 22137, 22179, 22221, 22263, 22305
|
||||
dw 22347, 22389, 22431, 22472, 22514, 22555, 22597, 22638, 22679, 22721
|
||||
dw 22762, 22803, 22844, 22885, 22926, 22967, 23007, 23048, 23089, 23129
|
||||
dw 23170, 23210, 23251, 23291, 23331, 23371, 23411, 23451, 23491, 23531
|
||||
dw 23571, 23610, 23650, 23689, 23729, 23768, 23808, 23847, 23886, 23925
|
||||
dw 23964, 24003, 24042, 24081, 24120, 24158, 24197, 24235, 24274, 24312
|
||||
dw 24351, 24389, 24427, 24465, 24503, 24541, 24579, 24617, 24654, 24692
|
||||
dw 24730, 24767, 24804, 24842, 24879, 24916, 24953, 24990, 25027, 25064
|
||||
dw 25101, 25138, 25174, 25211, 25247, 25284, 25320, 25356, 25393, 25429
|
||||
dw 25465, 25501, 25537, 25572, 25608, 25644, 25679, 25715, 25750, 25785
|
||||
dw 25821, 25856, 25891, 25926, 25961, 25996, 26031, 26065, 26100, 26134
|
||||
dw 26169, 26203, 26238, 26272, 26306, 26340, 26374, 26408, 26442, 26475
|
||||
dw 26509, 26543, 26576, 26610, 26643, 26676, 26709, 26742, 26775, 26808
|
||||
dw 26841, 26874, 26907, 26939, 26972, 27004, 27036, 27069, 27101, 27133
|
||||
dw 27165, 27197, 27229, 27261, 27292, 27324, 27355, 27387, 27418, 27450
|
||||
dw 27481, 27512, 27543, 27574, 27605, 27635, 27666, 27697, 27727, 27758
|
||||
dw 27788, 27818, 27848, 27879, 27909, 27938, 27968, 27998, 28028, 28057
|
||||
dw 28087, 28116, 28146, 28175, 28204, 28233, 28262, 28291, 28320, 28348
|
||||
dw 28377, 28406, 28434, 28462, 28491, 28519, 28547, 28575, 28603, 28631
|
||||
dw 28659, 28686, 28714, 28741, 28769, 28796, 28823, 28851, 28878, 28905
|
||||
dw 28932, 28958, 28985, 29012, 29038, 29065, 29091, 29117, 29144, 29170
|
||||
dw 29196, 29222, 29247, 29273, 29299, 29324, 29350, 29375, 29400, 29426
|
||||
dw 29451, 29476, 29501, 29526, 29550, 29575, 29600, 29624, 29648, 29673
|
||||
dw 29697, 29721, 29745, 29769, 29793, 29817, 29840, 29864, 29887, 29911
|
||||
dw 29934, 29957, 29980, 30004, 30026, 30049, 30072, 30095, 30117, 30140
|
||||
dw 30162, 30184, 30207, 30229, 30251, 30273, 30295, 30316, 30338, 30360
|
||||
dw 30381, 30402, 30424, 30445, 30466, 30487, 30508, 30529, 30549, 30570
|
||||
dw 30591, 30611, 30631, 30652, 30672, 30692, 30712, 30732, 30752, 30771
|
||||
dw 30791, 30810, 30830, 30849, 30868, 30888, 30907, 30926, 30944, 30963
|
||||
dw 30982, 31000, 31019, 31037, 31056, 31074, 31092, 31110, 31128, 31146
|
||||
dw 31163, 31181, 31198, 31216, 31233, 31250, 31268, 31285, 31302, 31318
|
||||
dw 31335, 31352, 31368, 31385, 31401, 31418, 31434, 31450, 31466, 31482
|
||||
dw 31498, 31513, 31529, 31545, 31560, 31575, 31591, 31606, 31621, 31636
|
||||
dw 31650, 31665, 31680, 31694, 31709, 31723, 31738, 31752, 31766, 31780
|
||||
dw 31794, 31807, 31821, 31835, 31848, 31862, 31875, 31888, 31901, 31914
|
||||
dw 31927, 31940, 31953, 31965, 31978, 31990, 32003, 32015, 32027, 32039
|
||||
dw 32051, 32063, 32075, 32086, 32098, 32109, 32121, 32132, 32143, 32154
|
||||
dw 32165, 32176, 32187, 32197, 32208, 32218, 32229, 32239, 32249, 32259
|
||||
dw 32269, 32279, 32289, 32299, 32308, 32318, 32327, 32336, 32345, 32355
|
||||
dw 32364, 32372, 32381, 32390, 32399, 32407, 32415, 32424, 32432, 32440
|
||||
dw 32448, 32456, 32464, 32472, 32479, 32487, 32494, 32501, 32509, 32516
|
||||
dw 32523, 32530, 32537, 32543, 32550, 32556, 32563, 32569, 32575, 32581
|
||||
dw 32587, 32593, 32599, 32605, 32611, 32616, 32622, 32627, 32632, 32637
|
||||
dw 32642, 32647, 32652, 32657, 32661, 32666, 32670, 32675, 32679, 32683
|
||||
dw 32687, 32691, 32695, 32699, 32702, 32706, 32709, 32713, 32716, 32719
|
||||
dw 32722, 32725, 32728, 32731, 32733, 32736, 32738, 32741, 32743, 32745
|
||||
dw 32747, 32749, 32751, 32753, 32754, 32756, 32757, 32759, 32760, 32761
|
||||
dw 32762, 32763, 32764, 32765, 32765, 32766, 32766, 32767, 32767, 32767
|
||||
ALIGN 4
|
||||
dd -99999999
|
||||
tantable32 LABEL DWORD
|
||||
dd 0, 114, 229, 343, 458, 572, 686, 801, 915, 1030
|
||||
dd 1144, 1258, 1373, 1487, 1602, 1716, 1831, 1945, 2060, 2174
|
||||
dd 2289, 2403, 2518, 2632, 2747, 2861, 2976, 3091, 3205, 3320
|
||||
dd 3435, 3549, 3664, 3779, 3894, 4008, 4123, 4238, 4353, 4468
|
||||
dd 4583, 4698, 4813, 4928, 5043, 5158, 5273, 5388, 5503, 5618
|
||||
dd 5734, 5849, 5964, 6080, 6195, 6310, 6426, 6541, 6657, 6772
|
||||
dd 6888, 7004, 7119, 7235, 7351, 7467, 7583, 7699, 7815, 7931
|
||||
dd 8047, 8163, 8279, 8395, 8512, 8628, 8744, 8861, 8977, 9094
|
||||
dd 9210, 9327, 9444, 9561, 9678, 9794, 9911, 10028, 10146, 10263
|
||||
dd 10380, 10497, 10615, 10732, 10849, 10967, 11085, 11202, 11320, 11438
|
||||
dd 11556, 11674, 11792, 11910, 12028, 12146, 12265, 12383, 12502, 12620
|
||||
dd 12739, 12858, 12976, 13095, 13214, 13333, 13453, 13572, 13691, 13811
|
||||
dd 13930, 14050, 14169, 14289, 14409, 14529, 14649, 14769, 14889, 15010
|
||||
dd 15130, 15251, 15371, 15492, 15613, 15734, 15855, 15976, 16097, 16219
|
||||
dd 16340, 16462, 16583, 16705, 16827, 16949, 17071, 17193, 17315, 17438
|
||||
dd 17560, 17683, 17806, 17929, 18052, 18175, 18298, 18421, 18545, 18668
|
||||
dd 18792, 18916, 19040, 19164, 19288, 19413, 19537, 19662, 19786, 19911
|
||||
dd 20036, 20162, 20287, 20412, 20538, 20663, 20789, 20915, 21041, 21168
|
||||
dd 21294, 21420, 21547, 21674, 21801, 21928, 22055, 22183, 22310, 22438
|
||||
dd 22566, 22694, 22822, 22950, 23079, 23208, 23336, 23465, 23594, 23724
|
||||
dd 23853, 23983, 24113, 24243, 24373, 24503, 24633, 24764, 24895, 25026
|
||||
dd 25157, 25288, 25420, 25551, 25683, 25815, 25948, 26080, 26213, 26345
|
||||
dd 26478, 26611, 26745, 26878, 27012, 27146, 27280, 27414, 27549, 27683
|
||||
dd 27818, 27953, 28089, 28224, 28360, 28496, 28632, 28768, 28905, 29042
|
||||
dd 29179, 29316, 29453, 29591, 29728, 29866, 30005, 30143, 30282, 30421
|
||||
dd 30560, 30699, 30839, 30979, 31119, 31259, 31400, 31540, 31681, 31823
|
||||
dd 31964, 32106, 32248, 32390, 32532, 32675, 32818, 32961, 33105, 33248
|
||||
dd 33392, 33536, 33681, 33826, 33971, 34116, 34261, 34407, 34553, 34700
|
||||
dd 34846, 34993, 35140, 35288, 35435, 35583, 35731, 35880, 36029, 36178
|
||||
dd 36327, 36477, 36627, 36777, 36928, 37078, 37230, 37381, 37533, 37685
|
||||
dd 37837, 37990, 38143, 38296, 38450, 38604, 38758, 38912, 39067, 39222
|
||||
dd 39378, 39534, 39690, 39847, 40003, 40161, 40318, 40476, 40634, 40793
|
||||
dd 40951, 41111, 41270, 41430, 41590, 41751, 41912, 42073, 42235, 42397
|
||||
dd 42560, 42722, 42886, 43049, 43213, 43377, 43542, 43707, 43873, 44038
|
||||
dd 44205, 44371, 44538, 44706, 44873, 45042, 45210, 45379, 45549, 45719
|
||||
dd 45889, 46059, 46231, 46402, 46574, 46746, 46919, 47092, 47266, 47440
|
||||
dd 47615, 47790, 47965, 48141, 48317, 48494, 48671, 48849, 49027, 49206
|
||||
dd 49385, 49564, 49745, 49925, 50106, 50288, 50470, 50652, 50835, 51018
|
||||
dd 51202, 51387, 51572, 51757, 51943, 52130, 52317, 52504, 52692, 52881
|
||||
dd 53070, 53260, 53450, 53641, 53832, 54024, 54216, 54409, 54603, 54797
|
||||
dd 54991, 55186, 55382, 55579, 55776, 55973, 56171, 56370, 56569, 56769
|
||||
dd 56970, 57171, 57372, 57575, 57778, 57981, 58186, 58390, 58596, 58802
|
||||
dd 59009, 59216, 59424, 59633, 59843, 60053, 60263, 60475, 60687, 60900
|
||||
dd 61113, 61328, 61542, 61758, 61974, 62191, 62409, 62628, 62847, 63067
|
||||
dd 63287, 63509, 63731, 63954, 64178, 64402, 64627, 64853, 65080, 65308
|
||||
dd 65536, 65765, 65995, 66226, 66458, 66690, 66923, 67157, 67392, 67628
|
||||
dd 67865, 68102, 68340, 68580, 68820, 69061, 69302, 69545, 69789, 70033
|
||||
dd 70279, 70525, 70772, 71021, 71270, 71520, 71771, 72023, 72276, 72530
|
||||
dd 72785, 73041, 73298, 73556, 73815, 74075, 74336, 74598, 74861, 75125
|
||||
dd 75391, 75657, 75924, 76193, 76462, 76733, 77005, 77277, 77551, 77827
|
||||
dd 78103, 78380, 78659, 78938, 79219, 79502, 79785, 80069, 80355, 80642
|
||||
dd 80930, 81220, 81510, 81802, 82096, 82390, 82686, 82983, 83281, 83581
|
||||
dd 83882, 84185, 84489, 84794, 85100, 85408, 85718, 86028, 86340, 86654
|
||||
dd 86969, 87286, 87604, 87923, 88244, 88567, 88891, 89216, 89544, 89872
|
||||
dd 90203, 90534, 90868, 91203, 91540, 91878, 92218, 92560, 92903, 93248
|
||||
dd 93595, 93944, 94294, 94646, 95000, 95355, 95713, 96072, 96433, 96796
|
||||
dd 97161, 97528, 97897, 98267, 98640, 99014, 99391, 99769, 100150, 100532
|
||||
dd 100917, 101303, 101692, 102083, 102476, 102871, 103268, 103668, 104069, 104473
|
||||
dd 104880, 105288, 105699, 106112, 106527, 106945, 107365, 107788, 108213, 108640
|
||||
dd 109070, 109503, 109938, 110375, 110815, 111258, 111703, 112151, 112602, 113056
|
||||
dd 113512, 113971, 114432, 114897, 115364, 115834, 116308, 116784, 117263, 117745
|
||||
dd 118230, 118718, 119210, 119704, 120202, 120702, 121206, 121714, 122224, 122738
|
||||
dd 123255, 123776, 124300, 124828, 125359, 125893, 126432, 126974, 127519, 128069
|
||||
dd 128622, 129179, 129739, 130304, 130872, 131445, 132021, 132602, 133187, 133776
|
||||
dd 134369, 134966, 135568, 136174, 136784, 137399, 138018, 138642, 139271, 139904
|
||||
dd 140542, 141185, 141833, 142485, 143143, 143806, 144473, 145146, 145824, 146508
|
||||
dd 147196, 147890, 148590, 149295, 150006, 150722, 151445, 152173, 152907, 153647
|
||||
dd 154393, 155145, 155904, 156669, 157440, 158218, 159002, 159793, 160591, 161396
|
||||
dd 162207, 163026, 163852, 164685, 165525, 166373, 167228, 168091, 168962, 169841
|
||||
dd 170727, 171622, 172525, 173436, 174356, 175284, 176221, 177167, 178122, 179086
|
||||
dd 180059, 181041, 182033, 183035, 184046, 185068, 186100, 187141, 188194, 189257
|
||||
dd 190330, 191415, 192511, 193618, 194736, 195866, 197008, 198163, 199329, 200508
|
||||
dd 201699, 202903, 204121, 205351, 206596, 207854, 209126, 210412, 211713, 213028
|
||||
dd 214359, 215704, 217066, 218443, 219836, 221246, 222672, 224116, 225576, 227055
|
||||
dd 228551, 230066, 231599, 233152, 234724, 236315, 237927, 239559, 241213, 242887
|
||||
dd 244584, 246302, 248044, 249808, 251597, 253409, 255246, 257108, 258996, 260910
|
||||
dd 262851, 264819, 266815, 268839, 270893, 272977, 275091, 277237, 279414, 281624
|
||||
dd 283868, 286145, 288458, 290806, 293191, 295614, 298075, 300575, 303116, 305698
|
||||
dd 308323, 310991, 313703, 316461, 319266, 322120, 325022, 327976, 330981, 334040
|
||||
dd 337153, 340324, 343552, 346839, 350189, 353601, 357078, 360621, 364234, 367917
|
||||
dd 371673, 375504, 379413, 383401, 387472, 391628, 395871, 400204, 404631, 409155
|
||||
dd 413778, 418504, 423337, 428280, 433337, 438512, 443809, 449233, 454788, 460480
|
||||
dd 466313, 472292, 478424, 484715, 491169, 497795, 504599, 511589, 518771, 526154
|
||||
dd 533748, 541560, 549601, 557881, 566411, 575202, 584267, 593618, 603269, 613236
|
||||
dd 623533, 634179, 645190, 656586, 668388, 680617, 693298, 706457, 720119, 734316
|
||||
dd 749080, 764444, 780447, 797130, 814536, 832714, 851716, 871601, 892431, 914274
|
||||
dd 937208, 961317, 986692, 1013437, 1041665, 1071504, 1103096, 1136601, 1172197, 1210088
|
||||
dd 1250501, 1293700, 1339981, 1389688, 1443215, 1501021, 1563642, 1631704, 1705950, 1787264
|
||||
dd 1876705, 1975558, 2085389, 2208138, 2346225, 2502719, 2681563, 2887917, 3128656, 3413159
|
||||
dd 3754555, 4171808, 4693365, 5363928, 6257998, 7509682, 9387188, 12516340, 18774605, 37549324
|
||||
dd 1024-900 dup(99999999)
|
||||
405
HARD/VNEW.ASM
Normal file
405
HARD/VNEW.ASM
Normal file
|
|
@ -0,0 +1,405 @@
|
|||
|
||||
;!!!!!! TRANSPARENT NEW COPPER !!!!!!
|
||||
|
||||
NROWS equ 128
|
||||
MAXLINES equ 512
|
||||
ndp0 dw 0 ;toggling pointer inside newdata1
|
||||
ndp dw 0 ;pointer inside newdata1
|
||||
nec dw 0 ;pointer to next free in ne
|
||||
nlc dw 0 ;items in horizontal list
|
||||
newvram dw 0 ;<-gs:vram
|
||||
ALIGN 4
|
||||
nep dw NROWS dup(0)
|
||||
ALIGN 4
|
||||
ne db MAXLINES dup(16 dup(0))
|
||||
NE_X equ 0 ;dd
|
||||
NE_Y1 equ 4 ;dw
|
||||
NE_Y2 equ 6 ;dw
|
||||
NE_COLOR equ 8 ;dw
|
||||
NE_NEXT equ 10 ;dw
|
||||
NE_DX equ 12 ;dd
|
||||
ALIGN 4
|
||||
nl db 256 dup(0)
|
||||
|
||||
public __ndebug1
|
||||
__ndebug1 dw 0
|
||||
|
||||
ng_init PROC NEAR
|
||||
LOADGS
|
||||
mov ax,gs:vram
|
||||
mov cs:newvram,ax
|
||||
mov cs:nec,OFFSET ne
|
||||
mov ax,cs:ndp0
|
||||
xor ax,8000h
|
||||
mov cs:ndp0,ax
|
||||
mov cs:ndp,ax
|
||||
mov cx,NROWS/2
|
||||
mov ax,cs
|
||||
mov es,ax
|
||||
xor eax,eax
|
||||
mov di,OFFSET nep
|
||||
rep stosd
|
||||
mov ax,SEG newdata1
|
||||
mov ds,ax
|
||||
cmp word ptr ds:[0],0
|
||||
jne @@1
|
||||
mov word ptr ds:[0],-1
|
||||
@@1: cmp word ptr ds:[8000h],0
|
||||
jne @@2
|
||||
mov word ptr ds:[8000h],-1
|
||||
@@2: ret
|
||||
ng_init ENDP
|
||||
|
||||
ALIGN 2
|
||||
yrow dw 0
|
||||
yrowad dw 0
|
||||
siend dw 0
|
||||
|
||||
ng_pass3 PROC NEAR
|
||||
mov ax,SEG newdata1
|
||||
mov ds,ax
|
||||
mov ax,cs:newvram
|
||||
mov es,ax
|
||||
xor di,di
|
||||
mov si,cs:ndp0
|
||||
mov bx,si
|
||||
xor bx,8000h
|
||||
xor ax,ax
|
||||
;si=new bx=last
|
||||
;cx=newpos dx=lastpos
|
||||
;al=newcol ah=lastcol
|
||||
mov edx,ds:[bx]
|
||||
add bx,4
|
||||
mov ecx,ds:[si]
|
||||
add si,4
|
||||
;
|
||||
@@21: cmp dx,cx
|
||||
jb @@23
|
||||
je @@22
|
||||
;cx<dx
|
||||
cmp al,ah
|
||||
je @@31
|
||||
push cx
|
||||
sub cx,di
|
||||
cmp cx,4
|
||||
jae @@r1
|
||||
rep stosb
|
||||
pop cx
|
||||
@@31: mov di,cx
|
||||
shr ecx,16
|
||||
xor al,cl
|
||||
mov ecx,ds:[si]
|
||||
add si,4
|
||||
jmp @@21
|
||||
@@r1: push ax
|
||||
mov ah,al
|
||||
test di,1
|
||||
jz @@r11
|
||||
dec cx
|
||||
stosb
|
||||
@@r11: shr cx,1
|
||||
rep stosw
|
||||
adc cx,cx
|
||||
rep stosb
|
||||
pop ax
|
||||
pop cx
|
||||
jmp @@31
|
||||
@@22: ;cx=dx
|
||||
cmp cx,-1
|
||||
je @@20
|
||||
@@23: ;dx<cx
|
||||
cmp al,ah
|
||||
je @@32
|
||||
push cx
|
||||
mov cx,dx
|
||||
sub cx,di
|
||||
cmp cx,4
|
||||
jae @@r2
|
||||
rep stosb
|
||||
pop cx
|
||||
@@32: mov di,dx
|
||||
shr edx,16
|
||||
xor ah,dl
|
||||
mov edx,ds:[bx]
|
||||
add bx,4
|
||||
jmp @@21
|
||||
@@r2: push ax
|
||||
mov ah,al
|
||||
test di,1
|
||||
jz @@r21
|
||||
dec cx
|
||||
stosb
|
||||
@@r21: shr cx,1
|
||||
rep stosw
|
||||
adc cx,cx
|
||||
rep stosb
|
||||
pop ax
|
||||
pop cx
|
||||
jmp @@32
|
||||
@@20: ret
|
||||
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
mov ax,SEG newdata1
|
||||
mov ds,ax
|
||||
xor si,si
|
||||
xor di,di
|
||||
xor ax,ax
|
||||
mov dx,cs:ndp
|
||||
@@1: mov cx,ds:[si]
|
||||
sub cx,di
|
||||
rep stosb
|
||||
xor al,ds:[si+2]
|
||||
add si,4
|
||||
cmp si,dx
|
||||
jb @@1
|
||||
ret
|
||||
ng_pass3 ENDP
|
||||
|
||||
ng_pass2 PROC NEAR
|
||||
mov bp,OFFSET nep
|
||||
mov di,OFFSET nl
|
||||
mov cx,NROWS
|
||||
mov cs:yrow,0
|
||||
mov cs:yrowad,0
|
||||
@@1: push cx
|
||||
;di=pointer to this row list end
|
||||
;bp=pointer to nep
|
||||
|
||||
;add new items this row
|
||||
mov bx,cs:[bp]
|
||||
jmp @@3
|
||||
@@2: mov cs:[di],bx
|
||||
add di,2
|
||||
mov bx,cs:[bx+NE_NEXT]
|
||||
@@3: cmp bx,0
|
||||
jne @@2
|
||||
|
||||
;sort this row (insertion sort)
|
||||
push bp
|
||||
push di
|
||||
mov bp,di
|
||||
mov si,OFFSET nl+2
|
||||
jmp @@4
|
||||
@@5: ;for(k=1;k<listc;k++) { // k=SI
|
||||
mov bx,cs:[si] ;bx=list[k]
|
||||
mov dx,bx ;dx=i
|
||||
mov eax,cs:[bx+NE_X] ;eax=x
|
||||
mov di,si
|
||||
sub di,2 ;di=j
|
||||
jmp @@6
|
||||
;;;for(j=k-1;j>=0 && x<e[list[j]].x;j--) {
|
||||
@@9: mov cs:[di+2],bx ;bx=cs:di
|
||||
sub di,2
|
||||
@@6: cmp di,OFFSET nl
|
||||
jge @@8
|
||||
jmp @@7
|
||||
@@8: mov bx,cs:[di]
|
||||
cmp eax,cs:[bx+NE_X]
|
||||
jl @@9
|
||||
@@7: ;;;}
|
||||
mov cs:[di+2],dx
|
||||
add si,2
|
||||
@@4: cmp si,bp
|
||||
jb @@5
|
||||
;}
|
||||
pop di
|
||||
;bp=nl end
|
||||
|
||||
;process list & kill finished lines
|
||||
|
||||
mov cs:siend,bp
|
||||
mov ax,SEG newdata1
|
||||
mov fs,ax
|
||||
mov bp,cs:ndp
|
||||
mov dx,cs:yrow
|
||||
mov cx,8000h
|
||||
mov si,OFFSET nl
|
||||
mov di,si
|
||||
jmp @@10
|
||||
@@11: mov bx,cs:[si]
|
||||
cmp dx,cs:[bx+NE_Y2]
|
||||
jge @@12
|
||||
mov cs:[di],bx
|
||||
add di,2
|
||||
mov eax,cs:[bx+NE_X]
|
||||
push eax
|
||||
add eax,cs:[bx+NE_DX]
|
||||
;sub dword ptr cs:[bx+NE_DX],500
|
||||
mov cs:[bx+NE_X],eax
|
||||
pop eax
|
||||
shr eax,16
|
||||
;clip X
|
||||
cmp ax,319
|
||||
jle @@15
|
||||
mov ax,319
|
||||
@@15: cmp ax,1
|
||||
jge @@16
|
||||
mov ax,1
|
||||
@@16: ;
|
||||
cmp cx,ax
|
||||
jne @@14
|
||||
;same x pos
|
||||
mov ax,cs:[bx+NE_COLOR]
|
||||
xor fs:[bp-2],ax
|
||||
jmp @@12
|
||||
@@14: ;new x pos
|
||||
add ax,cs:yrowad
|
||||
mov fs:[bp+0],ax
|
||||
mov ax,cs:[bx+NE_COLOR]
|
||||
mov fs:[bp+2],ax
|
||||
add bp,4
|
||||
mov cx,ax
|
||||
@@12: add si,2
|
||||
@@10: cmp si,cs:siend
|
||||
jb @@11
|
||||
mov cs:ndp,bp
|
||||
|
||||
pop bp
|
||||
pop cx
|
||||
inc cs:yrow
|
||||
add cs:yrowad,320
|
||||
add bp,2
|
||||
loop @@1
|
||||
mov bx,cs:ndp
|
||||
mov word ptr fs:[bx+0],63999
|
||||
mov word ptr fs:[bx+2],0
|
||||
add bx,4
|
||||
mov word ptr fs:[bx+0],-1
|
||||
mov word ptr fs:[bx+2],0
|
||||
add bx,4
|
||||
mov cs:ndp,bx
|
||||
ret
|
||||
ng_pass2 ENDP
|
||||
|
||||
tmp_firstvx dw 0
|
||||
tmp_color dw 0
|
||||
public __newgroup
|
||||
__newgroup PROC FAR
|
||||
;es:di=polygroup
|
||||
;sides,color,x,y,x,y,x,y,...
|
||||
;sides=0=end
|
||||
cmp ax,0
|
||||
jne @@ng1
|
||||
call ng_init
|
||||
ret
|
||||
@@ng1: cmp ax,1
|
||||
je @@ng2
|
||||
; setborder 2
|
||||
call ng_pass2
|
||||
; setborder 3
|
||||
call ng_pass3
|
||||
ret
|
||||
@@ng2: ;setborder 1
|
||||
|
||||
;add polygons to list
|
||||
mov bp,cs:nec
|
||||
@@2: mov cx,es:[di] ;sides
|
||||
cmp cx,0
|
||||
je @@1
|
||||
mov ax,es:[di+2] ;color
|
||||
mov cs:tmp_color,ax
|
||||
mov si,di
|
||||
add di,4
|
||||
mov cs:tmp_firstvx,di
|
||||
@@3: add si,4
|
||||
add di,4
|
||||
cmp cx,1
|
||||
jne @@4
|
||||
mov di,cs:tmp_firstvx
|
||||
@@4: push cx
|
||||
;dx=color, si->start, di->end
|
||||
mov ax,cs:tmp_color
|
||||
mov cs:[bp+NE_COLOR],ax
|
||||
mov bx,es:[si+2] ;y1
|
||||
mov cx,es:[di+2] ;y2
|
||||
cmp bx,cx
|
||||
jg @@i1 ;y1>y2
|
||||
mov ax,es:[si+0] ;x1
|
||||
mov dx,es:[di+0] ;x2
|
||||
jmp @@i0
|
||||
@@i1: xchg bx,cx
|
||||
mov ax,es:[di+0] ;x1
|
||||
mov dx,es:[si+0] ;x2
|
||||
@@i0: ;ax,bx=xy1 dx,cx=xy2
|
||||
mov cs:[bp+NE_Y1],bx
|
||||
mov cs:[bp+NE_Y2],cx
|
||||
mov word ptr cs:[bp+NE_X],0
|
||||
mov cs:[bp+NE_X+2],ax
|
||||
neg ax
|
||||
add ax,dx
|
||||
shl eax,16
|
||||
cdq
|
||||
sub cx,bx
|
||||
;cx=y2-y1,edx:eax=(x2-x1)<<16
|
||||
cmp cx,0
|
||||
je @@n1 ;skip horizontal lines
|
||||
movzx ecx,cx
|
||||
idiv ecx
|
||||
mov cs:[bp+NE_DX],eax
|
||||
;!!!if y1<0, clip
|
||||
cmp bx,NROWS
|
||||
jge @@n1
|
||||
cmp bx,0
|
||||
jge @@nc
|
||||
mov dx,cs:[bp+NE_Y2]
|
||||
cmp dx,0
|
||||
jle @@n1
|
||||
neg bx
|
||||
movzx ebx,bx
|
||||
imul ebx
|
||||
add cs:[bp+NE_X],eax
|
||||
xor bx,bx
|
||||
mov cs:[bp+NE_Y1],bx
|
||||
@@nc: ;!!!
|
||||
shl bx,1
|
||||
mov ax,cs:nep[bx]
|
||||
or ax,ax
|
||||
jnz @@j1
|
||||
;first on this row
|
||||
mov cs:nep[bx],bp
|
||||
mov word ptr cs:[bp+NE_NEXT],0
|
||||
jmp @@j0
|
||||
@@j1: ;add to this row
|
||||
;scan if already exists
|
||||
push ax
|
||||
push si
|
||||
mov si,ax
|
||||
jmp @@h11
|
||||
@@h1: mov si,cs:[si+NE_NEXT]
|
||||
@@h11: mov ax,cs:[bp+NE_Y2]
|
||||
cmp ax,cs:[si+NE_Y2]
|
||||
jne @@h2
|
||||
mov eax,cs:[bp+NE_X]
|
||||
cmp eax,cs:[si+NE_X]
|
||||
jne @@h2
|
||||
mov eax,cs:[bp+NE_DX]
|
||||
cmp eax,cs:[si+NE_DX]
|
||||
jne @@h2
|
||||
;duplicate line SI
|
||||
mov al,cs:[bp+NE_COLOR]
|
||||
xor cs:[si+NE_COLOR],al
|
||||
pop si
|
||||
pop ax
|
||||
jmp @@n1
|
||||
@@h2: cmp si,0
|
||||
jne @@h1 ;end of list
|
||||
@@h3: pop si
|
||||
pop ax
|
||||
mov cs:nep[bx],bp
|
||||
mov word ptr cs:[bp+NE_NEXT],ax
|
||||
@@j0: add bp,16
|
||||
@@n1: ;next
|
||||
pop cx
|
||||
loop @@3
|
||||
add si,4
|
||||
mov di,si
|
||||
jmp @@2
|
||||
|
||||
@@1: mov cs:nec,bp
|
||||
sub bp,OFFSET ne
|
||||
shr bp,4
|
||||
mov cs:__ndebug1,bp
|
||||
|
||||
ret
|
||||
__newgroup ENDP
|
||||
BIN
HARD/_GRID1.TMP
Normal file
BIN
HARD/_GRID1.TMP
Normal file
Binary file not shown.
Loading…
Reference in a new issue