INES Mapper 045: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(Created page with "Category:iNES Mappers Here are Disch's original notes: ======================== = Mapper 045 = ======================== Example Games: -----------…")
 
(Add other menu selection mechanism)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:iNES Mappers]]
{{DEFAULTSORT:045}}[[Category:iNES Mappers]][[Category:MMC3-like mappers]][[Category:Multicart mappers]][[Category:Mappers with scanline IRQs]]
iNES Mapper 045 denotes multicart PCBs using the GA23C ASIC in its standard configuration. It is an [[MMC3]] clone with four outer bank registers.


  Here are Disch's original notes: 
=Registers=
  ========================
The four outer bank registers are accessed at address $6000. The first write goes to the first register, the second write to the second, and so on; the fifth write goes to the first register again. The outer bank registers overlay WRAM and function regardless of the MMC3's WRAM bits' setting.
  =  Mapper 045          =
 
  ========================
==MMC3-compatible registers==
 
* Bank select ($8000-$9FFE, even)
  Example Games:
* Bank data ($8001-$9FFF, odd)
  --------------------------
* Mirroring ($A000-$BFFE, even)
  Super 8-in-1
* PRG RAM protect ($A001-$BFFF, odd)
  Super 4-in-1
* IRQ latch ($C000-$DFFE, even)
  Super 1000000-in-1
* IRQ reload ($C001-$DFFF, odd)
 
* IRQ disable ($E000-$FFFE, even)
 
* IRQ enable ($E001-$FFFF, odd)
  Notes:
These registers function identically to the [[MMC3]], with the PRG/CHR bank registers subject to masking by the outer bank registers.
  ---------------------------
 
 
==CHR-OR LSB ($6000 #0, write)==
  This mapper is another MMC3 multicart, only it works a bit strangely.  The multicart selects PRG/CHR blocks
Mask: $F001
  independently through 4 internal registers (accessed via $6000-7FFF). MMC3 registers then operate normally
  within the current block.
D~7654 3210
 
  ---------
  For info on MMC3, see mapper 004.
  CCCC CCCC
 
  ++++-++++- Select CHR A10-A17, OR'd with MMC3's CHR A10-A17 masked according to CHR-AND
 
 
  Registers:
==PRG-OR LSB ($6000 #1, write)==
  ---------------------------
Mask: $F001
 
     $6000-7FFF:  Multicart regs
D~7654 3210
     $8000-FFFF: Same as MMC3 for selected blocks
  ---------
 
  ppPP PPPP
  When Multicart regs are locked, writes to $6000-7FFF proceed to PRG-RAM, as normal.
  ||++-++++- Select PRG A13-A18, OR'd with MMC3's PRG A13-A18 masked according to PRG-AND
 
  ++-------- Select PRG A19-A20
  Where the game writes in the $6000-7FFF range doesn't matter.  An internal counter selects which reg gets
 
  written to.  ie:
==CHR-AND, CHR-OR/PRG-OR MSB ($6000 #2, write)==
 
Mask: $F001
    LDA #$00
    STA $6000 ; first write, goes to reg 0
D~7654 3210
    STA $6000 ; second write, goes to reg 1
  ---------
    STA $6000 ; reg 2
  PPCC cccc
    STA $6000 ; reg 3
  |||| ++++- Select number of CHR bits from MMC3
    STA $6000 ; back to reg 0, etc
  ||||      ($F: 256 KiB, $E: 128 KiB ... $7-$0: 1 KiB)
 
  ||++------ Select CHR A18-A19
 
  ++-------- Select CHR A20-A21 and PRG A21-22
    Reg 0:  [CCCC CCCC]  Low 8 bits of CHR-OR
 
    Reg 1:  [PPPP PPPP]  PRG-OR
==PRG-AND, register lock ($6000 #3, write)==
    Reg 2:  [CCCC SSSS]
Mask: $F001
            S = CHR-AND block size
            C = High 4 bits of CHR-OR
D~7654 3210
    Reg 3:  [.LAA AAAA]
  ---------
            L = Lock Multicart regs (1=locked)
  1LPP PPPP
            A = Inverted PRG-AND
     |++ ++++- Select PRG-AND mask (inverted)
 
     |||      ($00: 512 KiB, $20: 256 KiB...)
  Once multicart regs are locked, the only way to unlock is to Reset the system.
    +-------- 1=Lock outer bank registers
 
 
 
==Reset outer bank registers and release lock ($6001, write)==
  CHR Setup:
Writing any value to $6001 (mask: $F001) resets the outer bank registers as a soft reset would, clearing the "Lock" bit and making the next write to $6000 go to register #0.
  --------------------------
 
 
==Menu Selection #1 ($5000-$5FFF, read)==
  'S' bits are somewhat strange. They seem to select the size of the CHR block to mask out:
The ''超强年度新卡 (Super New Year Cart) 15-in-1'' multicart has a DIP switch whose setting causes the menu program to select one of eight different menus.
    'S'  Block size    CHR-AND
A~FEDC BA98 7654 3210  D~7654 3210
    ----------------------------
  -------------------   ---------
    $F      256k          $FF
  0101 AAAA AAAA ....    .... ...D
    $E      128k          $7F
        ++++-++++-----------------+- 1=If DIP switch is in the position selected by the corresponding A bit
    $D        64k          $3F
This means that:
        ...
* If the dip switch is in the "0" position, reads from $5010 return with D0 set while reads from $5020, $5040...$5800 return with D0 clear.
    $8        2k          $01
* If the dip switch is in the "1" position, reads from $5020 return with D0 set while reads from $5010, $5040...$5800 return with D0 clear.
    7-0        1k          $00
* If the dip switch is in the "7" position, reads from $5800 return with D0 set while reads from $5010, $5020...$5400 return with D0 clear.
 
 
 
==Menu Selection #2==
  An easy way to emulate this:
Some multicarts select between five different menus by connecting one of the higher address lines to PRG /CE. The menu code selects between menus by checking which of the higher address lines disables PRG-ROM when set.
 
Selection 0: No address line connected to PRG /CE
    chr_and = 0xFF >> ~S_bits;
Selection 1: PRG A20 connected to PRG /CE
 
  Selection 2: CHR A20 connected to PRG /CE
  CHR-OR is straightforward
Selection 3: PRG A19 connected to PRG /CE
 
Selection 4: CHR A19 connected to PRG /CE
 
Cartridges with 1 MiB of PRG-/CHR-ROM cannot use selections 3/4, cartridges with 2 MiB of more of PRG-/CHR-ROM cannot use this menu selection mechanism.
 
=Notes=
  PRG Setup:
* Some multicart menus write the same values to the outer bank registers multiple times. Experiments during dumping do not suggest that this is necessary.
  -------------------------
* NES 2.0 Mappers [[NES 2.0 Mapper 356|356]], [[NES 2.0 Mapper 372|372]] and [[NES 2.0 Mapper 373|373]] repurpose bits from outer bank register #2 for other things.
 
* [[NES 2.0 Mapper 269]] is an enhanced plug-and-play console variant of this mapper.
  PRG-OR is straightforward.
 
  PRG-AND is inverted. XOR written value with $3F for actual PRG-AND.
 
 
 
  Odd game behavior:
  -------------------------
 
  Games seem to set the multicart registers in a loop that runs 256 times. Why it does this isn't known,
  neither is whether or not it is actually necessary.
 
 
 
  Powerup and reset:
  -------------------------
 
  Block 0 must be selected on powerup and reset. Regs must be unlocked, as well... and they must be reset so
  that the next write will write to reg 0.

Latest revision as of 21:03, 23 February 2022

iNES Mapper 045 denotes multicart PCBs using the GA23C ASIC in its standard configuration. It is an MMC3 clone with four outer bank registers.

Registers

The four outer bank registers are accessed at address $6000. The first write goes to the first register, the second write to the second, and so on; the fifth write goes to the first register again. The outer bank registers overlay WRAM and function regardless of the MMC3's WRAM bits' setting.

MMC3-compatible registers

  • Bank select ($8000-$9FFE, even)
  • Bank data ($8001-$9FFF, odd)
  • Mirroring ($A000-$BFFE, even)
  • PRG RAM protect ($A001-$BFFF, odd)
  • IRQ latch ($C000-$DFFE, even)
  • IRQ reload ($C001-$DFFF, odd)
  • IRQ disable ($E000-$FFFE, even)
  • IRQ enable ($E001-$FFFF, odd)

These registers function identically to the MMC3, with the PRG/CHR bank registers subject to masking by the outer bank registers.

CHR-OR LSB ($6000 #0, write)

Mask: $F001

D~7654 3210
  ---------
  CCCC CCCC
  ++++-++++- Select CHR A10-A17, OR'd with MMC3's CHR A10-A17 masked according to CHR-AND

PRG-OR LSB ($6000 #1, write)

Mask: $F001

D~7654 3210
  ---------
  ppPP PPPP
  ||++-++++- Select PRG A13-A18, OR'd with MMC3's PRG A13-A18 masked according to PRG-AND
  ++-------- Select PRG A19-A20

CHR-AND, CHR-OR/PRG-OR MSB ($6000 #2, write)

Mask: $F001

D~7654 3210
  ---------
  PPCC cccc
  |||| ++++- Select number of CHR bits from MMC3
  ||||       ($F: 256 KiB, $E: 128 KiB ... $7-$0: 1 KiB)
  ||++------ Select CHR A18-A19
  ++-------- Select CHR A20-A21 and PRG A21-22

PRG-AND, register lock ($6000 #3, write)

Mask: $F001

D~7654 3210
  ---------
  1LPP PPPP
   |++ ++++- Select PRG-AND mask (inverted)
   |||       ($00: 512 KiB, $20: 256 KiB...)
   +-------- 1=Lock outer bank registers

Reset outer bank registers and release lock ($6001, write)

Writing any value to $6001 (mask: $F001) resets the outer bank registers as a soft reset would, clearing the "Lock" bit and making the next write to $6000 go to register #0.

Menu Selection #1 ($5000-$5FFF, read)

The 超强年度新卡 (Super New Year Cart) 15-in-1 multicart has a DIP switch whose setting causes the menu program to select one of eight different menus.

A~FEDC BA98 7654 3210  D~7654 3210
  -------------------    ---------
  0101 AAAA AAAA ....    .... ...D
       ++++-++++-----------------+- 1=If DIP switch is in the position selected by the corresponding A bit

This means that:

  • If the dip switch is in the "0" position, reads from $5010 return with D0 set while reads from $5020, $5040...$5800 return with D0 clear.
  • If the dip switch is in the "1" position, reads from $5020 return with D0 set while reads from $5010, $5040...$5800 return with D0 clear.
  • If the dip switch is in the "7" position, reads from $5800 return with D0 set while reads from $5010, $5020...$5400 return with D0 clear.

Menu Selection #2

Some multicarts select between five different menus by connecting one of the higher address lines to PRG /CE. The menu code selects between menus by checking which of the higher address lines disables PRG-ROM when set.

Selection 0: No address line connected to PRG /CE
Selection 1: PRG A20 connected to PRG /CE
Selection 2: CHR A20 connected to PRG /CE
Selection 3: PRG A19 connected to PRG /CE
Selection 4: CHR A19 connected to PRG /CE

Cartridges with 1 MiB of PRG-/CHR-ROM cannot use selections 3/4, cartridges with 2 MiB of more of PRG-/CHR-ROM cannot use this menu selection mechanism.

Notes

  • Some multicart menus write the same values to the outer bank registers multiple times. Experiments during dumping do not suggest that this is necessary.
  • NES 2.0 Mappers 356, 372 and 373 repurpose bits from outer bank register #2 for other things.
  • NES 2.0 Mapper 269 is an enhanced plug-and-play console variant of this mapper.