Graphics Library (part 4 of 5)
Dave Lewis
lewis at m2-net.UUCP
Fri Jul 1 14:15:00 AEST 1988
------------------------------ cut here ------------------------------
# To recover, type "sh archive"
echo restoring bitmaps.h
sed 's/^X//' > bitmaps.h <<XxX--EOF--XxX
X/* @(#) bitmaps.h 4.4 88/06/19 */
X/*
X * Copyright (c) David T. Lewis 1987, 1988
X * All rights reserved.
X *
X * Permission is granted to use this for any personal noncommercial use.
X * You may not distribute source or executable code for profit, nor
X * may you distribute it with a commercial product without the written
X * consent of the author. Please send modifications to the author for
X * inclusion in updates to the program. Thanks.
X */
X
X/* Number of print pixel columns across the page. */
X# define PRINTDENSITY 960
X/* Number of 8 pixel print rows down the page (times 3 for full page). */
X# define PRINTLINES 30
X
X/*
X * Define the structure for CGA video memory.
X */
Xtypedef struct CGAMEM {
X char page1[100][80];
X char filler[192];
X char page2[100][80];
X} CGA_BUF_TYPE;
X
X/*
X * Define the structure for EGA video memory.
X */
Xtypedef struct EGAMEM {
X char mem[350][80];
X} EGA_BUF_TYPE;
X
X/*
X * Define the structure for Hercules video memory.
X */
Xtypedef struct HERCMEM {
X char page1[87][90];
X char filler1[362];
X char page2[87][90];
X char filler2[362];
X char page3[87][90];
X char filler3[362];
X char page4[87][90];
X} HERC_BUF_TYPE;
X
X/*
X * Define the structure for a memory buffer for IBM printer bit map
X * image. The horizontal resolution may be either 960 bits, or 480
X * bits (in which case only part of the 960 characters is used in each
X * line of the buffer). The buffer is divided into multiple pages so
X * that it can fit into two memory segments of < 64K each. That is,
X * three of these structures must be declared to make a complete print
X * buffer for 90 * 960 byte printing.
X */
Xtypedef struct IBM_PRINT_BUF {
X char buf[PRINTLINES][PRINTDENSITY];
X} PR_BUF_TYPE; /* Three of these required! */
XxX--EOF--XxX
echo restoring cellfont.h
sed 's/^X//' > cellfont.h <<XxX--EOF--XxX
X/* @(#) cellfont.h 4.3 88/06/19 */
X/* Note: Copyright status unknown. Presumed public domain. dtl 3-15-88*/
X
X/* RAM-Loadable Character Sets for the IBM PC
X Richard Wilton
X July 1986 */
X
X/* definitions for 8 by 8 characters 00 through FF */
X
Xstatic char charcell [2048]={
X 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000, /* 000 */
X 0x07E,0x081,0x0A5,0x081,0x0BD,0x099,0x081,0x07E, /* 001 */
X 0x07E,0x0FF,0x000,0x0FF,0x0C3,0x0E7,0x0FF,0x07E, /* 002 */
X 0x06C,0x0FE,0x0FE,0x0FE,0x07C,0x038,0x010,0x000, /* 003 */
X 0x010,0x038,0x07C,0x0FE,0x07C,0x038,0x010,0x000, /* 004 */
X 0x038,0x07C,0x038,0x0FE,0x0FE,0x07C,0x038,0x07C, /* 005 */
X 0x010,0x010,0x038,0x07C,0x0FE,0x07C,0x038,0x07C, /* 006 */
X 0x000,0x000,0x018,0x03C,0x03C,0x018,0x000,0x000, /* 007 */
X 0x0FF,0x0FF,0x0E7,0x0C3,0x0C3,0x0E7,0x0FF,0x0FF, /* 008 */
X 0x000,0x03C,0x066,0x042,0x042,0x066,0x03C,0x000, /* 009 */
X 0x0FF,0x0C3,0x099,0x0BD,0x0BD,0x099,0x0C3,0x0FF, /* 00A */
X 0x00F,0x007,0x00F,0x07D,0x0CC,0x0CC,0x0CC,0x078, /* 00B */
X 0x03C,0x066,0x066,0x066,0x03C,0x018,0x07E,0x018, /* 00C */
X 0x03F,0x033,0x03F,0x030,0x030,0x070,0x0F0,0x0E0, /* 00D */
X 0x07F,0x063,0x07F,0x063,0x063,0x067,0x0E6,0x0C0, /* 00E */
X 0x099,0x05A,0x03C,0x0E7,0x0E7,0x03C,0x05A,0x099, /* 00F */
X 0x080,0x0E0,0x0F8,0x0FE,0x0F8,0x0E0,0x080,0x000, /* 010 */
X 0x002,0x00E,0x03E,0x0FE,0x03E,0x00E,0x002,0x000, /* 011 */
X 0x018,0x03C,0x07E,0x018,0x018,0x07E,0x03C,0x018, /* 012 */
X 0x066,0x066,0x066,0x066,0x066,0x000,0x066,0x000, /* 013 */
X 0x07F,0x000,0x000,0x07B,0x01B,0x01B,0x01B,0x000, /* 014 */
X 0x03E,0x063,0x038,0x06C,0x06C,0x038,0x0CC,0x078, /* 015 */
X 0x000,0x000,0x000,0x000,0x07E,0x07E,0x07E,0x000, /* 016 */
X 0x018,0x03C,0x07E,0x018,0x07E,0x03C,0x018,0x0FF, /* 017 */
X 0x018,0x03C,0x07E,0x018,0x018,0x018,0x018,0x000, /* 018 */
X 0x018,0x018,0x018,0x018,0x07E,0x03C,0x018,0x000, /* 019 */
X 0x000,0x018,0x00C,0x0FE,0x00C,0x018,0x000,0x000, /* 01A */
X 0x000,0x030,0x060,0x0FE,0x060,0x030,0x000,0x000, /* 01B */
X 0x000,0x000,0x0C0,0x0C0,0x0C0,0x0FE,0x000,0x000, /* 01C */
X 0x000,0x024,0x066,0x0FF,0x066,0x024,0x000,0x000, /* 01D */
X 0x000,0x018,0x03C,0x07E,0x0FF,0x0FF,0x000,0x000, /* 01E */
X 0x000,0x0FF,0x0FF,0x07E,0x03C,0x018,0x000,0x000, /* 01F */
X 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000, /* 020 */
X 0x030,0x078,0x078,0x030,0x030,0x000,0x030,0x000, /* 021 */
X 0x06C,0x06C,0x06C,0x000,0x000,0x000,0x000,0x000, /* 022 */
X 0x06C,0x06C,0x0FE,0x06C,0x0FE,0x06C,0x06C,0x000, /* 023 */
X 0x030,0x07C,0x0C0,0x078,0x00C,0x0F8,0x030,0x000, /* 024 */
X 0x000,0x0C6,0x0CC,0x018,0x030,0x066,0x0C6,0x000, /* 025 */
X 0x038,0x06C,0x038,0x076,0x0DC,0x0CC,0x076,0x000, /* 026 */
X 0x060,0x060,0x0C0,0x000,0x000,0x000,0x000,0x000, /* 027 */
X 0x018,0x030,0x060,0x060,0x060,0x030,0x018,0x000, /* 028 */
X 0x060,0x030,0x018,0x018,0x018,0x030,0x060,0x000, /* 029 */
X 0x000,0x066,0x03C,0x0FF,0x03C,0x066,0x000,0x000, /* 02A */
X 0x000,0x030,0x030,0x0FC,0x030,0x030,0x000,0x000, /* 02B */
X 0x000,0x000,0x000,0x000,0x000,0x030,0x030,0x060, /* 02C */
X 0x000,0x000,0x000,0x0FC,0x000,0x000,0x000,0x000, /* 02D */
X 0x000,0x000,0x000,0x000,0x000,0x030,0x030,0x000, /* 02E */
X 0x006,0x00C,0x018,0x030,0x060,0x0C0,0x080,0x000, /* 02F */
X 0x07C,0x0C6,0x0CE,0x0DE,0x0F6,0x0E6,0x07C,0x000, /* 030 */
X 0x030,0x070,0x030,0x030,0x030,0x030,0x0FC,0x000, /* 031 */
X 0x078,0x0CC,0x00C,0x038,0x060,0x0CC,0x0FC,0x000, /* 032 */
X 0x078,0x0CC,0x00C,0x038,0x00C,0x0CC,0x078,0x000, /* 033 */
X 0x01C,0x03C,0x06C,0x0CC,0x0FE,0x00C,0x01E,0x000, /* 034 */
X 0x0FC,0x0C0,0x0F8,0x00C,0x00C,0x0CC,0x078,0x000, /* 035 */
X 0x038,0x060,0x0C0,0x0F8,0x0CC,0x0CC,0x078,0x000, /* 036 */
X 0x0FC,0x0CC,0x00C,0x018,0x030,0x030,0x030,0x000, /* 037 */
X 0x078,0x0CC,0x0CC,0x078,0x0CC,0x0CC,0x078,0x000, /* 038 */
X 0x078,0x0CC,0x0CC,0x07C,0x00C,0x018,0x070,0x000, /* 039 */
X 0x000,0x030,0x030,0x000,0x000,0x030,0x030,0x000, /* 03A */
X 0x000,0x030,0x030,0x000,0x000,0x030,0x030,0x060, /* 03B */
X 0x018,0x030,0x060,0x0C0,0x060,0x030,0x018,0x000, /* 03C */
X 0x000,0x000,0x0FC,0x000,0x000,0x0FC,0x000,0x000, /* 03D */
X 0x060,0x030,0x018,0x00C,0x018,0x030,0x060,0x000, /* 03E */
X 0x078,0x0CC,0x00C,0x018,0x030,0x000,0x030,0x000, /* 03F */
X 0x07C,0x0C6,0x0DE,0x0DE,0x0DE,0x0C0,0x078,0x000, /* 040 */
X 0x030,0x078,0x0CC,0x0CC,0x0FC,0x0CC,0x0CC,0x000, /* 041 */
X 0x0FC,0x066,0x066,0x07C,0x066,0x066,0x0FC,0x000, /* 042 */
X 0x03C,0x066,0x0C0,0x0C0,0x0C0,0x066,0x03C,0x000, /* 043 */
X 0x0F8,0x06C,0x066,0x066,0x066,0x06C,0x0F8,0x000, /* 044 */
X 0x0FE,0x062,0x068,0x078,0x068,0x062,0x0FE,0x000, /* 045 */
X 0x0FE,0x062,0x068,0x078,0x068,0x060,0x0F0,0x000, /* 046 */
X 0x03C,0x066,0x0C0,0x0C0,0x0CE,0x066,0x03E,0x000, /* 047 */
X 0x0CC,0x0CC,0x0CC,0x0FC,0x0CC,0x0CC,0x0CC,0x000, /* 048 */
X 0x078,0x030,0x030,0x030,0x030,0x030,0x078,0x000, /* 049 */
X 0x01E,0x00C,0x00C,0x00C,0x0CC,0x0CC,0x078,0x000, /* 04A */
X 0x0E6,0x066,0x06C,0x078,0x06C,0x066,0x0E6,0x000, /* 04B */
X 0x0F0,0x060,0x060,0x060,0x062,0x066,0x0FE,0x000, /* 04C */
X 0x0C6,0x0EE,0x0FE,0x0FE,0x0D6,0x0C6,0x0C6,0x000, /* 04D */
X 0x0C6,0x0E6,0x0F6,0x0DE,0x0CE,0x0C6,0x0C6,0x000, /* 04E */
X 0x038,0x06C,0x0C6,0x0C6,0x0C6,0x06C,0x038,0x000, /* 04F */
X 0x0FC,0x066,0x066,0x07C,0x060,0x060,0x0F0,0x000, /* 050 */
X 0x078,0x0CC,0x0CC,0x0CC,0x0DC,0x078,0x01C,0x000, /* 051 */
X 0x0FC,0x066,0x066,0x07C,0x06C,0x066,0x0E6,0x000, /* 052 */
X 0x078,0x0CC,0x0E0,0x070,0x01C,0x0CC,0x078,0x000, /* 053 */
X 0x0FC,0x0B4,0x030,0x030,0x030,0x030,0x078,0x000, /* 054 */
X 0x0CC,0x0CC,0x0CC,0x0CC,0x0CC,0x0CC,0x0FC,0x000, /* 055 */
X 0x0CC,0x0CC,0x0CC,0x0CC,0x0CC,0x078,0x030,0x000, /* 056 */
X 0x0C6,0x0C6,0x0C6,0x0D6,0x0FE,0x0EE,0x0C6,0x000, /* 057 */
X 0x0C6,0x0C6,0x06C,0x038,0x038,0x06C,0x0C6,0x000, /* 058 */
X 0x0CC,0x0CC,0x0CC,0x078,0x030,0x030,0x078,0x000, /* 059 */
X 0x0FE,0x0C6,0x08C,0x018,0x032,0x066,0x0FE,0x000, /* 05A */
X 0x078,0x060,0x060,0x060,0x060,0x060,0x078,0x000, /* 05B */
X 0x0C0,0x060,0x030,0x018,0x00C,0x006,0x002,0x000, /* 05C */
X 0x078,0x018,0x018,0x018,0x018,0x018,0x078,0x000, /* 05D */
X 0x010,0x038,0x06C,0x0C6,0x000,0x000,0x000,0x000, /* 05E */
X 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x0FF, /* 05F */
X 0x030,0x030,0x018,0x000,0x000,0x000,0x000,0x000, /* 060 */
X 0x000,0x000,0x078,0x00C,0x07C,0x0CC,0x076,0x000, /* 061 */
X 0x0E0,0x060,0x060,0x07C,0x066,0x066,0x0DC,0x000, /* 062 */
X 0x000,0x000,0x078,0x0CC,0x0C0,0x0CC,0x078,0x000, /* 063 */
X 0x01C,0x00C,0x00C,0x07C,0x0CC,0x0CC,0x076,0x000, /* 064 */
X 0x000,0x000,0x078,0x0CC,0x0FC,0x0C0,0x078,0x000, /* 065 */
X 0x038,0x06C,0x060,0x0F0,0x060,0x060,0x0F0,0x000, /* 066 */
X 0x000,0x000,0x076,0x0CC,0x0CC,0x07C,0x00C,0x0F8, /* 067 */
X 0x0E0,0x060,0x06C,0x076,0x066,0x066,0x0E6,0x000, /* 068 */
X 0x030,0x000,0x070,0x030,0x030,0x030,0x078,0x000, /* 069 */
X 0x00C,0x000,0x00C,0x00C,0x00C,0x0CC,0x0CC,0x078, /* 06A */
X 0x0E0,0x060,0x066,0x06C,0x078,0x06C,0x0E6,0x000, /* 06B */
X 0x070,0x030,0x030,0x030,0x030,0x030,0x078,0x000, /* 06C */
X 0x000,0x000,0x0CC,0x0FE,0x0FE,0x0D6,0x0C6,0x000, /* 06D */
X 0x000,0x000,0x0F8,0x0CC,0x0CC,0x0CC,0x0CC,0x000, /* 06E */
X 0x000,0x000,0x078,0x0CC,0x0CC,0x0CC,0x078,0x000, /* 06F */
X 0x000,0x000,0x0DC,0x066,0x066,0x07C,0x060,0x0F0, /* 070 */
X 0x000,0x000,0x076,0x0CC,0x0CC,0x07C,0x00C,0x01E, /* 071 */
X 0x000,0x000,0x0DC,0x076,0x066,0x060,0x0F0,0x000, /* 072 */
X 0x000,0x000,0x07C,0x0C0,0x078,0x00C,0x0F8,0x000, /* 073 */
X 0x010,0x030,0x07C,0x030,0x030,0x034,0x018,0x000, /* 074 */
X 0x000,0x000,0x0CC,0x0CC,0x0CC,0x0CC,0x076,0x000, /* 075 */
X 0x000,0x000,0x0CC,0x0CC,0x0CC,0x078,0x030,0x000, /* 076 */
X 0x000,0x000,0x0C6,0x0D6,0x0FE,0x0FE,0x06C,0x000, /* 077 */
X 0x000,0x000,0x0C6,0x06C,0x038,0x06C,0x0C6,0x000, /* 078 */
X 0x000,0x000,0x0CC,0x0CC,0x0CC,0x07C,0x00C,0x0F8, /* 079 */
X 0x000,0x000,0x0FC,0x098,0x030,0x064,0x0FC,0x000, /* 07A */
X 0x01C,0x030,0x030,0x0E0,0x030,0x030,0x01C,0x000, /* 07B */
X 0x018,0x018,0x018,0x000,0x018,0x018,0x018,0x000, /* 07C */
X 0x0E0,0x030,0x030,0x01C,0x030,0x030,0x0E0,0x000, /* 07D */
X 0x076,0x0DC,0x000,0x000,0x000,0x000,0x000,0x000, /* 07E */
X 0x000,0x010,0x038,0x06C,0x0C6,0x0C6,0x0FE,0x000, /* 07F */
X 0x078,0x0CC,0x0C0,0x0CC,0x078,0x018,0x00C,0x078, /* 080 */
X 0x000,0x066,0x000,0x066,0x066,0x066,0x03F,0x000, /* 081 */
X 0x00E,0x000,0x03C,0x066,0x07E,0x060,0x03C,0x000, /* 082 */
X 0x07E,0x0C3,0x03C,0x006,0x03E,0x066,0x03F,0x000, /* 083 */
X 0x066,0x000,0x03C,0x006,0x03E,0x066,0x03F,0x000, /* 084 */
X 0x070,0x000,0x03C,0x006,0x03E,0x066,0x03F,0x000, /* 085 */
X 0x018,0x018,0x03C,0x006,0x03E,0x066,0x03F,0x000, /* 086 */
X 0x000,0x000,0x03C,0x060,0x060,0x03C,0x006,0x01C, /* 087 */
X 0x07E,0x0C3,0x03C,0x066,0x07E,0x060,0x03C,0x000, /* 088 */
X 0x066,0x000,0x03C,0x066,0x07E,0x060,0x03C,0x000, /* 089 */
X 0x070,0x000,0x03C,0x066,0x07E,0x060,0x03C,0x000, /* 08A */
X 0x066,0x000,0x038,0x018,0x018,0x018,0x03C,0x000, /* 08B */
X 0x07C,0x0C6,0x038,0x018,0x018,0x018,0x03C,0x000, /* 08C */
X 0x070,0x000,0x038,0x018,0x018,0x018,0x03C,0x000, /* 08D */
X 0x063,0x01C,0x036,0x063,0x07F,0x063,0x063,0x000, /* 08E */
X 0x018,0x018,0x000,0x03C,0x066,0x07E,0x066,0x000, /* 08F */
X 0x00E,0x000,0x07E,0x030,0x03C,0x030,0x07E,0x000, /* 090 */
X 0x000,0x000,0x07F,0x00C,0x07F,0x0CC,0x07F,0x000, /* 091 */
X 0x01F,0x036,0x066,0x07F,0x066,0x066,0x067,0x000, /* 092 */
X 0x03C,0x066,0x000,0x03C,0x066,0x066,0x03C,0x000, /* 093 */
X 0x000,0x066,0x000,0x03C,0x066,0x066,0x03C,0x000, /* 094 */
X 0x000,0x070,0x000,0x03C,0x066,0x066,0x03C,0x000, /* 095 */
X 0x03C,0x066,0x000,0x066,0x066,0x066,0x03F,0x000, /* 096 */
X 0x000,0x070,0x000,0x066,0x066,0x066,0x03F,0x000, /* 097 */
X 0x000,0x066,0x000,0x066,0x066,0x03E,0x006,0x07C, /* 098 */
X 0x0C3,0x018,0x03C,0x066,0x066,0x03C,0x018,0x000, /* 099 */
X 0x066,0x000,0x066,0x066,0x066,0x066,0x03C,0x000, /* 09A */
X 0x018,0x018,0x07E,0x0C0,0x0C0,0x07E,0x018,0x018, /* 09B */
X 0x01C,0x036,0x032,0x078,0x030,0x073,0x07E,0x000, /* 09C */
X 0x066,0x066,0x03C,0x07E,0x018,0x07E,0x018,0x018, /* 09D */
X 0x0F8,0x0CC,0x0CC,0x0FA,0x0C6,0x0CF,0x0C6,0x0C7, /* 09E */
X 0x00E,0x01B,0x018,0x03C,0x018,0x018,0x0D8,0x070, /* 09F */
X 0x00E,0x000,0x03C,0x006,0x03E,0x066,0x03F,0x000, /* 0A0 */
X 0x01C,0x000,0x038,0x018,0x018,0x018,0x03C,0x000, /* 0A1 */
X 0x000,0x00E,0x000,0x03C,0x066,0x066,0x03C,0x000, /* 0A2 */
X 0x000,0x00E,0x000,0x066,0x066,0x066,0x03F,0x000, /* 0A3 */
X 0x000,0x07C,0x000,0x07C,0x066,0x066,0x066,0x000, /* 0A4 */
X 0x07E,0x000,0x066,0x076,0x07E,0x06E,0x066,0x000, /* 0A5 */
X 0x03C,0x06C,0x06C,0x03E,0x000,0x07E,0x000,0x000, /* 0A6 */
X 0x038,0x06C,0x06C,0x038,0x000,0x07C,0x000,0x000, /* 0A7 */
X 0x018,0x000,0x018,0x030,0x060,0x066,0x03C,0x000, /* 0A8 */
X 0x000,0x000,0x000,0x07E,0x060,0x060,0x000,0x000, /* 0A9 */
X 0x000,0x000,0x000,0x07E,0x006,0x006,0x000,0x000, /* 0AA */
X 0x0C3,0x0C6,0x0CC,0x0DE,0x033,0x066,0x0CC,0x00F, /* 0AB */
X 0x0C3,0x0C6,0x0CC,0x000,0x037,0x06F,0x0CF,0x003, /* 0AC */
X 0x018,0x018,0x000,0x018,0x018,0x018,0x018,0x000, /* 0AD */
X 0x000,0x033,0x066,0x0CC,0x066,0x033,0x000,0x000, /* 0AE */
X 0x000,0x0CC,0x066,0x033,0x066,0x0CC,0x000,0x000, /* 0AF */
X 0x022,0x088,0x022,0x088,0x022,0x088,0x022,0x088, /* 0B0 */
X 0x055,0x0AA,0x055,0x0AA,0x055,0x0AA,0x055,0x0AA, /* 0B1 */
X 0x000,0x077,0x000,0x0EE,0x000,0x077,0x000,0x0EE, /* 0B2 */
X 0x018,0x018,0x018,0x018,0x018,0x018,0x018,0x018, /* 0B3 */
X 0x018,0x018,0x018,0x018,0x0F8,0x018,0x018,0x018, /* 0B4 */
X 0x018,0x018,0x0F8,0x018,0x0F8,0x018,0x018,0x018, /* 0B5 */
X 0x036,0x036,0x036,0x036,0x0F6,0x036,0x036,0x036, /* 0B6 */
X 0x000,0x000,0x000,0x000,0x0FE,0x036,0x036,0x036, /* 0B7 */
X 0x000,0x000,0x0F8,0x018,0x0F8,0x018,0x018,0x018, /* 0B8 */
X 0x036,0x036,0x0F6,0x006,0x0F6,0x036,0x036,0x036, /* 0B9 */
X 0x036,0x036,0x036,0x036,0x036,0x036,0x036,0x036, /* 0BA */
X 0x000,0x000,0x0FE,0x006,0x0F6,0x036,0x036,0x036, /* 0BB */
X 0x036,0x036,0x0F6,0x006,0x0FE,0x000,0x000,0x000, /* 0BC */
X 0x036,0x036,0x036,0x036,0x0FE,0x000,0x000,0x000, /* 0BD */
X 0x018,0x018,0x0F8,0x018,0x0F8,0x000,0x000,0x000, /* 0BE */
X 0x000,0x000,0x000,0x000,0x0F8,0x018,0x018,0x018, /* 0BF */
X 0x018,0x018,0x018,0x018,0x01F,0x000,0x000,0x000, /* 0C0 */
X 0x018,0x018,0x018,0x018,0x0FF,0x000,0x000,0x000, /* 0C1 */
X 0x000,0x000,0x000,0x000,0x0FF,0x018,0x018,0x018, /* 0C2 */
X 0x018,0x018,0x018,0x018,0x01F,0x018,0x018,0x018, /* 0C3 */
X 0x000,0x000,0x000,0x000,0x0FF,0x000,0x000,0x000, /* 0C4 */
X 0x018,0x018,0x018,0x018,0x0FF,0x018,0x018,0x018, /* 0C5 */
X 0x018,0x018,0x01F,0x018,0x01F,0x018,0x018,0x018, /* 0C6 */
X 0x036,0x036,0x036,0x036,0x037,0x036,0x036,0x036, /* 0C7 */
X 0x036,0x036,0x037,0x030,0x03F,0x000,0x000,0x000, /* 0C8 */
X 0x000,0x000,0x03F,0x030,0x037,0x036,0x036,0x036, /* 0C9 */
X 0x036,0x036,0x0F7,0x000,0x0FF,0x000,0x000,0x000, /* 0CA */
X 0x000,0x000,0x0FF,0x000,0x0F7,0x036,0x036,0x036, /* 0CB */
X 0x036,0x036,0x037,0x030,0x037,0x036,0x036,0x036, /* 0CC */
X 0x000,0x000,0x0FF,0x000,0x0FF,0x000,0x000,0x000, /* 0CD */
X 0x036,0x036,0x0F7,0x000,0x0F7,0x036,0x036,0x036, /* 0CE */
X 0x018,0x018,0x0FF,0x000,0x0FF,0x000,0x000,0x000, /* 0CF */
X 0x036,0x036,0x036,0x036,0x0FF,0x000,0x000,0x000, /* 0D0 */
X 0x000,0x000,0x0FF,0x000,0x0FF,0x018,0x018,0x018, /* 0D1 */
X 0x000,0x000,0x000,0x000,0x0FF,0x036,0x036,0x036, /* 0D2 */
X 0x036,0x036,0x036,0x036,0x03F,0x000,0x000,0x000, /* 0D3 */
X 0x018,0x018,0x01F,0x018,0x01F,0x000,0x000,0x000, /* 0D4 */
X 0x000,0x000,0x01F,0x018,0x01F,0x018,0x018,0x018, /* 0D5 */
X 0x000,0x000,0x000,0x000,0x03F,0x036,0x036,0x036, /* 0D6 */
X 0x036,0x036,0x036,0x036,0x0FF,0x036,0x036,0x036, /* 0D7 */
X 0x018,0x018,0x0FF,0x018,0x0FF,0x018,0x018,0x018, /* 0D8 */
X 0x018,0x018,0x018,0x018,0x0F8,0x000,0x000,0x000, /* 0D9 */
X 0x000,0x000,0x000,0x000,0x01F,0x018,0x018,0x018, /* 0DA */
X 0x0FF,0x0FF,0x0FF,0x0FF,0x0FF,0x0FF,0x0FF,0x0FF, /* 0 */
X 0x000,0x000,0x000,0x000,0x0FF,0x0FF,0x0FF,0x0FF, /* 0DC */
X 0x0F0,0x0F0,0x0F0,0x0F0,0x0F0,0x0F0,0x0F0,0x0F0, /* 0DD */
X 0x00F,0x00F,0x00F,0x00F,0x00F,0x00F,0x00F,0x00F, /* 0DE */
X 0x0FF,0x0FF,0x0FF,0x0FF,0x000,0x000,0x000,0x000, /* 0DF */
X 0x000,0x000,0x03B,0x06E,0x064,0x06E,0x03B,0x000, /* 0E0 */
X 0x000,0x03C,0x066,0x07C,0x066,0x07C,0x060,0x060, /* 0E1 */
X 0x000,0x07E,0x066,0x060,0x060,0x060,0x060,0x000, /* 0E2 */
X 0x000,0x07F,0x036,0x036,0x036,0x036,0x036,0x000, /* 0E3 */
X 0x07E,0x066,0x030,0x018,0x030,0x066,0x07E,0x000, /* 0E4 */
X 0x000,0x000,0x03F,0x06C,0x06C,0x06C,0x038,0x000, /* 0E5 */
X 0x000,0x033,0x033,0x033,0x033,0x03E,0x030,0x060, /* 0E6 */
X 0x000,0x03B,0x06E,0x00C,0x00C,0x00C,0x00C,0x000, /* 0E7 */
X 0x07E,0x018,0x03C,0x066,0x066,0x03C,0x018,0x07E, /* 0E8 */
X 0x01C,0x036,0x063,0x07F,0x063,0x036,0x01C,0x000, /* 0E9 */
X 0x01C,0x036,0x063,0x063,0x036,0x036,0x077,0x000, /* 0EA */
X 0x00E,0x018,0x00C,0x03E,0x066,0x066,0x03C,0x000, /* 0EB */
X 0x000,0x000,0x07E,0x000,0x000,0x07E,0x000,0x000, /* 0EC */
X 0x006,0x00C,0x07E,0x000,0x000,0x07E,0x060,0x0C0, /* 0ED */
X 0x01C,0x060,0x0C0,0x0FC,0x0C0,0x060,0x01C,0x000, /* 0EE */
X 0x03C,0x066,0x066,0x066,0x066,0x066,0x066,0x000, /* 0EF */
X 0x000,0x07E,0x000,0x07E,0x000,0x07E,0x000,0x000, /* 0F0 */
X 0x018,0x018,0x07E,0x018,0x018,0x000,0x07E,0x000, /* 0F1 */
X 0x030,0x018,0x00C,0x018,0x030,0x000,0x07E,0x000, /* 0F2 */
X 0x00C,0x018,0x030,0x018,0x00C,0x000,0x07E,0x000, /* 0F3 */
X 0x00E,0x01B,0x01B,0x018,0x018,0x018,0x018,0x018, /* 0F4 */
X 0x018,0x018,0x018,0x018,0x018,0x0D8,0x0D8,0x070, /* 0F5 */
X 0x018,0x018,0x000,0x07E,0x000,0x018,0x018,0x000, /* 0F6 */
X 0x000,0x076,0x0DC,0x000,0x076,0x0DC,0x000,0x000, /* 0F7 */
X 0x038,0x06C,0x06C,0x038,0x000,0x000,0x000,0x000, /* 0F8 */
X 0x000,0x000,0x000,0x018,0x018,0x000,0x000,0x000, /* 0F9 */
X 0x000,0x000,0x000,0x000,0x018,0x000,0x000,0x000, /* 0FA */
X 0x00F,0x00C,0x00C,0x00C,0x0EC,0x06C,0x03C,0x01C, /* 0FB */
X 0x078,0x06C,0x06C,0x06C,0x06C,0x000,0x000,0x000, /* 0FC */
X 0x070,0x018,0x030,0x060,0x078,0x000,0x000,0x000, /* 0FD */
X 0x000,0x000,0x03C,0x03C,0x03C,0x03C,0x000,0x000, /* 0FE */
X 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000 /* 0FF */
X};
XxX--EOF--XxX
echo restoring graphics.h
sed 's/^X//' > graphics.h <<XxX--EOF--XxX
X/* @(#) graphics.h 4.5 88/06/19 */
X/*
X * Copyright (c) David T. Lewis 1987, 1988
X * All rights reserved.
X *
X * Permission is granted to use this for any personal noncommercial use.
X * You may not distribute source or executable code for profit, nor
X * may you distribute it with a commercial product without the written
X * consent of the author. Please send modifications to the author for
X * inclusion in updates to the program. Thanks.
X */
X
X
X/* Define variables used in translation from 3D world coordinates */
X/* through several steps to reach the screen. */
X/* Sun Dec 20 18:31:11 EST 1987 */
X/* system5 dtlewis 2 2.2-U AT */
X/* dtlewis 6-28-87 */
X
X#include "bitmaps.h"
X
X#define PRINTPROG "/usr/bin/lp"
X
X/*
X * The following are for MIX-C on MS-DOS.
X */
X#define DOS 0x021
X#define VIDEO_BIOS 0x010
X#define SET_VIDEO_MODE 0x00
X#define WRT_PIXEL 0x0C
X
X/*
X * Mode definitions.
X */
X#define CGA_HI_RES_MODE 0x06
X#define CGA_COLOR_MODE 0x04
X#define EGA_COLOR_MODE 0x010
X#define HERC_GRAF_MODE 0x08
X#define COLOR_TEXT 0x03
X#define MONO_TEXT 0x02
X#define IBM_PRINTER 0x100
X
X/*
X * The following are masks for the four possible 2-bit pixel
X * positions in CGA 320x200 mode.
X */
X#define PIX0 0x0C0
X#define PIX1 0x030
X#define PIX2 0x0C
X#define PIX3 0x03
X
X/*
X * Define range of the normalized 2D coordinate system
X */
X#define NORM_X_MIN 0
X#define NORM_Y_MIN 0
X#define NORM_X_MAX 32767
X#define NORM_Y_MAX 32767
X#define NORM_X_RANGE 0x7FFFL
X#define NORM_Y_RANGE 0x7FFFL
X
X#define X_CELL_BITS 8 /* Number of bits per character cell */
X /* in X direction. */
X
X#define Y_CELL_BITS 8 /* Number of bits per character cell */
X /* in Y direction. */
X
X/* Define transforms for normalized 2-D drawing space to pixel space. */
X/* These routines convert from normalized (x,y) coordinates to local */
X/* screen pixel coordinates. The normalized coordinate system extends */
X/* from 0 to 32767 in the x direction, and from 0 to 32767 in the */
X/* downward y direction, with the origin at the upper left of the */
X/* screen. Screen aspect ratio is not taken into account. */
X
X#define conv_x_coord(x) ((int)((long)(x * graphics.x_extent) / NORM_X_RANGE))
X#define conv_y_coord(y) ((int)((long)(y * graphics.y_extent) / NORM_Y_RANGE))
X
X/* Enumerated data type for pixel setting mode. */
Xenum PIX_MODE {OR, XOR};
X
X/* The following structure defines variables used for video support. */
X
Xstruct SVAT_graphics {
X
X CGA_BUF_TYPE *cgamem; /* Pointer to video memory segment. */
X /* Will be used by the write_pixel() */
X /* routine. */
X
X EGA_BUF_TYPE *egamem; /* Pointer to video memory segment. */
X /* Will be used by the write_pixel() */
X /* routine. */
X
X HERC_BUF_TYPE *hercmem; /* Pointer to video memory segment. */
X /* Will be used by the write_pixel() */
X /* routine. */
X
X PR_BUF_TYPE *printbuf1, /* Pointers to printer bit map segment. */
X *printbuf2, /* Will be used by the write_pixel() */
X *printbuf3; /* routine. */
X
X int x_cursor; /* Graphics cursor position in pixel */
X /* units on x axis. */
X int y_cursor; /* Graphics cursor position in pixel */
X /* units on y axis. */
X
X /* Definition of the virtual screen space. This will usually */
X /* be set to (0,0) at the lower left of the screen and */
X /* (32767,32767) at the upper right, regardless of aspect */
X /* ratio of the physical screen. */
X
X int x_extent, /* Width and height of screen in units */
X y_extent; /* of pixels. */
X
X float aspect_ratio; /* Height of screen divided by width. */
X
X /* Variables used for coordinate transformations. */
X
X float xlate_x, /* Translation prior to rotation and */
X xlate_y, /* scaling, perspective, viewports, and */
X xlate_z; /* windows. */
X
X float offset_x, /* Offset from origin of world */
X offset_y, /* coordinates (after translation), */
X offset_z; /* about which we will rotate, scale, */
X /* and do perspective. */
X
X float theta_x, /* Angle of rotation about x axis. */
X /* (z to y right hand rule.) */
X theta_y, /* Angle of rotation about y axis. */
X /* (z to x right hand rule.) */
X theta_z; /* Angle of rotation about x axis. */
X /* (x to y right hand rule.) */
X
X /* Factors used in the 3D to 2D rotation matrix. We want to */
X /* calculate them once, then use them repeatedly. */
X
X float c_tz_c_ty, /* cos(theta_z)*cos(theta_y) */
X s_tz, /* sin(theta_z) */
X s_ty, /* sin(theta_y) */
X c_tz_c_tx, /* cos(theta_z)*cos(theta_x) */
X s_tx; /* sin(theta_x) */
X
X float scale_factor; /* Scaling factor, after rotation, */
X /* before perspective. */
X
X float perspect_dist; /* Perspective viewing distance. */
X
X int x_vport_ll, /* Lower left and upper right x and y */
X y_vport_ll, /* coordinates of the viewport in the */
X x_vport_ur, /* normalized coordinate space. */
X y_vport_ur;
X
X int x_window_ll, /* Lower left and upper right x and y */
X y_window_ll, /* coordinates of the active windo in */
X x_window_ur, /* terms of normalized coordinate */
X y_window_ur; /* space. */
X
X /* Drawing control variables. */
X
X int grafmode; /* Video display mode */
X
X int color; /* Color of line to draw */
X
X int lineweight; /* Line thickness */
X
X long linestyle; /* Line style (e.g. dot-dash) */
X
X enum PIX_MODE wrt_mode; /* Pixel writing mode (OR, XOR) */
X
X struct {
X int xtic; /* Character to character distance */
X int ytic; /* Line to line distance */
X int xsize; /* Vertical character size */
X int ysize; /* Horizontal character size */
X float angle; /* Rotation angle of text line, in */
X /* counterclockwise radians. */
X float slant; /* Char slant angle, in clockwise */
X /* radians. */
X } strokefont;
X
X struct {
X int chars_per_line;
X int lines_per_screen;
X int xtic; /* Character to character distance */
X int ytic; /* Line to line distance */
X int xmult; /* If 2, then make double wide, etc. */
X int ymult; /* If 2, then make double high, etc. */
X } cellfont;
X};
XxX--EOF--XxX
echo restoring pix_color.c
sed 's/^X//' > pix_color.c <<XxX--EOF--XxX
X#ifndef lint
Xstatic char sccsid[] = "@(#) pix_color.c 1.3 88/06/19";
X#endif
X
X/*
X * Copyright (c) David T. Lewis 1988
X * All rights reserved.
X *
X * Permission is granted to use this for any personal noncommercial use.
X * You may not distribute source or executable code for profit, nor
X * may you distribute it with a commercial product without the written
X * consent of the author. Please send modifications to the author for
X * inclusion in updates to the program. Thanks.
X */
X
X/*
X * This routine sets the color to be used for all pixel operations.
X * Color is (unfortunately) nothing more than a 16 bit integer, and
X * may display different results on different graphics adapters.
X * No attempt has been made to correlate colors between CGA, EGA
X * or any other adapter, in part because the author is developing
X * the code on a machine with only monochrome graphics (Everex
X * Edge).
X *
X * The returned value is the previous color setting.
X */
X
X#include "graphics.h"
X
Xextern struct SVAT_graphics graphics;
X
Xint pix_color(color)
Xint color;
X{
X int last_color;
X last_color = graphics.color;
X graphics.color = color;
X if (graphics.grafmode == EGA_COLOR_MODE) {
X /* Write to EGA registers. Not yet implemented. */
X /* Ditto for VGA. */
X }
X return(last_color);
X}
XxX--EOF--XxX
echo restoring pix_mode.c
sed 's/^X//' > pix_mode.c <<XxX--EOF--XxX
X#ifndef lint
Xstatic char sccsid[] = "@(#) pix_mode.c 1.3 88/06/19";
X#endif
X
X/*
X * Copyright (c) David T. Lewis 1988
X * All rights reserved.
X *
X * Permission is granted to use this for any personal noncommercial use.
X * You may not distribute source or executable code for profit, nor
X * may you distribute it with a commercial product without the written
X * consent of the author. Please send modifications to the author for
X * inclusion in updates to the program. Thanks.
X */
X
X/*
X * This routine sets us up to update pixels in either OR mode
X * (set the pixel on, regardless of previous state), or XOR mode
X * (pixel is XORed with its previous value). XOR mode is used for
X * things like graphics cursors which may be placed on the screen
X * without destroying the previous screen contents.
X *
X * The returned value is the previous state of the pixel mode.
X */
X
X#include "graphics.h"
X
Xextern struct SVAT_graphics graphics;
X
Xenum PIX_MODE pix_mode(mode_val)
Xenum PIX_MODE mode_val;
X{
X enum PIX_MODE last_mode;
X last_mode = graphics.wrt_mode;
X switch (mode_val) {
X case OR:
X graphics.wrt_mode = OR;
X break;
X case XOR:
X graphics.wrt_mode = XOR;
X break;
X default:
X graphics.wrt_mode = OR;
X break;
X }
X return(last_mode);
X}
XxX--EOF--XxX
--
Dave Lewis
Ann Arbor, MI
...![ itivax umix ]!m-net!dtlewis!lewis
More information about the Comp.unix.xenix
mailing list