INES Mapper 215

From NESdev Wiki
Revision as of 22:52, 9 August 2017 by NewRisingSun (talk | contribs) (Described mapper in detail, provided a specification that (as far as I can tell without having played each game to the end) runs all games without submappers or CRC-based hacks.)
Jump to navigationJump to search

The MMC3-based Sugar Softec Type 2 mapper enhances the Sugar Softec Type 1 with greater PRG and CHR ROM sizes and a more complicated protection scheme: while Sugar Softec Type 1 only scrambled the data written to $8001, Type 2 scrambles the address as well according to a selectable pattern. To make life difficult for potential hackers, some of these games write to nonexistent registers; these writes should be ignored.

If implemented correctly, the following games developed, or rather ported, by SuperGame should all run under the same mapper number without the need for submappers or ROM-hash-value-specific behavior:

  • Boogerman
  • Earthworm Jim 2
  • Golden Card 6-in-1
  • Mortal Kombat 3
  • Mortal Kombat 3 Extra 60
  • Pocahontas Part 2

This description is based on FCEUX's implementation, with the exception that FCEUX does not mirror the $5000 register at $6000 and therefore cannot run Boogerman.

Registers

Extra Banking Register Low Byte ($5000 and $6000, write-only)

Sets the low byte of the 16-bit-wide extra bank register. The default value at startup is $00.

Note that this register exists at both $5000 and $6000, the latter address being necessary for Boogerman.

Extra Banking Register High Byte ($5001 only, write-only)

Sets the high byte of the 16-bit-wide extra bank register. The default value at startup is $FF.

Note that this register does not exist at $6001, even though Mortal Kombat 3 Extra 60 pretends that it does.

Set Scramble Pattern ($5007, write-only)

Selects one of eight arrays that define how the MMC3-compatible register addresses are scrambled. The default value at startup is $04.

Note that this register does not exist at $6007, even though Mortal Kombat 3 Extra 60 pretends that it does.

MMC3-compatible registers ($8000-$FFFF, write-only)

After unscrambling the address and the data written, these registers function the same as the MMC3's, unless overriden by the Extra Banking Register.

The scrambled addresses correspond to the real address as follows:

$5007	-------------address written-----------
value	8000 8001 A000 A001 C000 C001 E000 E001
-----------------------------------------------	
0	8000 8001 A000 A001 C000 C001 E000 E001
1	A001 A000 8000 C000 8001 C001 E000 E001
2?	8000 8001 A000 A001 C000 C001 E000 E001
3	C001 8000 8001 A000 A001 E001 E000 C000
4	A001 8001 8000 C001 A000 C000 E000 E001
5?	8000 8001 A000 A001 C000 C001 E000 E001
6?	8000 8001 A000 A001 C000 C001 E000 E001
7?	8000 8001 A000 A001 C000 C001 E000 E001

? denotes $5007 values that according to the FCEUX source code are unused by all known games.

The data that is written to the low three bits of register $8001 corresponds to the real data as follows:

$5007	-value written-
value	0 1 2 3 4 5 6 7
-----------------------
0	0 1 2 3 4 5 6 7
1	0 2 6 1 7 3 4 5
2?	0 5 4 1 7 2 6 3
3	0 6 3 7 5 2 4 1
4	0 2 5 3 6 1 7 4
5?	0 1 2 3 4 5 6 7
6?	0 1 2 3 4 5 6 7
7?	0 1 2 3 4 5 6 7 

? denotes $5007 values that according to the FCEUX source code are unused by all known games. Note that bits 3 to 7 of register $8001 are kept as they are. The data written to $8000 and $A000-$FFFF is never scrambled.

Extra Banking register

FEDC BA98 7654 3210
---- ---- ---- ----
..cp CCPP MSK. PPPP
  || |||| |||  ||||
  || |||| |||  ++++- Lower four bits of PRG bank number in Extra Banking Register PRG Banking Mode. Ignored in MMC3 PRG Banking Mode.
  || |||| ||+------- Select PRG Bank Size in Extra Banking Register PRG Banking Mode. Ignored in MMC3 PRG Banking Mode.
  || |||| ||           0: 16K, 8000 and C000 mapped to the same selected bank number
  || |||| ||           1: 32K, 8000 mapped to selected bank number SHR 1
  || |||| |+-------- Select Inner Bank Number MSB Substitution
  || |||| |            0: Leave highest inner bank number bit as it is
  || |||| |            1: Substitute highest inner bank number bit with bit 12 (PRG)/bit 13 (CHR) of Extra Banking Register
  || |||| +--------- PRG Banking Mode
  || ||||              0: MMC3 Mode
  || ||||              1: Extra Banking Register Mode
  || ||++----------- Two upper bits of PRG bank number in both MMC3 and Extra Banking Register PRG Banking Mode
  || ++------------- Two upper bits of CHR bank number
  |+---------------- Highest bit of inner PRG bank number if Inner Bank Number MSB Substitution is enabled   
  +----------------- Highest bit of inner CHR bank number if Inner Bank Number MSB Substitution is enabled
  

Bit 7 determines the source of the inner PRG bank. It can be five bits from the MMC3 bank registers 6 and 7, or the four lowest bits of the Extra Banking Register. If the source is the Extra Banking Register, then Bit 5 determines whether the selected PRG bank number is a 16K bank mapped to both CPU $8000 and $C000, or a 32K PRG bank number mapped to CPU $8000.

The inner CHR bank always comes from the MMC3's bank registers 0 to 5 (all eight bits each).

Bits 8 and 9 provide the outer PRG Bank number, bits 10 and 11 the other CHR bank number.

Bit 6, if set, causes both PRG and CHR inner bank numbers' highest bit to be chopped off and substituted with bit 12 (inner PRG bank) and bit 13 (inner CHR bank) from the Extra Banking Register, respectively. This is only used by Golden Cart 6-in-1 multicart to put two MMC3 games into one outer PRG/CHR bank.

Example implementations