Integrated NullDevice into one header file.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3035 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-11-03 16:39:26 +00:00
parent 5dbb2e4261
commit 6f5c5b2df5
3 changed files with 18 additions and 81 deletions

View File

@ -1,68 +0,0 @@
//============================================================================
//
// MM MM 6666 555555 0000 2222
// MMMM MMMM 66 66 55 00 00 22 22
// MM MMM MM 66 55 00 00 22
// MM M MM 66666 55555 00 00 22222 -- "A 6502 Microprocessor Emulator"
// MM MM 66 66 55 00 00 22
// MM MM 66 66 55 55 00 00 22
// MM MM 6666 5555 0000 222222
//
// Copyright (c) 1995-2014 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.
//
// $Id$
//============================================================================
#include "Serializer.hxx"
#include "NullDev.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NullDevice::NullDevice()
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NullDevice::~NullDevice()
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void NullDevice::reset()
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void NullDevice::install(System& system)
{
mySystem = &system;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 NullDevice::peek(uInt16 address)
{
cerr << hex << "NullDevice: peek(" << address << ")" << endl;
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool NullDevice::poke(uInt16 address, uInt8 value)
{
cerr << hex << "NullDevice: poke(" << address << "," << value << ")" << endl;
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool NullDevice::save(Serializer& out) const
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool NullDevice::load(Serializer& in)
{
return true;
}

View File

@ -39,26 +39,26 @@ class NullDevice : public Device
/**
Create a new null device
*/
NullDevice();
NullDevice() { }
/**
Destructor
*/
virtual ~NullDevice();
virtual ~NullDevice() { }
public:
/**
Reset device to its power-on state
*/
void reset();
/**
Install device in the specified system. Invoked by the system
when the device is attached to it.
@param system The system the device should install itself in
*/
void install(System& system);
void install(System& system) { mySystem = &system; }
/**
Reset device to its power-on state
*/
void reset() { }
/**
Save the current state of this device to the given Serializer.
@ -66,7 +66,7 @@ class NullDevice : public Device
@param out The Serializer object to use
@return False on any errors, else true
*/
bool save(Serializer& out) const;
bool save(Serializer& out) const { return true; }
/**
Load the current state of this device from the given Serializer.
@ -74,7 +74,7 @@ class NullDevice : public Device
@param in The Serializer object to use
@return False on any errors, else true
*/
bool load(Serializer& in);
bool load(Serializer& in) { return true; }
/**
Get a descriptor for the device name (used in error checking).
@ -89,7 +89,10 @@ class NullDevice : public Device
@return The byte at the specified address
*/
uInt8 peek(uInt16 address);
uInt8 peek(uInt16 address) {
cerr << hex << "NullDevice: peek(" << address << ")\n";
return 0;
}
/**
Change the byte at the specified address to the given value
@ -99,7 +102,10 @@ class NullDevice : public Device
@return True if the poke changed the device address space, else false
*/
bool poke(uInt16 address, uInt8 value);
bool poke(uInt16 address, uInt8 value) {
cerr << hex << "NullDevice: poke(" << address << "," << value << ")\n";
return false;
}
};
#endif

View File

@ -58,7 +58,6 @@ MODULE_OBJS := \
src/emucore/M6502.o \
src/emucore/M6532.o \
src/emucore/MT24LC256.o \
src/emucore/NullDev.o \
src/emucore/MD5.o \
src/emucore/OSystem.o \
src/emucore/Paddles.o \