Tape turbo-loader

discussion of beeb/electron applications, languages, utils and educational s/w
Post Reply
User avatar
Rich Talbot-Watkins
Posts: 1462
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Tape turbo-loader

Post by Rich Talbot-Watkins » Sat Jan 08, 2011 8:07 pm

Thought I'd open this up to a wider audience than over at RS.

This is basically a small plea for help. Inspired by this post from a little while ago, the other night, I set out to create a tape turboloader for the Beeb, using a custom tape format without interblock gaps, and decompressing LZ77 compressed data on-the-fly from the tape bitstream.

The results are attached, using the title screen from a Beeb game I'm working on as a test. There are two tape images - run both with

Code: Select all

*TAPE
*/
Turbo.uef is a demonstration of the turbo loader, loading a Mode 5 title screen in 30 seconds! Normal.uef uses the regular Acorn loading system, for comparison.

Here's where the cry for help comes in: I'd like to know whether real Beeb hardware will load the turbo file ok (as so far, I've only been able to test it on BeebEm and B-Em). Would anyone with the facilities be able to try this tape image on a real Beeb (maybe using Thomas Harte's FreeUEF to output an audio version of the UEF file)? Any results would be much appreciated.
Attachments
TapeTest.zip
(7.66 KiB) Downloaded 106 times

User avatar
MartinB
Posts: 5201
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: Tape turbo-loader

Post by MartinB » Sat Jan 08, 2011 9:35 pm

Hi Rich :wink:

In a currently rare moment of Beeb time, I'd already been playing with this over a couple of days but haven't had a lot of success I'm afraid. Firstly, I should say that I've never used freeuef (or the like) before and so have only just mastered loading direct from PC but think I've got that side working ok. I tried a few random uef sample tapes and got things set up and working including making audio equaliser adjustments until the set-up wasn't unduly sensitive to levels.

Now, with your images, I'm struggling - I started with the normal image to establish a baseline but even that is misbehaving. I didn't realise until eventually trying the turbo version that there is an initial file called loader because for some reason the Beeb (a Model B) just doesn't see it. Before I realised there was a loader file, I concluded (incorrectly of course) that I needed to pre-select Mode 5 after which the screen file loads perfectly but of course is overwritten at the top by the loading info and crashes at the end because it's not code.

When using the turbo file, the loader is seen, begins loading and gets to 01 0186 but it doesn't appear to execute such that a few seconds later there are (not surprisingly) bursts of ???? and Searching etc.

I think you're going to need a second opinion on this because I might well be doing something wrong :roll:

User avatar
dv8
Posts: 221
Joined: Mon Jun 22, 2009 9:07 pm
Contact:

Re: Tape turbo-loader

Post by dv8 » Sat Jan 08, 2011 11:46 pm

Rich,

Just tried this on my beeb and it's working perfectly.

As Martin discovered, there is a problem with the UEF files though. They seem to be missing the usual inter-block carrier tone at the start. It just launches straight into the first data block. The files work in BeebEm but a real beeb ignores that first block.

I got it working by converting the file to WAV, and copying a short section of carrier tone to the start of it.

User avatar
MartinB
Posts: 5201
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: Tape turbo-loader

Post by MartinB » Sun Jan 09, 2011 12:34 am

Paul wrote:As Martin discovered, there is a problem with the UEF files though.
Ah, but I wasn't brave enough to suggest that Rich's images were at fault :wink:

If you (Paul) or Rich want to post a fixed version I'm happy to be a sample of two and can also test it on a Master and an Elk (if it should work on the latter?)

User avatar
Rich Talbot-Watkins
Posts: 1462
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Tape turbo-loader

Post by Rich Talbot-Watkins » Sun Jan 09, 2011 12:57 am

Thanks guys for your help and feedback.

As you might've guessed, I had to generate the uef file with a tool I wrote (because I couldn't get BeebEm to output tape files in a custom format like this), but obviously I've done it a little bit wrong. I'll compare my files with some other uef files from the archive and see how they differ (it may just be that it requires an extra carrier tone section at the very start of the file; it may also be that my sections of carrier are not quite long enough for a real Beeb to synchronise with correctly).

I'll try and post a new version tomorrow and it'd be great if you could give it another go if you have time Martin :) If it works on a regular Beeb, it should be fine on a Master. It won't possibly work on an Electron as the loader code accesses the serial hardware directly (which is totally different on an Electron).

Cheers again!

User avatar
Rich Talbot-Watkins
Posts: 1462
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Tape turbo-loader

Post by Rich Talbot-Watkins » Sun Jan 09, 2011 1:01 am

@dv8: forget to mention, it's great to know though that, with the leader carrier tone in place, it all works fine - which was my main concern! Thanks again for going to the effort of constructing an audio file that would load ok - much appreciated!

Fraser
Posts: 551
Joined: Tue May 20, 2003 7:21 pm
Contact:

Re: Tape turbo-loader

Post by Fraser » Sun Jan 09, 2011 12:39 pm

There is a dummy byte in the leading tone of files which is necessary with all BBCs but not the Electron. You would be asking for trouble by not including it.

You could use the standard block format. You could assign say bit 1 of the block flag to indicate compressed data. The compressed data format can be identified from a header at the compressed data usually. I presume LZ77 has this?

User avatar
Rich Talbot-Watkins
Posts: 1462
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Tape turbo-loader

Post by Rich Talbot-Watkins » Sun Jan 09, 2011 2:05 pm

Yes, there's a UEF block type which is 'carrier tone with 0xAA dummy byte' which I use as the lead-in to all files (as I understand, it's to ensure the serial system is synchronised, following a change in transmission rate, otherwise received data can be lost).

There's no 'standard' LZ77 format - it's more an algorithm, which can be wrapped up in whatever way you wish. My implementation of it is very simple, but seems to yield pretty good compression ratios (the difficulty is always determining how to mark literal data versus reference data, and how to efficiently represent the length and offset of reference data).

I'm not personally interested in trying to mimic the standard Beeb tape loading (although given this first test, it would certainly be possible), but I might try making it use some very basic kind of block system for greater recoverability from errors. I think Gary Partis' custom tape loader for Starquake did something a bit like this.

Having compared my generated uef files to some in the archive, it seems to me that the only difference is that I haven't specified long enough sections of leader tone, particularly at the start. I reckon if I were to make these longer, they would load fine into a Beeb without modification.

Post Reply