Final updates for bankswitch schemes, updating documentation.

- Some schemes are not completely documented and/or implemented, and in those cases a FIXME has been added.
This commit is contained in:
Stephen Anthony 2017-08-31 19:21:20 -02:30
parent 6cf4aa4832
commit 4440aabc56
22 changed files with 85 additions and 70 deletions

View File

@ -59,7 +59,7 @@ CartridgeUAWidget::CartridgeUAWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeUAWidget::loadConfig()
{
myBank->setSelectedIndex(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.getBank());
CartDebugWidget::loadConfig();
}
@ -83,8 +83,8 @@ string CartridgeUAWidget::bankState()
ostringstream& buf = buffer();
static const char* const spot[] = { "$200", "$240" };
buf << "Bank = " << std::dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
buf << "Bank = " << std::dec << myCart.getBank()
<< ", hotspot = " << spot[myCart.getBank()];
return buf.str();
}

View File

@ -86,15 +86,10 @@ uInt8 Cartridge0840::peek(uInt16 address)
break;
}
if(!(address & 0x1000))
{
// Because of the way we've set up accessing above, we can only
// get here when the addresses are from 0x800 - 0xFFF
int hotspot = ((address & 0x0F00) >> 8) - 8;
return myHotSpotPageAccess[hotspot].device->peek(address);
}
return 0;
// Because of the way we've set up accessing above, we can only
// get here when the addresses are from 0x800 - 0xFFF
int hotspot = ((address & 0x0F00) >> 8) - 8;
return myHotSpotPageAccess[hotspot].device->peek(address);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -119,13 +114,14 @@ bool Cartridge0840::poke(uInt16 address, uInt8 value)
break;
}
// Because of the way accessing is set up, we will may get here by
// doing a write to 0x800 - 0xFFF or cart; we ignore the cart write
if(!(address & 0x1000))
{
// Because of the way we've set up accessing above, we can only
// get here when the addresses are from 0x800 - 0xFFF
int hotspot = ((address & 0x0F00) >> 8) - 8;
myHotSpotPageAccess[hotspot].device->poke(address, value);
}
return false;
}

View File

@ -27,7 +27,8 @@
/**
Cartridge class used for 0840 "Econobanking" 8K bankswitched games. There
are two 4K banks.
are two 4K banks, which are switched by accessing $0800 (bank 0) and
$0840 (bank 1).
@author Fred X. Quimby
*/

View File

@ -30,7 +30,8 @@ class System;
This is the standard Atari 2K cartridge. These cartridges are not
bankswitched, however, the data repeats twice in the 2600's 4K cartridge
addressing space. For 'Sub2K' ROMs (ROMs less than 2K in size), the
data repeats in intervals based on the size of the ROM.
data repeats in intervals based on the size of the ROM (which will
always be a power of 2).
@author Stephen Anthony
*/

View File

@ -28,7 +28,7 @@ class System;
/**
Bankswitching method as defined/created by John Payson (aka Supercat),
documented at http://www.casperkitty.com/stella/cartfmt.htm.
documented at https://stella-emu.github.io/4A50.html.
In this bankswitching scheme the 2600's 4K cartridge address space
is broken into four segments. The first 2K segment accesses any 2K
@ -44,6 +44,12 @@ class System;
for the ROM address space to change that we just consider the bank to
have changed on every poke operation (for any RAM) or an actual bankswitch.
NOTE: This scheme hasn't been fully implemented, and may never be (there
is only one test ROM, and it hasn't been extended any further).
In particular, the following functionality is missing:
- hires helper functions
- 1E00 page wrap
@author Eckhard Stolberg & Stephen Anthony
*/
class Cartridge4A50 : public Cartridge

View File

@ -27,6 +27,8 @@ class System;
#endif
/**
FIXME: This scheme needs to be be described in more detail.
This is the cartridge class for Arcadia (aka Starpath) Supercharger
games. Christopher Salomon provided most of the technical details
used in creating this class. A good description of the Supercharger

View File

@ -32,12 +32,12 @@ class System;
/**
Cartridge class used for CDF.
THIS NEEDS TO BE UPDATED
There are seven 4K program banks, a 4K Display Data RAM,
1K C Variable and Stack, and the CDF chip.
CDF chip access is mapped to $1000 - $103F.
CDF chip access is mapped to $1000 - $103F (both read and write).
Program banks are accessible by read/write to $1FF5 - $1FFB.
FIXME: THIS NEEDS TO BE UPDATED
@authors: Darrell Spice Jr, Chris Walton, Fred Quimby,
Stephen Anthony, Bradford W. Mott

View File

@ -28,6 +28,9 @@ class System;
#endif
/**
FIXME: This scheme is not yet fully implemented. In particular, loading
from and saving to the cassette is completely missing.
Cartridge class used for SpectraVideo CompuMate bankswitched games.
This is more than just a cartridge mapper - it's also a "computer" add-on.

View File

@ -27,6 +27,8 @@ class System;
#endif
/**
FIXME: This scheme is not yet fully implemented.
The 'Chetiry' bankswitch scheme was developed by Chris D. Walton for a
Tetris clone game by the same name. It makes use of a Harmony cart,
whereby ARM code in bank 0 is executed to implement the bankswitch scheme.

View File

@ -34,11 +34,14 @@ class System;
program banks, a 4K display bank, 1K frequency table and the DPC chip.
DPC chip access is mapped to $1000 - $1080 ($1000 - $103F is read port,
$1040 - $107F is write port).
Program banks are accessible by read/write to $1FF6 - $1FFB.
FIXME: THIS NEEDS TO BE UPDATED
For complete details on the DPC chip see David P. Crane's United States
Patent Number 4,644,495.
@author Darrell Spice Jr, Fred Quimby, Stephen Anthony, Bradford W. Mott
@authors Darrell Spice Jr, Fred Quimby, Stephen Anthony, Bradford W. Mott
*/
class CartridgeDPCPlus : public Cartridge
{

View File

@ -30,9 +30,9 @@ class System;
This is the cartridge class for Parker Brothers' 8K games. In
this bankswitching scheme the 2600's 4K cartridge address space
is broken into four 1K segments. The desired 1K slice of the
ROM is selected by accessing 1FE0 to 1FE7 for the first 1K.
1FE8 to 1FEF selects the slice for the second 1K, and 1FF0 to
1FF7 selects the slice for the third 1K. The last 1K segment
ROM is selected by accessing $1FE0 to $1FE7 for the first 1K.
$1FE8 to $1FEF selects the slice for the second 1K, and $1FF0 to
$1FF7 selects the slice for the third 1K. The last 1K segment
always points to the last 1K of the ROM image.
Because of the complexity of this scheme, the cart reports having

View File

@ -27,8 +27,8 @@ class System;
#endif
/**
Cartridge class used for Atari's 32K bankswitched games. There
are eight 4K banks.
Cartridge class used for Atari's 32K bankswitched games. There are eight
4K banks, accessible by read/write to $1FF4 - $1FFB.
@author Bradford W. Mott
*/

View File

@ -27,8 +27,8 @@ class System;
#endif
/**
Cartridge class used for Atari's 32K bankswitched games with
128 bytes of RAM. There are eight 4K banks.
Cartridge class used for Atari's 32K bankswitched games with 128 bytes of
RAM. There are eight 4K banks, accessible by read/write to $1FF4 - $1FFB.
RAM read port is $1080 - $10FF, write port is $1000 - $107F.
@author Bradford W. Mott

View File

@ -27,8 +27,8 @@ class System;
#endif
/**
Cartridge class used for Atari's 16K bankswitched games. There
are four 4K banks.
Cartridge class used for Atari's 16K bankswitched games. There are four
4K banks, accessible by read/write to $1FF6 - $1FF9.
@author Bradford W. Mott
*/

View File

@ -27,8 +27,8 @@ class System;
#endif
/**
Cartridge class used for Atari's 16K bankswitched games with
128 bytes of RAM. There are four 4K banks.
Cartridge class used for Atari's 16K bankswitched games with 128 bytes of
RAM. There are four 4K banks, accessible by read/write to $1FF6 - $1FF9.
RAM read port is $1080 - $10FF, write port is $1000 - $107F.
@author Bradford W. Mott

View File

@ -27,8 +27,8 @@ class System;
#endif
/**
Cartridge class used for Atari's 8K bankswitched games. There
are two 4K banks.
Cartridge class used for Atari's 8K bankswitched games. There are two
4K banks, accessible by read/write to $1FF8 - $1FF9.
@author Bradford W. Mott
*/

View File

@ -27,8 +27,8 @@ class System;
#endif
/**
Cartridge class used for Atari's 8K bankswitched games with
128 bytes of RAM. There are two 4K banks.
Cartridge class used for Atari's 8K bankswitched games with 128 bytes of
RAM. There are two 4K banks, accessible by read/write to $1FF8 - $1FF9.
RAM read port is $1080 - $10FF, write port is $1000 - $107F.
@author Bradford W. Mott

View File

@ -27,8 +27,8 @@ class System;
#endif
/**
Cartridge class used for CBS' RAM Plus cartridges. There are
three 4K banks and 256 bytes of RAM.
Cartridge class used for CBS' RAM Plus cartridges. There are three 4K
banks, accessible by read/write at $1FF8 - $1FFA, and 256 bytes of RAM.
RAM read port is $1100 - $11FF, write port is $1000 - $10FF.
@author Bradford W. Mott

View File

@ -30,13 +30,18 @@ class System;
This is an extended version of the CBS RAM Plus bankswitching scheme
supported by the Harmony cartridge.
There are six (or seven) 4K banks and 256 bytes of RAM. The 256 bytes
of RAM can be loaded/saved to Harmony cart flash, which is emulated by
storing in a file.
There are six (or seven) 4K banks, accessible by read/write to $1FF5 -
$1FFA (or $1FFB), and 256 bytes of RAM.
For 29K versions of the scheme, the first 1K is ARM code
(implements actual bankswitching on the Harmony cart), which is
completely ignored by the emulator.
The 256 bytes of RAM can be loaded/saved to Harmony cart flash by
accessing $1FF4 (see ramReadWrite() for more information), which is
emulated by storing in a file.
RAM read port is $1100 - $11FF, write port is $1000 - $10FF.
For 29K versions of the scheme, the first 1K is ARM code (implements
actual bankswitching on the Harmony cart), which is completely ignored
by the emulator. Also supported is a 32K variant. In any event, only
data at 1K - 29K of the ROM is used.
@author Chris D. Walton
*/

View File

@ -61,8 +61,8 @@ class System;
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
binary 111 -> decimal 7 -> Lower 4K ROM (bank 0) @ $F000
binary 110 -> decimal 6 -> Upper 4K ROM (bank 1) @ $D000 - $DFFF
binary 111 -> decimal 7 -> Lower 4K ROM (bank 0) @ $F000 - $FFFF
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.

View File

@ -22,7 +22,7 @@
CartridgeUA::CartridgeUA(const BytePtr& image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
myCurrentBank(0)
myBankOffset(0)
{
// Copy the ROM image into my buffer
memcpy(myImage, image.get(), std::min(8192u, size));
@ -79,14 +79,9 @@ uInt8 CartridgeUA::peek(uInt16 address)
break;
}
if(!(address & 0x1000))
{
return myHotSpotPageAccess.device->peek(address);
}
else
{
return 0;
}
// Because of the way accessing is set up, we will only get here
// when doing a TIA read
return myHotSpotPageAccess.device->peek(address);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -111,10 +106,11 @@ bool CartridgeUA::poke(uInt16 address, uInt8 value)
break;
}
// Because of the way accessing is set up, we will may get here by
// doing a write to TIA or cart; we ignore the cart write
if(!(address & 0x1000))
{
myHotSpotPageAccess.device->poke(address, value);
}
return false;
}
@ -124,8 +120,7 @@ bool CartridgeUA::bank(uInt16 bank)
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
uInt16 offset = myCurrentBank << 12;
myBankOffset = bank << 12;
// Setup the page access methods for the current bank
System::PageAccess access(this, System::PA_READ);
@ -134,8 +129,8 @@ bool CartridgeUA::bank(uInt16 bank)
for(uInt32 address = 0x1000; address < 0x2000;
address += (1 << System::PAGE_SHIFT))
{
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[offset + (address & 0x0FFF)];
access.directPeekBase = &myImage[myBankOffset + (address & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> System::PAGE_SHIFT, access);
}
return myBankChanged = true;
@ -144,7 +139,7 @@ bool CartridgeUA::bank(uInt16 bank)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt16 CartridgeUA::getBank() const
{
return myCurrentBank;
return myBankOffset >> 12;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -156,7 +151,7 @@ uInt16 CartridgeUA::bankCount() const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeUA::patch(uInt16 address, uInt8 value)
{
myImage[(myCurrentBank << 12) + (address & 0x0FFF)] = value;
myImage[myBankOffset + (address & 0x0FFF)] = value;
return myBankChanged = true;
}
@ -173,7 +168,7 @@ bool CartridgeUA::save(Serializer& out) const
try
{
out.putString(name());
out.putShort(myCurrentBank);
out.putShort(myBankOffset);
}
catch(...)
{
@ -192,7 +187,7 @@ bool CartridgeUA::load(Serializer& in)
if(in.getString() != name())
return false;
myCurrentBank = in.getShort();
myBankOffset = in.getShort();
}
catch(...)
{
@ -201,7 +196,7 @@ bool CartridgeUA::load(Serializer& in)
}
// Remember what bank we were in
bank(myCurrentBank);
bank(myBankOffset >> 12);
return true;
}

View File

@ -28,7 +28,8 @@ class System;
/**
Cartridge class used for UA Limited's 8K bankswitched games. There
are two 4K banks.
are two 4K banks, which are switched by accessing $0220 (bank 0) and
$0240 (bank 1).
@author Bradford W. Mott
*/
@ -154,8 +155,8 @@ class CartridgeUA : public Cartridge
// Previous Device's page access
System::PageAccess myHotSpotPageAccess;
// Indicates which bank is currently active
uInt16 myCurrentBank;
// Indicates the offset into the ROM image (aligns to current bank)
uInt16 myBankOffset;
private:
// Following constructors and assignment operators not supported