Friday 21 March 2014

Project Update

Full Single/Double Density Support

I am now able to read double-density and mixed density disks including copy-protected disks. The DMA rate has been bumped to 10.417 MHZ. Due to quirks with the Raspberry Pi SPI interface I have to read tracks in three passes. Each pass grabs approximately 50% of the track and each pass is offset by 1/3 of the disk rotation. Each pass is decoded and then the three passes are stitched together to form a final track. It makes reading disks a little bit slower but still acceptable.

The increased DMA speed gives me a resolution of approximately 100 nanoseconds which makes decoding double density possible as well as supporting a newer TEAC drive that outputs very short disk data pulses - 0.25 microseconds versus 1 microsecond for an original TRS-80 drive.

Attack Force and Defense Command from Big Five software are two mixed format disks I have successfully converted to DMK format. They are good examples of unusual formatting as several of the tracks have a mixture of single and double density sectors and some of the sectors are unusual sizes. I was also able to read a Model III Scripsit disk and run it from an emulator.

Write Support

I am also able to write DMK files to a floppy disk from the device itself. Each track is written in a single pass from index pulse to index pulse. The resulting disks can be used to boot my Model I. I do not yet have double-density or mixed density support since my Model I lacks a double-density adapter so I would only be able to verify a double density disk by reading it back from the Raspberry Pi. I intend to build a double density board for my Model I using existing schematics I have found on the web.

Sunday 16 March 2014

DMK File Viewer/Editor

My Raspberry Pi system converts TRS-80 floppy disks to DMK files. One of the challenges of working with DMK files is ensuring that they are workable and comparing them to existing samples from other systems. In order to help with this work I wrote a small DMK file editor/viewer which is also able to compare two different DMK files.

This viewer works on tracks and sectors only and does not deal with file name or directories. It has several unique features that I have not found on existing software.

It handles mixed density disks and displays both single-density and double-density sectors, even if they have the same sector numbers.

It displays the CRC for each sector and indicates whether the CRC is bad or not. If you edit a sector the CRC is automatically updated (and corrected). Of course you have to know what you are doing when modifying disk sectors, especially when they contain program files.

You can compare DMK files sector by sector and the software steps through the differences between each sector. Sector data is displayed as both hexadecimal and ASCII format. You can edit using either hexadecimal or ASCII input, though hexadecimal is recommended for non-ASCII files.

DMK Viewer/Editor
The screenshot above shows two DMK files being compared. One from http://trs-80.com/ and one that I created myself using my Raspberry Pi interface board. In this sector the difference is in the serial number which was written to each disk.

The installer can be downloaded here from my Dropbox public folder. Or, if you don't want to install, download this zipfile containing the program and a support dll.

Update: version 1.01 now includes clipboard support for binary copy and paste (sector editor only) and F7 and F8 to move through all sector differences. Note that if there is a sector or track in the right hand view (the file being compared) that isn't in the left hand view (the main view) it won't be displayed.

defensePiFixed.dmk  is a DMK file created using a Raspberry Pi. The original DMK file had two data CRC errors but I was able to fix them using the editor and copying from single-density sectors to the corresponding double-density sectors. The disk is Defense Command which is available on the www.trs-80.com software archive.

Please note that the editor is written in C# and requires the .NET framework 3.5.

Tuesday 11 March 2014

Board Giveaway

I have built another PCB with improved layout and a debug pin for the logic analyzer so I am giving away my first working prototype PCB to the person who makes the best submissions. I'm looking for someone who has both a Raspberry Pi and a TRS-80 and is capable and interested in moving the project forward. Note: this is the board to read  and convert TRS-80 floppy disks to DMK format, not the floppy drive emulator.

With this board, a Raspberry Pi and a TRS-80 floppy disk drive you can rip TRS-80 floppy disks to .dmk files. Works very well with single density disks including many copy-protected disks. Double-density is a work in progress. Works fairly well for non copy-protected disks with verify enabled.

Please email submissions to me at alan.page.ca (@) gmail.com. Photos of your Pi and/or TRS-80 are encouraged. Submissions may be published on this blog, but with email addresses removed. Please indicate if there is any part of your submission you don't want published.
Prototype PCB Board
The successful applicant will receive the prototype board shown here and I will pay shipping (cheapest ground rate).

If there is sufficient interest I am willing to build a few more boards and sell them at the cost of materials plus shipping.

Current Status

DMA is working well at 5 MHZ. It is very reliable with FM decoding, marginal for MFM decoding. This appears to be the limit for getting a full track in a continuous chain of DMA blocks. For some unknown reason the DMA chain stalls out at around 128K. I can extend it by clearing the output FIFO but then there is a one microsecond gap which could cause data loss. Faster DMA speeds could be achieved by using multiple overlapping operations. For example, two 8 MHZ request chains covering 2/3 of a revolution each. I would then need to splice the two blocks together on a suitable boundary.

ZIP file of current PCB schematic/layout for KiCad
ZIP file of current source code.