T9552

From NESdev Wiki
Revision as of 19:10, 18 January 2023 by Rainwarrior (talk | contribs) (add forum reference)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

T9552 is the silkscreen name of a chip on early Waixing cartridge circuit boards that scrambles the order of PRG and CHR address bits. Register $5000 selects the scrambling pattern:

Scrambling Pattern Select ($5000, write)

Mask: $F000

D~[.... .pPP]
         |++-- PRG scrambling pattern (0-3)
         +++-- CHR scrambling pattern (0-7)

Power-on value: $00

PRG Scrambling Patterns

$5000 value
0/4             1/5             2/6             3/7
PRG A16         PRG A17         PRG A14         PRG A15
PRG A17         PRG A16         PRG A15         PRG A14
PRG A15         PRG A14         PRG A16         PRG A17
PRG A14         PRG A15         PRG A17         PRG A16

CHR Scrambling Patterns

$5000 value
0               1               2               3               4               5               6               7
CHR A15         CHR A14         CHR A12         CHR A16         CHR A15         CHR A14         CHR A13         CHR A12
CHR A12         CHR A15         CHR A13         CHR A14         CHR A13         CHR A12         CHR A16         CHR A15
CHR A16         CHR A13         CHR A14         CHR A12         CHR A17         CHR A15         CHR A14         CHR A16
CHR A17         CHR A12         CHR A15         CHR A13         CHR A16         CHR A16         CHR A15         CHR A17
CHR A14         CHR A17         CHR A16         CHR A17         CHR A12         CHR A17         CHR A12         CHR A13
CHR A13         CHR A16         CHR A17         CHR A15         CHR A14         CHR A13         CHR A17         CHR A14

ROM file bank order

iNES Mapper 249 was originally assigned to indicate that the PRG/CHR banks are stored in the file as they appear when $5000=00. iNES Mapper 4, submapper 5 indicates that the PRG/CHR banks are stored in the files as they appear when $5000=02. This resembles the unscrambled bank order, as all known games choose this value, and later re-releases of the games using common TKROM-compatible boards use the same bank order. Because all known games using the T9552 chip immediately write $02 to $5000, scrambling effectively does not strictly need to be emulated for mapper 4 submapper 5 ROM files for the games to run, though accurate emulation would boot them with scrambled banks according to pattern 0. As $5000 value $02 is thought to represent the true on-die bank order, the assignment of mapper 4.5 effectively deprecates mapper 249.

To use the above tables in emulation, choose the column whose heading corresponds to the current $5000 value. Then, for every MMC3 output address signal, locate the corresponding row within that column. Within that row, pick either column 0 if the ROM header indicates mapper 249, or column 2 if the ROM header indicates mapper 4 submapper 5. For example, if mapper=249, $5000=02 and PRG ROM bank $02 (PRG A14) is selected, PRG A14 becomes PRG A16, so PRG Bank $08 in the ROM file it is.

References