FNT2COM.BAS

 BBS: Inland Empire Archive
Date: 02-21-93 (10:05)             Number: 233
From: QUINN TYLER JACKSON          Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: FNT2COM.BAS                    Conf: (2) Quik_Bas
' FNT2COM version 1.1
'
' Written by Quinn Tyler Jackson
'
' This program turns the resident VGA font into an executable COM
' file that, when run, restores the font that was captured.

' QBS: Yes!


TYPE ImageType
        Jump AS STRING * 3
        FontData AS STRING * 4096
        Desc AS STRING * 32
        DescTrailer AS STRING * 2
        Notice AS STRING * 64
        CRTrailer AS STRING * 3
        ASM AS STRING * 25
END TYPE

DEFINT A-Z

DIM File AS ImageType

CLS

PRINT
PRINT "FNT2COM version 1.1 (Public Domain Version)"
PRINT "Written by Quinn Tyler Jackson"
PRINT
PRINT

INPUT "Font description: ", File.Desc

File.DescTrailer = CHR$(10) + CHR$(13)
File.Notice = "This file created by FNT2COM v1.1 (PD)"
File.CRTrailer = CHR$(13) + CHR$(10) + "$"

PRINT
PRINT "Please wait...."

' A little jump over the data.
File.Jump = CHR$(&HE9) + CHR$(&H65) + CHR$(&H10)

' Prepare the monitor for scanning
OUT &H3C4, 2    ' Thanks to Rich Geldreich for these out statements!
OUT &H3C5, 4
OUT &H3C4, 4
OUT &H3C5, 7
OUT &H3CE, 4
OUT &H3CF, 2
OUT &H3CE, 5
OUT &H3CF, 0
OUT &H3CE, 6
OUT &H3CF, 4

DEF SEG = &HA000

        FOR a = 1 TO 8192
         x = a MOD 32
         IF x > 0 AND x <= 16 THEN
                Buffer$ = Buffer$ + CHR$(PEEK(a - 1))
         END IF
        NEXT a

' Restore monitor
OUT &H3CE, 4
OUT &H3CF, 1
OUT &H3CE, 6
OUT &H3CF, &HE
OUT &H3CE, 5
OUT &H3CF, &H10
OUT &H3C4, 2
OUT &H3C5, 3
OUT &H3C4, 4
OUT &H3C5, 3

DEF SEG

File.FontData = Buffer$

RESTORE ASMData

Buffer$ = ""

FOR i = 1 TO 25
        READ byte
        Buffer$ = Buffer$ + CHR$(byte)
NEXT

File.ASM = Buffer$

OPEN "FONT.COM" FOR BINARY AS #1 LEN = LEN(File)

PUT #1, , File

CLOSE #1

PRINT "DONE!"

END

ASMData:

DATA &HB4,&H9,&HBA,&H3,&H11
DATA &HCD,&H21,&HB4,&H11,&HB0
DATA &H0,&HB7,&H10,&HB9,&H0
DATA &H1,&HBA,&H0,&H0,&HBD
DATA &H3,&H1,&HCD,&H10,&HC3

--- Maximus/2 2.01wb
 * Origin: The Nibble's Roost, Richmond BC Canada 604-244-8009 (1:153/918)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET