INES Mapper 176

From Nesdev wiki
Jump to: navigation, search

Mapper 176 is used by some Chinese games by Waixing (aka WXN). At one point, FCEUX by way of fceumm rewired mapper 176 to be handled by the BMCFK23C board but it is unclear what that means. Hacked builds of VirtuaNesEX and Nestopia acquired support for this mapper, at least so far as to emulate "水浒神兽" (Shui Hu Shen Shou, Waixing ES-1087; literally "Water Margin Animal"; appears to be a Pokémon-style RPG). FCEUX supposedly acquired support for it in r2519 by reimplementing the mapper and getting BMCFK23C out of the picture.

CaH4e3 insists that mapper 176 belongs to BMCFK23C or variants thereof, subject to some caveats: the prg may be wired differently, and there are 'protections' relating to different dip switches which connect to address bits and control which addresses the mappers respond to. Preliminary investigation bears this out, and the chinese test case above can be made to work as a BMCFK23C variant. Consequently, this whole document may be obsolete soon and turn into a BMCFK23C reference.

This documentation is based on VirtuaNesEX's hack's and FCEUX's sources are somewhat non-representative of logical hardware. This documentation was reasoned out from those sources into a slightly more logical explanation; working sources should be considered authoritative.

The initial PRG state is as follows:

     $8000   $A000   $C000   $E000  
   +-------+-------+-------+-------+
   |   0   |   1   |   62  |   63  |
   +-------+-------+-------+-------+

This is the case even for 1024KB roms where you might expect 127 and 128 instead. Perhaps the registers are only 6 bits. This distinction is significant.

By writing to $5FF1, you can effect the following:

     $8000   $A000   $C000   $E000  
   +-------+-------+-------+-------+
   |            <$5FF1>            |
   +-------+-------+-------+-------+

By writing $24 to $5010, you can set the 'SBW' mode bit. Once that bit is set, other registers become available for mapping control. There seems to be no way to clear the bit.

By writing to $5001 with SBW set, you can effect the following:

     $8000   $A000   $C000   $E000  
   +-------+-------+-------+-------+
   |             $5001             |
   +-------+-------+-------+-------+

By writing to $5011 with SBW set, you can effect the following:

     $8000   $A000   $C000   $E000  
   +-------+-------+-------+-------+
   |            <$5011>            |
   +-------+-------+-------+-------+

There is a CHR register at $5FF2 with the following format:

 $5FF2:  [CCCC CCCC] (exact number of bits unknown)
   C = Select 8k CHR page @ $0000-1FFF

With this mapper, there may be no VROM present.

There are registers at $A000 and $A001. I haven't been able to verify them yet, but here's how VirtuaNesEX has them:

 $A000:  [.... ..MM] Mirroring
   0 = Vert
   1 = Horz
   2 = 1ScA
   3 = 1ScB
 $A001:  [.... ..EE] Enable Write SRAM
   1,2,3 = Enabled

VirtuaNesEX has the write enable fixed to always enabled. This documentation is just provided as a clue in case that works out not to work well.

Additionally, VirtuaNesEX handles register writes to $5000 and $5013 but doesn't do anything with them.