Created
August 20, 2022 13:48
-
-
Save PennRobotics/dd872309924f272d030c08a41362a39a to your computer and use it in GitHub Desktop.
MicroProse Graphics Library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MicroProse Graphics Library is intended to be a collection of high quality routines | |
To perform the primitive graphic functions normally required in our games. | |
The routines are combined together to form a consistent interface between the applications. | |
As much as possible, graphics adapter specific logic has been hidden.To make the underlying hardware transparent to the user. | |
Each game will of necessity embellish the library with custom features. | |
Hopefully the library will at least provide the required primitives. | |
Many of the C-callable graphics routines get their parameters from a RastPort. | |
A RastPort is a definition of a window into a screen. | |
It defines the boundaries of that window for clipping and relative addressing. | |
As well as maintaining current pen colors and font info for text drawing. | |
The file RastPort contains a definition of the structure. | |
Map a graphic page to a memory segment. | |
Returns library specific data parameters one at a time. | |
Programs would have an include file with defines for the indexes.Conceptually, this facility should be for static data only. | |
Load in the selected overlay and setup vector table. | |
This is a software only function. | |
To load the new palette into the hardware registers, a SetPalette is required. | |
Set video mode for this library plus any other library specific initialization | |
The mode argument is the same value used for LibCanDo. | |
And is unused in libraries supporting a single video mode. | |
Determine what graphics modes are supported in the hardware. | |
Returns a code for the highest performance video system found. | |
It would be nice if this code was used system-wide. | |
This group of functions operate on entire graphic pages. | |
Display the selected graphics page on the CRT. | |
Otherwise a blast is performed, overwriting the data previously in video memory. | |
Display the selected graphics page on the CRT. | |
Otherwise a non-destructive ShowPage is performed, swapping the data with the video buffer. | |
A random dissolve is performed from page to the current video page. | |
This is a destructive copy in all video modes. | |
This group of functions operate on windows of graphic pages. | |
Copy a window from one graphics page to another. | |
Fill a window in a RastPort with a color. | |
These routines read a picture from a disk file into a graphics page. | |
Any conversion or decompression is performed automatically. | |
Currently two file formats are supported: IFF for development and CRUNCHED for production. | |
The picture file contains color palette data that is loaded as well. | |
For color pictures, the palette is 16 color values stored in bytes. | |
With the upper nibble being blank. | |
The following are used internally by LoadPicture. | |
The following code illustrates the intended usage. | |
Sprites are defined by a structure and are passed as arguments with pointers to that structure. | |
The header of the structure defines the size of the sprite and other parameter data. | |
Following the header is the compressed picture data. | |
Each scan line is defined by two size bytes and the variable length data. | |
The first size byte gives the relative offset to the first non-blank pixel. | |
The second size byte gives the length of data following. | |
There was a conceptual problem with building sprites off-line. | |
But I can't remember what it is. | |
Sprites can be built online or offline. | |
An off-line sprite compiler will allow sprites to be extracted from graphic images. | |
Formed into structures and saved in disk files. | |
An on-line facility will exist to perform the same function at the expense of longer load times. | |
Sprites contain the destination page for writing and display. | |
Sprites ALWAYS exist in real memory and are in pixel format. | |
It is still an open issue as to whether or not a separate mask plane is required. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was found running
strings
on an old MPS Labs binary. It offers a bit of insight into how the majority of the MicroProse graphics were constructed. It has not been edited, so it reads more like docstrings for a function that hasn't been named. I am listing it for easy access to the graphics aspect of (what I see as) an interesting early-generation video game engine.