In response to popular demand, I am herewith making available the sources for my low-level graphics modules for the PC. These may be freely used and modified, subject only to the condition that they may not be sold or used in any product which is sold. (For for-profit applications, please contact the author.) Future versions might come with more stringent conditions.
These modules are part of the PMOS library; I've extracted this small subset of modules for the benefit of those who want only the low-level graphics. (If you already have PMOS version 2.2, don't bother fetching this graphics package - you already have it.)
To obtain the graphics package, fetch the file graf004.zip (don't forget to set binary mode for ftp transfers).
The package does NOT include higher-level features such as screen windows. If you want such things you'll have to fetch the entire PMOS package.
Limitation: although we do most things via direct access to the hardware, mode setting is done by BIOS calls. Since the BIOS software on video adaptors is usually buggy - it's apparently written by the same people who have given such a bad reputation to Windows and OS/2 screen drivers - you will probably find one or more modes that don't work. The faulty modes seem to vary from model to model and are hard to predict. The solution is to modify the "Screen" module to disable the modes that don't work on your hardware.
SVGA support includes 256-colour, 32K-colour and 64K-colour modes, but for efficiency reasons I've left out 24-bit colour support. Graphics accelerator support is not yet available; I'm hoping to add it for ATI, S3, and Trident, maybe for other chips if the demand is strong enough, but the available documentation is so poor that it's hard to predict when and if this will be done.
The software as supplied works with TopSpeed Modula-2 version 3. By running it through the PP preprocessor (see the information on PMOS) you can get a working version for TopSpeed version 1.17. Porting to other dialects of Modula-2 should be easy.
Porting to another language is possible in principle - and certainly easier than starting the whole job from scratch - but might result in a loss of execution speed. For the sake of run-time efficiency, the code uses features of the Modula-2 language that might be hard to emulate in languages which are less suited for systems programming.