Bandai EPROM mapper: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(iNES Mapper 016 states that the serial EPROM is optional)
(what the bits actually mean; also the "unknown" sequence is the "ACK" you send between packets on the 24C02)
Line 2: Line 2:
This mapper has two iNES numbers, depending on which save chip is present: [[iNES Mapper 016]] and [[iNES Mapper 159]].
This mapper has two iNES numbers, depending on which save chip is present: [[iNES Mapper 016]] and [[iNES Mapper 159]].


Hardware: PRG ROM (16 KiB banks, one switchable and one fixed), CHR ROM (1 KiB banks), no PRG RAM, optional serial EPROM.
Hardware: PRG ROM (16 KiB banks, one switchable and one fixed), CHR ROM (1 KiB banks), no PRG RAM, optional serial EEPROM (24C02 or 24C01).


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


*$8000-$8007: Select 1024 byte CHR bank at $0000, $0400, ..., $1C00
*$8000-$8007: Select 1024 byte CHR bank at $0000, $0400, ..., $1C00
Line 13: Line 13:
*$800B: Low 8 bits of IRQ counter
*$800B: Low 8 bits of IRQ counter
*$800C: High 8 bits of IRQ counter
*$800C: High 8 bits of IRQ counter
*$800D: EPROM write
*$800D: EEPROM 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.
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.
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.
Any read from $6000-$7FFF appears to read the EEPROM.


EPROM appears to be laid out like this:
EEPROM appears to be laid out like this:
<pre>
<pre>
7  bit  0  $800D: EPROM control
7  bit  0  $800D: EPROM control
|||' ''''
|||' ''''
||+-------- Clock?
||+-------- Clock
|+--------- Data in?
|+--------- Data in
+---------- Unknown
+---------- Enable Read


7654 3210  $6000-$7FFF: EPROM read
7654 3210  $6000-$7FFF: EPROM read
Line 32: Line 32:
   +------ Data out
   +------ Data out
</pre>
</pre>
Some patterns observed in the games' save code:
Some patterns observed in the games' save code:
* Start I/O: $00 $40 $60 $20 $00
* Start I/O: $00 $40 $60 $20 $00
* Write 0 bit: $00 $20 $00
* Write 0 bit: $00 $20 $00
* Write 1 bit: $00 $40 $60 $40 $00
* Write 1 bit: $00 $40 $60 $40 $00
* Unknown: $00 $20 $A0 Read $00
* Acknowledge: $00 $20 $A0 Read $00
* Read bit: $60 $E0 Read $40
* Read bit: $60 $E0 Read $40
* Stop I/O: $00 $20 $60 $40 $C0
* Stop I/O: $00 $20 $60 $40 $C0

Revision as of 02:38, 2 January 2011

Bandai EPROM mapper is an ad hoc designation for a mapper used by Bandai for Dragon Ball and Gundam games. This mapper has two iNES numbers, depending on which save chip is present: iNES Mapper 016 and iNES Mapper 159.

Hardware: PRG ROM (16 KiB banks, one switchable and one fixed), CHR ROM (1 KiB banks), no PRG RAM, optional serial EEPROM (24C02 or 24C01).

Ports

The mapper's ports are mirrored at $6000-$FFFF, except for the EEPROM 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: EEPROM 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 EEPROM.

EEPROM appears to be laid out like this:

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

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
  • Acknowledge: $00 $20 $A0 Read $00
  • Read bit: $60 $E0 Read $40
  • Stop I/O: $00 $20 $60 $40 $C0