Some 'nullptr' updates to Cart classes.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3036 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-11-03 17:16:43 +00:00
parent 6f5c5b2df5
commit 3949101fb7
18 changed files with 38 additions and 39 deletions

View File

@ -28,7 +28,6 @@ AtariVox::AtariVox(Jack jack, const Event& event, const System& system,
const string& eepromfile)
: Controller(jack, event, system, Controller::AtariVox),
mySerialPort((SerialPort&)port),
myEEPROM(NULL),
myShiftCount(0),
myShiftRegister(0),
myLastDataWriteCycle(0)
@ -38,7 +37,7 @@ AtariVox::AtariVox(Jack jack, const Event& event, const System& system,
else
myAboutString = " (invalid serial port \'" + portname + "\')";
myEEPROM = new MT24LC256(eepromfile, system);
myEEPROM = make_ptr<MT24LC256>(eepromfile, system);
myDigitalPinState[One] = myDigitalPinState[Two] =
myDigitalPinState[Three] = myDigitalPinState[Four] = true;
@ -50,7 +49,6 @@ AtariVox::AtariVox(Jack jack, const Event& event, const System& system,
AtariVox::~AtariVox()
{
mySerialPort.closePort();
delete myEEPROM;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -106,7 +106,7 @@ class AtariVox : public Controller
SerialPort& mySerialPort;
// The EEPROM used in the AtariVox
MT24LC256* myEEPROM;
unique_ptr<MT24LC256> myEEPROM;
// How many bits have been shifted into the shift register?
uInt8 myShiftCount;

View File

@ -24,7 +24,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge2K::Cartridge2K(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings)
: Cartridge(settings),
myImage(nullptr)
{
// Size can be a maximum of 2K
if(size > 2048) size = 2048;

View File

@ -27,6 +27,7 @@
Cartridge3E::Cartridge3E(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
myImage(nullptr),
mySize(size)
{
// Allocate array for the ROM image

View File

@ -27,6 +27,7 @@
Cartridge3F::Cartridge3F(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
myImage(nullptr),
mySize(size)
{
// Allocate array for the ROM image

View File

@ -28,7 +28,8 @@ CartridgeAR::CartridgeAR(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
my6502(0),
mySize(BSPF_max(size, 8448u))
mySize(BSPF_max(size, 8448u)),
myLoadImages(nullptr)
{
// Create a load image buffer and copy the given image
myLoadImages = new uInt8[mySize];

View File

@ -30,8 +30,8 @@ class System;
/**
Update of EF cartridge class used for Homestar Runner by Paul Slocum.
There are 32 4K banks (total of 128K ROM).
Accessing $1FC0 - $1FDF switches to each bank.
There are 64 4K banks (total of 256K ROM).
Accessing $1F80 - $1FBF switches to each bank.
@author Mike Saarna
@version $Id$
@ -159,8 +159,8 @@ class CartridgeBF : public Cartridge
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 64K ROM image of the cartridge
uInt8 myImage[262144];
// The 256K ROM image of the cartridge
uInt8 myImage[64 * 4096];
};
#endif

View File

@ -29,8 +29,8 @@ class System;
#endif
/**
There are 32 4K banks (total of 128K ROM) with 128 bytes of RAM.
Accessing $1FD0 - $1FEF switches to each bank.
There are 64 4K banks (total of 256K ROM) with 128 bytes of RAM.
Accessing $1F80 - $1FBF switches to each bank.
@author Stephen Anthony
@version $Id$
@ -158,8 +158,8 @@ class CartridgeBFSC : public Cartridge
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 64K ROM image of the cartridge
uInt8 myImage[131072*2];
// The 256K ROM image of the cartridge
uInt8 myImage[64 * 4096];
// The 128 bytes of RAM
uInt8 myRAM[128];

View File

@ -26,7 +26,7 @@
CartridgeCV::CartridgeCV(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
myInitialRAM(0),
myInitialRAM(nullptr),
mySize(size)
{
if(mySize == 2048)

View File

@ -24,9 +24,11 @@
#include "CartDASH.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDASH::CartridgeDASH(const uInt8* image, uInt32 size, const Settings& settings) :
Cartridge(settings), mySize(size) {
CartridgeDASH::CartridgeDASH(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings),
mySize(size),
myImage(nullptr)
{
// Allocate array for the ROM image
myImage = new uInt8[mySize];
@ -40,7 +42,8 @@ CartridgeDASH::CartridgeDASH(const uInt8* image, uInt32 size, const Settings& se
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDASH::~CartridgeDASH() {
CartridgeDASH::~CartridgeDASH()
{
delete[] myImage;
}

View File

@ -159,8 +159,8 @@ class CartridgeDF : public Cartridge
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 64K ROM image of the cartridge
uInt8 myImage[131072];
// The 128K ROM image of the cartridge
uInt8 myImage[32 * 4096];
};
#endif

View File

@ -30,7 +30,7 @@ class System;
/**
There are 32 4K banks (total of 128K ROM) with 128 bytes of RAM.
Accessing $1FD0 - $1FEF switches to each bank.
Accessing $1FC0 - $1FDF switches to each bank.
@author Stephen Anthony
@version $Id$
@ -158,8 +158,8 @@ class CartridgeDFSC : public Cartridge
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 64K ROM image of the cartridge
uInt8 myImage[131072];
// The 128K ROM image of the cartridge
uInt8 myImage[32 * 4096];
// The 128 bytes of RAM
uInt8 myRAM[128];

View File

@ -30,6 +30,7 @@
CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
myImage(nullptr),
myFastFetch(false),
myLDAimmediate(false),
myParameterPointer(0),
@ -59,8 +60,8 @@ CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size,
#ifdef THUMB_SUPPORT
// Create Thumbulator ARM emulator
myThumbEmulator = new Thumbulator((uInt16*)(myProgramImage-0xC00),
(uInt16*)myDPCRAM,
myThumbEmulator = make_ptr<Thumbulator>
((uInt16*)(myProgramImage-0xC00), (uInt16*)myDPCRAM,
settings.getBool("thumb.trapfatal"));
#endif
setInitialState();
@ -73,10 +74,6 @@ CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size,
CartridgeDPCPlus::~CartridgeDPCPlus()
{
delete[] myImage;
#ifdef THUMB_SUPPORT
delete myThumbEmulator;
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -216,7 +216,7 @@ class CartridgeDPCPlus : public Cartridge
#ifdef THUMB_SUPPORT
// Pointer to the Thumb ARM emulator object
Thumbulator* myThumbEmulator;
unique_ptr<Thumbulator> myThumbEmulator;
#endif
// Pointer to the 1K frequency table

View File

@ -38,9 +38,6 @@ CartridgeFA2::CartridgeFA2(const uInt8* image, uInt32 size, const OSystem& osyst
mySize = 28 * 1024;
}
// Allocate array for the ROM image
myImage = new uInt8[mySize];
// Copy the ROM image into my buffer
memcpy(myImage, image, mySize);
createCodeAccessBase(mySize);
@ -52,7 +49,6 @@ CartridgeFA2::CartridgeFA2(const uInt8* image, uInt32 size, const OSystem& osyst
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeFA2::~CartridgeFA2()
{
delete[] myImage;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -197,7 +197,7 @@ class CartridgeFA2 : public Cartridge
uInt16 myCurrentBank;
// The 24K/28K ROM image of the cartridge
uInt8* myImage;
uInt8 myImage[28 * 1024];
// The 256 bytes of RAM on the cartridge
uInt8 myRAM[256];

View File

@ -25,7 +25,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeMDM::CartridgeMDM(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings),
myImage(NULL),
myImage(nullptr),
mySize(size),
myBankingDisabled(false)
{
@ -43,7 +43,7 @@ CartridgeMDM::CartridgeMDM(const uInt8* image, uInt32 size, const Settings& sett
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeMDM::~CartridgeMDM()
{
delete[] myImage; myImage = NULL;
delete[] myImage;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -26,6 +26,7 @@
CartridgeSB::CartridgeSB(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
myImage(nullptr),
mySize(size)
{
// Allocate array for the ROM image