gameboy: update MBC1--MBC5 mapper documentation

Signed-off-by: Tauwasser <tauwasser@tauwasser.eu>
This commit is contained in:
Tauwasser 2017-06-09 06:16:47 +02:00
parent e807364394
commit 0210c87222

View File

@ -25,65 +25,55 @@ MBC1 Mapper
=========== ===========
The MBC1 mapper has two modes: 2MB ROM/8KB RAM or 512KB ROM/32KB RAM. The MBC1 mapper has two modes: 2MB ROM/8KB RAM or 512KB ROM/32KB RAM.
Initially, the mapper operates in 2MB ROM/8KB RAM mode.
This mode is selected by writing into the 6000-7FFF memory area: This mode is selected by writing into the 6000-7FFF memory area:
0bXXXXXXXB - B=0 - 2MB ROM/8KB RAM mode
B=1 - 512KB ROM/32KB RAM mode
The default behaviour is to be in 2MB ROM/8KB RAM mode.
Writing a value ( 0bXXXBBBBB ) into the 2000-3FFF memory area selects the 0000-1FFF - Writing to this area enables (value 0x0A) or disables (not 0x0A) the
lower 5 bits of the ROM bank to select for the 4000-7FFF memory area. If a SRAM.
value of 0bXXX00000 is written then this will autmatically be changed to 2000-3FFF - Writing a value 0bXXXBBBBB into the 2000-3FFF memory area selects the
0bXXX00001 by the mbc chip. lower 5 bits of the ROM bank to select for the 4000-7FFF memory area.
If a value of 0bXXX00000 is written then this will autmatically be
Writing a value (0bXXXXXXBB ) into the 4000-5FFF memory area either selects changed to 0bXXX00001 by the mbc chip. Initial value 00.
the RAM bank to use or bits 6 and 7 for the ROM bank to use for the 4000-7FFF 4000-5FFF - Writing a value 0bXXXXXXBB into the 4000-5FFF memory area either selects
memory area. This behaviour depends on the memory moddel chosen. the RAM bank to use or bits 6 and 7 for the ROM bank to use for the 4000-7FFF
memory area. This behaviour depends on the memory moddel chosen.
The RAM sections are enabled by writing the value 0bXXX1010 into the 0000-1FFF These address lines are fixed in mode 1 and switch depending on A14 in mode 0.
memory area. Writing any other value disables the RAM section. In mode 0 these will drive 0 when RB 00 is accessed (A14 low) or the value set
in 4000-5FFF when RB <> 00 is accessed (A14 high).
Some unanswered cases: Switching between modes does not clear this register. Initial value 00.
#1 - Set mode 0 6000-7FFF - Writing a value 0bXXXXXXXB into the 6000-7FFF memory area switches the mode.
- Set lower bank bits to 1F B=0 - 2MB ROM/8KB RAM mode
- Set high bank bits to 01 => bank #3F B=1 - 512KB ROM/32KB RAM mode
- Set mode 1
- What ROM bank is now at 4000-7FFF, bank #1F or bank #3F?
#2 - Set mode 1
- Set ram area #1
- Set mode 0
- What ram area is now at A000-BFFF, ram bank 00 or ram bank 01?
Regular ROM aliasing rules apply.
MBC2 Mapper MBC2 Mapper
=========== ===========
The MBC2 mapper includes 512x4bits of builtin RAM. The MBC2 mapper includes 512x4bits of builtin RAM.
0000-1FFF - Writing to this area enables (value 0bXXXX1010) or disables (any 0000-3FFF - Writing to this area enables (value 0bXXXX1010) or disables (any
other value than 0bXXXX1010) the RAM. In order to perform this other value than 0bXXXX1010) the RAM. In order to perform this
function bit 12 of the address must be reset, so usable areas are function bit 8 of the address must be reset, so usable areas are
0000-00FF, 0200-02FF, 0400-04FF, 0600-06FF, ..., 1E00-1EFF. 0000-00FF, 0200-02FF, 0400-04FF, 0600-06FF, ..., 3E00-3EFF,
2000-3FFF - Writing to this area selects the rom bank to appear at 4000-7FFF. 0000-3FFF - Writing to this area selects the rom bank to appear at 4000-7FFF.
Only bits 3-0 are used to select the bank number. If a value of Only bits 3-0 are used to select the bank number. If a value of
0bXXXX0000 is written then this is automatically changed into 0bXXXX0000 is written then this is automatically changed into
0bXXXX0001 by the mapper. 0bXXXX0001 by the mapper.
In order to perform the rom banking bit 12 of the address must be In order to perform the rom banking bit 8 of the address must be
set, so usable areas are 2100-21FF, 2300-23FF, 2500-25FF, 2700- set, so usable areas are 0100-01FF, 0300-03FF, 0500-05FF, 0700-
27FF, ..., 3F00-3FFF. 07FF,..., 3F00-3FFF,
Some unanswered cases:
#1 - Set rom bank to 8 for a 4 bank rom image.
- What rom bank appears at 4000-7FFF, bank #0 or bank #1 ?
Regular ROM aliasing rules apply.
MBC3 Mapper MBC3 Mapper
=========== ===========
The MBC3 mapper cartridges can include a RTC chip. The MBC3 mapper cartridges can include a RTC chip.
0000-1FFF - Writing to this area enables (value 0x0A) or disables (0x00) the 0000-1FFF - Writing to this area enables (value 0x0A) or disables (not 0x0A) the
RAM and RTC registers. SRAM and RTC registers.
2000-3FFF - Writing to this area selects the rom bank to appear at 4000-7FFF. 2000-3FFF - Writing to this area selects the rom bank to appear at 4000-7FFF.
Bits 6-0 are used to select the bank number. If a value of Bits 6-0 are used to select the bank number. If a value of
0bX0000000 is written then this is autmatically changed into 0bX0000000 is written then this is autmatically changed into
@ -102,21 +92,12 @@ The MBC3 mapper cartridges can include a RTC chip.
6000-7FFF - Writing 0x00 followed by 0x01 latches the RTC data. This latching 6000-7FFF - Writing 0x00 followed by 0x01 latches the RTC data. This latching
method is used for reading the RTC registers. method is used for reading the RTC registers.
Some unanswered cases: Regular ROM aliasing rules apply.
#1 - Set rom bank to 8(/16/32/64) for a 4(/8/16/32) bank image.
- What rom bank appears at 4000-7FFF, bank #0 or bank #1 ?
MBC4 Mapper
===========
Stauts: not supported yet.
MBC5 Mapper MBC5 Mapper
=========== ===========
0000-1FFF - Writing to this area enables (0x0A) or disables (0x00) the RAM area. 0000-1FFF - Writing to this area enables (0x0A) or disables (not 0x0A) the SRAM area.
2000-2FFF - Writing to this area updates bits 7-0 of the rom bank number to 2000-2FFF - Writing to this area updates bits 7-0 of the rom bank number to
appear at 4000-7FFF. appear at 4000-7FFF.
3000-3FFF - Writing to this area updates bit 8 of the rom bank number to appear 3000-3FFF - Writing to this area updates bit 8 of the rom bank number to appear