Tank battle game.
program fontsshow;
uses
crt, graph, dos, globals, general;
function GetHighestCap(Table: Pointer; Modes: Word; Size: Integer): Integer;
near; assembler;
asm
XOR AX,AX
LES DI, Table
@@1:
MOV SI, Modes
ADD SI, Size
ADD SI, Size
MOV BX, ES:[DI]
CMP BX, 0FFFFH
JE @@4
INC DI
INC DI
MOV CX,Size
@@2:
CMP BX,[SI]
JZ @@3
DEC SI
DEC SI
LOOP @@2
@@3:
CMP AX,CX
JA @@1
MOV AX,CX
JMP @@1
@@4:
end;
function DetectVesa16: Integer; far; assembler;
var
VesaInfo: array[0..255] of Byte;
asm
MOV AX,SS
MOV ES,AX
LEA DI,VesaInfo
MOV AX,4F00H
INT 10H
CMP AX,004FH
MOV AX,grError
JNZ @@Exit
CMP ES:[DI].VgaInfoBlock.VESASignature.Word[0], 'EV'
JNZ @@Exit
CMP ES:[DI].VgaInfoBlock.VESASignature.Word[2], 'AS'
JNZ @@Exit
LES DI,ES:[DI].VgaInfoBlock.VideoModePtr
PUSH ES
PUSH DI
MOV AX, OFFSET Vesa16Modes
PUSH AX
MOV AX,3
PUSH AX
CALL GetHighestCap
@@Exit:
end;
procedure SVGAinitialize;
var
PathToDriver : string; {Stores the DOS path to *.BGI & *.CHR}
begin
PathToDriver:= '\DATA';
VESA16 := InstallUserDriver('VESA', @DetectVesa16);
GD := IBM8514;
GM := IBM8514Hi;
GD := Detect; {Use autodetection}
InitGraph(GD, GM,PathToDriver);
end; { SVGA initialize }
{----------------------------------------------------------------------------}
begin
SVGAinitialize;
setgraphmode( 3 ); { 800 x 600 }
setcolor( 15 );
for counter := 0 to 9 do
begin
settextstyle( counter, 0, 0 );
outtextxy( 20, counter*50, 'Fonts Show' + ' /number: ' + inttostr(counter));
end;
readkey;
end.