Upload
This commit is contained in:
commit
43352ff262
1291 changed files with 220976 additions and 0 deletions
202
START/ASM.ASM
Normal file
202
START/ASM.ASM
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
include clink.inc
|
||||
code SEGMENT para public 'CODE'
|
||||
ASSUME cs:code
|
||||
LOCALS
|
||||
.386
|
||||
|
||||
waitb PROC NEAR
|
||||
mov dx,3dah
|
||||
@@1: in al,dx
|
||||
test al,8
|
||||
jnz @@1
|
||||
@@2: in al,dx
|
||||
test al,8
|
||||
jz @@2
|
||||
ret
|
||||
waitb ENDP
|
||||
|
||||
PUBLIC _waitb
|
||||
_waitb PROC FAR
|
||||
CBEG
|
||||
call waitb
|
||||
CEND
|
||||
_waitb ENDP
|
||||
|
||||
PUBLIC _setborder
|
||||
_setborder PROC FAR
|
||||
CBEG
|
||||
mov dx,3dah
|
||||
in al,dx
|
||||
mov dx,3c0h
|
||||
mov al,11h+32
|
||||
out dx,al
|
||||
movpar ax,0
|
||||
out dx,al
|
||||
CEND
|
||||
_setborder ENDP
|
||||
|
||||
PUBLIC _initvideo
|
||||
_initvideo PROC FAR
|
||||
CBEG
|
||||
mov ax,13h
|
||||
int 10h
|
||||
call waitb
|
||||
;clear palette
|
||||
mov dx,3c8h
|
||||
xor al,al
|
||||
out dx,al
|
||||
inc dx
|
||||
mov cx,768
|
||||
@@1: out dx,al
|
||||
loop @@1
|
||||
;400 rows
|
||||
mov dx,3d4h
|
||||
mov ax,00009h
|
||||
out dx,ax
|
||||
;tweak
|
||||
mov ax,00014h
|
||||
out dx,ax
|
||||
mov ax,0e317h
|
||||
out dx,ax
|
||||
mov dx,3c4h
|
||||
mov ax,0604h
|
||||
out dx,ax
|
||||
;
|
||||
mov dx,3c4h
|
||||
mov ax,0f02h
|
||||
out dx,ax
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
xor di,di
|
||||
mov cx,32768
|
||||
xor ax,ax
|
||||
rep stosw
|
||||
;
|
||||
;640 wide
|
||||
mov dx,3d4h
|
||||
mov ax,05013h
|
||||
out dx,ax
|
||||
CEND
|
||||
_initvideo ENDP
|
||||
|
||||
PUBLIC _deinitvideo
|
||||
_deinitvideo PROC FAR
|
||||
CBEG
|
||||
mov ax,3h
|
||||
int 10h
|
||||
CEND
|
||||
_deinitvideo ENDP
|
||||
|
||||
PUBLIC _loadpal
|
||||
_loadpal PROC FAR
|
||||
CBEG
|
||||
call waitb
|
||||
;clear palette
|
||||
mov dx,3c8h
|
||||
xor al,al
|
||||
out dx,al
|
||||
inc dx
|
||||
mov cx,768
|
||||
movpar si,0
|
||||
movpar ds,1
|
||||
rep outsb
|
||||
CEND
|
||||
_loadpal ENDP
|
||||
|
||||
PUBLIC _lineblit
|
||||
_lineblit PROC FAR
|
||||
CBEG
|
||||
movpar ax,0
|
||||
mov cx,160
|
||||
mul cx
|
||||
mov di,ax
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
movpar si,1
|
||||
movpar ds,2
|
||||
zpl=0
|
||||
REPT 4
|
||||
mov dx,3c4h
|
||||
mov ax,02h+(100h shl zpl)
|
||||
out dx,ax
|
||||
zzz=0
|
||||
REPT 160/2
|
||||
mov al,ds:[si+(zzz+0)*4+zpl]
|
||||
mov ah,ds:[si+(zzz+1)*4+zpl]
|
||||
mov es:[di+zzz],ax
|
||||
zzz=zzz+2
|
||||
ENDM
|
||||
zpl=zpl+1
|
||||
ENDM
|
||||
rep outsb
|
||||
CEND
|
||||
_lineblit ENDP
|
||||
|
||||
PUBLIC _pget
|
||||
_pget PROC FAR
|
||||
CBEG
|
||||
movpar bx,1
|
||||
mov ax,160
|
||||
mul bx
|
||||
mov di,ax
|
||||
movpar dx,0
|
||||
mov ax,dx
|
||||
shr dx,2
|
||||
add di,dx
|
||||
mov ah,al
|
||||
and ah,3
|
||||
mov al,4
|
||||
mov dx,3ceh
|
||||
out dx,ax
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
mov al,es:[di]
|
||||
xor ah,ah
|
||||
CEND
|
||||
_pget ENDP
|
||||
|
||||
PUBLIC _pset
|
||||
_pset PROC FAR
|
||||
CBEG
|
||||
movpar bx,1
|
||||
mov ax,160
|
||||
mul bx
|
||||
mov di,ax
|
||||
movpar cx,0
|
||||
mov ax,cx
|
||||
shr ax,2
|
||||
add di,ax
|
||||
mov ax,0102h
|
||||
and cl,3
|
||||
shl ah,cl
|
||||
mov dx,3c4h
|
||||
out dx,ax
|
||||
mov ax,0a000h
|
||||
mov es,ax
|
||||
movpar ax,2
|
||||
mov es:[di],al
|
||||
CEND
|
||||
_pset ENDP
|
||||
|
||||
PUBLIC _setpalarea
|
||||
_setpalarea PROC FAR
|
||||
CBEG
|
||||
movpar si,0
|
||||
movpar ds,1
|
||||
movpar cx,3
|
||||
movpar ax,2
|
||||
mov dx,3c8h
|
||||
out dx,al
|
||||
movpar ax,3
|
||||
mov cx,ax
|
||||
shl cx,1
|
||||
add cx,ax
|
||||
inc dx
|
||||
rep outsb
|
||||
sti
|
||||
CEND
|
||||
_setpalarea ENDP
|
||||
|
||||
code ENDS
|
||||
END
|
||||
|
||||
BIN
START/ASM.OBJ
Normal file
BIN
START/ASM.OBJ
Normal file
Binary file not shown.
41
START/CLINK.INC
Normal file
41
START/CLINK.INC
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
FIXWORD MACRO ;go to word boundary
|
||||
if ($-start) mod 1
|
||||
db 0
|
||||
endif
|
||||
ENDM
|
||||
|
||||
CDS MACRO
|
||||
mov ax,cs
|
||||
mov ds,ax
|
||||
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
|
||||
|
||||
CBEG0 MACRO ;C/Assembler procedure begin, minimal
|
||||
push bp
|
||||
mov bp,sp
|
||||
ENDM
|
||||
|
||||
CEND0 MACRO ;C/Assembler procedure end, minimal
|
||||
pop bp
|
||||
ret
|
||||
ENDM
|
||||
|
||||
movpar MACRO reg,par ;loads parameter [par(0..)] to register [reg]
|
||||
mov reg,[bp+par*2+6]
|
||||
ENDM
|
||||
|
||||
2
START/DOHZ.BAT
Normal file
2
START/DOHZ.BAT
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
lbm2p hzpic.lbm hzpic.p
|
||||
doobj hzpic.p _hzpic _hzpic.obj
|
||||
BIN
START/DP_PREFS
Normal file
BIN
START/DP_PREFS
Normal file
Binary file not shown.
BIN
START/HZPIC.LBM
Normal file
BIN
START/HZPIC.LBM
Normal file
Binary file not shown.
BIN
START/HZPIC.P
Normal file
BIN
START/HZPIC.P
Normal file
Binary file not shown.
BIN
START/HZPIC.PAL
Normal file
BIN
START/HZPIC.PAL
Normal file
Binary file not shown.
222
START/MAIN.C
Normal file
222
START/MAIN.C
Normal file
|
|
@ -0,0 +1,222 @@
|
|||
// THIS CODE SUCKS!
|
||||
|
||||
#include <stdio.h>
|
||||
#include "..\dis\dis.h"
|
||||
|
||||
extern char hzpic[];
|
||||
|
||||
char font[31][640];
|
||||
|
||||
char *vram=(char *)0xa0000000L;
|
||||
char palette[768];
|
||||
char palette2[768];
|
||||
char rowbuf[640];
|
||||
|
||||
char fade1[64][576];
|
||||
char fade2[64][576];
|
||||
|
||||
char *fonaorder="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
int fonap[256];
|
||||
int fonaw[256];
|
||||
|
||||
#include "readp.c"
|
||||
|
||||
void prt(int x,int y,char *txt)
|
||||
{
|
||||
int x2w,x2,y2,y2w=y+32,sx,d;
|
||||
while(*txt)
|
||||
{
|
||||
x2w=fonaw[*txt]+x;
|
||||
sx=fonap[*txt];
|
||||
for(x2=x;x2<x2w;x2++)
|
||||
{
|
||||
for(y2=y;y2<y2w;y2++)
|
||||
{
|
||||
d=font[y2-y][sx];
|
||||
pset(x2,y2,pget(x2,y2)|d);
|
||||
}
|
||||
sx++;
|
||||
}
|
||||
x=x2+2;
|
||||
txt++;
|
||||
}
|
||||
}
|
||||
|
||||
void prtc(int x,int y,char *txt)
|
||||
{
|
||||
int w=0;
|
||||
char *t=txt;
|
||||
while(*t) w+=fonaw[*t++]+2;
|
||||
prt(x-w/2,y,txt);
|
||||
}
|
||||
|
||||
void dofade2(int wait)
|
||||
{
|
||||
int x;
|
||||
for(x=0;x<64;x++)
|
||||
{
|
||||
waitb();
|
||||
setpalarea(fade2[x],64,192);
|
||||
}
|
||||
for(x=0;x<wait && !kbhit();x++) waitb();
|
||||
for(x=63;x>=0;x--)
|
||||
{
|
||||
waitb();
|
||||
setpalarea(fade2[x],64,192);
|
||||
}
|
||||
}
|
||||
|
||||
void dofadef(void)
|
||||
{
|
||||
char tmp[64*3];
|
||||
int x,y;
|
||||
for(y=0;y<=64;y++)
|
||||
{
|
||||
for(x=0;x<64*3;x++)
|
||||
{
|
||||
tmp[x]=(palette[x]*y>>6);
|
||||
}
|
||||
waitb();
|
||||
setpalarea(tmp,0,64);
|
||||
}
|
||||
}
|
||||
|
||||
void dofade(int wait)
|
||||
{
|
||||
int x;
|
||||
for(x=0;x<64;x++)
|
||||
{
|
||||
waitb();
|
||||
setpalarea(fade1[x],64,192);
|
||||
}
|
||||
for(x=0;x<wait;x++) waitb();
|
||||
for(x=63;x>=0;x--)
|
||||
{
|
||||
waitb();
|
||||
setpalarea(fade1[x],64,192);
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
int a,b,x,y;
|
||||
int zimz;
|
||||
initvideo();
|
||||
readp(palette,-1,hzpic);
|
||||
for(y=0;y<256;y++)
|
||||
{
|
||||
readp(rowbuf,y,hzpic);
|
||||
lineblit(y+64,rowbuf);
|
||||
}
|
||||
for(y=0;y<32;y++)
|
||||
{
|
||||
readp(font[y],y+300,hzpic);
|
||||
for(a=0;a<640;a++)
|
||||
{
|
||||
switch(font[y][a])
|
||||
{
|
||||
case 0x40 : b=0xc0; break;
|
||||
case 0x41 : b=0x80; break;
|
||||
case 0x42 : b=0x40; break;
|
||||
default : b=0;
|
||||
}
|
||||
font[y][a]=b;
|
||||
}
|
||||
}
|
||||
for(y=0;y<768;y+=3)
|
||||
{
|
||||
if(y<64*3) ;
|
||||
else if(y<128*3)
|
||||
{
|
||||
palette2[y+0]=palette[0x42*3+0];
|
||||
palette2[y+1]=palette[0x42*3+1];
|
||||
palette2[y+2]=palette[0x42*3+2];
|
||||
}
|
||||
else if(y<192*3)
|
||||
{
|
||||
palette2[y+0]=palette[0x41*3+0];
|
||||
palette2[y+1]=palette[0x41*3+1];
|
||||
palette2[y+2]=palette[0x41*3+2];
|
||||
}
|
||||
else
|
||||
{
|
||||
palette2[y+0]=palette[0x40*3+0];
|
||||
palette2[y+1]=palette[0x40*3+1];
|
||||
palette2[y+2]=palette[0x40*3+2];
|
||||
}
|
||||
}
|
||||
for(y=192;y<768;y++)
|
||||
{
|
||||
palette[y]=palette[y-192];
|
||||
}
|
||||
for(x=0;x<64;x++)
|
||||
{
|
||||
for(y=0;y<576;y++)
|
||||
{
|
||||
fade1[x][y]=(palette2[y+192]*x+palette[y+192]*(63-x))/63;
|
||||
fade2[x][y]=(palette2[y+192]*x)/63;
|
||||
}
|
||||
}
|
||||
|
||||
for(x=0;x<640 && *fonaorder;)
|
||||
{
|
||||
while(x<640)
|
||||
{
|
||||
for(y=0;y<32;y++) if(font[y][x]) break;
|
||||
if(y!=32) break;
|
||||
x++;
|
||||
}
|
||||
b=x;
|
||||
while(x<640)
|
||||
{
|
||||
for(y=0;y<32;y++) if(font[y][x]) break;
|
||||
if(y==32) break;
|
||||
x++;
|
||||
}
|
||||
//printf("%c: %i %i\n",*fonaorder,b,x-b);
|
||||
fonap[*fonaorder]=b;
|
||||
fonaw[*fonaorder]=x-b;
|
||||
fonaorder++;
|
||||
}
|
||||
fonap[32]=640-20;
|
||||
fonaw[32]=16;
|
||||
setpalarea(fade2[0],64,192);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
prtc(160,140,"A");
|
||||
prtc(160,180,"Future Crew");
|
||||
prtc(160,220,"production");
|
||||
dofade2(300);
|
||||
if(kbhit()) break;
|
||||
|
||||
prtc(160,140,"First presented at");
|
||||
prtc(160,220,"Assembly NoNumbers");
|
||||
dofade2(300);
|
||||
if(kbhit()) break;
|
||||
|
||||
dofadef();
|
||||
if(kbhit()) break;
|
||||
|
||||
prtc(100,140,"Graphics");
|
||||
prtc(100,200,"Pixel");
|
||||
prtc(100,240,"Marvel");
|
||||
dofade(300);
|
||||
if(kbhit()) break;
|
||||
|
||||
prtc(100,140,"Music");
|
||||
prtc(100,200,"Purple Motioon");
|
||||
prtc(100,240,"Skaven");
|
||||
dofade(300);
|
||||
if(kbhit()) break;
|
||||
|
||||
prtc(100,140,"Code");
|
||||
prtc(100,200,"Trug");
|
||||
prtc(100,240,"Wildfire");
|
||||
prtc(100,280,"Psi");
|
||||
dofade(300);
|
||||
if(kbhit()) break;
|
||||
}
|
||||
getch();
|
||||
deinitvideo();
|
||||
}
|
||||
BIN
START/MAIN.OBJ
Normal file
BIN
START/MAIN.OBJ
Normal file
Binary file not shown.
17
START/MAKEFILE
Normal file
17
START/MAKEFILE
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
all : s.exe
|
||||
|
||||
objs=main.obj _hzpic.obj asm.obj
|
||||
|
||||
asm_f = /ML /m2 /s /JJUMPS
|
||||
c_f = /AL /c /W2 /Oxaz
|
||||
|
||||
.asm.obj :
|
||||
tasm $(asm_f) $<
|
||||
|
||||
.c.obj :
|
||||
cl $(c_f) $<
|
||||
|
||||
s.exe : $(objs)
|
||||
link /E $(objs),s.exe,nul;
|
||||
|
||||
|
||||
42
START/READP.C
Normal file
42
START/READP.C
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
struct st_readp
|
||||
{
|
||||
int magic;
|
||||
int wid;
|
||||
int hig;
|
||||
int cols;
|
||||
int add;
|
||||
};
|
||||
|
||||
void readp(char *dest,int row,char *src)
|
||||
{
|
||||
int bytes,a,b;
|
||||
struct st_readp *hdr;
|
||||
hdr=(struct st_readp *)src;
|
||||
if(row==-1)
|
||||
{
|
||||
memcpy(dest,src+16,hdr->cols*3);
|
||||
return;
|
||||
}
|
||||
if(row>=hdr->hig) return;
|
||||
src+=hdr->add*16;
|
||||
while(row)
|
||||
{
|
||||
src+=*(int *)src;
|
||||
src+=2;
|
||||
row--;
|
||||
}
|
||||
bytes=*(int *)src;
|
||||
src+=2;
|
||||
while(bytes--)
|
||||
{
|
||||
a=*src++;
|
||||
if(a&0x80)
|
||||
{
|
||||
b=*src++;
|
||||
bytes--;
|
||||
a&=0x7f;
|
||||
while(a--) *dest++=b;
|
||||
}
|
||||
else *dest++=a;
|
||||
}
|
||||
}
|
||||
BIN
START/S.EXE
Normal file
BIN
START/S.EXE
Normal file
Binary file not shown.
BIN
START/_HZPIC.OBJ
Normal file
BIN
START/_HZPIC.OBJ
Normal file
Binary file not shown.
Loading…
Reference in a new issue