Bankswitching: Difference between revisions
(Created page with "Games which need more than 1MiB of P ROM use simple bankswitching of the "P2" ROM, which is achieved in hardware by D-latches on the PROG board. The P1 ROM is always (?) ...") |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
Games which need more than | Games which need more than 2MiB of [[P ROM]] data use simple bankswitching in the [[68k memory map|PORT memory range]] ($200000~$2FFFFF), which is achieved in hardware by latches on the cartridge's [[PROG board]]. No games use bankswitching of the ROM range ($000000~$1FFFFF) ? | ||
To switch the ROM | To switch the ROM bank, a byte needs to be written in this range. Depending on how large the ROM is, one or more bits can be used. | ||
[[File:Pbankswitch.png|thumb|300px]] | [[File:Pbankswitch.png|thumb|300px]] | ||
For example, the PROGBK1 board uses a 74LS74 dual D-latch to allow a 4MiB P2 ROM to be mapped | For example, the PROGBK1 board uses a 74LS74 dual D-latch to allow a 4MiB P2 ROM to be mapped in 4, 1MiB banks (2 bits, see schematic). | ||
In this case, when a byte write is | In this case, when a byte write is done in the $200000~$2FFFFF range, /PORTWEL falls, latching D0 and D1 which are connected to the P2 ROM's A20 and A21 lines respectively. | ||
When the NeoGeo is reset, both latches are | When the NeoGeo is reset, both latches are reset to 0, to ensure that the first bank is mapped on startup. | ||
As there is no /PORTOE signal on the cartridge edge (like /ROMOE), both /PORTOEL and /PORTOEU need to be ANDed together to make the /OE signal of P2 (if it's a 16bit ROM). | |||
As there is no /PORTOE signal on the cartridge edge (like /ROMOE), both /PORTOEL and /PORTOEU | |||
===Example code=== | ===Example code=== | ||
<pre> | <pre> | ||
move.b #3,#$200000 ; | move.b #3,#$200000 ; Set bank 3, ROM's $300000~$3FFFFF appears in $200000~$2FFFFF | ||
move.b #1,#$2B92F1 ; | move.b #1,#$2B92F1 ; Set bank 1, ROM's $100000~$1FFFFF appears in $200000~$2FFFFF | ||
</pre> | </pre> | ||
[[Category:Cartridge systems]] | [[Category:Cartridge systems]] | ||
[[Category:Chips]] | [[Category:Chips]] |
Latest revision as of 14:12, 10 June 2019
Games which need more than 2MiB of P ROM data use simple bankswitching in the PORT memory range ($200000~$2FFFFF), which is achieved in hardware by latches on the cartridge's PROG board. No games use bankswitching of the ROM range ($000000~$1FFFFF) ?
To switch the ROM bank, a byte needs to be written in this range. Depending on how large the ROM is, one or more bits can be used.
For example, the PROGBK1 board uses a 74LS74 dual D-latch to allow a 4MiB P2 ROM to be mapped in 4, 1MiB banks (2 bits, see schematic).
In this case, when a byte write is done in the $200000~$2FFFFF range, /PORTWEL falls, latching D0 and D1 which are connected to the P2 ROM's A20 and A21 lines respectively. When the NeoGeo is reset, both latches are reset to 0, to ensure that the first bank is mapped on startup.
As there is no /PORTOE signal on the cartridge edge (like /ROMOE), both /PORTOEL and /PORTOEU need to be ANDed together to make the /OE signal of P2 (if it's a 16bit ROM).
Example code
move.b #3,#$200000 ; Set bank 3, ROM's $300000~$3FFFFF appears in $200000~$2FFFFF move.b #1,#$2B92F1 ; Set bank 1, ROM's $100000~$1FFFFF appears in $200000~$2FFFFF