AIDE Auxiliary Debug Displays

From AIDE 6.6 onwards, AIDE's PowerTerm can provide additional debug displays. These are separate from the main PowerTerm console, and behave like traditional cursor-addressable units with a fixed-width font.

The displays are controlled by sending control sequences starting with <ESC><!>. The whole of the command sequence must be performed with inter-character gaps less than 100 ms.


<ESC>!'0'       Use the main PowerTerm console - char 0
<ESC>!'1'       Use the the first debug display - char 1
<ESC>!'2'       Use the the second debug display - char 2
<ESC>!...
<ESC>!'8'       Use the the eighth debug display - char 8
                If a display is not open, it is created.
                If it has not been defined, the default is
                80x25 in a 10 point font.
<ESC>!'9'n      Close display n (1..8).
<ESC>!'10'nwhf  Define the display size and open it
                n is the display in the range 1..8
                w (width) and h (height) are 1..255.
                f (font height) is 6..24
                The display is not selected for output.
<ESC>!'11'n#<txt>  Set the caption of an open display
                n is the display, 1..8
                # is the number of characters in the string
                txt is the string (no terminator)
<ESC>!'12'nfffbbb Set the foreground and background colours
                n is the display in the range 1..8
                fff is a 24 bit foreground colour
                bbb is a 24 bit background colour
<ESC>!'13'n     Clear the display to the background colour
                n is the display in the range 1..8
<ESC>!'14'nxy   Goto the given position
                n is the display in the range 1..8
                x is the X position from the left
                y is the Y position from the top
<ESC><ESC>      Pass a single Escape character to the host.

An example of using these displays can be found in Examples/hanoi.fth.


Towers of Hanoi

: esc!          \ --
Send escape prefix.

semaphore SerChannel  1 SerChannel !    \ -- addr
Exclusive access semaphore.

: [d            \ disp -- ; disp=0..8
Select/Launch the given display. The auxiliary consoles are numbered 1..8. This is the multi-tasking version which includes a semaphore for the serial channel.

: d]            \ --
End a display sequence and return to the main console. This is the multi-tasking version which includes a semaphore for the serial channel.

: [d            \ disp -- ; disp=0..8
Select/Launch the given display. The auxiliary consoles are numbered 1..8. This is the single-tasking version.

: d]            \ --
End a display sequence and return to the main console. This is the single-tasking version.

: dclose        \ disp -- ; disp=0..8
Close the given display. If this is the current display, the main display is used.

: dopen         \ w h f disp -- ; disp=1..8
Open an auxiliary display with width=w, height=h and font size f points. The display is not selected.

: dcaption      \ caddr len disp -- ; disp=1..8
Set the string as the caption of the display.

: dcolours      \ forecolor backcolor disp -- ; disp=0..8
Set the foreground and background colours of the given display. Some colours will cause problems on the console (disp=0). Colours are of the form 00bbggrr.

A few standard colours:

$000000 constant RGB_BLACK      \ -- colorref
$DFDFDF constant RGB_LTGRAY     \ -- colorref
$FFFFFF constant RGB_WHITE      \ -- colorref
$0000FF constant RGB_RED        \ -- colorref
$00FF00 constant RGB_GREEN      \ -- colorref
$FF0000 constant RGB_BLUE       \ -- colorref

: dclear        \ disp -- ; disp=0..8
Clear the display.

: datxy         \ x y disp -- disp=1..8
Goto the given position. Does not work on the console (disp=0).