home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Equalizer BBS
/
equalizer-bbs-collection_2004.zip
/
equalizer-bbs-collection
/
DEMOSCENE-STUFF
/
INTRO93.ZIP
/
UBFVIEW.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-02-27
|
4KB
|
139 lines
Uses Dos,TPCrt,TPString,UBFUnit,Graph320;
Var
FontX,FontY : Byte;
CharNumber : Word;
S : String;
B : Byte;
FontP : Pointer;
PalBuffer1 : PalArray;
MemoryPicture : Array [0..3999] of Byte;
X,Y : Word;
Ch : Char;
Spacing : Byte;
(**************************************************************************)
Procedure Pal; External; {$L FONTPAL.OBJ} { 1K}
(**************************************************************************)
{$F-}
Procedure Get_Font (SIZE,Word1,Word2:Word;Byte1,A,B,FONTCHARS:Byte);
VAR
TEMP : Word;
Begin
Asm
PUSH DS
PUSH ES
PUSH BP
PUSH DX
PUSH BX
PUSH AX
MOV AX,Word1
MOV DS,AX
MOV SI,Word2
MOV DI,320
MOV TEMP,DI
MOV AX,$A000
MOV ES,AX
MOV BH,FONTCHARS
XOR CH,CH
@LOOP4: MOV AH,BYTE PTR Byte1
@LOOP3: MOV AL,LOW B
@LOOP2: MOV DX,DI
MOV CL,LOW A
@LOOP1: MOVSB
ADD DI,319
LOOP @LOOP1
MOV DI,DX
INC DI
DEC AL
JNZ @LOOP2
DEC BH
JZ @QUIT
DEC AH
JNZ @LOOP3
MOV DI,TEMP
ADD DI,SIZE
MOV TEMP,DI
JMP @LOOP4
@QUIT: POP AX
POP BX
POP DX
POP BP
POP ES
POP DS
End;
End;
{$F+}
(*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*)
Begin
Move (@Pal^,UBFPalette,768);
WriteLn (' Bonijoni''s Ultimate BitMap Format Viewer v1.0. 12-12-92. By: Bonijoni');
WriteLn (' Fast .UBF Viewer. UBF Format Originally by Mr.Spock And Bonijoni');
WriteLn;
If ParamCount<1 then
Begin
WriteLn ('Usage: UBFVIEW.EXE [FILENAME.UBF]');
Halt;
End;
S:=ParamStr(1);
If JustExtension(S)='' then S:=ForceExtension(S,'UBF');
S:=StUpCase(S);
If MemAvail<65000 then
Begin
WriteLn (' ■ Not Enough Memory to Display Font');
WriteLn (' ■ Done UnSuccesfuly.');
Halt;
End;
GetMem(FontP,65000);
WriteLn (' ■ Opening FontFile ',S);
B:=LoadUBF(S,FontP,FontX,FontY,CharNumber);
Case Chr(B) Of
#1 : Begin
WriteLn (' ■ UBF File Was Not Found!');
WriteLn (' ■ Done UnSuccesfuly.');
Halt;
End;
#2 : Begin
WriteLn (' ■ File Specified is Not UBF!');
WriteLn (' ■ Done UnSuccesfuly.');
Halt;
End;
#3 : Begin
WriteLn (' ■ UBF File has a General IO Error');
WriteLn (' ■ Done UnSuccesfuly.');
Halt;
End;
#4 : Begin
WriteLn (' ■ Loaded Okay With Pallete');
End;
End;
{Capture Screen}
Move (Mem[$B800:0000],MemoryPicture,4000);
For X:=0 to 767 do PalBuffer1[X]:=0;
X:=WhereX;
Y:=WhereY;
GotoMode ($13);
SetPal(PalBuffer1);
B:=CharNumber;
Get_Font ((FontY+1)*320,Seg(FontP^),Ofs(FontP^),(319 DIV FontX),FontY,FontX,B);
FadeInPal (UBFPalette,PalBuffer1);
Repeat
Repeat Until KeyPressed;
If KeyPressed then Ch:=ReadKey;
Until (Ch>=#27);
Ch:=#0;
ErasePal(PalBuffer1);
FadeInPal (PalBuffer1,UBFPalette);
GotoMode ($03);
GotoXY(X,Y);
Move (MemoryPicture,Mem[$B800:0000],4000);
WriteLn (' ■ Displayed Succesfully');
FreeMem(FontP,65000);
End.