This commit is contained in:
Frater 2017-09-24 01:45:36 +02:00
commit 43352ff262
1291 changed files with 220976 additions and 0 deletions

26
DIS/DIS.ASM Normal file
View file

@ -0,0 +1,26 @@
code SEGMENT para public 'CODE'
ASSUME cs:code
rtext: db 13,10
db 'Demo Int Server (DIS) V1.0 Copyright (C) 1993 The Future Crew',13,10
include disdate.inc
db 13,10,'Installed (int fc).',13,10
db "NOTE: This DIS server doesn't support copper or music syncronization!",13,10
db '$',26
rstart: mov ax,cs
mov ds,ax
mov dx,OFFSET rtext
mov ah,9
int 21h
call dis_setint
mov ax,3100h
mov dx,(rend-rstart+600)/16
int 21h
include disint.asm
rend LABEL BYTE
code ENDS
END rstart

BIN
DIS/DIS.EXE Normal file

Binary file not shown.

59
DIS/DIS.H Normal file
View file

@ -0,0 +1,59 @@
/* Demo Int Server (DIS) V1.0 - Header & documentation file */
extern int dis_version(void);
/* Initialize dis. IMPORTANT. This routine must be called at start of each
** demo part, it will clear the exitkey flag and do other stuff as well...
** returns version number
** 0x100=V1.0
** 0=dis not installed!
*/
extern int dis_indemo(void);
/* Returns status if the actual demo is running.
** 0=part run from dos
** 1=part run from demo (no mode switches etc)
*/
extern int dis_waitb(void);
/* waits for border, retuns number of frames since last call.
** (currently returns always 1)
*/
extern int dis_exit(void);
/* returns 1 if part should exit, 0 if not.
** Currently any key press sets dis_exit return status to 1.
*/
extern void dis_partstart(void);
/* initializes dis (calls dis_version), if dis is not detected
** exits to dos with an error msg.
*/
extern void * dis_msgarea(int areanumber);
/* returns a pointer to a 64 byte interpart communications area.
** areanumber is 0..3
*/
extern int dis_muscode(int);
/* returns a music syncronization code. As a parameter, give the
** code you are waiting, so a skip can be easily done by DIS.
*/
extern int dis_musplus(void);
/* returns a music syncronization code. As a parameter, give the
** code you are waiting, so a skip can be easily done by DIS.
*/
extern int dis_musrow(int);
/* returns a music syncronization code. As a parameter, give the
** code you are waiting, so a skip can be easily done by DIS.
*/
extern void dis_setcopper(int routine_number,void (*routine)(void));
/* routine=1(top of screen)/2(bottom of screen)/3(retrace)
** routine=pointer to routine
*/
void _dis_setmframe(int frame);
int _dis_getmframe(void);
int _dis_sync(void);

8
DIS/DIS.MAP Normal file
View file

@ -0,0 +1,8 @@
Start Stop Length Name Class
00000H 00070H 00071H CODE CODE
Program entry point at 0000:005A
Warning: No stack

BIN
DIS/DIS.OBJ Normal file

Binary file not shown.

173
DIS/DISC.ASM Normal file
View file

@ -0,0 +1,173 @@
;DIS - C interface, Large memory model
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
movpar MACRO reg,par ;loads parameter [par(0..)] to register [reg]
mov reg,[bp+par*2+6]
ENDM
text_disc SEGMENT para public 'CODE'
ASSUME cs:text_disc
LOCALS
public _dis_version ;int _dis_version(void)
_dis_version PROC FAR
xor ax,ax
mov es,ax
mov bx,es:[0fch*4+0]
mov es,es:[0fch*4+2]
cmp es:[bx-2],0fc0h
jne @@1
cmp es:[bx-4],0fc0h
jne @@1
xor bx,bx
int 0fch
@@1: ret
_dis_version ENDP
public _dis_waitb ;int _dis_waitb(void)
_dis_waitb PROC FAR
mov bx,1
int 0fch
ret
_dis_waitb ENDP
error_nodis db 'ERROR: DIS not loaded.$'
public _dis_partstart ;void _dis_partstart(void)
_dis_partstart PROC FAR
call _dis_version
cmp ax,0
jne @@1
mov ax,cs
mov ds,ax
mov dx,OFFSET error_nodis
mov ah,9
int 21h
mov ax,4c03h
int 21h
@@1: ret
_dis_partstart ENDP
public _dis_exit ;int _dis_exit(void)
_dis_exit PROC FAR
mov bx,2
int 0fch
ret
_dis_exit ENDP
public _dis_indemo ;int _dis_indemo(void)
_dis_indemo PROC FAR
mov bx,3
int 0fch
ret
_dis_indemo ENDP
public _dis_msgarea ;void *_dis_msgarea(void)
_dis_msgarea PROC FAR
push bp
mov bp,sp
mov ax,[bp+6]
mov bx,5
int 0fch
pop bp
ret
_dis_msgarea ENDP
public _dis_muscode ;int _dis_muscode(void)
_dis_muscode PROC FAR
push bp
mov bp,sp
mov ax,[bp+6]
mov bx,6
int 0fch
pop bp
ret
_dis_muscode ENDP
public _dis_musplus ;int _dis_musplus(void)
_dis_musplus PROC FAR
push bp
mov bp,sp
mov ax,[bp+6]
mov bx,6
int 0fch
mov ax,dx
pop bp
ret
_dis_musplus ENDP
public _dis_musrow ;int _dis_musrow(void)
_dis_musrow PROC FAR
push bp
mov bp,sp
mov bx,6
int 0fch
mov ax,bx
pop bp
ret
_dis_musrow ENDP
public _dis_setcopper ;void _dis_copper(int routine_number,void *routine)
_dis_setcopper PROC FAR
push bp
mov bp,sp
mov ax,[bp+6]
mov cx,[bp+8]
mov dx,[bp+10]
mov bx,7
int 0fch
pop bp
ret
_dis_setcopper ENDP
public _dis_setmframe ;void _dis_setmframe(int frame)
_dis_setmframe PROC FAR
push bp
mov bp,sp
mov dx,[bp+6]
mov ax,1
mov bx,9
int 0fch
pop bp
ret
_dis_setmframe ENDP
public _dis_getmframe ;void _dis_getmframe(void)
_dis_getmframe PROC FAR
push bp
mov bp,sp
xor ax,ax
mov bx,9
int 0fch
pop bp
ret
_dis_getmframe ENDP
public _dis_sync ;void _dis_sync(void)
_dis_sync PROC FAR
push bp
mov bp,sp
mov bx,10
int 0fch
pop bp
ret
_dis_sync ENDP
text_disc ENDS
END

BIN
DIS/DISC.OBJ Normal file

Binary file not shown.

1
DIS/DISDATE.INC Normal file
View file

@ -0,0 +1 @@
db 'BETA VERSION - Compiled: 07/26/93 03:15:53 '

463
DIS/DISINT.ASM Normal file
View file

@ -0,0 +1,463 @@
;Actual DIS server routines
;==========================
;note: lines with TEMP! are temporary to be replaced by smarter
;techniques in the future...
LOCALS
.386
ALIGN 16
;±±±±±±±±±±±±±±±±±±±± Variables ±±±±±±±±±±±±±±±±±±
exitflag dw 0 ;1=exit key pressed
indemoflag dw 0 ;1=inside the great big ultra cool demo
passmuscode dw 0
ALIGN 4
msgarea0 db 64 dup(0)
msgarea1 db 64 dup(0)
msgarea2 db 64 dup(0)
msgarea3 db 64 dup(0)
;±±±±±±±±±±±±±± List of service routines ±±±±±±±±±±±±
service0 LABEL WORD
dw OFFSET version_0
dw OFFSET waitb_1
dw OFFSET exit_2
dw OFFSET indemo_3
dw OFFSET loader_4
dw OFFSET msgarea_5
dw OFFSET muscode_6
dw OFFSET setcopper_7
dw OFFSET fastvmode_8
dw OFFSET musframe_9
dw OFFSET sync_10
service9 LABEL WORD
;±±±±±±±±±±±±±±±±±±±± General stuff ±±±±±±±±±±±±±±±±±±
dis_oldint dd ?
dis_setint PROC NEAR
push ds
xor ax,ax
mov ds,ax
mov ax,word ptr ds:[0fch*4+0]
mov bx,word ptr ds:[0fch*4+2]
mov word ptr cs:dis_oldint[0],ax
mov word ptr cs:dis_oldint[2],bx
mov word ptr ds:[0fch*4+0],OFFSET dis_int
mov word ptr ds:[0fch*4+2],cs
pop ds
ret
dis_setint ENDP
dis_resetint PROC NEAR
xor ax,ax
mov ds,ax
mov ax,word ptr cs:dis_oldint[0]
mov bx,word ptr cs:dis_oldint[2]
mov word ptr ds:[0fch*4+0],ax
mov word ptr ds:[0fch*4+2],bx
ret
dis_resetint ENDP
dw 0fc0h ;signature for dis
dw 0fc0h ;installation check
dis_int PROC FAR ;interrupt 0fch server, BX=function number
sti
shl bx,1
cmp bx,(service9-service0)
jae @@1
call cs:service0[bx]
@@1: iret
dis_int ENDP
;±±±±±±±±±±±±±±±±±±±± Service Routines ±±±±±±±±±±±±±±±±±±
;entry: -
; exit: AX=version
;descr: -
version_0 PROC NEAR
;indemo?
IFDEF INDEMO
mov ax,1
ELSE
mov ax,0
ENDIF
mov cs:indemoflag,ax
;initialize
mov cs:passmuscode,0
mov cs:exitflag,0
;return version
mov ax,0100h
ret
version_0 ENDP
ff PROC FAR
IFDEF INDEMO
push es
mov es,cs:stmikseg
mov bx,es:_np_ord
inc bx
xor ax,ax
push ax
push bx
call _zgotosong
add sp,4
pop es
ENDIF
ret
ff ENDP
checkkeys PROC NEAR
IFDEF INDEMO
cmp cs:forcebreak,0
jne @@3
ENDIF
call ctrldown
jc @@6
mov ah,1 ;TEMP!
int 16h
jz @@3
mov ah,0
int 16h
cmp al,'0'
jne @@9
pusha
push ds
push es
mov ax,0fcfch
mov bx,1
int 33h
pop es
pop ds
popa
ret
@@9: cmp al,'9'
jne @@8
pusha
push ds
push es
mov ax,0fcfch
mov bx,2
int 33h
pop es
pop ds
popa
ret
@@8: cmp al,'1'
jne @@5
call ff
@@5: cmp al,27
jne @@4
@@6: mov cs:exitflag,1
@@4: mov cs:passmuscode,1
@@3: ret
checkkeys ENDP
;entry: -
; exit: -
;descr: Waits for border start
waitb_1 PROC NEAR
call checkkeys
IFDEF INDEMO
sti
mov ax,cs:copperframecount
@@v: cmp cs:copperframecount,ax
je @@v
@@q: mov ax,cs:copperframecount
mov cs:copperframecount,0
ELSE
mov dx,3dah
@@1: in al,dx
test al,8
jnz @@1
@@2: in al,dx
test al,8
jz @@2
mov ax,1 ;number of frames taken ;TEMP!
ENDIF
ret
waitb_1 ENDP
;entry: -
; exit: AX=return
;descr: returns 1 if part should exit.
exit_2 PROC NEAR
call checkkeys
mov ax,cs:exitflag
ret
exit_2 ENDP
;entry: -
; exit: AX=return
;descr: returns 1 if inside demo (and not testing from dos)
indemo_3 PROC NEAR
mov ax,cs:indemoflag
ret
indemo_3 ENDP
;entry: AX=area desired (0..3)
; exit: DX:AX=pointer to msgarea
;descr: returns a pointer to interpart communications area.
; There is ONLY 64 bytes of space in the area, DON'T OVERFLOW IT :-)
msgarea_5 PROC NEAR
cmp ax,1
je @@1
cmp ax,2
je @@2
cmp ax,3
je @@3
@@0: mov dx,cs
mov ax,OFFSET msgarea0
ret
@@1: mov dx,cs
mov ax,OFFSET msgarea1
ret
@@2: mov dx,cs
mov ax,OFFSET msgarea2
ret
@@3: mov dx,cs
mov ax,OFFSET msgarea3
ret
msgarea_5 ENDP
;Loader functions (not for parts)
;entry: AX=0/1
; exit: -
;descr: AX=0: restores dos process id
; AX=1: sets dos process id to the loader
; AX=100h: call _zloadinstrument(dx)
; AX=101h: call _zinitmodule(dx:0)
; This is used to load the music in name of the loader!
loader_4 PROC NEAR
IFDEF INDEMO
call loaderservices
ENDIF
ret
loader_4 ENDP
;entry: AX=code you want (are waiting for)
; exit: AX=current code,BX=row
muscode_6 PROC NEAR
push ax
call checkkeys
pop ax
IFDEF INDEMO
push es
mov es,cs:stmikseg
mov ax,es:_np_zinfo
mov bx,es:_np_row
mov cx,es:_np_ord
mov dx,-32
cmp es:_np_zplus,0
je @@1a
cmp es:_np_zplus,1
je @@1b
cmp es:_np_zplus,2
je @@1e
@@1eb: cmp bx,32
ja @@1b
@@1e: mov dx,bx
cmp dx,32
jb @@1a
mov dx,-32
jmp @@1a
@@1b: ;plus coming
mov dx,bx
sub dx,64
cmp dx,-32
jge @@1a
mov dx,-32
@@1a: mov bx,es:_np_row
pop es
ELSE
cmp cs:passmuscode,0
jne @@1
xor ax,ax
ENDIF
ret
@@1: mov cs:passmuscode,0
ret
muscode_6 ENDP
;entry: AX=number of copper interrupt to capture:
; 0=after display start (about scan line 25)
; 1=just before retrace (AVOID USING THIS IF POSSIBLE)
; 2=in the retrace
; DX:CX=far pointer to routine (0:0=remove routine)
; The routine pointed to must end in a RETF. It must save any
; 386 registers it uses (including FS/GS)
; exit: -
;descr: sets the specified copper interrupt to call the specified routine.
; IMPORTANT: The part must reset the copper int before it exits!
setcopper_7 PROC NEAR
IFDEF INDEMO
or dx,dx
jnz @@1
or cx,cx
jnz @@1
mov dx,cs
mov cx,OFFSET copper_intretf
@@1: cmp ax,0
jne @@2
mov word ptr cs:copper_int0[0],cx
mov word ptr cs:copper_int0[2],dx
@@2: cmp ax,1
jne @@3
mov word ptr cs:copper_int1[0],cx
mov word ptr cs:copper_int1[2],dx
@@3: cmp ax,2
jne @@4
mov word ptr cs:copper_int2[0],cx
mov word ptr cs:copper_int2[2],dx
@@4: ENDIF
ret
setcopper_7 ENDP
;entry: AX=area (0..3) containing the saved VGA state.
; exit: -
;descr: Quicksets the desired vga mode (takes one frame)
fastvmode_8 PROC NEAR ;DOESN'T WORK!-(
IFDEF INDEMO
push si
push ds
call msgarea_5 ;dx:ax=ds:ax
mov si,ax
mov ax,cs
mov ds,ax
;data now at ds:si
push si
call waitb_1
pop si
mov dx,3dah
in al,dx
;Syncronous reset
mov dx,3c4h
mov ax,0200h
out dx,ax
;Clear CRTC protection flag
mov dx,3d4h
mov al,011h
out dx,al
inc dx
in al,dx
and al,not 128
out dx,al
;Set misc register
mov al,ds:[si]
inc si
mov dx,3c2h
out dx,al
;Set Sequencer (3C4)
mov dx,3c4h
xor al,al
REPT 04h+1
mov ah,ds:[si]
inc si
out dx,ax
inc al
ENDM
;Set CRTC (3D4)
mov dx,3d4h
xor al,al
REPT 018h+1
mov ah,ds:[si]
inc si
out dx,ax
inc al
ENDM
;Set GFX controller (3CE)
mov dx,3ceh
xor al,al
REPT 08h+1
mov ah,ds:[si]
inc si
out dx,ax
inc al
ENDM
;Set Attribute controller (3C0)
mov dx,3dah
in al,dx
mov dx,3c0h
zzz=0
REPT 014h+1
mov al,zzz
out dx,al
mov al,ds:[si]
out dx,al
inc si
zzz=zzz+1
ENDM
;Enable display, enable PEL mask
mov dx,3c0h
mov al,20h
out dx,al
mov dx,3c6h
mov al,0ffh
out dx,al
pop ds
pop si
ELSE
mov ax,13h
int 10h
ENDIF
ret
fastvmode_8 ENDP
;entry: AX=1 : set frame to DX
; AX=0 : read frame to AX
; exit: AX=frame)
;descr: controls/returns music frame numbers
musframe_9 PROC NEAR
IFDEF INDEMO
push es
mov es,cs:stmikseg
cmp ax,0
je @@1
mov es:_np_zframe,dx
@@1: mov ax,es:_np_zframe
pop es
ELSE
xor ax,ax
ENDIF
ret
musframe_9 ENDP
IFDEF INDEMO
ordersync1 LABEL BYTE ;startpart
dw 0000h,0
dw 0200h,1
dw 0300h,2
dw 032fh,3
dw 042fh,4
dw 052fh,5
dw 062fh,6
dw 072fh,7
dw 082fh,8
dw 0900h,9
dw 0d00h,10
;dw 0800h,8
;dw 0c00h,9
;dw 0f00h,10
dw 3d00h,1
dw 3f00h,2
dw 4100h,3
dw 4200h,4
ENDIF
sync_10 PROC NEAR
IFDEF INDEMO
mov es,cs:stmikseg
mov dh,byte ptr es:_np_ord
mov dl,byte ptr es:_np_row
mov bx,OFFSET ordersync1
mov cx,16
@@2: cmp dx,cs:[bx]
jbe @@1
add bx,4
loop @@2
@@1: mov ax,cs:[bx-2]
ENDIF
ret
sync_10 ENDP

26
DIS/DISTEST.C Normal file
View file

@ -0,0 +1,26 @@
#include <stdio.h>
#include "dis.h"
main()
{
int a;
a=dis_version();
if(!a)
{
printf("\nDIS not installed!\n");
return(1);
}
else
{
printf("\nDIS version %04X installed.\n",a);
}
printf("\nPress any key to exit.\n");
a=0;
while(!dis_exit())
{
a+=dis_waitb();
printf("%i frames waited.\r",a);
}
printf("\n\n");
return(0);
}

BIN
DIS/DISTEST.EXE Normal file

Binary file not shown.

BIN
DIS/DISTEST.OBJ Normal file

Binary file not shown.

BIN
DIS/DODATE.EXE Normal file

Binary file not shown.

22
DIS/MAKEFILE Normal file
View file

@ -0,0 +1,22 @@
all : dis.exe distest.exe
objs=
asm_f = /ML /m2 /s /JJUMPS
c_f = /AL /c /W3
.asm.obj :
tasm $(asm_f) $<
.c.obj :
cl /qc $(c_f) $<
dis.obj : dis.asm disint.asm
..\util\dodate "db 'BETA VERSION - Compiled:" "'" > disdate.inc
tasm $(asm_f) dis.asm
dis.exe : dis.obj
link dis.obj,dis.exe;
distest.exe : distest.obj disc.obj
link /E distest.obj+disc.obj,distest.exe;

10
DIS/NOTES Normal file
View file

@ -0,0 +1,10 @@
0 version
1 waitborder, returns number frames
2 keybhit 0 ei, 1=quit
3 indemo
. set framecounter
. get framecounter
. insert copper routine
. remove copper routine
. get equpointer

19
DIS/README Normal file
View file

@ -0,0 +1,19 @@
Demo Interrupt Server - For Internal FC distribution
====================================================
Version is 1.0á, this is still in development, and will be untill
< Unreal 2 | [ Rectum ] [Impact] | Potato | ? > is finished.
Read dis.h for function descriptions.
makefile guess (microsoft nmake)
dis.h C header file for routines in disc.asm
disc.asm C interface routines for DIS (also usable from asm)
dis.asm Resident DIS server main program
disint.asm Actual DIS interrupt server
distest.c C test program for DIS
notes Notes... Nothing special
The disc.asm(obj) is the easiest way to call dis from C. If you want
to call it from asm, see the disc.asm and copy routines from there
or include it to your asm.