INES Mapper 178: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(Infrared)
(Add submapper 1)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:iNES Mappers|178]][[Category:Mappers using $4020-$5FFF|178]]
{{DEFAULTSORT:178}}[[Category:iNES Mappers]][[Category:Mappers using $4020-$5FFF]][[Category:Mappers with large PRG RAM]]'''iNES Mapper 178''' is used by some games from Waixing (on a PCB named '''FS305'''), Nanjing (on a PCB named '''NJ0430'''), Jncota and Henge Dianzi as well as some educational computers from GameStar, a.k.a. Belsonic. The chipset is designed for using 8 KiB of chip-internal unbanked CHR-RAM, but can address external RAM/ROM as well, banked in 8 KiB amounts. Circuit boards described by iNES Mapper 178 connect external RAM as bankable PRG-RAM mapped to CPU $6000-$7FFF.
VirtuaNesEX sources call this mapper "Education / WaiXing / HengGe". However, virtuanes is among most other emulators in not supporting it fully; a game "Pet Family ES-1081" has a larger PRG than this mapper was originally supposed to handle, and only Nestopia 1.40u4 has been supporting it. The rest of the emulators will manifest a bug in the nametables when the main game engine starts. With r2536, FCEUX supports it; bizhawk does as well.


This is a simple mapper.
A company named ''Gameinis'' uses this chipset along with an infrared sensor built right into the cartridge shell. This sensor will generate IRQs upon detecting movement. As some non-sensor mapper 178 games are bothered by IRQs that they are not expecting, '''Submapper 0''' denotes the absence, '''Submapper 1''' the presence of the infrared sensor, used by at least the following cartridges:
* ''Gameinis Boxing+Soccer''
* ''Gameinis Ping Pong''


  $4800: [.... ...M]
=Banks=
      M = Mirror mode
* CPU $6000-$7FFF: 8 KiB switchable PRG-RAM bank
          %0 = Vertical
* CPU $8000-$FFFF: 16/32 KiB PRG-ROM bank, switchable
          %1 = Horizontal
* PPU $0000-$1FFF: 8 KiB unbanked CHR-RAM
 
* Nametable mirroring: Switchable horizontal/vertical settings
  $4801: [...P PPP.]
=Registers=
      P = Some bits of the selected 32K PRG bank
==Mode Register ($4800)==
 
7654 3210
  $4802: [pppp pppp]
---------
      p = Some more bits of the selected 32K PRG bank
  .... .SSM
      ||+- Nametable mirroring
      ||    0: Vertical
      ||    1: Horizontal
      ++-- PRG banking mode
            0: NROM-256/BNROM (PRG A14=CPU A14)
            1: UNROM (PRG A14..16=111b if CPU A14=1)
            2: NROM-128
            3: UNROM but with bit 0 of "fixed" bank selectable
                (PRG A15..16=11b if CPU A14=1)


The selected 32K PRG bank (mapped to $8000) is P + (p<<2). The older emulators are masking this result by & 0xF which is what breaks the larger PRG games. It is unclear whether this mask is necessary for some games to work.
==Low PRG Bank Register ($4801)==
7654 3210
---------
.... .LLL
      +++- PRG A16..A14


This addition is unusual but would be expected from a multicart if $4802 originally meant "start of program" and $4801 "address within program". Pet Family seems to boot up and get past the nametable bug using an OR instead of a + which strikes me as much more likely.
This can be considered an inner bank register for UNROM mode.
==High PRG Bank Register ($4802)==
7654 3210
---------
HHHH HHHH
++++-++++- PRG A24?..A17


The new PRG bank is only committed when $4801 is written. Therefore, you should write $4802 first and then $4801 to complete the remapping.
This can be considered an outer bank register for UNROM mode.
==PRG-RAM Bank register ($4803) ==
7654 3210
---------
BBBB BBBB
++++-++++- PRG-RAM A20?..A13
 
PRG-RAM is mapped to CPU $6000-$7FFF and is banked in 8 KiB amounts.


==Infrared==
==Infrared==
Apparently some cartridge having infrared. Infrared receiving is working by having two registers:
Some cartridges have an additional infrared sensor. Infrared receiving is working by having two registers:
   $5000-$5FFF:  [.... ...V]  (read only)
   $5000-$5FFF:  [.... ...V]  (read only)
     V = read current bit from IR sensor
     V = read current bit from IR sensor
   $6000-$7FFF:  [I... ....]  (write only)
   $6000-$7FFF:  [I... ....]  (write only)
     I = set to activate interrupts by infrared signal
     I = set to activate interrupts by infrared signal
The I bit is set at power-on, i.e. without writing to the $6000-$7FFF register, interrupts will be ''enabled''.
=Errata=
* The commonly-available ROM images of
** ''宠物: 小精灵 IV (Chǒngwù: Xiǎo Jīnglíng IV)'', headerless CRC32 0xB0B13DBD
** ''Education Computer 32-in-1 (Game Star) [!]'', headerless CRC32 0xF834F634
: will not work when emulated using the above description. The meaning of registers $4801 and $4802 is swapped, and an emulator must shift the value of $4802 one bit to the left before ORing with $4801. While it cannot be ruled out that these games use an alternative version of the hardware, the more likely explanation is that these are simply bad dumps (notwithstanding GoodNES 3.23b's [!] tag) where the dumper confused the two bank registers.
* Supposedly, the new PRG bank is only committed when $4801 is written. Emulating this supposed behavior however will break ''Ping Pong'', while commiting the PRG bank after any $480x write does not seem to break anything else.
* Most of the educational computers using this mapper require Dendy video timing and will freeze at various points when run with NTSC timing.
* The Waixing FS305 circuit board connects PRG A14 directly to CPU A14, making all PRG banking modes except BNROM unusable. Since it writes the correct banking mode to $4800, it does not require any special treatment.
=See also=
* https://forums.nesdev.org/viewtopic.php?t=16657

Latest revision as of 12:39, 5 April 2020

iNES Mapper 178 is used by some games from Waixing (on a PCB named FS305), Nanjing (on a PCB named NJ0430), Jncota and Henge Dianzi as well as some educational computers from GameStar, a.k.a. Belsonic. The chipset is designed for using 8 KiB of chip-internal unbanked CHR-RAM, but can address external RAM/ROM as well, banked in 8 KiB amounts. Circuit boards described by iNES Mapper 178 connect external RAM as bankable PRG-RAM mapped to CPU $6000-$7FFF.

A company named Gameinis uses this chipset along with an infrared sensor built right into the cartridge shell. This sensor will generate IRQs upon detecting movement. As some non-sensor mapper 178 games are bothered by IRQs that they are not expecting, Submapper 0 denotes the absence, Submapper 1 the presence of the infrared sensor, used by at least the following cartridges:

  • Gameinis Boxing+Soccer
  • Gameinis Ping Pong

Banks

  • CPU $6000-$7FFF: 8 KiB switchable PRG-RAM bank
  • CPU $8000-$FFFF: 16/32 KiB PRG-ROM bank, switchable
  • PPU $0000-$1FFF: 8 KiB unbanked CHR-RAM
  • Nametable mirroring: Switchable horizontal/vertical settings

Registers

Mode Register ($4800)

7654 3210
---------
.... .SSM
      ||+- Nametable mirroring
      ||    0: Vertical
      ||    1: Horizontal
      ++-- PRG banking mode
            0: NROM-256/BNROM (PRG A14=CPU A14)
            1: UNROM (PRG A14..16=111b if CPU A14=1)
            2: NROM-128
            3: UNROM but with bit 0 of "fixed" bank selectable
               (PRG A15..16=11b if CPU A14=1)

Low PRG Bank Register ($4801)

7654 3210
---------
.... .LLL
      +++- PRG A16..A14

This can be considered an inner bank register for UNROM mode.

High PRG Bank Register ($4802)

7654 3210
---------
HHHH HHHH
++++-++++- PRG A24?..A17

This can be considered an outer bank register for UNROM mode.

PRG-RAM Bank register ($4803)

7654 3210
---------
BBBB BBBB
++++-++++- PRG-RAM A20?..A13

PRG-RAM is mapped to CPU $6000-$7FFF and is banked in 8 KiB amounts.

Infrared

Some cartridges have an additional infrared sensor. Infrared receiving is working by having two registers:

 $5000-$5FFF:  [.... ...V]  (read only)
    V = read current bit from IR sensor
 $6000-$7FFF:  [I... ....]  (write only)
    I = set to activate interrupts by infrared signal

The I bit is set at power-on, i.e. without writing to the $6000-$7FFF register, interrupts will be enabled.

Errata

  • The commonly-available ROM images of
    • 宠物: 小精灵 IV (Chǒngwù: Xiǎo Jīnglíng IV), headerless CRC32 0xB0B13DBD
    • Education Computer 32-in-1 (Game Star) [!], headerless CRC32 0xF834F634
will not work when emulated using the above description. The meaning of registers $4801 and $4802 is swapped, and an emulator must shift the value of $4802 one bit to the left before ORing with $4801. While it cannot be ruled out that these games use an alternative version of the hardware, the more likely explanation is that these are simply bad dumps (notwithstanding GoodNES 3.23b's [!] tag) where the dumper confused the two bank registers.
  • Supposedly, the new PRG bank is only committed when $4801 is written. Emulating this supposed behavior however will break Ping Pong, while commiting the PRG bank after any $480x write does not seem to break anything else.
  • Most of the educational computers using this mapper require Dendy video timing and will freeze at various points when run with NTSC timing.
  • The Waixing FS305 circuit board connects PRG A14 directly to CPU A14, making all PRG banking modes except BNROM unusable. Since it writes the correct banking mode to $4800, it does not require any special treatment.

See also