Relocatable Quick-Tape installer for the Sharp PC-1500
Saturday, 26th April 2025
After my previous journal post about faster saving and loading of Sharp PC-1500 programs to and from tape I discovered that I was using a somewhat out-of-date version of Sharp Pocket Tools. The later version I upgraded to adds support for the "SuperTape" and "Quick-Tape" formats, and also includes copies of the PC-1500 programs for those formats.
Both formats appear to support file names and verification of the recorded data (a minor gripe I had with the Fast Load was its lack of these features). SuperTape apparently manages even higher speeds, though at the cost of somewhat more RAM than Fast Load (711 bytes, or 761 for the full version with the ability to merge a program with the existing one in memory, instead of Fast Load's 540 bytes). Quick-Tape seems to be about the same speed as Fast Load, but actually consumes less memory overall (only 508 bytes). Quick-Tape also explicitly supports saving machine language programs by specifying a start and end address, something that I cannot see is supported with the SuperTape format, though it looks like it might support loading machine language programs if the correct load address is stored in the file.
Based on my experiences with Fast Load and the documentation that accompanies SuperTape and Quick-Tape I came up with a rough feature comparison table (I can't claim it's completely accurate, as it's based on what I've gleaned from the documentation):
Format | Fast Load | SuperTape | Quick-Tape |
---|---|---|---|
Speed | Fast | Fastest | Fast |
Filenames | ✗ | ✓ | ✓ |
Verification | ✗ | ✓ | ✓ |
Machine language | ✗ | (Maybe?) | ✓ |
Variables | ✓ | ✗ | ✗ |
RAM usage (bytes) | 540 | 711–761 | 508 |
Relocatable | ✓ | (Partial) | ✗ |
To get a rough idea of speed I tried converting the Globe application to a wave file. Both Fast Load and Quick-Tape produce a file that's 30 seconds long — a huge improvement over the seven minutes that the native cassette routines take. SuperTape still manages to blow both of these out of the water with a file that's only 13 seconds long! Only Fast Load seems to have the ability to save BASIC's variables to tape, though this is not a feature I personally have any use for.
The ability to relocate the machine language routines that make up the tape routines is a very important one, however! The available range of memory addresses in a PC-1500 computer will depend on which memory expansion module is installed and whether any other machine language routines are also loaded. Fast Load can be relocated to anywhere you want in memory via its BASIC installer program. SuperTape has a few different versions for different starting addresses based on certain memory modules as well as a BASIC installer, however as far as I can see it doesn't seem to allow being loaded at an arbitrary address which would make it trickier for it to coexist alongside other machine language programs on the computer. Quick-Tape doesn't have any relocation support at all, only working if loaded to address &00C5 and used with the CE-161 memory expansion module.
However, Quick-Tape seems like it would otherwise be ideal — it consumes the last RAM, it seems the most feature-complete and though it's not quite as fast as SuperTape it's still a massive improvement over the native cassette routines.
I therefore decided I'd try to make a relocatable version of Quick-Tape. To assist with this I first disassembled it using lhTools. It doesn't load any data nor jump to any absolute addresses within its own memory space, which is a good start — in fact, it only calls three subroutines inside itself: &01BE, &01BF and &01CF. You can spot these easily in the disassembled code as they are assigned named labels by lhTools instead of absolute addresses, for example in this snippet:
lbl_0_159: SJP lbl_0_1be ; labelled address inside our memory ADR Y LOP lbl_0_159 LDA YH SJP lbl_0_1bf ; labelled address inside our memory LDA YL SJP lbl_0_1bf ; labelled address inside our memory
...as opposed to:
lbl_0_117: SJP BBD6 ; absolute address outside our memory VMJ 0A SJP BBC0 ; another absolute address outside our memory
The version of lhTools I'm using is one I've modified to use the standard LH5801 instruction mnemonics instead of the Z80-inspired ones it normally uses; it also disassembles vectored subroutine calls into standard VMJ instructions instead of the lhTools pseudo-instructions, though as I haven't got it to re-assembled these instructions properly yet this is not something I'm able to share just yet. However, the important thing here is the subroutine called with the SJP instruction.
Now that we know where these subroutine calls are, a BASIC program can be written that patches the loaded machine language program with the correct target addresses for where it's been relocated to. Similarly, the reserve program (which contains BASIC CALL statements to call the entry points in the machine language program) needs to have its addresses patched to point at the relocated machine language program. The resulting installer looks like this:
10 M=PEEK &7863*256+197:B=PEEK &7865*256+PEEK &7866 20 IF B-M<508 PRINT "No room": END 30 L=M: IF B-M>508 WAIT 0: PRINT "Load @";L;" ";: INPUT L 40 CLS : WAIT : IF (L<M) OR (L+508>B) PRINT "Bad address": GOTO 10 50 WAIT 0: PRINT "Play QUICK-TAPE...": CLOAD M"QUICK-TAPE";L 60 FOR I=1 TO 3: READ A,C: FOR J=1 TO C 70 READ O: POKE O+L,(A+L)/256,(A+L) AND 255 80 NEXT J: NEXT I 90 DATA 249,1,149,250,2,157,161,266,3,411,443,452 100 M=M-197: PRINT "Play QUICK-RESERVE...": CLOAD M"QUICK-RESERVE";M 110 FOR I=1 TO 6: READ A,O:A$=RIGHT$("00"+STR$ (A+L),5) 120 FOR J=1 TO 5: POKE M+O+J,ASC MID$(A$,J,1): NEXT J: NEXT I 130 DATA 4,89,6,101,5,113,2,130,1,153,0,165 140 CLEAR :Z$="": WAIT : PRINT "QUICK-TAPE installed"
You can download the installer and reserve program as ready-to-go WAV files in Quick-Tape-Install.zip. You'll also need to create a WAV file for Quick-Tape itself, which can be downloaded as part of Pocket Tools. Instructions can be found inside the installer zip archive.
Subscribe to an RSS feed that only contains items with the SuperTape tag.