home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS 1
/
BBS#1.iso
/
game-crk
/
pt.ha
/
PTGVIEW.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-12-15
|
2KB
|
117 lines
{=================== Turbo Pascal 7.0+ ==============================}
type
THead=Record
FVga:byte;
Old_mode:byte;
Old_page:byte;
Fpal:byte;
Addrpal:array[1..17] of byte;
Vgabuff:array[1..896] of byte;
End;
Var
Ch:Char;
Fl:File;
R:Word;
FileHead:THead;
VSegh,VOfsh:Word;
Vbyte:Byte;
Begin
Assign(fl,paramstr(1));
Reset(fl,1);
BlockRead(fl,FileHead,917,r);
Asm
mov al,10h
mov ah,0
int 10h
End;
Asm
MOV DX,03DAh
IN AL,DX
MOV DL,0C0h
XOR AX,AX
OUT DX,AL
End;
Port[$3c4]:=2;
Port[$3c5]:=8;
BlockRead(fl,mem[$a000:0],$ffff,r);
BlockRead(fl,mem[$a000:$0ffff],1,r);
Port[$3c4]:=2;
Port[$3c5]:=4;
BlockRead(fl,mem[$a000:0],$ffff,r);
BlockRead(fl,mem[$a000:$0ffff],1,r);
Port[$3c4]:=2;
Port[$3c5]:=2;
BlockRead(fl,mem[$a000:0],$ffff,r);
BlockRead(fl,mem[$a000:$0ffff],1,r);
Port[$3c4]:=2;
Port[$3c5]:=1;
BlockRead(fl,mem[$a000:0],$ffff,r);
BlockRead(fl,mem[$a000:$0ffff],1,r);
If FileHead.Fvga=0 Then
Begin
Vbyte:=FileHead.old_mode;
Asm
mov al,Vbyte
or al,10000000b
mov ah,0
int 10h
End;
Vbyte:=FileHead.old_page;
Asm
mov ah,5
mov al,VByte
int 10h
End;
If FileHead.Fpal=1 Then
Begin
VSegh:=Seg(FileHead.AddrPal);
VOfsh:=Ofs(FileHead.AddrPal);
Asm
push es
mov ax,Vsegh
mov es,ax
mov ax,1002h
mov dx,Vofsh
int 10h
pop es
End;
End;
End
Else
Begin
VSegh:=Seg(FileHead.VgaBuff);
VOfsh:=Ofs(FileHead.VgaBuff);
Asm
push es
mov ax,Vsegh
mov es,ax
mov ax,1c02h
mov cx,00000101b
mov bx,Vofsh
int 10h
pop es
End;
End;
Asm
xor ax,ax
int 16h
mov ax,0003h
int 10h
End;
Close(fl);
End.;