UEF/CSW support Atomulator

discussion of games, software, hardware & emulators relating to the Acorn Atom
User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

UEF/CSW support Atomulator

Post by oss003 » Thu Mar 03, 2016 7:32 pm

Hi guys,

In the Atomic Egghead topic, there was a discussion going on about the problems with tape support for Atomulator but I think it's better to start a new topic about this. In fact there are 3 tape formats readable by the Atom emulators: WAV, CSW and UEF files. Atomulator can read CSW and UEF files and the Atom emulator in MESS/MAME can read WAV files.

Until now converting ATM files looks like this:

Creating a WAV file:
- Load the ATM files into a real Atom
- Switch to tape support and save one or more ATM files
- Record the Atom cassette output to a mono 8-bits WAV file
- Or use ATM2WAV tool written by Charlie Robson but result is not 100% comparable with a real recorded WAV file

Creating a CSW file:
- Load the WAV file in CSW-viewer r38 tool written by Fraser Ross
- Convert it to a CSW file

Creating an UEF file:
- Convert the CSW file to an UEF file with the MAKEUEF v2.3 tool written by Fraser Ross

There are a lot of disadvantages using this method:
- Very time consuming operation with multiple- or big files, even if everything is working the first time
- Creating a CSW/UEF file is not reliable an the result is unpredictable
- UEF/CSW drivers in Atomulator are buggy and not following the protocols for 100%

So it would be nice to:
- have an ATM2WAV tool
- have an ATM2CSW tool
- have an ATM2UEF tool
- improving the UEF/CSW drivers for Atomulator

Thomas Harte offered his help but anyone else who wants to help is welcome. I know there is a lot done in the past for BBC tape emulation so maybe we can use some of these tools for the Atom.

Greetings
Kees

User avatar
sirmorris
Posts: 737
Joined: Wed Feb 11, 2009 12:18 pm
Location: oxfordshire uk
Contact:

Re: UEF/CSW support Atomulator

Post by sirmorris » Fri Mar 04, 2016 9:01 am

I made an atm2wav tool years ago. One sec.

<10 minutes pass>

Ah yes, there it is. I've made a repo in github.

https://github.com/charlierobson/atom-tools.git

These were built in visual studio but if i remember correctly I was careful to avoid ms specifics so these should be fairly portable.

C

User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by oss003 » Fri Mar 04, 2016 9:30 am

You do have a library with tools ..... that's interesting ..... =D>
Thanks.

Greetings
Kees

User avatar
sirmorris
Posts: 737
Joined: Wed Feb 11, 2009 12:18 pm
Location: oxfordshire uk
Contact:

Re: UEF/CSW support Atomulator

Post by sirmorris » Fri Mar 04, 2016 11:05 am

I wrote this when I got my first Atom. There was no fancy-pants MMC card business in those days... ;)

User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by oss003 » Fri Mar 04, 2016 11:41 am

That was in the past century ...... :lol: :lol:

User avatar
sirmorris
Posts: 737
Joined: Wed Feb 11, 2009 12:18 pm
Location: oxfordshire uk
Contact:

Re: UEF/CSW support Atomulator

Post by sirmorris » Fri Mar 04, 2016 1:37 pm

:shock:

ThomasHarte
Posts: 458
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Re: UEF/CSW support Atomulator

Post by ThomasHarte » Fri Mar 04, 2016 3:10 pm

To recap from elsewhere, https://github.com/TomHarte/UEFAppend should be able to append ATM and ATM-style TAP files to uncompressed* UEFs but has immediately revealed that Atomulator hangs indefinitely upon encountering an integer-measured gap.

I'm unclear why Atomulator is treating UEFs the way it does — attempting to parse them for files based on encoding assumptions — and not just using them as another wave source, exactly identical to CSW and WAV.

Otherwise: I notice that Sir Charlie Robson Morris' (?) atom-tools are outputting with a sine wave, BBC/Electron style. But the WAV provided on the other thread was definitely a square wave. Does the real hardware definitely use sine waves and not a Spectrum-style one-bit DAC? The ATOM technical manual refers to a frequency divider chain fed by an oscillator crystal so, yes, it'll be a sine. I guess the square waves comes from ATM -> CSW -> audio?

* because I didn't immediately fancy the zlib dependency; I'll make my peace with that and update. You can use gzip externally as a workaround for now.

User avatar
CMcDougall
Posts: 6058
Joined: Wed Feb 02, 2005 3:13 pm
Location: Shadow in a Valley of Scotland
Contact:

Re: UEF/CSW support Atomulator

Post by CMcDougall » Mon Mar 14, 2016 7:41 pm

just some notes from my 3hour quality Atom time \:D/ with tapes the other night, might be of some use....

1) when using FreeUEF to convert .UEFhq files back to .WAV, they do not load into the actual Atom played from PC earphone socket (vol91).
2) when using BackToLife to convert .CSW files back to .WAV, they do load into the actual Atom played from PC earphone socket (vol91) :P
2b) .CSW files that do not load into Atomulator127, when converted back to .WAV do load into the Atom :shock:
ImageImageImage

ThomasHarte
Posts: 458
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Re: UEF/CSW support Atomulator

Post by ThomasHarte » Mon Mar 14, 2016 7:45 pm

CMcDougall wrote:just some notes from my 3hour quality Atom time \:D/ with tapes the other night, might be of some use....

1) when using FreeUEF to convert .UEFhq files back to .WAV, they do not load into the actual Atom played from PC earphone socket (vol91).
2) when using BackToLife to convert .CSW files back to .WAV, they do load into the actual Atom played from PC earphone socket (vol91) :P
2b) .CSW files that do not load into Atomulator127, when converted back to .WAV do load into the Atom :shock:
Follow-up question: does this result hold true of the UEF I posted above? Does the Atom give any indication as to the problem? If it were a BBC/Electron then e.g. if you *CAT and get filenames but data errors then you know the general structure is sound enough for headers to be parsed but something is amiss in the data — does an Atom provide, implicitly or not, a distinction between finding something and finding nothing?

User avatar
CMcDougall
Posts: 6058
Joined: Wed Feb 02, 2005 3:13 pm
Location: Shadow in a Valley of Scotland
Contact:

Re: UEF/CSW support Atomulator

Post by CMcDougall » Mon Mar 14, 2016 8:06 pm

ThomasHarte wrote:does this result hold true of the UEF I posted above?
I don't see a .UEFhq file anywhere :?
I only deal (and swear alot :lol: ) at original /copied MIA tapes and convert them to .WAV then .CSW then .UEFhq :-x
ImageImageImage

ThomasHarte
Posts: 458
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Re: UEF/CSW support Atomulator

Post by ThomasHarte » Mon Mar 14, 2016 8:11 pm

Sorry! Forgot about the thread change! It's here: download/file.php?id=21340.

I guess I'll focus on the CSW versus UEF results of existing titles though — can you name any one title that worked as CSW but not as UEF? It's probably most likely that FreeUEF isn't handling something correctly rather than the UEF file being at fault; which version did you use?

I'm otherwise still poking around the emulation topic, having previously had no specific Atom knowledge.

User avatar
CMcDougall
Posts: 6058
Joined: Wed Feb 02, 2005 3:13 pm
Location: Shadow in a Valley of Scotland
Contact:

Re: UEF/CSW support Atomulator

Post by CMcDougall » Mon Mar 14, 2016 8:20 pm

^just using the ones I made 3+yr ago here:
viewtopic.php?f=44&t=10601#p129106
MakeUEF version that made those is still V2.3, so as you say maybe FreeUEF just can't handle Atom 300 baud correctly.....
ImageImageImage

ThomasHarte
Posts: 458
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Re: UEF/CSW support Atomulator

Post by ThomasHarte » Mon Mar 14, 2016 10:39 pm

CMcDougall wrote:^just using the ones I made 3+yr ago here:
viewtopic.php?f=44&t=10601#p129106
MakeUEF version that made those is still V2.3, so as you say maybe FreeUEF just can't handle Atom 300 baud correctly.....
A quick way to guess would be: are the FreeUEF files significant shorter than the CSW versions? Otherwise, I'll see what I can do about producing a definitely correct rendering of audio output from a UEF and compare it to the CSW.

User avatar
hoglet
Posts: 7117
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: UEF/CSW support Atomulator

Post by hoglet » Thu Feb 15, 2018 3:22 pm

Continuing discussion from Kamikazi Thread.

I'd be interested in finding out why the machine generated WAV files don't catalog correctly.

FYI, my ATMtoWAV conversion program is basically a Java port of Charlie's atmtowav:
https://github.com/hoglet67/AtomSoftwar ... e.java#L14

It's possibly down to the lack of gaps.

Dave

User avatar
hoglet
Posts: 7117
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: UEF/CSW support Atomulator

Post by hoglet » Thu Feb 15, 2018 4:22 pm

hoglet wrote: It's possibly down to the lack of gaps.
Actually, it's because the length of the high tone between the block header and the block data is too long.

The high tone between the header and the data should be 0.5 seconds (1200 cycles of 2.4KHz) but it's actually 1.0 seconds (2400 cycles of 2.4KHz) with my program, and probably the same with atm2wav.

The Atom *CAT block detection code is at FB8E:
http://www.acornatom.nl/atom_handleidin ... m/f000.txt

If it sees a a high tone that lasts 4096 half-cycles (2048 cycles), it thinks this is the start of a new block.

The other difference seems to be gaps between the blocks, rather than high tone.

So the correct sequence is:
- 4.0 seconds of high tone
- block 0 header
- 0.5 seconds of high tone
- block 0 data
- 2.0 seconds of silence
- 2.0 seconds of high tone
- block 1 header
- 0.5 seconds of high tone
- block 1 data
- 2.0 seconds of silence
- 2.0 seconds of high tone
- block 2 header
- 0.5 seconds of high tone
- block 2 data
- 2.0 seconds of silence
- etc

I'll fix my program now...

Dave

User avatar
hoglet
Posts: 7117
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: UEF/CSW support Atomulator

Post by hoglet » Thu Feb 15, 2018 4:59 pm

Kees, Colin,

Here's is an updated WAV file with the fixes described above:
KAMIKAZE.zip
(145.11 KiB) Downloaded 13 times
You can see the silence now between blocks.
audacity.png
This *CATs correctly in my real Atom (which the old one didn't).

Can one of you regenerate the CSF/UEF files from this for testing in Atomulator please?

Dave
Last edited by hoglet on Thu Feb 15, 2018 5:02 pm, edited 2 times in total.

User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by oss003 » Thu Feb 15, 2018 5:00 pm

I think there are 2 problems:

- The CSW/UEF/WAV files
- CSW/UEF support in Atomulator

Catalog has always been a problem, sometimes it works and sometimes not. Sometimes after rewind.
Also Atomulator does crash sometimes after playing with CSW/UEF files.

It would be good to have utils to create perfect WAV's which can be converted to 100% working CSW/UEF files.

Greetings
Kees

User avatar
hoglet
Posts: 7117
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: UEF/CSW support Atomulator

Post by hoglet » Thu Feb 15, 2018 5:01 pm

Bump, in case Kees missed my post above....

User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by oss003 » Thu Feb 15, 2018 5:03 pm

There are 1200 baud drivers like FCOS with shortened gaps.

Greetings
Kees

User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by oss003 » Thu Feb 15, 2018 5:12 pm

I had to convert the WAV to an 8 bit mono file.
Creating a CSW file works perfect but I'm getting an error when I want to create an UEF file ......

Greetings
Kees
Attachments
KAMIKAZE-mono.zip
(9.66 KiB) Downloaded 10 times

User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by oss003 » Thu Feb 15, 2018 5:14 pm

This is the error in MAKEUEF
Attachments
makeuef.png

User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by oss003 » Thu Feb 15, 2018 5:16 pm

And it still produces the double headers in *CAT
Attachments
csw2.png

User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by oss003 » Thu Feb 15, 2018 5:17 pm

And the CSW file still produces the double headers in *CAT
Attachments
csw2.png
Last edited by oss003 on Thu Feb 15, 2018 5:19 pm, edited 1 time in total.

User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by oss003 » Thu Feb 15, 2018 5:20 pm

Hmmm ...... all my posts are displayed twice ...... strange

User avatar
hoglet
Posts: 7117
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: UEF/CSW support Atomulator

Post by hoglet » Thu Feb 15, 2018 5:31 pm

oss003 wrote:And the CSW file still produces the double headers in *CAT
Hmmmm, it doesn't for me :shock:
kam1.png
Did you load the right file?

User avatar
CMcDougall
Posts: 6058
Joined: Wed Feb 02, 2005 3:13 pm
Location: Shadow in a Valley of Scotland
Contact:

Re: UEF/CSW support Atomulator

Post by CMcDougall » Thu Feb 15, 2018 5:43 pm

oss003 wrote:...... all my posts are displayed twice .....
three times in the Kamikaze thread :shock:

Not had a go at this yet , as was eating Pizza :P

I also could not make a UEFhq from the ATMs, even after converting it two times to get a standard WAV :o
ImageImageImage

User avatar
oss003
Posts: 2733
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by oss003 » Thu Feb 15, 2018 5:48 pm

Atomulator v1.28 .... I'm using v1.27 .... :-k

User avatar
vanekp
Posts: 539
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by vanekp » Thu Feb 15, 2018 5:49 pm

Created my own csw but don't see or get double headers.
And got the same error when trying to make a uef from it.
Atom.png
O and did not know 1.28 existed. also on the official site i see 1.27 http://acornatom.co.uk/

User avatar
hoglet
Posts: 7117
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: UEF/CSW support Atomulator

Post by hoglet » Thu Feb 15, 2018 5:56 pm

vanekp wrote: O and did not know 1.28 existed. also on the official site i see 1.27 http://acornatom.co.uk/
It doesn't exist!

(I was just messing with some stuff and incremented the version number so I didn't get confused)

User avatar
vanekp
Posts: 539
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: UEF/CSW support Atomulator

Post by vanekp » Thu Feb 15, 2018 5:56 pm

:lol: okay

Post Reply