VAST vdigit.txt

Warning: if you clip this code into your program, look out for possible html code slipping in.

REM   VAST vdigit.txt
REM
REM   This file contains code to print alphabetic characters to the VAST 8-digit
REM   display boards with an SBC2000-074. It must be used in conjunction with the
REM   code in the file VAST vled.txt.
REM
REM   This code has two significant restrictions:
REM   1. It cannot be used with PRINT statements.
REM   2. It does not take string arguments.


REM   This is the number of entries in each of the constant arrays.

CONSTANT VTI_VDigit_MAX_Index AS INTEGER = 66


REM   This array contains the ASCII characters which can be displayed in a single
REM   display element of the V8Digit display board.

DIM VTI_VDigit_Legal[VTI_VDigit_Max_Index] AS INTEGER CONSTANT = [
	'0',	'1',	'2',	'3',	'4',	'5',	'6',	'7',	'8',	'9',
	'A',	'a',	'B',	'b',	'C',	'c',	'D',	'd',	'E',	'e',
	'F',	'f',	'G',	'g',	'H',	'h',	'I',	'i',	'J',	'j',
	'K',	'k',	'L',	'l',	'M',	'm',	'N',	'n',	'O',	'o',
	'P',	'p',	'Q',	'q',	'R',	'r',	'S',	's',	'T',	't',
	'U',	'u',	'V',	'v',	'W',	'w',	'X',	'x',	'Y',	'y',
	'Z',	'z',	' ',	'-',	'_',	'.'
]


REM   This array contains the segment data which corresponds to the characters in
REM   the previous array (VTI_VDigit_Legal).

DIM VTI_VDigit_Use[VTI_VDigit_Max_Index] AS INTEGER CONSTANT = [
	0x7E,	0x30,	0x6D,	0x79,	0x33,	0x5B,	0x5F,	0x70,	0x7F,	0x73,
	0x77,	0x7D,	0x1F,	0x1F,	0x4E,	0x0D,	0x3D,	0x3D,	0x4F,	0x6F,
	0x47,	0x47,	0x7B,	0x7B,	0x37,	0x17,	0x06,	0x04,	0x3C,	0x3C,
	0x37,	0x37,	0x0E,	0x0E,	0x76,	0x76,	0x15,	0x15,	0x7E,	0x1D,
	0x67,	0x67,	0x7E,	0x73,	0x05,	0x05,	0x5B,	0x5B,	0x46,	0x0F,
	0x3E,	0x1C,	0x3E,	0x1C,	0x3E,	0x1C,	0x37,	0x37,	0x3B,	0x3B,
	0x6D,	0x6D,	0x00,	0x01,	0x08,	0x80
]


REM   This subroutine will take an ASCII character's value as input, along with
REM   the position at which it is to be displayed, and whether or not the decimal
REM   point segment should be lit for the character. If the character is not one
REM   of the ones which can be displayed properly, it will be shown as a space.

SUBROUTINE VDigit_Display(position AS INTEGER, character AS INTEGER, decpt AS INTEGER)
LOCAL index AS INTEGER
	character = character AND 255		: REM   Limit to character size
	decpt = ABS(decpt <> 0) * 128		: REM   Get 0 or 128
	FOR index = 0 TO VTI_VDigit_MAX_Index
		IF character = VTI_VDigit_Legal[index]
			VLED_Matrix(position, VTI_VDigit_Use[index] + decpt)
			RETURN
		ENDIF
	NEXT
	VLED_Matrix(position, decpt)
END

 

VestaTech Home

© 2002 Vesta Technology