'===========================================================================
' Subject: MODIFY ASCII SET                   Date: 05-07-95 (13:30)       
'  Author: Egbert Zijlema                     Code: PB                     
'  Origin: E.Zijlema@uni4nn.inf.nl          Packet: PB.ABC
'===========================================================================
' LOADFONT.BAS    : routine to modify 2 characters within the
'                   default ASCII set

' Author          : Egbert Zijlema (The Netherlands)
' Copyright status: Public Domain

' Purpose: * to generate a copyright symbol for use within your creditline
'          * to create a telephone symbol for use with phonenumbers
'            (e.g. in a cardfile)

' In this demo CHR$(166) and CHR$(167) are subject to change, but of
' course you are free to choose a different starting point within
' the ASCII-set

' The routine only works with VGA-cards. If not present the procedure
' assigns "(C)" to copyright$ and "Tel." to phone$

DEFINT A - Z

$INCLUDE "REGNAMES.INC"         ' came with Power Basic

SUB LoadFonts(copyright$, phone$)

  ' font patterns:
  cr$ = CHR$(0, 0, 0, 28, 34, 65, 77, 81, 81, 77, 65, 34, 28, 0, 0, 0)
  ph$ = CHR$(0, 0, 0, 0, 0, 126, 255, 153, 60, 126, 126, 0, 0, 0, 0, 0)
  pattern$   = cr$ + ph$

  IF BIT(pbvScrnCard, 4) THEN     ' works with VGA-card only

    REG %AX, &H1100               ' function
    REG %BX, 16 * 256             ' 16 bytes per char in BH
    REG %CX, 2                    ' 2 characters
    REG %DX, 166                  ' first char in ASCII-set to modify
    REG %ES, STRSEG(pattern$)
    REG %BP, STRPTR(pattern$)
    CALL INTERRUPT &H10
    REG %AX, &H1103               ' function
    REG %BX, 0
    CALL INTERRUPT &H10

    copyright$ = CHR$(166)
    phone$     = CHR$(167)
  ELSE
    ' use normal text instead
    copyright$ = "(C)"
    phone$     = "Tel."
  END IF
END SUB

' demo
CLS
  LoadFonts copyright$, phone$
  LOCATE 4, 4 : PRINT "This shows the result: "
  LOCATE 6, 4
    PRINT "Copyright ";copyright$;CHR$(32);RIGHT$(DATE$, 4);": EzySoft"
  LOCATE 7, 4
    PRINT "Helpdesk  ";phone$;" +31 50 5844275"

  DO
  LOOP UNTIL LEN(INKEY$)

  SCREEN 0, 0, 0, 0                 ' restore default font
END
