Page 4 of 4

Re: Utility for converting a binary file to a .CAS file

Posted: Tue Dec 10, 2013 1:17 pm
by zephyr
robcfg wrote: I'll be adding Tormod's patch and endian support to the next version.
Will you also be adding a cas to bin function, as suggested by KenH and Rink?

Re: Utility for converting a binary file to a .CAS file

Posted: Tue Dec 10, 2013 2:51 pm
by robcfg
Yep, sure.

I have sort of a hack, on a utility I have to check the block's crcs, that extracts the binary files to disk. So I can clean a bit and add it to the program.

I think that, most probably, I'll have it before the end of the week or earlier next week. Quite busy lately... :D

Re: Utility for converting a binary file to a .CAS file

Posted: Tue Dec 10, 2013 9:27 pm
by Rink
You're a good'un Rob.

Re: Utility for converting a binary file to a .CAS file

Posted: Wed Dec 11, 2013 9:02 am
by KenH
robcfg wrote:Yep, sure.

I have sort of a hack, on a utility I have to check the block's crcs, that extracts the binary files to disk. So I can clean a bit and add it to the program.

I think that, most probably, I'll have it before the end of the week or earlier next week. Quite busy lately... :D
Great, thanks.
Would be nice to have an option to convert to either a DragonDos binary or a CoCo DECB binary (useful also for the Dragon with HDBDOS / Drivewire).

Re: Utility for converting a binary file to a .CAS file

Posted: Wed Dec 11, 2013 11:07 am
by robcfg
Could you explain the diferences between the binary formats?

As far as I know, the .cas files are the same for both machines and what changes is the data you insert there. I mean, if you take a coco binary and run my tool on it, you'll get a .cas file for the CoCo, same way for the dragon.

In case you're extracting the file, there wouldn't be also any difference. You run the tool on a CoCo .cas file, and get your CoCo binary, and if you do it on a Dragon .cas file, you'll get a dragon binary file.

If you'd like to convert the binary files from one format to another on the fly, it's doable, yes, but I think it would fall out of the tool's intended scope.

Anyway, I'd like to hear more about it and see if we can find a nice solution.

Regards,
Rob

@Rink: Thanks mate! You people really make worth the time coding this kind of tools ;)

Re: Utility for converting a binary file to a .CAS file

Posted: Wed Dec 11, 2013 2:26 pm
by KenH
The difference between DragonDos and DECB binaries is in the preamble/postamble (which are similar to the namefile block in CAS files)

DragonDos binary files have a 9 byte header of the following format:

Code: Select all

Offset     Value
0x00       0x55
0x01       Filetype
0x02:0x03  Load Address
0x04:0x05  Length
0x06:0x07  Exec Address
0x08       $AA
0x09-      Data

Filetype is
0x01    BAS
0x02    BIN
CoCo DECB binaries have a 5 byte preamble and a 5 byte postamble.

Code: Select all

Header:
0x00:         0x00
0x01 : 0x02	length in bytes of following data
0x03 : 0x04	load address of data

Tail:
0x00:         0xff
0x01 : 0x02	0x0000	 
0x03 : 0x04	EXEC address

Non-Segmented files consist of
	[header] [data] [tail]
Source: http://dragon32.info/info/

Re: Utility for converting a binary file to a .CAS file

Posted: Wed Dec 11, 2013 7:52 pm
by tormod
KenH wrote:Would be nice to have an option to convert to either a DragonDos binary or a CoCo DECB binary
I wrote tools for DragonDos <-> DECB binary files conversion some months ago. Will find them and post in a new thread. Also wrote something that parsed CAS files and made DECB files out of them - for DLOAD of course :)