games@tekred.CNA.TEK.COM (02/15/89)
Submitted by: Dave Bodenstab <att!iwsl8!imdave>
Comp.sources.games: Volume 6, Issue 11
Archive-name: ega-wanderer/Part03
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 3 (of 5)."
# Contents: help.c iAPX286.c icons/48x48/timecapsule_bm
# icons/wanderer_bm scores.c
# Wrapped by billr@saab on Tue Feb 14 15:28:01 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'help.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'help.c'\"
else
echo shar: Extracting \"'help.c'\" \(7996 characters\)
sed "s/^X//" >'help.c' <<'END_OF_FILE'
X#include "wand_head.h"
X
Xchar *text1[]={
X/* 0 */ " ** W A N D E R E R **",
X/* 1 */ " ===========================",
X/* 2 */ " by Steven Shipway",
X/* 3 */ "How to play:",
X/* 4 */ " Collect all the treasure: %*",
X/* 5 */ "",
X/* 6 */ " Then go through the exit: %X",
X/* 7 */ "",
X/* 8 */ " %h Left %j Down",
X/* 9 */ " %k Up %l Right",
X/* 10 */ " 1 Loud q Quit game",
X/* 11 */ " 0 Quiet v Look at map",
X/* 12 */ " S Save game R Restore Game",
X/* 13 */ " ? Help mode @ Center screen",
X/* 14 */ " ~ Jump level # Switch mode",
X/* 15 */ " (no bonus) ^L Redraw screen",
XNULL
X},
X
X *text2[]={
X/* 0 */ "This is you: You are a spider.",
X/* 1 */ " %@ (At least, that's",
X/* 2 */ " what you look like)",
X/* 3 */ "",
X/* 4 */ "The other items you will find are:",
X/* 5 */ "",
X/* 6 */ " %# %=",
X/* 7 */ " and Solid rock",
X/* 8 */ " %C",
X/* 9 */ " Time capsule (5 points,",
X/* 10 */ " +250 extra moves)",
X/* 11 */ " %:",
X/* 12 */ " Passable earth (one point)",
X/* 13 */ "",
X/* 14 */ " %T Teleport (50 points for",
X/* 15 */ " using it)",
XNULL
X},
X
X *text3[]={
X/* 0 */ " %O Boulder (falls down, other",
X/* 1 */ " boulders and arrows fall",
X/* 2 */ " off of it)",
X/* 3 */ "",
X/* 4 */ " %< %> Arrows",
X/* 5 */ " and (fly left and right)",
X/* 6 */ "",
X/* 7 */ " %+ Cage - holds baby monsters",
X/* 8 */ " and changes into diamonds",
X/* 9 */ "",
X/* 10 */ " %* (10 points)",
X/* 11 */ " Money (collect it)",
X/* 12 */ "",
X/* 13 */ " %S Baby monster (kills you)",
X/* 14 */ "",
XNULL
X},
X
X *text4[]={
X/* 0 */ "When a baby monster hits a cage it",
X/* 1 */ "is captured and you get 50 points.",
X/* 2 */ "The cage also becomes a diamond.",
X/* 3 */ "",
X/* 4 */ " %! Instant annihilation ",
X/* 5 */ "",
X/* 6 */ "",
X/* 7 */ " %\\ %/ Slopes (boulders",
X/* 8 */ " and and etc. slide off)",
X/* 9 */ "",
X/* 10 */ " %M Monster (eats you up whole.",
X/* 11 */ " Yum Yum yum..) (100 points)",
X/* 12 */ " (kill with a rock or arrow)",
X/* 13 */ "",
X/* 14 */ " %X Exit -- Must Collect all the",
X/* 15 */ " treasure first. (250 bonus)",
XNULL
X},
X
X *text5[]={
X/* 0 */ " %^ Balloons rise and are popped",
X/* 1 */ " by arrows. It does not kill",
X/* 2 */ " you.",
X/* 3 */ "",
X/* 4 */ "",
X/* 5 */ " %? Unrecognised symbol in map.",
X/* 6 */ " This is probably a **bug** !",
X/* 7 */ "",
X/* 8 */ " Environment variables:",
X/* 9 */ "",
X/* 10 */ " NEWNAME,NAME : Checked in that",
X/* 11 */ " order for the hiscore table",
X/* 12 */ " NEWKEYS : Redefine movement keys",
X/* 13 */ " (default \"hlkj\")",
X/* 14 */ " SAVENAME : File used for saved",
X/* 15 */ " games.",
XNULL
X};
X
Xchar **texthelp[] ={ text1, text2, text3, text4, text5, NULL };
X
X#ifdef EGA
X#include "bitmap.h"
X
Xextern bitmap *b48x48[];
Xextern char *EGAaddr;
X
Xchar author1[] =" ** W A N D E R E R **";
Xchar author2[] =" by Steven Shipway";
X
Xchar *ega1[] ={
Xauthor1,
Xauthor2,
X"",
X"",
X"Environment variables:",
X"",
X" NEWNAME,NAME,FULLNAME,USER,LOGNAME : Checked in that order for your name",
X"",
X" NEWKEYS : Redefine movement keys (default \"hlkj\")",
X"",
X" SAVENAME : File used for saved games",
X"",
X"",
X"",
X"How to play:",
X" %* %X",
X"",
X" Collect all the treasure: then go through the exit:",
X"",
X"",
X"",
X"",
X"",
X" Keys are: %h Left %j Down",
X" %k Up %l Right",
X" 1 Loud q Quit game",
X" 0 Quiet v Look at map",
X" S Save game R Restore game",
X" ? Help @ Center screen",
X" ~ Jump level (lose # Switch mode",
X" bonus) ^L Redraw screen",
XNULL
X},
X
X *ega2[]={
Xauthor1,
Xauthor2,
X"",
X"Screen Items:",
X" %@",
X"",
X" This is You:",
X"",
X"",
X"",
X"",
X" The other items you will find are:",
X"",
X" %# %= %: %!",
X"",
X"",
X"",
X"",
X"",
X" Solid rock Passable earth Land mine",
X" (1 point)",
X"",
X"",
X" %* %X %C",
X"",
X"",
X"",
X"",
X"",
X" Money - 10 points Exit - 250 points Time capsule - 5 points",
X" (collect all the (250 extra moves)",
X" treasures first)",
XNULL
X},
X
X *ega3[]={
Xauthor1,
Xauthor2,
X"",
X" %O %^",
X" Boulders (fall down, Balloons (rise up)",
X" other boulders fall off,",
X" arrows slide off)",
X"",
X"",
X" %< %> %\\ %/",
X" Arrows (fly left Slopes (boulders,",
X" and right, will balloons and arrows",
X" pop balloons) slide off)",
X"",
X"",
X"",
X" %M %S",
X"",
X"",
X"",
X"",
X"",
X" Monster - 100 points Baby monster - 50 points",
X" (eats you up whole) (kills you)",
X"",
X" Kill with a rock or arrow When baby monster hits a cage, it",
X" is trapped and turns into a diamond",
X"",
X" %T %+",
X" Teleport Cage",
X" 50 points for",
X" using it",
XNULL
X};
X
Xchar **egahelp[] ={ ega1, ega2, ega3, NULL };
X#endif
X
X/* remember locations of graphics symbols */
Xstruct graphics
X {
X int x, y, c;
X }
X coordinates[10], *nextcoordinate;
X
Xstatic char *blank = " ";
X
Xstatic
Xchar *
Xexpand( y, line, keys )
Xchar *line;
Xchar *keys;
X{
X static char expansion[100];
X char *p;
X int c;
X
X for( p = expansion; c = *line++; )
X {
X if ( c == '%' )
X {
X if ( (c = *line++) != '%' )
X switch( c )
X {
X case 'h': c = keys[2]; break;
X case 'j': c = keys[1]; break;
X case 'k': c = keys[0]; break;
X case 'l': c = keys[3]; break;
X default:
X nextcoordinate->y = y;
X nextcoordinate->x = p - expansion;
X nextcoordinate++->c = c;
X c = ' ';
X break;
X }
X }
X
X *p++ = c;
X }
X
X *p = '\0';
X
X return( expansion );
X}
X
Xstatic
Xint
Xdopage( page, keys )
Xchar **page;
Xchar *keys;
X{
X struct graphics *p;
X char *line;
X int y;
X
X nextcoordinate = coordinates;
X
X#ifdef EGA
X if (EGAaddr)
X clear();
X#endif
X for( y = 0; line = *page++; ++y )
X {
X line = expand( y, line, keys );
X#ifdef EGA
X if ( EGAaddr )
X egaputs( 0, 10*y, line );
X else
X#endif
X mvprintw(y,0,"%-*s",ROWLEN+2,line);
X }
X
X if ( nextcoordinate > coordinates )
X for( p = coordinates; p < nextcoordinate; ++p )
X#ifdef EGA
X if ( EGAaddr )
X egapaint( 8*p->x, 10*p->y, b48x48[symbol(p->c)] );
X else
X#endif
X draw_symbol( p->x-1, p->y-1, p->c );
X
X#ifdef EGA
X if ( EGAaddr )
X egaputs( 4+8*(80-44)/2, 341, "Press <return> to continue, <space> to exit." );
X else
X#endif
X {
X while( y < 16 )
X mvaddstr(y++,0,blank);
X
X mvaddstr(16,0,blank);
X mvaddstr(16+1,0,"<return> to continue, <space> to exit ");
X }
X
X refresh();
X
X return( getch() );
X}
X
Xvoid
Xhelpme(keys) /* routine to show help menu. */
Xchar *keys;
X{
X char ***pages, **page;
X
X#ifdef EGA
X if ( EGAaddr )
X pages = egahelp;
X else
X#endif
X pages = texthelp;
X
X while( page = *pages++ )
X if( dopage(page,keys) == ' ' )
X break;
X
X#ifdef EGA
X if ( ! EGAaddr )
X#endif
X {
X mvaddstr(16,0,blank);
X mvaddstr(16+1,0,blank);
X }
X}
END_OF_FILE
if test 7996 -ne `wc -c <'help.c'`; then
echo shar: \"'help.c'\" unpacked with wrong size!
fi
# end of 'help.c'
fi
if test -f 'iAPX286.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'iAPX286.c'\"
else
echo shar: Extracting \"'iAPX286.c'\" \(17736 characters\)
sed "s/^X//" >'iAPX286.c' <<'END_OF_FILE'
X#include <curses.h>
X#include <sys/types.h>
X#include <sys/ipc.h>
X#include <sys/shm.h>
X#include "bitmap.h"
X
Xtypedef unsigned char uchar;
X
Xuchar *EGAaddr;
X
X#define POINT(x,y) &EGAaddr[((((y)<<2)+(y))<<4)+((x)>>3)]
X
X#define VIDKEY 0xa0000
X#define VIDLEN 65535
X#define VIDFD 1
X
X
X/*
X * If stdout is one of the console devices (/dev/cons*), then we can
X * use the EGA. Attach to the EGA shared memory segment.
X */
Xegainit()
X{
X int shmid;
X uchar *shmat();
X char *tty, *ttyname();
X
X if ( (tty = ttyname(VIDFD)) == NULL || strncmp(tty,"/dev/cons",9) != 0 )
X /*
X * stdout is not the console
X */
X return( 0 );
X
X if ( (shmid = shmget((key_t)VIDKEY,(int)VIDLEN,0)) != -1 ) {
X /*
X * segment exists (hopefully attached to the EGA)
X */
X if ( (int)(EGAaddr = shmat(shmid,NULL,0)) != -1 ) {
X write( VIDFD, "\033[=16h", 6 );
X Clear();
X return( 1 );
X }
X }
X
X EGAaddr = NULL;
X
X return( 0 );
X}
X
Xegaclear(x1,y1, x2,y2)
X{
X uchar *sp, *p;
X int j, n, width, fetch;
X unsigned mask, o, old, bits;
X
X width = x2 - x1 + 1;
X
X if ( o = (x1 & 0x07) )
X if ( width + o <= 8 )
X /*
X * within a single byte
X */
X {
X mask = ~(((0xff00 >> width) & 0xff) >> o);
X
X for( sp = POINT(x1,y1); y1++ <= y2; sp += 640/8 )
X *sp &= mask;
X }
X else
X /*
X * extends beyond a byte boundry
X */
X for( sp = POINT(x1,y1); y1++ <= y2; sp += 640/8 )
X {
X for( old = *(p=sp) & (0xff00 >> o), j = 0; j < (width+8-o)/8; old = 0, ++j, fetch = *p )
X *p++ = old;
X
X if ( (bits = ((width + o) % 8)) != 0 )
X *p &= ~(0xff00 >> bits);
X }
X else
X for( sp = POINT(x1,y1); y1++ <= y2; sp += 640/8 )
X {
X if ( (n = width/8) > 0 )
X for( p = sp; n-- > 0; )
X *p++ &= 0;
X
X if ( (o = width%8) != 0 )
X sp[n] &= (0xff >> o);
X }
X}
X
Xegareset()
X{
X if ( EGAaddr ) {
X Clear();
X
X write( VIDFD, "\033[=h", 4 );
X
X /* Detach from shared memory segment */
X if (shmdt(EGAaddr) == -1)
X perror("shmdt");
X }
X}
X
X
X/*
X * Draw a line from (x0,y0) to (x1,y1), where the 4 arguments are
X * in device coordinates and the 4 arguments must each be a short
X * (since the arithmetic is done using shorts, for speed).
X */
X
X#define PLOT(x,y) { \
X uchar *p = POINT(x,y); \
X *p |= mask[x]; \
X }
X#define ABS(x) ((x) < 0 ? (-(x)) : (x))
X#define SWAP(s1, s2) { int tmp; tmp = s1; s1 = s2; s2 = tmp; }
X
Xstatic uchar mask[640] ={ /* x-pixels in range [0,639] */
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
X };
X
Xegaline(x0, y0, x1, y1)
Xshort x0, y0, x1, y1; /* all in device coordinates */
X{
X register short d, x, y, incr1, incr2, xend;
X short dx, dy, rotate;
X
X /*
X * Now starts Bresenham's algorithm. See Foley and Van Dam,
X * pages 433-436 for some of the details.
X * The variable names below are the same as in the text.
X *
X * Optimized to use short integer arithmetic, and further optimized
X * by taking some of the logic tests out of the main loop (making
X * 4 copies of the main loop, one for each case - space versus
X * time tradeoff).
X */
X
X dy = y1 - y0;
X dx = x1 - x0;
X
X /*
X * The octants are numbered 1 through 8, counterclockwise,
X * starting with octant 1 being east-northeast.
X * If we are in octants 2, 3, 6, or 7, then rotate the line
X * about the line x=y. This maps octant 2 into 1,
X * octant 3 into 8, octant 6 into 5 and octant 7 into 4.
X * We must remember this rotation for later, as we will
X * re-rotate the points when we plot them.
X */
X
X if (ABS(dx) >= ABS(dy))
X rotate = 0;
X else {
X rotate = 1;
X SWAP(x0, y0);
X SWAP(x1, y1);
X SWAP(dx, dy);
X }
X
X if (dx < 0) {
X /*
X * We're in octants 4 or 5.
X * Swap the starting and ending points, mapping
X * octant 4 to 8, and octant 5 to 1.
X * This will generate the points in reverse order
X * for octants 3 and 5 (i.e., we'll go from the end
X * to the beginning), but who cares?
X */
X
X SWAP(x0, x1); /* swap start and end points */
X SWAP(y0, y1);
X dx = -dx; /* dx becomes positive */
X dy = -dy; /* dy can be positive or negative */
X }
X
X /*
X * At this point we're guaranteed that dx >= 0, and x0 < x1.
X */
X
X if (dy < 0) {
X /*
X * Octants 3, 4, 7 or 8.
X * x will be: x1, x1-1, x1-2, ..., x0.
X */
X
X xend = x0;
X y = y1;
X
X incr1 = 2 * (-dy); /* remember that dy < 0 */
X d = incr1 - dx; /* 2*dy - dx */
X incr2 = d - dx; /* 2*dy - 2*dx = 2*(dy - dx) */
X
X if (rotate) { /* main loop, octants 3 or 7 */
X
X for (x = x1; x >= xend; x--) {
X PLOT(y, x);
X
X if (d > 0) {
X y++;
X d += incr2;
X } else
X d += incr1;
X }
X
X } else { /* main loop, octants 4 or 8 */
X
X for (x = x1; x >= xend; x--) {
X PLOT(x, y);
X
X if (d > 0) {
X y++;
X d += incr2;
X } else
X d += incr1;
X }
X }
X
X } else {
X /*
X * Octants 1, 2, 5 or 6.
X * x will be: x0, x0+1, x0+2, ..., x1.
X */
X
X xend = x1;
X y = y0;
X
X incr1 = 2 * dy;
X d = incr1 - dx; /* 2*dy - dx */
X incr2 = d - dx; /* 2*dy - 2*dx = 2*(dy - dx) */
X
X if (rotate) { /* main loop, octants 2 or 6 */
X
X for (x = x0; x <= xend; x++) {
X PLOT(y, x);
X
X if (d > 0) {
X y++;
X d += incr2;
X } else
X d += incr1;
X }
X } else { /* main loop, octants 1 or 5 */
X
X for (x = x0; x <= xend; x++) {
X PLOT(x, y);
X
X if (d > 0) {
X y++;
X d += incr2;
X } else
X d += incr1;
X }
X }
X }
X}
X
Xstruct { /* 8 x 8 */
X uchar letter[8];
X }
X font[ 0x80 - ' ' ] ={
X /* sp */{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
X /* ! */ { 0x30,0x78,0x78,0x30,0x30,0x00,0x30,0x00 },
X /* " */ { 0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00 },
X /* # */ { 0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00 },
X /* $ */ { 0x30,0x7C,0xC0,0x78,0x0C,0xF8,0x30,0x00 },
X /* % */ { 0x00,0xC6,0xCC,0x18,0x30,0x66,0xC6,0x00 },
X /* & */ { 0x38,0x6C,0x38,0x76,0xDC,0xCC,0x76,0x00 },
X /* ' */ { 0x60,0x60,0xC0,0x00,0x00,0x00,0x00,0x00 },
X /* ( */ { 0x18,0x30,0x60,0x60,0x60,0x30,0x18,0x00 },
X /* ) */ { 0x60,0x30,0x18,0x18,0x18,0x30,0x60,0x00 },
X /* * */ { 0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00 },
X /* + */ { 0x00,0x30,0x30,0xFC,0x30,0x30,0x00,0x00 },
X /* , */ { 0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60 },
X /* - */ { 0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00 },
X /* . */ { 0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00 },
X /* / */ { 0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00 },
X /* 0 */ { 0x7C,0xC6,0xCE,0xDE,0xF6,0xE6,0x7C,0x00 },
X /* 1 */ { 0x30,0x70,0x30,0x30,0x30,0x30,0xFC,0x00 },
X /* 2 */ { 0x78,0xCC,0x0C,0x38,0x60,0xCC,0xFC,0x00 },
X /* 3 */ { 0x78,0xCC,0x0C,0x38,0x0C,0xCC,0x78,0x00 },
X /* 4 */ { 0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x1E,0x00 },
X /* 5 */ { 0xFC,0xC0,0xF8,0x0C,0x0C,0xCC,0x78,0x00 },
X /* 6 */ { 0x38,0x60,0xC0,0xF8,0xCC,0xCC,0x78,0x00 },
X /* 7 */ { 0xFC,0xCC,0x0C,0x18,0x30,0x30,0x30,0x00 },
X /* 8 */ { 0x78,0xCC,0xCC,0x78,0xCC,0xCC,0x78,0x00 },
X /* 9 */ { 0x78,0xCC,0xCC,0x7C,0x0C,0x18,0x70,0x00 },
X /* : */ { 0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00 },
X /* ; */ { 0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x60 },
X /* < */ { 0x18,0x30,0x60,0xC0,0x60,0x30,0x18,0x00 },
X /* = */ { 0x00,0x00,0xFC,0x00,0x00,0xFC,0x00,0x00 },
X /* > */ { 0x60,0x30,0x18,0x0C,0x18,0x30,0x60,0x00 },
X /* ? */ { 0x78,0xCC,0x0C,0x18,0x30,0x00,0x30,0x00 },
X /* @ */ { 0x7C,0xC6,0xDE,0xDE,0xDE,0xC0,0x78,0x00 },
X /* A */ { 0x30,0x78,0xCC,0xCC,0xFC,0xCC,0xCC,0x00 },
X /* B */ { 0xFC,0x66,0x66,0x7C,0x66,0x66,0xFC,0x00 },
X /* C */ { 0x3C,0x66,0xC0,0xC0,0xC0,0x66,0x3C,0x00 },
X /* D */ { 0xF8,0x6C,0x66,0x66,0x66,0x6C,0xF8,0x00 },
X /* E */ { 0xFE,0x62,0x68,0x78,0x68,0x62,0xFE,0x00 },
X /* F */ { 0xFE,0x62,0x68,0x78,0x68,0x60,0xF0,0x00 },
X /* G */ { 0x3C,0x66,0xC0,0xC0,0xCE,0x66,0x3E,0x00 },
X /* H */ { 0xCC,0xCC,0xCC,0xFC,0xCC,0xCC,0xCC,0x00 },
X /* I */ { 0x78,0x30,0x30,0x30,0x30,0x30,0x78,0x00 },
X /* J */ { 0x1E,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00 },
X /* K */ { 0xE6,0x66,0x6C,0x78,0x6C,0x66,0xE6,0x00 },
X /* L */ { 0xF0,0x60,0x60,0x60,0x62,0x66,0xFE,0x00 },
X /* M */ { 0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0x00 },
X /* N */ { 0xC6,0xE6,0xF6,0xDE,0xCE,0xC6,0xC6,0x00 },
X /* O */ { 0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x38,0x00 },
X /* P */ { 0xFC,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00 },
X /* Q */ { 0x78,0xCC,0xCC,0xCC,0xDC,0x78,0x1C,0x00 },
X /* R */ { 0xFC,0x66,0x66,0x7C,0x6C,0x66,0xE6,0x00 },
X /* S */ { 0x78,0xCC,0xE0,0x70,0x1C,0xCC,0x78,0x00 },
X /* T */ { 0xFC,0xB4,0x30,0x30,0x30,0x30,0x78,0x00 },
X /* U */ { 0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFC,0x00 },
X /* V */ { 0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x30,0x00 },
X /* W */ { 0xC6,0xC6,0xC6,0xD6,0xFE,0xEE,0xC6,0x00 },
X /* X */ { 0xC6,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x00 },
X /* Y */ { 0xCC,0xCC,0xCC,0x78,0x30,0x30,0x78,0x00 },
X /* Z */ { 0xFE,0xC6,0x8C,0x18,0x32,0x66,0xFE,0x00 },
X /* [ */ { 0x78,0x60,0x60,0x60,0x60,0x60,0x78,0x00 },
X /* \ */ { 0xC0,0x60,0x30,0x18,0x0C,0x06,0x02,0x00 },
X /* ] */ { 0x78,0x18,0x18,0x18,0x18,0x18,0x78,0x00 },
X /* ^ */ { 0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00 },
X /* _ */ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF },
X /* ` */ { 0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00 },
X /* a */ { 0x00,0x00,0x78,0x0C,0x7C,0xCC,0x76,0x00 },
X /* b */ { 0xE0,0x60,0x60,0x7C,0x66,0x66,0xDC,0x00 },
X /* c */ { 0x00,0x00,0x78,0xCC,0xC0,0xCC,0x78,0x00 },
X /* d */ { 0x1C,0x0C,0x0C,0x7C,0xCC,0xCC,0x76,0x00 },
X /* e */ { 0x00,0x00,0x78,0xCC,0xFC,0xC0,0x78,0x00 },
X /* f */ { 0x38,0x6C,0x60,0xF0,0x60,0x60,0xF0,0x00 },
X /* g */ { 0x00,0x00,0x76,0xCC,0xCC,0x7C,0x0C,0xF8 },
X /* h */ { 0xE0,0x60,0x6C,0x76,0x66,0x66,0xE6,0x00 },
X /* i */ { 0x30,0x00,0x70,0x30,0x30,0x30,0x78,0x00 },
X /* j */ { 0x0C,0x00,0x0C,0x0C,0x0C,0xCC,0xCC,0x78 },
X /* k */ { 0xE0,0x60,0x66,0x6C,0x78,0x6C,0xE6,0x00 },
X /* l */ { 0x70,0x30,0x30,0x30,0x30,0x30,0x78,0x00 },
X /* m */ { 0x00,0x00,0xCC,0xFE,0xFE,0xD6,0xC6,0x00 },
X /* n */ { 0x00,0x00,0xF8,0xCC,0xCC,0xCC,0xCC,0x00 },
X /* o */ { 0x00,0x00,0x78,0xCC,0xCC,0xCC,0x78,0x00 },
X /* p */ { 0x00,0x00,0xDC,0x66,0x66,0x7C,0x60,0xF0 },
X /* q */ { 0x00,0x00,0x76,0xCC,0xCC,0x7C,0x0C,0x1E },
X /* r */ { 0x00,0x00,0xDC,0x76,0x66,0x60,0xF0,0x00 },
X /* s */ { 0x00,0x00,0x7C,0xC0,0x78,0x0C,0xF8,0x00 },
X /* t */ { 0x10,0x30,0x7C,0x30,0x30,0x34,0x18,0x00 },
X /* u */ { 0x00,0x00,0xCC,0xCC,0xCC,0xCC,0x76,0x00 },
X /* v */ { 0x00,0x00,0xCC,0xCC,0xCC,0x78,0x30,0x00 },
X /* w */ { 0x00,0x00,0xC6,0xD6,0xFE,0xFE,0x6C,0x00 },
X /* x */ { 0x00,0x00,0xC6,0x6C,0x38,0x6C,0xC6,0x00 },
X /* y */ { 0x00,0x00,0xCC,0xCC,0xCC,0x7C,0x0C,0xF8 },
X /* z */ { 0x00,0x00,0xFC,0x98,0x30,0x64,0xFC,0x00 },
X /* { */ { 0x1C,0x30,0x30,0xE0,0x30,0x30,0x1C,0x00 },
X /* | */ { 0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x00 },
X /* } */ { 0xE0,0x30,0x30,0x1C,0x30,0x30,0xE0,0x00 },
X /* ~ */ { 0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00 },
X /*del*/ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
X };
X
X/*
X * Handle writing text messages to the display.
X *
X * Things are more complicated than they should be, since we must
X * plot the actual bit maps of each character.
X */
Xegaprintf( x, y, fmt )
Xchar *fmt;
X{
X char buffer[128];
X
X vsprintf( buffer, fmt, &fmt+1 );
X egaputs( x, y, buffer );
X}
X
X
Xegaputs(x,y,str)
Xchar *str;
X{
X unsigned c;
X
X for ( ; c = *str++; x += 8 )
X egaputc(x,y,c);
X}
X
X
Xegaputc(x,y,c)
Xunsigned c;
X{
X unsigned mod, line, fetch;
X uchar *fp, *Sp;
X
X Sp = POINT( x, y );
X
X fp = font[(c & 0x7f) - ' '].letter;
X
X /*
X * Now comes the fun. We must take the actual bit map of
X * the character and turn on the appropriate bits in the screen.
X */
X if ( mod = x & 0x07 ) {
X for( line = 0; line < 8*80; line += 80 ) {
X Sp[line] = (Sp[line] & (0xff00 >> mod)) | ((c = *fp++) >> mod);
X Sp[line+1] = (c << (8 - mod)) | (Sp[line+1] & (0xff >> mod));
X }
X }
X else {
X for( line = 0; line < 8*80; line += 80 ) {
X fetch = Sp[line];
X Sp[line] = *fp++;
X }
X }
X}
X
X
X/*
X * graphic version of gets
X */
X
XBM(8,8) cursor ={ 8, 8, 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00 };
X
Xegagets( x, y, buffer )
Xchar *buffer;
X{
X unsigned c;
X int nx = x;
X
X while( egapaint(nx,y,&cursor), (c = Getch()) != '\n' && c != '\r' )
X switch( c ) {
X default:
X if ( c >= ' ' && c < 127 ) {
X egaputc( nx, y, *buffer++ = c );
X nx += 8;
X }
X else
X Beep();
X break;
X case '\b':
X if ( nx > x ) {
X egaputc( nx, y, ' ' );
X --buffer;
X nx -= 8;
X }
X break;
X }
X
X egaputc( nx, y, ' ' );
X *buffer = 0;
X}
X
X
X/*
X * Copy a bitmap to the screen
X */
Xegapaint( x, y, map )
Xbitmap *map;
X{
X uchar *sp, *p, *q, fetch;
X int i, j, n, width;
X unsigned mask, o, old, bits;
X
X width = (map->width + 7) / 8;
X
X if ( o = (x & 0x07) )
X if ( map->width + o < 8 )
X /*
X * within a single byte
X */
X {
X mask = ((0xff00 >> map->width) & 0xff) >> o;
X
X for( i = 0, sp = POINT(x,y); i < map->height; ++i, sp += 640/8 )
X *sp = (*sp & ~mask) | ((map->bits[i*width] >> o) & mask);
X }
X else
X /*
X * extends upto or beyond a byte boundry
X */
X for( i = 0, sp = POINT(x,y); i < map->height; ++i, sp += 640/8 )
X {
X for( old = *(p=sp) & (0xff00 >> o), j = 0; j < (map->width+8-o)/8; ++j, fetch = *p )
X {
X *p++ = old | ((bits=map->bits[i*width+j]) >> o);
X old = bits << (8 - o);
X }
X
X if ( (bits = ((map->width + o) % 8)) != 0 )
X {
X mask = 0xff00 >> bits;
X
X *p = (old & mask) | (*p & ~mask);
X }
X }
X else
X for( i = 0, sp = POINT(x,y); i < map->height; ++i, sp += 640/8 )
X {
X if ( (n = map->width/8) > 0 )
X for( p = sp, q = &map->bits[i*width]; n-- > 0; )
X {
X fetch = *p;
X *p++ = *q++;
X }
X
X if ( (o = map->width%8) != 0 )
X {
X p = sp + n;
X
X *p = (*p & (0xff >> o)) | (map->bits[i*width+n] & ~(0xff >> o));
X }
X }
X}
X
X
X/*
X * Getch()
X */
XGetch()
X{
Xchar c = 0;
X
Xif(EGAaddr) {
X while( c == 0 )
X read(0, &c, 1);
X
X if(c == '\r')
X c = '\n';
X
X return( c );
X }
Xelse
X return( wgetch(stdscr) );
X}
X
X/*
X * Clear()
X */
XClear()
X{
Xif(EGAaddr)
X egaclear(0,0, 639,349);
Xelse
X wclear(stdscr);
X}
X
X/*
X * Move(y,x)
X */
XMove(y,x)
X{
Xif(!EGAaddr)
X wmove(stdscr, y, x);
X}
X
X/*
X * Refresh()
X */
XRefresh()
X{
Xif(!EGAaddr)
X wrefresh(stdscr);
X}
X
X/*
X * Beep()
X */
X
X#undef beep
X
XBeep()
X{
Xif(EGAaddr)
X write(VIDFD,"\007",1);
Xelse
X beep();
X}
END_OF_FILE
if test 17736 -ne `wc -c <'iAPX286.c'`; then
echo shar: \"'iAPX286.c'\" unpacked with wrong size!
fi
# end of 'iAPX286.c'
fi
if test -f 'icons/48x48/timecapsule_bm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'icons/48x48/timecapsule_bm'\"
else
echo shar: Extracting \"'icons/48x48/timecapsule_bm'\" \(1905 characters\)
sed "s/^X//" >'icons/48x48/timecapsule_bm' <<'END_OF_FILE'
X#define timecapsule_bm_width 48
X#define timecapsule_bm_height 48
Xstatic char timecapsule_bm_bits[] = {
X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x7a, 0x00, 0x00,
X 0x00, 0xc0, 0x55, 0xd5, 0x01, 0x00, 0x00, 0xe0, 0xaa, 0xaa, 0x03, 0x00,
X 0x00, 0x70, 0xfd, 0x5f, 0x07, 0x00, 0x00, 0xb8, 0x8e, 0xb8, 0x0e, 0x00,
X 0x00, 0x5c, 0x83, 0x60, 0x1d, 0x00, 0x00, 0xae, 0x01, 0xc0, 0x3a, 0x00,
X 0x00, 0xd6, 0x00, 0x80, 0x35, 0x00, 0x00, 0x6b, 0x06, 0x06, 0x6b, 0x00,
X 0x00, 0x37, 0x04, 0x02, 0x76, 0x00, 0x00, 0x3b, 0x08, 0x22, 0x6e, 0x00,
X 0x80, 0x1d, 0x10, 0x71, 0xdc, 0x00, 0x80, 0x1b, 0x22, 0xa9, 0xec, 0x00,
X 0x80, 0x1d, 0xc2, 0x21, 0xdc, 0x00, 0x80, 0x7b, 0xc2, 0x21, 0xef, 0x00,
X 0x80, 0x1d, 0x82, 0x20, 0xdc, 0x00, 0x80, 0x1b, 0x04, 0x10, 0xec, 0x00,
X 0x80, 0x1d, 0x24, 0x10, 0xdc, 0x00, 0x00, 0x3b, 0x28, 0x08, 0x6e, 0x00,
X 0x00, 0x37, 0x30, 0x04, 0x76, 0x00, 0x00, 0x6b, 0x3c, 0x00, 0x6b, 0x00,
X 0x00, 0xd6, 0x00, 0x80, 0x35, 0x00, 0x00, 0xae, 0x01, 0xc0, 0x3a, 0x00,
X 0x00, 0x5c, 0x83, 0x60, 0x1d, 0x00, 0x00, 0xb8, 0x8e, 0xb8, 0x0e, 0x00,
X 0x00, 0x78, 0xfd, 0x5f, 0x0f, 0x00, 0x00, 0xf8, 0xaa, 0xaa, 0x0f, 0x00,
X 0x00, 0xf8, 0x55, 0xd5, 0x0f, 0x00, 0x00, 0xf8, 0xaf, 0xfa, 0x0f, 0x00,
X 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00,
X 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00,
X 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00,
X 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00,
X 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00,
X 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00,
X 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00,
X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
END_OF_FILE
if test 1905 -ne `wc -c <'icons/48x48/timecapsule_bm'`; then
echo shar: \"'icons/48x48/timecapsule_bm'\" unpacked with wrong size!
fi
# end of 'icons/48x48/timecapsule_bm'
fi
if test -f 'icons/wanderer_bm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'icons/wanderer_bm'\"
else
echo shar: Extracting \"'icons/wanderer_bm'\" \(18055 characters\)
sed "s/^X//" >'icons/wanderer_bm' <<'END_OF_FILE'
X#define wanderer_bm_width 174
X#define wanderer_bm_height 159
Xstatic char wanderer_bm_bits[] = {
X 0x00,0x00,0x00,0x00,0xfc,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x1f,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0xf0,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0x00,0x00,0x00,
X 0x00,0x00,0x00,0xfc,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0xfe,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0xff,0x7f,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x03,0x00,0x00,0x00,
X 0x00,0xc0,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
X 0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x01,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,
X 0xf0,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,
X 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0xfc,
X 0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,
X 0xff,0x3f,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xff,0xff,
X 0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
X 0x7f,0x00,0x00,0x00,0x80,0x7f,0xf0,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x80,0x07,0xc0,0xff,
X 0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,
X 0x00,0x00,0x00,0xc0,0x7f,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0xf8,0xff,0x83,0xff,0xff,0x00,0x00,0x00,0xc0,0xff,0x07,0xfe,0xff,
X 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x3f,0x00,0xfc,0xff,0x00,
X 0x00,0x00,0xc0,0xff,0x1f,0xfe,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0xf8,0x0f,0x00,0xff,0xff,0x00,0x00,0x00,0xc0,0xff,0x3f,0xfe,0xff,0x01,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x07,0xf8,0xff,0xff,0x00,0x00,
X 0x00,0xc0,0x3f,0x3e,0xfe,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0xf0,0x07,0xfe,0xff,0xff,0x00,0x00,0x00,0xc0,0x0f,0x38,0xfe,0xff,0x03,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x87,0xff,0xff,0xff,0x00,0x00,0x00,
X 0xc0,0x07,0x38,0xfe,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
X 0xc7,0xc7,0xff,0x7f,0x00,0x00,0x00,0xc0,0x07,0x38,0xfe,0xff,0x03,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xc7,0x01,0xff,0x7f,0x00,0x00,0x00,0xc0,
X 0x0f,0x38,0xfe,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xc7,
X 0x00,0xfe,0x3f,0x00,0x00,0x00,0xc0,0x3f,0x3e,0xfe,0xff,0x03,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0xc0,0xe7,0x00,0xfe,0x3f,0x00,0x00,0x00,0x80,0xff,
X 0x3f,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x80,0xf7,0x01,
X 0xff,0x1f,0x00,0x00,0x00,0x80,0xff,0xbf,0xff,0xff,0x03,0x00,0x00,0x00,0x00,
X 0x7e,0x00,0x00,0x00,0x00,0xff,0xc7,0xff,0x1f,0x00,0x00,0x00,0x00,0xff,0xff,
X 0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
X 0x0f,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x0e,0xfc,
X 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
X 0xff,0x01,0x00,0x00,0x00,0x1f,0xf8,0x01,0x60,0x00,0x00,0xf8,0xff,0xff,0x07,
X 0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x3f,0xf0,0x03,
X 0xf8,0x01,0x00,0xf0,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0x7f,
X 0x00,0x00,0x00,0x00,0x7e,0xf0,0x07,0xfc,0x00,0x00,0xc0,0xff,0xff,0x01,0x00,
X 0x00,0x00,0x00,0xe0,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0xfc,0xe0,0x0f,0x7e,
X 0x80,0x03,0x00,0xfe,0xff,0x01,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x07,0x00,
X 0x00,0x00,0x00,0xf8,0xc1,0x1f,0x3f,0xe0,0x07,0x00,0xf0,0xff,0x00,0x00,0x00,
X 0x00,0x00,0x80,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0xf0,0x83,0x3f,0x3f,0xf0,
X 0x03,0x00,0x80,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x7f,0x00,0x00,0x00,
X 0x00,0x00,0xe0,0x07,0x3f,0x3f,0xf8,0x01,0x00,0x00,0xff,0x01,0x00,0x00,0x00,
X 0x00,0x00,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xc0,0x0f,0x3f,0x3f,0xfc,0x80,
X 0x03,0x00,0xfc,0x01,0x00,0x00,0x00,0x00,0x00,0xff,0x07,0x00,0x00,0x00,0xc0,
X 0x03,0x80,0x1f,0x3f,0x3f,0x7e,0xe0,0x07,0x00,0xfc,0x01,0x00,0x00,0x00,0x00,
X 0x00,0xff,0x01,0x00,0x00,0x00,0xe0,0x0f,0x00,0x3f,0x3f,0x3f,0x7e,0xf0,0x03,
X 0x00,0xfc,0x03,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0xe0,0x3f,
X 0x00,0x3f,0x3f,0x3f,0x7e,0xf8,0x01,0x00,0xf8,0x03,0x00,0x00,0x00,0x00,0x00,
X 0xff,0x00,0x00,0x00,0x00,0x80,0x7f,0x00,0xbe,0x3f,0x3f,0x7e,0xfc,0x00,0x00,
X 0xf8,0x03,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0xfc,0x01,
X 0xfe,0x3f,0x3f,0x7e,0xfc,0x00,0x00,0xf0,0x07,0x00,0x00,0x00,0x00,0x00,0xff,
X 0x00,0x00,0x00,0x00,0x00,0xf0,0x03,0xfc,0x1f,0x3f,0x7e,0xfc,0x00,0x00,0xf0,
X 0x07,0x00,0x00,0xe0,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0xe0,0x07,0xfc,
X 0x0f,0x3f,0x7e,0xfc,0x00,0x00,0xf0,0x0f,0x00,0x80,0xff,0xff,0x0f,0xff,0x00,
X 0x00,0x00,0x00,0x00,0xc0,0x0f,0xfc,0x07,0x3f,0x7e,0xfc,0x00,0x00,0xe0,0x0f,
X 0x00,0xfc,0xff,0xff,0x3f,0xff,0x00,0x00,0x00,0x00,0x00,0x80,0x1f,0xfe,0x07,
X 0x3f,0x7f,0x7e,0x00,0x00,0xe0,0x1f,0xe0,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
X 0x00,0x00,0xe0,0x00,0xff,0xff,0x03,0x3f,0x7f,0x7e,0x00,0x00,0xe0,0x3f,0xfe,
X 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0xf0,0x01,0xfe,0xff,0x03,0x3f,
X 0x7f,0x7e,0x00,0x00,0xc0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
X 0x00,0xf8,0x01,0xfe,0xff,0x01,0x7f,0xff,0x7e,0x80,0x03,0xc0,0xff,0xff,0xff,
X 0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xf8,0x01,0xfe,0xff,0x01,0x7f,0xff,
X 0x7e,0xc0,0x03,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,
X 0xf8,0x01,0xfe,0xff,0x00,0x7f,0xff,0x7e,0xe0,0x07,0x80,0xff,0xff,0xff,0xff,
X 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0xfc,0x00,0xfe,0xff,0x00,0xff,0xff,0x3f,
X 0xf0,0x07,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xfc,
X 0x01,0xff,0xff,0x00,0xff,0xff,0x3f,0xf8,0x03,0x00,0xff,0xff,0xff,0xff,0xff,
X 0xff,0xff,0xff,0x03,0x00,0x00,0xf8,0xff,0xff,0xff,0x00,0xff,0xff,0x1f,0xfc,
X 0x03,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xe0,0xff,
X 0xff,0xff,0x00,0xff,0xff,0x1f,0xfe,0x01,0x00,0xff,0xff,0xff,0xff,0xff,0xff,
X 0xff,0xff,0x0f,0x00,0x00,0x00,0xfe,0xff,0xff,0x00,0xff,0xff,0x1f,0xff,0x00,
X 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xc0,0xff,
X 0xff,0x00,0xff,0xff,0xbf,0x7f,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
X 0xff,0x1f,0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xff,0xff,0xff,0x7f,0x00,0xe0,
X 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0xf8,0xff,
X 0x00,0xff,0xff,0xff,0x3f,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
X 0x3f,0x00,0x00,0x00,0x00,0xf0,0xff,0x00,0xff,0xff,0xff,0x1f,0x00,0xf8,0xff,
X 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xc0,0xff,0x00,
X 0xff,0xff,0xff,0x0f,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
X 0x00,0x00,0x00,0x00,0x80,0xff,0x00,0xff,0xff,0xff,0x07,0x00,0xfe,0xff,0xff,
X 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x80,0xff,0x00,0xff,
X 0xff,0xff,0x03,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
X 0x00,0x00,0x00,0x80,0xff,0x00,0xfe,0xff,0xff,0x01,0x00,0xff,0xff,0xff,0xff,
X 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x80,0xff,0x00,0xfc,0xff,
X 0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
X 0x00,0x00,0x80,0xff,0x00,0xf0,0xff,0x7f,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
X 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x80,0xff,0x00,0xe0,0xff,0x1f,
X 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,
X 0x00,0x80,0xff,0x00,0xc0,0xff,0x03,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
X 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x80,0xff,0x00,0xc0,0xff,0x01,0x00,
X 0x80,0xff,0xff,0xff,0xff,0xef,0xdf,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
X 0x80,0xff,0x00,0xc0,0xff,0x01,0x00,0x80,0xff,0xff,0xff,0xff,0xc7,0x8f,0xff,
X 0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x80,0xff,0x00,0xc0,0xff,0x01,0x00,0xc0,
X 0xff,0xff,0xff,0xff,0xc7,0x8f,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x80,
X 0xff,0x00,0xc0,0xff,0x01,0x00,0xc0,0xff,0xff,0xff,0xff,0x83,0x07,0xff,0xff,
X 0xff,0xff,0x03,0x00,0x00,0x00,0xc0,0xff,0x00,0xc0,0xff,0x01,0x00,0xc0,0xff,
X 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xc0,0xff,
X 0x00,0xc0,0xff,0x01,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
X 0xff,0x03,0x00,0x00,0x00,0xe0,0xff,0x00,0xc0,0xff,0x01,0x00,0xe0,0xff,0xff,
X 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xf0,0xff,0x00,
X 0xc0,0xff,0x03,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
X 0x07,0x00,0x00,0x00,0xfc,0x7f,0x00,0xc0,0xff,0x03,0x00,0xe0,0xff,0xff,0xff,
X 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0xff,0x7f,0x00,0xc0,
X 0xff,0x03,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
X 0x00,0x00,0xe0,0xff,0x7f,0x00,0xc0,0xff,0x07,0x00,0xf0,0xff,0xff,0xff,0xff,
X 0xfd,0xff,0xc7,0xff,0xff,0xff,0x0f,0x00,0x00,0xfe,0xff,0x3f,0x00,0xc0,0xff,
X 0x1f,0x00,0xf0,0xff,0xff,0xff,0xff,0xf8,0xff,0x83,0xff,0xff,0xff,0x0f,0x00,
X 0xf0,0xff,0xff,0x1f,0x00,0x80,0xff,0x7f,0x00,0xf0,0xff,0xff,0xff,0xe7,0xf8,
X 0xff,0x83,0xc7,0xff,0xff,0x0f,0xe0,0xff,0xff,0xff,0x0f,0x00,0x00,0xff,0xff,
X 0x01,0xf8,0xff,0xff,0xff,0xe3,0x38,0x80,0x83,0x03,0xf0,0xff,0xff,0xff,0xff,
X 0xff,0xff,0x03,0x00,0x00,0xfe,0xff,0x07,0xf8,0xff,0xff,0x7f,0xe0,0x38,0x00,
X 0x87,0x03,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xfc,0xff,0x1f,
X 0xf8,0xff,0xff,0x1f,0xe0,0x38,0x00,0x8e,0x03,0x00,0xff,0xff,0xff,0xff,0xff,
X 0x7f,0x00,0x00,0x00,0xf8,0xff,0x3f,0xf8,0xff,0xff,0x0f,0xe0,0x38,0x00,0x9c,
X 0x03,0x00,0xfe,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xf0,0xff,0xff,0xf8,
X 0xff,0xff,0x07,0xe0,0x38,0x00,0xb8,0x03,0x00,0xfe,0xff,0xff,0xff,0xff,0x00,
X 0x00,0x00,0x00,0xc0,0xff,0xff,0xfb,0xff,0xff,0x03,0xe0,0x38,0x00,0xb8,0x03,
X 0x00,0xfe,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
X 0xff,0x03,0xe0,0x1c,0x00,0xf0,0x01,0x00,0xfc,0xff,0xff,0x1f,0x00,0x00,0x00,
X 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0x03,0xc0,0x0f,0x00,0xe0,0x00,0x00,
X 0xfc,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
X 0x01,0x80,0x03,0x00,0x40,0x00,0x00,0xfc,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0xfe,
X 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0x01,
X 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0xf8,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x1f,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x01,0x00,
X 0x00,0x00,0x00,0x00,0x00,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0xc0,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x0f,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x01,0x00,0x00,
X 0x00,0x00,0x00,0xc0,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0xfe,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0x0f,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0x01,0x00,0x00,0x04,
X 0x00,0x00,0xf0,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0xf0,0xff,0xff,0x01,0x00,0x00,0x0e,0x00,0x00,0xf8,0xff,0x03,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x01,0x00,0x00,0x1f,0x00,
X 0x00,0xfc,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
X 0xff,0xff,0x01,0x00,0x80,0x3b,0x00,0x00,0xfe,0xff,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x07,0x00,0xc0,0x71,0x00,0x80,
X 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
X 0xff,0x07,0x00,0xe0,0x70,0x00,0xe0,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x1f,0x00,0x70,0xe0,0x00,0xf8,0xff,
X 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
X 0x7f,0x00,0x38,0xe0,0x00,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x00,0x38,0xe0,0x80,0xff,0xff,0x7f,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,
X 0x03,0x38,0xe0,0xe0,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x1f,0x38,0xe0,0xf8,0xff,0xff,0x3f,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x3f,
X 0x78,0xe0,0xfe,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xf9,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
X 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
X 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
X 0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
X 0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
X 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
X 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
X 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,
X 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
X 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,
X 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
X 0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0x3f,0xe0,0xff,
X 0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0xe0,0xff,0xff,0x0f,0x00,0xfe,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x07,0x00,0xf0,0xff,
X 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x80,0xff,0xff,0x01,0x00,0xe0,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0xc0,0xff,0x7f,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0xff,0xff,0x00,0x00,0xc0,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0xc0,0xff,0xff,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
X 0xff,0x00,0x00,0x80,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0x00,0x00,0x80,0xff,0xff,0x01,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
X 0x00,0x00,0x00,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0x00,
X 0x00,0x00,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0xf8,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0xc0,0xc3,0x03,0x00,0x00,0xfc,0xff,0xff,0x00,0x00,
X 0x00,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc7,0x07,
X 0x00,0x00,0xfe,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x00,0xf8,0x7c,
X 0x00,0x00,0x00,0x00,0x80,0xcf,0x07,0x00,0x80,0xff,0xff,0xff,0x00,0x00,0x00,
X 0xff,0xff,0x03,0x00,0x00,0x78,0x3c,0x00,0x00,0x00,0x00,0x80,0x9f,0x0f,0x00,
X 0xf0,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0x07,0x00,0x00,0x78,0x7e,0x00,
X 0x00,0x00,0x00,0x80,0xff,0x7f,0x80,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0xff,
X 0xff,0x07,0x00,0x00,0xfc,0xff,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,
X 0xff,0xff,0x7f,0x00,0x00,0x00,0xff,0xff,0x0f,0x00,0x00,0xff,0xff,0x01,0x00,
X 0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0xff,0xff,
X 0x1f,0x00,0xf0,0xff,0xff,0x03,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
X 0xff,0x3f,0x00,0x00,0x00,0xff,0xff,0x7f,0x80,0xff,0xff,0xff,0x03,0x00,0x00,
X 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0xff,0xff,0xff,
X 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
X 0x1f,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,
X 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
X 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
X 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xf0,
X 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
X 0xff,0xff,0x01,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
X 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xe0,0xff,
X 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
X 0x1f,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
X 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
X 0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0x1f,0x00,
X 0x00,0x00,0x00};
END_OF_FILE
if test 18055 -ne `wc -c <'icons/wanderer_bm'`; then
echo shar: \"'icons/wanderer_bm'\" unpacked with wrong size!
fi
# end of 'icons/wanderer_bm'
fi
if test -f 'scores.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'scores.c'\"
else
echo shar: Extracting \"'scores.c'\" \(7550 characters\)
sed "s/^X//" >'scores.c' <<'END_OF_FILE'
X#include "wand_head.h"
X
X#ifdef EGA
Xextern char *EGAaddr;
X#endif
X
X#ifdef MSDOS /* M001 */
X#define LOCK
X#define UNLOCK
X#else
X/* MFC- lockfiles fixed: tries 5 times to get lock, with 1 second between
X * tries, if after 5 seconds, no lock is gained, the lockfile is blown
X * away.
X */
X#define LOCK { int lc=5; \
X while((lock = creat(LOCKPATH,0))<0 && lc) { \
X sleep(1); lc--; } \
X close(lock); \
X }
X#define UNLOCK (void) unlink(LOCKPATH)
X#endif
X
X#define ENTRIES 15
X
X#ifndef MSDOS /* M001 */
Xextern int getuid();
X#else
X#define getuid() 0
X#endif
X
Xtypedef struct
X {
X char howdead[25];
X char name[20];
X long score;
X int level;
X int uid;
X } score_entry;
X
X#ifdef LINT_ARGS /* M001 */
Xvoid show_scores(score_entry *,int );
Xint readtable(score_entry *);
X#else
Xvoid show_scores();
Xint readtable();
X#endif
X
Xvoid show_scores(table,num)
Xscore_entry *table;
Xint num;
X{
Xint tot = num;
Xprintf("\n\
XNo. Score Level Names How they died\n\
X===============================================================================\n"); /*
Xxx xxxxxx xxxx xxxxxxxxxxxxxxxxxxxx killed by xxxxxxxxxxxxxxxxxxxxxxxxx */
Xwhile(num > 0)
X {
X num--;
X printf("%2d %6ld %4d %-20s ",(tot - num),table->score,table->level,table->name);
X if(*table->howdead)
X printf("killed by %s\n",table->howdead);
X else
X printf("a total winner!\n");
X table++;
X }
Xprintf("\n\n");
X}
X
X#ifdef EGA
X
X#define vertical(x,y1,y2) egaline(x,y1, x,y2)
X#define horizontal(y,x1,x2) egaline(x1,y, x2,y)
X
Xvoid egabox( x1,y1, x2,y2 )
X{
X horizontal( y1, x1,x2 );
X vertical( x2, y1,y2 );
X horizontal( y2, x1,x2 );
X vertical( x1, y1,y2 );
X}
X
X#define X_MIN 0
X#define X_NO X_MIN+4+4
X#define X_SCORE X_NO+3*8+4+4
X#define X_LEVEL X_SCORE+6*8+4+4
X#define X_NAMES X_LEVEL+5*8+4+4
X#define X_HOW X_NAMES+20*8+4+4
X#define X_MAX 639
X
X#define Y_MIN 50
X#define Y_TITLE Y_MIN+4+4
X#define Y_LINE1 Y_TITLE+1*8+4+1+4
X#define Y_MAX Y_LINE1+ENTRIES*10+4+4
X
Xvoid ega_show_scores(header,table,tot)
Xchar *header;
Xscore_entry *table;
Xint tot;
X{
Xint num;
X
Xclear();
X
Xegaputs( (640 - 8*strlen(header)) / 2, (50 - 8) / 2, header );
X /*
XNo. Score Level Names How they died
Xxx xxxxxx xxxx xxxxxxxxxxxxxxxxxxxx killed by xxxxxxxxxxxxxxxxxxxxxxxxx
X */
Xegabox( X_MIN, Y_MIN, X_MAX, Y_MAX );
Xegabox( X_MIN+4, Y_MIN+4, X_MAX-4, Y_MAX-4 );
X
Xegaprintf(X_NO+2, Y_TITLE, "No." );
Xegaprintf(X_SCORE+(6*8-5*8)/2, Y_TITLE, "Score" );
Xegaprintf(X_LEVEL+1, Y_TITLE, "Level" );
Xegaprintf(X_NAMES, Y_TITLE, " Names How they died" );
X
Xhorizontal(Y_LINE1-4, X_MIN+4, X_MAX-4);
X
Xvertical(X_SCORE-4, Y_MIN+4, Y_MAX-4);
Xvertical(X_LEVEL-4, Y_MIN+4, Y_MAX-4);
Xvertical(X_NAMES-4, Y_MIN+4, Y_MAX-4);
Xvertical(X_HOW-4, Y_MIN+4, Y_MAX-4);
X
Xfor( num = 1; num <= tot; ++num, ++table ) {
X egaprintf(X_NO+(3*8-2*8)/2, Y_LINE1+10*(num-1), "%2d",num);
X egaprintf(X_SCORE, Y_LINE1+10*(num-1), "%6ld", table->score);
X egaprintf(X_LEVEL+(5*8-4*8)/2, Y_LINE1+10*(num-1), "%4d", table->level);
X egaprintf(X_NAMES, Y_LINE1+10*(num-1), "%-20s", table->name);
X if(*table->howdead)
X egaprintf(X_HOW, Y_LINE1+10*(num-1), "killed by %s", table->howdead);
X else
X egaprintf(X_HOW, Y_LINE1+10*(num-1), "a total winner!");
X }
X}
X#endif
X
Xint readtable(table_ptr)
Xscore_entry *table_ptr;
X{
XFILE *fp;
Xint numread;
Xif((fp = fopen(HISCOREPATH,R_BIN)) == NULL)
X {
X numread = 0;
X }
Xelse
X {
X numread = fread( VOIDSTAR table_ptr, sizeof(score_entry), ENTRIES, fp);
X fclose(fp);
X }
Xreturn numread;
X}
X
Xsavescore(howdead,score,level,name)
Xchar *howdead, *name;
Xlong score;
Xint level;
X{
Xscore_entry table[ENTRIES + 2],
X *table_ptr = table,new_entry;
Xint numread,index = 1, numsaved, lock, already = 0, user_id;
Xchar buffer[80];
XFILE *fp;
X
XLOCK;
Xnumread = readtable(table);
Xif(name == NULL)
X {
X show_scores(table,numread);
X UNLOCK;
X return;
X }
X
Xuser_id = getuid();
Xstrncpy(new_entry.howdead,howdead,25);
Xnew_entry.howdead[24] = '\0'; /* M002 strncpy does not null terminate */
Xstrncpy(new_entry.name,name,20);
Xnew_entry.name[19] = '\0'; /* M002 strncpy does not null terminate */
Xnew_entry.score = score;
Xnew_entry.level = level;
Xnew_entry.uid = user_id;
X
Xif (numread > 0)
X {
X /* insert new_entry at correct point */
X for( table_ptr = &table[numread-1]; table_ptr >= table; --table_ptr ) {
X if(table_ptr->score > score ||
X (table_ptr->score == score && table_ptr->level >= level)) {
X table_ptr[1] = new_entry;
X break;
X }
X table_ptr[1] = table_ptr[0];
X }
X if ( ! (table_ptr >= table) )
X table[0] = new_entry;
X
X /* see if name now appears twice */
X for( already = index = 0, table_ptr = &table[numread]; table_ptr >= table; --table_ptr ) {
X#ifdef COMPARE_BY_NAME
X#define SAMEUSER(p) (strcmp((p)->name, name) == 0)
X#else
X#define SAMEUSER(p) ((p)->uid == user_id)
X#endif
X if(SAMEUSER(table_ptr))
X if(index > 0) {
X already= 1;
X break;
X } else
X index = table_ptr - table;
X }
X if(already)
X /* remove duplicate */
X while( index < numread ) {
X table[index] = table[index + 1];
X ++index;
X }
X else
X ++numread;
X }
Xelse
X {
X#ifdef EGA
X if(!EGAaddr)
X#endif
X printf("\nCreating new hiscore table.\n\n");
X table[0] = new_entry;
X numread = 1;
X }
Xnumread = ( (numread > ENTRIES) ? ENTRIES : numread );
X
Xif(howdead[0])
X sprintf(buffer,"%s killed by %s with a score of %ld on level %d.",name,howdead,score,level);
Xelse
X sprintf(buffer,"%s a total winner with a score of %ld on level %d!",name,score,level);
X
X#ifdef EGA
Xif(EGAaddr)
X ega_show_scores(buffer,table,numread);
Xelse
X#endif
X {
X printf( "\n\n%s\n", buffer );
X show_scores(table,numread);
X }
X
Xfp = fopen(HISCOREPATH,W_BIN);
Xnumsaved = fwrite( VOIDSTAR table, sizeof(score_entry), numread, fp);
Xif(numsaved < numread)
X#ifdef EGA
X if(EGAaddr)
X egaprintf(8,300,"ERROR! Only %d items saved from %d!",numsaved,numread);
X else
X#endif
X printf("ERROR! Only %d items saved from %d !\n",numsaved,numread);
Xfclose(fp);
Xchmod(HISCOREPATH,0660);
XUNLOCK;
X}
X
Xvoid delete_entry(num)
Xint num;
X{
Xscore_entry table[ENTRIES + 22],
X *table_ptr = table;
Xint numread,index = 1, numsaved, lock;
XFILE *fp;
XLOCK;
Xnumread = readtable(table_ptr);
Xif (numread == 0) {
X printf("Missing or unreadable hiscore table.\n\n");
X UNLOCK;
X exit(1);
X}
Xif (num > numread) {
X printf("Invalid entry, choose again\n");
X UNLOCK;
X return;
X}
Xwhile(index < num) {
X index++;
X table_ptr++;
X }
Xwhile(index < numread) {
X index++;
X *table_ptr = *(table_ptr+1);
X table_ptr++;
X }
Xnumread--;
Xfp = fopen(HISCOREPATH,W_BIN);
Xtable_ptr = table;
Xnumsaved = fwrite( VOIDSTAR table_ptr, sizeof(score_entry), numread, fp);
Xchmod(HISCOREPATH,0660);
Xif(numsaved < numread)
X printf("ERROR! Only %d items saved from %d !\n",numsaved,numread);
Xfclose(fp);
XUNLOCK;
Xshow_scores(table,numsaved);
X}
X
Xerase_scores()
X{
Xint erasenum,numread,index = 0;
Xchar correct[20],c;
Xscore_entry table[ENTRIES + 2],
X *table_ptr = table;
Xprintf("Please enter password:");
Xwhile((c = getchar()) != '\n' && index <19) {
X correct[index++] = c;
X }
Xcorrect[index] = 0;
Xif(strcmp(correct,MASTERPASSWORD)) {
X printf("\nFoo, charlatan!\n");
X return;
X }
Xnumread = readtable(table_ptr);
Xshow_scores(table,numread);
Xprintf("\n");
Xfor(;;) {
X printf("Number to erase (0 to exit): ");
X scanf("%d",&erasenum);
X printf("\n");
X if(erasenum == 0)
X break;
X delete_entry(erasenum);
X printf("\n");
X }
Xprintf("Byee!\n");
X}
END_OF_FILE
if test 7550 -ne `wc -c <'scores.c'`; then
echo shar: \"'scores.c'\" unpacked with wrong size!
fi
# end of 'scores.c'
fi
echo shar: End of archive 3 \(of 5\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 5 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 5 archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0