mirror of https://github.com/stella-emu/stella.git
removed CV+ type (incl. doc update)
This commit is contained in:
parent
cf9c109681
commit
ca5b6a6fe7
|
@ -22,7 +22,7 @@
|
|||
a game. This allows the user to save high scores for these games. For each
|
||||
game and variation, the top 10 scores can be saved. (TODO: Doc)
|
||||
|
||||
* Add option which lets default ROM path follow launcher navigation (TODO: Doc)
|
||||
* Added option which lets default ROM path follow launcher navigation (TODO: Doc)
|
||||
|
||||
* Added displaying last write address in the debugger.
|
||||
|
||||
|
@ -30,6 +30,8 @@
|
|||
|
||||
* Restored 'cfg' directory for Distella config files.
|
||||
|
||||
* Removed unused CV+ bank switching type.
|
||||
|
||||
-Have fun!
|
||||
|
||||
|
||||
|
|
|
@ -3756,7 +3756,9 @@ Ms Pac-Man (Stella extended codes):
|
|||
<p>Each block in a property file consists of a set of properties for a single
|
||||
game. Stella supports the properties described below:</p>
|
||||
|
||||
<a><img src="graphics/options_gameinfo_emulation.png"></a>
|
||||
<p>
|
||||
<a><img src="graphics/options_gameinfo_emulation.png"></a>
|
||||
</p>
|
||||
<table CELLSPACING="10">
|
||||
|
||||
<tr>
|
||||
|
@ -3791,8 +3793,7 @@ Ms Pac-Man (Stella extended codes):
|
|||
<tr><td>CDF </td><td>Chris, Darrell, Fred (includes CDFJ)</td><td>.CDF </td></tr>
|
||||
<tr><td>CM ¹</td><td>Spectravideo CompuMate </td><td>.CM </td></tr>
|
||||
<tr><td>CTY ²</td><td>CDW - Chetiry </td><td>.CTY </td></tr>
|
||||
<tr><td>CV </td><td>Commavid extra RAM </td><td>.CV </td></tr>
|
||||
<tr><td>CV+ </td><td>Extended Commavid extra RAM</td><td>.CVP </td></tr>
|
||||
<tr><td>CV </td><td>CommaVid extra RAM </td><td>.CV </td></tr>
|
||||
<tr><td>DASH </td><td>Boulder Dash 2 </td><td>.DAS, .DASH </td></tr>
|
||||
<tr><td>DF </td><td>CPUWIZ 128K </td><td>.DF </td></tr>
|
||||
<tr><td>DFSC </td><td>CPUWIZ 128K + RAM</td><td>.DFS, .DFSC </td></tr>
|
||||
|
@ -3875,11 +3876,15 @@ Ms Pac-Man (Stella extended codes):
|
|||
</tr>
|
||||
|
||||
</table>
|
||||
</br>
|
||||
<!--
|
||||
<p><b>Note:</b> Items marked as '*' are deprecated, and will probably be
|
||||
removed in a future release.</p>
|
||||
-->
|
||||
<a><img src="graphics/options_gameinfo_console.png"></a>
|
||||
<p>
|
||||
<a><img src="graphics/options_gameinfo_console.png"></a>
|
||||
</p>
|
||||
|
||||
<table CELLSPACING="10">
|
||||
<tr>
|
||||
<td VALIGN="TOP"><i>Console.TelevisionType:</i></td>
|
||||
|
@ -3899,8 +3904,11 @@ Ms Pac-Man (Stella extended codes):
|
|||
right player. The value must be <b>A</b> or <b>B</b>.</td>
|
||||
</tr>
|
||||
</table>
|
||||
</br>
|
||||
|
||||
<a name="Controller"><img src="graphics/options_gameinfo_controller.png"></a>
|
||||
<p>
|
||||
<a name="Controller"><img src="graphics/options_gameinfo_controller.png"></a>
|
||||
</p>
|
||||
<table CELLSPACING="10">
|
||||
<tr>
|
||||
<td VALIGN="TOP"><i>Controller.Left:</i><br><i>Controller.Right:</i></td>
|
||||
|
@ -3975,8 +3983,11 @@ Ms Pac-Man (Stella extended codes):
|
|||
how to use the X/Y axis (ie, 02 is paddle0/paddle2).
|
||||
-->
|
||||
</table>
|
||||
</br>
|
||||
|
||||
<a><img src="graphics/options_gameinfo_cartridge.png"></a>
|
||||
<p>
|
||||
<a><img src="graphics/options_gameinfo_cartridge.png"></a>
|
||||
</p>
|
||||
<table CELLSPACING="10">
|
||||
<tr>
|
||||
<td VALIGN="TOP"><i>Cartridge.Name:</i></td>
|
||||
|
|
|
@ -1,157 +0,0 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2020 by Bradford W. Mott, Stephen Anthony
|
||||
// and the Stella Team
|
||||
//
|
||||
// See the file "License.txt" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//============================================================================
|
||||
|
||||
#include "Debugger.hxx"
|
||||
#include "CartDebug.hxx"
|
||||
#include "CartCVPlus.hxx"
|
||||
#include "PopUpWidget.hxx"
|
||||
#include "CartCVPlusWidget.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeCVPlusWidget::CartridgeCVPlusWidget(
|
||||
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
|
||||
int x, int y, int w, int h, CartridgeCVPlus& cart)
|
||||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
size_t size = cart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "LS_Dracon CV+ cartridge, 1K RAM, 2-256 2K ROM\n"
|
||||
<< "1024 bytes RAM @ $F000 - $F7FF\n"
|
||||
<< " $F000 - $F3FF (R), $F400 - $F7FF (W)\n"
|
||||
<< "2048 bytes ROM @ $F800 - $FFFF, by writing to $3D\n"
|
||||
<< "Startup bank = " << cart.startBank() << "\n";
|
||||
|
||||
int xpos = 2,
|
||||
ypos = addBaseInformation(size, "LS_Dracon / Stephen Anthony",
|
||||
info.str()) + myLineHeight;
|
||||
|
||||
VariantList items;
|
||||
for(uInt16 i = 0; i < cart.bankCount(); ++i)
|
||||
VarList::push_back(items, Variant(i).toString() + " ($3D)");
|
||||
|
||||
ostringstream label;
|
||||
label << "Set bank ($F800 - $FFFF) ";
|
||||
myBank =
|
||||
new PopUpWidget(boss, _font, xpos, ypos-2, _font.getStringWidth("xxx ($3D)"),
|
||||
myLineHeight, items, label.str(),
|
||||
_font.getStringWidth(label.str()), kBankChanged);
|
||||
myBank->setTarget(this);
|
||||
addFocusWidget(myBank);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeCVPlusWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeCVPlusWidget::handleCommand(CommandSender* sender,
|
||||
int cmd, int data, int id)
|
||||
{
|
||||
if(cmd == kBankChanged)
|
||||
{
|
||||
myCart.unlockBank();
|
||||
myCart.bank(myBank->getSelected());
|
||||
myCart.lockBank();
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
string CartridgeCVPlusWidget::bankState()
|
||||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = $3D";
|
||||
|
||||
return buf.str();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeCVPlusWidget::saveOldState()
|
||||
{
|
||||
myOldState.internalram.clear();
|
||||
|
||||
for(uInt32 i = 0; i < internalRamSize(); ++i)
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
|
||||
myOldState.bank = myCart.getBank();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt32 CartridgeCVPlusWidget::internalRamSize()
|
||||
{
|
||||
return 1024;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt32 CartridgeCVPlusWidget::internalRamRPort(int start)
|
||||
{
|
||||
return 0xF000 + start;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
string CartridgeCVPlusWidget::internalRamDescription()
|
||||
{
|
||||
ostringstream desc;
|
||||
desc << "$F000 - $F3FF used for Read Access\n"
|
||||
<< "$F400 - $F7FF used for Write Access";
|
||||
|
||||
return desc.str();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const ByteArray& CartridgeCVPlusWidget::internalRamOld(int start, int count)
|
||||
{
|
||||
myRamOld.clear();
|
||||
for(int i = 0; i < count; i++)
|
||||
myRamOld.push_back(myOldState.internalram[start + i]);
|
||||
return myRamOld;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const ByteArray& CartridgeCVPlusWidget::internalRamCurrent(int start, int count)
|
||||
{
|
||||
myRamCurrent.clear();
|
||||
for(int i = 0; i < count; i++)
|
||||
myRamCurrent.push_back(myCart.myRAM[start + i]);
|
||||
return myRamCurrent;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeCVPlusWidget::internalRamSetValue(int addr, uInt8 value)
|
||||
{
|
||||
myCart.myRAM[addr] = value;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt8 CartridgeCVPlusWidget::internalRamGetValue(int addr)
|
||||
{
|
||||
return myCart.myRAM[addr];
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
string CartridgeCVPlusWidget::internalRamLabel(int addr)
|
||||
{
|
||||
CartDebug& dbg = instance().debugger().cartDebug();
|
||||
return dbg.getLabel(addr + 0xF000, false);
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2020 by Bradford W. Mott, Stephen Anthony
|
||||
// and the Stella Team
|
||||
//
|
||||
// See the file "License.txt" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//============================================================================
|
||||
|
||||
#ifndef CARTRIDGECVPlus_WIDGET_HXX
|
||||
#define CARTRIDGECVPlus_WIDGET_HXX
|
||||
|
||||
class CartridgeCVPlus;
|
||||
class PopUpWidget;
|
||||
|
||||
#include "CartDebugWidget.hxx"
|
||||
|
||||
class CartridgeCVPlusWidget : public CartDebugWidget
|
||||
{
|
||||
public:
|
||||
CartridgeCVPlusWidget(GuiObject* boss, const GUI::Font& lfont,
|
||||
const GUI::Font& nfont,
|
||||
int x, int y, int w, int h,
|
||||
CartridgeCVPlus& cart);
|
||||
virtual ~CartridgeCVPlusWidget() = default;
|
||||
|
||||
private:
|
||||
CartridgeCVPlus& myCart;
|
||||
PopUpWidget* myBank{nullptr};
|
||||
struct CartState {
|
||||
ByteArray internalram;
|
||||
uInt16 bank{0};
|
||||
};
|
||||
CartState myOldState;
|
||||
|
||||
enum { kBankChanged = 'bkCH' };
|
||||
|
||||
private:
|
||||
void loadConfig() override;
|
||||
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||
|
||||
string bankState() override;
|
||||
|
||||
void saveOldState() override;
|
||||
|
||||
// start of functions for Cartridge RAM tab
|
||||
uInt32 internalRamSize() override;
|
||||
uInt32 internalRamRPort(int start) override;
|
||||
string internalRamDescription() override;
|
||||
const ByteArray& internalRamOld(int start, int count) override;
|
||||
const ByteArray& internalRamCurrent(int start, int count) override;
|
||||
void internalRamSetValue(int addr, uInt8 value) override;
|
||||
uInt8 internalRamGetValue(int addr) override;
|
||||
string internalRamLabel(int addr) override;
|
||||
// end of functions for Cartridge RAM tab
|
||||
|
||||
// Following constructors and assignment operators not supported
|
||||
CartridgeCVPlusWidget() = delete;
|
||||
CartridgeCVPlusWidget(const CartridgeCVPlusWidget&) = delete;
|
||||
CartridgeCVPlusWidget(CartridgeCVPlusWidget&&) = delete;
|
||||
CartridgeCVPlusWidget& operator=(const CartridgeCVPlusWidget&) = delete;
|
||||
CartridgeCVPlusWidget& operator=(CartridgeCVPlusWidget&&) = delete;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -21,8 +21,7 @@ MODULE_OBJS := \
|
|||
src/debugger/gui/CartCDFWidget.o \
|
||||
src/debugger/gui/CartCDFInfoWidget.o \
|
||||
src/debugger/gui/CartCMWidget.o \
|
||||
src/debugger/gui/CartCTYWidget.o \
|
||||
src/debugger/gui/CartCVPlusWidget.o \
|
||||
src/debugger/gui/CartCTYWidget.o \
|
||||
src/debugger/gui/CartCVWidget.o \
|
||||
src/debugger/gui/CartDASHWidget.o \
|
||||
src/debugger/gui/CartDFSCWidget.o \
|
||||
|
|
|
@ -118,7 +118,6 @@ Bankswitch::BSList = {{
|
|||
{ "CM" , "CM (SpectraVideo CompuMate)" },
|
||||
{ "CTY" , "CTY (CDW - Chetiry)" },
|
||||
{ "CV" , "CV (Commavid extra RAM)" },
|
||||
{ "CV+" , "CV+ (Extended Commavid)" },
|
||||
{ "DASH" , "DASH (Experimental)" },
|
||||
{ "DF" , "DF (CPUWIZ 128K)" },
|
||||
{ "DFSC" , "DFSC (CPUWIZ 128K + RAM)" },
|
||||
|
@ -197,7 +196,6 @@ Bankswitch::ExtensionMap Bankswitch::ourExtensions = {
|
|||
{ "CM" , Bankswitch::Type::_CM },
|
||||
{ "CTY" , Bankswitch::Type::_CTY },
|
||||
{ "CV" , Bankswitch::Type::_CV },
|
||||
{ "CVP" , Bankswitch::Type::_CVP },
|
||||
{ "DAS" , Bankswitch::Type::_DASH },
|
||||
{ "DASH" , Bankswitch::Type::_DASH },
|
||||
{ "DF" , Bankswitch::Type::_DF },
|
||||
|
@ -262,7 +260,6 @@ Bankswitch::NameToTypeMap Bankswitch::ourNameToTypes = {
|
|||
{ "CM" , Bankswitch::Type::_CM },
|
||||
{ "CTY" , Bankswitch::Type::_CTY },
|
||||
{ "CV" , Bankswitch::Type::_CV },
|
||||
{ "CV+" , Bankswitch::Type::_CVP },
|
||||
{ "DASH" , Bankswitch::Type::_DASH },
|
||||
{ "DF" , Bankswitch::Type::_DF },
|
||||
{ "DFSC" , Bankswitch::Type::_DFSC },
|
||||
|
|
|
@ -38,14 +38,14 @@ class Bankswitch
|
|||
public:
|
||||
// Currently supported bankswitch schemes
|
||||
enum class Type {
|
||||
_AUTO, _0840, _2IN1, _4IN1, _8IN1, _16IN1, _32IN1,
|
||||
_64IN1, _128IN1, _2K, _3E, _3EP, _3F, _4A50,
|
||||
_4K, _4KSC, _AR, _BF, _BFSC, _BUS, _CDF,
|
||||
_CM, _CTY, _CV, _CVP, _DASH, _DF, _DFSC,
|
||||
_DPC, _DPCP, _E0, _E7, _E78K, _EF, _EFSC,
|
||||
_F0, _F4, _F4SC, _F6, _F6SC, _F8, _F8SC,
|
||||
_FA, _FA2, _FC, _FE, _MDM, _SB, _UA,
|
||||
_UASW, _WD, _WDSW, _X07,
|
||||
_AUTO, _0840, _2IN1, _4IN1, _8IN1, _16IN1, _32IN1,
|
||||
_64IN1, _128IN1, _2K, _3E, _3EP, _3F, _4A50,
|
||||
_4K, _4KSC, _AR, _BF, _BFSC, _BUS, _CDF,
|
||||
_CM, _CTY, _CV, _DASH, _DF, _DFSC, _DPC,
|
||||
_DPCP, _E0, _E7, _E78K, _EF, _EFSC, _F0,
|
||||
_F4, _F4SC, _F6, _F6SC, _F8, _F8SC, _FA,
|
||||
_FA2, _FC, _FE, _MDM, _SB, _UA, _UASW,
|
||||
_WD, _WDSW, _X07,
|
||||
#ifdef CUSTOM_ARM
|
||||
_CUSTOM,
|
||||
#endif
|
||||
|
|
|
@ -1,235 +0,0 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2020 by Bradford W. Mott, Stephen Anthony
|
||||
// and the Stella Team
|
||||
//
|
||||
// See the file "License.txt" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//============================================================================
|
||||
|
||||
#include "System.hxx"
|
||||
#include "TIA.hxx"
|
||||
#include "CartCVPlus.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeCVPlus::CartridgeCVPlus(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size)
|
||||
{
|
||||
// Allocate array for the ROM image
|
||||
myImage = make_unique<uInt8[]>(mySize);
|
||||
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), mySize, myImage.get());
|
||||
createRomAccessArrays(mySize + myRAM.size());
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeCVPlus::reset()
|
||||
{
|
||||
initializeRAM(myRAM.data(), myRAM.size());
|
||||
initializeStartBank(0);
|
||||
|
||||
// We'll map the startup bank into the first segment upon reset
|
||||
bank(startBank());
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeCVPlus::install(System& system)
|
||||
{
|
||||
mySystem = &system;
|
||||
|
||||
System::PageAccess access(this, System::PageAccessType::READWRITE);
|
||||
|
||||
// The hotspot ($3D) is in TIA address space, so we claim it here
|
||||
for(uInt16 addr = 0x00; addr < 0x40; addr += System::PAGE_SIZE)
|
||||
mySystem->setPageAccess(addr, access);
|
||||
|
||||
// Set the page accessing method for the RAM writing pages
|
||||
// Map access to this class, since we need to inspect all accesses to
|
||||
// check if RWP happens
|
||||
access.directPeekBase = access.directPokeBase = nullptr;
|
||||
access.romAccessBase = nullptr;
|
||||
access.type = System::PageAccessType::WRITE;
|
||||
for(uInt16 addr = 0x1400; addr < 0x1800; addr += System::PAGE_SIZE)
|
||||
{
|
||||
access.romAccessBase = &myRomAccessBase[mySize + (addr & 0x03FF)];
|
||||
access.romPeekCounter = &myRomAccessCounter[mySize + (addr & 0x03FF)];
|
||||
access.romPokeCounter = &myRomAccessCounter[mySize + (addr & 0x03FF) + myAccessSize];
|
||||
mySystem->setPageAccess(addr, access);
|
||||
}
|
||||
|
||||
// Set the page accessing method for the RAM reading pages
|
||||
access.type = System::PageAccessType::READ;
|
||||
for(uInt16 addr = 0x1000; addr < 0x1400; addr += System::PAGE_SIZE)
|
||||
{
|
||||
access.directPeekBase = &myRAM[addr & 0x03FF];
|
||||
access.romAccessBase = &myRomAccessBase[mySize + (addr & 0x03FF)];
|
||||
access.romPeekCounter = &myRomAccessCounter[mySize + (addr & 0x03FF)];
|
||||
access.romPokeCounter = &myRomAccessCounter[mySize + (addr & 0x03FF) + myAccessSize];
|
||||
mySystem->setPageAccess(addr, access);
|
||||
}
|
||||
|
||||
// Install pages for the startup bank into the first segment
|
||||
bank(startBank());
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt8 CartridgeCVPlus::peek(uInt16 address)
|
||||
{
|
||||
if((address & 0x0FFF) < 0x0800) // Write port is at 0xF400 - 0xF7FF (1024 bytes)
|
||||
return peekRAM(myRAM[address & 0x03FF], address);
|
||||
else
|
||||
return myImage[(address & 0x07FF) + (myCurrentBank << 11)];
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartridgeCVPlus::poke(uInt16 address, uInt8 value)
|
||||
{
|
||||
uInt16 pokeAddress = address;
|
||||
address &= 0x0FFF;
|
||||
|
||||
if(address < 0x0040)
|
||||
{
|
||||
// Switch banks if necessary
|
||||
if(address == 0x003D)
|
||||
bank(value);
|
||||
|
||||
// Handle TIA space that we claimed above
|
||||
return mySystem->tia().poke(address, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(address & 0x0400)
|
||||
{
|
||||
pokeRAM(myRAM[address & 0x03FF], pokeAddress, value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Writing to the read port should be ignored, but trigger a break if option enabled
|
||||
uInt8 dummy;
|
||||
|
||||
pokeRAM(dummy, pokeAddress, value);
|
||||
myRamWriteAccess = pokeAddress;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartridgeCVPlus::bank(uInt16 bank)
|
||||
{
|
||||
if(bankLocked()) return false;
|
||||
|
||||
// Make sure the bank they're asking for is reasonable
|
||||
if((uInt32(bank) << 11) < mySize)
|
||||
{
|
||||
myCurrentBank = bank;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Oops, the bank they're asking for isn't valid so let's wrap it
|
||||
// around to a valid bank number
|
||||
myCurrentBank = bank % (mySize >> 11);
|
||||
}
|
||||
|
||||
uInt32 offset = myCurrentBank << 11;
|
||||
|
||||
// Setup the page access methods for the current bank
|
||||
System::PageAccess access(this, System::PageAccessType::READ);
|
||||
|
||||
// Map ROM image into the system
|
||||
for(uInt16 addr = 0x1800; addr < 0x2000; addr += System::PAGE_SIZE)
|
||||
{
|
||||
access.directPeekBase = &myImage[offset + (addr & 0x07FF)];
|
||||
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x07FF)];
|
||||
mySystem->setPageAccess(addr, access);
|
||||
}
|
||||
|
||||
return myBankChanged = true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt16 CartridgeCVPlus::getBank(uInt16) const
|
||||
{
|
||||
return myCurrentBank;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt16 CartridgeCVPlus::bankCount() const
|
||||
{
|
||||
return uInt16(mySize >> 11);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartridgeCVPlus::patch(uInt16 address, uInt8 value)
|
||||
{
|
||||
address &= 0x0FFF;
|
||||
|
||||
if(address < 0x0800)
|
||||
{
|
||||
// Normally, a write to the read port won't do anything
|
||||
// However, the patch command is special in that ignores such
|
||||
// cart restrictions
|
||||
// The following will work for both reads and writes
|
||||
myRAM[address & 0x03FF] = value;
|
||||
}
|
||||
else
|
||||
myImage[(address & 0x07FF) + (myCurrentBank << 11)] = value;
|
||||
|
||||
return myBankChanged = true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeCVPlus::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.get();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartridgeCVPlus::save(Serializer& out) const
|
||||
{
|
||||
try
|
||||
{
|
||||
out.putShort(myCurrentBank);
|
||||
out.putByteArray(myRAM.data(), myRAM.size());
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cerr << "ERROR: CartridgeCVPlus::save" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartridgeCVPlus::load(Serializer& in)
|
||||
{
|
||||
try
|
||||
{
|
||||
myCurrentBank = in.getShort();
|
||||
in.getByteArray(myRAM.data(), myRAM.size());
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cerr << "ERROR: CartridgeCVPlus::load" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Now, go to the current bank
|
||||
bank(myCurrentBank);
|
||||
|
||||
return true;
|
||||
}
|
|
@ -1,188 +0,0 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2020 by Bradford W. Mott, Stephen Anthony
|
||||
// and the Stella Team
|
||||
//
|
||||
// See the file "License.txt" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//============================================================================
|
||||
|
||||
#ifndef CARTRIDGECVPlus_HXX
|
||||
#define CARTRIDGECVPlus_HXX
|
||||
|
||||
class System;
|
||||
|
||||
#include "bspf.hxx"
|
||||
#include "Cart.hxx"
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
#include "CartCVPlusWidget.hxx"
|
||||
#endif
|
||||
|
||||
/**
|
||||
Cartridge class based on both Commavid and 3F/3E schemes:
|
||||
|
||||
Commavid (RAM):
|
||||
$F000-$F3FF read from RAM
|
||||
$F400-$F7FF write to RAM
|
||||
|
||||
3F/3E (ROM):
|
||||
$F800-$FFFF ROM
|
||||
|
||||
In this bankswitching scheme the 2600's 4K cartridge
|
||||
address space is broken into two 2K segments. The lower 2K
|
||||
is RAM, as decribed above (same as CV/Commavid scheme).
|
||||
To map ROM, the desired bank number of the upper 2K segment is
|
||||
selected by storing its value into $3D.
|
||||
|
||||
@author Stephen Anthony, LS_Dracon
|
||||
*/
|
||||
|
||||
class CartridgeCVPlus : public Cartridge
|
||||
{
|
||||
friend class CartridgeCVPlusWidget;
|
||||
|
||||
public:
|
||||
/**
|
||||
Create a new cartridge using the specified image and size
|
||||
|
||||
@param image Pointer to the ROM image
|
||||
@param size The size of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeCVPlus(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeCVPlus() = default;
|
||||
|
||||
public:
|
||||
/**
|
||||
Reset device to its power-on state
|
||||
*/
|
||||
void reset() override;
|
||||
|
||||
/**
|
||||
Install cartridge in the specified system. Invoked by the system
|
||||
when the cartridge is attached to it.
|
||||
|
||||
@param system The system the device should install itself in
|
||||
*/
|
||||
void install(System& system) override;
|
||||
|
||||
/**
|
||||
Install pages for the specified bank in the system.
|
||||
|
||||
@param bank The bank that should be installed in the system
|
||||
*/
|
||||
bool bank(uInt16 bank) override;
|
||||
|
||||
/**
|
||||
Get the current bank.
|
||||
|
||||
@param address The address to use when querying the bank
|
||||
*/
|
||||
uInt16 getBank(uInt16 address = 0) const override;
|
||||
|
||||
/**
|
||||
Query the number of banks supported by the cartridge.
|
||||
*/
|
||||
uInt16 bankCount() const override;
|
||||
|
||||
/**
|
||||
Patch the cartridge ROM.
|
||||
|
||||
@param address The ROM address to patch
|
||||
@param value The value to place into the address
|
||||
@return Success or failure of the patch operation
|
||||
*/
|
||||
bool patch(uInt16 address, uInt8 value) override;
|
||||
|
||||
/**
|
||||
Access the internal ROM image for this cartridge.
|
||||
|
||||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
||||
@param out The Serializer object to use
|
||||
@return False on any errors, else true
|
||||
*/
|
||||
bool save(Serializer& out) const override;
|
||||
|
||||
/**
|
||||
Load the current state of this cart from the given Serializer.
|
||||
|
||||
@param in The Serializer object to use
|
||||
@return False on any errors, else true
|
||||
*/
|
||||
bool load(Serializer& in) override;
|
||||
|
||||
/**
|
||||
Get a descriptor for the device name (used in error checking).
|
||||
|
||||
@return The name of the object
|
||||
*/
|
||||
string name() const override { return "CartridgeCV+"; }
|
||||
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
/**
|
||||
Get debugger widget responsible for accessing the inner workings
|
||||
of the cart.
|
||||
*/
|
||||
CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont,
|
||||
const GUI::Font& nfont, int x, int y, int w, int h) override
|
||||
{
|
||||
return new CartridgeCVPlusWidget(boss, lfont, nfont, x, y, w, h, *this);
|
||||
}
|
||||
#endif
|
||||
|
||||
public:
|
||||
/**
|
||||
Get the byte at the specified address
|
||||
|
||||
@return The byte at the specified address
|
||||
*/
|
||||
uInt8 peek(uInt16 address) override;
|
||||
|
||||
/**
|
||||
Change the byte at the specified address to the given value
|
||||
|
||||
@param address The address where the value should be stored
|
||||
@param value The value to be stored at the address
|
||||
@return True if the poke changed the device address space, else false
|
||||
*/
|
||||
bool poke(uInt16 address, uInt8 value) override;
|
||||
|
||||
private:
|
||||
// Pointer to a dynamically allocated ROM image of the cartridge
|
||||
ByteBuffer myImage;
|
||||
|
||||
// The 1024 bytes of RAM
|
||||
std::array<uInt8, 1_KB> myRAM;
|
||||
|
||||
// Size of the ROM image
|
||||
size_t mySize{0};
|
||||
|
||||
// Indicates which bank is currently active for the first segment
|
||||
uInt16 myCurrentBank{0};
|
||||
|
||||
private:
|
||||
// Following constructors and assignment operators not supported
|
||||
CartridgeCVPlus() = delete;
|
||||
CartridgeCVPlus(const CartridgeCVPlus&) = delete;
|
||||
CartridgeCVPlus(CartridgeCVPlus&&) = delete;
|
||||
CartridgeCVPlus& operator=(const CartridgeCVPlus&) = delete;
|
||||
CartridgeCVPlus& operator=(CartridgeCVPlus&&) = delete;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -33,7 +33,6 @@
|
|||
#include "CartCM.hxx"
|
||||
#include "CartCTY.hxx"
|
||||
#include "CartCV.hxx"
|
||||
#include "CartCVPlus.hxx"
|
||||
#include "CartDASH.hxx"
|
||||
#include "CartDF.hxx"
|
||||
#include "CartDFSC.hxx"
|
||||
|
@ -278,8 +277,6 @@ CartDetector::createFromImage(const ByteBuffer& image, size_t size, Bankswitch::
|
|||
return make_unique<CartridgeCTY>(image, size, md5, settings);
|
||||
case Bankswitch::Type::_CV:
|
||||
return make_unique<CartridgeCV>(image, size, md5, settings);
|
||||
case Bankswitch::Type::_CVP:
|
||||
return make_unique<CartridgeCVPlus>(image, size, md5, settings);
|
||||
case Bankswitch::Type::_DASH:
|
||||
return make_unique<CartridgeDASH>(image, size, md5, settings);
|
||||
case Bankswitch::Type::_DF:
|
||||
|
@ -346,11 +343,7 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, size_t si
|
|||
// Guess type based on size
|
||||
Bankswitch::Type type = Bankswitch::Type::_AUTO;
|
||||
|
||||
if(isProbablyCVPlus(image, size))
|
||||
{
|
||||
type = Bankswitch::Type::_CVP;
|
||||
}
|
||||
else if((size % 8448) == 0 || size == 6144)
|
||||
if((size % 8448) == 0 || size == 6144)
|
||||
{
|
||||
type = Bankswitch::Type::_AR;
|
||||
}
|
||||
|
@ -757,16 +750,6 @@ bool CartDetector::isProbablyCV(const ByteBuffer& image, size_t size)
|
|||
return searchForBytes(image.get(), size, signature[1], 3, 1);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyCVPlus(const ByteBuffer& image, size_t)
|
||||
{
|
||||
// CV+ cart is identified key 'commavidplus' @ $04 in the ROM
|
||||
// We inspect only this area to speed up the search
|
||||
uInt8 cvp[12] = { 'c', 'o', 'm', 'm', 'a', 'v', 'i', 'd',
|
||||
'p', 'l', 'u', 's' };
|
||||
return searchForBytes(image.get()+4, 24, cvp, 12, 1);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyDASH(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
|
|
|
@ -175,11 +175,6 @@ class CartDetector
|
|||
*/
|
||||
static bool isProbablyCV(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a CV+ bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyCVPlus(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a DASH bankswitching cartridge
|
||||
*/
|
||||
|
|
|
@ -20,8 +20,7 @@ MODULE_OBJS := \
|
|||
src/emucore/CartCDF.o \
|
||||
src/emucore/CartCM.o \
|
||||
src/emucore/CartCTY.o \
|
||||
src/emucore/CartCV.o \
|
||||
src/emucore/CartCVPlus.o \
|
||||
src/emucore/CartCV.o \
|
||||
src/emucore/CartDASH.o \
|
||||
src/emucore/CartDPC.o \
|
||||
src/emucore/CartDPCPlus.o \
|
||||
|
|
|
@ -585,9 +585,6 @@
|
|||
<ClCompile Include="..\debugger\gui\CartCTYWidget.cxx">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\debugger\gui\CartCVPlusWidget.cxx">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\debugger\gui\CartCVWidget.cxx">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
@ -724,7 +721,6 @@
|
|||
<ClCompile Include="..\emucore\CartCDF.cxx" />
|
||||
<ClCompile Include="..\emucore\CartCM.cxx" />
|
||||
<ClCompile Include="..\emucore\CartCTY.cxx" />
|
||||
<ClCompile Include="..\emucore\CartCVPlus.cxx" />
|
||||
<ClCompile Include="..\emucore\CartDASH.cxx" />
|
||||
<ClCompile Include="..\emucore\CartDetector.cxx" />
|
||||
<ClCompile Include="..\emucore\CartDF.cxx" />
|
||||
|
@ -1596,9 +1592,6 @@
|
|||
<ClInclude Include="..\debugger\gui\CartCTYWidget.hxx">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\debugger\gui\CartCVPlusWidget.hxx">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\debugger\gui\CartCVWidget.hxx">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
|
@ -1747,7 +1740,6 @@
|
|||
<ClInclude Include="..\emucore\CartCDF.hxx" />
|
||||
<ClInclude Include="..\emucore\CartCM.hxx" />
|
||||
<ClInclude Include="..\emucore\CartCTY.hxx" />
|
||||
<ClInclude Include="..\emucore\CartCVPlus.hxx" />
|
||||
<ClInclude Include="..\emucore\CartDASH.hxx" />
|
||||
<ClInclude Include="..\emucore\CartDetector.hxx" />
|
||||
<ClInclude Include="..\emucore\CartDF.hxx" />
|
||||
|
|
|
@ -759,12 +759,6 @@
|
|||
<ClCompile Include="..\debugger\gui\RiotRamWidget.cxx">
|
||||
<Filter>Source Files\debugger</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\emucore\CartCVPlus.cxx">
|
||||
<Filter>Source Files\emucore</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\debugger\gui\CartCVPlusWidget.cxx">
|
||||
<Filter>Source Files\debugger</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\debugger\gui\Cart3EPlusWidget.cxx">
|
||||
<Filter>Source Files\debugger</Filter>
|
||||
</ClCompile>
|
||||
|
@ -1748,12 +1742,6 @@
|
|||
<ClInclude Include="..\debugger\gui\RiotRamWidget.hxx">
|
||||
<Filter>Header Files\debugger</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\debugger\gui\CartCVPlusWidget.hxx">
|
||||
<Filter>Header Files\debugger</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\emucore\CartCVPlus.hxx">
|
||||
<Filter>Header Files\emucore</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\debugger\gui\Cart3EPlusWidget.hxx">
|
||||
<Filter>Header Files\debugger</Filter>
|
||||
</ClInclude>
|
||||
|
|
Loading…
Reference in New Issue