NES 2.0 Mapper 400
NES 2.0 Mapper 400 denotes retroUSB’s 8-BIT XMAS 2017 homebrew cartridge. It’s basically a multicart version of the “Christmas lights” variant of UNROM 512 (mapper 30 submapper 4) with the addition of a TFT LCD in place of a cartridge label.
- CPU $8000-$BFFF: 16 KiB switchable inner and outer window #1 into 4 MiB of PRG-ROM
- CPU $C000-$FFFF: 16 KiB fixed inner and switchable outer window #2 into 4 MiB of PRG-ROM, inner bank fixed at #7
- PPU $0000-$1FFF: 8 KiB switchable window into 32 KiB of CHR-RAM
- PPU $2000-$3FFF: Switchable horizontally-arranged/vertically-arranged console-internal nametables
D~[.CC. .PPP] A~[11.. .... .... ....] ($C000-$FFFF, no bus conflicts)
|| |||
|| +++- Inner 16 KiB PRG-ROM bank# at CPU $8000-$BFFF (PRG A16..14)
++------- 8 KiB CHR-RAM bank#
D~[PPPP P...] A~[0111 0??? ??00 0000] ($7000)
++++-+----- Outer 128 KiB PRG-ROM bank# at CPU $8000-$BFFF (PRG A21..17)
The lower address bits are checked as well, because 8-Bit XMAS 2008 performs APU writes to $7001-$7015, oddly enough, which must be ignored.
D~[PPPP P...] A~[0111 1???? ????] ($7800)
++++-+----- Outer 128 KiB PRG-ROM bank# at CPU $C000-$FFFF (PRG A21..17)
+-------- Nametable Arrangement
0: Horizontal arrangement/Vertical mirroring
1: Vertical arrangement/Horizontal mirroring
D~[BYGR bygr] A~[10.. .... .... ....] ($8000-$BFFF, no bus conflicts)
|||| |||+- Red 1, Red 2
|||| ||+-- Green 1, Green 2
|||| |+--- Yellow 1, Yellow 2
|||| +---- Blue 1, Blue 2
|||+------ Red 3, Red, 4
||+------- Green 3, Green 4
|+-------- Yellow 3, Yellow 4
+--------- Blue 3, Blue 4
LEDs are lit when the respective bit is clear and dark when the respective bit is set. Arrangement of LEDs and their respective register bit values:
+-----------------+ +-----------------+
|01 20| |R1 G3|
|04 80| |Y1 B3|
|08 40| |B1 Y3|
|02 10| |G1 R3|
|01 20| |R2 G4|
|04 80| |Y2 B4|
| 02 08 40 10 | | G2 B2 Y4 R4 |
+--+ +--+ +--+ +--+
+-----------+ +-----------+
Command port
D~[.... ..DC] A~[0110 1... .... ....] ($6800-$6FFF)
|+-- ILI9341 CSX pin
+--- ILI9341 D/CX pin
Data port
D~[DDDD DDDD] A~[???? ???? ???? ????] ($00FF)
The menu program writes $00 to $6800, then a command byte to $00FF, followed by $02 to $6800 and a series of data bytes to $00FF. It finishes by writing $03 to $6800. Refer to the ILI9341’s data sheet for a list of commands. The cartridge drives the LCD controller in 8080 MCU 8-bit bus interface mode. For simple emulation purposes, only watch for command byte $2C with 163,840 data bytes. The data consists of a 240x320 bitmap (with padding) in 16-bit big endian format, with a pixel represented as 5-6-5 RGB, bit order RRRR’RGGG’GGGB’BBBB. Note that horizontally, the data is stored from right to left.