Add files via upload
This commit is contained in:
@@ -6,17 +6,7 @@ Run it on the cpcp Andrews system.
|
||||
|
||||
## Building the Super Star Trek executable from Fortran 77 source in CP-V
|
||||
|
||||
After booting the SimH Sigma emulator into CP-V, connecting a terminal window via telnet, and logging in, it should be a simple matter of opening the file build_TRTREK in a host system text editor, copying its contents to the host system clipboard, and then selecting the CP-V terminal window and pasting the clipboard contents into the terminal. It will take a while to empty the clipboard into the CP-V terminal window, so be patient.
|
||||
|
||||
The file build_TRTREK contains:
|
||||
1) A sequence of Tele-Edit commands to build the 63 F7:TR* Fortran source files in the user's directory;
|
||||
2) A Tele-Edit command to load the game instructions as text file TX:STARTRK;
|
||||
3) A sequence of F77 commands to compile 62 of the source files to the corresponding BO:TR* object files (F7:TREKCOM is INCLUDEd by the other source files, and is not itself compiled);
|
||||
4) A LEMUR (CP-V object librarian) command to build the LB:TRTREK object library from 61 BO:TR* object files (i.e. all the object files except the main routine's object file BO:TRTREK;
|
||||
5) A LYNX (CP-V linker) command to build the executable TRTREK. from BO:TRTREK and LB:TRTREK;
|
||||
6) A sequence of DELETE commands to clean up the user directory by removing the F7:TR*, BO:TR*, and LB:TRTREK files.
|
||||
|
||||
When all this has finished and the CP-V terminal command prompt ("!") has returned, type "L" -- List -- to satisfy yourself that that the TRTREK. Super Star Trek executable and the TX:STARTRK text file have been successfully created.
|
||||
After booting the SimH Sigma emulator into CP-V, connecting a terminal window via telnet, and logging in, it should be a simple matter of opening the file build_TRTREK in a host system text editor, copying its contents to the host system clipboard, and then selecting the CP-V terminal window and pasting the clipboard contents into the terminal. It will take a while to empty the clipboard into the CP-V terminal window, so be patient. The file build_TRTREK contains: 1) a sequence of Tele-Edit commands to build the 63 F7:TR* Fortran source files in the user's directory; 2) a Tele-Edit command to load the game instructions as text file TX:STARTRK; 3) a sequence of F77 commands to compile 62 of the source files to the corresponding BO:TR* object files (F7:TREKCOM is INCLUDEd by the other source files, and is not itself compiled); 4) a LEMUR (CP-V object librarian) command to build the LB:TRTREK object library from 61 BO:TR* object files (i.e. all the object files except the main routine's object file BO:TRTREK; 5) a LYNX (CP-V linker) command to build the executable TRTREK. from BO:TRTREK and LB:TRTREK; 6) a sequence of DELETE commands to clean up the user directory by removing the F7:TR*, BO:TR*, and LB:TRTREK files. When all this has finished and the CP-V terminal command prompt ("!") has returned, type "L" -- List -- to satisfy yourself that that the TRTREK. Super Star Trek executable and the TX:STARTRK text file have been successfully created.
|
||||
|
||||
NOTE: The specific procedure for copying a file from your text editor onto the system clipboard, and then pasting the clipboard contents into your CP-V terminal window depend on the details of the host operating system, text editor, and terminal emulator you're using.
|
||||
|
||||
@@ -34,9 +24,27 @@ Just type "TRTREK." at the CP-V terminal command prompt, and the game will start
|
||||
|
||||
## Some tips
|
||||
|
||||
1 Getting output on the lineprinter (i.e., in whatever text file is attached to device "LP" in your SimH configuration file): A) On the SimH CP-V console, after CP-V has booted up (like, just before or after you've typed Ctrl-P, ON 107 <Return>) type Ctrl-P, SLP,I <Return> (to "initiate the lineprinter symbiont"); B) On the logged-in terminal, before starting the game (at the "!" prompt), type SET F:108 LP <Return> (this ensures that output to LUN -- logical unit -- 108 in Fortran is directed to the printer); C) After the game has ended and you're back at the "!" prompt, type PRINT <Return> to flush out the CP-V printer queue; D) Remember that SimH's LP buffer won't actually be flushed out to the attached text file until SimH itself exits.
|
||||
1. Getting output on the lineprinter (i.e., in whatever text file is attached to device "LP" in your SimH configuration file): A) On the SimH CP-V console, after CP-V has booted up (like, just before or after you've typed Ctrl-P, ON 107 <Return>) type Ctrl-P, SLP,I <Return> (to "initiate the lineprinter symbiont"); B) On the logged-in terminal, before starting the game (at the "!" prompt), type SET F:108 LP <Return> (this ensures that output to LUN -- logical unit -- 108 in Fortran is directed to the printer); C) After the game has ended and you're back at the "!" prompt, type PRINT <Return> to flush out the CP-V printer queue; D) Remember that SimH's LP buffer won't actually be flushed out to the attached text file until SimH itself exits.
|
||||
|
||||
2. About "TOURNAMENT" games: While requesting a "tournament" game "works", in the sense that it doesn't cause the program to crash (i.e., acts the same as requesting a "REGULAR" game), it doesn't do what it's supposed to do (on the VAX). The idea behind a "tournament" game is that the name or number you type in, to identify the tournament, is then used to seed a random number generator, resulting (on the VAX, at least) in an identical sequence of pseudo-random numbers, in turn resulting in identical games for identical actions. So it provides a level playing field for people to compete against each other -- the chance element is held constant. On the Sigma, running a test program with ten successive calls to RANF(0) generates a different sequence of ten numbers each time the program is run. So we are not implementing a proper "tournament" game as it was implemented on the VAX.
|
||||
2. About "TOURNAMENT" games: The idea behind a "tournament" game is that the name or number you type in, to identify the tournament, is then used to seed a random number generator, resulting in an identical sequence of pseudo-random numbers, in turn resulting in identical games for identical actions. So it provides a level playing field for people to compete against each other -- the chance element is held constant. In the original VAX code there are calls to RANF(0), but they are mapped to the standard DEC function RAN(). On the Sigma, it just so happens that, on the Andrews University system, library module RND (in :LIB.:SYS) contains a function RANF() (and also functions named DRANF() and IRANF()), that is apparently "self-seeding" from the M:TIME system call, so that successive calls to RANF(0) will always generate a different sequence of numbers (fractions >=0 and <1) each time the program is run (the argument is ignored). So in order to get a reproducible sequence of random numbers, the following code was cribbed from _The C Programming Language_, Brian W. Kernighan and Dennis M. Ritchie, Second Edition (Prentice Hall, 1988), p. 46 (in Chapter 2, "Types, Operators and Expressions"):
|
||||
|
||||
####
|
||||
unsigned long int next = 1;
|
||||
|
||||
/* rand: return pseudo-random integer on 0..32767 */
|
||||
int rand(void)
|
||||
{
|
||||
next = next * 1103515243 + 12345;
|
||||
return (unsigned int)(next / 65536) % 32768;
|
||||
}
|
||||
|
||||
/* srand: set seed for rand() */
|
||||
void srand(unsigned int seed)
|
||||
{
|
||||
next = seed;
|
||||
}
|
||||
|
||||
This algorithm was incorporated into the file F7:TRRANF, which contains function RAND() and entry point RANSET (all calls to RANF(0) elsewhere in the code were changed to RAND()). The "granularity" of this generator is based on 16-bit integers rather than 32-bit integers, but that doesn't matter for the purposes here. NOTE: this substitute code is only used for "tournament" games; for "regular" games the seed is set to 0 and calls to RAND() are just passed along to the Andrews library function RANF(), which generates a unique sequence of random numbers for each run of the game. Also NOTE: If you use an alphanumeric string as your tournament name (i.e., anything starting with a letter), then only the first four characters (32 bits worth) are significant. If you use all numbers, they get converted to floating-point and then truncated to integer to form the seed, so anything in the range 1..9999999 will work fine. A negative number is converted to its absolute value; leading 0's are ignored. The first occurrence of a letter in a string of digits terminates the number at the digit before it.
|
||||
|
||||
3. The source file F7:TRDEBUG is an addition to the original VAX complement, and was created in order to add some commands that facilitated testing the game without actually being able to play it very well. In particular, the "DEBUG" command was a generic command that could be attached to any subroutine that needed to be tested. In its final state, it calls the subroutine that generates a commemorative plaque (see the file "plaque.dat" in the "Original_VAX_version" directory), which can appear either on the terminal or on the lineprinter (if the latter has been set up properly). Unlike the VAX version of the plaque, the CP-V version has a hard-coded date (April Fool's Day, 2016).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user