BASIC CHRSET and CHRDEF Statements - fvdhoef/aquarius-plus GitHub Wiki

LOAD CHRSET

TYPE: plusBASIC v0.14c disk statement

FORMAT: LOAD CHARSET filespec

Action: Loads a binary character ROM file.

  • filespec is a string expression containing an optional path and the full file name.
  • The character ROM file must be exactly one of the following lengths:
    • 768 bytes - The standard ASCII printable characters block (ASCII 32 through 127) are replaced with the contents of the file.
    • 1024 bytes - The extended ASCII characters block (ASCII 128 through 255) are replaced with the contents of the file.
    • 2048 bytes - The entire character set is replaced with the contents of the file.
  • The character set is loaded into the alternate character set buffer but not into character RAM.
    • The USE CHRSET 1 command copies the character set into character RAM.
  • Error 50, File not found results if the file does not exist. (as of v0.17f)
Examples:
LOAD "custchars.chr"

Loads the character ROM file custchars.chr into the alternate character set buffer.

FORMAT: LOAD CHARSET filespec , SWAP

Action: As above, but loads the file into the character set swap buffer.

Examples:
LOAD "custchars.chr",SWAP

Loads the character ROM file custchars.chr into the character set swap buffer.


SAVE CHRSET

TYPE: plusBASIC v022.x disk statement

FORMAT: SAVE CHARSET filespec

Action: Save character set to binary character ROM file.

  • filespec is a string expression containing an optional path and the full file name.
  • The contents are Character RAM are written to the file.
    • The resulting file will be 2048 bytes long.
Examples:

SAVE "savedchars.chr"

Saves current character defininitions to character ROM file savedchars.chr.


USE CHRSET

TYPE: plusBASIC v0.21a graphics statement

FORMAT: USE CHRSET chrset

Action: Selects the specified character set.

  • chrset specifies the character set to use. Valid values are 0
    • 0 - The standard AQUASCII character set.
    • 1 - The character set in the alternate character set buffer.
      • The Latin-1 character set is loaded into the buffer during cold boot.
  • Any redefined characters will be overwritten.

FORMAT: USE CHRSET filespec

Action: Loads a binary character ROM file and copies it into character RAM.

  • Performs the following actions:
    • LOAD CHRSET filespec
    • USE CHRSET 1

GETCHRSET

TYPE: plusBASIC v0.21w graphics statement

FORMAT: GETCHRSET

Action: Returns the character set currently in use.

  • The possible return values are
    • 0 - The standard AQUASCII character set.
    • 1 - The character set in the alternate character set buffer.
    • -1 - The current character set has been altered using the SET CHRDEF statement.

STASH CHRSET

TYPE: plusBASIC v0.70g graphics statement

FORMAT: STASH CHRSET

Action: Copies the contents of character RAM to the character set swap buffer.


RESTORE CHRSET

TYPE: plusBASIC v0.70g graphics statement

FORMAT: RESTORE CHRSET

Action: Copies the contents of character set swap buffer to character RAM.


SWAP CHRSET

TYPE: plusBASIC v0.70g graphics statement

FORMAT: SWAP CHRSET

Action: Swaps the contents of character set swap buffer with character RAM.


SET CHRDEF

TYPE: plusBASIC v0.22x graphics statement

FORMAT: SET CHRDEF$ ascii_code TO string

Action: Redefines a character.

  • ascii_code is the ASCII code of the character to be defined.
  • _string is an 8 byte binary stringcontaining the character definition.
  • Illegal quantity error results if ascii_code is not in the range '0' through '255'
  • String length error occurs if string is not exactly 8 characters long.

RESET CHRDEF

TYPE: plusBASIC v022? graphics statement

FORMAT: RESET CHRDEF ascii_code

Action: Sets a character to it's default definition.

  • The character definition is copied from the default character set (CHRSET 0).
  • Illegal quantity error results if ascii_code is not in the range '0' through '255'.

GETCHRDEF

TYPE: plusBASIC v0.22x graphics statement

FORMAT: GETCHRDEF$ ( ascii_code )

Action: Returns the definition of the specified character.

  • ascii_code is the ASCII code of the requested character.
    • Illegal quantity error results if ascii_code is not in the range '0' through '255'.
  • Returns a binary string of 8 byte containing the character definition.
⚠️ **GitHub.com Fallback** ⚠️