Page 1 of 1

[Patch] IBM 5150 cassette loading

Posted: Sat 13 Apr, 2019 11:11 am
by JohnElliott
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)

Re: [Patch] IBM 5150 cassette loading

Posted: Sat 13 Apr, 2019 2:26 pm
by omarsis81
Interesting!
Do you think you could add the save function in a future?

Re: [Patch] IBM 5150 cassette loading

Posted: Sat 13 Apr, 2019 9:13 pm
by JohnElliott
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.

Re: [Patch] IBM 5150 cassette loading

Posted: Wed 17 Apr, 2019 7:38 pm
by SarahWalker
Committed at rev 1220. I also added it to the PCjr at rev 1221, as that uses the same cassette hardware.