8,732
edits
Changes
→Program Notes
[[Adventure: Pirate's Adventure|''Pirate's Adventure'']] was first sold commercially to run in Level II BASIC on a 16 K-byte TRS-80. Both the Adventure-interpreter program (in BASIC) and a data file created by the Adventure-editor program were on the cassette tape. After you loaded the interpreter program, you used it to read the data file, an operation that took 20 minutes but allowed me to compress a lot of Adventure into very little memory space.
In planning this article, I had to devise a means of creating the tape data file without using the Adventure editor. The BASIC program in listing 1 provides the means. This program, which runs on a TRS-80 with 16 Kbytes of memory, has the sole purpose of generating the Adventure-data file that will be read by theAdventure-interpreter program. The program of listing 1 writes the data on a C-60 cassette and verifies that the tape has been correctly written. Allow about 45 minutes for this program to run. The Adventure-interpreter program appears in listing 2. It will read the tape data file in about 20 minutes and then start play of the game. If you plan to run Pirate's Adventure, on a 32 K-byte TRS-80 or larger machine, you can merge the two programs as follows: delete lines 6510 thru 6790 of listing 1. Append the data statements of listing 1 to listing 2, replacing all occurrences of INPUT#D in listing 2 with the word READ. It is possible to run this program on machines other than the TRS-80. If your machine runs a version of Microsoft BASIC (eg: Apple II running Applesoft, Commodore PET, Exidy Sorcerer, or any Ohio Scientific computer), you will have fewer changes to make. Here are some of the obscure changes that may have to be made (depending on your machine and version of BASIC):* A logical operation returns the value -1 (or hexadecimal FF) whentrue, and 0 otherwise. For example, executing: PRINT (1=2), (1=1) causes the numbers 0 (denoting false) and -1 (denoting true) to be printed.
==References==