Utility for converting a binary file to a .CAS file

Hardware Hacking, Programming and Game Solutions/Cheats
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

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

Post 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?
User avatar
robcfg
Posts: 1531
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

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

Post 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
Rink
Posts: 236
Joined: Mon Sep 05, 2011 7:01 pm

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

Post by Rink »

You're a good'un Rob.
KenH
Posts: 182
Joined: Fri Oct 12, 2012 9:50 am

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

Post 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).
User avatar
robcfg
Posts: 1531
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

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

Post 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 ;)
KenH
Posts: 182
Joined: Fri Oct 12, 2012 9:50 am

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

Post 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/
User avatar
tormod
Posts: 416
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland
Contact:

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

Post 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 :)
Post Reply