Cassette tape based file options?

Discussion about other targets
stefano
Well known member
Posts: 1856
Joined: Mon Jul 16, 2007 7:39 pm

Re: Cassette tape based file options?

Post by stefano »

Forget BASICODE. That was for BASIC only.
Many targets, ideally all those which in our wiki are declared capable of 1bit sound output can now save in MSX BLOAD and ZX LOAD "" CODE formats (they still can't load, only a subset was tested, etc..).

The TAPE library is another story, the functions differ slightly between the targets, I did my best to provide the same syntax for tape_save_block() and tape_load_block(). They're very minimal (no file name, just a single byte to discriminate the "block types") and probably used only in adv_a.c at the moment. In this case the tape format is target specific, but a certain number of target share the ZX Spectrum style modulation (Jupiter ACE, TS2068, Spectrum). Soon It will also be the case of the Mattel Aquarius, because its original routines were crap ;)
Screenshot_20221015-161941_Gallery.jpg
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 1856
Joined: Mon Jul 16, 2007 7:39 pm

Re: Cassette tape based file options?

Post by stefano »

I try to list the targets able to SAVE and LOAD back data (mostly in a native format )

Aquarius (soon)
ZX80
ZX81
Spectrum (and ZX Next)
J.ACE
TS2068
Enterprise
MSX
Sharp MZ
S-OS (tape version)..

S-OS is a sort of simple operating system invented in Japan to provide a common platform to run text only machine code programs on z80 computers. The ideal program for such platform was a text adventure game, so the simpler version was baptized "Mace", the disk capable one: "Sword".
S-OS can be run on a certain number of different computer models, so I can't predict the results easily.

The ZX81 and Aquarius had a bad cassette modulation format, so I decided to provide an alternative one. The ZX81 now has a fairly powerful encoding system, it is able to auto tune the loading speed depending on the way the data block was saved. I think that MSX does the same, in a different way.
stefano
Well known member
Posts: 1856
Joined: Mon Jul 16, 2007 7:39 pm

Re: Cassette tape based file options?

Post by stefano »

I set up a generic variant of the loader, to have both bit_load_block_zx and bit_save_block_zx.
I checked it on the ZX Spectrum, probably it is pointless but now it is possible to load and save data without the border effects 😋
It should work also on the Mattel Aquarius but the MSX version, even if catches the leading tone and the sync key, seems to get wrong data.
stefano
Well known member
Posts: 1856
Joined: Mon Jul 16, 2007 7:39 pm

Re: Cassette tape based file options?

Post by stefano »

+Sorcerer Exidy, I got the trick on how invoke the MONITOR from an ancient 1982 library for the BDS C.
Time to add the credits and pull the code in.
exidy_adva.png
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 1856
Joined: Mon Jul 16, 2007 7:39 pm

Re: Cassette tape based file options?

Post by stefano »

I think @pjshumphreys and @Wysardry will like this one.
bit_load_block_zx() will READ the data from a ZX Spectrum tape on a Sharp MZ machine.

It first probes the MONITOR to understand if it is an MZ700 or MZ800 model (thus, 3,5 Mhz) or it is on an older 2Mhz model, then it does auto tuning.
If you are a lucky bastard and have the MZ800, you'll even see the border stripes while loading :D
mz800_zxhdr.png
mz800_zxdata.png

EDIT: the "pull" includes a custom routine to drive the tape motor silently, unlike the standard MONITOR, which prompts the user.
You do not have the required permissions to view the files attached to this post.
pjshumphreys
Member
Posts: 56
Joined: Sat Feb 06, 2021 2:32 pm

Re: Cassette tape based file options?

Post by pjshumphreys »

You're right. I do really like that :)
stefano
Well known member
Posts: 1856
Joined: Mon Jul 16, 2007 7:39 pm

Re: Cassette tape based file options?

Post by stefano »

Thank you :)
I'm adding the SAVE option, same syntax.
On many targets it was already available by the generic version based on the 1bit the sound output, but here we have different CPU speeds, different audio hardware and the tape motor commands to deal with.
The resulting code is not as clean as the LOAD part but it worked with the tests I could do on the emulators.

A check on the real hardware would be really appreciated.
Post Reply