Thursday, December 2, 2010

How To Emulate the TRS-80 Model I/III

Retro gaming in the new millennium depends heavily on emulation technology.  Today's machines are fast enough to simulate entire hardware systems of decades past, with superior speed and "free" virtual hardware upgrades like multiple disk drives and expanded memory.  And emulators take up a lot less physical space than the real thing, slight inaccuracies notwithstanding; my laptop is wonderfully schizophrenic, and much of what I do here would be difficult or impossible without this technology.

But it can be daunting to get an old system up and running past the initial boot display; game consoles aren't too frustrating, but an unfamiliar computer platform can be maddeningly cryptic.  I'm particularly fond of the vintage Radio Shack TRS-80, the machine I cut my computing teeth on way back when, and there aren't a lot of good "how-to" guides on the Internet.  So, at the urging of the good people at the CASA Solution Archive, I hope to help remedy that with this post.

The TRS-80 Model I home computer was introduced by Radio Shack in North America just as the build-it-yourself Heathkit era was ending and the Apple II era was beginning.  It was a simple, black-and-white computer, with a mere 4K of RAM in the low-end model and a maximum of 48K, but it had a decent Z-80 microprocessor and a dedicated monitor, permitting 64 columns of text.  Graphics resolution was very low -- 128 x 48 -- and there was no built-in sound hardware, so arcade style games were not its strong suit.  The Model I was later superseded by the Model III, which was a very similar machine in a more businesslike casing; the Model 4 followed as a logical revision of the III, before the IBM PC arrived and most of the competition dropped out of the industry.  

The emulator I use is Matthew Reed's TRS32.  It runs well in contemporary Windows environments, and the freeware version is very capable.  The $69 registration/upgrade fee provides additional capabilities -- like the ability to save state, handy for jumping in and out, and full EPSON dot-matrix printer emulation -- but I'll focus on the free version here, it will be sufficient for our purposes.


Step 1 -- Download TRS32 and install it.

The link is currently labeled TRS32 Model I/III/4/4P Emulator; as new versions come out, it may change, so I won't link directly here.


Step 2 -- Track down the TRS-80 boot ROM images.

This is a legal gray area -- the original ROM contents are still under Tandy and Microsoft copyright, but their real-world market value has plummeted to near zero and no one has seen fit to hassle the hobbyist community or make an officially licensed emulator available (yet).  If you have the original hardware, then you're arguably in the clear.  There's only one file you really need, named MODEL1.ROM.  The most stable source I have found is the System-80 site in New Zealand, which celebrates the local variant of the TRS-80; you can at this writing download the system ROMs here; once you have retrieved the .zip file, extract and rename the trs80model1.rom file to model1.rom.  Then point TRS32 to the ROM directory by starting it up, then accessing the Options menu, ROM image path option, and browsing to the location where you have stored the model1.rom file.


Step 3 -- Track down a boot DOS disk.

I like NEWDOS, and will use it for the examples below, but it's very similar to the classic Radio Shack TRSDOS (triss-doss) and the same commands should work in both environments.  You can at this writing find the NEWDOS boot disk at the System-80 site, here.  Virtually insert the virtual boot disk in Drive 0 by accessing the Storage menu, Insert floppy disk option, and clicking on drive 0; then browse and select the boot disk image.


Step 4 -- Track down a game image.

TRS32 supports a number of different formats, detailed in step 5 below.  For this example, I will recommend the Scott Adams adventures, as Mr. Adams has generously allowed his classic adventures to be distributed as shareware for quite a while now.  Again, the System-80 site has a disk image available here.

Step 5 -- Bring the game file into the virtual TRS32 system.

This emulator supports several different formats, with different approaches.

Disk image (.DSK, .DMK files) -- Insert the Disk image into one of the free drives (1-3), again by accessing the Storage menu, Insert floppy disk option, and clicking on drive 1, 2, or 3; then browse and select the disk image.

To inspect the contents of a disk, use the DIR [drive #] command, e.g. DIR 2.


Once you can see the files that are on the disk, there are two types of files you are likely to encounter.  A CMD file is an executable that can be run by simply typing its name, e.g. ADV/CMD and hitting [ENTER].  A /BAS file is a BASIC program; see below for instructions on running these.

.CMD file -- Run directly from the TRS32 file menu -- select the File menu, Run /CMD file... option, browse and select the .CMD file.  (Because these are binary images, no additional environment is needed, so the system can simply load these into memory and start them up directly.)

.BAS file -- You will need to copy the file to a TRS-80 disk image using Matthew Reed's companion TRSTOOLS utility (link to general download page, find the TRSTools utility item).  I find it easiest to copy an existing .DSK file, then clear it off, rather than fiddling with the multitude of ways to create a readable TRS-80 disk.  You can then drag and drop the .BAS file into the virtual disk image.


Boot the TRS-80, and type BASIC to invoke the BASIC language interpreter.  (Make note of the /BAS filename you want to load before doing this!)

Load the .BAS file by typing LOAD "[filename]", e.g. LOAD "COLDITZ/BAS", and hit [ENTER].  Then start it by typing RUN.



.CAS file -- Insert the virtual cassette into the TRS32 by accessing the Storage menu, Insert cassette tape... option, then browse and select the .CAS file.

Original TRS-80 cassette -- This is actually easier to deal with than a physical disk.  You'll have to digitize the audio from the cassette into a .WAV file using an audio recording tool, outside the scope of this discussion.  Now you can load the cassette data into TRS32, using the Storage menu, Insert cassette tape... option, then browse and select the .WAV file.

Original TRS-80 diskette -- The 5 1/4" format is almost completely out of circulation these days, so if you have an original disk, see if you can find a digital copy in the online archives.  There are gadgets available for reading and saving these vintage magnetized bits of mylar, but using them is beyond the scope of this simple getting-started guide.


Step 6 -- Play!

Obviously, every game will vary at this point -- it's not always easy to track down original documentation, either, so you may have to experiment a bit to get a game working once it's up and running.

Text adventures are usually pretty straightforward -- just start typing.




Most action-oriented TRS-80 games use the keyboard for controls; TRS32 maps the IBM PC's arrow directional keys to the TRS-80 equivalent, though some games use other keys for control.  Big Five Software used to sell an Atari joystick, modified to work with the TRS-80's expansion port, but no games counted on its availability; TRS32 does, however, support a PC game controller.  Access the Options menu, Configuration... item, and choose your connected device from the Joystick dropdown.


In-game sound is supported directly by TRS32 -- back in the day, we had to hook a little speaker up to the cassette out line to pick up the audio, but that's no longer necessary.  Many games did not include sound effects, as audio output was not an intentional feature of the TRS-80's design, but many games use this trick to produce sound effects.

I hope this guide is enough to get you up and running -- please share any comments, questions or feedback using the comments interface below.  Enjoy!

17 comments:

  1. Hey excellent tutorial - thanks! I had just downloaded TRS32 last night and was in the process of trying to figure it out when I stumbled across your blog. I never owned a TRS-80 (my first system was a VIC-20) but was curious to check out some of its programs. And seeing as how I am a fellow post-40 gamer I am going to check out the rest of your site too. Thanks!

    ReplyDelete
  2. Glad you found it useful. One of the great things about the emulator era is that we can all sample those hardware platforms we never owned back in the day -- and adding a memory upgrade or additional disk drive is just a matter of changing the configuration options. But just firing up a game can be a challenge with all the varying operating systems, so these kinds of tutorials are useful. Thanks for the kind words!

    ReplyDelete
  3. Excellent tutorial. I have a kid who's getting to be about the age I was when my dad brought home our Model I, and taught me how to use it. I found this page while trying to get TRS32 to work. Your tutorial is very informative, and I can't wait to share my joy with my kid. She enjoys ready-made games, but there's nothing like sitting with your dad and learning how to program "Mugwump" in BASIC. Cheers!

    ReplyDelete
  4. Fantastic! I was able to get this working and load my favorite game from high school, empire!

    ReplyDelete
  5. Trying a lot of emulators for all systems from the 80s and 90s. A few like this one I'm spending hours to get working or having to give up. Your guide is fantastic. brilliant.

    ReplyDelete
  6. Thank you so much. You are a lifesaver. I've been trying to figure out how to play games using my TRS-80 emulator for, like, ever, and neither my friends nor my parents could help (friends aren't interested in text-based adventure games, parents don't know anything about emulation.) This was a huge help.

    ReplyDelete
  7. I had some old TRS-80 cassettes I wanted to load into TRS32.

    Believe it or not, the toughest part of the process was finding a digital-audio recording tool that produced .WAV files the emulator would recognize. Windows Vista's Sound Recorder applet (at least on my PC) only took input from the Microphone jack, which introduced too much distortion to be useable. CakeWalk COULD record from the auxiliary input, but it had its own ideas about how to "clean up the sound" for human ears which I couldn't defeat. In the end, I found a shareware audio sampler that did the job, recommended by a TRS-80 afficionado's site.

    Without that last piece of the puzzle, I never would've been able to recover many of the old TRS-80 adventure games I wrote!

    ReplyDelete
  8. I try running Scott Adams adventures and got Directory Read error.

    ReplyDelete
    Replies
    1. Sounds like a disk the executable is expecting isn't available. Are you running a menu program, maybe, without the virtual disk inserted in the virtual drive? Or a disk with the ADVENT program but none of the data files?

      Delete
    2. I had the same problem with the disk loaded in drive 1, "DIR 1" displayed this message. I put the disk image in drive 2, and "DIR 2" worked perfectly. It looks like the virtual drive 1 doesn't work.

      Thanks a lot for this tutorial !

      Delete
  9. The correct command is "DIR :1", if you leave out the colon you will get an error.

    ReplyDelete
  10. I have been going crazy!! I can get Model I, Level II up and going. And I have the Old Invasion Orion, in formats off the floppy (yes, I, too, am old) as: INVASION/BSC, INVASION/CMD, INVASION/SRC all on a disc (which is readable with DIR).... but I can't get it to run!

    Any help? I long for the days of Judgment Day scenario!

    ReplyDelete
    Replies
    1. I would guess that INVASION/CMD is the executable. If you just boot into DOS and run INVASION or INVASION/CMD, does it fail? One thing you could try is using TRSTools to extract the INVASION/CMD file and load it directly into the emulator -- though if it references data files from the floppy that probably won't work.

      Delete
    2. it's all about setting the proper Himem, I think... I can set it, but I still don't know what to input.

      Delete
  11. It references the BAS file, I believe. What the CMD file does (and it DOES start) is come up and the say that the himem not in correct place, and unable to load Invasion Orion Secondary execution module, load aborted. I am looking through the manuals now to see if there is a himem address but not finding a reference.

    ReplyDelete
  12. Oh and I meant INVASION/BAS not 'bsc'

    ReplyDelete
  13. I can set everything up and run a simple trek game in BAS off the same DSK but not Orion. CMD fails as detailed above and BAS just goes back to the command prompt. I am willing to send you the raw files not on disc for you to see if you can get working.

    ReplyDelete