I have posted some of my old programs to the Color Computer Archive site:
One I found interesting to revisit was my TIDY DISK program. I created it in 1988, and it appears I revised it two more times since there is a version 1.2 from 1990. (Unfortunately, I did not update the title screen so it still reads 1.1):
This program, written in BASIC, was designed to scan a floppy disk and erase any unallocated space. Much like how one can “undelete” files on a modern PC and see what was there, the same thing was possible with the old Disk BASIC disk format in the 1980s. However, privacy was not even something I was considering when I created the program.
At the time, I had a modem and was using it all the time to call in to Bulletin Board Systems (BBS). There were many places where you could download CoCo software, including pirated software. There were also disk transfer programs that could be used to send an entire disk from one user to another.
I do not recall the name of the program I used, but it was smart enough to not send “empty” data. If a granule (the CoCo disk was divided in to 68 sections called granules) was empty, the program would skip sending it. Unfortunately, if you had a disk that previously had data on that granule (from a file that was since deleted), it would send all that old “deleted” data as well. This made the transfer much longer than it needed to be.
(And believe me, sending a full disk of 156K over a 300 or 1200 baud modem seemed to take “days” back then… At least it felt like it.)
I created TIDY DISK to solve this problem.
The program was written for a CoCo 3, and it errors out on a CoCo 1 or 2. This is because I do a PEEK on startup to check for screen width. If the CoCo 3 is not in 32-column mode, I do a “WIDTH 32” command to switch back. That PEEK does not work on a CoCo 1 or 2, and thus it tries to run the non-existent “WIDTH” command and errors out. Removing that check (or doing a manual POKE 231,0 before running) allows it to run on a CoCo 1 or 2.
To understand what it does, I built in HELP screens.
The “pop up” windows I used was a BASIC routine I wrote, and I also posted that routine to the Color Computer Archive site.
When the user selected a drive, they were asked to make sure they really meant to do that:
If they answered Yes, it would begin by first reading in the allocation table information:
This was basically a table that showed which of the 68 granules were in use. This would be a real good time to explain how the Disk BASIC disk format worked, but I think I’ll save that for a standalone article. (Mostly because I do not remember. I’m not even sure how I figured this out back then!)
The process would then scan all 68 granules of the disk and write blank data to any that was not marked as allocated. This would take some time…
When complete, the program would stop. It would literally STOP, saying “BREAK IN 55”. I ended the program with the STOP command. I can’t imagine I used that command very often, and was surprised I even used it there versus “END” which would just end cleanly.
One modern use for this program would be for disk images. If you have a disk image you want to ZIP and share, ZIP will compress all the data. If there are many sectors with deleted information, that will get ZIPped right along with the actual data you want to share. Not only does it make the file larger, but someone could use a disk editor and look at all the formerly “deleted” data.
Running this on a disk image before zipping it up might still have some use.
TIDY TIDK 1.3?
If I were to update this program, here are some things I would change:
- I would certainly fix the version number in the title screen.
- I’d also fix it to correctly work on a CoCo 1/2.
- I’d make it accept drives from 0-255, so it would work on RGB-DOS/HDB-DOS.
- And I’d remove that STOP, and just have a real Quit option so the user could keep doing disks without needing to re-RUN the program each time.
Maybe some day…
But until then…