kyuusaku wrote:
The ROM is binary but everything else is metadata, and since you have SO MUCH metadata, it's time to use a generic container. Using a generic container will mean that controversial areas of your specification can be safely ignored. Personally I don't even understand why your format handles iNES and UNIF (which never caught on), or why the half-width katakana which is little different than romanizing Japanese into ASCII anyways.
I put a note about the katakana so you should only use ASCII; it is likely to change much. If a generic container i sused, something like ZIP would probably be better since it can contain binary data. However, I think the format as it is now is OK, and like I have said before you can safely skip over much of it, and it is easy to skip over parts of the format which is not understood because a length is included with each command. The DotFami format itself does not handle iNES (including NES 2.0) and UNIF; these are optional features, supported by external files ines.map and unif.map, which is not required for an emulator to use anyways (the ines.map and unif.map files could even be parsed by external programs; the emulator does not need to know anything about them). Another thing that could do, is an emulator might have its own support for many iNES mappers, and if it finds a unknown mapper number to convert to DotFami using ines.map, and could also directly load .fami files.
kyuusaku wrote:
I think the mapper idea is inconsistent since you have a few limited 74 series, but can use ASIC and magical sound chip entities. Are people expected to make their own discrete latches, registers etc? Do you know how difficult it is to write a logic simulator that is able to simulate a mapper and sound chip from discrete gates? It'd be essential to simulate propagation. For sound what about all the analog characteristics from the DAC, filters, hybrid chips etc? Few if any emulators in circulation today even emulate at the bus-level.
Note that I have greatly changed over time; at first I listed the 74 series and ASICs but it is different now (look at it if you want to know). Yes you can make your own discrete latches, registers etc, although I intend to add some things to make it easier in some ways. For sound, I did recently add the plain digital-to-analog converter, and I could add filters if it is wanted too. I know they don't emulate at the bus-level, and how it can be difficult. It is why I suggested compiling into native code according to what the emulator requires (LLVM could be used, perhaps, if it helps), and make open source programs, it can reuse code in other programs since it is open source. Using interpreted simulations would be slow, although you could use it if you want if nothing else is available. For computers having CPLD and/or FPGA, that could be used too.
MottZilla wrote:
The iNES format already does what needs to be done for 99% of licensed or non-pirate titles. There is a small minority of titles that currently need hacks or hash checks to identify to run properly such as Startropics (MMC6) or various alternate MMC1 boards. iNES 2.0 should handle this. The main problem is that the ROM sets people have and that are still distributed have the old iNES 1.0 header and so until their ROMs are updated with the new header, iNES 2.0 can't help. And so we are back to hash checks or other detections. But for homebrew and hacks it shouldn't be as much of a problem as they will be newly distributed and can have a iNES 2.0 header and avoid these issues.
Yes, NES 2.0 is better format than 1.0, and I do also try to work on making a suggested list of submapper numbers for disambiguation (the official workers of NES 2.0 format can reject my suggestions if they want to, of course). While NES 2.0 can help many of these things, it cannot support custom mappers, unless you assign a mapper number. Also with DotFami, it may allow to specify mappers which are too modern for an emulator to support if the new mapper numbers are assigned after the emulator is written. This is what the ines.map file is for. And for experimental purposes, you may not want to assign any mapper numbers at all, so you will use .fami directly.
I have added support for NES 2.0 to Unofficial MagicKit (some people suggested making NES 2.0 the default, but there are some reasons why I refused), and intend to add support for UNIF and DotFami as well (DotFami format is currently written enough that this could be done; the assembler needs only understand $FE and $FF mapper commands, and can write the rest to output directly).
rainwarrior wrote:
When you make a spec like this that allows radical customization, it can become succeptible to unexpected abuse/conflicts. There are likely going to be exotic combinations allowed by the spec that will be underdefined or unimplementable, and may expose differences between different emulator implementations, etc. The example I'm reminded of is the NSF spec versus multi-expansion. A lot of people really like this feature, but there are issues like the FDS memory conflicts which are implemented differently in every emulator and create a headache for people that want a widely supported NSF. DotFami seems wider reaching than this, and could open a big can of worms.
This is the reason why I try to specify explicitly what happens in these cases, and what cases explicitly are defined as undefined behavior.
rainwarrior wrote:
As a programmer, I actually like the idea of being able to construct a mapper from generic building blocks, but only thinking of it as an emulator implementation. Like, instead of writing separate code for every mapper, I just have a table of mapper components that I look up and attach to some virtual mapper interface. It might be a sensible design for implementing mappers internally, but I'm not sure I like it as a file format.
In case you do not like it as a file format, that is also why ines.map exists and using such things as an emulator implementation you could compile ines.map and the *.cart files into a C code in the emulator, if that is what you prefer.
rainwarrior wrote:
If I was a ripper, I would want to choose the correct mapper, and a situation like this is much more error prone than just choosing the right iNES mapper number. Sure it would be nice to be able to fit in edge cases that we currently can't handle with iNES, but for everything else that's already handled you're introducing 100 other settings that could be wrong in the header. (People seem to have enough trouble getting the few settings in iNES correct.)
To choose the correct mapper, one thing you would need to do is to figure out what mapper it uses (which could be partially auto-detected, and I may make something like this in future). I am introducing many settings but most of them are optional anyways, so you do not need to use them. For ripping, I would prefer to make separate files, and then combined into iNES and/or DotFami format.
rainwarrior wrote:
As a user, I generally prefer single-file formats for my game collection.
It works regardless of what format you use.
rainwarrior wrote:
Anyhow, as usual I think the practical application and real implementation is the important thing. Get this into an emulator. Create some rips. Show use how it's useful. Maybe it'll be great.
Agreed. I cannot create any rips, but I may create some files that use custom mappers (since if I wanted to make something using custom mappers, I would certainly do this). For the standard mappers, the .cart (or programs which compile into it) and ines.map/unif.map could be created too.