fixed comments and minor enhancement in CartFE

This commit is contained in:
thrust26 2023-09-15 13:52:39 +02:00
parent dedeaf0849
commit afe84954a8
2 changed files with 8 additions and 15 deletions

View File

@ -42,9 +42,7 @@ void CartridgeFE::install(System& system)
// The hotspot $01FE is in a mirror of zero-page RAM // The hotspot $01FE is in a mirror of zero-page RAM
// We need to claim access to it here, and deal with it in peek/poke below // We need to claim access to it here, and deal with it in peek/poke below
const System::PageAccess access(this, System::PageAccessType::READWRITE); mySystem->setPageAccess(0x1c0, System::PageAccess(this, System::PageAccessType::READWRITE));
for(uInt16 addr = 0x180; addr < 0x200; addr += System::PAGE_SIZE)
mySystem->setPageAccess(addr, access);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -31,9 +31,8 @@ class System;
Originally named SCABS (Subroutine Controlled Automatic Bank Switching) Originally named SCABS (Subroutine Controlled Automatic Bank Switching)
This scheme was originally designed to have up to 8 4K banks, and is This scheme was originally designed to have up to 8 4K banks, and is
triggered by monitoring the address bus for address $01FE. All released triggered by monitoring the address bus for address $01FE. However, all
carts had only two banks, and this implementation assumes that (ie, ROM released carts had only two banks.
is always 8K, and there are two 4K banks).
The following is paraphrased from the original patent by David Crane, The following is paraphrased from the original patent by David Crane,
European Patent Application # 84300730.3, dated 06.02.84: European Patent Application # 84300730.3, dated 06.02.84:
@ -58,16 +57,12 @@ class System;
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Note that in the general scheme, we use D7, D6 and D5 for the bank number Note that in the general scheme, we use D7, D6 and D5 for the bank number
(3 bits, so 8 possible banks). However, the scheme as used historically (3 bits, so 8 possible banks), translated as follows:
by Activision only uses two banks. Furthermore, the two banks it uses
are actually indicated by binary 110 and 111, and translated as follows:
binary 110 -> decimal 6 -> Upper 4K ROM (bank 1) @ $D000 - $DFFF binary 111 -> decimal 7 -> 1st 4K ROM (bank 0) @ $F000 - $FFFF
binary 111 -> decimal 7 -> Lower 4K ROM (bank 0) @ $F000 - $FFFF binary 110 -> decimal 6 -> 2nd 4K ROM (bank 1) @ $D000 - $DFFF
binary 101 -> decimal 5 -> 3rd 4K ROM (bank 2) @ $B000 - $BFFF
Since the actual bank numbers (0 and 1) do not map directly to their ...
respective bitstrings (7 and 6), we simply test for D5 being 0 or 1.
This is the significance of the test '(value & 0x20) ? 0 : 1' in the code.
NOTE: Consult the patent application for more specific information, in NOTE: Consult the patent application for more specific information, in
particular *why* the address $01FE will be placed on the address particular *why* the address $01FE will be placed on the address