From 5b6fabcf3cd2d66644bdb8ae9ce02f20037afe24 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Mon, 20 Nov 2017 15:27:05 -0330 Subject: [PATCH] Header file fixes for remaining files in 'emucore'. --- src/emucore/CartDetector.hxx | 1 - src/emucore/KidVid.cxx | 1 + src/emucore/KidVid.hxx | 3 ++- src/emucore/M6502.cxx | 1 + src/emucore/M6502.hxx | 10 +++++----- src/emucore/M6532.cxx | 3 --- src/emucore/M6532.hxx | 2 +- src/emucore/MD5.cxx | 1 + src/emucore/MD5.hxx | 3 ++- src/emucore/PropsSet.cxx | 3 +-- src/emucore/PropsSet.hxx | 8 ++++---- src/emucore/Random.hxx | 22 +++++++++++----------- src/emucore/SaveKey.cxx | 36 ++++++++++++++++++++++++++++++++++++ src/emucore/SaveKey.hxx | 16 ++++++++-------- src/emucore/Serializer.hxx | 1 - src/emucore/TIASurface.hxx | 1 - src/emucore/Thumbulator.cxx | 1 + src/emucore/Thumbulator.hxx | 3 ++- 18 files changed, 76 insertions(+), 40 deletions(-) diff --git a/src/emucore/CartDetector.hxx b/src/emucore/CartDetector.hxx index 416319f95..d248cc3d6 100644 --- a/src/emucore/CartDetector.hxx +++ b/src/emucore/CartDetector.hxx @@ -24,7 +24,6 @@ class OSystem; #include "bspf.hxx" #include "BSType.hxx" -#include "Settings.hxx" /** Auto-detect cart type based on various attributes (file size, signatures, diff --git a/src/emucore/KidVid.cxx b/src/emucore/KidVid.cxx index f51716565..80d1a87d4 100644 --- a/src/emucore/KidVid.cxx +++ b/src/emucore/KidVid.cxx @@ -17,6 +17,7 @@ #include +#include "Event.hxx" #include "KidVid.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/KidVid.hxx b/src/emucore/KidVid.hxx index 90120fdd0..5cda891ca 100644 --- a/src/emucore/KidVid.hxx +++ b/src/emucore/KidVid.hxx @@ -20,9 +20,10 @@ #include +class Event; + #include "bspf.hxx" #include "Control.hxx" -#include "Event.hxx" /** The KidVid Voice Module, created by Coleco. This class emulates the diff --git a/src/emucore/M6502.cxx b/src/emucore/M6502.cxx index 6c4eb4385..f53d86d25 100644 --- a/src/emucore/M6502.cxx +++ b/src/emucore/M6502.cxx @@ -42,6 +42,7 @@ #include "Settings.hxx" #include "Vec.hxx" +#include "System.hxx" #include "M6502.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/M6502.hxx b/src/emucore/M6502.hxx index d23c4369b..96a890b7a 100644 --- a/src/emucore/M6502.hxx +++ b/src/emucore/M6502.hxx @@ -18,6 +18,11 @@ #ifndef M6502_HXX #define M6502_HXX +#include + +class Settings; +class System; + #ifdef DEBUGGER_SUPPORT class Debugger; class CpuDebug; @@ -27,12 +32,7 @@ #include "TrapArray.hxx" #endif -class Settings; - -#include - #include "bspf.hxx" -#include "System.hxx" #include "Serializable.hxx" /** diff --git a/src/emucore/M6532.cxx b/src/emucore/M6532.cxx index 18efd8411..c2d903e95 100644 --- a/src/emucore/M6532.cxx +++ b/src/emucore/M6532.cxx @@ -16,15 +16,12 @@ //============================================================================ #include -#include -#include #include "Console.hxx" #include "Settings.hxx" #include "Switches.hxx" #include "System.hxx" #ifdef DEBUGGER_SUPPORT - //#include "Debugger.hxx" #include "CartDebug.hxx" #endif diff --git a/src/emucore/M6532.hxx b/src/emucore/M6532.hxx index 2e4bf4e89..ebd298d33 100644 --- a/src/emucore/M6532.hxx +++ b/src/emucore/M6532.hxx @@ -20,11 +20,11 @@ class Console; class RiotDebug; +class System; class Settings; #include "bspf.hxx" #include "Device.hxx" -#include "System.hxx" /** This class models the M6532 RAM-I/O-Timer (aka RIOT) chip in the 2600 diff --git a/src/emucore/MD5.cxx b/src/emucore/MD5.cxx index 8cfb6e085..e9fc55cfb 100644 --- a/src/emucore/MD5.cxx +++ b/src/emucore/MD5.cxx @@ -18,6 +18,7 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ +#include "FSNode.hxx" #include "MD5.hxx" /* diff --git a/src/emucore/MD5.hxx b/src/emucore/MD5.hxx index cbec6db34..1fece5782 100644 --- a/src/emucore/MD5.hxx +++ b/src/emucore/MD5.hxx @@ -18,7 +18,8 @@ #ifndef MD5_HXX #define MD5_HXX -#include "FSNode.hxx" +class FilesystemNode; + #include "bspf.hxx" namespace MD5 { diff --git a/src/emucore/PropsSet.cxx b/src/emucore/PropsSet.cxx index 4a80e7956..63367e594 100644 --- a/src/emucore/PropsSet.cxx +++ b/src/emucore/PropsSet.cxx @@ -18,10 +18,9 @@ #include #include "bspf.hxx" - +#include "FSNode.hxx" #include "DefProps.hxx" #include "Props.hxx" - #include "PropsSet.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/PropsSet.hxx b/src/emucore/PropsSet.hxx index 230b8abef..5d131ddbc 100644 --- a/src/emucore/PropsSet.hxx +++ b/src/emucore/PropsSet.hxx @@ -20,12 +20,12 @@ #include -#include "bspf.hxx" -#include "FSNode.hxx" -#include "Props.hxx" - +class FilesystemNode; class OSystem; +#include "bspf.hxx" +#include "Props.hxx" + /** This class maintains an ordered collection of properties, maintained in a C++ map and accessible by ROM md5. The md5 is used since this is diff --git a/src/emucore/Random.hxx b/src/emucore/Random.hxx index 940e3fa90..0eb989f4d 100644 --- a/src/emucore/Random.hxx +++ b/src/emucore/Random.hxx @@ -66,18 +66,18 @@ class Random : public Serializable */ bool save(Serializer& out) const override { - try - { - out.putString(name()); - out.putInt(myValue); - } - catch(...) - { - cerr << "ERROR: Random::save" << endl; - return false; - } + try + { + out.putString(name()); + out.putInt(myValue); + } + catch(...) + { + cerr << "ERROR: Random::save" << endl; + return false; + } - return true; + return true; } /** diff --git a/src/emucore/SaveKey.cxx b/src/emucore/SaveKey.cxx index 77f717101..35edd828f 100644 --- a/src/emucore/SaveKey.cxx +++ b/src/emucore/SaveKey.cxx @@ -15,6 +15,7 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ +#include "MT24LC256.hxx" #include "System.hxx" #include "SaveKey.hxx" @@ -35,6 +36,11 @@ SaveKey::SaveKey(Jack jack, const Event& event, const System& system, { } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +SaveKey::~SaveKey() +{ +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool SaveKey::read(DigitalPin pin) { @@ -77,3 +83,33 @@ void SaveKey::write(DigitalPin pin, bool value) break; } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void SaveKey::reset() +{ + myEEPROM->systemReset(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void SaveKey::close() +{ + myEEPROM.reset(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void SaveKey::eraseAll() +{ + myEEPROM->eraseAll(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void SaveKey::eraseCurrent() +{ + myEEPROM->eraseCurrent(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool SaveKey::isPageUsed(const uInt32 page) const +{ + return myEEPROM->isPageUsed(page); +} diff --git a/src/emucore/SaveKey.hxx b/src/emucore/SaveKey.hxx index d7b24620d..317bec10f 100644 --- a/src/emucore/SaveKey.hxx +++ b/src/emucore/SaveKey.hxx @@ -18,8 +18,9 @@ #ifndef SAVEKEY_HXX #define SAVEKEY_HXX +class MT24LC256; + #include "Control.hxx" -#include "MT24LC256.hxx" /** Richard Hutchinson's SaveKey "controller", consisting of a 32KB EEPROM @@ -43,8 +44,7 @@ class SaveKey : public Controller */ SaveKey(Jack jack, const Event& event, const System& system, const string& eepromfile); - - virtual ~SaveKey() = default; + virtual ~SaveKey(); protected: /** @@ -86,21 +86,21 @@ class SaveKey : public Controller been called. It may be necessary to override this method for controllers that need to know a reset has occurred. */ - void reset() override { myEEPROM->systemReset(); } + void reset() override; /** Force the EEPROM object to cleanup */ - void close() override { myEEPROM.reset(); } + void close() override; /** Erase entire EEPROM to known state ($FF) */ - void eraseAll() { myEEPROM->eraseAll(); } + void eraseAll(); /** Erase the pages used by the current ROM to known state ($FF) */ - void eraseCurrent() { myEEPROM->eraseCurrent(); } + void eraseCurrent(); /** Returns true if the page is used by the current ROM */ - bool isPageUsed(const uInt32 page) const { return myEEPROM->isPageUsed(page); } + bool isPageUsed(const uInt32 page) const; private: // The EEPROM used in the SaveKey diff --git a/src/emucore/Serializer.hxx b/src/emucore/Serializer.hxx index 03acbc852..f590ef60f 100644 --- a/src/emucore/Serializer.hxx +++ b/src/emucore/Serializer.hxx @@ -18,7 +18,6 @@ #ifndef SERIALIZER_HXX #define SERIALIZER_HXX -#include #include "bspf.hxx" /** diff --git a/src/emucore/TIASurface.hxx b/src/emucore/TIASurface.hxx index 6cee9eac2..8390fc52d 100644 --- a/src/emucore/TIASurface.hxx +++ b/src/emucore/TIASurface.hxx @@ -27,7 +27,6 @@ class VideoMode; #include -#include "FrameManager.hxx" #include "Rect.hxx" #include "NTSCFilter.hxx" #include "bspf.hxx" diff --git a/src/emucore/Thumbulator.cxx b/src/emucore/Thumbulator.cxx index c41a5a51f..986cb7393 100644 --- a/src/emucore/Thumbulator.cxx +++ b/src/emucore/Thumbulator.cxx @@ -26,6 +26,7 @@ #include "bspf.hxx" #include "Base.hxx" +#include "Cart.hxx" #include "Thumbulator.hxx" using Common::Base; diff --git a/src/emucore/Thumbulator.hxx b/src/emucore/Thumbulator.hxx index 8b9192754..0b1953a28 100644 --- a/src/emucore/Thumbulator.hxx +++ b/src/emucore/Thumbulator.hxx @@ -27,6 +27,8 @@ #ifndef THUMBULATOR_HXX #define THUMBULATOR_HXX +class Cartridge; + // FIXME - This code has many instances of shifting into signed integers // Perhaps the int's should be changed to uInt32 #ifdef __clang__ @@ -35,7 +37,6 @@ #endif #include "bspf.hxx" -#include "Cart.hxx" #include "Console.hxx" #define ROMADDMASK 0x7FFF