Upload
This commit is contained in:
commit
43352ff262
1291 changed files with 220976 additions and 0 deletions
BIN
DDSTARS/DOIT.EXE
Normal file
BIN
DDSTARS/DOIT.EXE
Normal file
Binary file not shown.
70
DDSTARS/DOIT1.C
Normal file
70
DDSTARS/DOIT1.C
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
char *vram=(char *)0xa0000000L;
|
||||
|
||||
main()
|
||||
{
|
||||
FILE *f1;
|
||||
char *vp;
|
||||
int a,b,c,r,x,y;
|
||||
double l1,l2;
|
||||
_asm mov ax,13h
|
||||
_asm int 10h
|
||||
outp(0x3c8,0);
|
||||
for(a=0;a<8;a++)
|
||||
{
|
||||
outp(0x3c9,a*8);
|
||||
outp(0x3c9,a*8);
|
||||
outp(0x3c9,a*8);
|
||||
}
|
||||
for(y=0;y<200;y++) for(x=0;x<320;x++)
|
||||
{
|
||||
l1=(double)(x-320);
|
||||
l2=(double)(y-200);
|
||||
r=(int)pow(l1*l1+l2*l2,0.7);
|
||||
a=(r/16)&7;
|
||||
vram[x+y*320]=a;
|
||||
}
|
||||
c=1;
|
||||
f1=fopen("pic.ega","wb");
|
||||
for(y=0;y<200;y++)
|
||||
{
|
||||
for(c=1;c<=4;c<<=1)
|
||||
{
|
||||
for(x=0;x<320;x+=8)
|
||||
{
|
||||
vp=vram+x+y*320;
|
||||
a=0;
|
||||
if(vp[0]&c) a|=128;
|
||||
if(vp[1]&c) a|=64;
|
||||
if(vp[2]&c) a|=32;
|
||||
if(vp[3]&c) a|=16;
|
||||
if(vp[4]&c) a|=8;
|
||||
if(vp[5]&c) a|=4;
|
||||
if(vp[6]&c) a|=2;
|
||||
if(vp[7]&c) a|=1;
|
||||
putc(a,f1);
|
||||
}
|
||||
}
|
||||
vram[y*320]=15;
|
||||
vram[y*320+1]=0;
|
||||
}
|
||||
fclose(f1);
|
||||
getch();
|
||||
_asm mov ax,3
|
||||
_asm int 10h
|
||||
for(a=0;a<256;a++)
|
||||
{
|
||||
b=0;
|
||||
if(a&1) b|=128;
|
||||
if(a&2) b|=64;
|
||||
if(a&4) b|=32;
|
||||
if(a&8) b|=16;
|
||||
if(a&16) b|=8;
|
||||
if(a&32) b|=4;
|
||||
if(a&64) b|=2;
|
||||
if(a&128) b|=1;
|
||||
printf("%i,",b);
|
||||
}
|
||||
}
|
||||
BIN
DDSTARS/DOIT1.EXE
Normal file
BIN
DDSTARS/DOIT1.EXE
Normal file
Binary file not shown.
70
DDSTARS/DOIT2.C
Normal file
70
DDSTARS/DOIT2.C
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
char *vram=(char *)0xa0000000L;
|
||||
|
||||
main()
|
||||
{
|
||||
FILE *f1;
|
||||
char *vp;
|
||||
int a,b,c,r,x,y;
|
||||
long l1,l2;
|
||||
_asm mov ax,13h
|
||||
_asm int 10h
|
||||
outp(0x3c8,0);
|
||||
for(a=0;a<8;a++)
|
||||
{
|
||||
outp(0x3c9,a*8);
|
||||
outp(0x3c9,a*8);
|
||||
outp(0x3c9,a*8);
|
||||
}
|
||||
for(y=0;y<200;y++) for(x=0;x<320;x++)
|
||||
{
|
||||
l1=(long)(x-320)*(long)(x-320);
|
||||
l2=(long)(y-200)*(long)(y-200);
|
||||
r=(int)sqrt((double)l1+(double)l2);
|
||||
a=((r)/12)&1;
|
||||
vram[x+y*320]=a;
|
||||
}
|
||||
c=1;
|
||||
f1=fopen("pic2.ega","wb");
|
||||
for(y=0;y<200;y++)
|
||||
{
|
||||
for(c=1;c<=1;c<<=1)
|
||||
{
|
||||
for(x=0;x<320;x+=8)
|
||||
{
|
||||
vp=vram+x+y*320;
|
||||
a=0;
|
||||
if(vp[0]&c) a|=128;
|
||||
if(vp[1]&c) a|=64;
|
||||
if(vp[2]&c) a|=32;
|
||||
if(vp[3]&c) a|=16;
|
||||
if(vp[4]&c) a|=8;
|
||||
if(vp[5]&c) a|=4;
|
||||
if(vp[6]&c) a|=2;
|
||||
if(vp[7]&c) a|=1;
|
||||
putc(a,f1);
|
||||
}
|
||||
}
|
||||
vram[y*320]=15;
|
||||
vram[y*320+1]=0;
|
||||
}
|
||||
fclose(f1);
|
||||
getch();
|
||||
_asm mov ax,3
|
||||
_asm int 10h
|
||||
for(a=0;a<256;a++)
|
||||
{
|
||||
b=0;
|
||||
if(a&1) b|=128;
|
||||
if(a&2) b|=64;
|
||||
if(a&4) b|=32;
|
||||
if(a&8) b|=16;
|
||||
if(a&16) b|=8;
|
||||
if(a&32) b|=4;
|
||||
if(a&64) b|=2;
|
||||
if(a&128) b|=1;
|
||||
printf("%i,",b);
|
||||
}
|
||||
}
|
||||
BIN
DDSTARS/DOIT2.EXE
Normal file
BIN
DDSTARS/DOIT2.EXE
Normal file
Binary file not shown.
54
DDSTARS/DOIT3.C
Normal file
54
DDSTARS/DOIT3.C
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
char *vram=(char *)0xa0000000L;
|
||||
|
||||
main()
|
||||
{
|
||||
FILE *f1;
|
||||
char *vp;
|
||||
int a,b,c,r,x,y;
|
||||
double l1,l2;
|
||||
_asm mov ax,13h
|
||||
_asm int 10h
|
||||
outp(0x3c8,0);
|
||||
for(a=0;a<8;a++)
|
||||
{
|
||||
outp(0x3c9,a*8);
|
||||
outp(0x3c9,a*8);
|
||||
outp(0x3c9,a*8);
|
||||
}
|
||||
for(y=0;y<200;y++) for(x=0;x<320;x++)
|
||||
{
|
||||
a=((long)((x-160)*(long)(320-y)+1600L)/3200L)&1;
|
||||
vram[x+y*320]=a;
|
||||
}
|
||||
c=1;
|
||||
f1=fopen("pic3.ega","wb");
|
||||
for(y=0;y<200;y++)
|
||||
{
|
||||
for(c=1;c<=4;c<<=1)
|
||||
{
|
||||
for(x=0;x<320;x+=8)
|
||||
{
|
||||
vp=vram+x+y*320;
|
||||
a=0;
|
||||
if(vp[0]&c) a|=128;
|
||||
if(vp[1]&c) a|=64;
|
||||
if(vp[2]&c) a|=32;
|
||||
if(vp[3]&c) a|=16;
|
||||
if(vp[4]&c) a|=8;
|
||||
if(vp[5]&c) a|=4;
|
||||
if(vp[6]&c) a|=2;
|
||||
if(vp[7]&c) a|=1;
|
||||
putc(a,f1);
|
||||
}
|
||||
}
|
||||
vram[y*320]=15;
|
||||
vram[y*320+1]=0;
|
||||
}
|
||||
fclose(f1);
|
||||
getch();
|
||||
_asm mov ax,3
|
||||
_asm int 10h
|
||||
}
|
||||
BIN
DDSTARS/DOIT3.EXE
Normal file
BIN
DDSTARS/DOIT3.EXE
Normal file
Binary file not shown.
2
DDSTARS/DOTEXTS.BAT
Normal file
2
DDSTARS/DOTEXTS.BAT
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
lbm16 texts.lbm texts.16 2
|
||||
doobj texts.16 _textpic _textpic.obk
|
||||
BIN
DDSTARS/DP_PREFS
Normal file
BIN
DDSTARS/DP_PREFS
Normal file
Binary file not shown.
14
DDSTARS/FLIP.INC
Normal file
14
DDSTARS/FLIP.INC
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
flip8 LABEL BYTE
|
||||
db 0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200
|
||||
db 40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100
|
||||
db 228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156
|
||||
db 92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178
|
||||
db 114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6
|
||||
db 134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206
|
||||
db 46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225
|
||||
db 17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217
|
||||
db 57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245
|
||||
db 13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,3,131,67,195
|
||||
db 35,163,99,227,19,147,83,211,51,179,115,243,11,139,75,203,43,171,107,235
|
||||
db 27,155,91,219,59,187,123,251,7,135,71,199,39,167,103,231,23,151,87,215
|
||||
db 55,183,119,247,15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255
|
||||
BIN
DDSTARS/K.EXE
Normal file
BIN
DDSTARS/K.EXE
Normal file
Binary file not shown.
100
DDSTARS/KOE.ASM
Normal file
100
DDSTARS/KOE.ASM
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
extrn _textpic:byte
|
||||
extrn _dis_partstart:far
|
||||
|
||||
code SEGMENT para public 'CODE'
|
||||
ASSUME cs:code
|
||||
LOCALS
|
||||
.386
|
||||
|
||||
include sin1024.inc ;_sin1024
|
||||
|
||||
PLANE MACRO pl
|
||||
mov dx,3c4h
|
||||
mov ax,0002h+pl*100h
|
||||
out dx,ax
|
||||
ENDM
|
||||
|
||||
resetmode13 PROC NEAR
|
||||
mov ax,13
|
||||
int 10h
|
||||
mov dx,3dah
|
||||
in al,dx
|
||||
mov dx,3c0h
|
||||
xor al,al
|
||||
REPT 16
|
||||
out dx,al
|
||||
out dx,al
|
||||
inc al
|
||||
ENDM
|
||||
mov al,11h
|
||||
out dx,al
|
||||
mov al,255
|
||||
out dx,al
|
||||
mov al,32
|
||||
out dx,al
|
||||
;clear pal
|
||||
mov dx,3c8h
|
||||
xor al,al
|
||||
out dx,al
|
||||
inc dx
|
||||
mov cx,768
|
||||
@@clp: out dx,al
|
||||
loop @@clp
|
||||
ret
|
||||
resetmode13 ENDP
|
||||
|
||||
outpal PROC NEAR
|
||||
mov dx,3c8h
|
||||
out dx,al
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
inc dx
|
||||
rep outsb
|
||||
ret
|
||||
outpal ENDP
|
||||
|
||||
waitb PROC NEAR
|
||||
mov bx,1
|
||||
int 0fch
|
||||
ret
|
||||
waitb ENDP
|
||||
|
||||
ALIGN 16
|
||||
include stars.asm
|
||||
|
||||
start: mov bx,SEG endcode
|
||||
mov ax,es
|
||||
sub bx,ax
|
||||
add bx,64
|
||||
mov ah,4ah
|
||||
int 21h
|
||||
|
||||
call _dis_partstart
|
||||
|
||||
call resetmode13
|
||||
|
||||
call init_stars
|
||||
|
||||
call do_stars
|
||||
call deinit_stars
|
||||
|
||||
@@xit: mov ax,3
|
||||
int 10h
|
||||
mov ax,4c00h
|
||||
int 21h
|
||||
|
||||
code ENDS
|
||||
|
||||
.8086
|
||||
stack SEGMENT word stack 'STACK'
|
||||
db 1024 dup(0)
|
||||
stack ENDS
|
||||
|
||||
lastseg segment para public 'DATA' ;temporary stack when code starts
|
||||
ALIGN 16
|
||||
public endcode
|
||||
endcode db 16 dup(0)
|
||||
lastseg ends
|
||||
|
||||
END start
|
||||
|
||||
9
DDSTARS/KOE.MAP
Normal file
9
DDSTARS/KOE.MAP
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
Start Stop Length Name Class
|
||||
00000H 000D3H 000D4H text_disc CODE
|
||||
000E0H 0616BH 0608CH CODE CODE
|
||||
06170H 0A02FH 03EC0H DATA__textpic FARDATA
|
||||
0A030H 0A42FH 00400H STACK STACK
|
||||
0A430H 0A43FH 00010H lastseg DATA
|
||||
|
||||
Program entry point at 000E:6063
|
||||
BIN
DDSTARS/KOE.OBJ
Normal file
BIN
DDSTARS/KOE.OBJ
Normal file
Binary file not shown.
27
DDSTARS/KR.C
Normal file
27
DDSTARS/KR.C
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include <stdio.h>
|
||||
|
||||
char *vram=(char *)0xa0000000L;
|
||||
|
||||
main()
|
||||
{
|
||||
unsigned int seed;
|
||||
_asm mov ax,13h
|
||||
_asm int 10h
|
||||
_asm int 3
|
||||
rand();
|
||||
while(!kbhit())
|
||||
{
|
||||
vram[seed]++;
|
||||
_asm
|
||||
{
|
||||
mov ax,seed
|
||||
shl ax,1
|
||||
jnc l1
|
||||
add ax,0f7ffh
|
||||
l1: mov seed,ax
|
||||
}
|
||||
}
|
||||
getch();
|
||||
_asm mov ax,3h
|
||||
_asm int 10h
|
||||
}
|
||||
8
DDSTARS/MAKEFILE
Normal file
8
DDSTARS/MAKEFILE
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
k.exe : koe.obj
|
||||
link /E ..\dis\disc.obj+_textpic.obk+koe.obj,k.exe,koe.map;
|
||||
copy k.exe ..\main\data\ddstars.exe
|
||||
|
||||
koe.obj : koe.asm
|
||||
tasm /ML /m9 koe.asm
|
||||
|
||||
koe.asm : stars.asm
|
||||
BIN
DDSTARS/PIC.EGA
Normal file
BIN
DDSTARS/PIC.EGA
Normal file
Binary file not shown.
BIN
DDSTARS/PIC2.EGA
Normal file
BIN
DDSTARS/PIC2.EGA
Normal file
Binary file not shown.
421
DDSTARS/POLYEGA.ASM
Normal file
421
DDSTARS/POLYEGA.ASM
Normal file
|
|
@ -0,0 +1,421 @@
|
|||
;borders - can be found in asm.asm at the tmp work area (size 8K = 1024 rows)
|
||||
|
||||
ALIGN 4
|
||||
polysides dw 0
|
||||
polyxy dw 16 dup(0,0);
|
||||
|
||||
poly PROC NEAR
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
mov ax,cs:starvram
|
||||
mov es,ax
|
||||
jmp polyf
|
||||
poly ENDP
|
||||
|
||||
;*** POLYF / POLYFT
|
||||
|
||||
ALIGN 4
|
||||
borders dw 4096 dup(0)
|
||||
|
||||
feax dd 0
|
||||
fedx dd 0
|
||||
|
||||
fleftaddl dd 0 ;+0
|
||||
fleftaddh dw 0 ;+4
|
||||
fleftrown dw 0 ;+6
|
||||
fleftzb dd 0 ;+8
|
||||
fleftze dd 0 ;+12
|
||||
flefttx0 dw 0 ;+16
|
||||
fleftty0 dw 0 ;+18
|
||||
flefttxa dw 0 ;+20
|
||||
flefttya dw 0 ;+22
|
||||
fleftcnt dw 0 ;+24
|
||||
fleftcnta dw 0 ;+26
|
||||
fleftd3a dw 0 ;+28
|
||||
|
||||
frightaddl dd 0 ;+0
|
||||
frightaddh dw 0 ;+4
|
||||
frightrown dw 0 ;+6
|
||||
frightzb dd 0 ;+8
|
||||
frightze dd 0 ;+12
|
||||
frighttx0 dw 0 ;+16
|
||||
frightty0 dw 0 ;+18
|
||||
frighttxa dw 0 ;+20
|
||||
frighttya dw 0 ;+22
|
||||
frightcnt dw 0 ;+24
|
||||
frightcnta dw 0 ;+26
|
||||
frightd3a dw 0 ;+28
|
||||
|
||||
finfolen dw 0
|
||||
finfo0 dw 0
|
||||
finfo1 dw 0
|
||||
fwmaxy1 dw 0
|
||||
|
||||
wminx dw 0
|
||||
wmaxx dw 319
|
||||
wminy dw 0+100h
|
||||
wmaxy dw 399+100h
|
||||
|
||||
finfo dw 32 dup(0,0,0,0,0,0,0,0)
|
||||
;x,y,zlo,zhi,tx,ty,0,0
|
||||
|
||||
polyf PROC NEAR ;ONLY CONVEX POLYGONS - FAST?
|
||||
;input: polysides/polyxy
|
||||
;requirements:
|
||||
;es=vram
|
||||
;cpolysides>=4 (not checked)
|
||||
;color=set
|
||||
;**COPY/SEEK UPPERMOST**
|
||||
mov ax,cs
|
||||
mov gs,ax
|
||||
mov ds,ax
|
||||
mov cx,ds:polysides
|
||||
mov ax,cx
|
||||
shl ax,4 ;*16
|
||||
mov ds:finfolen,ax
|
||||
add ax,OFFSET finfo
|
||||
mov ds:finfo1,ax
|
||||
mov ax,gs:wmaxy
|
||||
inc ax
|
||||
mov ds:fwmaxy1,ax
|
||||
mov edx,077770000h
|
||||
xor bx,bx
|
||||
mov si,OFFSET polyxy
|
||||
mov di,OFFSET finfo
|
||||
mov ds:finfo0,di
|
||||
pfn1: mov eax,dword ptr ds:[si]
|
||||
cmp eax,edx
|
||||
jg pfn2
|
||||
mov edx,eax
|
||||
mov bx,di
|
||||
pfn2: mov dword ptr ds:[di],eax
|
||||
add si,4
|
||||
add di,16
|
||||
loop pfn1
|
||||
;[bx]=uppermost
|
||||
;**SETUP REGS**
|
||||
mov ds:fleftrown,-32767
|
||||
mov ds:frightrown,-32767
|
||||
mov si,bx
|
||||
mov di,bx
|
||||
mov bp,ds:[si+2]
|
||||
mov bx,OFFSET borders
|
||||
mov ax,bp
|
||||
cmp ax,gs:wminy
|
||||
jge pfn35
|
||||
mov ax,gs:wminy
|
||||
pfn35: mov gs:[bx],ax
|
||||
add bx,2
|
||||
mov cx,16 ;max tmp count to avoid hanging on illegal polygons
|
||||
;eax=left
|
||||
;bx=pointer to borders[]
|
||||
;cx=count
|
||||
;edx=right
|
||||
;si=left
|
||||
;di=right
|
||||
;bp=y
|
||||
pfn63: push cx
|
||||
push bx
|
||||
|
||||
cmp bp,ds:fleftrown
|
||||
jl pfn42
|
||||
push edx
|
||||
push di
|
||||
mov di,si
|
||||
sub di,16
|
||||
cmp di,ds:finfo0
|
||||
jae pfn41
|
||||
add di,ds:finfolen
|
||||
pfn41: mov bx,OFFSET fleftaddl
|
||||
call polyfcalc
|
||||
add cx,bp
|
||||
mov ds:fleftrown,cx
|
||||
movzx eax,word ptr ds:[si+0]
|
||||
mov ebx,ds:fleftaddl
|
||||
mov dx,ds:fleftaddh
|
||||
sar dx,1
|
||||
rcr ebx,1
|
||||
xor bx,bx
|
||||
sub eax,ebx
|
||||
sbb ax,dx
|
||||
mov si,di
|
||||
pop di
|
||||
pop edx
|
||||
pfn42:
|
||||
cmp bp,ds:frightrown
|
||||
jl pfn52
|
||||
push eax
|
||||
push si
|
||||
mov si,di
|
||||
add di,16
|
||||
cmp di,ds:finfo1
|
||||
jb pfn51
|
||||
sub di,ds:finfolen
|
||||
pfn51: mov bx,OFFSET frightaddl
|
||||
call polyfcalc
|
||||
add cx,bp
|
||||
mov ds:frightrown,cx
|
||||
movzx edx,word ptr ds:[si+0]
|
||||
mov ebx,ds:frightaddl
|
||||
mov ax,ds:frightaddh
|
||||
sar ax,1
|
||||
rcr ebx,1
|
||||
xor bx,bx
|
||||
sub edx,ebx
|
||||
sbb dx,ax
|
||||
pop si
|
||||
pop eax
|
||||
|
||||
pfn52: mov bx,ds:fleftrown
|
||||
mov cx,ds:frightrown
|
||||
cmp cx,bx
|
||||
jl pfn61
|
||||
mov cx,bx
|
||||
pfn61: sub cx,bp
|
||||
pop bx
|
||||
cmp cx,0
|
||||
jg pfn71
|
||||
pfn6: pop cx
|
||||
cmp bp,ds:fwmaxy1
|
||||
jg pfn64
|
||||
cmp si,di
|
||||
je pfn64
|
||||
dec cx
|
||||
jz pfn64
|
||||
jmp pfn63
|
||||
pfn64: mov word ptr gs:[bx],-32767
|
||||
mov si,OFFSET borders
|
||||
call polyn_disp
|
||||
ret
|
||||
pfn65: ;above screen
|
||||
;entering screen, cut.
|
||||
add bp,cx
|
||||
push bp
|
||||
push cx
|
||||
cmp bp,gs:wminy
|
||||
jl pfn66
|
||||
sub bp,cx
|
||||
mov cx,gs:wminy
|
||||
sub cx,bp
|
||||
pfn66: ;
|
||||
movsx ecx,cx
|
||||
ror eax,16
|
||||
mov ds:feax,eax
|
||||
ror edx,16
|
||||
mov ds:fedx,edx
|
||||
;
|
||||
mov ax,ds:fleftaddh
|
||||
shl eax,16
|
||||
mov ax,word ptr ds:fleftaddl[2]
|
||||
imul ecx
|
||||
add ds:feax,eax
|
||||
;
|
||||
mov ax,ds:frightaddh
|
||||
shl eax,16
|
||||
mov ax,word ptr ds:frightaddl[2]
|
||||
imul ecx
|
||||
add ds:fedx,eax
|
||||
;
|
||||
mov eax,ds:feax
|
||||
ror eax,16
|
||||
mov edx,ds:fedx
|
||||
ror edx,16
|
||||
mov bp,cx
|
||||
pop cx
|
||||
sub cx,bp
|
||||
pop bp
|
||||
cmp cx,0
|
||||
jne pfn6b
|
||||
jmp pfn6
|
||||
pfn6b: mov bp,gs:wminy
|
||||
pfn71: ;process segment
|
||||
cmp bp,gs:wminy
|
||||
jl pfn65 ;above screen still
|
||||
add bp,cx
|
||||
;clip max to maxy
|
||||
cmp bp,ds:fwmaxy1
|
||||
jle pfn72
|
||||
sub bp,cx
|
||||
mov cx,ds:fwmaxy1
|
||||
sub cx,bp
|
||||
mov bp,ds:fwmaxy1
|
||||
pfn72: cmp cx,0
|
||||
jle pfn6
|
||||
push si
|
||||
push di
|
||||
push bp
|
||||
ror ebx,16
|
||||
neg cx
|
||||
mov bx,cx
|
||||
ror ebx,16
|
||||
mov esi,ds:fleftaddl
|
||||
mov edi,ds:frightaddl
|
||||
mov bp,ds:fleftaddh
|
||||
mov cx,ds:frightaddh
|
||||
pfn7: add eax,esi
|
||||
adc ax,bp
|
||||
add edx,edi
|
||||
adc dx,cx
|
||||
mov gs:[bx],ax
|
||||
mov gs:[bx+2],dx
|
||||
add ebx,10004h
|
||||
jnc pfn7
|
||||
pop bp
|
||||
pop di
|
||||
pop si
|
||||
jmp pfn6
|
||||
polyfcalc: ;**** subroutine ****
|
||||
;calc slope for line [SI]->[DI] to [BX], returns CX=len
|
||||
mov cx,ds:[di+2]
|
||||
sub cx,bp ;ds:[si+2]
|
||||
jle pfc1
|
||||
mov ax,ds:[di+0]
|
||||
sub ax,ds:[si+0]
|
||||
jl pfc2
|
||||
xor dx,dx
|
||||
div cx
|
||||
mov ds:[bx+4],ax
|
||||
xor ax,ax
|
||||
div cx
|
||||
mov ds:[bx+2],ax
|
||||
;dec cx
|
||||
ret
|
||||
pfc1: xor cx,cx
|
||||
ret
|
||||
pfc2: neg ax
|
||||
xor dx,dx
|
||||
div cx
|
||||
push ax
|
||||
xor ax,ax
|
||||
div cx
|
||||
pop dx
|
||||
neg ax
|
||||
adc dx,0
|
||||
neg dx
|
||||
mov ds:[bx+4],dx
|
||||
mov ds:[bx+2],ax
|
||||
;dec cx
|
||||
ret
|
||||
polyf ENDP
|
||||
|
||||
polyn_disp PROC NEAR
|
||||
;calc/load regs
|
||||
mov si,OFFSET borders
|
||||
mov bx,ds:[si]
|
||||
add si,2
|
||||
plnd3: ;draw hlines
|
||||
push cx
|
||||
push bx
|
||||
mov ax,ds:[si]
|
||||
cmp ax,-32767
|
||||
je polyn_dispx
|
||||
mov dx,ds:[si+2]
|
||||
call hline1 ;must not change DS:SI!
|
||||
pop bx
|
||||
pop cx
|
||||
inc bx
|
||||
add si,8
|
||||
jmp plnd3
|
||||
polyn_dispx:
|
||||
pop bx
|
||||
pop cx
|
||||
mov dx,3ceh
|
||||
mov ax,0ff08h
|
||||
out dx,ax
|
||||
ret
|
||||
polyn_disp ENDP
|
||||
|
||||
ALIGN 4
|
||||
leftside db 11111111b,01111111b,00111111b,00011111b,00001111b,00000111b,00000011b,00000001b
|
||||
rightside db 10000000b,11000000b,11100000b,11110000b,11111000b,11111100b,11111110b,11111111b
|
||||
|
||||
ALIGN 4
|
||||
hline1 PROC NEAR
|
||||
;DS:SI must be preserved!
|
||||
;(ax,bx)-(dx,bx)
|
||||
sub bx,256
|
||||
cmp bx,199
|
||||
ja hlixx
|
||||
|
||||
cmp ax,dx
|
||||
jl hli1
|
||||
xchg ax,dx
|
||||
hli1: inc dx
|
||||
|
||||
dec dx
|
||||
cmp dx,ax
|
||||
jg hli21
|
||||
hlixx: ret
|
||||
|
||||
hli21: cmp ax,0
|
||||
jnl hli2
|
||||
cmp dx,0
|
||||
jl hli0
|
||||
xor ax,ax
|
||||
hli2: cmp dx,cs:wmaxx
|
||||
jng hliok
|
||||
cmp ax,cs:wmaxx
|
||||
jg hli0
|
||||
mov dx,cs:wmaxx
|
||||
|
||||
hliok: mov di,ax
|
||||
sar di,3
|
||||
mov cx,dx
|
||||
sar cx,3
|
||||
sub cx,di
|
||||
shl bx,1
|
||||
add di,ds:rows[bx]
|
||||
|
||||
mov bp,7
|
||||
and bp,ax
|
||||
mov bl,ds:leftside[bp]
|
||||
mov bp,7
|
||||
and bp,dx
|
||||
mov bh,ds:rightside[bp]
|
||||
|
||||
cmp cx,0
|
||||
je hli30
|
||||
|
||||
mov dx,3ceh
|
||||
mov al,8
|
||||
mov ah,bl
|
||||
out dx,ax
|
||||
|
||||
mov ah,es:[di]
|
||||
mov byte ptr es:[di],255
|
||||
inc di
|
||||
|
||||
dec cx
|
||||
jcxz hli33
|
||||
|
||||
mov ah,0ffh
|
||||
out dx,ax
|
||||
mov ax,0ffffh
|
||||
test di,1
|
||||
jz hli32
|
||||
mov es:[di],al
|
||||
inc di
|
||||
dec cx
|
||||
hli32: shr cx,1
|
||||
rep stosw
|
||||
adc cx,cx
|
||||
rep stosb
|
||||
|
||||
hli33: mov dx,3ceh
|
||||
mov al,8
|
||||
mov ah,bh
|
||||
out dx,ax
|
||||
mov ah,es:[di]
|
||||
mov byte ptr es:[di],255
|
||||
|
||||
hli0: ret
|
||||
hli30: ;end and beg in same byte
|
||||
mov dx,3ceh
|
||||
mov al,8
|
||||
mov ah,bh
|
||||
and ah,bl
|
||||
out dx,ax
|
||||
mov al,es:[di]
|
||||
mov byte ptr es:[di],255
|
||||
ret
|
||||
hline1 ENDP
|
||||
33
DDSTARS/SIN1024.INC
Normal file
33
DDSTARS/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
|
||||
803
DDSTARS/STARS.ASM
Normal file
803
DDSTARS/STARS.ASM
Normal file
|
|
@ -0,0 +1,803 @@
|
|||
;included to koe.asm
|
||||
|
||||
.386
|
||||
|
||||
include polyega.asm
|
||||
|
||||
STARS equ 512
|
||||
STARS2 equ 1024
|
||||
|
||||
starvram dw 0a000h
|
||||
emmhandle dw 0
|
||||
emmseg dw 0
|
||||
emmpage4 dw 0
|
||||
starlimit dw 0
|
||||
startxtopen dw 0
|
||||
startxtclose dw 0
|
||||
startxtp0 dw 0
|
||||
starframe dw 0
|
||||
starpalfade db 0,0
|
||||
_nostar1 dw 200
|
||||
_nostar2 dw 199
|
||||
|
||||
rows1 dw 200 dup(0)
|
||||
rows dw 400 dup(0)
|
||||
|
||||
star dw STARS2 dup(0,0,0,0)
|
||||
|
||||
muldivx dw 256 dup(0)
|
||||
muldivy dw 256 dup(0)
|
||||
|
||||
ALIGN 2
|
||||
seed dd 0 ;12345678h
|
||||
random PROC NEAR
|
||||
push edx
|
||||
mov eax,0343fdh
|
||||
mul cs:seed
|
||||
add eax,269ec3h
|
||||
mov cs:seed,eax
|
||||
mov ax,dx
|
||||
pop edx
|
||||
ret
|
||||
random ENDP
|
||||
|
||||
setborder PROC NEAR
|
||||
push ax
|
||||
mov dx,3dah
|
||||
in al,dx
|
||||
mov dx,3c0h
|
||||
mov al,11h+20h
|
||||
out dx,al
|
||||
pop ax
|
||||
out dx,al
|
||||
ret
|
||||
setborder ENDP
|
||||
|
||||
init_stars PROC NEAR
|
||||
mov ax,13
|
||||
int 10h
|
||||
|
||||
mov dx,3dah
|
||||
in al,dx
|
||||
mov dx,3c0h
|
||||
xor al,al
|
||||
REPT 16
|
||||
out dx,al
|
||||
out dx,al
|
||||
inc al
|
||||
ENDM
|
||||
mov al,20h
|
||||
out dx,al
|
||||
|
||||
mov dx,3d4h
|
||||
mov al,9
|
||||
out dx,al
|
||||
inc dx
|
||||
in al,dx
|
||||
and al,127
|
||||
out dx,al
|
||||
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
xor di,di
|
||||
mov cx,32768
|
||||
xor ax,ax
|
||||
rep stosw
|
||||
|
||||
mov ah,43h
|
||||
mov bx,32*2
|
||||
int 67h
|
||||
or ah,ah
|
||||
jz @@1
|
||||
mov ax,4c00h
|
||||
int 21h
|
||||
@@1: mov cs:emmhandle,dx
|
||||
|
||||
mov ah,41h
|
||||
int 67h
|
||||
mov cs:emmseg,bx
|
||||
|
||||
call clearsbu
|
||||
|
||||
mov cx,200
|
||||
mov ax,0
|
||||
mov dx,320/8
|
||||
mov bx,OFFSET rows1
|
||||
@@4: mov cs:[bx],ax
|
||||
add ax,dx
|
||||
add bx,2
|
||||
loop @@4
|
||||
|
||||
mov cx,400
|
||||
mov ax,0
|
||||
mov dx,320/8
|
||||
mov bx,OFFSET rows
|
||||
@@4b: mov cs:[bx],ax
|
||||
add ax,dx
|
||||
add bx,2
|
||||
loop @@4b
|
||||
|
||||
mov ax,cs
|
||||
mov es,ax
|
||||
|
||||
mov di,OFFSET star
|
||||
mov cx,STARS2
|
||||
@@3: mov al,cl
|
||||
dec al
|
||||
xor ah,ah
|
||||
stosw
|
||||
call random
|
||||
and ax,1023
|
||||
sub ax,512
|
||||
stosw
|
||||
call random
|
||||
and ax,1023
|
||||
sub ax,512
|
||||
stosw
|
||||
xor ax,ax
|
||||
stosw
|
||||
loop @@3
|
||||
|
||||
mov di,OFFSET muldivy
|
||||
mov cx,256
|
||||
mov bp,150
|
||||
@@2b: mov dx,108
|
||||
xor ax,ax
|
||||
div bp
|
||||
shr ax,1
|
||||
stosw
|
||||
add bp,4
|
||||
loop @@2b
|
||||
|
||||
mov di,OFFSET muldivx
|
||||
mov cx,256
|
||||
mov bp,150
|
||||
@@2c: mov dx,144
|
||||
xor ax,ax
|
||||
div bp
|
||||
shr ax,1
|
||||
stosw
|
||||
add bp,4
|
||||
loop @@2c
|
||||
|
||||
mov cs:starlimit,STARS
|
||||
mov cs:starpalfade,0
|
||||
|
||||
mov cs:startxtopen,-9999
|
||||
mov cs:startxtclose,10000
|
||||
|
||||
mov cx,100
|
||||
@@sa: push cx
|
||||
call starfetch0
|
||||
call staradd
|
||||
pop cx
|
||||
loop @@sa
|
||||
ret
|
||||
init_stars ENDP
|
||||
|
||||
deinit_stars PROC NEAR
|
||||
mov ah,45h
|
||||
mov dx,cs:emmhandle
|
||||
int 67h
|
||||
ret
|
||||
deinit_stars ENDP
|
||||
|
||||
fetch4ax PROC NEAR
|
||||
shl ax,1
|
||||
mov bx,ax
|
||||
push ax
|
||||
mov ax,4400h
|
||||
shr bx,2
|
||||
mov dx,cs:emmhandle
|
||||
int 67h
|
||||
pop ax
|
||||
and ax,3
|
||||
shl ax,12-4
|
||||
add ax,cs:emmseg
|
||||
ret
|
||||
fetch4ax ENDP
|
||||
|
||||
fetch4ax2 PROC NEAR
|
||||
shl ax,1
|
||||
mov bx,ax
|
||||
push ax
|
||||
mov ax,4401h
|
||||
shr bx,2
|
||||
mov dx,cs:emmhandle
|
||||
int 67h
|
||||
pop ax
|
||||
and ax,3
|
||||
shl ax,12-4
|
||||
add ax,cs:emmseg
|
||||
add ax,400h
|
||||
ret
|
||||
fetch4ax2 ENDP
|
||||
|
||||
fetch4ax3 PROC NEAR
|
||||
shl ax,1
|
||||
mov bx,ax
|
||||
push ax
|
||||
mov ax,4402h
|
||||
shr bx,2
|
||||
mov dx,cs:emmhandle
|
||||
int 67h
|
||||
pop ax
|
||||
and ax,3
|
||||
shl ax,12-4
|
||||
add ax,cs:emmseg
|
||||
add ax,800h
|
||||
ret
|
||||
fetch4ax3 ENDP
|
||||
|
||||
clearsbu PROC NEAR
|
||||
mov cx,128
|
||||
mov ax,0
|
||||
@@1: push cx
|
||||
push ax
|
||||
call fetch4ax
|
||||
mov es,ax
|
||||
mov cx,4096/4*2
|
||||
xor eax,eax
|
||||
xor di,di
|
||||
rep stosd
|
||||
pop ax
|
||||
pop cx
|
||||
inc ax
|
||||
loop @@1
|
||||
ret
|
||||
clearsbu ENDP
|
||||
|
||||
starfetch0 PROC NEAR
|
||||
mov ax,cs:emmpage4
|
||||
inc ax
|
||||
and ax,63
|
||||
mov cs:emmpage4,ax
|
||||
call fetch4ax
|
||||
mov es,ax
|
||||
ret
|
||||
starfetch0 ENDP
|
||||
|
||||
starfetch1 PROC NEAR
|
||||
mov ax,cs:emmpage4
|
||||
add ax,17
|
||||
and ax,63
|
||||
call fetch4ax2
|
||||
mov fs,ax
|
||||
ret
|
||||
starfetch1 ENDP
|
||||
|
||||
starfetch2 PROC NEAR
|
||||
mov ax,cs:emmpage4
|
||||
add ax,43
|
||||
and ax,63
|
||||
call fetch4ax3
|
||||
mov gs,ax
|
||||
ret
|
||||
starfetch2 ENDP
|
||||
|
||||
staradd PROC NEAR
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
mov ax,ds:starlimit
|
||||
or ax,ax
|
||||
jz @@11
|
||||
dec ax
|
||||
mov ds:starlimit,ax
|
||||
@@11: mov bp,STARS
|
||||
mov si,OFFSET star
|
||||
@@1: movzx bx,ds:[si]
|
||||
sub bl,2
|
||||
mov ds:[si],bl
|
||||
jc @@4
|
||||
cmp bp,cs:starlimit
|
||||
jb @@2
|
||||
shl bx,1
|
||||
mov ax,ds:[si+4]
|
||||
imul ds:muldivy[bx]
|
||||
shld dx,ax,2
|
||||
add dx,100
|
||||
cmp dx,99
|
||||
ja @@2
|
||||
mov cx,dx
|
||||
mov ax,ds:[si+2]
|
||||
imul ds:muldivx[bx]
|
||||
mov bx,cx
|
||||
shld dx,ax,2
|
||||
add dx,160
|
||||
cmp dx,319
|
||||
ja @@2
|
||||
mov cl,dl
|
||||
and cl,7
|
||||
shr dx,3
|
||||
shl bx,1
|
||||
mov bx,ds:rows1[bx]
|
||||
add bx,dx
|
||||
mov ch,80h
|
||||
shr ch,cl
|
||||
mov cl,ds:[si]
|
||||
cmp cl,180
|
||||
jb @@sc1
|
||||
or byte ptr es:[bx],ch
|
||||
jmp @@2
|
||||
@@sc1: cmp cl,110
|
||||
jb @@sc2
|
||||
or byte ptr es:[bx+4096],ch
|
||||
jmp @@2
|
||||
@@sc2: or byte ptr es:[bx],ch
|
||||
or byte ptr es:[bx+4096],ch
|
||||
@@2: add si,8
|
||||
dec bp
|
||||
jnz @@1
|
||||
ret
|
||||
@@4: call random
|
||||
and ax,1023
|
||||
sub ax,512
|
||||
mov cs:[si+2],ax
|
||||
call random
|
||||
and ax,1023
|
||||
sub ax,512
|
||||
mov cs:[si+4],ax
|
||||
jmp @@2
|
||||
staradd ENDP
|
||||
|
||||
staradd2 PROC NEAR
|
||||
call starfetch1
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
mov ax,ds:starlimit
|
||||
or ax,ax
|
||||
jz @@11
|
||||
sub ax,4
|
||||
mov ds:starlimit,ax
|
||||
@@11: mov bp,STARS2
|
||||
mov si,OFFSET star
|
||||
@@1: movzx bx,ds:[si]
|
||||
sub bl,2
|
||||
mov ds:[si],bl
|
||||
jc @@4
|
||||
cmp bp,cs:starlimit
|
||||
jb @@2
|
||||
shl bx,1
|
||||
mov ax,ds:[si+4]
|
||||
imul ds:muldivy[bx]
|
||||
shld dx,ax,2
|
||||
add dx,100
|
||||
cmp dx,99
|
||||
ja @@2
|
||||
mov cx,dx
|
||||
mov ax,ds:[si+2]
|
||||
imul ds:muldivx[bx]
|
||||
mov bx,cx
|
||||
shld dx,ax,2
|
||||
add dx,160
|
||||
cmp dx,319
|
||||
ja @@2
|
||||
mov cl,dl
|
||||
and cl,7
|
||||
shr dx,3
|
||||
shl bx,1
|
||||
mov bx,ds:rows1[bx]
|
||||
add bx,dx
|
||||
mov ch,80h
|
||||
shr ch,cl
|
||||
mov cl,ds:[si]
|
||||
cmp cl,180
|
||||
jb @@sc1
|
||||
or byte ptr es:[bx],ch
|
||||
or byte ptr fs:[bx],ch
|
||||
jmp @@2
|
||||
@@sc1: cmp cl,110
|
||||
jb @@sc2
|
||||
or byte ptr es:[bx+4096],ch
|
||||
or byte ptr fs:[bx+4096],ch
|
||||
jmp @@2
|
||||
@@sc2: or byte ptr es:[bx],ch
|
||||
or byte ptr es:[bx+4096],ch
|
||||
or byte ptr fs:[bx],ch
|
||||
or byte ptr fs:[bx+4096],ch
|
||||
@@2: add si,8
|
||||
dec bp
|
||||
jnz @@1
|
||||
ret
|
||||
@@4: call random
|
||||
and ax,1023
|
||||
sub ax,512
|
||||
mov cs:[si+2],ax
|
||||
call random
|
||||
and ax,1023
|
||||
sub ax,512
|
||||
mov cs:[si+4],ax
|
||||
jmp @@2
|
||||
staradd2 ENDP
|
||||
|
||||
risetext PROC NEAR
|
||||
mov ax,cs:startxtopen
|
||||
cmp ax,99
|
||||
jge @@12
|
||||
inc ax
|
||||
mov cs:startxtopen,ax
|
||||
@@12: mov dx,cs:startxtclose
|
||||
cmp dx,0
|
||||
jle @@21
|
||||
dec dx
|
||||
mov cs:startxtclose,dx
|
||||
@@21: cmp dx,ax
|
||||
jge @@22
|
||||
mov ax,dx
|
||||
@@22: ;ax=startxtuse
|
||||
|
||||
cmp ax,0
|
||||
jg @@tcc
|
||||
jmp @@tc0
|
||||
@@tcc: cmp ax,1
|
||||
jg @@tnz
|
||||
mov ax,2
|
||||
@@tnz: push ax
|
||||
mov di,150
|
||||
sub di,ax
|
||||
mov cs:_nostar2,ax
|
||||
mov ax,80
|
||||
mul di
|
||||
mov di,ax
|
||||
mov cs:_nostar1,di
|
||||
mov ax,SEG _textpic
|
||||
mov ds,ax
|
||||
mov si,040h
|
||||
add si,cs:startxtp0
|
||||
pop cx
|
||||
dec cx
|
||||
|
||||
sub di,40
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
xor eax,eax
|
||||
zzz=0
|
||||
REPT 40/4
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add di,80
|
||||
dec cx
|
||||
jz @@tc0c
|
||||
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
mov eax,0
|
||||
zzz=0
|
||||
REPT 40/4
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add di,80
|
||||
dec cx
|
||||
jz @@tc0
|
||||
dec cx
|
||||
jz @@tc0b
|
||||
|
||||
mov dx,3ceh
|
||||
mov ax,0400h
|
||||
out dx,ax
|
||||
mov ax,01h+400h+800h
|
||||
out dx,ax
|
||||
|
||||
@@tc1: mov dx,3c4h
|
||||
mov ax,0102h+400h+800h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add si,40
|
||||
mov dx,3c4h
|
||||
mov ax,0202h+400h+800h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add si,40
|
||||
add di,80
|
||||
dec cx
|
||||
jz @@tc0b
|
||||
jmp @@tc1
|
||||
|
||||
@@tc0b: mov dx,3ceh
|
||||
mov ax,0001h
|
||||
out dx,ax
|
||||
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
mov eax,0
|
||||
zzz=0
|
||||
REPT 40/4
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add di,80
|
||||
|
||||
dec di
|
||||
mov cs:_nostar2,di
|
||||
@@tc0: ret
|
||||
@@tc0c: mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
xor eax,eax
|
||||
zzz=0
|
||||
REPT 80/4
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
ret
|
||||
risetext ENDP
|
||||
|
||||
do_stars PROC NEAR
|
||||
@@aga: mov al,0
|
||||
;call setborder
|
||||
|
||||
mov dx,3d4h
|
||||
mov ax,cs:starvram
|
||||
cmp ax,0a000h
|
||||
je @@sw1
|
||||
mov cs:starvram,0a000h
|
||||
mov ax,400ch
|
||||
jmp @@sw0
|
||||
@@sw1: mov cs:starvram,0a400h
|
||||
mov ax,000ch
|
||||
@@sw0: out dx,ax
|
||||
call waitb
|
||||
|
||||
mov al,1
|
||||
;call setborder
|
||||
|
||||
cmp cs:starpalfade,32
|
||||
ja @@p1
|
||||
|
||||
mov bl,cs:starpalfade
|
||||
inc bl
|
||||
mov cs:starpalfade,bl
|
||||
shl bl,3
|
||||
jnc @@p2
|
||||
mov bl,255
|
||||
@@p2:
|
||||
mov dx,3c8h
|
||||
xor al,al
|
||||
out dx,al
|
||||
inc dx
|
||||
|
||||
mov al,0
|
||||
out dx,al
|
||||
mov al,0
|
||||
out dx,al
|
||||
mov al,0
|
||||
out dx,al
|
||||
|
||||
mov al,25*70/100
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,31*70/100
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,38*70/100
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
|
||||
mov al,45*56/100
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,58*56/100
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,69*56/100
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
|
||||
mov al,67*64/100
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,84*64/100
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,99*64/100
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
|
||||
;-----
|
||||
|
||||
mov al,0
|
||||
out dx,al
|
||||
mov al,0
|
||||
out dx,al
|
||||
mov al,0
|
||||
out dx,al
|
||||
|
||||
mov al,10
|
||||
out dx,al
|
||||
mov al,20
|
||||
out dx,al
|
||||
mov al,35
|
||||
out dx,al
|
||||
|
||||
mov al,20
|
||||
out dx,al
|
||||
mov al,30
|
||||
out dx,al
|
||||
mov al,45
|
||||
out dx,al
|
||||
|
||||
mov al,30
|
||||
out dx,al
|
||||
mov al,40
|
||||
out dx,al
|
||||
mov al,60
|
||||
out dx,al
|
||||
@@p1:
|
||||
mov ax,cs:starframe
|
||||
inc ax
|
||||
mov cs:starframe,ax
|
||||
cmp ax,1200
|
||||
jne @@st1
|
||||
mov cs:startxtp0,80
|
||||
mov cs:startxtopen,-256
|
||||
mov cs:startxtclose,1500
|
||||
@@st1: cmp ax,3200
|
||||
jne @@st2
|
||||
mov cs:startxtp0,101*80
|
||||
mov cs:startxtopen,-256
|
||||
mov cs:startxtclose,1500
|
||||
@@st2: cmp ax,1500
|
||||
jne @@st3
|
||||
mov cs:starlimit,STARS2
|
||||
@@st3:
|
||||
call risetext
|
||||
|
||||
call starfetch0
|
||||
cmp cs:starframe,1200
|
||||
ja @@stz
|
||||
cmp cs:starframe,900
|
||||
ja @@stz0
|
||||
call staradd
|
||||
jmp @@stz0
|
||||
@@stz: call staradd2
|
||||
;mov al,1
|
||||
;call setborder
|
||||
@@stz0:
|
||||
mov ax,es
|
||||
mov ds,ax
|
||||
|
||||
mov ax,cs:starvram
|
||||
mov es,ax
|
||||
xor di,di
|
||||
mov dx,3c4h
|
||||
mov ax,0102h
|
||||
out dx,ax
|
||||
mov si,0
|
||||
mov cx,100
|
||||
@@3: zzz=0
|
||||
; cmp di,cs:_nostar1
|
||||
; jl @@3g
|
||||
; cmp di,cs:_nostar2
|
||||
; jg @@3g
|
||||
; jmp @@3s
|
||||
@@3g: REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
@@3s: add si,40
|
||||
add di,80
|
||||
loop @@3
|
||||
xor di,di
|
||||
mov si,4096
|
||||
mov dx,3c4h
|
||||
mov ax,0202h
|
||||
out dx,ax
|
||||
mov cx,100
|
||||
@@7: zzz=0
|
||||
; cmp di,cs:_nostar1
|
||||
; jl @@7g
|
||||
; cmp di,cs:_nostar2
|
||||
; jg @@7g
|
||||
; jmp @@7s
|
||||
@@7g: REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
@@7s: add si,40
|
||||
add di,80
|
||||
loop @@7
|
||||
|
||||
mov ax,cs:emmpage4
|
||||
add ax,32
|
||||
and ax,63
|
||||
call fetch4ax
|
||||
mov ds,ax
|
||||
mov di,200*40
|
||||
mov si,99*40
|
||||
mov dx,3c4h
|
||||
mov ax,0102h
|
||||
out dx,ax
|
||||
mov cx,100
|
||||
@@5: zzz=0
|
||||
; cmp di,cs:_nostar1
|
||||
; jl @@5g
|
||||
; cmp di,cs:_nostar2
|
||||
; jg @@5g
|
||||
; jmp @@5s
|
||||
@@5g: REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
@@5s: sub si,40
|
||||
add di,80
|
||||
loop @@5
|
||||
mov di,200*40
|
||||
mov si,99*40+4096
|
||||
mov dx,3c4h
|
||||
mov ax,0202h
|
||||
out dx,ax
|
||||
mov cx,100
|
||||
@@8: zzz=0
|
||||
; cmp di,cs:_nostar1
|
||||
; jl @@8g
|
||||
; cmp di,cs:_nostar2
|
||||
; jg @@8g
|
||||
; jmp @@8s
|
||||
@@8g: REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
@@8s: sub si,40
|
||||
add di,80
|
||||
loop @@8
|
||||
|
||||
mov bx,2
|
||||
int 0fch
|
||||
or ax,ax
|
||||
jz @@aga
|
||||
ret
|
||||
|
||||
mov ax,0a000h
|
||||
mov ds,ax
|
||||
xor si,si
|
||||
mov cx,40*400
|
||||
mov dx,0
|
||||
@@1: lodsb
|
||||
shl al,1
|
||||
adc dx,0
|
||||
shl al,1
|
||||
adc dx,0
|
||||
shl al,1
|
||||
adc dx,0
|
||||
shl al,1
|
||||
adc dx,0
|
||||
shl al,1
|
||||
adc dx,0
|
||||
shl al,1
|
||||
adc dx,0
|
||||
shl al,1
|
||||
adc dx,0
|
||||
shl al,1
|
||||
adc dx,0
|
||||
loop @@1
|
||||
int 3
|
||||
ret
|
||||
do_stars ENDP
|
||||
650
DDSTARS/STARS.OK
Normal file
650
DDSTARS/STARS.OK
Normal file
|
|
@ -0,0 +1,650 @@
|
|||
;included to koe.asm
|
||||
|
||||
.386
|
||||
|
||||
include polyega.asm
|
||||
|
||||
STARS equ 512
|
||||
|
||||
starvram dw 0a000h
|
||||
emmhandle dw 0
|
||||
emmseg dw 0
|
||||
emmpage4 dw 0
|
||||
starlimit dw 0
|
||||
startxtopen dw 0
|
||||
startxtclose dw 0
|
||||
startxtp0 dw 0
|
||||
starframe dw 0
|
||||
starpalfade db 0,0
|
||||
_nostar1 dw 200
|
||||
_nostar2 dw 199
|
||||
|
||||
rows1 dw 200 dup(0)
|
||||
rows dw 400 dup(0)
|
||||
|
||||
star dw STARS dup(0,0,0,0)
|
||||
|
||||
muldivx dw 256 dup(0)
|
||||
muldivy dw 256 dup(0)
|
||||
|
||||
ALIGN 2
|
||||
seed1 dw 1234
|
||||
seed2 dw 1234
|
||||
random PROC NEAR
|
||||
push dx
|
||||
mov dx,cs:seed2
|
||||
mov ax,cs:seed1
|
||||
shl ax,1
|
||||
jnc @@1
|
||||
xor ax,0f7ffh
|
||||
@@1: mov cs:seed1,ax
|
||||
sub dx,ax
|
||||
xor ax,dx
|
||||
rol dx,1
|
||||
mov cs:seed2,dx
|
||||
pop dx
|
||||
ret
|
||||
random ENDP
|
||||
|
||||
setborder PROC NEAR
|
||||
push ax
|
||||
mov dx,3dah
|
||||
in al,dx
|
||||
mov dx,3c0h
|
||||
mov al,11h+20h
|
||||
out dx,al
|
||||
pop ax
|
||||
out dx,al
|
||||
ret
|
||||
setborder ENDP
|
||||
|
||||
init_stars PROC NEAR
|
||||
mov ax,13
|
||||
int 10h
|
||||
|
||||
mov dx,3dah
|
||||
in al,dx
|
||||
mov dx,3c0h
|
||||
xor al,al
|
||||
REPT 16
|
||||
out dx,al
|
||||
out dx,al
|
||||
inc al
|
||||
ENDM
|
||||
mov al,20h
|
||||
out dx,al
|
||||
|
||||
mov dx,3d4h
|
||||
mov al,9
|
||||
out dx,al
|
||||
inc dx
|
||||
in al,dx
|
||||
and al,127
|
||||
out dx,al
|
||||
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
xor di,di
|
||||
mov cx,32768
|
||||
xor ax,ax
|
||||
rep stosw
|
||||
|
||||
mov ah,43h
|
||||
mov bx,32
|
||||
int 67h
|
||||
mov cs:emmhandle,dx
|
||||
|
||||
mov ah,41h
|
||||
int 67h
|
||||
mov cs:emmseg,bx
|
||||
|
||||
call clearsbu
|
||||
|
||||
mov cx,200
|
||||
mov ax,0
|
||||
mov dx,320/8
|
||||
mov bx,OFFSET rows1
|
||||
@@4: mov cs:[bx],ax
|
||||
add ax,dx
|
||||
add bx,2
|
||||
loop @@4
|
||||
|
||||
mov cx,400
|
||||
mov ax,0
|
||||
mov dx,320/8
|
||||
mov bx,OFFSET rows
|
||||
@@4b: mov cs:[bx],ax
|
||||
add ax,dx
|
||||
add bx,2
|
||||
loop @@4b
|
||||
|
||||
mov ax,cs
|
||||
mov es,ax
|
||||
|
||||
mov di,OFFSET star
|
||||
mov cx,STARS
|
||||
@@3: mov al,cl
|
||||
dec al
|
||||
xor ah,ah
|
||||
stosw
|
||||
call random
|
||||
and ax,1023
|
||||
sub ax,512
|
||||
stosw
|
||||
call random
|
||||
and ax,1023
|
||||
sub ax,512
|
||||
stosw
|
||||
xor ax,ax
|
||||
stosw
|
||||
loop @@3
|
||||
|
||||
mov di,OFFSET muldivy
|
||||
mov cx,256
|
||||
mov bp,130
|
||||
@@2b: mov dx,64
|
||||
xor ax,ax
|
||||
div bp
|
||||
shr ax,1
|
||||
stosw
|
||||
add bp,4
|
||||
loop @@2b
|
||||
|
||||
mov di,OFFSET muldivx
|
||||
mov cx,256
|
||||
mov bp,130
|
||||
@@2c: mov dx,80 ;64
|
||||
xor ax,ax
|
||||
div bp
|
||||
shr ax,1
|
||||
stosw
|
||||
add bp,4
|
||||
loop @@2c
|
||||
|
||||
mov cs:starlimit,STARS
|
||||
mov cs:starpalfade,0
|
||||
|
||||
mov cs:startxtopen,-256
|
||||
mov cs:startxtclose,800
|
||||
|
||||
mov cx,100
|
||||
@@sa: push cx
|
||||
call staradd
|
||||
pop cx
|
||||
loop @@sa
|
||||
ret
|
||||
init_stars ENDP
|
||||
|
||||
deinit_stars PROC NEAR
|
||||
mov ah,45h
|
||||
mov dx,cs:emmhandle
|
||||
int 67h
|
||||
ret
|
||||
deinit_stars ENDP
|
||||
|
||||
fetch4ax PROC NEAR
|
||||
mov bx,ax
|
||||
push ax
|
||||
mov ax,4400h
|
||||
shr bx,2
|
||||
mov dx,cs:emmhandle
|
||||
int 67h
|
||||
pop ax
|
||||
and ax,3
|
||||
shl ax,12-4
|
||||
add ax,cs:emmseg
|
||||
ret
|
||||
fetch4ax ENDP
|
||||
|
||||
clearsbu PROC NEAR
|
||||
mov cx,128
|
||||
mov ax,0
|
||||
@@1: push cx
|
||||
push ax
|
||||
call fetch4ax
|
||||
mov es,ax
|
||||
mov cx,4096/4
|
||||
xor eax,eax
|
||||
xor di,di
|
||||
rep stosd
|
||||
pop ax
|
||||
pop cx
|
||||
inc ax
|
||||
loop @@1
|
||||
ret
|
||||
clearsbu ENDP
|
||||
|
||||
staradd PROC NEAR
|
||||
mov ax,cs:emmpage4
|
||||
inc ax
|
||||
and ax,127
|
||||
mov cs:emmpage4,ax
|
||||
call fetch4ax
|
||||
mov es,ax
|
||||
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
mov ax,ds:starlimit
|
||||
or ax,ax
|
||||
jz @@11
|
||||
dec ax
|
||||
mov ds:starlimit,ax
|
||||
@@11: mov bp,STARS
|
||||
mov si,OFFSET star
|
||||
@@1: movzx bx,ds:[si]
|
||||
sub bl,2
|
||||
mov ds:[si],bl
|
||||
jc @@4
|
||||
cmp bp,cs:starlimit
|
||||
jb @@2
|
||||
shl bx,1
|
||||
mov ax,ds:[si+4]
|
||||
imul ds:muldivy[bx]
|
||||
shld dx,ax,2
|
||||
add dx,100
|
||||
cmp dx,99
|
||||
ja @@2
|
||||
mov cx,dx
|
||||
mov ax,ds:[si+2]
|
||||
imul ds:muldivx[bx]
|
||||
mov bx,cx
|
||||
shld dx,ax,2
|
||||
add dx,160
|
||||
cmp dx,319
|
||||
ja @@2
|
||||
mov cl,dl
|
||||
and cl,7
|
||||
shr dx,3
|
||||
shl bx,1
|
||||
mov bx,ds:rows1[bx]
|
||||
add bx,dx
|
||||
mov ch,80h
|
||||
shr ch,cl
|
||||
or byte ptr es:[bx],ch
|
||||
@@2: add si,8
|
||||
dec bp
|
||||
jnz @@1
|
||||
ret
|
||||
@@4: call random
|
||||
and ax,1023
|
||||
sub ax,512
|
||||
mov cs:[si+2],ax
|
||||
call random
|
||||
and ax,1023
|
||||
sub ax,512
|
||||
mov cs:[si+4],ax
|
||||
jmp @@2
|
||||
staradd ENDP
|
||||
|
||||
risetext PROC NEAR
|
||||
mov ax,cs:startxtopen
|
||||
cmp ax,100
|
||||
jge @@12
|
||||
inc ax
|
||||
mov cs:startxtopen,ax
|
||||
@@12: mov dx,cs:startxtclose
|
||||
cmp dx,0
|
||||
jle @@21
|
||||
dec dx
|
||||
mov cs:startxtclose,dx
|
||||
@@21: cmp dx,ax
|
||||
jge @@22
|
||||
mov ax,dx
|
||||
@@22: ;ax=startxtuse
|
||||
|
||||
cmp ax,0
|
||||
jg @@tcc
|
||||
jmp @@tc0
|
||||
@@tcc: cmp ax,1
|
||||
jg @@tnz
|
||||
mov ax,2
|
||||
@@tnz: push ax
|
||||
mov di,250
|
||||
sub di,ax
|
||||
mov cs:_nostar2,ax
|
||||
mov ax,40
|
||||
mul di
|
||||
mov di,ax
|
||||
inc di
|
||||
mov cs:_nostar1,di
|
||||
dec di
|
||||
mov ax,SEG _textpic
|
||||
mov ds,ax
|
||||
mov si,040h
|
||||
add si,cs:startxtp0
|
||||
pop cx
|
||||
dec cx
|
||||
|
||||
sub di,80
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
xor eax,eax
|
||||
zzz=0
|
||||
REPT 80/4
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add di,80
|
||||
dec cx
|
||||
jz @@tc0c
|
||||
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
mov eax,-1
|
||||
zzz=0
|
||||
REPT 40/4
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add di,40
|
||||
dec cx
|
||||
jz @@tc0
|
||||
dec cx
|
||||
jz @@tc0b
|
||||
|
||||
mov dx,3ceh
|
||||
mov ax,0400h
|
||||
out dx,ax
|
||||
mov ax,01h+400h+800h
|
||||
out dx,ax
|
||||
|
||||
@@tc1: mov dx,3c4h
|
||||
mov ax,0102h+400h+800h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add si,40
|
||||
mov dx,3c4h
|
||||
mov ax,0202h+400h+800h
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add si,40
|
||||
add di,40
|
||||
dec cx
|
||||
jz @@tc0b
|
||||
jmp @@tc1
|
||||
|
||||
@@tc0b: mov dx,3ceh
|
||||
mov ax,0001h
|
||||
out dx,ax
|
||||
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
mov eax,-1
|
||||
zzz=0
|
||||
REPT 40/4
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
add di,40
|
||||
|
||||
dec di
|
||||
mov cs:_nostar2,di
|
||||
@@tc0: ret
|
||||
@@tc0c: mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
xor eax,eax
|
||||
zzz=0
|
||||
REPT 80/4
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
ret
|
||||
risetext ENDP
|
||||
|
||||
do_stars PROC NEAR
|
||||
@@aga: mov al,0
|
||||
;call setborder
|
||||
|
||||
mov dx,3d4h
|
||||
mov ax,cs:starvram
|
||||
cmp ax,0a000h
|
||||
je @@sw1
|
||||
mov cs:starvram,0a000h
|
||||
mov ax,400ch
|
||||
jmp @@sw0
|
||||
@@sw1: mov cs:starvram,0a400h
|
||||
mov ax,000ch
|
||||
@@sw0: out dx,ax
|
||||
call waitb
|
||||
|
||||
mov al,5
|
||||
;call setborder
|
||||
|
||||
cmp cs:starpalfade,32
|
||||
ja @@p1
|
||||
|
||||
mov bl,cs:starpalfade
|
||||
inc bl
|
||||
mov cs:starpalfade,bl
|
||||
shl bl,3
|
||||
jnc @@p2
|
||||
mov bl,255
|
||||
@@p2:
|
||||
mov dx,3c8h
|
||||
xor al,al
|
||||
out dx,al
|
||||
inc dx
|
||||
|
||||
mov al,0
|
||||
out dx,al
|
||||
mov al,0
|
||||
out dx,al
|
||||
mov al,0
|
||||
out dx,al
|
||||
|
||||
mov al,5
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,35
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,35
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
|
||||
mov al,30
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,50
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,50
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
|
||||
mov al,61
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,61
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
mov al,61
|
||||
mul bl
|
||||
mov al,ah
|
||||
out dx,al
|
||||
|
||||
;-----
|
||||
|
||||
mov al,0
|
||||
out dx,al
|
||||
mov al,0
|
||||
out dx,al
|
||||
mov al,0
|
||||
out dx,al
|
||||
|
||||
mov al,10
|
||||
out dx,al
|
||||
mov al,20
|
||||
out dx,al
|
||||
mov al,35
|
||||
out dx,al
|
||||
|
||||
mov al,20
|
||||
out dx,al
|
||||
mov al,30
|
||||
out dx,al
|
||||
mov al,45
|
||||
out dx,al
|
||||
|
||||
mov al,30
|
||||
out dx,al
|
||||
mov al,40
|
||||
out dx,al
|
||||
mov al,60
|
||||
out dx,al
|
||||
@@p1:
|
||||
mov ax,cs:starframe
|
||||
inc ax
|
||||
mov cs:starframe,ax
|
||||
cmp ax,4
|
||||
jne @@st1
|
||||
mov cs:startxtp0,80
|
||||
mov cs:startxtopen,-256-100
|
||||
mov cs:startxtclose,800+100
|
||||
@@st1: cmp ax,1200
|
||||
jne @@st2
|
||||
mov cs:startxtp0,101*80
|
||||
mov cs:startxtopen,-256
|
||||
mov cs:startxtclose,800
|
||||
@@st2:
|
||||
call risetext
|
||||
|
||||
call staradd
|
||||
|
||||
mov ax,es
|
||||
mov ds,ax
|
||||
xor si,si
|
||||
|
||||
mov dx,3c4h
|
||||
mov ax,0102h
|
||||
out dx,ax
|
||||
|
||||
mov ax,cs:starvram
|
||||
mov es,ax
|
||||
xor di,di
|
||||
mov cx,100
|
||||
@@3: zzz=0
|
||||
cmp di,cs:_nostar1
|
||||
jl @@3g
|
||||
cmp di,cs:_nostar2
|
||||
jg @@3g
|
||||
jmp @@3s
|
||||
@@3g: REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
@@3s: add si,40
|
||||
add di,80
|
||||
loop @@3
|
||||
|
||||
mov ax,cs:emmpage4
|
||||
add ax,32
|
||||
and ax,127
|
||||
call fetch4ax
|
||||
mov ds,ax
|
||||
mov si,99*40
|
||||
mov cx,100
|
||||
@@5: zzz=0
|
||||
cmp di,cs:_nostar1
|
||||
jl @@5g
|
||||
cmp di,cs:_nostar2
|
||||
jg @@5g
|
||||
jmp @@5s
|
||||
@@5g: REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
@@5s: sub si,40
|
||||
add di,80
|
||||
loop @@5
|
||||
|
||||
mov dx,3c4h
|
||||
mov ax,0202h
|
||||
out dx,ax
|
||||
|
||||
mov di,40
|
||||
mov ax,cs:emmpage4
|
||||
add ax,64
|
||||
and ax,127
|
||||
call fetch4ax
|
||||
mov ds,ax
|
||||
xor si,si
|
||||
mov cx,100
|
||||
@@7: zzz=0
|
||||
cmp di,cs:_nostar1
|
||||
jl @@7g
|
||||
cmp di,cs:_nostar2
|
||||
jg @@7g
|
||||
jmp @@7s
|
||||
@@7g: REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
@@7s: add si,40
|
||||
add di,80
|
||||
loop @@7
|
||||
|
||||
mov ax,cs:emmpage4
|
||||
add ax,96
|
||||
and ax,127
|
||||
call fetch4ax
|
||||
mov ds,ax
|
||||
mov si,99*40
|
||||
mov cx,100
|
||||
@@8: zzz=0
|
||||
cmp di,cs:_nostar1
|
||||
jl @@8g
|
||||
cmp di,cs:_nostar2
|
||||
jg @@8g
|
||||
jmp @@8s
|
||||
@@8g: REPT 40/4
|
||||
mov eax,ds:[si+zzz]
|
||||
mov es:[di+zzz],eax
|
||||
zzz=zzz+4
|
||||
ENDM
|
||||
@@8s: sub si,40
|
||||
add di,80
|
||||
loop @@8
|
||||
|
||||
; mov dx,3c4h
|
||||
; mov ax,0f02h
|
||||
; out dx,ax
|
||||
; mov cs:polysides,4
|
||||
; mov dword ptr cs:polyxy[0], 10000h*10+10+01000000h
|
||||
; mov dword ptr cs:polyxy[4], 10000h*310+10+01000000h
|
||||
; mov dword ptr cs:polyxy[8], 10000h*310+390+01000000h
|
||||
; mov dword ptr cs:polyxy[12],10000h*10+390+01000000h
|
||||
; int 3
|
||||
; call poly
|
||||
|
||||
mov bx,2
|
||||
int 0fch
|
||||
or ax,ax
|
||||
jz @@aga
|
||||
ret
|
||||
do_stars ENDP
|
||||
241
DDSTARS/STARS.PRE
Normal file
241
DDSTARS/STARS.PRE
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
;included to koe.asm
|
||||
|
||||
.386
|
||||
|
||||
STARS equ 4800
|
||||
|
||||
rows1 dw 100 dup(0)
|
||||
dw 2*28 dup(64000)
|
||||
dw 100 dup(0)
|
||||
|
||||
d1seg dw 0
|
||||
d1segp dw 4
|
||||
d2seg dw 0
|
||||
d2segp dw 4
|
||||
d3seg dw 0
|
||||
d3segp dw 4
|
||||
d4seg dw 0
|
||||
d4segp dw 4
|
||||
|
||||
ALIGN 2
|
||||
seed1 dw 1234
|
||||
seed2 dw 1234h
|
||||
random PROC NEAR
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
mov ax,ds:seed1
|
||||
mov bx,ds:seed2
|
||||
mov cx,ax
|
||||
mov dx,bx
|
||||
add cx,bx
|
||||
add ax,bx
|
||||
rol ax,cl
|
||||
xor ax,dx
|
||||
xchg cl,ch
|
||||
add bx,cx
|
||||
add dx,bx
|
||||
add cx,ax
|
||||
ror bx,1
|
||||
sbb ax,dx
|
||||
mov ds:seed2,dx
|
||||
mov ds:seed1,ax
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
ret
|
||||
random ENDP
|
||||
|
||||
setborder PROC NEAR
|
||||
push ax
|
||||
mov dx,3dah
|
||||
in al,dx
|
||||
mov dx,3c0h
|
||||
mov al,11h+20h
|
||||
out dx,al
|
||||
pop ax
|
||||
out dx,al
|
||||
ret
|
||||
setborder ENDP
|
||||
|
||||
brandom PROC NEAR
|
||||
call random
|
||||
mov bx,ax
|
||||
call random
|
||||
rol ax,4
|
||||
xor ax,bx
|
||||
ret
|
||||
brandom ENDP
|
||||
|
||||
ALIGN 2
|
||||
tmpx dw 0,0
|
||||
tmpy dw 0,0
|
||||
|
||||
init_stars_2 PROC NEAR
|
||||
@@6: call brandom
|
||||
shr ax,6
|
||||
sub ax,512
|
||||
cwd
|
||||
shld dx,ax,7
|
||||
shl ax,7
|
||||
mov ds:tmpx[0],ax
|
||||
mov ds:tmpx[2],dx
|
||||
|
||||
call brandom
|
||||
shr ax,6
|
||||
sub ax,512
|
||||
cwd
|
||||
shld dx,ax,7
|
||||
shl ax,7
|
||||
mov ds:tmpy[0],ax
|
||||
mov ds:tmpy[2],dx
|
||||
|
||||
mov cx,128
|
||||
mov bp,64+1024
|
||||
mov si,di
|
||||
@@5: mov ax,ds:tmpx[0]
|
||||
mov dx,ds:tmpx[2]
|
||||
idiv bp
|
||||
add ax,100
|
||||
cmp ax,199
|
||||
ja @@7
|
||||
mov bx,ax
|
||||
shl bx,1
|
||||
mov bx,ds:rows1[bx]
|
||||
mov ax,ds:tmpy[0]
|
||||
mov dx,ds:tmpy[2]
|
||||
idiv bp
|
||||
add ax,160
|
||||
cmp ax,319
|
||||
ja @@7
|
||||
add bx,ax
|
||||
;mov byte ptr fs:[bx],2
|
||||
mov es:[di],bx
|
||||
add di,2
|
||||
jz @@8
|
||||
sub bp,8
|
||||
loop @@5
|
||||
@@7: jmp @@6
|
||||
|
||||
@@8: mov word ptr es:[si],64000
|
||||
add si,2
|
||||
jnz @@8
|
||||
ret
|
||||
init_stars_2 ENDP
|
||||
|
||||
init_stars PROC NEAR
|
||||
mov ax,13h
|
||||
int 10h
|
||||
;set screen width to 320-8 pixs
|
||||
mov dx,3d4h
|
||||
mov al,11h
|
||||
out dx,al
|
||||
inc dx
|
||||
in al,dx
|
||||
and al,127
|
||||
out dx,al
|
||||
;
|
||||
mov ah,48h
|
||||
mov bx,4096
|
||||
int 21h
|
||||
mov cs:d1seg,ax
|
||||
mov ah,48h
|
||||
mov bx,4096
|
||||
int 21h
|
||||
mov cs:d2seg,ax
|
||||
mov ah,48h
|
||||
mov bx,4096
|
||||
int 21h
|
||||
mov cs:d3seg,ax
|
||||
mov ah,48h
|
||||
mov bx,4096
|
||||
int 21h
|
||||
mov cs:d4seg,ax
|
||||
|
||||
mov cx,200
|
||||
mov ax,0
|
||||
mov dx,320
|
||||
mov bx,OFFSET rows1
|
||||
@@4: mov cs:[bx],ax
|
||||
add ax,dx
|
||||
add bx,2
|
||||
loop @@4
|
||||
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
mov ax,0a000h
|
||||
mov fs,ax
|
||||
|
||||
mov es,ds:d1seg
|
||||
xor di,di
|
||||
call init_stars_2
|
||||
|
||||
mov es,ds:d2seg
|
||||
xor di,di
|
||||
call init_stars_2
|
||||
|
||||
mov es,ds:d3seg
|
||||
xor di,di
|
||||
call init_stars_2
|
||||
|
||||
mov es,ds:d4seg
|
||||
xor di,di
|
||||
call init_stars_2
|
||||
|
||||
ret
|
||||
init_stars ENDP
|
||||
|
||||
do_stars_2 PROC NEAR
|
||||
mov ax,7
|
||||
zzz=0
|
||||
REPT 256*4
|
||||
mov ebx,ds:[si+zzz+0]
|
||||
mov es:[bx],ah
|
||||
shr ebx,16
|
||||
mov es:[bx],al
|
||||
zzz=zzz+64
|
||||
ENDM
|
||||
ret
|
||||
do_stars_2 ENDP
|
||||
|
||||
do_stars PROC NEAR
|
||||
@@aga: mov al,0
|
||||
call setborder
|
||||
call waitb
|
||||
mov al,1
|
||||
call setborder
|
||||
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
|
||||
mov ds,cs:d1seg
|
||||
mov si,cs:d1segp
|
||||
add si,2
|
||||
mov cs:d1segp,si
|
||||
; call do_stars_2
|
||||
|
||||
mov ds,cs:d2seg
|
||||
mov si,cs:d2segp
|
||||
add si,2
|
||||
mov cs:d2segp,si
|
||||
; call do_stars_2
|
||||
|
||||
mov ds,cs:d3seg
|
||||
mov si,cs:d3segp
|
||||
add si,2
|
||||
mov cs:d3segp,si
|
||||
; call do_stars_2
|
||||
|
||||
mov ds,cs:d4seg
|
||||
mov si,cs:d4segp
|
||||
add si,2
|
||||
mov cs:d4segp,si
|
||||
; call do_stars_2
|
||||
|
||||
mov bx,2
|
||||
int 0fch
|
||||
or ax,ax
|
||||
jnz @@end
|
||||
jmp @@aga
|
||||
@@end: ret
|
||||
do_stars ENDP
|
||||
24
DDSTARS/TEST/KOE.C
Normal file
24
DDSTARS/TEST/KOE.C
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <stdio.h>
|
||||
#include "graph.h"
|
||||
|
||||
main()
|
||||
{
|
||||
int x,y,z,sx,sy,a;
|
||||
_setvideomode(_VRES16COLOR);
|
||||
for(a=0;a<19200;a++)
|
||||
{
|
||||
x=a%26;
|
||||
y=a/26%26;
|
||||
z=a/26/26%26;
|
||||
x=(x-13)*64;
|
||||
y=(y-13)*64;
|
||||
z=z*32+64;
|
||||
sx=100*x/z+320;
|
||||
sy=100*y/z+240;
|
||||
if(a&1) _setcolor(15);
|
||||
else _setcolor(3+8);
|
||||
_setpixel(sx,sy);
|
||||
}
|
||||
getch();
|
||||
_setvideomode(_DEFAULTMODE);
|
||||
}
|
||||
BIN
DDSTARS/TEST/KOE.EXE
Normal file
BIN
DDSTARS/TEST/KOE.EXE
Normal file
Binary file not shown.
BIN
DDSTARS/TEXTS.16
Normal file
BIN
DDSTARS/TEXTS.16
Normal file
Binary file not shown.
BIN
DDSTARS/TEXTS.LBM
Normal file
BIN
DDSTARS/TEXTS.LBM
Normal file
Binary file not shown.
BIN
DDSTARS/_TEXTPIC.OBK
Normal file
BIN
DDSTARS/_TEXTPIC.OBK
Normal file
Binary file not shown.
Loading…
Reference in a new issue