Virtual Tape Utilities

Clarification

Reading and Writing tapes does not require a special utility in and of itself. Audacity, Goldwave, or any other audio recording software will work, because tapes are, in fact, just audio. There is a page devoted to how to read TRS-80 tapes into WAV format here.

What is the issue, is what to do with a WAV file once you have it. That is what this page is for. It has utilities that will convert WAVs to CAS format for use in an emulator, and back again. It has utilities that will convert high speed (1500 baud) tapes to Level II (500 baud) or even Level 1 (250 baud) and back again.


Repair WAV’s and Convert Between MANY File Formats

NameDateAuthorPicture

Click to Enlarge

TRS80-Tool v2.4.1 (Win/Mac/Linux) March 2023 Lawrence Kestleoot

Its 3 main functions are:

  1. It can try to correct a WAV file
  2. It can convert between many different formats. This includes converting from tokenized (BAS) to untokenized (ASCII), converting machine language files (CMD or SYSTEM) to disassembled listings (LST), and converting between 250 (Level 1), 500 (Level II), 1000 (LNW-80), and 1500 (Model III) baud rates. You want to take a BASIC file, a CMD file, and a SYSTEM file and put them all into a WAV file … it will do it!
  3. It can display a guessed start address for system programs with no specified start address.

TRS80-TOOL supports the following formats:

.BASThis is a BASIC program. It’s typically tokenized (token words like PRINT are stored as a single byte), but the tool supports reading Basic programs that are in text (non-tokenized) format. When writing a file with a .BAS extension, the file is always tokenized.

.ASCThis is also a BASIC program, but always in text (non-tokenized) format. The extension is mostly useful when writing a BASIC file, because it tells the converter to use the non-tokenized format.

.WAVThis is a cassette’s audio stream. It can be at any sampling rate, either 8 or 16 bits per sample, and either mono or stereo.

.CASThis is a cassette stored in a compact form where each bit on the cassette is stored as a bit in the file. It includes synchronization headers and bytes, as well as start bits (for high-speed cassettes). This is a decent archival format for cassettes.

.CMDThis is a machine language program as stored on a floppy disk.

.3BNThis is a SYSTEM file (a machine language program as stored on a cassette). The name comes from “Model 3 BiNary”. This is typically not used, and instead these files are stored within .CAS files.

.JV1This is a floppy disk format for the Model I. It’s very simple, capturing the basic sector data. It does not capture enough information for copy-protected floppies. It’s named after Jeff Vavasour.

.JV3This is a floppy disk format for the Model III. It’s very simple, capturing the basic sector data and IDAM structure. It does not capture enough information for copy-protected floppies. It’s slightly more capable than .JV1 because it can encode a mix of FM and MFM signals on the same track.

.DMKAnother floppy disk format, capturing more information from the floppy, such as some bits between sectors. Named after David M. Keil.

.LSTThis is an assembly language listing file, generated by disassembling a .CMD or .3BN file using the convert command.

Web Page Version:

Click to Enlarge

This utility is in the form of an extremely powerful web page.

The web page can be found at https://www.my-trs-80.com/cassette/. You can drag and drop a WAV, CAS, or BAS file and from there see the individual pulses of the WAV (original and filtered). You can click on the BASIC or Machine Language output listing and see the individual clock pulses in the WAV which gave rise to whatever you are pointing to. You can run the program in a virtual emulator in the browser. And, of course, you can export the corrected WAV to WAV, BAS, Binary, or CAS.

Standalone Version:

Click to Enlarge

The standalone can be found on https://github.com/lkesteloot/trs80/tree/master/packages/trs80-tool. v2.4.1 can be downloaded there or right here for Windows/MacOS/Linux.

Command line options are as follows:

Usage: trs80-tool COMMAND args …

Options:

–versionShow the tool’s version number

–helpShow the usage message

dirShow the contents of WAV, CAS, JV1, JV3, DMK, and SCP files

infoDisplays a one-line description of the contents of the file, such as its type (system program, Basic program); if known, the embedded filename; and the starting address (or its best guess for one) for SYSTEM tapes.

hexdumpDisplays a hex dump of the input file, with annotations. By default the command will collapse consecutive identical lines (turn off with –no-collapse. Then –color flag will force coloring on or off.

sectorsDisplays a table of the sectors in a floppy disk. The columns are the sectors and the rows are the tracks. For each sector a character is displayed. The –contents flag will show the contents of each sector.

replStart an interactive session for exploring the Z80. You can type an assembly language instruction (such as “ld a,5”) to assemble it, write it to memory, explain it, execute it, and show its effects on flags and registers. This virtual machine is not in a TRS-80 context (it has no ROM or peripherals).


asmAssembles the specified assembly language source code.

trs80-tool asm …

program.asm program.cmdAssembles program.asm into program.cmd. Output can be .CMD, .3BN, .CAS, or .WAV

–baud 1500 program.asm program.casAssembles program.asm into a 1500 baud CAS file.

–listing program.lst program.asm program.cmdAssembles program.asm into a program.cmd with a listing file of program.lst.


disasmDisassembles the specified program.

trs80-tool disasm …

saucer.cmdDisassembles saucer.cmd

–org 0x8000 saucer.cmdDisassembles saucer.cmd with an ORG of 8000H


runRun a TRS-80 emulator in the shell.

trs80-tool run …

run –model 1 –level 1Starts a Model I Level 1 Emulator. Choices are Model I, III, and 4, Level 1 and Level II.

run tdos13a.dskRuns an emulator and boots tdos13a.dsk


convertConverts a list of input files to an output file or directory.

The convert option is quite powerful and has three arguments of its own: –baud, –entry, and –start. Here are SOME examples:

trs80-tool convert …

in.cmd out.3bnCMD file (Diskette) to SYSTEM format (Cassette)

–start 17408 in.rom out.cmdRaw Image file to CMD format, with a load address of 17408

in.bin out.3bnRaw Image file to SYSTEM format

in.bas out.ascDetokenize file

in1.bas in2.3bn in3.cmd out.wav3 files into a WAV file (including converting CMD to SYSTEM)

in.dmk out.wavDiskette to WAV

in1.cas in2.cas in3.cas out.wav3 CAS files into a single WAV file

in1.bas in2.3bn out.wavBAS file and SYSTEM file into a single WAV file

in.cmd out.lstDisassemble CMD file

in.3bn out.lstDisassemble SYSTEM file

in.wav outdirExtract the files from a WAV file to a directory

in.cas outdirExtract the files from a CAS file to a directory

in.dmk outdirExtract the files from a DMK file to a directory

in.wav out.wavClean and radically shrink the size of a WAV file


trs80-tool convert –baud …

1500 in1.bas in2.3bn out.wavBAS file and SYSTEM file into a 1,500 Baud WAV file


trs80-tool convert –start …

17408 in.cas out.casSet the start address to /17408

auto in.cas out.casSet the start address to its best guess

0x7059,0x7064,0x71B9,0x7263 lower.cas lower.lstDisassemble the cassette file LOWER.CAS to LOWER.LST but treat locations 7059H 7064H 71B9H and 7263H as entry points. This will stop the disassembler from wrongly assuming relocated code is actually an ascii string.

Current limitations

  • Cannot write floppy disk files.
  • Can only read TRSDOS and LDOS floppy disks

Outputting CAS Files

NameDateAuthorPicture

Click to Enlarge

Play CAS Utility v2.0 (Win) May 2018 Knut Roll-Lund

Use your PC as a cassette player for your TRS-80 Model I/III/4 Level I and II by connecting your TRS-80 cassette input (“Ear” Output) into the PC’s headphones output.

Supports Level 1 (250 Baud), Level II (500 Baud), LNW (1kHz), and Highspeed (1500 Baud) and SYSTEM, BASIC, EDTASM, LEVEL 1 SYSTEM, and LEVEL 1 BASIC files. It does NOT support Scripsit, or ASCII files.



Convert between File Formats

NameDateAuthorPicture

Click to Enlarge

TRLD v1.5.2 July 2018 George Phillips

Reads one or more TRS-80 programs in .cmd, .cas, .hex or .bas format and saves them as a single .cmd, .cas, .wav, or .hex file. As input it supports 250, 500 and 1500 baud .cas cassette image files as well as tokenized and ASCII .bas BASIC program files. Output can be in .cmd, .cas, .hex or .wav (audio file) format.

One additional feature, the “-s” option, detects relocation code and cassette loaders, runs them and puts the resuls into the output file. For example, many disk executables (.cmd) start with a short block of code that copies the entire program to a different spot in memory and jumps to it. Similarly, a few games had their own custom cassette loaders. The first program on the cassette was a short loader program that would load the rest of the tape in some custom format.


Everything below this line, while fine programs, have functionality which is included in the above programs.

NameDateAuthorPicture

Click to Enlarge

CAS to WAV Utility (DOS) Nov 2004 Knut Roll-Lund

Convert a CAS file into a WAV for making a real TRS-80 cassette.


Click to Enlarge

WAV 2 CAS July 2020 Anton Argirov

Convert WAV files to CAS. It accepts WAV files with any sample rate (11025 / 22050 / 44100) and format (float / 8-bit / 16-bit / stereo / mono), uses auto-detection mechanism to get clock frequency which depends on baud rate (model I level2 500baud, level1 250baud or model III highspeed 1500 baud). Requires Ruby v2.3 to be installed.


Click to Enlarge

WAV to CAS Utility v2.0.0.2 (Bug Fix 2) (DOS) Feb 2008 Knut Roll-Lund

Wav2cas is a Windows program, run in a DOS window (or you can use drag’n’drop, dropping the wav file onto the wav2cas desktop shortcut icon), which takes an uncompressed Windows wav file (made from a Model I Level II (500 Baud), Model I Level 1 (250 baud), or Model III (1500 Baud) cassette tapes) and generates a cas file for use by TRS-80 emulators. Silent bits doesn’t matter, so an entire tape can be converted (but header synchronization is only done once, so this is risky).


Click to Enlarge

High/Low Cassette Converter (DOS) Apr 2005 Knut Roll-Lund

Highlow is a small utility for converting CAS files between Highspeed (1500 Baud) and Lowspeed (500 Baud). Since 1500 Baud includes a startbit, making the file contents unreadbale, it is useful for viewing the contents of a highspeed CAS file after a wav2cas_h conversion, to do a preliminary check for success or to get the name from a system tape. It can convert both ways and does so automatically. It can’t handle multiple files in a CAS file so only single content CAS files may be used, and it must detect the header so it can’t deal with fragments.


Click to Enlarge

High/Low Cassette Converter (DOS) Apr 2005 Knut Roll-Lund

Highlow is a small utility for converting CAS files between Highspeed (1500 Baud) and Lowspeed (500 Baud). Since 1500 Baud includes a startbit, making the file contents unreadbale, it is useful for viewing the contents of a highspeed CAS file after a wav2cas_h conversion, to do a preliminary check for success or to get the name from a system tape. It can convert both ways and does so automatically. It can’t handle multiple files in a CAS file so only single content CAS files may be used, and it must detect the header so it can’t deal with fragments.


Click to Enlarge

ACAS CAS Analyzer (DOS) N/A Knut Roll-Lund

ACAS is another small utility, this time for checking the cas files. Actually it is a beta as it will be incorporated in another program but I decided that I would release this standalone version anyway. As it is now it will scan through a cas file and find out what it can about it and output what it thinks to a txt file with the same path and name.


Click to Enlarge

CMD2CAS (Win) Mar 2005 Attila Grosz

Cass80 is a tool by Jurgen Buchmueller to load, analyze, disassemble or list, modify, and save EACA Colour-Genie 2000 and Video-Genie 3003 (which was a TRS-80 clone) cassette images. Cass80 can be downloaded from https://github.com/pullmoll/cass80.

One thought to “Virtual Tape Utilities”

  1. One issue in modern PC’s is the use of USB for disk interfaces. There are NO 5 1/4″ disk drives with USB interfaces! I have one PC with a 5 1/4″ drive. It is an old XT class machine with a 4.77MHz 8088 and 8087 coprocessor so the emulator is not recommended for it. Last I heard it required a 100MHz pentium class machine. What is needed for those of us with working TRS-80’s is for Tandy to waive its copyrights and allow us to get what we need for these machines that we have loyally used. If you followed me (HigginsCharles) on twitter you’d know my brother bet me my TRS-80 would not work after it spent 9 years in non climate controlled storage. This afternoon I got bored and hooked up my TRS-80 W/4 180 KB drives, stereo sound system and monophonic sound system up and saw if it would work. It did. Amazing reliability. I even played music (Orch90) through its stereo amp and speakers. And yes the old disks are still readable.

Comments are closed.