Files
atari2600/docs/bankswitching.txt
Raimon @ quifisraimon 22fd027cff - [NEW] Afegits varios documents útils recopilats.
- [NEW] Afegida la rom de Combat.
- [NEW] Afegit mòdul "rom"
- [NEW] Ampliats stubs de "mem", "tia" i "pia"
2026-09-10 13:50:56 +02:00

38 lines
2.3 KiB
Plaintext

From: https://forums.atariage.com/topic/192418-mirrored-memory/
There are two bankswitching schemes commonly called 3E and 3F because those
zero-page addresses are used as hotspots to trigger a bank switch. The original
version was 3F, also called Tigervision because it was used by Tigervision, and
there is an extended version of 3F, as well as 3E. (I'm no expert on these
schemes, so this information may contain errors.) I'm not sure if extended 3F
and 3E are the same, or separate schemes, but 3E adds extra RAM, whereas 3F and
extended 3F don't necessarily add extra RAM.
Anyway, these bankswitching schemes divide the 4K cartridge area into two 2K
slots. The upper 2K area ($1800 - $1FFF) always points to the last 2K of the
cartridge ROM, but the lower 2K area ($1000 - $17FF) can be selected from
several 2K banks by writing the desired bank number into address $3F. I think
the original version had four 2K banks, for a total cartridge size of 8K,
whereas the extended version allows up to 256 2K banks, for a total cartridge
size of 512K.
The 3E version still uses address $3F to select between different 2K ROM banks,
but it also allows you to select between different 1K banks of extra RAM by
writing the desired RAM bank number into address $3E.
The TIA write addresses are $00 - $2C, and the TIA read addresses are $0 - $D,
so even though $3E and $3F fall within the memory area that's normally
associated with the TIA chip, they don't actually correspond to any addresses
or mirrors that are used by the TIA read or write registers. So in theory it
should be safe to use $3E and $3F as bankswitching hotspots without interfering
with the TIA addresses and mirrors.
However, it's my understanding that any access below $40 (i.e., from $00 - $3F)
can trigger a bank switch in these schemes-- although this might not be true
for all cartridges that use 3E or 3F bankswitching (I don't know). For this
reason, the TIA addresses are usually (or always?) relocated to $40 - $7F when
using 3E or 3F bankswitching. That is, $40 - $6C are used for the TIA write
registers, and either $40 - $4D or $70 - $7D are used for the TIA read
registers. Since these are mirrors of the "real" TIA addresses, accessing them
is the same (from the TIA's point of view) as accessing $00 - $2C and $00 - $0D.