mirror of https://github.com/stella-emu/stella.git
More pointer rearrangment for Console class.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3034 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
a21f3be6e4
commit
5dbb2e4261
|
@ -66,13 +66,11 @@
|
||||||
#include "Console.hxx"
|
#include "Console.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Console::Console(OSystem& osystem, Cartridge& cart, const Properties& props)
|
Console::Console(OSystem& osystem, Cartridge* cart, const Properties& props)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem),
|
||||||
myCart(cart),
|
|
||||||
myEvent(osystem.eventHandler().event()),
|
myEvent(osystem.eventHandler().event()),
|
||||||
myProperties(props),
|
myProperties(props),
|
||||||
myTIA(0),
|
myCMHandler(nullptr),
|
||||||
myCMHandler(0),
|
|
||||||
myDisplayFormat(""), // Unknown TV format @ start
|
myDisplayFormat(""), // Unknown TV format @ start
|
||||||
myFramerate(0.0), // Unknown framerate @ start
|
myFramerate(0.0), // Unknown framerate @ start
|
||||||
myCurrentFormat(0), // Unknown format @ start
|
myCurrentFormat(0), // Unknown format @ start
|
||||||
|
@ -81,31 +79,25 @@ Console::Console(OSystem& osystem, Cartridge& cart, const Properties& props)
|
||||||
// Load user-defined palette for this ROM
|
// Load user-defined palette for this ROM
|
||||||
loadUserPalette();
|
loadUserPalette();
|
||||||
|
|
||||||
// Create switches for the console
|
// Create subsystems for the console
|
||||||
|
my6502 = make_ptr<M6502>(myOSystem.settings());
|
||||||
|
myRiot = make_ptr<M6532>(*this, myOSystem.settings());
|
||||||
|
myTIA = make_ptr<TIA>(*this, myOSystem.sound(), myOSystem.settings());
|
||||||
|
myCart = unique_ptr<Cartridge>(cart);
|
||||||
mySwitches = make_ptr<Switches>(myEvent, myProperties);
|
mySwitches = make_ptr<Switches>(myEvent, myProperties);
|
||||||
|
|
||||||
// Construct the system and components
|
// Construct the system and components
|
||||||
mySystem = make_ptr<System>(osystem);
|
mySystem = make_ptr<System>(osystem, *my6502, *myRiot, *myTIA, *myCart);
|
||||||
|
|
||||||
// The real controllers for this console will be added later
|
// The real controllers for this console will be added later
|
||||||
// For now, we just add dummy joystick controllers, since autodetection
|
// For now, we just add dummy joystick controllers, since autodetection
|
||||||
// runs the emulation for a while, and this may interfere with 'smart'
|
// runs the emulation for a while, and this may interfere with 'smart'
|
||||||
// controllers such as the AVox and SaveKey
|
// controllers such as the AVox and SaveKey
|
||||||
// Note that the controllers must be added directly after the system
|
|
||||||
// has been created, and before any other device is added
|
|
||||||
// (particularly the M6532)
|
|
||||||
myControllers[0] = new Joystick(Controller::Left, myEvent, *mySystem);
|
myControllers[0] = new Joystick(Controller::Left, myEvent, *mySystem);
|
||||||
myControllers[1] = new Joystick(Controller::Right, myEvent, *mySystem);
|
myControllers[1] = new Joystick(Controller::Right, myEvent, *mySystem);
|
||||||
|
|
||||||
M6502* m6502 = new M6502(myOSystem.settings());
|
// We can only initialize after all the devices/components have been created
|
||||||
|
mySystem->initialize();
|
||||||
myRiot = new M6532(*this, myOSystem.settings());
|
|
||||||
myTIA = new TIA(*this, myOSystem.sound(), myOSystem.settings());
|
|
||||||
|
|
||||||
mySystem->attach(m6502);
|
|
||||||
mySystem->attach(myRiot);
|
|
||||||
mySystem->attach(myTIA);
|
|
||||||
mySystem->attach(&myCart);
|
|
||||||
|
|
||||||
// Auto-detect NTSC/PAL mode if it's requested
|
// Auto-detect NTSC/PAL mode if it's requested
|
||||||
string autodetected = "";
|
string autodetected = "";
|
||||||
|
@ -166,9 +158,9 @@ Console::Console(OSystem& osystem, Cartridge& cart, const Properties& props)
|
||||||
myConsoleInfo.CartMD5 = myProperties.get(Cartridge_MD5);
|
myConsoleInfo.CartMD5 = myProperties.get(Cartridge_MD5);
|
||||||
myConsoleInfo.Control0 = myControllers[0]->about();
|
myConsoleInfo.Control0 = myControllers[0]->about();
|
||||||
myConsoleInfo.Control1 = myControllers[1]->about();
|
myConsoleInfo.Control1 = myControllers[1]->about();
|
||||||
myConsoleInfo.BankSwitch = myCart.about();
|
myConsoleInfo.BankSwitch = myCart->about();
|
||||||
|
|
||||||
myCart.setRomName(myConsoleInfo.CartName);
|
myCart->setRomName(myConsoleInfo.CartName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -471,7 +463,7 @@ void Console::initializeAudio()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Console::fry() const
|
void Console::fry() const
|
||||||
{
|
{
|
||||||
for (int ZPmem=0; ZPmem<0x100; ZPmem += rand() % 4)
|
for(int ZPmem = 0; ZPmem < 0x100; ZPmem += rand() % 4)
|
||||||
mySystem->poke(ZPmem, mySystem->peek(ZPmem) & (uInt8)rand() % 256);
|
mySystem->poke(ZPmem, mySystem->peek(ZPmem) & (uInt8)rand() % 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ class Event;
|
||||||
class Switches;
|
class Switches;
|
||||||
class System;
|
class System;
|
||||||
class TIA;
|
class TIA;
|
||||||
|
class M6502;
|
||||||
class M6532;
|
class M6532;
|
||||||
class Cartridge;
|
class Cartridge;
|
||||||
class CompuMate;
|
class CompuMate;
|
||||||
|
@ -68,7 +69,7 @@ class Console : public Serializable
|
||||||
@param cart The cartridge to use with this console
|
@param cart The cartridge to use with this console
|
||||||
@param props The properties for the cartridge
|
@param props The properties for the cartridge
|
||||||
*/
|
*/
|
||||||
Console(OSystem& osystem, Cartridge& cart, const Properties& props);
|
Console(OSystem& osystem, Cartridge* cart, const Properties& props);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
@ -119,7 +120,7 @@ class Console : public Serializable
|
||||||
|
|
||||||
@return The cartridge for this console
|
@return The cartridge for this console
|
||||||
*/
|
*/
|
||||||
Cartridge& cartridge() const { return myCart; }
|
Cartridge& cartridge() const { return *myCart; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the 6532 used by the console
|
Get the 6532 used by the console
|
||||||
|
@ -330,30 +331,33 @@ class Console : public Serializable
|
||||||
// Reference to the osystem object
|
// Reference to the osystem object
|
||||||
OSystem& myOSystem;
|
OSystem& myOSystem;
|
||||||
|
|
||||||
// Pointer to the Cartridge (the debugger needs it)
|
|
||||||
Cartridge& myCart;
|
|
||||||
|
|
||||||
// Reference to the event object to use
|
// Reference to the event object to use
|
||||||
const Event& myEvent;
|
const Event& myEvent;
|
||||||
|
|
||||||
// Properties for the game
|
// Properties for the game
|
||||||
Properties myProperties;
|
Properties myProperties;
|
||||||
|
|
||||||
// Pointers to the left and right controllers
|
|
||||||
Controller* myControllers[2];
|
|
||||||
|
|
||||||
// Pointer to the TIA object
|
|
||||||
TIA* myTIA;
|
|
||||||
|
|
||||||
// Pointer to the switches on the front of the console
|
|
||||||
unique_ptr<Switches> mySwitches;
|
|
||||||
|
|
||||||
// Pointer to the 6502 based system being emulated
|
// Pointer to the 6502 based system being emulated
|
||||||
unique_ptr<System> mySystem;
|
unique_ptr<System> mySystem;
|
||||||
|
|
||||||
|
// Pointer to the M6502 CPU
|
||||||
|
unique_ptr<M6502> my6502;
|
||||||
|
|
||||||
// Pointer to the 6532 (aka RIOT) (the debugger needs it)
|
// Pointer to the 6532 (aka RIOT) (the debugger needs it)
|
||||||
// A RIOT of my own! (...with apologies to The Clash...)
|
// A RIOT of my own! (...with apologies to The Clash...)
|
||||||
M6532* myRiot;
|
unique_ptr<M6532> myRiot;
|
||||||
|
|
||||||
|
// Pointer to the TIA object
|
||||||
|
unique_ptr<TIA> myTIA;
|
||||||
|
|
||||||
|
// Pointer to the Cartridge (the debugger needs it)
|
||||||
|
unique_ptr<Cartridge> myCart;
|
||||||
|
|
||||||
|
// Pointer to the switches on the front of the console
|
||||||
|
unique_ptr<Switches> mySwitches;
|
||||||
|
|
||||||
|
// Pointers to the left and right controllers
|
||||||
|
Controller* myControllers[2];
|
||||||
|
|
||||||
// Pointer to CompuMate handler (only used in CompuMate ROMs)
|
// Pointer to CompuMate handler (only used in CompuMate ROMs)
|
||||||
CompuMate* myCMHandler;
|
CompuMate* myCMHandler;
|
||||||
|
|
|
@ -573,7 +573,7 @@ Console* OSystem::openConsole(const FilesystemNode& romfile, string& md5,
|
||||||
|
|
||||||
// Finally, create the cart with the correct properties
|
// Finally, create the cart with the correct properties
|
||||||
if(cart)
|
if(cart)
|
||||||
console = new Console(*this, *cart, props);
|
console = new Console(*this, cart, props);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free the image since we don't need it any longer
|
// Free the image since we don't need it any longer
|
||||||
|
|
|
@ -24,15 +24,17 @@
|
||||||
#include "M6502.hxx"
|
#include "M6502.hxx"
|
||||||
#include "M6532.hxx"
|
#include "M6532.hxx"
|
||||||
#include "TIA.hxx"
|
#include "TIA.hxx"
|
||||||
|
#include "Cart.hxx"
|
||||||
#include "System.hxx"
|
#include "System.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
System::System(const OSystem& osystem)
|
System::System(const OSystem& osystem, M6502& m6502, M6532& m6532,
|
||||||
|
TIA& mTIA, Cartridge& mCart)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem),
|
||||||
myNumberOfDevices(0),
|
myM6502(m6502),
|
||||||
myM6502(0),
|
myM6532(m6532),
|
||||||
myM6532(0),
|
myTIA(mTIA),
|
||||||
myTIA(0),
|
myCart(mCart),
|
||||||
myCycles(0),
|
myCycles(0),
|
||||||
myDataBusState(0),
|
myDataBusState(0),
|
||||||
myDataBusLocked(false),
|
myDataBusLocked(false),
|
||||||
|
@ -60,20 +62,21 @@ System::System(const OSystem& osystem)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
System::~System()
|
System::~System()
|
||||||
{
|
{
|
||||||
// Free the devices attached to me, since I own them
|
|
||||||
for(uInt32 i = 0; i < myNumberOfDevices; ++i)
|
|
||||||
{
|
|
||||||
delete myDevices[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Free the M6502 that I own
|
|
||||||
delete myM6502;
|
|
||||||
|
|
||||||
// Free my page access table and dirty list
|
// Free my page access table and dirty list
|
||||||
delete[] myPageAccessTable;
|
delete[] myPageAccessTable;
|
||||||
delete[] myPageIsDirtyTable;
|
delete[] myPageIsDirtyTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void System::initialize()
|
||||||
|
{
|
||||||
|
// Install all devices
|
||||||
|
myM6532.install(*this);
|
||||||
|
myTIA.install(*this);
|
||||||
|
myCart.install(*this);
|
||||||
|
myM6502.install(*this); // Must always be installed last
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void System::reset(bool autodetect)
|
void System::reset(bool autodetect)
|
||||||
{
|
{
|
||||||
|
@ -83,65 +86,23 @@ void System::reset(bool autodetect)
|
||||||
// Reset system cycle counter
|
// Reset system cycle counter
|
||||||
resetCycles();
|
resetCycles();
|
||||||
|
|
||||||
// First we reset the devices attached to myself
|
// Reset all devices
|
||||||
for(uInt32 i = 0; i < myNumberOfDevices; ++i)
|
myM6532.reset();
|
||||||
myDevices[i]->reset();
|
myTIA.reset();
|
||||||
|
myCart.reset();
|
||||||
// Now we reset the processor if it exists
|
myM6502.reset(); // Must always be reset last
|
||||||
if(myM6502 != 0)
|
|
||||||
myM6502->reset();
|
|
||||||
|
|
||||||
// There are no dirty pages upon startup
|
// There are no dirty pages upon startup
|
||||||
clearDirtyPages();
|
clearDirtyPages();
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
void System::attach(Device* device)
|
|
||||||
{
|
|
||||||
assert(myNumberOfDevices < 5);
|
|
||||||
|
|
||||||
// Add device to my collection of devices
|
|
||||||
myDevices[myNumberOfDevices++] = device;
|
|
||||||
|
|
||||||
// Ask the device to install itself
|
|
||||||
device->install(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
void System::attach(M6502* m6502)
|
|
||||||
{
|
|
||||||
// Remember the processor
|
|
||||||
myM6502 = m6502;
|
|
||||||
|
|
||||||
// Ask the processor to install itself
|
|
||||||
myM6502->install(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
void System::attach(M6532* m6532)
|
|
||||||
{
|
|
||||||
// Remember the processor
|
|
||||||
myM6532 = m6532;
|
|
||||||
|
|
||||||
// Attach it as a normal device
|
|
||||||
attach(static_cast<Device*>(m6532));
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
void System::attach(TIA* tia)
|
|
||||||
{
|
|
||||||
myTIA = tia;
|
|
||||||
attach(static_cast<Device*>(tia));
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void System::resetCycles()
|
void System::resetCycles()
|
||||||
{
|
{
|
||||||
// First we let all of the device attached to me know about the reset
|
// First we let all of the device attached to me know about the reset
|
||||||
for(uInt32 i = 0; i < myNumberOfDevices; ++i)
|
myM6532.systemCyclesReset();
|
||||||
{
|
myTIA.systemCyclesReset();
|
||||||
myDevices[i]->systemCyclesReset();
|
myCart.systemCyclesReset();
|
||||||
}
|
|
||||||
|
|
||||||
// Now, we reset cycle count to zero
|
// Now, we reset cycle count to zero
|
||||||
myCycles = 0;
|
myCycles = 0;
|
||||||
|
@ -290,13 +251,15 @@ bool System::save(Serializer& out) const
|
||||||
out.putInt(myCycles);
|
out.putInt(myCycles);
|
||||||
out.putByte(myDataBusState);
|
out.putByte(myDataBusState);
|
||||||
|
|
||||||
if(!myM6502->save(out))
|
// Save the state of each device
|
||||||
|
if(!myM6502.save(out))
|
||||||
|
return false;
|
||||||
|
if(!myM6532.save(out))
|
||||||
|
return false;
|
||||||
|
if(!myTIA.save(out))
|
||||||
|
return false;
|
||||||
|
if(!myCart.save(out))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Now save the state of each device
|
|
||||||
for(uInt32 i = 0; i < myNumberOfDevices; ++i)
|
|
||||||
if(!myDevices[i]->save(out))
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
|
@ -318,14 +281,15 @@ bool System::load(Serializer& in)
|
||||||
myCycles = in.getInt();
|
myCycles = in.getInt();
|
||||||
myDataBusState = in.getByte();
|
myDataBusState = in.getByte();
|
||||||
|
|
||||||
// Next, load state for the CPU
|
// Load the state of each device
|
||||||
if(!myM6502->load(in))
|
if(!myM6502.load(in))
|
||||||
|
return false;
|
||||||
|
if(!myM6532.load(in))
|
||||||
|
return false;
|
||||||
|
if(!myTIA.load(in))
|
||||||
|
return false;
|
||||||
|
if(!myCart.load(in))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Now load the state of each device
|
|
||||||
for(uInt32 i = 0; i < myNumberOfDevices; ++i)
|
|
||||||
if(!myDevices[i]->load(in))
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,7 +52,8 @@ class System : public Serializable
|
||||||
Create a new system with an addressing space of 2^13 bytes and
|
Create a new system with an addressing space of 2^13 bytes and
|
||||||
pages of 2^6 bytes.
|
pages of 2^6 bytes.
|
||||||
*/
|
*/
|
||||||
System(const OSystem& osystem);
|
System(const OSystem& osystem, M6502& m6502, M6532& m6532,
|
||||||
|
TIA& mTIA, Cartridge& mCart);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
@ -72,6 +73,11 @@ class System : public Serializable
|
||||||
static const uInt16 NUM_PAGES = 1 << (13 - PAGE_SHIFT);
|
static const uInt16 NUM_PAGES = 1 << (13 - PAGE_SHIFT);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
Initialize system and all attached devices to known state.
|
||||||
|
*/
|
||||||
|
void initialize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reset the system cycle counter, the attached devices, and the
|
Reset the system cycle counter, the attached devices, and the
|
||||||
attached processor of the system.
|
attached processor of the system.
|
||||||
|
@ -85,38 +91,6 @@ class System : public Serializable
|
||||||
*/
|
*/
|
||||||
void reset(bool autodetect = false);
|
void reset(bool autodetect = false);
|
||||||
|
|
||||||
/**
|
|
||||||
Attach the specified device and claim ownership of it. The device
|
|
||||||
will be asked to install itself.
|
|
||||||
|
|
||||||
@param device The device to attach to the system
|
|
||||||
*/
|
|
||||||
void attach(Device* device);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Attach the specified processor and claim ownership of it. The
|
|
||||||
processor will be asked to install itself.
|
|
||||||
|
|
||||||
@param m6502 The 6502 microprocessor to attach to the system
|
|
||||||
*/
|
|
||||||
void attach(M6502* m6502);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Attach the specified processor and claim ownership of it. The
|
|
||||||
processor will be asked to install itself.
|
|
||||||
|
|
||||||
@param m6532 The 6532 microprocessor to attach to the system
|
|
||||||
*/
|
|
||||||
void attach(M6532* m6532);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Attach the specified TIA device and claim ownership of it. The device
|
|
||||||
will be asked to install itself.
|
|
||||||
|
|
||||||
@param tia The TIA device to attach to the system
|
|
||||||
*/
|
|
||||||
void attach(TIA* tia);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
Answer the 6502 microprocessor attached to the system. If a
|
Answer the 6502 microprocessor attached to the system. If a
|
||||||
|
@ -124,7 +98,7 @@ class System : public Serializable
|
||||||
|
|
||||||
@return The attached 6502 microprocessor
|
@return The attached 6502 microprocessor
|
||||||
*/
|
*/
|
||||||
M6502& m6502() const { return *myM6502; }
|
M6502& m6502() const { return myM6502; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Answer the 6532 processor attached to the system. If a
|
Answer the 6532 processor attached to the system. If a
|
||||||
|
@ -132,14 +106,14 @@ class System : public Serializable
|
||||||
|
|
||||||
@return The attached 6532 microprocessor
|
@return The attached 6532 microprocessor
|
||||||
*/
|
*/
|
||||||
M6532& m6532() const { return *myM6532; }
|
M6532& m6532() const { return myM6532; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Answer the TIA device attached to the system.
|
Answer the TIA device attached to the system.
|
||||||
|
|
||||||
@return The attached TIA device
|
@return The attached TIA device
|
||||||
*/
|
*/
|
||||||
TIA& tia() const { return *myTIA; }
|
TIA& tia() const { return myTIA; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Answer the random generator attached to the system.
|
Answer the random generator attached to the system.
|
||||||
|
@ -404,26 +378,17 @@ class System : public Serializable
|
||||||
private:
|
private:
|
||||||
const OSystem& myOSystem;
|
const OSystem& myOSystem;
|
||||||
|
|
||||||
// Pointer to a dynamically allocated array of PageAccess structures
|
// 6502 processor attached to the system
|
||||||
PageAccess* myPageAccessTable;
|
M6502& myM6502;
|
||||||
|
|
||||||
// Pointer to a dynamically allocated array for dirty pages
|
// 6532 processor attached to the system
|
||||||
bool* myPageIsDirtyTable;
|
M6532& myM6532;
|
||||||
|
|
||||||
// Array of all the devices attached to the system
|
// TIA device attached to the system
|
||||||
Device* myDevices[5];
|
TIA& myTIA;
|
||||||
|
|
||||||
// Number of devices attached to the system
|
// Cartridge device attached to the system
|
||||||
uInt32 myNumberOfDevices;
|
Cartridge& myCart;
|
||||||
|
|
||||||
// 6502 processor attached to the system or the null pointer
|
|
||||||
M6502* myM6502;
|
|
||||||
|
|
||||||
// 6532 processor attached to the system or the null pointer
|
|
||||||
M6532* myM6532;
|
|
||||||
|
|
||||||
// TIA device attached to the system or the null pointer
|
|
||||||
TIA* myTIA;
|
|
||||||
|
|
||||||
// Number of system cycles executed since the last reset
|
// Number of system cycles executed since the last reset
|
||||||
uInt32 myCycles;
|
uInt32 myCycles;
|
||||||
|
@ -431,6 +396,12 @@ class System : public Serializable
|
||||||
// Null device to use for page which are not installed
|
// Null device to use for page which are not installed
|
||||||
NullDevice myNullDevice;
|
NullDevice myNullDevice;
|
||||||
|
|
||||||
|
// Pointer to a dynamically allocated array of PageAccess structures
|
||||||
|
PageAccess* myPageAccessTable;
|
||||||
|
|
||||||
|
// Pointer to a dynamically allocated array for dirty pages
|
||||||
|
bool* myPageIsDirtyTable;
|
||||||
|
|
||||||
// The current state of the Data Bus
|
// The current state of the Data Bus
|
||||||
uInt8 myDataBusState;
|
uInt8 myDataBusState;
|
||||||
|
|
||||||
|
|
|
@ -252,8 +252,6 @@ void TIA::install(System& system, Device& device)
|
||||||
// Remember which system I'm installed in
|
// Remember which system I'm installed in
|
||||||
mySystem = &system;
|
mySystem = &system;
|
||||||
|
|
||||||
mySystem->resetCycles();
|
|
||||||
|
|
||||||
// All accesses are to the given device
|
// All accesses are to the given device
|
||||||
System::PageAccess access(&device, System::PA_READWRITE);
|
System::PageAccess access(&device, System::PA_READWRITE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue