The Text VDU


&BB4ETXT INITIALISE
ActionInitialise the text VDU to its settings when the computer is switched on, includes resetting all the text VDU indirections, selecting Stream 0, resetting the text paper to pen 0 and the text pen to pen 1, moving the cursor to the top left corner of the screen and setting the writing mode to be opaque
EntryNo entry conditions
ExitAF, BC, DE and HL are corrupt, and all others are preserved
&BB51TXT RESET
ActionResets the text VDU indirections and the control code table
EntryNo entry conditions
ExitAF, BC, DE and HL are corrupt, and all the other registers are preserved
&BB54TXT VDU ENABLE
ActionAllows characters to be printed on the screen in the current stream
EntryNo entry conditions
ExitAF is corrupt, and all other registers are preserved
&BB57TXT VDU DISABLE
ActionPrevents characters from being printed to the current stream
EntryNo entry conditions
ExitAF is corrupt, and al1 the other registers are preserved
&BB5ATXT OUTPUT
ActionOutput a character or control code (&00 to &1F) to the screen
EntryA contains the character to output
ExitAll registers are preserved
NotesAny control codes are obeyed and nothing is printed if the VDU is disabled; characters are printed using the TXT OUT ACTION routine; if using graphics printing mode, then control codes are printed and not obeyed
&BB5DTXT WR CHAR
ActionPrint a character at the current cursor position - control codes are printed and not obeyed
EntryA contains the character to be printed
ExitAF, BC, DE and HL are corrupt, and all others are preserved
NotesThis routine uses the TXT WRITE CHAR indirection to put the character on the screen
&BB60TXT RD CHAR
ActionRead a character from the screen at the current cursor position
EntryNo entry conditions
ExitIf it was successful then A contains the character that was read from the screen and Carry is true; otherwise Carry is false, and A holds 0; in either case, the other flags are corrupt, and all registers are preserved
NotesThis routine uses the TXT UNWRITE indirection
&BB63TXT SET GRAPHIC
ActionEnables or disables graphics print character mode
EntryTo switch graphics printing mode on, A must be non- zero; to turn it off, A must contain zero
ExitAF corrupt, and all other registers are preserved
NotesWhen turned on, control codes are printed and not obeyed; characters are printed by GRA WR CHAR
&BB66TXT WIN ENABLE
ActionSets the boundaries of the current text window - uses physical coordinates
EntryH hoIds the column number of one edge, D holds the column number of the other edge, L holds the line number of one edge, and E holds the line number of the other edge
ExitAF, BC, DE and HL are corrupt
NotesThe window is not cleared but the cursor is moved to the top left corner of the window
&BB69TXT GET WINDOW
ActionReturns the size of the current window - returns physical coordinates
EntryNo entry conditions
ExitH holds the column number of the left edge, D holds the column number of the right edge, L holds the line number of the top edge, E holds the line number of the bottom edge, A is corrupt, Carry is false if the window covers the entire screen, and the other registers are always preserved
&BB6CTXT CLEAR WINDOW
ActionClears the window (of the current stream) and moves the cursor to the top left corner of the window
EntryNo entry conditions
ExitAF, BC, DE and HL are corrupt, and alI others are preserved
&BB6FTXT SET COLUMN
ActionSets the cursor's horizontal position
EntryA contains the logical column number to move the cursor to
ExitAF and HL are corrupt, and all the other registers are preserved
NotesSee also TXT SET CURSOR
&BB72TXT SET ROW
ActionSets the cursor's vertical position
EntryA contains the logical line number to move the cursor to
ExitAF and HL are corrupt, and all others are preserved
NotesSee also TXT SET CURSOR
&BB75TXT SET CURSOR
ActionSets the cursor's vertical and horizontal position
EntryH contains the logical column number and L contains the logical line number
ExitAF and HL are corrupt, and all the others are preserved
NotesSee also TXT SET COLUMN and TXT SET ROW
&BB78TXT GET CURSOR
ActionGets the cursor's current position
EntryNo entry conditions
ExitH holds the logical column number, L holds the logical line number, and A contains the roll count, the flags are corrupt, and all the other registers are preserved
NotesThe roll count is increased when the screen is scrolled down, and is decreased when it is scrolled up
&BB7BTXT CUR ENABLE
ActionAllows the text cursor to be displayed (if it is allowed by TXT CUR ON) - intended for use by the user
EntryNo entry conditions
ExitAF is corrupt, and all other registers are preserved
&BB7ETXT CUR DISABLE
ActionPrevents the text cursor from being displayed -intended for use by the user
EntryNo entry conditions
ExitAF is corrupt, and all others are preserved
&BB81TXT CUR ON
ActionAllows the text cursor to be displayed - intended for use by the operating system
EntryNo entry conditions
ExitAll registers and flags are preserved
&BB84TXT CUR OFF
ActionPrevents the text cursor from being displayed -intended for use by the operating system
EntryNo entry conditions
ExitAll registers and flags are preserved
&BB87TXT VALIDATE
ActionChecks whether a cursor position is within the current window
EntryH contains the logical column number to check, and L holds the logical line number
ExitH holds the logical column number where the next character will be printed, L holds the logical line number; if printing at this position would make the window scroll up, then Carry is false and B holds &FF; if printing at this position would make the window scroll down, then Carry is false and B contains &00; if printing at the specified cursor position would not scroll the window, then Carry is true and B is corrupt; always, A and the other flags are corrupt, and all others are preserved
&BB8ATXT PLACE CURSOR
ActionPuts a `cursor blob' on the screen at the current cursor position
EntryNo entry conditions
ExitAF is corrupt, and all other registers are preserved
NotesIt is possible to have more than one cursor in a window (see also TXT DRAW CURSOR); do not use this routine twice without using TXT REMOVE CURSOR between
&BB8DTXT REMOVE CURSOR
ActionRemoves a `cursor blob' from the current cursor position
EntryNo entry conditions
ExitAF is corrupt, and all the others are preserved
NotesThis should be used only to remove cursors created by TXT PLACE CURSOR, but see also TXT UNDRAW CURSOR
&BB90TXT SET PEN
ActionSets the foreground PEN for the current stream
EntryA contams the PEN number to use
ExitAF and HL are corrupt, and all other registers are preserved
&BB93TXT GET PEN
ActionGets the foreground PEN for the current stream
EntryNo entry conditions
ExitA contains the PEN number, the flags are corrupt, and all other registers are preserved
&BB96TXT SET PAPER
ActionSets the background PAPER for the current stream
EntryA contains the PEN number to use
ExitAF and HL are corrupt, and all other registers are preserved
&BB99TXT GET PAPER
ActionGets the background PAPER for the current stream
EntryNo entry conditions
ExitA contains the PEN number, the flags are corrupt, and all other registers are preserved
&BB9CTXT INVERSE
ActionSwaps the current PEN and PAPER colours over for the current stream
EntryNo entry conditions
ExitAF and HL are corrupt, and all others are preserved
&BB9FTXT SET BACK
ActionSets the character write mode to either opaque or transparent
EntryFor transparent mode, A must be non-zero; for opaque mode, A has to hold zero
ExitAF and HL are corrupt, and all other registers are preserved
NotesSetting the character write mode has no effects on the graphics VDU
&BBA2TXT GET BACK
ActionGets the character write mode for the current stream
EntryNo entry conditions
ExitIf in transparent mode, A is non-zero; in opaque mode, A is zero; in either case DE, HL and flags are corrupt, and the other registers are preserved
&BBA5TXT GET MATRIX
ActionGets the address of a character matrix
EntryA contains the character whose matrix is to be found
ExitIf it is a user-defined matrix, then Carry is true; if it is in the lower ROM then Carry is false; in either event, HL contains the address of the matrix, A and other flags are corrupt, and others are preserved
NotesThe character matrix is stored in 8 bytes; the first byte is for the top row of the character, and the last byte refers to the bottom row of the character; bit 7 of a byte refers to the leftmost pixel of a line, and bit 0 refers to the rightmost pixel in Mode 2.
&BBA8TXT SET MATRIX
ActionInstalls a matrix for a user-defined character
EntryA contains the character which is being defined and HL contains the address of the matrix to be used
ExitIf the character is user-definable then Carry is true; otherwise Carry is false, and no action is taken; in both cases AF, BC, DE and HL are corrupt, and all other registers are preserved
&BBABTXT SET M TABLE
ActionSets the address of a user-defined matrix table
EntryDE is the first character in the table and HL is the table's address (in the central 32K of RAM)
ExitIf there are no existing tables then Carry is false, and A and HL are both corrupt; otherwise Carry is true, A is the first character and HL is the table's address; in both cases BC, DE and the other flags are corrupt
&BBAETXT GET M TABLE
ActionGets the address of a user-defined matrix table
EntryNo entry conditions
ExitSee TXT SET M TABLE above for details of the values that can be returned
&BBB1TXT GET CONTROLS
ActionGets the address of the control code table
EntryNo entry conditions
ExitHL contains the address of the table, and all others are preserved
NotesThe table has 32 entries, and each entry has three bytes
byte 1 is the number of parameters needed by the control code
bytes 2 and 3 are the address of the routine, in the Lower ROM, to execute the control code
&BBB4TXT STR SELECT
ActionSelects a new VDU text stream
EntryA contains the value of the stream to change to
ExitA contains the previously selected stream, HL and the flags are corrupt, and all others are preserved
&BBB7TXT SWAP STREAMS
ActionSwaps the states of two stream attribute tables
EntryB contains a stream number, and C contains the other stream number
ExitAF, BC, DE and HL are corrupt, and all other registers are preserved
NotesThe foreground pen and paper, the window size, the cursor position, the character write mode and graphic character mode are all exchanged between the two streams


David Cantrell, March 1996