INES Mapper 137: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(→‎Mode and Mirroring Select (Internal 7): previous simple mode explanation was confusing, move it above the caveat)
(→‎Variants: italics)
 
(2 intermediate revisions by one other user not shown)
Line 13: Line 13:


== Variants ==
== Variants ==
There is only one known 8259D game, The Great Wall.  It has 32KiB PRG ROM and 32KiB CHR ROM.  It has been seen in the wild as iNES 137 and UNIF "UNL-Sachen-8259D".
There is only one known 8259D game, ''The Great Wall''.  It has 32KiB PRG ROM and 32KiB CHR ROM.  It has been seen in the wild as iNES 137 and UNIF "UNL-Sachen-8259D".


== Banks ==
== Banks ==
Line 25: Line 25:
== Registers ==
== Registers ==
Registers should be masked with $C101.
Registers should be masked with $C101.
=== Reg Select ($4100) ===
=== Register Select ($4100) ===
  7  bit  0
  7  bit  0
  ---- ----
  ---- ----
Line 32: Line 32:
       +++- Select register number for next data write
       +++- Select register number for next data write


=== Reg Data ($4000, $4001, $4101) ===
=== Register Data ($4101) ===
  7  bit  0
  7  bit  0
  ---- ----
  ---- ----
Line 39: Line 39:
       +++- Output data to register selected by $4100.
       +++- Output data to register selected by $4100.


=== Chr Select (Internal 0-3) ===
=== CHR Select (Internal 0-3) ===
  7  bit  0
  7  bit  0
  ---- ----
  ---- ----
Line 46: Line 46:
       +++- Select lower 3 bits of 1KiB CHR block for PPU $0000/$0400/$0800/$0C00
       +++- Select lower 3 bits of 1KiB CHR block for PPU $0000/$0400/$0800/$0C00


=== Chr Top Bits (Internal 4) ===
=== CHR Top Bits (Internal 4) ===
  7  bit  0
  7  bit  0
  ---- ----
  ---- ----
  .... .DCB
  .... .DCB
       |||
       |||
       ||+- Select bit #4 for chr reg 1
       ||+- Select bit #4 for CHR register 1
       |+-- Select bit #4 for chr reg 2
       |+-- Select bit #4 for CHR register 2
       +--- Select bit #4 for chr reg 3
       +--- Select bit #4 for CHR register 3


=== Prg Bank (Internal 5) ===
=== PRG Bank (Internal 5) ===
  7  bit  0
  7  bit  0
  ---- ----
  ---- ----
Line 62: Line 62:
       +++- Select 32KiB PRG bank for CPU $8000
       +++- Select 32KiB PRG bank for CPU $8000


=== Chr 3 Bit #3 (Internal 6) ===
=== CHR 3 Bit #3 (Internal 6) ===
  7  bit  0
  7  bit  0
  ---- ----
  ---- ----
  .... ...E
  .... ...E
         |
         |
         +- Select bit #3 for chr reg 3
         +- Select bit #3 for CHR register 3


Putting all of this together, the 4 chr regs have the following bit layouts:
Putting all of this together, the 4 CHR registers have the following bit layouts:
  7  bit  0
  7  bit  0
  ---- ----
  ---- ----
  ...0 0ccc  chr reg 0
  ...0 0ccc  CHR register 0
  ...B 0ccc  chr reg 1
  ...B 0ccc  CHR register 1
  ...C 0ccc  chr reg 2
  ...C 0ccc  CHR register 2
  ...D Eccc  chr reg 3
  ...D Eccc  CHR register 3
So only chr reg 3 can access all possible locations in CHR ROM.
So only CHR register 3 can access all possible locations in CHR ROM.


=== Mode and Mirroring Select (Internal 7) ===
=== Mode and Mirroring Select (Internal 7) ===
The only game only writes 0x2 to this register (i.e. mm=1, s=0) and wants vertical mirroring/horizontal layout. Underdocumentation has caused someone to set the "4-screen" bit in the header for ''The Great Wall'', but this is unnecessary and erroneous.
The below is deduction, and differs from the normal Sachen 8259 behavior, because some rewiring is necessary for the reduced bank size.
  7  bit  0
  7  bit  0
  ---- ----
  ---- ----
  .... .mms
  .... .mms
       |||
       |||
       ||+- Enable "simple" mode. (mirroring is fixed to V, and ignoring registers 1-3)
       ||+- Enable "simple" mode. (mirroring is fixed to ''H'', and banks become weird)
       ++-- Select mirroring (0 = V, 1 = H, 2 = (0,1,1,1), 3 = 1scA)
       ++-- Select mirroring (0 = ''H'', 1 = ''V'', 2 = (0,1,1,1), 3 = 1scA)
 
The upper two bits of the address are still controlled by the mapper when in "simple" mode, even though the three LSBs now all come from register 0. "Simple" mode doesn't affect the behavior of the external 74-series ICs.


Caution: the above is suspect. The only game only writes 0x2 to this register (i.e. mm=1) and wants vertical mirroring/horizontal layout. Additionally, some rewiring is necessary for the reduced bank size, and so there are two likely behaviors:
== See also ==
# Select mirroring (0,1,2=V; 3=1scA), and
* http://cah4e3.shedevr.org.ru/%5Blst%5D-sachen-mappers.txt
# Select mirroring (0=H, 1=V, 2=L, 3=1scA)

Latest revision as of 20:16, 16 February 2023


iNES Mapper 137 is used to represent the Sachen 8259D board. It is similar to the Sachen 8259A-C boards, but has some important differences. The information here comes primarily from FCEU-mm and may have some inaccuracies.

Overview

  • PRG ROM size: up to 128 KiB
  • PRG ROM bank size: 32 KiB
  • PRG RAM: No
  • CHR capacity: up to 32KiB ROM
  • CHR bank size: 1 KiB / 4KiB
  • Nametable mirroring: Mapper controlled
  • Subject to bus conflicts: No

Variants

There is only one known 8259D game, The Great Wall. It has 32KiB PRG ROM and 32KiB CHR ROM. It has been seen in the wild as iNES 137 and UNIF "UNL-Sachen-8259D".

Banks

  • CPU $8000-$FFFF: 32KiB switchable PRG ROM bank
  • PPU $0000-$03FF: 1KiB switchable CHR ROM bank
  • PPU $0400-$07FF: 1KiB switchable CHR ROM bank
  • PPU $0800-$0BFF: 1KiB switchable CHR ROM bank
  • PPU $0C00-$0FFF: 1KiB switchable CHR ROM bank
  • PPU $1000-$1FFF: fixed to last 4KiB of CHR ROM

Registers

Registers should be masked with $C101.

Register Select ($4100)

7  bit  0
---- ----
.... .rrr
      |||
      +++- Select register number for next data write

Register Data ($4101)

7  bit  0
---- ----
.... .ddd
      |||
      +++- Output data to register selected by $4100.

CHR Select (Internal 0-3)

7  bit  0
---- ----
.... .ccc
      |||
      +++- Select lower 3 bits of 1KiB CHR block for PPU $0000/$0400/$0800/$0C00

CHR Top Bits (Internal 4)

7  bit  0
---- ----
.... .DCB
      |||
      ||+- Select bit #4 for CHR register 1
      |+-- Select bit #4 for CHR register 2
      +--- Select bit #4 for CHR register 3

PRG Bank (Internal 5)

7  bit  0
---- ----
.... .ppp
      |||
      +++- Select 32KiB PRG bank for CPU $8000

CHR 3 Bit #3 (Internal 6)

7  bit  0
---- ----
.... ...E
        |
        +- Select bit #3 for CHR register 3

Putting all of this together, the 4 CHR registers have the following bit layouts:

7  bit  0
---- ----
...0 0ccc  CHR register 0
...B 0ccc  CHR register 1
...C 0ccc  CHR register 2
...D Eccc  CHR register 3

So only CHR register 3 can access all possible locations in CHR ROM.

Mode and Mirroring Select (Internal 7)

The only game only writes 0x2 to this register (i.e. mm=1, s=0) and wants vertical mirroring/horizontal layout. Underdocumentation has caused someone to set the "4-screen" bit in the header for The Great Wall, but this is unnecessary and erroneous.

The below is deduction, and differs from the normal Sachen 8259 behavior, because some rewiring is necessary for the reduced bank size.

7  bit  0
---- ----
.... .mms
      |||
      ||+- Enable "simple" mode. (mirroring is fixed to H, and banks become weird)
      ++-- Select mirroring (0 = H, 1 = V, 2 = (0,1,1,1), 3 = 1scA)

The upper two bits of the address are still controlled by the mapper when in "simple" mode, even though the three LSBs now all come from register 0. "Simple" mode doesn't affect the behavior of the external 74-series ICs.

See also