1) PropTerm.spin
The PropTerm object is the top object in the ANSI terminal project. The PropTerm object is responsible for terminal start up, the setup dialog, and keyboard decoding. This object is written entirely in spin language. At start up any previously saved settings are read from the serial EEprom device. Next the font loaded by the hardware reset (complied into the VGA_HColor_Text object) is saved into the default font location in the serial EEprom device. All custom fonts that do not have a valid font table saved to them in the EEprom device are written with the default font. At this point the PropTerm object starts the AnsiTerminal object which starts a number of its own objects.
Once the terminal is started the PropTerm object starts the Keyboard object and begins polling for key presses. The PropTerm object uses a FIFO accessed through the AnsiTerminal object to write data to the terminal and/or the RS232 interface. The PropTerm object never reads data from the ANSiTerminal object.
2) AnsiTerminal.spin
The AnsiTerminal object implements the ANSI terminal command parser. At start up the AnsiTerminal object starts the VGA_HColor_Text object which produces the hardware signals required to drive a VGA type display. The AnsiTerminal object passes the address of the character table and color table in global memory to the VGA_HColor_Text object. The character table has one byte per display position (Rows * Columns) which is used to hold the font glyph index to be displayed. The color table holds the font color and background color per display position as (Rows * Columns) words.
The AnsiTerminal object starts the AnsiHelp object that contains many of the complex functions required by the AnsiTerminal object. The AnsiTerminal object uses a command buffer in global memory to pass command requests to the AnsiHelp object for execution in assembly language.
The AnsiTerminal object uses the ComHelper object to read and write serial data. The ComHelper object is actually started by the PropTerm object by calling the "Initialize" method of the AnsiTerminal object. The PropTerm object requires the serial EEprom device support code implemented in the ComHelper object to read settings and save fonts. The AnsiTerminal object uses a command buffer in global memory to pass command requests to the ComiHelper object for execution.
3) VGA_HColor_Text.spin
The VGA_HColor_Text object produces the hardware signals required to drive a VGA type display. The VGA_HColor_Text object rasterizes the character and color data using the font glyph table to produce the required VGA video signal.
The VGA_HColor_Text object generates a 800x600 VGA signal which contains 100 columns x 50 rows or, a 640x480 VGA signal which contains 80 columns x 40 rows 'of 8x12 characters. Each character can have a unique forground/background color combination. The text characters resides at the ScreentPtr address, one byte per character. The character memory requires rows*cols bytes. 'The color information resides at the ColorPtr address one word per character. The low byte contains the forground color in the high 6 bits (RRGGBBxx). 'The high byte of the color word contains the background color (high 6 bits). When a color is written to the color table the low bits(0..1) must be 0. 'The color table requires rows*cols words. There is also a text cursor (slow blink underscore). The four rows of the cursor pattern are stored in a long at the address in PAR register. This is read during vertical blanking. You must provide buffers for the screen, colors, cursor position, and cursor pattern. Once 'started, all interfacing is done via memory. To this object, all buffers are read-only.
4) AnsiHelp.spin
The main purpose of the AnsiHelp object is to extend the size of the ANSI code implementation while allowing the code to be developed in assembly language for speed. The AnsiTerminal object makes function calls to the AnsiHelp object by writing the required parameters and function index to the command buffer in global memory. The AnsiHelp object executes the function request while the AnsiTerminal objects waits. Once the AnsiHelp object completes the requested function any required results are saved to the command buffer and the long holding the function index is set to zero to indicate the function completed.
5) ComHelper.spin
The primary function of the ComHelper object is to manage the flow of data within the terminal. A terminal is made up of multiple function blocks that must route data between each other. The main function blocks of a terminal are; the terminal parser, host interface (RS232), and keyboard interface. To mange the flow of data between each of the Propeller Cogs implementing the various terminal function blocks the ComHelper object uses a number of FIFO buffers. These FIFOs allow the ComHelper object to implement "local echo" and "local only" functionality. The ComHelper object FIFOs also remove the problem of having both the terminal parser and the PropTerm cogs attempting to write to the host interface at the same time. The ComHelper object processes function requests from the AnsiTerminal object in the same manner as the AnsiHelp object does.
The ComHelper object also implements the serial EEprom device routines. These routine have a separate command buffer from the other commands to allow the PropTerm object to use the serial EEprom to save/load setting, and font tables using the spin language. Due to code size limitations in the AnsiHelp object the ComHelper object also contains the code for the horizontal tab stop functions and the proprietary font management functions.
The host interface is currently manage by the FullDuplexSerial object. The ComHelper object starts and manages the FullDuplexSerial object. If an interface other then RS232 is required the FullDuplexSerial object would be replace by an object implementing the new host interface. The ComHelper object sends and receives data from the FullDuplexSerial object using transmit and receive FIFOs provided by the FullDuplexSerial object.
6) FullDuplexSerial.spin
The FullDuplexSerial object implement a full duplex RS232 interface. The FullDuplexSerial object allows for; baud rates of 300...128000, 5..8 bit data word size, even/odd/no parity, and RTS/CTS hardware flow control. The FullDuplexSerial object implements transmit and receive FIFOs to allow data transfer with other cogs on the Propeller chip. This object is managed by the ComHelper object which uses it as the host interface for an RS232 based terminal.
7) Keyboard.spin
The Keyboard object provides a PS2 keyboard interface for the PropTerm object. The Keyboard object is basically the same as the one provided by Parallax but has a few entries altered in the scan code table. The Keyboard object implements a FIFO to allow it to pass keyboard information to the PropTerm object.