a new alternative to iNES

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
a new alternative to iNES
by on (#63632)
Even if I've spent quite some time, in the past year, to improve compatibility in the NES emulation of MESS (by adding new mappers, by adding support for UNIF files and by implementing preliminary iNES 2.0 support), I have never been really happy with the current NES formats.
Being my background mainly related to MAME, I've always been under the impression that gluing together the different chip contents + an 'arbitrary' header was not the best solution. Especially, given the large number of ROMs floating around with the wrong header (while working on pirate mappers, I have found tons of chinese roms generically assigned to Mapper 4 or 0, which in fact required different features to work), and the generic lack of consensus on some mapper numbers for obscure chinese carts.

This is why, starting from today, MESS publicly supports loading zipfiles containing separate PRG and CHR files, in addition to iNES and UNIF!
The matching between the ROM files and the correspondent boards is obtained through a .xml database which gets read when carts are loaded and which is public for anyone to use (as long as new findings about obscure boards are made public so that anyone can use them): you can get a copy from this link (click on 'plain' and save the ~2.5MB xml file)

http://git.redump.net/cgit.cgi/mess/tree/hash/nes.xml

Before getting into the xml details, I would like to point out that only 3 things are required to add support for these files in any emu:
1. an xml parser, to read info from nes.xml about the board type, the memory sizes, the mirroring, the dispwitches, the peripherals, etc.
2. the capability to load separate files from inside a zipfile based on checksums or filenames (like MAME, Nebula and FBA do for arcade romsets)
3. a lookup table to pass from the board type [read in nes.xml] to the correct mapper emulation. NEStopia has a lookup table of this sort in src/core/boards/NstBoard.h, if a reference is needed

once the file is loaded in memory and the emulator has chosen the appropriate read/write handlers, emulation can go on as it would usually do after loading an iNES file to memory.

Now let's focus on the xml format. Let's examine a typical entry (in this case for Aerobic Studio)

Code:
   <software name="train3as" supported="partial">
      <!-- Serial: FT-03 - Release Date: 1987-02-26 - Alternative Title: ファミリートレーナー③ エアロビスタジオ -->
      <description>Family Trainer 3: Aerobics Studio (Jpn)</description>
      <year>1987</year>
      <publisher>Bandai</publisher>
      <part name="cart" interface="nes_cart">
         <feature name="pcb" value="BANDAI-PT-554" />
         <feature name="mirroring" value="horizontal" />
         <feature name="peripherals" value="ftrainer" />
         <dataarea name="prg" size="32768">
            <rom name="aerob pr" size="32768" crc="f8da2506" sha1="c14075b1b7c98b684870e8d85b7ff2b462e3cd10" offset="00000" />
         </dataarea>
         <dataarea name="chr" size="32768">
            <rom name="aerob ch" size="32768" crc="ff1d2bfd" sha1="c41872d3c28230f3a907db9bf46568ca8a789e22" offset="00000" />
         </dataarea>
         <dataarea name="adpcm" size="262144">
            <rom name="m50805" status="nodump" offset="00000" />
         </dataarea>
      </part>
   </software>


Each game is in a <software> node with a "name" attribute (a shortname like MAME uses: the emulator will then look for the files inside a train3as.zip file) and a "supported" attribute (this is MESS specific, but other emus can strip it out with e.g. a perl script).

Then, we have the basic info which could be shown in the emu UI:
- <description> for the complete name of the game
- <year> & <publisher> for the corresponding info
the commented out fields (serial, release date & alt titles) might be re-added later, I'm not sure (this xml format is used for many systems in MESS, so some compromise had to be accepted)

Finally, <part> includes everything an emulator needs to know to emulate this specific piece of software (the "name" and "interface" attributes are internally used by MESS to know this is NES and not another console).

Ideally, an emulator could start any file of the xml list by simply parsing the part node:
- from <features>, you would find out: which "pcb" the game uses (in this case a Bandai CNROM variant containing an additional sound chip), so that you can choose the required mapper; if the game has hardwired "mirroring", horizontal in this case; if the game supports particular peripherals; etc. for some particular pcb there might be specific features, e.g. the pin settings for protected CNROM games, or the pin connections for Konami VRC-2, VRC-4 and VRC-6 games, or the chip revision for MMC1 and MMC3 (to handle different MMC3 IRQ or Mapper 1 vs. Mapper 155 emulation)...
- from <dataarea>, you would find out which chips were present on the pcb: in the example we have the expected "chr" and "prg", plus a "adpcm" area for the content of the audio chip, if we ever manage to dump it. Other possible 'dataarea' are "vram" (if present on the board), "wram" and "bwram" for PRG RAM with or without battery, "mapper_ram" and "mapper_bram" for mappers which have internal RAM with or without battery like MMC5, MMC6 & Taito X1-005. At start, an emu should simply load prg & chr, and take note of the other dataarea to setup VRAM & WRAM like it would do by parsing the iNES header
- from <dipswitch>, you would read if the cart had switches on it (this is needed for a few pirate multicarts)

Here are other three examples for Excitebike, Shin Satomi Hakkenden and Taito Grand Prix, respectively

Code:
   <software name="excitbik">
      <!-- Serial: NES-EB (EEC/NOE/ESP) - Release Date: 1986 -->
      <description>Excitebike (Euro)</description>
      <year>1986</year>
      <publisher>Nintendo</publisher>
      <part name="cart" interface="nes_cart">
         <feature name="pcb" value="NES-NROM-128" />
         <feature name="mirroring" value="vertical" />
         <dataarea name="prg" size="32768">
            <rom name="pal-eb-0 prg" size="16384" crc="0b5667e9" sha1="8c37839c645d54184df6273e481527d4cfa312d2" offset="00000" />
            <rom size="16384" offset="4000" loadflag="reload" />
         </dataarea>
         <dataarea name="chr" size="8192">
            <rom name="hvc-eb-0 chr" size="8192" crc="e5f72401" sha1="a8bf028e1a62677e48e88cf421bb2a8051eb800c" offset="00000" />
         </dataarea>
      </part>
   </software>

   <software name="shinsato">
      <!-- Serial: TDF-91 - Release Date: 1989-12-08 - Alternative Title: æ–° 里見八犬传 光㠨闇㠮戦㠄 -->
      <description>Shin Satomi Hakkenden: Hikari to Yami no Tatakai (Jpn)</description>
      <year>1989</year>
      <publisher>Toei Animation</publisher>
      <part name="cart" interface="nes_cart">
         <feature name="pcb" value="HVC-SNROM" />
         <feature name="mmc1_type" value="MMC1B2" />
         <dataarea name="prg" size="262144">
            <rom name="tdf-91-0 prg" size="262144" crc="23e9c736" sha1="835a0f9a3ddd516cecbccf34fbe8f7632f297558" offset="00000" />
         </dataarea>
         <!-- 8k VRAM on cartridge -->
         <dataarea name="vram" size="8192">
         </dataarea>
         <!-- 8k WRAM on cartridge, battery backed up -->
         <dataarea name="bwram" size="8192">
         </dataarea>
      </part>
   </software>

   <software name="taitogp">
      <!-- Serial: TFC-TG-5500 (15) - Release Date: 1987-12-18 - Alternative Title: タイトーグランプリ æ „å…‰ã ¸ã ®ãƒ©ã‚¤ã‚»ãƒ³ã‚¹ -->
      <description>Taito Grand Prix: Eikou e no License (Jpn)</description>
      <year>1987</year>
      <publisher>Taito</publisher>
      <part name="cart" interface="nes_cart">
         <feature name="pcb" value="TAITO-X1-005" />
         <feature name="x1-pin17" value="CHR A17" />
         <feature name="x1-pin31" value="CIRAM A10" />
         <dataarea name="prg" size="131072">
            <rom name="pr0 x3-018" size="131072" crc="17627d4b" sha1="5a8680dce5f2f2ecb28ef592b7418b2371fe98f4" offset="00000" />
         </dataarea>
         <dataarea name="chr" size="131072">
            <rom name="ch x3-019" size="131072" crc="505aa340" sha1="8890e530e9b1485bfeb7e73669104edce8fa625f" offset="00000" />
         </dataarea>
         <!-- 128b Internal RAM (battery backed up) in the X1-005 chip -->
         <dataarea name="mapper_bram" size="128">
         </dataarea>
      </part>
   </software>


Notice that, as shown by Excitebike, the "prg" dataarea is always at least 32KB wide, with smaller roms reloaded/mirrored where necessary

A few more remarks:

Concerning accuracy of the info in the xml list, the first part of the list is very precise, being based on the latest version of Bootgod's database.
On the other hand, the second part is not so complete (yet): it contains files (around 2500) from various other collections (GoodNES, nointro and NonGoodNES), with pcb, mirroring and vram/wram settings taken from the headers. As such, there might be mistakes which I hope to fix little by little... Moreover, additional info are mostly missing (I will add them next, but I thought checksums had definitely priority over Manufacturers and Release Dates ;) ) and some Alt sets might actually be bad dumps which got incorrectly labeled, and they will need further investigations to be sorted out.
However, I think the current list is not that bas as a starting point, given that 95% of the games shows something when loaded :)

Concerning included file, you might notice that the xml list does not contain hacks or translations: this is done in purpose, since in my opinion these should be made available as IPS patches (to be applied at loading time, after the separate prg & chr have been loaded into memory). On the other hand, dumps from pirate carts are included.

Finally, concerning the file availability (a not so trivial question, given that it's what basically killed the nice UNIF format), conversion from iNES & UNIF is pretty easy since it mainly consists of splitting PRG and CHR chunks from the existing files: MESS is already capable of dumping out the data when the user loads one of his files, if required, and rommanager programs like clrmame or romvault can use the xml list to create zip archives with the correct names from the split files. Also, there is a group of users actively splitting the files so that ready-to-use zipfiles might appear soon-ish through rom collector websites. I'm not sure this will be enough to gain some momentum,
but I hope I can find some more people not exactly happy with the iNES format and the arbitrary mapper numbers :)

Of course, I'd be interested in feedback and suggestions (as well as critics, of course) and I'm ready to answer to any question which might arise.

That's all folks. Thanks for reading. Cheers.
Re: a new alternative to iNES
by on (#63636)
A bit of constructive criticism:

etabeta wrote:
This is why, starting from today, MESS publicly supports loading zipfiles containing separate PRG and CHR files

In other words, "Now supports Pasofami split format!"

Quote:
The matching between the ROM files and the correspondent boards is obtained through a .xml database

So it's almost Pasofami, just with the board spec in a central XML database instead of a .prm file. But then how can a homebrew game add itself to the database? Should a zipfile include its own nes.xml? Or did you intend it only for ROM images of games that have been released commercially or otherwise satisfy English Wikipedia's notability criteria?

Quote:
Code:
   <software name="train3as" supported="partial">
      <!-- Serial: FT-03 - Release Date: 1987-02-26 - Alternative Title: ファミリートレーナー③ エアロビスタジオ -->

Shouldn't text in XML be in UTF-8 rather than Shit-JIS?

Quote:
Code:
   <software name="excitbik">

Who registers software names and publisher names?

Quote:
Code:
      <description>Taito Grand Prix: Eikou e no License (Jpn)</description>

"no License" sounds like something Tengen or Color Dreams might do :-)

Quote:
Concerning included file, you might notice that the xml list does not contain hacks or translations: this is done in purpose, since in my opinion these should be made available as IPS patches (to be applied at loading time, after the separate prg & chr have been loaded into memory).

If you want to handle them like MAME handles clones, a zipfile with an IPS in it would have the main ROM as its parent. But then IPS isn't so good at handling disassemble-patch-reassemble hacks such as the newer SMB1 hacks based on Doppelganger's SMBDis. Those would be better served by xdelta than by IPS, as KaioShin of Romhacking.net suggested to me.

by on (#63648)
Well I definently think this is cool but I kinda think that it's a bad thing. iNES is the standard for a reason, so it can be standardized. I don't think MESS should be trying to change it, it should conform to it IMO. I also believe that maybe it should have this data in it if needed but just solve it via checksum and ROM size list, we shouldn't need a whole new zip file with multiple files and such when with iNES we just have one file that if need be, we could find what game it is through a database inside the emulator/program (Bootgod's site is amazing) Well thats my opinion but others can definently go off to a new standard it won't matter to my FCEUX and NESASM3 :P

by on (#63650)
You're not likely to succeed in replacing iNES with a far more complicated format. iNES has some short falls but overall works well. Beats implementing some XML parser and other such things.
Re: a new alternative to iNES
by on (#63656)
thanks a lot for the comments, tepples

tepples wrote:
In other words, "Now supports Pasofami split format!"


I was not sure Pasofami format was exactly like this (no files seems to be still available), but then yes: I have resurrected the separate PRG/CHR thing

tepples wrote:
But then how can a homebrew game add itself to the database? Should a zipfile include its own nes.xml? Or did you intend it only for ROM images of games that have been released commercially or otherwise satisfy English Wikipedia's notability criteria?


well, so far I tried to list all and only the carts released for the real hardware (both licensed and unlicensed).

one of the reasons we added xml lists to MESS (for several systems) is that we received a lot of bug reports due to bad dumps. In the NES case we also had reports due to corrupted headers, or headerless roms (which got spread out with early nointro datfiles). this xml list offers a list of best-dump-to-knowledge to check bugs against, and therefore I was initially concerned with released games for the most part

eventually, I'd be interested to add homebrew programs which run on the real hardware, but I simply haven't got around to it yet.

shipping a single-set xml file with the software is another possibility as well, I really haven't spent too much time on this yet.


tepples wrote:
Shouldn't text in XML be in UTF-8 rather than Shit-JIS?


to say the truth, I directly extracted the Japanese titles from bootgod's db, without checking the encoding. I will check the issue (especially if we decide to uncomment the alternative titles)

tepples wrote:
Who registers software names and publisher names?


so far I've been the only one working on the list (that's why additional info are often missing: for start, I devoted a lot more attention to the checksums than to titles/manufacturer/release date), but now that it's public any contribution and help would be very welcome.

we also plan to eventually create some sort of PHP interface in our wiki to make list improvements a community effort, but we're still working on it

tepples wrote:
If you want to handle them like MAME handles clones, a zipfile with an IPS in it would have the main ROM as its parent. But then IPS isn't so good at handling disassemble-patch-reassemble hacks such as the newer SMB1 hacks based on Doppelganger's SMBDis. Those would be better served by xdelta than by IPS, as KaioShin of Romhacking.net suggested to me.


well, if these hacks get released as iNES files rather than patches, then they might be as well released as separate PRG+CHR with an additional xml file, like homebrew...

however, this is definitely one of the reasons we would never drop immediately iNES even if this format would meet immediate consensus and success: too many nice hombrew programs and interesting ASM hacks are only available in iNES format and sometimes an IPS (or UPS) patch is not enough

by on (#63657)
Thanks for the replies to 65024U and MottZilla as well. I hope you won't get offended if I merged the counter-replies to your critics in a single post

65024U wrote:
Well I definently think this is cool but I kinda think that it's a bad thing. iNES is the standard for a reason, so it can be standardized. I don't think MESS should be trying to change it, it should conform to it IMO.


MESS supports around 150 different iNES mappers and will continue to support the format, because too many users are only interested into playing and will simply keep using their old iNES files.

there is no big kill-iNES-and-impose-a-new-standard conspiracy behind this ;)

just an(other) attempt to overcome some of the iNES limitations with an alternative approach

MottZilla wrote:
You're not likely to succeed in replacing iNES with a far more complicated format.


let me clarify this point again: I do not plan to replace iNES files.

that said, I do not think it is a very complicated format (except for the xml parsing): say that you have the parser, then you simply
1. read the xml, extracting pcb type and the info about PRG and CHR checksums and sizes
2. load from zip the files with the expected checksums
3. store the files in memory with prg followed by chr

now your emulator can treat the file like a iNES one! simply use the pcb type to choose mapper, divide prg size by 16k and you get prg_chunks, divide chr size by 8k and you get chr_chunks... then you're ready to start emulation.

of course, if you do not want to add an xml parser (despite libexpat being free), the format becomes complicate to support.

however, I'd like to stress once more that I'm just offering an alternative, not trying to evangelize other emu authors. this alternative seems to work pretty fine in MESS, but I agree that it might not fit other people needs.

Overall, I'm already happy you spent some time reading my posts :)

65024U wrote:
I also believe that maybe it should have this data in it if needed but just solve it via checksum and ROM size list, we shouldn't need a whole new zip file with multiple files and such when with iNES we just have one file that if need be, we could find what game it is through a database inside the emulator/program (Bootgod's site is amazing)


well, my xml list is generated from bootgod db and it just adds a lot of carts which haven't still be verified with bootgod's quality standards ;)

also, MESS already have a series of crc hacks to handle multiple boards sharing the same mapper... I've just always thought that relying on checksums sort of defeat the point of using files with an header (see below)...

about the choice of separate files, I made the following reasoning:
1. let's say you want to use an internal crc list or an internal database like e.g. NEStopia does... well, doesn't this beat the whole point of having an header? if you have to identify boards based on the crc, then you could add to your database the mapper number as well, and the header would become pointless/unused

2. once the header is not so useful anymore, we might start thinking about headerless roms... but then why don't support the real content of the carts (like documented by bootgod) instead of files which glue together PRG and CHR? I know my MAME experience is probably the reason behind this second point, but if it has proven to be working for arcade games, why should it be so bad for NES?


MottZilla wrote:
iNES has some short falls but overall works well.


except for the need of submappers in many cases (mappers 32, 34, 71, 78, 113, 153, 185 & 242), except for not being able to natively support Galaxian with its 8K PRG, except for some Chinese dumpers assigning new mapper numbers without anyone tracking them (except maybe Cah4e3), except for the wrong/corrupted headers the users might have, except that even if you fix the headers or upgrade them to iNES2.0 next GoodNES might change them back or the users might never update the headers in their collections... etc... etc...

I know that iNES is not that bad (and MESS will keep supporting it, of course), but I was personally not satisfied with it :)

65024U wrote:
Well thats my opinion but others can definently go off to a new standard it won't matter to my FCEUX and NESASM3 :P


If you're simply not interested in the thing (or you don't want to touch xml), I respect your opinion.
but if you see any design flaw which makes the format incompatible with your projects, please let me know: I'm always open to suggestions

by on (#63667)
I think moving past INES is an important thing for the future. However I'm not sure some XML + rom thing is the best way forward. Firstly it doesn't help either emulator authors or end users. With no standardized compression/format for the actual ROM data we will still be left to support a myriad of formats for the data, or a format such as ZIP which is antiquidated. Who wants RAR, ZIP, 7ZIP, TAR, GZ, etc support in every single emulator? It's a waste.

Secondly, it seems XML is favoured because of the ability to 'be liquid' in the future when it comes to adding new features. Considering the games we are covering here are almost 30 years old, we pretty much know what they contain, the best solution is to have people spend the hundreds of hours necessary to write appropriate things for each game, and bundling data into appropriate containers. Not adding simple INES -> XML converters which do nothing except change the data into another form.

Any solution which doesn't involve some people spending the hundreds of hours going over each game isn't really a solution and will never take off. I know from my experience with RetroCopy and the new .GAME format, without people helping you with the databases there is pretty much no point in trying a new format.

As a developer I look at what you have done etabeta and go, what do I get out of it? If you can't offer developers a positive benefit they aren't going to take a new thing up. MESS isn't like MAME in that it can dictate formats as very few people actually use it. Without proper consultation of developers it's pretty much going to be like running on a treadmill any time you waste on such an endeavor.
NESMiss.txt
by on (#63668)
etabeta wrote:
eventually, I'd be interested to add homebrew programs which run on the real hardware

With PowerPak becoming more widespread, it's far more common for homebrew to work as advertised on an NES.

Because a homebrew game might be released early and often, a database (or section) designed for homebrew should probably not list outdated dumps. For example, the entry for LJ65 on pdroms.de lists only the latest version (0.41). But common ROM cataloging tools are designed for commercial games, and far more prototypes can be found for a homebrew game than for a commercial game. The database might end up with entries for versions 0.01, 0.02, 0.03, 0.04, ..., 0.45, 0.46 of a program, as if they were alternate dumps. It becomes complicated when cataloging tools such as GoodNES include a function to spit out NESMiss.txt, a report listing ROMs in the database that the tool could not find. The presence of outdated dumps in the default view of NESMiss.txt encourages people to try to collect a "compl33t GoodNES set!!!11" including every outdated prototype version ever released. That's why the copyright screens of very early versions of LJ65 (formerly Tetramino) included notices to the maintainer of GoodNES that they weren't yet ready for wide distribution, let alone for the database.

And while researching this reply, I found your post in a discussion on how NESMiss.txt expresses excluded ROM categories. (And is that the distributed.net cow head in Cowering's favicon?)

etabeta wrote:
I hope you won't get offended if I merged the counter-replies to your critics in a single post

In fact, that's common practice on this and many other phpBB boards I've used. The problem with merging happens when a comment mixes replies to on-topic and off-topic posts, and a moderator wants to split off the OT discussion. Moderators can split a topic but not an individual post.

etabeta wrote:
of course, if you do not want to add an xml parser (despite libexpat being free)

It's free as in speech, but not free as in memory. Some NES emulators run on platforms with 4 MB of RAM or even less: see nesDS and PocketNES.

etabeta wrote:
if it has proven to be working for arcade games, why should it be so bad for NES?

Apart from "arcade consoles" such as PlayChoice, CPS, and Neo Geo, a given arcade system board supports only one or a few games, and they have far less of a homebrew scene than consoles. (There's Vantris, a falling block game for Vanguard hardware, and what else?) This makes adding a game less cumbersome, as the emulator developer has to add support to the emulator's code anyway.

etabeta wrote:
except for the need of submappers in many cases (mappers 32, 34

I see 34 and think BNROM. The wiki page for 34 claims that BNROM and NINA-001 are easy to distinguish: NINA-001 has CHR ROM.

by on (#63669)
RetroRalph wrote:
As a developer I look at what you have done etabeta and go, what do I get out of it? If you can't offer developers a positive benefit they aren't going to take a new thing up.


well, it replaces the need of a mapper number with a string of the board name: there would be no risk of multiple boards assigned to the same mapper, or the need of changing number to the mapper at a later stage (quite difficult after you have released a rom with the wrong header). nor limits on the number of mappers would be present anymore.

also, from the point of view of emu authors, with the xml list VRC2, VRC4 and VRC6 code can be simplified a lot, based on the pin settings (which basically shifts which bits control chr/prg bankswitch)

similarly Taito X1-005 and Mapper 185 games can be setup more easily at start without a crc check, but simply parsing accurately the pin 'features' in the xml

again, the controller needed by some game can be retrieved by the xml and also the dipswitches that some pirate multicart have.

all these aspects could be handled by using a list of crc in the emulator source, but it's much more transparent when externalized.

also, it's easier when a new cart gets dumped: say you put in the source the dipswicthes for a 65-in-1 cart and then a 77-in-1 different cart get dumped with the same cart hw but different switch settings: if you use an internal crc list you have to release a new version of the emu with the new crc; in this way you just have to add the xml entry and the emulator would read the enw settings without even the need of recompiling it...

RetroRalph wrote:
Secondly, it seems XML is favoured because of the ability to 'be liquid' in the future when it comes to adding new features. Considering the games we are covering here are almost 30 years old, we pretty much know what they contain, the best solution is to have people spend the hundreds of hours necessary to write appropriate things for each game, and bundling data into appropriate containers. Not adding simple INES -> XML converters which do nothing except change the data into another form.


except that a few years ago pirate carts with dispwitches started to get dumped. something completely unexpected when iNES got created...

except that a couple of years ago, bootgod proved that some boards (CNROM now assigned to mapper 185) have a copy protection involving particular pins on the board and that each setting would result in a different protection scheme.

there are continuously new findings about these games, despite their age: as such, we could expect some more extension to be needed in the future (even if for smaller and smaller tidbits)


RetroRalph wrote:
Any solution which doesn't involve some people spending the hundreds of hours going over each game isn't really a solution and will never take off. I know from my experience with RetroCopy and the new .GAME format, without people helping you with the databases there is pretty much no point in trying a new format.


erm... did you take a look at the link in the original post? the database has already been created (by me, partially based on bootgod amazing website) and it lists ~3600 images... of course, I would appreciate *a lot* correction and external contributions, but the initial work has already been done.

also the format is simpler than .GAME, in the sense that is plain zip (no rar, no 7z, no gz... only zip) containing a few prg and chr files, expected to have the exact checksum listed in the provided xml database... and nothing else.

also it does not require tons of changes to support it (except for the xml parser, I know): you load the separate files one after the other and then you can treat it like a iNES file


RetroRalph wrote:
MESS isn't like MAME in that it can dictate formats as very few people actually use it. Without proper consultation of developers it's pretty much going to be like running on a treadmill any time you waste on such an endeavor.


I'm not trying to dictate anything and I would really like to know where you did take this impression from...
I was unsatisfied with iNES and displeased that neither UNIF nor iNES2.0 were getting success. I looked for inspiration in NEStopia (with its emulation based on the board types and its internal xml db) and in bootgod's website, and I pushed their approach to the extreme consequences because it matched my needs, my background and MESS capabilities.

Once the list was ready, I thought the result could be of interested for other developers as well. I also added the controller and dipswitch settings, that MESS cannot even use at the moment, because they could be of use for some other (better) emulator. that's all.

I don't expect iNES to be dropped at all (and indeed MESS will always keep supporting it). hence if you don't like xml, feel free to ignore it.
Re: NESMiss.txt
by on (#63670)
tepples wrote:
Because a homebrew game might be released early and often, a database (or section) designed for homebrew should probably not list outdated dumps. For example, the entry for LJ65 on pdroms.de lists only the latest version (0.41). But common ROM cataloging tools are designed for commercial games, and far more prototypes can be found for a homebrew game than for a commercial game. The database might end up with entries for versions 0.01, 0.02, 0.03, 0.04, ..., 0.45, 0.46 of a program, as if they were alternate dumps.


nope: outdated entries could be removed from the database, of course ;)

tepples wrote:
It's free as in speech, but not free as in memory. Some NES emulators run on platforms with 4 MB of RAM or even less: see nesDS and PocketNES.


touche'. but I'm not really an expert about 'handheld' NES emu, so I'm going to do some research before suggesting anything about it.


tepples wrote:
Apart from "arcade consoles" such as PlayChoice, CPS, and Neo Geo, a given arcade system board supports only one or a few games, and they have far less of a homebrew scene than consoles. (There's Vantris, a falling block game for Vanguard hardware, and what else?) This makes adding a game less cumbersome, as the emulator developer has to add support to the emulator's code anyway.


the same holds true if you replace "arcade board" with "cart pcb/mapper". there are mappers which only support 1 or 2 games and "the emulator developer has to add support to the emulator's code anyway" ;)

tepples wrote:
I see 34 and think BNROM. The wiki page for 34 claims that BNROM and NINA-001 are easy to distinguish: NINA-001 has CHR ROM.


ok, I took the wrong example. but it only means that instead of checking for the submapper but in iNES 2.0 I need to add to my emu

if CHRROM -> use NINA
else -> use BNROM

until we find an obscure NINA game which has only PRGROM and only writes to 0x7ffd ;)

by on (#63672)
etabeta wrote:
all these aspects could be handled by using a list of crc in the emulator source, but it's much more transparent when externalized.


Agreed, I don't think INES is the best solution, but what you have offered is merely a minor improvement.

etabeta wrote:
also, it's easier when a new cart gets dumped: say you put in the source the dipswicthes for a 65-in-1 cart and then a 77-in-1 different cart get dumped with the same cart hw but different switch settings: if you use an internal crc list you have to release a new version of the emu with the new crc; in this way you just have to add the xml entry and the emulator would read the enw settings without even the need of recompiling it...


Well this is taking the simple case isn't it? A "major" finding would still require new information to be added and every emulator to be recompiled. Simple things can already be handled with INES or pretty much any decent format. XML isn't some magic bullet, and it requires decent amounts of code to support (RetroCopy already supports it so it's not an issue from my perspective).

etabeta wrote:
there are continuously new findings about these games, despite their age: as such, we could expect some more extension to be needed in the future (even if for smaller and smaller tidbits)


I'm not advising a 100% closed solution is possible at this point, however it seems to me most of what you have done is automation with a few tweaks on top. You can't take your few hours? of work and expect it to matter much when hundreds, likely thousands of hours is required.

You are merely fixing small issues with INES, you aren't helping to cover all cases needed by emulators going forward. Unless you have a complete solution that fixes all issues and improves on nearly every aspect of INES I can't see how you can champion a minor improvement that no emulator supports. For something that RetroCopy requires I don't see any real benefits for me to convert, and that to me is what matters. Until you cover all the cases that *I* need, which is a rather advanced setting, you won't have a good replacement for INES.

That said, I welcome any improvements you can do because my helpers will be taking everything they can when they add NES support to .GAME :D Or alternatively if you do want to get serious about it I welcome a complete solution, I'd prefer not to be the one that does all the work (or manages it rather).

by on (#63674)
RetroRalph wrote:
Agreed, I don't think INES is the best solution, but what you have offered is merely a minor improvement.


yet it is exactly the kind of minor improvements which has lead in the past to the proposal of UNIF and iNES2.0 formats...

what would you suggest as a major improvement?

RetroRalph wrote:
Well this is taking the simple case isn't it? A "major" finding would still require new information to be added and every emulator to be recompiled.


of course I took a simple case. any 'revolutionary' new finding will always require major changes in the emulators and no well studied format could take care of the emulation issues for you ;)

still, no matter how easy it might seems to you, iNES could not handle these easy cases as transparently as an external xml list, nor UNIF could (except if a new [DIPS] chunk gets added to the format)

RetroRalph wrote:
You can't take your few hours? of work and expect it to matter much when hundreds, likely thousands of hours is required.


leaving aside the fact that
* I have spent 6 months on this before disclosing it yesterday (and you can also publicly review in the MESS svn the past 2 months of work on the emulator side, after the long time spent by myself and judge and micko on the xml side),
* I have had several discussions with bootgod about both the xml and several tiny pcb details since last January
* I have tested briefly *ALL* 3625 images to check obvious mis-assigned boards and/or mirroring settings

you should not forget the *years* which have been spent by other emu authors on matching mappers number to pcb boards...
something which resulted in the wonderful "board" files you can see in NEStopia source (namely src/core/board/NstBoard.c & .h) and which I was able to use the founding stone when I decided to build up my list


RetroRalph wrote:
You are merely fixing small issues with INES, you aren't helping to cover all cases needed by emulators going forward. [snip]..[snip] Until you cover all the cases that *I* need, which is a rather advanced setting


you can consider them as small issues, but they cover most complaints other authors reported over the years.

please be so kind to give me some examples of *all* the cases you think you will encounter and I will happily take a look at them... until then, I still think a 1:1 representation of the cart hardware (as the separate files + xml <fearure> fields allow) is way more effective than .GAME ;)

by on (#63677)
etabeta wrote:
yet it is exactly the kind of minor improvements which has lead in the past to the proposal of UNIF and iNES2.0 formats...


Both formats failed to gain any traction.

etabeta wrote:
what would you suggest as a major improvement?


Standardized advanced compression (7ZIP), proper integrity checking, proper naming schemes including a global naming system for linking different systems. Multiple name to rom linking. Ease of use, to support .GAME requires almost no code for the emulator itself and is more simple than an XML parser to add. Details of game such as input devices, number of players, ports used, slots used, etc. .GAME has all these for supported systems. In essence, everything you need to know about a game for an emulator is there. You can argue "it's XML, we can add them", but the point is it's not there now is it. Comparing what you've done to say UNIF is like comparing FireFox 3.5 to 3.6.

etabeta wrote:
still, no matter how easy it might seems to you, iNES could not handle these easy cases as transparently as an external xml list, nor UNIF could (except if a new [DIPS] chunk gets added to the format)


That isn't really the point I think. Is it easier to add a few CRC checks for the minority of games or add a complete new ROM format that does it? The answer is simple. Until you have some side benefits, all the things I mentioned for instance, who is going to convert to it? What is the reward for doing so? The chance a few undiscovered pirate boards may work without recompiling? The line will be long.

etabeta wrote:
leaving aside the fact that
* I have spent 6 months on this before disclosing it yesterday (and you can also publicly review in the MESS svn the past 2 months of work on the emulator side, after the long time spent by myself and judge and micko on the xml side),
* I have had several discussions with bootgod about both the xml and several tiny pcb details since last January
* I have tested briefly *ALL* 3625 images to check obvious mis-assigned boards and/or mirroring settings

you should not forget the *years* which have been spent by other emu authors on matching mappers number to pcb boards...
something which resulted in the wonderful "board" files you can see in NEStopia source (namely src/core/board/NstBoard.c & .h) and which I was able to use the founding stone when I decided to build up my list


I am very thankful of those that have spent their time trying to improve the NES scene in any way possible, even your attempt here. I welcome change.

However if you spent 6 months coming up with what you did you haven't worked optimally in my opinion. In reality whatever work you've done is going to be mostly wasted because what you offer isn't a complete solution for emulators going forward. REsolving the problems of the 1990s isn't going to help those of us in 2010.

by on (#63679)
RetroRalph wrote:
Standardized advanced compression (7ZIP), proper integrity checking, proper naming schemes including a global naming system for linking different systems. Multiple name to rom linking. Ease of use, to support .GAME requires almost no code for the emulator itself and is more simple than an XML parser to add. Details of game such as input devices, number of players, ports used, slots used, etc. .GAME has all these for supported systems. In essence, everything you need to know about a game for an emulator is there. You can argue "it's XML, we can add them", but the point is it's not there now is it. Comparing what you've done to say UNIF is like comparing FireFox 3.5 to 3.6.


Most of the things you listed would probably belong more to a frontend than to an emulator, imho, and the one who don't (like the controller devices) are already listed above.
As such, personally I'm not interested to include the things you mentioned directly into the emulation.

RetroRalph wrote:
That isn't really the point I think. Is it easier to add a few CRC checks for the minority of games or add a complete new ROM format that does it? The answer is simple. Until you have some side benefits, all the things I mentioned for instance, who is going to convert to it? What is the reward for doing so? The chance a few undiscovered pirate boards may work without recompiling? The line will be long.


didn't I say more than once that the multicart dump was just a stupid example which came easily to my mind? rather than list other small advantage I will repeat my (few) points

1. imho the list of crc is a gross hack and defeats from start the usage of headered files (call it NES, UNIF or GAME) ;)
2. simplifying (as Marty first did, and as I was able to do as well) the emulation of Konami Boards is more than enough as a side effect for me.
3. accurately represent and describe the content of the carts is an added value, and cannot harm the documentation side of emulation

feel free to disagree. as I said I'm not forcing anyone to use the format I added to MESS.

RetroRalph wrote:
However if you spent 6 months coming up with what you did you haven't worked optimally in my opinion. In reality whatever work you've done is going to be mostly wasted because what you offer isn't a complete solution for emulators going forward. REsolving the problems of the 1990s isn't going to help those of us in 2010.


I had a goal in mind and I reached it with the easier solution I could think of (a solution which makes wonder for ~9000 games in MAME).
this same solution would also allow people with the right instruments like bootgod to repair broken carts. is this enough for me? yes, in my eyes it is.

That said, I'm not interested in converting anyone to see separate PRG & CHR as a revolution.
They just represent an alternative approach to iNES. In particular, an approach capable to address most past complaints and all my needs in MESS. And an approach publicly available to anyone who wants to use it.

If no one wants to use it, ok, I'm still happy with the result I obtained for the reasons I listed above. In the end it's just an hobby ;)

by on (#63680)
In other words, this is research/an experiment in another way of representing NES cartridges digitally. The results of this will help anyone in the future considering a similar approach. Maybe it won't pan out for some/all uses, but it will provide actual experience.

by on (#63682)
blargg wrote:
In other words, this is research/an experiment in another way of representing NES cartridges digitally. The results of this will help anyone in the future considering a similar approach. Maybe it won't pan out for some/all uses, but it will provide actual experience.


exactly.

+ the fact that it's not just a theoretical exercise: there is also an emulator already supporting these files (MESS) and NEStopia would probably need only few changes to support it as well (if Marty comes back from wherever he's hidden and is interested)

also, it's not sculptured into the stone: I'm open to suggestions and the format can be extended to address additional emu-related questions

now I have to go, Sunday is running out :)

bye

by on (#63683)
I think it would be more practical to specify mappers using some kind of script. So that if you know how to handle MMC3, you could handle the alternate boards just by having different scripts with them (like the NES Play Action Football board, or the Dragon Quest 4 pirate board, the Metal Max Pirate board, etc...)

by on (#63687)
Script, as in specification of mapper behavior in the config file? It wouldn't have to be at the gate level, more at a higher level, so that complex things like MMC3 could be mostly written in C internal to the emulator, and the script just specify how its registers are mapped, and any extra simple things. Something like that could be useful when one is wiring up their own cartridges in unique configurations, but still using standard components so that this could handle it. It obviously wouldn't handle something like Squeedo, though.

by on (#63689)
An XML parser really isn't a challenge for anyone who can write an emulator. I wrote one that does everything except DOCTYPE in a few hours. Of course there are those who will complain it's not an XML parser because it lacks DOCTYPE.

Using libexpat and the like is great if you want to spend more time learning a new API than writing a parser in the first place, and don't mind using gigantic packages from other people, and don't mind more license dependencies. Either way, XML is really only a hurdle if you are really lazy.

Given how little nesting there is, a format like this can really work with a fancy CSV file, XML is just prettier to look at. But you definitely need the extensibility for ROM hacks, translations, etc; which is why a strict database approach will never work.

Back to splitting files apart again. All I can say is you better stay away from the SNES scene with that nonsense, you've already ruined NSS :P

Yes, one in 50,000 people can solder on new flash ROMs over failed mask ROM boards. If they can do that, they can split a file apart. Focus on the majority: one file is much, much easier to work with. Some people don't want to keep all their files inside an archive container that may or may not be around in 10 years or even have an extractor/maker tool on their OS for it.

Lastly, you will never convert everyone to a new format. So make an internal emulator database that performs strict SHA256 -> XML transformations on loaded games for all official titles, and let the rest use either stock iNES or flexible XML.

My appproach would be:
1. XML file exists? Use it.
2. Database entry exists? Use database XML file.
3. Unknown iNES? Run generic iNES->XML parser on it, load that.

Your core only recognizes XML, and you'll have some really ugly iNES->XML code somewhere external.

by on (#63714)
No offense man it's just that all this stuff could be figured out with a internal database inside the emulator which IIRC, One emulator does that.

I think if you need/want to display this match the iNES and ROM checksum to a database and pick out what game it is and display the info on it, because changing the while NES file for Mame seems kind of unneccessary :/

I do like this but would be happier if Mess only used the standard ^_^ But your making it so I guess it doesn't matter.


I love the idea but just don't like how to implement it you have to either have a local database of info or include it in the file :/

by on (#63718)
byuu wrote:
Back to splitting files apart again. All I can say is you better stay away from the SNES scene with that nonsense, you've already ruined NSS :P


if you would look closely, you would notice that we already ship a snes.xml list, but no split files have been added... wonder why? because it's not strictly necessary and the current format emulation works like a charm ;)

for NES, otoh, essential hardware details are related to the way pieces are wired inside the cart itself. In many ways, NES carts are much closer to arcade pcbs than any other console carts (except SNK AES, but that's a different story ;) ), and as such it's difficult to handle them as easily as you handle SNES/GB/GBC carts


byuu wrote:
Yes, one in 50,000 people can solder on new flash ROMs over failed mask ROM boards. If they can do that, they can split a file apart. Focus on the majority: one file is much, much easier to work with. Some people don't want to keep all their files inside an archive container that may or may not be around in 10 years or even have an extractor/maker tool on their OS for it.


majority should not *always* be the only target... sometimes I wonder (not too seriously, but I still do it) if 50,000 people interested to restore the old carts are not worth helping much more than a million of people only interested in the free gamez...

byuu wrote:
Lastly, you will never convert everyone to a new format. So make an internal emulator database that performs strict SHA256 -> XML transformations on loaded games for all official titles, and let the rest use either stock iNES or flexible XML.

My appproach would be:
1. XML file exists? Use it.
2. Database entry exists? Use database XML file.
3. Unknown iNES? Run generic iNES->XML parser on it, load that.

Your core only recognizes XML, and you'll have some really ugly iNES->XML code somewhere external.


in my opinion, internal databases are not so useful, given that they risk to be used only for a single emu and other emus cannot really make use of it... I prefer external and open ones: they still possibly won't be used by any other emu, but at least they are out there available for other to use!

anyway, we already keep backward compatibility with iNES & UNIF in MESS (by using 3 different loading routines, i.e. ~50 lines of code to setup the correct pcb types and wirings). the point is that, given the past complaints about some iNES tidbits and the lack of success for UNIF, I thought some dev could find this solution interesting, so I shared the news and given the basic details here as well.

I'm still interested in giving details if someone wants to take a closer look :)


EDIT: sorry, but I could not resist: can I say I find it funny how you state here

byuu wrote:
Back to splitting files apart again. All I can say is you better stay away from the SNES scene with that nonsense, you've already ruined NSS :P


and then you complain at ( http://byuu.org/preservation/ ) about

Quote:
When dumping the ROM contents alone, this discards everything else about the game. For an emulator, this means there is no PCB layout information. In other words, we don't know where to map ROM and RAM to. The current state of SNES emulation is to use extremely elaborate hacks that essentially put ROM and RAM everywhere, even though the real cartridges didn't exactly work this way.


?

am I the only one who thinks that PCB layout information also includes the possible presence of multiple chips with different sizes instead of a single huge blob of binary data?

not that I'm advocating we should start splitting SNES dumps (until it is proven to be absolutely necessary for emulation), but still it seems to me you're not being completely objective on the subject ;)

by on (#63719)
65024U wrote:
No offense man it's just that all this stuff could be figured out with a internal database inside the emulator which IIRC, One emulator does that.


no offense taken.

still, if you go to the route of the internal database, then iNES headers really becomes useless and info can directly go in the db itsels...

that's what pushed me towards the next step, but I can understand that possibly other devs don't see in this an important aspect


65024U wrote:
I love the idea but just don't like how to implement it you have to either have a local database of info or include it in the file :/


well, given that there are not enough info in the file itself (i.e. the so-called standard is not so well designed, and the 2.0 format does not get serious coverage), you have to store the info somewhere else...

OTOH, if you agree on the db idea, but you don't like it to be external, feel free to add support for it internally: I have no objections if you take the database and you compile it internally to your emu, as long as you share fixes to any mistake you can find, so that the external version can be improved as well

probably, a perl script is all it's needed to add/remove the info you want and to convert xml to any format which fits your needs.

by on (#63734)
The "internal" database could be an external file. The point being that it would be an official/commercial only multi-game database used as a fallback.

Quote:
am I the only one who thinks that PCB layout information also includes the possible presence of multiple chips with different sizes instead of a single huge blob of binary data?


There are cases where the same game has been made in two different regions. One used 2x8mbit and one used 1x16mbit. The bus sees the 16mbit of data exactly the same, and the SNES program has absolutely no way of knowing that there is any difference.

With NSS, we have shit like this:
Code:
nss-c.dat / 32 KB / a8e202b3 / nss / good
nss-ic14.02 / 32 KB / e06cb58f / nss / good
m50458_char / 2 KB / / nss_actr / nodump
act-rais.ic3 / 512 KB / c9f788c2 / nss_actr / good
act-rais.ic2 / 512 KB / 4df9cc63 / nss_actr / good
act-rais.ic8 / 32 KB / 08b38ce6 / nss_actr / good

nss-c.dat / 32 KB / a8e202b3 / nss / good
nss-ic14.02 / 32 KB / e06cb58f / nss / good
m50458_char / 2 KB / / nss_fzer / nodump
nss-fz-0.ic2 / 1024 KB / e9b3cdf1 / nss_fzer / good
fz.ic7 / 32 KB / 48ae570d / nss_fzer / good


All stuffed inside ZIP files. Extremely inconsistent labeling, no XML to guide use, the only way to load this is to keep a filename listing inside the emulator source code ... exactly like MAME does.

Actraiser's ic3 comes before ic2 in a standard ROM, and valid games can be 32KB in size. And now you have to have ZIP decompression to load this aberration.

If you piece these files back together, they load and play fine in any SNES emulator.

In that comment on my site you are quoting, I am advocating for storing layout information in the XML file. The XML file can specify boundaries within the file (via offset= and size=) to map data anywhere. You can even give each section a "chipid=" field to store what you would have in the separate filenames for the ten Bootgods in the world.

by on (#63742)
byuu wrote:
In that comment on my site you are quoting, I am advocating for storing layout information in the XML file. The XML file can specify boundaries within the file (via offset= and size=) to map data anywhere. You can even give each section a "chipid=" field to store what you would have in the separate filenames for the ten Bootgods in the world.


labels are incorrect because original dumpers did not took care of labeling properly the files. when we manage to get pictures of the original boards and/or redumps we fix the filenames to follow labels. around ~30 files get renamed at each MAME update, but to recover a decade of inaccurate work takes time.

about the xml, if you run "mame -lx > output.xml" you get an xml listing of all the hardware emulated in MAME for each system, in xml format. in particular you get a precise xml description of nss boards with sizes and memory offset to load the files. MESS would be capable of load such a separate xml, MAME still keeps all the data internally ;)

however, we might move this separate NSS discussion to your boards, if you want to talk about it

by on (#63834)
blargg wrote:
Script, as in specification of mapper behavior in the config file? It wouldn't have to be at the gate level, more at a higher level, so that complex things like MMC3 could be mostly written in C internal to the emulator, and the script just specify how its registers are mapped, and any extra simple things. Something like that could be useful when one is wiring up their own cartridges in unique configurations, but still using standard components so that this could handle it. It obviously wouldn't handle something like Squeedo, though.


In my mind this is the ideal solution. I talked with Nestopia author a couple years ago when we were working on the XML DB format on this very idea but we never really went anywhere with it as it would require a lot of work to flesh it out.

It would be great if you could just give an emulator a list of chips used and some way to describe register layouts and not need to use any ines number or board name at all.

by on (#63838)
Oh, BootGod. Since you're here, I wanted to say thank you for your NES database website. It's what inspired me to start doing the same for the SNES.

Quote:
when we manage to get pictures of the original boards and/or redumps we fix the filenames to follow labels.


Well, that's an improvement at least. Still, why deviate from the way the other 4,000 dumps are stored? Let it run in everything else and keep it in one file.

Quote:
however, we might move this separate NSS discussion to your boards, if you want to talk about it


If you like, certainly. I'd like to hear your thoughts on an XML file to describe the jumpers.

Quote:
It would be great if you could just give an emulator a list of chips used and some way to describe register layouts and not need to use any ines number or board name at all.


The mappers are the reason I've never even considered an NES emulator. It would indeed be an amazing thing if everyone could share mappers.

Are you and blargg willing to work on this idea a bit more? I have the skill to write a C-like compiler that can build something into bytecode. And I think all three of us can write an interpreter.

Something like a generic VM specification for coprocessors, and a library that can execute said VM, sounds like a really fantastic idea.

It would of course be slower, no getting around that. Really depends on how in-depth it becomes, the biggest issue being synchronization if we try and run these boards with actual clocks.

by on (#63843)
byuu wrote:
Something like a generic VM specification for coprocessors, and a library that can execute said VM, sounds like a really fantastic idea.

It would of course be slower, no getting around that. Really depends on how in-depth it becomes, the biggest issue being synchronization if we try and run these boards with actual clocks.


Completely abstracting all extra cartridge logic away from the emulator would be very cool indeed, but that is really taking it to the extreme. I was thinking more along the lines of the emulator still emulates the chips native but having a dynamic way of interpreting and mapping register IO to functions. It seems like this could be accomplished without too much of a performance hit.

There are so many boards that have extra logic solely for simple bank-switching but will use a different memory region and or bits to do it.

Not too long ago I RE'd a pirate cart described here that is pretty simple overall and is a good example of a game that would be a good candidate for this system. Any emulator that supported this theoretical method could have this game just work without recompilation. You wouldn't need to choose some arbitrary mapper number that may or may not be in use by something else. You wouldn't need to make up a fake board ID in cases where it has none.

Having such a system would make dumping and testing new dumps easier too.

I've not written an emulator, so I don't think I'm the best one to be coming up with a design that is most efficient for the emulator and allows the greatest flexibility of what can be accomplished thru this configuration and what needs to stay native to the emulator.

I'm certainly willing to write up board configurations if a viable system was developed.

Sorry etabeta, I don't mean to sidetrack your topic!

by on (#63870)
It's still tangentially related to the original post :)

Quote:
I was thinking more along the lines of the emulator still emulates the chips native but having a dynamic way of interpreting and mapping register IO to functions.


That should be doable from XML, then, no?

Code:
<mmc5 id="irq" mask="(ADDR&4000)==0">
<mmc5 id="bankmap" mask="(ADDR&ff7f)==2080" dest="(ADDR&7f)>>1">


Then just have a recursive descent parser build you a bytecode table so you can evaluate the expressions faster.

by on (#63881)
this is exactly the kind of discussion I was hoping for, so don't worry about sidetracking (only the nss talk was a bit off ;) )

about jumpers and registers, there is basically no example that I could use when I started with this xml thing [1], so I looked for the solution with less impact over the existing implementation. take Konami VCR-2 boards: they have a series of pins that can be wired differently to change the lines which control bankswitch. I went with the following (gross) approach

Code:
         <feature name="pcb" value="KONAMI-VRC-2" />
         <feature name="vrc2-pin3" value="PRG A1" />
         <feature name="vrc2-pin4" value="PRG A0" />
         <feature name="vrc2-pin21" value="CHR A10" />
         <feature name="vrc2-pin22" value="CHR A16" />
         <feature name="vrc2-pin23" value="CHR A11" />
         <feature name="vrc2-pin24" value="CHR A13" />
         <feature name="vrc2-pin25" value="CHR A14" />
         <feature name="vrc2-pin26" value="CHR A12" />
         <feature name="vrc2-pin27" value="CHR A15" />
         <feature name="vrc2-pin28" value="NC" />


and MESS, whenever loading a "KONAMI-VRC-2" board, configures the switch lines depending on pin3, pin4 and pin21 (similarly to what NEStopia internally does).

but of course we might well think about pushing more things outside emulation: it would be like slowly merging various 'mappers'/'boards' together, with a few parameters/registers to be configured at loading time (by importing them from either the xml or some script or some other external source)... and I'm all for it!

it's the kind of improvement I was dreaming for when I started working on my board-based implementation, but I thought nobody else wanted to move things outside the header ;)

we can also use MESS as a guinea pig, if you want, to try 'externalizing' some of board types as a test... any suggestion about which board to start from? and about which parts should be kept internal at first (e.g. I'm not sure IRQ is a good place to start from, given the very different ways boards can deal with it)?

I'm a bit busy these days, but I will try to stay around and find some time for NES :)



[1] e.g. MAME handles internally all the jumper settings, because it had never needed to put them outside the source, and similarly MESS was not able to externalize anything until 2 months ago... I have been a sort of 'pioneer' in this field among MAME/MESS devs, and I haven't probably chosen the best solution in all the cases...

by on (#63887)
etabeta wrote:
but of course we might well think about pushing more things outside emulation: it would be like slowly merging various 'mappers'/'boards' together, with a few parameters/registers to be configured at loading time

Such as A*ROM vs. BNROM (they're the same except for mirroring), or NROM, CNROM, and GNROM (they're the same except for ROM size), or UNROM and Crazy Climber (they're the same except swapping a quad OR gate for a quad AND), or GNROM vs. Color Dreams (nibble swap).

Quote:
it's the kind of improvement I was dreaming for when I started working on my board-based implementation, but I thought nobody else wanted to move things outside the header ;)

As long as homebrew games can include their own "things outside the header"...

Quote:
any suggestion about which board to start from?

The discrete ones should be fairly easy.

by on (#63890)
I remember we already discussed something like this... I can't find the topic now, but we did.

It would be great if instead of complete mappers the emulators emulated components, and a cartridge description would indicate the parts that are used and how they are wired up. As long as the emulator knew the chips, it would be able to simulate any cartridge that used them.

That would even allow homebrewers to create new boards without the pain that is getting an unused iNES number and having the scheme implemented in different emulators.

by on (#63891)
I like the work you are doing with the preservation stuff Byuu, it will come in handy when I add SNES.

@etabeta Most of the things discussed here seem to be things favoring "ease" of development, making life easier for minority emulator programmers and cart dumpers. What benefits do you bring to the majority? Nothing really. As such, how are you going to convince them? If you don't care about convincing them then I guess it's irrelevant.

MAME isn't a good example to use in the console world because it doesn't allow homebrew development in any easy fashion. You would basically have to send out a large personalized MAME.exe that runs your "homebrew" with source included. A project like MAME that has basically walmarted arcade emulation is disappointing in these aspects. RetroCopy supports using any of the arcade boards covered in a homebrew fashion because of its better format.

Anyhow, my personal belief is these files should not contain only ROM data. It should contain information allowing complete emulation, including things that would be known about the game if you owned it. Such as whether it's 2 player, coop, etc, because these things affect the actual playing or selecting of the game. People are still thinking about what an emulator in 1999 requires to play a game instead of the future, and your "frontend" comment typifies the old thought process etabeta.

All criticisms aside, thanks for your (and others) work with this NES XML database as it will save me some time.

by on (#63893)
RetroRalph wrote:
It should contain information allowing complete emulation, including things that would be known about the game if you owned it. Such as whether it's 2 player, coop, etc, because these things affect the actual playing or selecting of the game.

And a frontend needs to know these things so that it can know what flags to pass to the emulator, such as what to tell the emulator to emulate in ports 1 and 2: controller, mouse, paddle, multitap, or any of several incompatible light guns.

And I agree with tokumaru and RetroRalph about homebrew. Any effort dedicated solely to games from a console's original commercial era is going to fizzle on a homebrew forum. To take the example of MAME, it should be as easy to get the emulator to run a new game made for Scramble hardware as it is to get a newly discovered Scramble-based bootleg running.

by on (#63904)
RetroRalph wrote:
Anyhow, my personal belief is these files should not contain only ROM data. It should contain information allowing complete emulation, including things that would be known about the game if you owned it. Such as whether it's 2 player, coop, etc, because these things affect the actual playing or selecting of the game. People are still thinking about what an emulator in 1999 requires to play a game instead of the future, and your "frontend" comment typifies the old thought process etabeta.


well, I would e.g. prefer to include the scan of a manual rather than hardcoding in the xml how the game was supposed to be used. back in the 80s, putting the cart in the console would have never self-plugged the correct controllers ;)

that's what I meant with "they belong to a frontend". as I stated in one of the first posts, I added as <feature> the kind of peripherals because that is valuable for the emulator, but where the controller should be inserted should be left up to the user... errors included (like having zapper in port 1 and being unable to play to Duck Hunt... as it happened to me the first time I fired up the game as a child ;) )!

I can understand that the all-in-one approach you use in your emu pushes you to merge the things together, but I still prefer to keep them separated in MESS.

the two approaches are not self-exclusive, though... MESS could simply use a subset of the info required by other emus and I would have no objections :)


tepples wrote:
And I agree with tokumaru and RetroRalph about homebrew. Any effort dedicated solely to games from a console's original commercial era is going to fizzle on a homebrew forum. To take the example of MAME, it should be as easy to get the emulator to run a new game made for Scramble hardware as it is to get a newly discovered Scramble-based bootleg running.


I agree as well on the importance of homebrew games & demos (especially when verified on a 'copier'): they often can be able to push the hardware closer to its limits than some official soft. It's just that I had already a lot of work in front of me to deal with ~3600 'industry' games and I had spent no time to investigate how to exactly deal with homebrew :)

for sure, any self-programmed soft should simply provide the board type (as it is now) or the pins/lines settings (if we externalize more parts of the emulation) and would work... it would already work also in current MESS if you zip up separate PRG and CHR and you manually add the entry to nes.xml!

also, boards should not be strictly limited to the existing ones (as long as a real NES could cope with them): as an example, I'd love to support the UNIF board used by Drip, if some more docs were available... ;)

by on (#63928)
Dynamically building mappers is just not worth it. Most emulators are written in reflection-less languages, so mappers would have to be designed from primitives and *netlists*. A likely implementation would be a linked list of operation expressions, where each item would need to be parsed (evaluated against dynamic registers and static interfaces) at least one time for each access at run-time.

by on (#63931)
How about just the simplest mappers being specified dynamically.

Something that would handle the mappers that just do bankswitching and mirroring selection without modes.

You just need to specify where the bytes you write to are, what address mask to use, how wide the banks are, and how the bits are shifted, AND'd and OR'd together to create the bank selection for PRG and CHR as well as mirroring.

I could see these mappers being done this way:
2, 3, 7, 11, 33, 34, 46, 57, 66, 70, 71, 75, 78, 79, 80, 89, 93, 94, 97, 107, 113, 140, 152, 164, 180, 184, 185, 193, 203, 207, 232, 240, 246
Consider this the "List of simple mappers".

by on (#65353)
tepples wrote:
And a frontend needs to know these things so that it can know what flags to pass to the emulator, such as what to tell the emulator to emulate in ports 1 and 2: controller, mouse, paddle, multitap, or any of several incompatible light guns.


Yes, what .GAME does isn't strictly "only a joypad can be used in Input 1", it simply says the game will work with a joypad in that slot. It is up to the emulator (currently only RetroCopy) to do what it wants with that information, you can still virtually plug in any input device or put the cartridge into the card slot (SMS) if you really wanted.

However it makes the emulator/frontend/whatever so much easier to use for the end-user because you can simply select and show things that are relevant. Most emulators require you to trawl through menus looking for input options, system options, region options, etc, and the everyday user has no idea about these things. It reduces problems such as "why is XXX game having glitches on the screen, i never remember it this way". When maybe a thousand people in the world know that the game doesn't correctly work when you play it on a certain region it is good to have that information somewhere to reduce support issues.

tepples wrote:
And I agree with tokumaru and RetroRalph about homebrew. Any effort dedicated solely to games from a console's original commercial era is going to fizzle on a homebrew forum. To take the example of MAME, it should be as easy to get the emulator to run a new game made for Scramble hardware as it is to get a newly discovered Scramble-based bootleg running.


From discussions with MAME people I have had it seems 99% certain they will never allow homebrew. They use various reasons such as disallowing"current games", historicity, etc. The way I see it if you emulate a system it should be able to run any software developed for that system, not just a hardcoded game. I think the open source license also has certain restrictions in regards to what you can do with this?

Most current MESS devs seem a bit more relaxed on this, however the MAME "zealots" also work on MESS time to time so at any stage the same "only commercial games" could start applying to if the balance of power switches. As ridiculously dramatic as all this sounds it seems quite silly to me.

by on (#65355)
Dwedit wrote:
How about just the simplest mappers being specified dynamically.


It's not really a solution though in my opinion, someone will always want "something more than basic".

Maybe a real solution could be an "ultimate" mapper that utilizes every bit of power you can get from the NES and is possible (and ideally cheap) in hardware. Then 99% of homebrew developers would use this mapper and never have a need for any other mappers.

With one simple restriction "only use NES hardware" an "ultimate" mapper can be figured out without too much effort. That restriction is to stop the never ending possibilities of say "an ATOM CPU in the cartridge that does all the game processing and a MPEG decoding chip for movie playback". By only using what's available on the NES you can stay faithful to the console. An ultimate mapper would cover 99% of homebrew development, the remaining 1% would never be happy with something that isn't custom I think. :)

by on (#65358)
RetroRalph wrote:
Maybe a real solution could be an "ultimate" mapper that utilizes every bit of power you can get from the NES and is possible (and ideally cheap) in hardware.

By "cheap" do you mean MMC3/FME-7 class, or do you mean MMC5? If you're putting up money to have an ASIC designed, I'd support something similar to the FME-7 (old doc here), perhaps with the ports moved down to $5000 and $5001 so as to stay out of the way of games that save by writing back to the 29F040.

by on (#65383)
tepples wrote:
RetroRalph wrote:
Maybe a real solution could be an "ultimate" mapper that utilizes every bit of power you can get from the NES and is possible (and ideally cheap) in hardware.

By "cheap" do you mean MMC3/FME-7 class, or do you mean MMC5? If you're putting up money to have an ASIC designed, I'd support something similar to the FME-7 (old doc here), perhaps with the ports moved down to $5000 and $5001 so as to stay out of the way of games that save by writing back to the 29F040.


No I mean something new that allows full use of every NES feature. The FME-7 type mapper is a good start as it gives a lot of flexibility. I haven't put much thought into an ultimate mapper for the NES, but I'm just saying it's another way to solve the problem of wanting "custom mappers". If you have every feature 99% of developers want then you've solved any need for a complex electrical simulation in emulators. Also if there was a standardized "ultimate" mapper that was easily available then NES development would be much more approachable, if it could do everything developers wanted it's also likely it could emulate nearly every existing mapper.

It's hard to know what cheap means to people, $200-300 is fine for me if the ultimate mapper devcart was nice (drag->drop USB and large amount of space), but others will only want to pay something like $20-50.

by on (#65388)
RetroRalph wrote:
It's hard to know what cheap means to people, $200-300 is fine for me if the ultimate mapper devcart was nice (drag->drop USB and large amount of space), but others will only want to pay something like $20-50.

Well, "cheap" can have different meanings depending on the type of cart you're talking about. For a devcart, $200 is an acceptable price (not great, but being a one time deal most people would be able to make the sacrifice eventually), but production carts of the games made with that devcart must be way cheaper, because nobody will pay $200 for a single NES game.

by on (#65394)
Quote:
No I mean something new that allows full use of every NES feature.

This is a great idea but unfortunately the NES is basically unlimited so this is just not possible. You could have a 4-color frame buffer system and place a PS3 in a cartridge and have 300 million polygons per frame - rendered with 4 colors and 256x240 resolution. With external sound, you're not limited either - as long as you have mono output. You can get a million PCM channels with as many bits and as many high sampling rate you want.

That being said, Membler's Squeedo is basically what you mention here. An "ultimate" mapper - that if people would really make great games for it would be awesome - but it would end up being not that ultimate as people would keep asking for more.

by on (#65397)
RetroRalph wrote:
With one simple restriction "only use NES hardware" an "ultimate" mapper can be figured out without too much effort. That restriction is to stop the never ending possibilities of say "an ATOM CPU in the cartridge that does all the game processing and a MPEG decoding chip for movie playback".

Bregalad wrote:
place a PS3 in a cartridge

Bregalad: I take it you're criticizing RetroRalph's definition of "ultimate".

by on (#65399)
tepples wrote:
RetroRalph wrote:
With one simple restriction "only use NES hardware" an "ultimate" mapper can be figured out without too much effort. That restriction is to stop the never ending possibilities of say "an ATOM CPU in the cartridge that does all the game processing and a MPEG decoding chip for movie playback".

Bregalad wrote:
place a PS3 in a cartridge

Bregalad: I take it you're criticizing RetroRalph's definition of "ultimate".

I LOLed.

by on (#65411)
concerning the original topic, I plan to try some more work on the xml thing around the end of the months, if my real work permits it.

I'd like to discuss a bit more with bootgod before, though...

too many things to do and no time to do them all :(

RetroRalph wrote:
From discussions with MAME people I have had it seems 99% certain they will never allow homebrew.


"allow" where and which homebrew? if you mean arcade homebrew in the MAME source, then yes. but as long as you name the modified roms in the same way of the roms of the original pcb, then you can run any program in MAME, just being warned of wrong crc.

RetroRalph wrote:
The way I see it if you emulate a system it should be able to run any software developed for that system, not just a hardcoded game.


in general it is easier for computer/console hardware. less easy for arcade hardware. as I said, though, you can run other software in MAME, just you should not expect it to be officially supported in the source

RetroRalph wrote:
I think the open source license also has certain restrictions in regards to what you can do with this?


only if you add games which are actively sold (we don't want to harm people producing new games)

RetroRalph wrote:
Most current MESS devs seem a bit more relaxed on this, however the MAME "zealots" also work on MESS time to time so at any stage the same "only commercial games" could start applying to if the balance of power switches. As ridiculously dramatic as all this sounds it seems quite silly to me.


you are full of prejudices, my friend... the point is simply that what applies to arcades (MAME) does not fully apply to home systems (MESS)

1. any software (official+homebrew) can be run in MESS and it is natural that this won't change at any time: half of the fun when emulating old home computers is being able to run the software you might have created back in the days and there are large communities of TI99-4 and Tandy CoCo users which use MESS exactly for this reason
2. even when talking about adding homebrew to xml lists (which got added to MESS to offer some list of 'confirmed' dumps, so that we can avoid bug reports caused by bad images), there are not so many zealots as you might think. to make an example, Arbee is strongly against any homebrew software in MAME, but he fully supports demos & homebrew to be officially listed for home computers like Amiga or consoles like a2600, as long as the software runs on the real hardware

how all this affects this thread? it's simple: NES homebrew will always be supported by MESS in both iNES and UNIF format. moreover, once I finalize the external xml thing for NES, we might decide to add homebrew to this part of the code as well (again restricting to software which runs on the real hardware)