8KB PRG ROMs

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

BootGod
Posts: 359
Joined: Wed Jul 13, 2005 3:14 pm

8KB PRG ROMs

Post by BootGod »

When dealing with the iNES format, do you have any option besides mirroring it out to 16KB? I've actually come across a game that only uses an 8KB PRG:

Galaxian:
http://bootgod.dyndns.org:7777/profile.php?id=1808

Take a look at the PCB pics. Note that I haven't updated the ROM info to reflect it as 8KB ROM.

On a side note, regarding the site, it shouldn't be terribly much longer before the new version goes live. Lots of new functionality! ;)
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: 8KB PRG ROMs

Post by Banshaku »

As for the iNES header, I'm no expert but what I know is that you can only set 16k banks only.
BootGod wrote:On a side note, regarding the site, it shouldn't be terribly much longer before the new version goes live. Lots of new functionality! ;)
I have a question regarding your site. Is it possible to have a local version or do you plan do do one? That would be sometime useful and that would avoid to burn your bandwidth limit when we do mindless search in it ;)
User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku »

There's nothing to do but mirror it while noting the true size. Galaxian is the best known 8KB PRG game, but there are probably a few others not to mention a ton of firmware. It's just not something that could ever be enforced without widespread emulator hacks.
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

If you assume that no actual ROM will ever contain exactly mirrored contents (or don't mind if such a ROM looks like a smaller one of the unmirrored contents), then iNES can represent PRG ROM sizes of any power of 2, down to 1 byte. To "decode" such sizes, if the iNES file has 16K PRG then the data must be scanned to determine how many times the contents are mirrored. This isn't much of a problem since the size of the ROM rarely needs to be determined (certainly not for running the program). It may be less clean this way, but it really does represent the same information that a file with no mirroring would represent.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

VS Tetris has a PRG size of 24k.
For that matter, VS Tetris is really weird since it's a licensed version of Tengen's [Atari Games's] version of Tetris.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
albailey
Posts: 177
Joined: Thu Jul 13, 2006 3:15 pm

Post by albailey »

So how would you deal with VS Tetris?
Is the bottom 8K mirrored, or the top 8K?
Al
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

The 24k is mapped to the last 3 8k pages. No clue what goes in the first 8k.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku »

Either the ROMs are decoded with A14 and A13 and the first page is open bus (unless there are 3x 8K ROMs where it'd be possible to partially decode one of them with dual decoders) or only A14 is used and the low data is mirrored. It's probably mirrored.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

What about interpreating iNES with "0 8kb PRG ROM banks" as a 8kb PRGROM ? Of course this will disallow 4kb and below, as well as 24kb.
Useless, lumbering half-wits don't scare us.
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

That would break compatibility with current programs. Why do that when you don't have to? (as I described in my previous message) Anyway, treating zero specially only adds direct support for one other size between 1 and 16384 bytes; it still doesn't directly handle all the other possible sizes in that range.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

This is a job for iNES 2.0! Seriously, did it have provisions for small ROMs? The 0 could mean "smaller than 16KB, go get the exact size from some other byte".
Drag
Posts: 1350
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Post by Drag »

There are those reserved bytes at the end of the ines header, don't tell me nobody's ever going to use them. :P
Nessie
Posts: 134
Joined: Mon Sep 20, 2004 11:13 am
Location: Sweden
Contact:

Post by Nessie »

Drag wrote:There are those reserved bytes at the end of the ines header, don't tell me nobody's ever going to use them. :P
Nope, those are only reserved for the string "DiskDude!" ;)
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Drag wrote:There are those reserved bytes at the end of the ines header, don't tell me nobody's ever going to use them. :P
The last time I heard about iNES 2.0 it used some of the bytes. I just don't know if any of them had anything to do with PRG-ROM smaller than 16KB.
BootGod
Posts: 359
Joined: Wed Jul 13, 2005 3:14 pm

Post by BootGod »

blargg wrote:If you assume that no actual ROM will ever contain exactly mirrored contents (or don't mind if such a ROM looks like a smaller one of the unmirrored contents), then iNES can represent PRG ROM sizes of any power of 2, down to 1 byte. To "decode" such sizes, if the iNES file has 16K PRG then the data must be scanned to determine how many times the contents are mirrored. This isn't much of a problem since the size of the ROM rarely needs to be determined (certainly not for running the program). It may be less clean this way, but it really does represent the same information that a file with no mirroring would represent.
There are actually quite a few games that stored their content on ROMs larger than needed, padding them out with mirrored data. The new DB records physical ROM size in addition to the size of the utilized data, so you can easily find games like that.

It's certainly easy enough to simply mirror the data when writing in the iNES format, the crappy part is you would still have to keep a copy of the 16K CRC in order to detect the mirrored ROM again in a scan.
Post Reply