User:Zzo38/Mapper E: Difference between revisions
No edit summary |
No edit summary |
||
Line 83: | Line 83: | ||
== PRG RAM == | == PRG RAM == | ||
There is 8K PRG RAM at $6000-$7FFF (optional feature). Sometimes the user register is also mapped here, but it might not be. There is no bus conflicts. | There is 8K PRG RAM at $6000-$7FFF (optional feature). Sometimes the user register is also mapped here, but it might not be. There is no bus conflicts. | ||
== Trainer ROM == | |||
If trainer ROM and PRG RAM are both present, then the $5000-$5FFF area is the trainer ROM (mirrored to fill the entire address range). This may be used to program individual games which are on such a cartridge, so that they can still be tested in the emulator, and then later you can combine them into one without a trainer ROM. | |||
== ROM/RAM sizes == | == ROM/RAM sizes == |
Revision as of 22:34, 23 December 2013
This is a mapper for multigame cartridges, although it has other features useful for other purposes, too. Compare also iNES Mapper 028.
You may be able to make multiple programs using mappers such as:
- NROM
- CNROM (no expansion audio)
- GNROM
- UNROM
- UxROM
- AxROM
- BNROM
- MHROM
- iNES Mapper 029
- iNES Mapper 038
- iNES Mapper 070
- iNES Mapper 087
- UN1ROM
- iNES Mapper 101
- iNES Mapper 107
- iNES Mapper 140
- iNES Mapper 203
- iNES Mapper 218
- Color Dreams
Depending on ROM/RAM sizes and submapper numbers, it might not be possible to use all combinations, and in mappers with a fixed lower bank, it will be necessary to duplicate the banks.
Registers
Bankswitching masks
[0101 .... .... ..xy]
Writing to these four registers (of eight bits each, regardless of ROM size) controls the bankswitching masks:
- The "x" bit is 0 for PRG banks or 1 for CHR banks (CHR banks can be ROM or RAM; see below section).
- The "y" bit is 0 for AND masks or 1 for XOR masks.
This produces four ports visible to the program:
- $5000: PRG AND mask
- $5001: PRG XOR mask
- $5002: CHR AND mask
- $5003: CHR XOR mask
Control register
[0101 .... .... .1..]
Writing to this register will write the control register (one of the mask registers will also be set at the same time).
7654 3210 [BFUE EEMM] |||| |||| |||| ||++- Nametable mirroring controls |||+-++--- CIRAM enable bits ||+------- User register at $6000-$7FFF |+-------- Fixed bank at $C000-$FFFF +--------- Bus conflicts
The meaning of nametable mirroring controls is determining what CIRAM A10 is connected to:
- 00 = A10
- 01 = A11
- 10 = A12
- 11 = A13
The CIRAM enable bits are as follows (if the bit is set, CIRAM is enabled):
- bit2 = PPU address $0000-$0FFF
- bit3 = PPU address $1000-$1FFF
- bit4 = PPU address $2000-$3FFF
If the control register is exactly $13, and the high four bits of the PRG AND mask are clear, and CHR RAM in the cartridge is enabled, then the CIRAM A10 will be PPU A13 XOR bit4 of the user register.
The user registers at $6000-$7FFF means, if this bit is set, writes to $6000-$FFFF will write the user register; if cleared, the user register is at $8000-$FFFF.
The fixed bank bit, if set, causes reads from $C000-$FFFF to be treated as if the user register is set to $FF, although it doesn't cause it to be changed.
If the bus conflicts bit is set, then there are bus conflicts on registers mapped at $8000-$FFFF. This does not apply to registers mapped at $6000-$7FFF, regardless if this bit is set or not. It is undefined whether or not it applies to registers at $5000-$5FFF.
User register
The user register is mapped at either $6000-$FFFF or $8000-$FFFF. There is no bus conflicts. Calling the registers "pa" (PRG AND), "px" (PRG XOR), "ca" (CHR AND), "cx" (CHR XOR), and "u" (User), the bank selection is as follows:
- 32K PRG bank at $8000-$FFFF: (u AND pa) XOR px
- 8K CHR bank at $0000-$1FFF and $2000-$3FFF: (u AND ca) XOR cx
If the ROM is small enough that eight bits are not used, the bits of the result are ORed together to determine what bank to select.
Supervisor ROM
Reading from $5000-$5FFF reads from PRG ROM as if the PRG AND mask and PRG XOR mask are both zero (then it will be the same data at $D000-$DFFF).
PRG RAM
There is 8K PRG RAM at $6000-$7FFF (optional feature). Sometimes the user register is also mapped here, but it might not be. There is no bus conflicts.
Trainer ROM
If trainer ROM and PRG RAM are both present, then the $5000-$5FFF area is the trainer ROM (mirrored to fill the entire address range). This may be used to program individual games which are on such a cartridge, so that they can still be tested in the emulator, and then later you can combine them into one without a trainer ROM.
ROM/RAM sizes
PRG bankswitching is ROM only, although CHR may be ROM and/or RAM. Subtypes of bankswitching are the high two bits of the submapper number for PRG, and the low two bits for CHR.
In the table below, "ROM" and "RAM" means the number of bits needed to select the bank; "-" means the ROM/RAM is not present. The column "sub" means the submapper number.
ROM RAM sub calc - 0 0 No bankswitching - 1 0 RAM=[76543210] - 2 0 RAM=[7531 6420] - 2 1 RAM=[7654 3210] 0 - 0 No bankswitching 0 0 0 RAM if any bit set; ROM if all bits clear 0 0 1 RAM if all bits set; ROM if any bit clear 0 1 0 ROM if all bits clear, otherwise RAM=[6543210] 0 1 1 ROM if all bits clear, otherwise RAM=[7654321] 1 - 0 Bank 1 if any bit set; bank 0 if all bits clear 2 - 0 ROM=[7531 6420] 2 - 1 ROM=[7654 3210] 3 - 0 ROM=[70 642 531] 3 - 1 ROM=[72 641 530] 4 - 0 ROM=[73 62 51 40] 4 - 1 ROM=[75 64 31 20] 4 0 0 EN=[76] ROM=[3 2 51 40] 4 1 0 EN=[76] ROM=[3 2 51 40] RAM=[543210] 5 - 0 ROM=[7 3 62 51 40] 5 - 1 ROM=[7 0 64 53 21] 6 - 0 ROM=[7 6 5 42 31 0] 6 - 1 ROM=[7 6 53 42 1 0] 7 - 0 ROM=[7 6 5 43 2 1 0] 7 - 1 ROM=[7 65 4 3 2 1 0] 7 0 0 EN=[7] ROM=[6 5 4 3 2 1 0] 7 0 1 EN=[0] ROM=[7 6 5 4 3 2 1] 7 1 0 EN=[7] ROM=[6 5 4 3 2 1 0] RAM=[6543210] 7 1 1 EN=[0] ROM=[7 6 5 4 3 2 1] RAM=[7654321] 7 2 0 EN=[7] ROM=[6 5 4 3 2 1 0] RAM=[641 5320] 7 2 1 EN=[0] ROM=[7 6 5 4 3 2 1] RAM=[652 7431] 8 - 0 ROM=[7 6 5 4 3 2 1 0]
Notation in brackets means, any numbers without spaces between means those bits are ORed together; if there are spaces, that designates the separate bits of the bank number. EN means if RAM is enabled.