|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T a
Length: 4265 (0x10a9)
Types: TextFile
Names: »asteroids.h«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/Sun/Asteroids/asteroids.h«
/* asteroids.h
*
* Definitions used by the asteroids game.
* Written by Rich Burridge - SUN Microsystems Australia (Melbourne).
*
* Version 3.0. - April 1987.
*
* No responsibility is taken for any errors inherent either to the code
* or the comments of this program, but if reported to me then an attempt
* will be made to fix them.
*/
extern char *sprintf() ;
#define CLOSE (void) close /* To make lint happy. */
#define FCLOSE (void) fclose
#define FCNTL (void) fcntl
#define FPRINTF (void) fprintf
#define IOCTL (void) ioctl
#define NICE (void) nice
#define PRINTF (void) printf
#define READ (void) read
#define SCANF (void) scanf
#define SPRINTF (void) sprintf
#define STRCPY (void) strcpy
#define WRITE (void) write
#define BYTESPERWORD 2
#define BHEIGHT 15
#define BSIZE 2*BHEIGHT+1
/*
* Macros to test and set bits.
* i,j are the x,y offsets from pointer.
* scan is the scan length of the area pointed at.
*/
#define SETON(i,j,scan,ptr) (*(ptr+(scan*(j))+(i)/16) |= (1 << (017 - ((i) & 017))))
#define SETOFF(i,j,scan,ptr) (*(ptr+(scan*(j))+(i)/16) &= ~(1 << (017 - ((i) & 017))))
#define BITSET(i,j,scan,ptr) \
(((*(ptr+(scan*(j))+(i)/16)) &(1 << (017 - ((i) & 017)))) ? (1):(0))
#define BIDLE 0
#define BWAITING 1
#define BACTIVE 2
#define BDYING 3
#define MAXHS 5 /* Max records held in high score file. */
#define AFACTOR 120
#define BFACTOR 256
#define REFUEL 6000 /* fill up tanks every REFUEL points scored per ship */
#define MAXDIFF 15000
#define MAXLINE 80 /* Maximum string length. */
#ifndef CTRLQ
#define CTRLQ 17 /* Used to restart the asteroids game. */
#endif
#ifndef CTRLS
#define CTRLS 19 /* Used to halt the asteroids game. */
#endif
/* Definitions for asteroid keys. */
#define K_QUIT 'q' /* Quit the asteroids game. */
#define K_GO 'g' /* Turn the rocket motor on. */
#define K_STOP 's' /* Turn the rocket motor off. */
#define K_TELEPORT 't' /* Jump through hyperspace. */
/* Key definitions used by getnewscore. */
#define BSPACE 8 /* Backspace. */
#define CR 13 /* Carriage Return. */
#define DEL 127 /* Delete. */
#define FLASHTIME 4 /* Seconds */
#define FLICKERTIME 20 /* Jiffies */
#define FONT_HEIGHT 16 /* Height of font within asteroids. */
#define FONT_WIDTH 8 /* Width of standard character font. */
#define FULLTANK 50000 /* Full fuel tanks */
#define HELPNAME "asteroids.help" /* Name of the initial help file. */
#define RETURN 13 /* Certain useful ASCII constants. */
#define OFFCURSOR 0 /* Modes for the mouse cursor. */
#define TRACKCURSOR 1
#define KEY_SET 0 /* Used for function key setup. */
#define KEY_RESET 1
/* States for the asteroids automation. */
#define HELP 0 /* Display initial help screen. */
#define GETRET 1 /* Wait for user to press return. */
#define STARTUP 2 /* Perform initialisation. */
#define UPDATE 3 /* Main loop to update screen. */
#define EXPIRED 4 /* Player is dead. Terminate gracefully. */
#define NEXTLINE 5 /* Get new username for highscore. */
#define DOEND 6 /* Finally show highscores and end. */
#define SCORE 7 /* Get RETURN after highscores. */
#define CTRLSHIT 8 /* ^S has been hit, do nothing until ^Q. */
/* Asteroid event values. */
#define LEFTUP 1 /* Left mouse button up. */
#define LEFTDOWN 2 /* Left mouse button down. */
#define BUTMIDDLE 3 /* Middle mouse button. */
#define RIGHTUP 4 /* Right mouse button up. */
#define RIGHTDOWN 5 /* Right mouse button down. */
#define SWIDTH 768 /* Maximum screen width. */
#define SHEIGHT 900 /* Maximum screen height. */
/* Set the function to be used for characters. */
#define SCHRFUNC(f) (sfunc = f)
struct hscore
{
char who[MAXLINE] ;
int score ;
} ;