Jump to content
Robbbert

File headers

Recommended Posts

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 by Robbbert

Share this post


Link to post
Share on other sites

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 by ggn

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 by Zerosquare
  • Like 1

Share this post


Link to post
Share on other sites

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 by Robbbert

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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'.

  • Like 1

Share this post


Link to post
Share on other sites

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 by Robbbert

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...