XTOMYDEV: Tomy Tutor Cross Development
and the Tomy Tutor Cassette Tape Format Page

It's here at last: you can now read and write Tomy-tape format data on your desktop computer.
This section is under development. Last modified 6 July 2014. There be dragons here yo.

Back to the main page



The Tomy Tutor has a crush on Scarlett Johansson too.
Shameless pinup generated with tobitenc. (Chroma noise removed from the Mac monitor.)

XTOMYDEV: Transfer Data To And From Your Tomy Tutor With Your Desktop Computer

GRAPHIC is hard to draw really nice pictures in. BASIC can be tricky and sometimes buggy. GBASIC can be onerous. Editing in any of these three modes is often tedious. Now you can create your work of art on your desktop computer and transfer it to GRAPHIC, or (coming soon!) edit your BASIC or GBASIC program in any text editor and have XTOMYDEV tokenize and transfer it.

Plus, if you're trying to preserve your old masterpieces for posterity, now you can convert them to easily compressible bitstreams and back them up for later instead of leaving them vulnerable on cassette tape. You can even share them with other Tomy Tutor owners who can reconstruct the tape data from the bitstream and enjoy your old creations.

XTOMYDEV works by deciphering the tape output line from the Tutor into a bitstream that its suite of tools can analyze. It can also take the bitstream output from one of its tools and generate the audio data to save to tape. With XTOMYDEV, your Tutor and a Data Recorder, you can now move data to and from your Tutor and your desktop without any additional special hardware.

Before we begin, however, how does the Tomy Tutor tape format work anyway? Let's take a look.


The Tomy Tape Format Explained

The Tutor uses a digital tape format, which is to say, it emits pulses instead of a continuous analogue waveform. This is the way that the Commodore Datasette does it, and there are some high-level similarities between the formats, as opposed to a frequency-based approach such as the Kansas City (non-)Standard. Despite the huge number of similarities between the TI 99/4A and the Tomy Tutor, their tape formats are not one of them. Not only are they not mutually intelligible, but the CS1er home page has a depiction of the TI cassette waveform which isn't even close to the Tutor's.

Ultimately, the Tutor is just emitting bits encoded as pulses. If we connect the Tutor's cassette output line directly to the Power Mac's audio input and record it, we get a bit pattern like this:

The doubled pulses indicate a one; the single longer pulse is a zero. Like the Datasette, the Tutor emits a sync mark before everything else, which for the Tutor is just a long string of ones followed by a single zero. The filename follows, and then (BASIC) either another sync mark and then the program or (GRAPHIC) the screen data. No further encoding is done and there is no parity bit. A final sync mark terminates the transmission.

What The Data Recorder Does

The simplicity of this format suggests that you should simply be able to connect your Tutor (or your Data Recorder) to your computer's audio input, record it, and then later connect your computer to the Tutor's cassette input line and play it back. Go ahead and try it. It doesn't work.

As it turns out, the Data Recorder is not a standard tape recorder and actually alters the signal substantially. The first change it makes is to the waveform:

Notice that our nice, regular square waves now have a "bent" falling edge, but only the second pulse of the twin "one" pulses, and also a "bent" rising edge for the single "zero" pulse. If we take this and run it repeatedly through the Data Recorder, we can actually "bend" the edges so far that the bits will become difficult to distinguish and the Tutor will refuse to read it.

Furthermore, the Data Recorder also sends a non-standard signal back to the Tomy Tutor. Not only will a regular tape recorder (or your computer) simply faithfully record the pulse waveform and play it back, which the Tutor won't read, but also if we take that regular tape recorder (or your computer) and use it to play a Data Recorder tape (or an audio file of the tape), the Tutor will still not recognize it. The signal the Data Recorder sends to the Tomy is not a regular audio signal.

Getting The Tutor To Read External Data

If the only way to get readable data on tape were to have the Tomy Tutor write it itself, then this would eliminate any chance at cross-development. Fortunately, there is one thing that does work: if you save a program to tape on the Data Recorder and play that tape from the Data Recorder into your computer, saving it as an appropriate audio file, then later play the audio file back to the Data Recorder, recording that on another tape, and playing the tape back to the Tutor in the Data Recorder, it does work.

So that gives us an idea. We know what the Data Recorder does to the waveform, at least. If we can encode bits ourselves using those same "bent" edges and then record that "bent" audio file to tape using the Data Recorder, we can play that tape back to the Tomy Tutor using the Recorder and the Tutor will accept the data. And that's what XTOMYDEV does.



The Mac is displaying a Targa generated from this test GRAPHIC image using topicdec.

Installing and Using XTOMYDEV

XTOMYDEV is distributed as a suite of Perl scripts for Perl 5.8.6 or later, which comes with Mac OS X 10.4+ (PowerPC or Intel) and most Linux and *BSD distributions, and is also available for Cygwin for Windows. No special utilities are required, although you will need an audio player that understands PCM .au files to play generated output (QuickTime or Audacity will suffice), and you will need a 1/8" stereo-mono converter and a 1/8" male-male audio cable. You must have a Tomy Tutor and a Data Recorder; both the computer and the tape drive are necessary for interchange. XTOMYDEV is distributed under the Floodgap Free Software License.

XTOMYDEV is designed to be modular -- you pipe commands together to convert between formats. The primary tools are totapdec, which takes a 44.1 kHz 16-bit mono uncompressed AIFF audio file and emits a bitstream, and totapenc, which takes a bitstream and emits a 44.1 kHz 16-bit mono PCM .au audio file. The reason for the different formats is so you don't accidentally substitute one for the other: totapdec takes output from the computer, while totapenc makes input for the Data Recorder. totapdec only understands the direct output from the computer. It does not currently understand previously recorded cassettes.

The current version is more concerned about ease of understanding than efficiency. We might change that later, but until the Tutor is completely understood this makes the programs easier to work with.

Let's perform a simple test to get your setup working and demonstrate the process. In this example, we will write a simple BASIC program, save it to and decode it on the desktop computer, reencode it, and send it back to the Tutor. If all these steps work, you're set for XTOMYDEV.

  1. Download XTOMYDEV. This is a .zip file. Extract it into a folder. If you are on a Unix or Mac OS X machine, cd that_folder and chmod +x *. Then copy them into your system -- /usr/local/bin is always appropriate -- or add that folder to your path. On Cygwin, odds are the execute bits are already set, but you can verify that yourself.

    The below command lines assume that XTOMYDEV is in your path. If it isn't, you can also cd into that directory and ./name_of_tool instead of name_of_tool (for Cygwin, you may need to say something like perl ./name_of_tool if the execute bits don't work properly).

  2. Start your Tomy and go to BASIC. Enter this program (or whatever you like, but let's start small):

    10 PRINT"HELLO WORLD"

  3. Connect your Tutor's output to cassette (on a Tomy cable, this is the red line) to your PC or Macintosh's audio in. You may or may not need the mono adapter but it won't hurt to use it. Using your audio program of choice, start recording; once your recording has begun, then type SAVE HELLO on the Tutor. (You might want to have your speaker volume turned down if you have play-thru enabled; it's quite ugly audio.) For this one-line example, the total recording time is around 20 or 30 seconds. When the Tomy prompt returns, wait a few seconds, and then stop the recording.

    The exact line level you should record at will depend on your hardware and sound chipset. On my quad G5, I had audio input all the way up to max in System Preferences; we don't need to worry about clipping at the top end since it's a pulse waveform, so I'd start there if you don't know.

  4. Save the audio file as a 44.1kHz uncompressed 16-bit mono AIFF file. (Windows users: do not save it as WAV!)

  5. First, let's extract the raw bitstream. At your command prompt type

    totapdec the_audio_file.aiff > output.txt

    A rare spurious warning is fine, but multiple errors indicate totapdec cannot properly decode the audio stream. Try recording it again. Make sure you save it in the correct format.

  6. Look at the bitstream in your text editor of choice. The sync marks at the beginning and end (big stream of 1s) should be obvious. If you don't see both sync marks, it decoded incorrectly.

  7. See if tobasdec, the BASIC decoder, can understand the bitstream:

    tobasdec output.txt

    You should see the filename HELLO and the lines of the BASIC program. (You can do the tape decoding and the BASIC decoding in one step in future: totapdec the_audio_file.aiff | tobasdec)

  8. Now let's record that bitstream back to an audio file:

    totapenc output.txt > the_new_audio_file.au

  9. Connect your Data Recorder to your computer's output (use the headphone or speaker port) with the 1/8" male-male cable, putting the 1/8" stereo-mono converter on the end so that the Data Recorder gets a mono signal, connecting to the Data Recorder's "IN" port, obviously. Using your audio program, load the_new_audio_file.au. Insert a cassette into the Data Recorder, press PLAY/RECORD and wait for the tape leader to pass by (the spool should start showing magnetic tape), then press play in your audio program. You should hear the tape data through the Data Recorder's internal speaker.

    Again, the exact volume level you should play back at will depend on your hardware and chipset, but on my G5 I simply maxed it out again because, as I mentioned above, clipping isn't generally a problem for this type of waveform.

  10. When the playback finishes, stop the tape and rewind it, connect the Data Recorder to your Tomy Tutor, and try to LOAD HELLO.

    If this worked, you've just validated XTOMYDEV on your system. Congratulations.

    If it didn't, but all the other steps did, try the last step again, re-recording at a different volume level.


Specific Tool Documentation

For specific documentation on an XTOMYDEV utility, select from these pages:

totapdec | totapenc | tobasdec | topicdec | togradec | tobitenc


Back to the main page