Robbbert #1 Posted May 12, 2010 (edited) I see COF files, ABS files, JAG files, ROM files, PRG files and BIN files. Some have headers, some don't. The headers seem inconsistent as far as I can see. Is there an article somewhere that explains what the bytes in a header do? If not, can someone enlighten me - because I haven't got a clue! Thanks Edited May 12, 2010 by Robbbert Quote Share this post Link to post Share on other sites
ggn #2 Posted May 12, 2010 (edited) I wrote a few stuff in this thread. Take a look and if you have some more specific questions, don't hesitate to ask [EDIT] I'm surely not mentioning PRG files in that post, so let me add it here because I saw it recently: These are standard ST GEM program files that have a ST compatible header (starting with $601A). I'm not sure but I think some bjl uploaders can identify those, skip the header and upload them properly. Edited May 12, 2010 by ggn Quote Share this post Link to post Share on other sites
sh3-rg #3 Posted May 12, 2010 In that post, GGN mentions .JAG as probably being a .ROM file, there are lots of files of various types that have been renamed .JAG by some kind of file management tool or maybe even by hand. .JAG should be Jaguar Server, a homebrew file format, but as I said, it could really be anything so check the file sizes as GGN mentions for hints or see if ULS recognises it. Quote Share this post Link to post Share on other sites
Zerosquare #4 Posted May 12, 2010 (edited) You can also take a look at the C source of lo_inp, which is an updated version of Bastian Schick's original BJL uploader. It contains a routine which parses several kinds of headers. Just in case you missed it, I also posted a few ideas about file format detection here a while ago. Edited May 12, 2010 by Zerosquare 1 Quote Share this post Link to post Share on other sites
+TrekMD #5 Posted May 12, 2010 This is good to know. Quote Share this post Link to post Share on other sites
Robbbert #6 Posted May 13, 2010 (edited) Thanks to you all for the help. From what you've told me, would the following assumptions be correct? A "cart" (usually a .jag but should really be a .j64) loads at 0x800000, and the start address (usually 0x802000) is to be found at 0x800404. A .rom file is a cart minus the header, loads and runs at 0x802000. A .cof file starts with 01 50, and has a variable header length, located at +68, while the load and run address are listed at +56. A .prg file starts with 60 1A, has a variable header length determined by the "type" at +32, and the load and run address is at +34 Not sure about .abs file, need to read a bit more.. .bin file has no header, but usually loads and runs at 0x4000, although I've seen some that use 0x8000 or 0x10000. With no header it is difficult.. I even have a few .prg that are headerless which I've renamed to .bin Edited May 13, 2010 by Robbbert Quote Share this post Link to post Share on other sites
Robbbert #7 Posted May 13, 2010 Sorry for double post, edit button went missing. Seems ABS (some of them) may be a COF in disguise. Also, what is the format of a Jaguar Server (.jag) header? Quote Share this post Link to post Share on other sites
ggn #8 Posted May 13, 2010 Seems ABS (some of them) may be a COF in disguise. Yep, all the .abs files I've come across are coff files (virtual jaguar doesn't reckognise the .cof extension). Also, what is the format of a Jaguar Server (.jag) header? Well, the Jaguar server homepage has lots of info, but let me quote the relevant bit of text here just for completeness' sake. *-----------------------------------------------------------------* * Standard JagOS 3 Upload & Run parameters. * * ½ Roine 950420 * *-----------------------------------------------------------------* OUTPUT I:\*.JAG * Output standard Atari Executable. down EQU $5000 * Download address in Jaguar. start EQU $5000 * Program start address in Jaguar. OPT D- * No debugging info. dc.b 'JAGR' * Magic to skip Devpac Header. dc.w 3 * JagOS 3 - Receive & Run. dc.l down * Download address. dc.l c_end-c_start * Length of Jaguar Code. * A dc.l 0 are also possible. dc.l start * Start address. ORG start * If position dependent code. So, the header 'JAGR', a 0003, download address in a longword, length of program in longword and start address in longword. Note that while writing the ULS GUI I came across some v2 Jag Server files, so instead of that '0003' you might get a '0002'. 1 Quote Share this post Link to post Share on other sites
Zerosquare #9 Posted May 13, 2010 I wouldn't rely on the file extension at all if I were you, as there are too many mislabeled files. Quote Share this post Link to post Share on other sites
Robbbert #10 Posted May 13, 2010 (edited) After checking all my .abs files, only one was in .cof format. Some are just binaries, and some have a strange header starting with 60 1B. I was able to find the size and load address with this format. The header size appears to be 0xD0. Thank you for the jagserver info. edit: Just saw your post Zerosquare, yes I've decided to largely ignore the extension and just check the first 2 bytes instead. Edited May 13, 2010 by Robbbert Quote Share this post Link to post Share on other sites
JagChris #11 Posted May 15, 2010 Good stuff but doesnt this thread more properly fit in the programming section? Quote Share this post Link to post Share on other sites
Robbbert #12 Posted May 15, 2010 I don't know, that would be something for the moderators to decide. Now, I've been able to understand the format of all the headers of all the files on hand. So, thanks to all who helped, and this can be closed. Quote Share this post Link to post Share on other sites