Since I needed some functions of the BP unit CRT, I implemented them using ncurses. As a result, we now have a very primitive CRT that should be portable (ncurses is widely available, AFAIK).
However, there are some problems:
- Some CRT functions are missing, most prominently AssignCrt and the TFDD stuff (which is impossible to do with the current GPC -- but I'll try to implement it sometime later), the Window procedure (which might not be too hard to implement), TextMode (which doesn't make much sense in general, but perhaps can be done so it works where possible)...
- As a consequence of the missing TFDD stuff, input and output is not possible though the normal routines (read[ln], write[ln]), but only through CRTRead and CRTWrite. This is, of course, a big disadvantage, but thanks to ReadStr and WriteStr input and output can at least be converted quite automatically.
- The code is very alpha, I just wrote it, and didn't really test it. It only works in the program I wrote it for. Some routines haven't been tested at all.
Some other remarks:
- The interface routines to ncurses are written in C to remain portable (writing them in Pascal would have been possible, but require some manual translation of system headers which might be importable).
- When compiling, give "-lncurses" on the command line. (Sometimes, the automake mechanism doesn't find crtc.o, then give that on the command line, too.)-:
- I haven't made any attempt to merge it with the existing CRT unit for DJGPP. I'm not sure if this is useful at all (since ncurses should exist there, too), but if so, it should be possible...
For anyone who's daring to try and hopefully improve it, I'll put it at:
http://home.pages.de/~fjf/crt.pas http://home.pages.de/~fjf/crtc.c