Jump to content
IGNORED

Intellivision ECS file format


evietron

Recommended Posts

Is there a somewhat standardized format for Intellivision other than BIN+CFG (too vague) or LUIGI (too detailed) that can play an ECS title?

 

It would be nice if there were a single binary file format that was easy to parse by an embedded device.

 

I was considering just making my own, but I wanted to open up to community input.

  • Like 1
Link to comment
Share on other sites

There are 3 standard formats for the Intellivision.  Please don't create a 4th.

  • LUIGI - This format is parsed by a 16-bit microcontroller so it can be handled by an embedded device.  I believe the spec for this format has been published.  If you don't have a copy, I can help you hunt one down.
  • BIN+CFG - The CFG file is pretty much an INI file format.  As you are probably alluding to with the vagueness, the CFG file is sometimes handcrafted by a human so there can be slight variations in how different people type it up.  If you dig up the source code for jzintv, the code in src\bincfg is close to being a spec, especially the bincfg.* and bincfg_lex.* files.  Edit: *.int and *.itv files are just *.bin files but with a different file extension.
  • ROM - Sadly, this format does not support ECS bank switching (aka Mattel bank switching).  Theoretically, you could work with Joe Z to try and define some new tags at the end of file to specify ECS bank switching.  However, my concern here would be that if that were easy to add to the file format, it would have been done already.  The tag format is defined in the "doc\rom_fmt\id_tag.txt" file that is included with jzintv.
  • Like 2
Link to comment
Share on other sites

Yeah, there have been threads here about obtaining ROMs in the Analogue NT mini format. I understand it was created because the developers didn't "like" existing formats, not so much because existing formats didn't work as required. So if anything, instead of creating yet one more, try to copy what these people did though support for ROMs in that format will be thin to begin with.

Link to comment
Share on other sites

On 10/28/2022 at 12:45 AM, Lathe26 said:

There are 3 standard formats for the Intellivision.  Please don't create a 4th.

  • LUIGI - This format is parsed by a 16-bit microcontroller so it can be handled by an embedded device.  I believe the spec for this format has been published.  If you don't have a copy, I can help you hunt one down.
  • BIN+CFG - The CFG file is pretty much an INI file format.  As you are probably alluding to with the vagueness, the CFG file is sometimes handcrafted by a human so there can be slight variations in how different people type it up.  If you dig up the source code for jzintv, the code in src\bincfg is close to being a spec, especially the bincfg.* and bincfg_lex.* files.
  • ROM - Sadly, this format does not support ECS bank switching (aka Mattel bank switching).  Theoretically, you could work with Joe Z to try and define some new tags at the end of file to specify ECS bank switching.  However, my concern here would be that if that were easy to add to the file format, it would have been done already.  The tag format is defined in the "doc\rom_fmt\id_tag.txt" file that is included with jzintv.

It wouldn't hurt to mention that file extensions of .itv or .int are just .bin files.  Those extensions were used on the Intellivision Lives/Rocks CDs to prevent conflicts on computers that already bound .bin to something else.

 

There's also .cc3, but I don't have a Cuttle Cart 3, so I don't know what's special about it.

Link to comment
Share on other sites

I haven't seen files with .cc3 extension but the cuttle cart 3 used the same file format as the intellicart and I've seen both with .rom extensions.  Only the first couple of bytes differs but that's enough to make the cc3 format not work with some emulators.  The bin2rom utility can make both variations, it defaults to intellicart.

Edited by mr_me
  • Like 1
Link to comment
Share on other sites

I update my prior post has been updated with the *.int and *.itv being the same as *.bin.

 

The story on ROM file variations and their related CC3 files is a little messy and doesn't directly address evietron's original question (ECS support) so I'll keep it separate in this post:

  • ROM files vary in their 1st byte identifier.  There are 3 that I am aware of.  It's not clear to me that these differences are meaningful to the rest of the file format (i.e., whether new features got added or not) but there are emulators that reject some of the legit identifiers.  The values are:
    • 0xA8 Intellicart file (the Intellicart preceded the Cuttle Cart 3)
    • 0x41 Cuttle Cart 3 file
    • 0x61 Cuttle Cart 3 file
  • CC3 files unfortunately indicate 2 completely different types of files that serve different purposes.  Fortunately, a parser can trivially tell them apart.
    • Some CC3 files are just renamed ROM files.  The only such file I have (Spice Patrol) is a 0x41 ROM file.
    • Some CC3 files are text files used to specific the sub-directories / groupings / menus of games in the Cuttle Cart 3's UI.  CC3 are one of 4 files that go onto the Cuttle Cart's SD card (the others are ROM files that go into the "GAMES" directory, TXT files that go into the "MANUALS" directory, and the MENULIST.TXT that goes into the root of the SD card).  Note: This post is just for historical purposes; I am not suggesting that evietron use ROM files or use this directory structure for the BackBit.
  • Like 1
Link to comment
Share on other sites

Technically the BIN+CFG isn't too vague. It is just enough to read the source code for jzintv.

 

Besides BIN+CFG is the only format that supports bank switching.

 

All the important data is in the [mapping] section.

 

This is the simplest parser I've done (not supports bank switching as it wasn't required):

 

		binary = fopen(argv[1], "rb");
		if (binary == NULL) {
			fprintf(stderr, "Unable to open binary file '%s'\n", argv[1]);
			exit(1);
		}
		config = fopen(argv[2], "r");
		if (config == NULL) {
			fprintf(stderr, "Unable to open config file '%s'\n", argv[1]);
			exit(1);
		}	
		process = 0;
		while (fgets(line, sizeof(line) - 1, config)) {
			if (line[0] == '[') {
				if (memcmp(line + 1, "mapping", 7) == 0)
					process = 1;
				else
					process = 0;
			}
			if (process && line[0] == '$') {
				start = strtol(line + 1, &p, 16);
				p = strchr(p, '$');
				end = strtol(p + 1, &p, 16);
				p = strchr(p, '$');
				target = strtol(p + 1, &p, 16);
				fprintf(stdout, "$%04X - $%04X\n", target, target + (end - start));
				fseek(binary, start * 2, SEEK_SET);
				while (start <= end) {
					fread(line, 1, 2, binary);
					rom[target * 2 + 0] = line[1];
					rom[target * 2 + 1] = line[0];
					target++;
					start++;
				}
			}
		}
		fclose(config);
		fclose(binary);

 

  • Like 2
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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