Text output routines.

Example

; setup VDC write offset and register
ldx    #$08  ; BAT x = 8
lda    #$0A  ; BAT y = 10
jsr    vdc_calc_addr
jsr    vdc_set_write
; output the string "Yo"
lda    #'Y'
jsr    print_char
lda    #'o'
jsr    print_char

Note

The font must be 8x8 pixels wide and stored in VRAM as tiles.  This means that the font routines modifies the BAT.  Only standard ASCII (0-127 included) is supported at the moment.

Summary
Text output routines.
Functions
print_charOutput an ASCII character at the current BAT location.
print_digitOutput a decimal digit at the current BAT location.
print_hexOutput a hexadecimal digit at the current BAT location.
print_bcdOutput a bcd number at the current BAT location.
print_dec_u8Output an unsigned decimal number at the current BAT location.
print_dec_u16Output an unsigned decimal number at the current BAT location.
print_hex_u8Output a hexadecimal number at the current BAT location.
print_hex_u16Output a hexadecimal number at the current BAT location.
print_stringDisplay a null (0) terminated string in a textarea.
print_string_rawDisplay a null (0) terminated string.
print_string_nDisplay the n first characters of a string.
print_fillFill an area with a given character.

Functions

print_char

Output an ASCII character at the current BAT location.

Remarks

  • The VDC write register must point to a valid BAT location.
  • Only a subset of the ASCII character set is supported (see 8x8 monochrome 1bpp font).

Parameters

AASCII character

print_digit

Output a decimal digit at the current BAT location.

Remark

The VDC write register must point to a valid BAT location.

Parameters

ADigit value between 0 and 9.

print_hex

Output a hexadecimal digit at the current BAT location.

Remark

The VDC write register must point to a valid BAT location.

Parameters

ADigit value between 0 and 15.

print_bcd

Output a bcd number at the current BAT location.

Parameters

_axBCD encoded number (max 4 bytes).
XBCD array top element index

print_dec_u8

Output an unsigned decimal number at the current BAT location.

Parameters

AUnsigned byte.

print_dec_u16

Output an unsigned decimal number at the current BAT location.

Parameters

AWord MSB.
XWord LSB.

print_hex_u8

Output a hexadecimal number at the current BAT location.

Parameters

AUnsigned byte.

print_hex_u16

Output a hexadecimal number at the current BAT location.

Parameters

AWord MSB.
XWord LSB.

print_string

Display a null (0) terminated string in a textarea.

The characters must have been previously converted to fit to current font.

Parameters

_sistring address.
Xtextarea x tile position.
Atextarea y tile position.
_altextarea width.
_ahtextarea height.

Returns

_sipointer to the last displayed character or ‘\0’.

print_string_raw

Display a null (0) terminated string.

Remark

The VDC write register must point to a valid BAT location.  The string must be less than 256 characters long (‘\0’ included).

Parameters

_sistring address.

print_string_n

Display the n first characters of a string.

Remark

The VDC write register must point to a valid BAT location.  The string must be less than 256 characters long.

Parameters

_sistring address.
Xnumber of characters to print.

print_fill

Fill an area with a given character.

Parameters

XBAT x position.
ABAT y position.
_alBAT area width.
_ahBAT area height.
_blASCII code.
Close