raw binary to DECB ...

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
tjewell
Posts: 347
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

raw binary to DECB ...

Post by tjewell »

Hi - I've got some raw binary data I want to load into Xroar, so I'd like to convert into a DECB .bin file (so I can simply say xroar -load stuff.bin). I've scoured the archive, and I can find almost every other type of conversion tool but this one - I'm guessing it's as simple as adding a few bytes of header info at the start? But I'm struggling to find a spec. I would be ever so grateful if someone could point me in the right direction!

Many thanks in advance, Tony
pser1
Posts: 1672
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: raw binary to DECB ...

Post by pser1 »

Hi Tony,
it needs a 5 bytes header and a 5 bytes trailer at the end
The Header is:
- byte 0 -> always $00
- bytes 1-2 -> The Length of the file
- bytes 3-4 -> The Load address

And the trailer:
- byte 0 -> always $FF
- bytes 1-2 -> by now $0000 (maybe intended for Stack value before execution ...)
- bytes 3-4 -> execute address

cheers
pere
pser1
Posts: 1672
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: raw binary to DECB ...

Post by pser1 »

Hello Tony,
I wrote the header and trailer that are the CoCo standard.
XRoar loads them into a Dragon emulation with no problems.

But if you wanted to add the Dragon std Header (no trailer)
It has this structure:
Byte 0 -> always $55
byte 1 -> $02 for Binary files
bytes 2-3 - Load Address
bytes 4-5 - Length of file
bytes 6-7 - Execute Address
byte 8 -> always $AA

cheers
pere
tjewell
Posts: 347
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

Re: raw binary to DECB ...

Post by tjewell »

Oh, just to let you know Pere, that worked perfectly! Thanks!
pser1
Posts: 1672
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: raw binary to DECB ...

Post by pser1 »

glad to know,
you are welcome!

cheers
pere
User avatar
tormod
Posts: 416
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland
Contact:

Re: raw binary to DECB ...

Post by tormod »

The best reference for these things are Graham's files at http://dragon32.info/info/
Post Reply