Minor updates today: I timed the two character drawing routines for writing 120,000 characters to the screen: the old version was nine seconds and change and the optimised version just 0.9 seconds - call it eight microseconds per character. Which means I can write incoming data - other than any screen scrolls - ten times faster than a 115200 serial port. I can live with that.
(Hmm, writing the screen with 2,400 characters would therefore take just under 20ms; nearly as fast as moving the memory...)
I've modified terminal() slightly to accommodate 0x0c (CLS) and 0x0a or 0x0d as carriage return. At the moment I have a serial port on /dev/ttyACM0 courtesy of the Arduino framework, which is handy, saves me doing one.
The aim is that there will be Pico buffers for UART incoming and outgoing, PS/2 incoming, and screen outgoing (i.e. to the vga output). I haven't fully thought out the interface yet but I have enough pins for sixteen or thirty-two addresses, chip enable, and read-not-write (if I can work out how to program it
).
First thought of an interface - subject to lots of changes if it doesn't work...
Code:
address read write
0 status bits status/command bits
1 UART Rx (ACM0) UART Tx (ACM0)
2 PS/2 char (raw or cooked)
3 char to write to terminal (vga)
4 foreground colour
5 background colour
6/7 cursor or graphics start 'x'
8/9 cursor or graphics start 'y'
10/11 graphics end 'x'
12/13 graphics end 'y'
14 graphics command (point, line, square, circle etc)
Still thinking about this, but my idea is that a write to the serial or vga text would immediately call the appropriate routines; similarly a graphics command would assume that the appropriate data has already been loaded.
Neil