Page 1 of 1

raw binary to DECB ...

Posted: Fri Oct 16, 2015 4:28 pm
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

Re: raw binary to DECB ...

Posted: Fri Oct 16, 2015 7:06 pm
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

Re: raw binary to DECB ...

Posted: Fri Oct 16, 2015 7:42 pm
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

Re: raw binary to DECB ...

Posted: Thu Oct 22, 2015 5:58 pm
by tjewell
Oh, just to let you know Pere, that worked perfectly! Thanks!

Re: raw binary to DECB ...

Posted: Thu Oct 22, 2015 9:25 pm
by pser1
glad to know,
you are welcome!

cheers
pere

Re: raw binary to DECB ...

Posted: Sat Oct 24, 2015 2:57 pm
by tormod
The best reference for these things are Graham's files at http://dragon32.info/info/