Bandai EPROM mapper

From NESdev Wiki
Revision as of 20:35, 26 December 2010 by Tepples (talk | contribs) (based on Disch)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Bandai EPROM mapper is an ad hoc designation for a mapper used by Bandai for Dragon Ball and Gundam games. iNES Mapper 016 and iNES Mapper 159

Hardware: PRG ROM, CHR ROM, no PRG RAM, serial EPROM.

Ports

The mapper's ports are mirrored at $6000-$FFFF, except for the EPROM I/O register which can only be read at $6000-$7FFF.

  • $8000-$8007: Select 1024 byte CHR bank at $0000, $0400, ..., $1C00
  • $8008: Select 16384 byte PRG bank at $8000 (the last bank is fixed at $C000)
  • $8009: Mirroring (0: vertical; 1: horizontal; 2: 1-screen $2000; 3: 1-screen $2C00)
  • $800A: IRQ control (0: pause; 1: count; any write acknowledges)
  • $800B: Low 8 bits of IRQ counter
  • $800C: High 8 bits of IRQ counter
  • $800D: EPROM write

When enabled, IRQ counts down by 1 every CPU cycle. /IRQ goes low when the counter goes from $0001 to $0000, and it goes high when $800A is written. The counter is not reloaded after IRQ; it'll fire once every 65536 cycles unless paused or reloaded with $800B/$800C writes.

Any read from $6000-$7FFF appears to read the EPROM.

EPROM appears to be laid out like this:

7  bit  0  $800D: EPROM control
|||' ''''
||+-------- Clock?
|+--------- Data in?
+---------- Unknown

7654 3210  $6000-$7FFF: EPROM read
   |
   +------ Data out

Some patterns observed in the games' save code:

  • Start I/O: $00 $40 $60 $20 $00
  • Write 0 bit: $00 $20 $00
  • Write 1 bit: $00 $40 $60 $40 $00
  • Unknown: $00 $20 $A0 Read $00
  • Read bit: $60 $E0 Read $40
  • Stop I/O: $00 $20 $60 $40 $C0