Previous Thread
Next Thread
Print Thread
Page 1 of 3 1 2 3
Coleco Adam cassette format research #78359
03/31/12 09:25 PM
03/31/12 09:25 PM
Joined: Jun 2011
Posts: 74
H
Huygens Offline OP
Member
Huygens  Offline OP
Member
H
Joined: Jun 2011
Posts: 74
Since the peripheral dumps made raw data pack wav files necessary for cassette support I got an Adam data cassette and have been trying to figure out the format.

Physical form factor:
The cassette has two extra alignment holes that only allow the cassette can only go into the drive one way.
The drive holes in a different position from a standard audio cassette. Reading it in a cassette player requires moving the tape to a standard case or drilling a couple of holes.
The tape has two data tracks. Reading the second can be done by flipping the tape over and then reversing the recorded audio.

Data (if anybody's interested in an odd tape format):
Quote:

A zero is encoded as a two flux transitions at a lower frequency (half a cycle).
A one is encoded as three flux transitions at about double the frequency (one full cycle).
I'm not sure about the timing yet as the playback speed on a tape player is so different from the original drive. (1 7/8ips vs 20ips!)

The beginning of each track is padded with 2752 leading zeros.

Example headers:
16 48 45 00 00 ff ff 00 80 f4 (first block)
16 48 45 00 01 ff fe 00 80 f4 (second block)

Data block format:
Header: 16 48 45 00 (block counter) ff (ff - block counter) 00 80 f4
00 (21 of them)
16
1k data
00 (21)
16
data checksum-16 (sum of all data bytes)
aa (922)
00 00

ddp to wav: (Offsets given are for the .ddp file)
track a:
0x20000-0x3ffff
0x3f400-0x3ffff (last three data blocks repeat)

track b:
0x10000-0x1ffff
0x00000-0x0ffff
0x0f400-0x0ffff (last three data blocks repeat)

The ddp vs track layout may not be universal, I'm basing this on the one tape I have decoded.

I'm going to try and write a little program to do the ddp to wav conversion and see if I can get the Adam tape support working.

Re: Coleco Adam cassette format research [Re: Huygens] #78360
03/31/12 10:06 PM
03/31/12 10:06 PM
Joined: Mar 2001
Posts: 16,058
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,058
USA
Cool! smile

Re: Coleco Adam cassette format research [Re: R. Belmont] #78369
04/01/12 07:55 AM
04/01/12 07:55 AM
Joined: Jun 2011
Posts: 74
H
Huygens Offline OP
Member
Huygens  Offline OP
Member
H
Joined: Jun 2011
Posts: 74
Thanks Belmont :-)

Also any instance of 0x0A is replaced with 0x0D 0x0A

Wrote a little program that will convert a ddp file to binary files (last step before FM encoding). I checked it against files decoded from a real tape and they're identical except for a couple bad bytes in the ddp (it appears to have been taken from a copy of the original data pack). I still need to get more tapes as there are apparently two different block layouts. This should work properly for ddp files with 'DIRECTORY' at offset 0x434 (most of them).

The program
'ddp_raw.exe tape.ddp' will spit out track_0.bin and track_1.bin files.

Now to see if I can figure out the MESS side...


Last edited by Huygens; 04/01/12 09:38 AM. Reason: updated download link
Re: Coleco Adam cassette format research [Re: Huygens] #78370
04/01/12 08:38 AM
04/01/12 08:38 AM
Joined: Jul 2007
Posts: 4,625
A
Anna Wu Offline
Very Senior Member
Anna Wu  Offline
Very Senior Member
A
Joined: Jul 2007
Posts: 4,625
Originally Posted By Huygens
Thanks Belmont :-)

Also any instance of 0x0A is replaced with 0x0D 0x0A

Wrote a little program that will convert a ddp file to binary files (last step before FM encoding). I checked it against files decoded from a real tape and they're identical except for a couple bad bytes in the ddp (it appears to have been taken from a copy of the original data pack). I still need to get more tapes as there are apparently two different block layouts. This should work properly for ddp files with 'DIRECTORY' at offset 0x434 (most of them).

The program
'ddp_raw.exe tape.ddp' will spit out track_0.bin and track_1.bin files.

Now to see if I can figure out the MESS side...




Nice smile

ddp_to_bin.exe, is this a valid Win32 PE file? I ask because I canīt execute the binary on WinXP 32-bit OS.

Re: Coleco Adam cassette format research [Re: Huygens] #78373
04/01/12 09:43 AM
04/01/12 09:43 AM
Joined: Jun 2011
Posts: 74
H
Huygens Offline OP
Member
Huygens  Offline OP
Member
H
Joined: Jun 2011
Posts: 74
Hmmm. Problems on my end I imagine. I compiled with the gcc that installed with MinGW-x64 on windows 7 x64. I fought with it a bit and got it to compile with regular MinGW gcc with the -m32 option. Hopefully it works now. The download link is updated.

Re: Coleco Adam cassette format research [Re: Huygens] #78374
04/01/12 10:01 AM
04/01/12 10:01 AM
Joined: Jul 2007
Posts: 4,625
A
Anna Wu Offline
Very Senior Member
Anna Wu  Offline
Very Senior Member
A
Joined: Jul 2007
Posts: 4,625
Originally Posted By Huygens
Hmmm. Problems on my end I imagine. I compiled with the gcc that installed with MinGW-x64 on windows 7 x64. I fought with it a bit and got it to compile with regular MinGW gcc with the -m32 option. Hopefully it works now. The download link is updated.


It works now, thanks. smile

Re: Coleco Adam cassette format research [Re: Huygens] #78378
04/01/12 12:33 PM
04/01/12 12:33 PM
Joined: Mar 2006
Posts: 1,026
PA, USA
L
Lord Nightmare Offline
Very Senior Member
Lord Nightmare  Offline
Very Senior Member
L
Joined: Mar 2006
Posts: 1,026
PA, USA
"Also any instance of 0x0A is replaced with 0x0D 0x0A"

You sure that isn't a problem on the decoder end? mingw and msvc will do that by default unless you open a file in wb mode instead of w mode...

LN


"When life gives you zombies... *CHA-CHIK!* ...you make zombie-ade!"
Re: Coleco Adam cassette format research [Re: Huygens] #78382
04/01/12 06:16 PM
04/01/12 06:16 PM
Joined: Jun 2011
Posts: 74
H
Huygens Offline OP
Member
Huygens  Offline OP
Member
H
Joined: Jun 2011
Posts: 74
Thanks! Yup, changed my wav decoder to use fopen(file.bin,"wb") and the 0xODs disappear. I'll update the code and download link. Good to know, I'll know something's up if I see that again.

Hmmm. I can only edit this last post. Any way to update the link above?

Anyway here's the corrected source / binary that doesn't add the 0x0Ds
file link

Last edited by Huygens; 04/01/12 06:47 PM.
Re: Coleco Adam cassette format research [Re: Huygens] #78500
04/12/12 12:33 AM
04/12/12 12:33 AM
Joined: Jun 2011
Posts: 74
H
Huygens Offline OP
Member
Huygens  Offline OP
Member
H
Joined: Jun 2011
Posts: 74
Well I've got loading from a wav file working (from a wav file recorder from a Data Pack).
I wrote some converter code to load .ddp format images into mess but it's not working yet due to a bug somewhere. It looks okay as long as I output a mono track, but specifying 2 channels results in corrupted output. Outputting a square wave to channel 0 with cassette_put_samples results in a wav file with noise in both channels.

Last edited by Huygens; 04/12/12 05:59 AM.
Re: Coleco Adam cassette format research [Re: Huygens] #78549
04/16/12 02:35 PM
04/16/12 02:35 PM
Joined: Mar 2001
Posts: 16,058
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,058
USA
Huygens' patch has been applied for ADAM tape emulation, by the way. He'll have to tell us what all it enables smile

Page 1 of 3 1 2 3

Who's Online Now
4 registered members (AntoPISA, Osso, 2 invisible), 23 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,600
Posts112,408
Members4,821
Most Online283
Oct 11th, 2018
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.027s Queries: 15 (0.009s) Memory: 5.7222 MB (Peak: 5.9429 MB) Zlib enabled. Server Time: 2018-11-21 12:42:37 UTC