2002.12.10 ~09 Q3VM /dev/tty Well, it's done. In the cvs repository for my Q3 mod, there is now a (dumb) terminal emulator. Currently the tty devices is capable of some sane reads and writes (i.e. open("/dev/tty", O_RDWR) acts as expected). The tty device can provide uncooked key input, but no line-buffered input yet (as expected by various command-line code). Local echo is implemented, and could be toggled if the termios functions were done. Writing to /dev/tty works as expected. Text falling off the bottom of the tty region scrolls the text as expected. Scrolling the other way not yet tested. Only a subset of command characters yield non-character effects: BS, NL, CR, LF. Other command characters produce glyphs. Backspacing past first column not tested. Reading from /dev/tty produces an octet stream of characters. Raw keycodes and key release events are not reported via /dev/tty (but instead in /dev/keyboard). Also supports ioctl(), and I made up a bunch of TIOC_* constants to fit the idiosyncrasies of Q3VM. For example, the cgame module needs to explictly blt the tty content every frame, by calling ioctl() with a request value of TIOC_DRAW (this should be renamed to TIOC_RUNFRAME or something later on...). Later I plan support for some of ECMA-035 (character sets extensions) and ECMA-048 (control characters and escape sequences).