INES Mapper 215: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(Note on overdumps)
(Rewrite; split up $5000 and $5001 registers, and make it clear that this mapper describes four different boards)
Line 1: Line 1:
[[Category:INES Mappers|215]][[Category:MMC3-like mappers|215]][[Category:Mappers using $4020-$5FFF|215]]
[[Category:INES Mappers|215]][[Category:MMC3-like mappers|215]][[Category:Mappers using $4020-$5FFF|215]]
The MMC3-based Sugar Softec Type 2 mapper enhances the [[INES Mapper 114|Sugar Softec Type 1]] with greater PRG and CHR ROM sizes and a more complicated
iNES Mapper 215 combines four different MMC3-clone-bearing boards with scrambled register addresses and indices, an outer PRG/CHR-ROM bank register, and an NROM-like PRG-ROM register that can override the MMC3 clone's PRG-ROM bank.
protection scheme: while Sugar Softec Type 1 scrambles register addresses and MMC3 bank register numbers according to a fixed pattern, Type 2 allows the pattern to be changed during run-time.
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
* '''Subtype 1''': Fixed scrambling pattern #4, NROM Override Register at $6000; basically [[INES Mapper 114]] but with a different scrambling pattern. Used by:
without the need for submappers or ROM-hash-value-specific behavior:
** ''Boogerman'' (SuperGame, not to be confused with ''Boogerman II'' by Rex Soft)
* '''Subtype 2''': Selectable scrambling pattern via $5007, NROM Override/Mode Register at $5000, Outer Bank Register at $5001. UNIF board name '''UNL-8237'''. Used by:
** ''Earthworm Jim 2''
** ''Mortal Kombat 3'' (SuperGame, not ''Extra 60'', not to be confused by similarly-named games from other developers)
** ''Pocahontas Part 2''
** ''Mortal Kombat 3 Extra 60''
** ''2-in-1: Aladdin, EarthWorm Jim 2''
** ''2-in-1: EarthWorm Jim 2, Boogerman''
** ''3-in-1: Boogerman, Adventure Island 3, Double Dragon 3''
** ''5-in-1: Aladdin, EarthWorm Jim 2, Garo Densetsu Special, Silkworm, Contra Force''
** ''6-in-1: EarthWorm Jim 2, Mortal Kombat 3, Double Dragon 3, Contra 3, The Jungle Book, Turtles Tournament Fighters''
* '''Subtype 3''': Similar to '''Subtype 2''', but with an extended Outer Bank Register at $5001 to accomodate 2 MiB PRG-/CHR-ROMs. UNIF board name '''UNL-8237A'''. Used by:
** ''9-in-1: The Lion King, EarthWorm Jim 2, Aladdin, Boogerman, Somari, Turtles Tournament Fighters, Mortal Kombat 3, Captain Tsubasa 2, Taito Basketball''
* '''Subtype 4''': Fixed scrambling pattern #3, no NROM Override Register, Outer CHR-ROM Bank register at $6001, Outer PRG-ROM Bank register at $6007. Used by:
** ''2-in-1: Mortal Kombat 3 Extra 60, The Super Shinobi''
** (''Mortal Kombat 3 Extra 60'': both existing ROM images are just extracts of the 2-in-1 multicart.)


* ''Boogerman''
So far, no submappers have been proposed for the different subtypes, as they can coexist and be emulated under the same mapper number by:
* ''Earthworm Jim 2''
* powering-up in scrambling mode 4 (to accommodate '''Subtype 1''');
* ''Mortal Kombat 3''
* emulating the NROM Override/Mode Register at both $5000 and $6000 (to accomodate '''Subtypes 1-3''');
* ''Mortal Kombat 3 Extra 60''
* interpreting the bits of the Outer Bank Register at $5001 differently depending on ROM size (to differentiate '''Subtypes 2''' and '''3''');
* ''Pocahontas Part 2''
* ''not emulating'' '''Subtype 4''''s Outer Bank registers at $6001 and $6007 at all, since the only known image retains '''Subtype 2''' compatibility writes.


It will also run the following multicarts:
=Registers=
* ''2-in-1: Aladdin, EarthWorm Jim 2''
==NROM Override/Mode Register ($5000, Subtypes 2/3; $6000, Subtype 1)==
* ''2-in-1: EarthWorm Jim 2, Boogerman''
Mask: $F007 (Subtype 2/3), probably $E001 (Subtype 1)
* ''2-in-1: Mortal Kombat 3 Extra 60, The Super Shinobi''
* ''3-in-1: Boogerman, Adventure Island 3, Double Dragon 3''
D~7654 3210
* ''5-in-1: Aladdin, EarthWorm Jim 2, Garo Densetsu Special, Silkworm, Contra Force''
  ---------
* ''6-in-1: EarthWorm Jim 2, Mortal Kombat 3, Double Dragon 3, Contra 3, The Jungle Book, Turtles Tournament Fighters''
  MCS. BBBb
  |||  ++++- Select 16 KiB PRG-ROM bank at CPU
  |||        $8000-$BFFF and $C000-$FFFF
  ||+------- 0: Do not replace bit 0 (NROM-128)
  ||        1: Replace bit 0 with CPU A14 (NROM-256)
  |+-------- 0: Do not replace PRG A14 and CHR A14 from the MMC3
  |          1: Replace PRG A14 and CHR A14 with $5001 bits 4 and 5, respectively ('''Subtypes 2/3 only''')
  +--------- 0: Use PRG bank from MMC3; ignore $6000 bits 0-3/5
              1: Ignore PRG bank from MMC3; apply $6000 bits 0-3/5
Power-up value: $00
==Outer Bank Register ($5001, Subtype 2)==
Mask: $F007
D~7654 3210
  ---------
  ..cp CCPP
    || ||++- Select 256 KiB Outer PRG-ROM bank (PRG A18/A19)
    || ++--- Select 256 KiB Outer CHR-ROM bank (CHR A18/A19)
    |+------ Select 128 KiB Outer PRG-ROM bank (PRG A17) if $5000 bit 6=1
    +------- Select 128 KiB Outer CHR-ROM bank (CHR A17) if $5000 bit 6=1
Power-up value: $xF


The ''9-in-1: The Lion King, EarthWorm Jim 2, Aladdin, Boogerman, Somari, Turtles Tournament Fighters, Mortal Kombat 3, Captain Tsubasa 2, Taito Basketball'' multicart holds 2 MiB of PRG and CHR data each and assigns the pins of the Extra Banking Register differently to accomodate these larger sizes. No submapper has been assigned for this cartridge, but it can be detected by checking that the PRG ROM size is 2 MiB.
==Outer Bank Register ($5001, Subtype 3)==
Mask: $F007
D~7654 3210
  ---------
  ..cp P.PP
        CCC.
    || +|++- Select 256 KiB Outer PRG-ROM bank (PRG A18-A20)
    || +++-- Select 256 KiB Outer CHR-ROM bank (CHR A18-A20)
    |+------ Select 128 KiB Outer PRG-ROM bank (PRG A17) if $5000 bit 6=1
    +------- Select 128 KiB Outer CHR-ROM bank (CHR A17) if $5000 bit 6=1
Power-up value: $xF


This description is based on [https://github.com/asfdfdfd/fceux/blob/master/src/boards/8237.cpp FCEUX's implementation],
==Scrambling Pattern Register ($5007, Subtypes 2 and 3)==
with the exception that FCEUX does not mirror the $5000 register at $6000 and therefore cannot run ''Boogerman''.
Mask: $F007
D~7654 3210
  ---------
  .... .MMM
        +++- Select MMC3 register address and index scrambling mode (0-7)
Power-up value: Unknown; use $04 for compatibility with '''Subtype 1'''


==Registers==
==Outer CHR-ROM Bank Register ($6001, Subtype 4)==
===Extra Banking Register Low Byte ($5xx0 and $6xx0, write-only)===
Mask: $E007
Sets the low byte of the 16-bit-wide extra bank register. The default value at startup is $00.
D~7654 3210
  ---------
  .... ...+- Select 256 KiB CHR-ROM bank at PPU $0000-$1FFF


Note that this register exists at both $5xx0 and $6xx0, the latter address being necessary for ''Boogerman''.
Since the only known Subtype 4 cartridge also retains compatibility writes to $5000/$5001/$5007, this register does not need to be emulated.
 
==Outer PRG-ROM Bank Register ($6007, Subtype 4)==
===Extra Banking Register High Byte ($5xx1 only, write-only)===
Mask: $E007
Sets the high byte of the 16-bit-wide extra bank register. The default value at startup is $FF.
 
D~7654 3210
Note that this register does not exist at $6xx1, even though ''Mortal Kombat 3 Extra 60'' pretends that it does.
  ---------
 
  PPPP Pppp
===Set Scramble Pattern ($5xx7, write-only)===
  |||| |+++- Select Inner Bank Mask (4=128 KiB, i.e. $0F; 5=256 KiB, i.e. $1F)
Selects one of eight arrays that define how the MMC3-compatible register addresses are scrambled.
  ++++-+---- Select 64 KiB Outer Bank
The default value at startup is $04.
 
Power-up Value: $25
Note that this register does not exist at $6xx7, even though ''Mortal Kombat 3 Extra 60'' pretends that it does.


===MMC3-compatible registers ($8000-$FFFF, write-only)===
The only known Subtype 4 cartridge uses the values $05 for the first 256 KiB game and $25 for the second 256 KiB game. Since it also retains compatibility writes to $5000/$5001/$5007, this register does not need to be emulated.
After unscrambling the address and the data written, these registers function the same as the MMC3's, unless overriden by the
==MMC3-compatible registers ($8000-$FFFF, write-only)==
Extra Banking Register.
After unscrambling the address and the data written, these registers function the same as the MMC3's. The scrambled addresses correspond to the real address as follows:
 
The scrambled addresses correspond to the real address as follows:
  $5007 -------------address written-----------
  $5007 -------------address written-----------
  value 8000 8001 A000 A001 C000 C001 E000 E001
  value 8000 8001 A000 A001 C000 C001 E000 E001
Line 76: Line 130:
Note that bits 6 and 7 of register $8000 are kept as they are. The data written to $8001 and $A000-$FFFF is never scrambled.
Note that bits 6 and 7 of register $8000 are kept as they are. The data written to $8001 and $A000-$FFFF is never scrambled.


===Extra Banking register (all cartridges except 9-in-1) ===
=Note=
FEDC BA98 7654 3210
* Games with only 256 KiB of CHR-ROM still use 512 KiB chips; the other 256 KiB usually contain leftover data from another game.
---- ---- ---- ----
..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
  || ||++----------- Outer PRG bank number
  || ++------------- Outer 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 outer 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 used by some of the multicarts to put two MMC3 games into one outer PRG/CHR bank.
 
===Extra Banking register (9-in-1 multicart) ===
FEDC BA98 7654 3210
---- ---- ---- ----
..cp P.PP MSK. PPPP
      CCC.
  || |||| |||  ||||
  || |||| |||  ++++- 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
  || |||+----------- Outer PRG bank number bit 0
  || ||+------------ Outer PRG bank number bit 1 ''and'' Outer CHR bank number bit 0
  || |+------------- Outer CHR bank number bit 1
  || +-------------- Outer PRG bank number bit 2 ''and'' Outer CHR bank number bit 2
  |+---------------- 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
 
In the ''9-in-1'' multicart, the outer PRG and CHR number have three rather than two bits each, two of them overlapping with each other.
 
==Notes==
Several ROM images using this mapper are overdumped in the sense that they contain additional PRG or CHR banks from other games. That data is in the actual cartridges' ROM chips; apparently Sugar Softec used larger ROM chips than they needed, because they had them in stock, and the unused space in the master file still contained data from previous runs.


==Example implementations==
=Similar Mappers=
* [https://github.com/asfdfdfd/fceux/blob/master/src/boards/8237.cpp FCEUX implementation]
* [[INES Mapper 114]] resembles '''Subtype 1''' but with a different scrambling pattern.
* [https://github.com/rdanbrook/nestopia/blob/master/source/core/board/NstBoardSuperGameBoogerman.cpp Nestopia implementation (Boogerman)]
* [[NES 2.0 Mapper 258]] has everything from '''Subtype 2''' but adds readable protection registers in the $5000-$5007 range.
* [https://github.com/rdanbrook/nestopia/blob/master/source/core/board/NstBoardSuperGamePocahontas2.cpp Nestopia implementation (Pocahontas 2)]

Revision as of 18:56, 23 May 2018

iNES Mapper 215 combines four different MMC3-clone-bearing boards with scrambled register addresses and indices, an outer PRG/CHR-ROM bank register, and an NROM-like PRG-ROM register that can override the MMC3 clone's PRG-ROM bank.

  • Subtype 1: Fixed scrambling pattern #4, NROM Override Register at $6000; basically INES Mapper 114 but with a different scrambling pattern. Used by:
    • Boogerman (SuperGame, not to be confused with Boogerman II by Rex Soft)
  • Subtype 2: Selectable scrambling pattern via $5007, NROM Override/Mode Register at $5000, Outer Bank Register at $5001. UNIF board name UNL-8237. Used by:
    • Earthworm Jim 2
    • Mortal Kombat 3 (SuperGame, not Extra 60, not to be confused by similarly-named games from other developers)
    • Pocahontas Part 2
    • Mortal Kombat 3 Extra 60
    • 2-in-1: Aladdin, EarthWorm Jim 2
    • 2-in-1: EarthWorm Jim 2, Boogerman
    • 3-in-1: Boogerman, Adventure Island 3, Double Dragon 3
    • 5-in-1: Aladdin, EarthWorm Jim 2, Garo Densetsu Special, Silkworm, Contra Force
    • 6-in-1: EarthWorm Jim 2, Mortal Kombat 3, Double Dragon 3, Contra 3, The Jungle Book, Turtles Tournament Fighters
  • Subtype 3: Similar to Subtype 2, but with an extended Outer Bank Register at $5001 to accomodate 2 MiB PRG-/CHR-ROMs. UNIF board name UNL-8237A. Used by:
    • 9-in-1: The Lion King, EarthWorm Jim 2, Aladdin, Boogerman, Somari, Turtles Tournament Fighters, Mortal Kombat 3, Captain Tsubasa 2, Taito Basketball
  • Subtype 4: Fixed scrambling pattern #3, no NROM Override Register, Outer CHR-ROM Bank register at $6001, Outer PRG-ROM Bank register at $6007. Used by:
    • 2-in-1: Mortal Kombat 3 Extra 60, The Super Shinobi
    • (Mortal Kombat 3 Extra 60: both existing ROM images are just extracts of the 2-in-1 multicart.)

So far, no submappers have been proposed for the different subtypes, as they can coexist and be emulated under the same mapper number by:

  • powering-up in scrambling mode 4 (to accommodate Subtype 1);
  • emulating the NROM Override/Mode Register at both $5000 and $6000 (to accomodate Subtypes 1-3);
  • interpreting the bits of the Outer Bank Register at $5001 differently depending on ROM size (to differentiate Subtypes 2 and 3);
  • not emulating Subtype 4's Outer Bank registers at $6001 and $6007 at all, since the only known image retains Subtype 2 compatibility writes.

Registers

NROM Override/Mode Register ($5000, Subtypes 2/3; $6000, Subtype 1)

Mask: $F007 (Subtype 2/3), probably $E001 (Subtype 1)

D~7654 3210
  ---------
  MCS. BBBb
  |||  ++++- Select 16 KiB PRG-ROM bank at CPU
  |||        $8000-$BFFF and $C000-$FFFF
  ||+------- 0: Do not replace bit 0 (NROM-128)
  ||         1: Replace bit 0 with CPU A14 (NROM-256)
  |+-------- 0: Do not replace PRG A14 and CHR A14 from the MMC3
  |          1: Replace PRG A14 and CHR A14 with $5001 bits 4 and 5, respectively (Subtypes 2/3 only)
  +--------- 0: Use PRG bank from MMC3; ignore $6000 bits 0-3/5
             1: Ignore PRG bank from MMC3; apply $6000 bits 0-3/5

Power-up value: $00

Outer Bank Register ($5001, Subtype 2)

Mask: $F007

D~7654 3210
  ---------
  ..cp CCPP
    || ||++- Select 256 KiB Outer PRG-ROM bank (PRG A18/A19)
    || ++--- Select 256 KiB Outer CHR-ROM bank (CHR A18/A19)
    |+------ Select 128 KiB Outer PRG-ROM bank (PRG A17) if $5000 bit 6=1
    +------- Select 128 KiB Outer CHR-ROM bank (CHR A17) if $5000 bit 6=1

Power-up value: $xF

Outer Bank Register ($5001, Subtype 3)

Mask: $F007

D~7654 3210
  ---------
  ..cp P.PP
       CCC.
    || +|++- Select 256 KiB Outer PRG-ROM bank (PRG A18-A20)
    || +++-- Select 256 KiB Outer CHR-ROM bank (CHR A18-A20)
    |+------ Select 128 KiB Outer PRG-ROM bank (PRG A17) if $5000 bit 6=1
    +------- Select 128 KiB Outer CHR-ROM bank (CHR A17) if $5000 bit 6=1

Power-up value: $xF

Scrambling Pattern Register ($5007, Subtypes 2 and 3)

Mask: $F007

D~7654 3210
  ---------
  .... .MMM
        +++- Select MMC3 register address and index scrambling mode (0-7)

Power-up value: Unknown; use $04 for compatibility with Subtype 1

Outer CHR-ROM Bank Register ($6001, Subtype 4)

Mask: $E007

D~7654 3210
  ---------
  .... ...+- Select 256 KiB CHR-ROM bank at PPU $0000-$1FFF

Since the only known Subtype 4 cartridge also retains compatibility writes to $5000/$5001/$5007, this register does not need to be emulated.

Outer PRG-ROM Bank Register ($6007, Subtype 4)

Mask: $E007

D~7654 3210
  ---------
  PPPP Pppp
  |||| |+++- Select Inner Bank Mask (4=128 KiB, i.e. $0F; 5=256 KiB, i.e. $1F)
  ++++-+---- Select 64 KiB Outer Bank

Power-up Value: $25

The only known Subtype 4 cartridge uses the values $05 for the first 256 KiB game and $25 for the second 256 KiB game. Since it also retains compatibility writes to $5000/$5001/$5007, this register does not need to be emulated.

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

After unscrambling the address and the data written, these registers function the same as the MMC3's. 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 $5xx7 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 $8000 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 6 and 7 of register $8000 are kept as they are. The data written to $8001 and $A000-$FFFF is never scrambled.

Note

  • Games with only 256 KiB of CHR-ROM still use 512 KiB chips; the other 256 KiB usually contain leftover data from another game.

Similar Mappers

  • INES Mapper 114 resembles Subtype 1 but with a different scrambling pattern.
  • NES 2.0 Mapper 258 has everything from Subtype 2 but adds readable protection registers in the $5000-$5007 range.