[Patch] IBM 5150 cassette loading

Post Reply
User avatar
JohnElliott
Posts: 101
Joined: Sun 31 Jan, 2016 7:29 pm

[Patch] IBM 5150 cassette loading

Post by JohnElliott » Sat 13 Apr, 2019 11:11 am

This patch adds read-only support for the IBM 5150 cassette port.

I have used PZX as the underlying tape format, with .pzxi as a file extension to indicate it contains IBM rather than Spectrum cassette data. I did this because PZX is a reasonably straightforward file format, the IBM 5150 cassette encoding is very similar to the Spectrum one and there are existing toolchains that can generate and manipulate PZX files. For example, to generate a test file I was able to do this with taptools 1.1.1:

Code: Select all

%  cat > hello.bas
10 print "Hello"
20 goto 10

% unix2dos hello.bas
unix2dos: converting file hello.bas to DOS format...

% mkibmtap -a -fpzxi hello.pzxi hello.bas
Appended ASCII Listing: hello [58 bytes]
 
% ./pcem
 
(and then in IBM Cassette BASIC:)

Code: Select all

 The IBM Personal Computer Basic
 Version C1.10 Copyright IBM Corp 1981
 62940 Bytes free
 Ok
 LOAD "CAS1:"
 hello   .A Found.
 Ok
 LIST
 10 PRINT "Hello"
 20 GOTO 10
 Ok
 
Possible areas for improvement:
  • Unlike the real 5150, it doesn't echo the tape input to the speaker while loading
  • No save support, load only
  • No tape browser, so it isn't possible to wind to a particular block
  • Could do with flashloading support (catch the ROM calls to load / save a block, and parse them directly out of the tape file)
Attachments
cassette.patch
(25.83 KiB) Downloaded 91 times

User avatar
omarsis81
Posts: 720
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] IBM 5150 cassette loading

Post by omarsis81 » Sat 13 Apr, 2019 2:26 pm

Interesting!
Do you think you could add the save function in a future?

User avatar
JohnElliott
Posts: 101
Joined: Sun 31 Jan, 2016 7:29 pm

Re: [Patch] IBM 5150 cassette loading

Post by JohnElliott » Sat 13 Apr, 2019 9:13 pm

Possibly. I can think of a few approaches (at the simplest, do it like a flashloader and hook the ROM save routine). Whether it could be done in time for the v15 feature freeze is a different matter.

User avatar
SarahWalker
Site Admin
Posts: 1724
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] IBM 5150 cassette loading

Post by SarahWalker » Wed 17 Apr, 2019 7:38 pm

Committed at rev 1220. I also added it to the PCjr at rev 1221, as that uses the same cassette hardware.

Post Reply