Turbo Pascal Text Adventure Primer cover: BEACON, the adventure the primer builds in Turbo Pascal 2.0, mid-game on the Tatung Einstein
← Back to Modules
module
2

Setting Up

Introduction

If you followed the Turbo Pascal course you already have MAME, the Einstein ROM and the habit of typing TURBO at 0:. This primer needs only a different disc. If you are starting here, the Turbo course's S2, Setting Up, installs everything; come back when you have the Einstein showing 0:.

If You Have A Real Einstein

Put the primer's disc image on whatever you use to get images onto your machine, and boot it. Its Turbo Pascal is the Turbo course's copy, set up for the 40-column screen and the DELETE key. Lines beginning In MAME are not for you.

The Disc

Download the Text Adventure Primer disc and keep it beside the Turbo course disc:

~/einstein/textadventure.mfi

It is an .mfi, like the Turbo course's, for the same reason: Turbo saves your programs to its disc, and MAME will not write to a .dsk. Keep a spare copy of the file you downloaded.

Start the machine with it:

mame -rompath ~/roms einstein -flop1 ~/einstein/textadventure.mfi -window

The Einstein boots to 0: as before. Type TURBO, wait for the sign-on (Version 2.00A, EINSTEIN 40col.), and answer Y to error messages.

What Is On It

At the menu press D, then ENTER:

Dir mask:
TURBO    MSG : TURBO    COM
TURBOMSG OVR : BEACON   TXT
TURBO    OVR : VOCAB    TXT
MAKEDAT  PAS : BEACON   PAS
BEACON   MSG : BEACON   DAT
BEACON   COM

Bytes Remaining On A: 110k
>

Turbo's directory of the primer's disc

FileWhat it isUsed in
TURBO filesTurbo Pascal and its messageseverywhere
BEACON.TXTBEACON's world as plain text: every room, its exits, and everything the game saysS12, S17
VOCAB.TXT121 words, in alphabetical order, one to a lineS9
MAKEDAT.PASa program that turns BEACON.TXT into the two files belowS17
BEACON.DATthe twelve rooms, as recordsS17 on
BEACON.MSGthe 27 messages, as records you can go straight toS13 on
BEACON.PAS, BEACON.COMthe finished game: its source, and compiled to run on its ownS21

That leaves 110k of the disc for your own programs, which is plenty: the biggest thing you will save is the game, at about 9k.

The data files are the game's, and some sections read them. If you ever damage one, MAKEDAT (S17) makes BEACON.DAT and BEACON.MSG again from BEACON.TXT, and your spare copy of the disc has all three.

The Code

No program yet. At 0:, before starting Turbo, type BEACON and play for a minute.

Starting from

A fresh boot of the primer's disc.

What you should see

BEACON's title, then the beach, and a > waiting for a command. Try LOOK, N, S, INVENTORY. QUIT brings you back to 0:.

Change One Thing

  • At the game's >, type a word it cannot know, such as HELLO. What does it say, and does it tell you which word was the trouble?
  • Press CAPS LOCK once, so that letters come out small, and type look. Watch the screen as you type. What appears, and does the game understand it? (Press CAPS LOCK again before QUIT.)

When It Goes Wrong

SymptomCause
Your work is not there after a restartYou are running from a .dsk. Use the .mfi.

Stopping A Program That Will Not Stop

As in the Turbo course: CONTROL and C stops a program that is waiting at a Readln, and a loop only if the program starts with {$U+}. In MAME: CONTROL is Ctrl. Several programs in this primer read the keyboard one key at a time; each tells you how to leave it. Otherwise, restart the Einstein. Save before you run something new.

Summary

One new disc: Turbo Pascal as before, BEACON finished, and the files its world lives in. 110k is yours.

Next

S3, Strings Up Close: what a string really is in memory, and what Turbo does at its edges.

Get the Newsletter

New guides, disk images and community finds, roughly once a quarter. No spam, we promise, this isn't Tatung's marketing department.
Your subscription could not be saved. Please try again.
Your subscription has been successful.

Newsletter

Subscribe to our newsletter and stay updated.

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.