From 7fb2d096b967272751effb0d02e6a648bb720d8a Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 13 Apr 2020 21:58:16 +0200 Subject: [PATCH] removed CV+ type (incl. doc update) --- Changes.txt | 4 +- docs/index.html | 23 ++- src/debugger/gui/CartCVPlusWidget.cxx | 157 ----------------- src/debugger/gui/CartCVPlusWidget.hxx | 73 -------- src/debugger/gui/module.mk | 3 +- src/emucore/Bankswitch.cxx | 3 - src/emucore/Bankswitch.hxx | 16 +- src/emucore/CartCVPlus.cxx | 235 -------------------------- src/emucore/CartCVPlus.hxx | 188 --------------------- src/emucore/CartDetector.cxx | 19 +-- src/emucore/CartDetector.hxx | 5 - src/emucore/module.mk | 3 +- src/windows/Stella.vcxproj | 8 - src/windows/Stella.vcxproj.filters | 12 -- 14 files changed, 31 insertions(+), 718 deletions(-) delete mode 100644 src/debugger/gui/CartCVPlusWidget.cxx delete mode 100644 src/debugger/gui/CartCVPlusWidget.hxx delete mode 100644 src/emucore/CartCVPlus.cxx delete mode 100644 src/emucore/CartCVPlus.hxx diff --git a/Changes.txt b/Changes.txt index 60fd29f4e..7a6b7bc3d 100644 --- a/Changes.txt +++ b/Changes.txt @@ -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! diff --git a/docs/index.html b/docs/index.html index 68be48e0d..b0065878b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3756,7 +3756,9 @@ Ms Pac-Man (Stella extended codes):

Each block in a property file consists of a set of properties for a single game. Stella supports the properties described below:

- +

+ +

@@ -3791,8 +3793,7 @@ Ms Pac-Man (Stella extended codes): - - + @@ -3875,11 +3876,15 @@ Ms Pac-Man (Stella extended codes):
CDF Chris, Darrell, Fred (includes CDFJ).CDF
CM ¹Spectravideo CompuMate .CM
CTY ²CDW - Chetiry .CTY
CV Commavid extra RAM .CV
CV+ Extended Commavid extra RAM.CVP
CV CommaVid extra RAM .CV
DASH Boulder Dash 2 .DAS, .DASH
DF CPUWIZ 128K .DF
DFSC CPUWIZ 128K + RAM.DFS, .DFSC
+
- +

+ +

+ @@ -3899,8 +3904,11 @@ Ms Pac-Man (Stella extended codes): right player. The value must be A or B.
Console.TelevisionType:
+
- +

+ +

@@ -3975,8 +3983,11 @@ Ms Pac-Man (Stella extended codes): how to use the X/Y axis (ie, 02 is paddle0/paddle2). -->
Controller.Left:
Controller.Right:
+
- +

+ +

diff --git a/src/debugger/gui/CartCVPlusWidget.cxx b/src/debugger/gui/CartCVPlusWidget.cxx deleted file mode 100644 index cab27d3e5..000000000 --- a/src/debugger/gui/CartCVPlusWidget.cxx +++ /dev/null @@ -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); -} diff --git a/src/debugger/gui/CartCVPlusWidget.hxx b/src/debugger/gui/CartCVPlusWidget.hxx deleted file mode 100644 index b1401b07c..000000000 --- a/src/debugger/gui/CartCVPlusWidget.hxx +++ /dev/null @@ -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 diff --git a/src/debugger/gui/module.mk b/src/debugger/gui/module.mk index d80408a60..522d31cf4 100644 --- a/src/debugger/gui/module.mk +++ b/src/debugger/gui/module.mk @@ -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 \ diff --git a/src/emucore/Bankswitch.cxx b/src/emucore/Bankswitch.cxx index 231d6f73f..9726dc6aa 100644 --- a/src/emucore/Bankswitch.cxx +++ b/src/emucore/Bankswitch.cxx @@ -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 }, diff --git a/src/emucore/Bankswitch.hxx b/src/emucore/Bankswitch.hxx index c57f81609..4ed7cc445 100644 --- a/src/emucore/Bankswitch.hxx +++ b/src/emucore/Bankswitch.hxx @@ -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 diff --git a/src/emucore/CartCVPlus.cxx b/src/emucore/CartCVPlus.cxx deleted file mode 100644 index a3258e53c..000000000 --- a/src/emucore/CartCVPlus.cxx +++ /dev/null @@ -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(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; -} diff --git a/src/emucore/CartCVPlus.hxx b/src/emucore/CartCVPlus.hxx deleted file mode 100644 index 63fcb62da..000000000 --- a/src/emucore/CartCVPlus.hxx +++ /dev/null @@ -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 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 diff --git a/src/emucore/CartDetector.cxx b/src/emucore/CartDetector.cxx index 9fe79314f..09e0def71 100644 --- a/src/emucore/CartDetector.cxx +++ b/src/emucore/CartDetector.cxx @@ -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(image, size, md5, settings); case Bankswitch::Type::_CV: return make_unique(image, size, md5, settings); - case Bankswitch::Type::_CVP: - return make_unique(image, size, md5, settings); case Bankswitch::Type::_DASH: return make_unique(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) { diff --git a/src/emucore/CartDetector.hxx b/src/emucore/CartDetector.hxx index 5f6a60674..8f9d04ac9 100644 --- a/src/emucore/CartDetector.hxx +++ b/src/emucore/CartDetector.hxx @@ -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 */ diff --git a/src/emucore/module.mk b/src/emucore/module.mk index bbdd5eaab..4b72d3b22 100644 --- a/src/emucore/module.mk +++ b/src/emucore/module.mk @@ -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 \ diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj index fcd2b85fb..46fd9a877 100644 --- a/src/windows/Stella.vcxproj +++ b/src/windows/Stella.vcxproj @@ -585,9 +585,6 @@ true - - true - true @@ -724,7 +721,6 @@ - @@ -1596,9 +1592,6 @@ true - - true - true @@ -1747,7 +1740,6 @@ - diff --git a/src/windows/Stella.vcxproj.filters b/src/windows/Stella.vcxproj.filters index ef41cf662..8f9d893f8 100644 --- a/src/windows/Stella.vcxproj.filters +++ b/src/windows/Stella.vcxproj.filters @@ -759,12 +759,6 @@ Source Files\debugger - - Source Files\emucore - - - Source Files\debugger - Source Files\debugger @@ -1748,12 +1742,6 @@ Header Files\debugger - - Header Files\debugger - - - Header Files\emucore - Header Files\debugger
Cartridge.Name: