Here is the updated proposal, as promised.
Byte 7: Flags 7
Code: Select all
7654 3210
---------
NNNN SSTT
|||| ||++- Console type (see below)
|||| ++--- NES 2.0 identificator (binary 10)
++++------ Upper four bits of mapper number
Console types:
$00 Regular NES/Famicom/Dendy home console, byte 13 unused
$01 Vs. System, byte 13's two nibbles indicating palette and protection/type
$02 Playchoice 10, byte 13 unused, three Misc. ROMs specified in byte 14 (8 KiB INST, 16 bytes PROM Data, 16 bytes PROM CounterOut).
$03 Extended, byte 13 further describing the console
Byte 9: Upper bits of ROM size
Code: Select all
7 0
---------
CCCC PPPP
C: 4 more CHR ROM size bits
P: 4 more PRG ROM size bits
If P/C has the value $F, header bytes $4/$5 changes meaning from number of 16 KiB/8 KiB PRG/CHR banks to the following floating-point-like format:
7 0
---------
EEEE EEMM
|||| ||++- Multiplier, actual value is MM*2+1 (1,3,5,7)
++++ ++--- Exponent (2^E), 0-63
The actual PRG- or CHR-ROM size therefore becomes 2^E * (MM*2+1). This allows for ROM sizes larger than the current maximum of 64 MiB without too much padding.
Byte 12: TV System
Code: Select all
7654 3210
---------
.... ..TT
++- Frame timing
0: RP2C02 (NTSC)
1: RP2C07 (PAL licensed)
2: RP2C02 and RP2C07 (game self-adjusting or doesn't matter)
3: UMC 6527P (PAL with NTSC-like timing, also known as "Dendy" or "Micro Genius" mode)
Byte 13 if Byte 7 AND $03 == $01: Vs. Hardware
Code: Select all
Bits 0-3: Palette (unchanged from current spec)
Bits 4-7: Vs. Mode
$0 Normal- no special mode(s)
$1 RBI Baseball (protection hardware at port 5E0xh)
$2 TKO Boxing (protection hardware at port 5E0xh, different from 1)
$3 Super Xevious (protection hardware at port 5xxxh)
$4 Vs. Ice Climber Japanese (protection: controller bit $08s always 1)
$5 Vs. Dual System
$6 Vs. Raid on Bungeling Bay (dual CPU, protection: controller bit $08s always 1)
Byte 13 if Byte 7 AND $03 == $03: Extended console type
Code: Select all
$00 NES/Famicom
$01 Vs. System
$02 Playchoice 10
$03 Bit Corporation Creator (normal Famiclone but with decimal-mode-supporting CPU)
$04 VT01 Monochrome
$05 VT01 Red/Cyan
$06 VT02
$07 VT03
$08 VT09
$09 VT3x
$0A VT36x
$0B-$FF Reserved for future expansion
Byte 15: Input/expansion port device
Code: Select all
$00 Unspecified, use NES standard controllers
$01 Famicom controllers with Microphone
$02 NES Four Score/Satellite with two additional standard controllers
$03 Famicom Four Players Adapter with two additional standard controllers
$04 Vs. System
$05 Vs. System with reversed inputs
$06 Vs. Pinball (Japan)
$07 Vs. Zapper
$08 Zapper
$09 Two Zappers
$0A Bandai Hyper Shot
$0B Power Pad Side A
$0C Power Pad Side B
$0D Family Trainer Side A
$0E Family Trainer Side B
$0F Arkanoid Paddle (NES)
$10 Arkanoid Paddle (Famicom)
$11 Two Vaus Controllers plus Famicom Data Recorder
$12 Konami Hyper Shot
$13 Coconuts Pachinko Controller
$14 Exciting Boxing Punching Bag
$15 Jissen Mahjong Controller
$16 Party Tap
$17 Oeka Kids Tablet
$18 Sunsoft Barcode Battler
$19 Miracle Piano Keyboard
$1A Pokkun Moguraa
$1B Top Rider
$1C Double-Fisted
$1D Famicom 3D System
$1E Doremikko Keyboard
$1F R.O.B. Gyro Set
$20 Famicom Data Recorder (don't emulate keyboard)
$21 ASCII Turbo File
$22 IGS Storage Battle Box
$23 Family BASIC Keyboard plus Famicom Data Recorder
$24 Dongda PEC-586 Keyboard
$25 Bit Corp. Bit-79 Keyboard
$26 Subor Keyboard
$27 Subor Keyboard plus mouse (3x8-bit protocol)
$28 Subor Keyboard plus mouse (24-bit protocol)
$29 SNES Mouse
$2A Generic multicart
$2B Two SNES controllers replacing the two standard NES controllers
Input Device Notes:
- Does not include input devices that attach to cartridge hardware.
- Most games only support one input device, making this value entirely unambiguous for them. For the few (mostly homebrew) games that allow selecting devices, this becomes a "default" input --- pick one, or don't and leave it at $00, letting the user decide in any case.
Device-specific notes:
- "Famicom controllers with Microphone": Use only if the microphone is actually used.
- "Vs. System": Used for both Unisystem and Dual.
- "Famicom Four Players Adapter": Use only if the games use the 3P and 4P controllers for independent input, not if they're just doubling 1P and 2P input.
- "Two Zappers": Becomes just "Zapper" if the user has only one mouse and does not use netplay. Even when emulating two Zappers, keep emulating 1P controller (the $4016 bits do not overlap, after all) so that player may choose to use it as well.
- "Two Vaus Controllers plus Famicom Data Recorder": For Arkanoid II.
- "Double-Fisted": Used for Crazy Climber and Smash TV. Implies NES Four Score for Smash TV's two-player double-fisted mode, which does not bother Crazy Climber.
- "R.O.B. Gyro Set": See what Nestopia does there.
- "Subor Keyboard": Implies Tape Recorder.
- "Generic multicart": Emulate this as "Zapper in Famicom Expansion port", keeping 1P and 2P controllers attached. This value exists to signal to emulators so-inclined to detect the handful of common expansion-device-using multicart games, for example by comparing ROM strings involving controller read code, and auto-select the device for the selected game.
ROM layout for Vs. Dual games:
- Most Vs. Dual games have unique 32 KiB PRG-ROM for each unit. Include both sequentially for 64 KiB of PRG-ROM.
- If both units have the same CHR-ROM data, include it only once.
- Vs. Mahjong has 24 KiB of PRG-ROM for each unit. Include both sequentially for 48 KiB of PRG-ROM, mapping each 24 KiB to each CPU's $A000-$FFFF, keeping CPU $8000-$9FFF as open bus.
- Vs. Raid on Bungeling Bay has 32 KiB of PRG-ROM for the first unit, and 8 KiB of PRG-ROM for the second unit. Include the first 32 KiB, then the second unit's 8 KiB without padding to form 40 KiB of PRG-ROM, denoted by setting byte 9's LSB to $F and byte 4 to $36. Map the first unit's 32 KiB to CPU $8000-$FFFF, the second unit's 8 KiB to CPU $E000-$FFFF, and keep the second unit's CPU $8000-$DFFF as open bus.
---
Obiter dictum: Note what I wrote about Playchoice 10 and Misc ROMs. The Extended Console Type now has values 0-2 identical to what Byte 7 bits 0-1 already specified for congruity.
I did not include a proposal for >64 MiB ROM sizes: the only such ROM known to me is the Coolgirl homebrew multicart, which has 66.5 MiB and would be nasty to pad to a power of two, so I am still undecided on what to do with that. Here is my current Nintendulator-NRS build, which includes an updated Header Editor incorporating all aspects of this proposal including the new byte 9. (It does not actually emulate all those expansion devices, yet.)
Edit: I have incorporated Rainwarrior's floating-point-ish proposal and modified the ROM layout description for
Vs. Raid on Bungeling Bay to make use of it. This could also be used to contain Galaxian's 8 KiB of PRG-ROM without padding. Doing so would however break compatibility with existing emulators that would otherwise run the game, one of NES 2.0's stated goals. It's less of an issue for
Vs. Raid on Bungeling Bay because no previous emulator runs the game from an iNES-format image anyway.