Turbo Pascal graphics for HP Palmtops

What's so special about HPLX graphics?
The HPLX Palmtops (I'm talking about the 95, 100 and 200LX, not the Windows CE models!) use a proprietary set of instructions to put graphics on screen. In addition to that, the 100 and 200LX models can do the graphics in the CGA 640x200 standard, like the desktop machines (where, by the way, CGA is practically no longer used).

This means that programming for the 100/200LX can be done in the CGA mode with use of the Borland Graphics Interface (BGI). This, however, has a number of disadvantages

  • Programs wouldn't run on the 95LX, which, although no longer in production, is still quite popular (they just keep going, and going, and going...)
  • You would have either to distribute Borland's CGA.BGI file (60k, if I remember right) with your programs, or to make it into an .OBJ file and link that one into the program, increasing its size substantially
  • The CGA output is slower than that in the native mode
  • The BGI functional interface is more difficult to use than my wrappers around the native graphic calls (this, of course, is a matter of taste)
HP Palmtop Graphics Unit
A long time ago, while using TP6 to program my Ex on the 95LX, I found somewhere the assembly code invoking the LX graphics primitives. With some tweaking and modifications I've used that as a base for a Turbo Pascal package encapsulating the basic graphics operations. A few years later, when the 100LX arrived, I modified the package so that it was compatible with both models. The switch to Turbo Pascal 7 did not require any modifications. The arrival of the 200LX did not change anything: this model is fully compatible with the 100LX.

Since then I have used the package for function graphs and histograms in the Ex program and in some smaller applications I wrote for my own use. It seems to work just fine. Another small unit is used for automatic detection of the machine on which the program is running (95LX vs. 100/200LX vs. a desktop PC).

Now I'm making the package available to any fellow programmers who still write for the HP Palmtop. Enjoy!

The distribution
The archive consists of three .TPU (compiled Turbo Pascal Unit) files with the corresponding .INT (interface) files; these contain the Pascal declarations of types, constants and subroutines with a short (but sufficient, I hope!) documentation. A README.1ST introduction text is also attached.
[Download] lxtpgr.zip (10k) - the complete package with documentation (97/10/24)
I am not making warranties of any kind on how the package performs; use it at your own risk. It works just fine for me. Still, if you discover (or suspect) any bugs or if you find the documentation erroneous, misleading or insufficient, let me know and I may try to fix it.

You are free to use the package in any programs you write. If you distribute these programs, please include the reference to it in your documentation, also giving the URL of the HP Palmtop Corner.

Have fun!


Home: wrotniak.net | Search this site | Change font size

Photo Tidbits News | The Gallery


Posted 1997/10/23; last updated 2002/06/15 Copyright © 1997-2002 by J. Andrzej Wrotniak.