Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- e Makefile
- w Makefile.original
- e Makefile
- 1,$d
- w
- e Makefile
- 0a
- # %W% %G% %U% - (c) Copyright 1987, 1988 Chuck Simmons
- #
- # Copyright (C) 1987, 1988 Chuck Simmons
- #
- # See the file COPYING, distributed with empire, for restriction
- # and warranty information.
- VERS=$(shell sed <vms-empire.spec -n -e '/Version: \(.*\)/s//\1/p')
- # Change the line below for your system. If you are on a Sun or Vax,
- # you may want BSD.
- SYS = LINUX
- #SYS = BSD
- #SYS = SYSV
- # Use -g to compile the program for debugging.
- ##DEBUG = -g -DDEBUG -Wall
- #DEBUG = -Wall
- # Use -p to profile the program.
- #PROFILE = -p -DPROFILE
- #PROFILE = -O0 -fno-omit-frame-pointer -fno-strict-aliasing
- #PROFILE = -Os -march=c3 --force-addr
- #PROFILE = -O3 -mcpu=G3
- ##PROFILE = -O2 -mcpu=G3
- #PROFILE = -Os -mcpu=G3
- ##PROFILE = -O1 -mcpu=G3
- #PROFILE = -O3 -mcpu=G4
- PROFILE = -Os
- # some of these options produce provable optimizing errors
- # meaning w/ certain CFLAGS the optimizer in the compiler
- # can be the culprit which is in fact a known feature
- # or attribute to Computer Science that VMS-Empire
- # is in the class of programs with that property
- # sadly I pruned any addtional info that was once here
- # thinking Id never share. This simple game program makes
- # it even more provable since generally you dont have autosave
- # every turn.. so you recompile, make the same choices
- # when replayiing from saved game.. which the default
- # with empire # also of course you keep those binaries
- # since this makefile produces only 1 one runnable object
- #LIBS = -lncurses
- # HANGING BRACE or CLOSING BRACE ERROR too
- # SEE IF CAN CATCH WHERE reading this script empireFIXED.ed
- # which naturally one applies appropiately with an ed < empireFIXED.ed
- # 1st time Ive really cared to share
- # any want to haha email this to apple kernels dev that
- # were responsible at the time for darwin...
- # not me, I think Ill find more joy
- # making some kind of twitter slide show about
- # the journey... make my own lecture
- # part of a certain Computer Science meme
- #LIBS = -lncurses
- # fixing the braces resolved Id say about half the fighter landed crap
- # but resolved completely the cities that never complete a build
- # unless army for the computer and I think only half the time does the computer
- # get that luck. AND TO BE PERFECTLY CLEAR ITS ALWAYS the SAME CITY
- # BUT the 1ST ELEMENT IN THE BIG STATIC ARRAY IS NO LONGER CONSTANTLY
- # CORRUPTED THANKS to me, and anyone RELATED TO GNU gdb , esp.
- # documentation, sellers of used or old books, NETBSD devs
- # esp. those who cared to provide enough features for a C3 that
- # watch-points will work w/o a doubt. AND thats what it
- # took for me stop criticizing myself every time I considered
- # criticizing hamlet. Seriously, except for that
- # I could have solved it on this computer, a G3 ibook,
- # a G4 mystic, a 486 cryrix with linux with kernel 2.0.38
- # or any of few kind of early to mid ninetys sun workstation
- # at Hunter Creech Lab
- # Cant forget Chuck, either
- LIBS = -lcurses
- # presently this is setup for a darwin tiger G3
- # you might find it easier to download color_console.term
- # as I made a few changes to make a faster game as well
- # Also, better color by far imo
- # AI unchanged # quite a few fighter tweaks tho.
- # AI apparent personalty exactly the same imo
- # basically, no easy tweak left undone
- # fans should prefer mine!
- #
- # You shouldn't have to modify anything below this line.
- CFLAGS += $(DEBUG) $(PROFILE) -D$(SYS) -DWITH_COLOR
- FILES = \
- attack.c \
- compmove.c \
- data.c \
- display.c \
- edit.c \
- empire.c \
- game.c \
- main.c \
- map.c \
- math.c \
- object.c \
- term.c \
- usermove.c \
- util.c
- HEADERS = empire.h extern.h
- OFILES = \
- attack.o \
- compmove.o \
- data.o \
- display.o \
- edit.o \
- empire.o \
- game.o \
- main.o \
- map.o \
- math.o \
- object.o \
- term.o \
- usermove.o \
- util.o
- all: vms-empire
- vms-empire: $(OFILES)
- $(CC) $(PROFILE) -o vms-empire $(OFILES) $(LIBS) $(LDFLAGS)
- TAGS: $(HEADERS) $(FILES)
- etags $(HEADERS) $(FILES)
- lint: $(FILES)
- lint -u -D$(SYS) $(FILES) -lcurses
- clean:
- rm -f *.o TAGS vms-empire
- clobber: clean
- rm -f vms-empire vms-empire-*.tar*
- SOURCES = README NEWS vms-empire.6 COPYING Makefile BUGS AUTHORS $(FILES) $(HEADERS) MANIFEST vms-empire.spec
- vms-empire-$(VERS).tar.gz: $(SOURCES) vms-empire.6
- @ls $(SOURCES) | sed s:^:vms-empire-$(VERS)/: >MANIFEST
- @(cd ..; ln -s vms-empire vms-empire-$(VERS))
- (cd ..; tar -czvf vms-empire/vms-empire-$(VERS).tar.gz `cat vms-empire/MANIFEST`)
- @(cd ..; rm vms-empire-$(VERS))
- dist: vms-empire-$(VERS).tar.gz
- release: vms-empire-$(VERS).tar.gz
- shipper -f; rm -f CHANGES ANNOUNCE* *.6 *.html *.rpm *.lsm MANIFEST
- .
- w
- e attack.c
- 85c
- }
- .
- 74a
- .
- 69a
- { /* points to score for city */
- int points;
- points=cityp->work * 2;
- if ( points < 10 )
- points=10;
- if (att_owner == USER)
- user_score += points;
- else
- comp_score += points;
- }
- .
- w
- e compmove.c
- 1203c
- automove = FALSE;
- .
- 1158c
- && nuser_city == 0 && nuser_army == 0 ) {
- .
- 250a
- #if 0 /* moved satellite to production to here */
- /* Now we need a SATELLITE. */
- if (cityp->prod == NOPIECE && city_count[SATELLITE] == 0
- && rndint(50,150) < date ) {
- comp_set_prod (cityp, SATELLITE);
- return;
- }
- if (cityp->prod == SATELLITE) return;
- #endif
- .
- 233c
- #if 0
- .
- w
- e display.c
- 286d
- 283d
- 281d
- 256d
- 56d
- 53c
- init_pair(COLOR_BLUE, COLOR_WHITE, COLOR_BLUE);
- .
- 50c
- init_pair(COLOR_CYAN, COLOR_BLACK, COLOR_BLUE);
- .
- 47,48c
- init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_WHITE);
- init_pair(COLOR_GREEN, COLOR_BLACK, COLOR_GREEN);
- .
- 42d
- w
- e edit.c
- 503a
- case '*': /* set fighter to crash */
- e_city_splat (cityp, type);
- break;
- .
- 263a
- void
- e_city_splat (cityp, type)
- city_info_t *cityp;
- int type;
- {
- if ( type == FIGHTER )
- e_set_city_func (cityp, type, FIGHTERBURN);
- else
- huh ();
- }
- .
- 181a
- in_edit_kludge=FALSE; /* user is no longer in edit mode */
- .
- 113,132c
- case '#':
- extra( "Location = %d" , edit_cursor, 0,0,0,0,0,0,0);
- break;
- case '$': /* kludge to see city's work */
- {
- city_info_t * cityp;
- long pos;
- static city_info_t * lastcityp = NULL;
- static long prev_work;
- cityp = find_city (edit_cursor);
- if (!cityp ) /* cityp->owner != USER) */
- break;
- pos=cityp - city;
- if ( cityp != lastcityp ) {
- extra( "City #%d at %d making %d work= %d cost=%d",
- pos,
- cityp->loc,
- cityp->prod,
- cityp->work,
- piece_attr[(uchar)cityp->prod].build_time,
- 0,0,0);
- lastcityp=cityp;
- prev_work=cityp->work;
- } else {
- extra( "City #%d at %d making %d work= %d cost=%d prev_work=%d",
- pos,
- cityp->loc,
- cityp->prod,
- cityp->work,
- piece_attr[(uchar)cityp->prod].build_time,
- prev_work,
- 0,0);
- prev_work=cityp->work;
- }
- break;
- }
- case '*': /* set fighter to crash */
- e_splat (edit_cursor);
- break;
- case '\034': /* CTRL - \ */
- case '_':
- {
- city_info_t * cityp;
- cityp = find_city (edit_cursor);
- if (!cityp ) /* || cityp->owner != USER) */
- break;
- extra( "City at %d making %d work= %d cost=%d",
- cityp->loc,
- cityp->prod,
- cityp->work,
- piece_attr[(uchar)cityp->prod].build_time,
- 0,0,0,0);
- kill(getpid(), SIGTRAP );
- }
- break;
- .
- 43a
- in_edit_kludge=TRUE ;
- .
- 27a
- int in_edit_kludge=TRUE ;
- .
- 21a
- #include <unistd.h>
- #include <signal.h>
- .
- w
- e empire.c
- 174,193c
- case '$': /* current score, number of cities, number of armies */
- /* number of enemies cites.. that you know ? , round */
- #if 0
- if ( win ==0 ) {
- #else
- if ( 1 == 0 ) {
- #endif
- int num_cities, num_armies, i;
- piece_info_t *p;
- num_cities=0;
- num_armies=0;
- for (i = 0; i < NUM_CITY; i++) {
- if (city[i].owner == USER)
- num_cities++;
- }
- for (p = user_obj[ARMY]; p != NULL; p = p->piece_link.next)
- num_armies++;
- comment("Round %d: You control %d/%d cities, and have %d armies.",
- date,num_cities, NUM_CITY, num_armies,0,0,0,0);
- } else {
- int num_cities, num_armies, comp_cities,comp_armies,i;
- piece_info_t *p;
- num_cities=comp_cities=0;
- num_armies=comp_armies=0;
- for (i = 0; i < NUM_CITY; i++) {
- if (city[i].owner == USER)
- num_cities++;
- else if ( city[i].owner == COMP )
- comp_cities++;
- }
- for (p = user_obj[ARMY]; p != NULL; p = p->piece_link.next)
- num_armies++;
- for (p = comp_obj[ARMY]; p != NULL; p = p->piece_link.next)
- comp_armies++;
- comment( "You have %d/%d cities, and %d armies vs "\
- "computer's %d cities and %d armies.",
- num_cities, NUM_CITY, num_armies,comp_cities,comp_armies,0,0,0);
- }
- break;
- .
- 95a
- .
- 94a
- #else
- c_examine();
- #endif
- .
- 92a
- #if 0
- .
- w
- e empire.h
- 255,256c
- #define SECTOR_ROWS 2 /* 5 */ /* number of vertical sectors */ /* 52=max for 2 */
- #define SECTOR_COLS 1 /* 2 */ /* number of horizontal sectors */
- .
- 211,212c
- #define MAP_WIDTH 94 /* 148 -- 74 -- 80x40 */ /* 100 */
- #define MAP_HEIGHT 50 /* 31, 35--- 35 -- 80x40 */ /* 60 */
- .
- 80c
- #define LIST_SIZE 2000 /*5000==original*/ /* max number of pieces on board */
- .
- 62c
- #define NUM_CITY 60 /* 28, 25 -- original == 70 */
- .
- 56c
- #define NUMTOPS 3 /* 3 */ /* number of lines at top of screen for messages */
- .
- w
- e extern.h
- 175a
- int rndint(int minp, int maxp);
- .
- 157d
- 155d
- w
- e game.c
- 859a
- #else
- switch(cell){
- case '+':
- attron(COLOR_PAIR(COLOR_GREEN));
- break;
- case '.':
- attron(COLOR_PAIR(COLOR_CYAN));
- break;
- case 'a':
- case 'f':
- case 'p':
- case 'd':
- case 'b':
- case 't':
- case 'c':
- case 's':
- case 'z':
- case 'X':
- attron(COLOR_PAIR(COLOR_RED));
- break;
- default:
- attron(COLOR_PAIR(COLOR_WHITE));
- break;
- }
- addch ((chtype)cell);
- attrset(0);
- attron(COLOR_PAIR(COLOR_WHITE));
- #endif
- .
- 858a
- #if 0
- .
- 562a
- #else
- if(!xread (f, (char *)object, sizeof(piece_info_t[1000] ))) return (FALSE);
- #endif
- .
- 561a
- #if 1
- .
- 503d
- 345a
- compp->work = 0; /* 0 */
- userp->work = 6; /* 0 */
- .
- 343d
- 339d
- 335a
- .
- 333a
- #else
- addprintf ("Your city is at %d. Computer city at %d", userp->loc,compp->loc,0,0,0,0,0,0);
- #endif
- .
- 332a
- #if 0
- .
- 324a
- if ( comp_cont == user_cont ) {
- addprintf("Player's continent == Computer's", 0,0,0,0,0,0,0,0);
- delay(); /* let user see output */
- goto REDO;
- }
- .
- 316a
- REDO:
- .
- 49c
- print_info = FALSE;
- .
- w
- e main.c
- 81a
- #if 1
- (void) printf ("%s = %li bytes\n",
- savefile,
- sizeof(map)+sizeof(comp_map)+sizeof(user_map)+
- sizeof(city)+sizeof(object)+sizeof(user_obj)+
- sizeof(comp_obj)+
- sizeof(free_list)+sizeof(date)+sizeof(automove)+
- sizeof(resigned)+sizeof(debug)+sizeof(win)+
- sizeof(save_movie)+sizeof(user_score)+
- sizeof(comp_score));
- #endif
- .
- 50,51c
- dflg = 2000;
- Sflg = 10;
- .
- w
- e object.c
- 735c
- }
- .
- 733c
- cityp->work = -(piece_attr[i].build_time / 5); /*was city->work! */
- .
- 731c
- else if ( cityp->prod == i )
- return;
- else
- {
- .
- 636,637c
- static unsigned int counter=0;
- if ( counter++ % 100 == 0 ) /* cut down on the checks */
- .
- 593,609c
- {
- /*
- * curses only updates the display if it is necessary, other
- * this only rears it head when a piece of the same kind needs input at
- * the same location -- so, output a number
- * in those cases, I found two ways this, one works well in automove
- * but doesn't work well in edit, the other works well in automove
- * but not at all in edit, so...
- */
- static long turn; /* current turn */
- static long prev_loc;
- static int prev_type=NOPIECE;
- static piece_info_t *prev_obj;
- piece_info_t *ptr;
- extern int in_edit_kludge ;
- if ( in_edit_kludge ) {
- /* count pieces of this type, until we find this object */
- for (num=0, ptr = map[obj->loc].objp; ptr; ptr = ptr->loc_link.next){
- if (ptr->type == obj->type) num++;
- if (ptr==obj) /* found ourselves */
- break; /* with approach: numbers can appear out of order */
- }
- } else { /* count times here at this location */
- if ( turn != date || prev_loc != obj->loc || prev_type != obj->type ){
- turn=date;
- prev_loc=obj->loc;
- prev_type=obj->type;
- prev_obj=obj;
- num=1;
- } else if ( obj != prev_obj )
- num++;
- }
- }
- if ( num <= 1 )
- prompt2 ("%s at %d: moves = %d; hits = %d; func = %s%s",
- piece_attr[obj->type].name,
- obj->loc,
- obj_moves (obj) - obj->moved,
- obj->hits,
- func,
- other,0,0);
- else {
- char namenum[STRSIZE];
- sprintf(namenum, "%s #%d", piece_attr[obj->type].name,num);
- prompt2 ("%s at %d: moves = %d; hits = %d; func = %s%s",
- namenum,
- obj->loc,
- obj_moves (obj) - obj->moved,
- obj->hits,
- func,
- other,
- 0,0);
- }
- .
- 572a
- static int num;
- .
- w
- e usermove.c
- 1001c
- void e_city_attack(), e_city_splat();
- .
- 781,783c
- break;
- .
- 768,779c
- #if 1
- extra( "Index = %d, Location = %d" ,
- obj-object,obj->loc,0,0,0,0,0,0);
- #else
- extra( "Location = %d" , obj->loc, 0,0,0,0,0,0,0);
- .
- 692,694c
- case '.':
- case '/':
- case '=':
- .
- 690c
- case '\014': /* CTRL - L */
- .
- 647,657d
- 644a
- .
- 620,643d
- 218,219c
- comment("Fighter landed on carrier at %d.",
- obj->loc,0,
- .
- w
- e util.c
- 227a
- #if 1
- {
- /* how many items on freelist */
- /* and how many objects in objectlist are untouched? */
- piece_info_t *p;
- long num_free, num_clean, i;
- num_free=0;
- num_clean=0;
- for (p = free_list; p != NULL; p = p->piece_link.next)
- num_free++;
- for (i=0; i<=LIST_SIZE ;i++ ){
- if (object[i].type == 0 &&
- object[i].loc == 0 )
- num_clean++;
- }
- printf("Objects: Free = %li , Untouched = %li, out of %i\n",
- num_free, num_clean, LIST_SIZE);
- }
- #endif
- .
- 211a
- #else
- abort();
- #endif
- .
- 208a
- #if 0
- .
- 74d
- 72d
- 15a
- #include <stdlib.h>
- .
- w
- q
- # can't pin this at top like I liked
- # June 20, 2018
- #! /bin/ed #the standard editor thx RMS! #/Users/daniel/src/vms-empire-1.7
- # naturally apply after unpacking
- # and nuking the Makefile is probably only useful to me
- # or possibly any using pkgsrc when in ->work/vms-empire-1.7 or similiar**?
- # after bmake
- # also console.term is a Terminal.app 100x37 TERM=rxvt, preferences=rxvt
- # which is
- # %g rxvt /Users/daniel/Library/Application\ Support/Terminal/color_console.term
- # <string>rxvt</string>
- # %#which isn't very useful , but I already know
- # if pedantically U cant tell what alias g=
- # is then please presume no warranty
Add Comment
Please, Sign In to add comment