From a7f176441166b52210d9033748d9301cc55204ee Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Thu, 16 Nov 2017 13:31:20 -0330 Subject: [PATCH] Second pass at optimizing header files, to eliminate cascaded compiles. --- src/debugger/CartDebug.cxx | 1 + src/debugger/CartDebug.hxx | 8 +-- src/debugger/CpuDebug.cxx | 73 +++++++++++++++++++++++++++ src/debugger/CpuDebug.hxx | 35 +++++++------ src/debugger/Debugger.cxx | 5 ++ src/debugger/Debugger.hxx | 7 ++- src/debugger/DebuggerParser.cxx | 25 ++++----- src/debugger/DebuggerParser.hxx | 3 +- src/debugger/TIADebug.cxx | 61 ++++++++++++++++++++++ src/debugger/TIADebug.hxx | 29 +++++------ src/debugger/gui/ControllerWidget.hxx | 1 + src/debugger/gui/DebuggerDialog.cxx | 2 + src/debugger/gui/DebuggerDialog.hxx | 7 ++- src/debugger/gui/RomListSettings.cxx | 1 + src/debugger/gui/RomWidget.cxx | 1 + src/debugger/gui/TiaOutputWidget.cxx | 1 + src/debugger/gui/TiaOutputWidget.hxx | 4 +- src/emucore/EventHandler.cxx | 6 +++ src/emucore/EventHandler.hxx | 5 +- src/emucore/FrameBuffer.hxx | 50 +----------------- src/emucore/FrameBufferConstants.hxx | 72 ++++++++++++++++++++++++++ src/emucore/OSystem.cxx | 2 + src/emucore/OSystem.hxx | 7 +-- src/emucore/PointingDevice.cxx | 2 + src/gui/InputDialog.cxx | 1 + src/gui/RomInfoWidget.cxx | 3 ++ src/gui/RomInfoWidget.hxx | 10 ++-- 27 files changed, 307 insertions(+), 115 deletions(-) create mode 100644 src/emucore/FrameBufferConstants.hxx diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx index 4056683a9..66b75b207 100644 --- a/src/debugger/CartDebug.cxx +++ b/src/debugger/CartDebug.cxx @@ -19,6 +19,7 @@ #include "bspf.hxx" #include "System.hxx" +#include "M6502.hxx" #include "FSNode.hxx" #include "DiStella.hxx" #include "Debugger.hxx" diff --git a/src/debugger/CartDebug.hxx b/src/debugger/CartDebug.hxx index 5c24d86a1..3efd9e9d1 100644 --- a/src/debugger/CartDebug.hxx +++ b/src/debugger/CartDebug.hxx @@ -21,6 +21,10 @@ class Settings; class CartDebugWidget; +// Function type for CartDebug instance methods +class CartDebug; +using CartMethod = int (CartDebug::*)(); + #include #include #include @@ -28,10 +32,6 @@ class CartDebugWidget; #include "bspf.hxx" #include "DebuggerSystem.hxx" -// Function type for CartDebug instance methods -class CartDebug; -using CartMethod = int (CartDebug::*)(); - class CartState : public DebuggerState { public: diff --git a/src/debugger/CpuDebug.cxx b/src/debugger/CpuDebug.cxx index d6c8c2d06..f580d3398 100644 --- a/src/debugger/CpuDebug.cxx +++ b/src/debugger/CpuDebug.cxx @@ -18,6 +18,7 @@ #include #include "M6502.hxx" +#include "System.hxx" #include "Debugger.hxx" #include "CartDebug.hxx" #include "TIADebug.hxx" @@ -69,6 +70,78 @@ void CpuDebug::saveOldState() Debugger::set_bits(myOldState.PS, myOldState.PSbits); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::pc() const +{ + return mySystem.m6502().PC; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::sp() const +{ + return mySystem.m6502().SP; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::a() const +{ + return mySystem.m6502().A; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::x() const +{ + return mySystem.m6502().X; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::y() const +{ + return mySystem.m6502().Y; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::n() const +{ + return mySystem.m6502().N; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::v() const +{ + return mySystem.m6502().V; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::b() const +{ + return mySystem.m6502().B; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::d() const +{ + return mySystem.m6502().D; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::i() const +{ + return mySystem.m6502().I; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::z() const +{ + return !mySystem.m6502().notZ; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int CpuDebug::c() const +{ + return mySystem.m6502().C; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CpuDebug::setPC(int pc) { diff --git a/src/debugger/CpuDebug.hxx b/src/debugger/CpuDebug.hxx index 836854871..2d346e486 100644 --- a/src/debugger/CpuDebug.hxx +++ b/src/debugger/CpuDebug.hxx @@ -18,13 +18,15 @@ #ifndef CPU_DEBUG_HXX #define CPU_DEBUG_HXX -#include "M6502.hxx" -#include "System.hxx" -#include "DebuggerSystem.hxx" +class M6502; +class System; // Function type for CpuDebug instance methods +class CpuDebug; using CpuMethod = int (CpuDebug::*)() const; +#include "DebuggerSystem.hxx" + class CpuState : public DebuggerState { public: @@ -44,23 +46,20 @@ class CpuDebug : public DebuggerSystem void saveOldState() override; string toString() override { return EmptyString; } // Not needed, since CPU stuff is always visible - // I know, we ain't supposed to do this... - M6502& m6502() const { return mySystem.m6502(); } - - int pc() const { return mySystem.m6502().PC; } - int sp() const { return mySystem.m6502().SP; } - int a() const { return mySystem.m6502().A; } - int x() const { return mySystem.m6502().X; } - int y() const { return mySystem.m6502().Y; } + int pc() const; + int sp() const; + int a() const; + int x() const; + int y() const; // These return int, not boolean! - int n() const { return mySystem.m6502().N; } - int v() const { return mySystem.m6502().V; } - int b() const { return mySystem.m6502().B; } - int d() const { return mySystem.m6502().D; } - int i() const { return mySystem.m6502().I; } - int z() const { return !mySystem.m6502().notZ; } - int c() const { return mySystem.m6502().C; } + int n() const; + int v() const; + int b() const; + int d() const; + int i() const; + int z() const; + int c() const; void setPC(int pc); void setSP(int sp); diff --git a/src/debugger/Debugger.cxx b/src/debugger/Debugger.cxx index 34271d827..f365939c5 100644 --- a/src/debugger/Debugger.cxx +++ b/src/debugger/Debugger.cxx @@ -83,6 +83,11 @@ Debugger::Debugger(OSystem& osystem, Console& console) myStaticDebugger = this; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Debugger::~Debugger() +{ +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::initialize() { diff --git a/src/debugger/Debugger.hxx b/src/debugger/Debugger.hxx index 48fafee1d..727427a82 100644 --- a/src/debugger/Debugger.hxx +++ b/src/debugger/Debugger.hxx @@ -31,6 +31,7 @@ class TrapArray; class PromptWidget; class ButtonWidget; +class M6502; class CartDebug; class CpuDebug; class RiotDebug; @@ -43,6 +44,7 @@ class RewindManager; #include "Base.hxx" #include "DialogContainer.hxx" #include "DebuggerDialog.hxx" +#include "FrameBufferConstants.hxx" #include "System.hxx" #include "bspf.hxx" @@ -69,7 +71,7 @@ class Debugger : public DialogContainer Create a new debugger parent object */ Debugger(OSystem& osystem, Console& console); - virtual ~Debugger() = default; + virtual ~Debugger(); public: /** @@ -217,6 +219,9 @@ class Debugger : public DialogContainer mySystem.poke(addr, value, flags); } + /** Convenience method to access the 6502 from System */ + M6502& m6502() const { return mySystem.m6502(); } + /** These are now exposed so Expressions can use them. */ int peekAsInt(int addr, uInt8 flags = 0) { return mySystem.peek(uInt16(addr), flags); diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index ffb7833ae..8646171e6 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -30,6 +30,7 @@ #include "M6502.hxx" #include "Expression.hxx" #include "FSNode.hxx" +#include "Settings.hxx" #include "PromptWidget.hxx" #include "RomWidget.hxx" #include "ProgressDialog.hxx" @@ -565,7 +566,7 @@ string DebuggerParser::eval() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DebuggerParser::listTraps(bool listCond) { - StringList names = debugger.cpuDebug().m6502().getCondTrapNames(); + StringList names = debugger.m6502().getCondTrapNames(); commandResult << (listCond ? "trapifs:" : "traps:") << endl; for(uInt32 i = 0; i < names.size(); i++) @@ -648,11 +649,11 @@ string DebuggerParser::saveScriptFile(string file) if(debugger.breakPoint(i)) out << "break " << Base::toString(i) << endl; - StringList conds = debugger.cpuDebug().m6502().getCondBreakNames(); + StringList conds = debugger.m6502().getCondBreakNames(); for(const auto& cond : conds) out << "breakif {" << cond << "}" << endl; - StringList names = debugger.cpuDebug().m6502().getCondTrapNames(); + StringList names = debugger.m6502().getCondTrapNames(); for(uInt32 i = 0; i < myTraps.size(); ++i) { bool read = myTraps[i]->read; @@ -745,7 +746,7 @@ void DebuggerParser::executeBreakif() int res = YaccParser::parse(argStrings[0].c_str()); if(res == 0) { - uInt32 ret = debugger.cpuDebug().m6502().addCondBreak( + uInt32 ret = debugger.m6502().addCondBreak( YaccParser::getResult(), argStrings[0] ); commandResult << "Added breakif " << Base::toString(ret); } @@ -793,7 +794,7 @@ void DebuggerParser::executeCheat() void DebuggerParser::executeClearbreaks() { debugger.clearAllBreakPoints(); - debugger.cpuDebug().m6502().clearCondBreaks(); + debugger.m6502().clearCondBreaks(); commandResult << "all breakpoints cleared"; } @@ -812,7 +813,7 @@ void DebuggerParser::executeClearconfig() void DebuggerParser::executeCleartraps() { debugger.clearAllTraps(); - debugger.cpuDebug().m6502().clearCondTraps(); + debugger.m6502().clearCondTraps(); myTraps.clear(); commandResult << "all traps cleared"; } @@ -916,7 +917,7 @@ void DebuggerParser::executeDefine() // "delbreakif" void DebuggerParser::executeDelbreakif() { - if (debugger.cpuDebug().m6502().delCondBreak(args[0])) + if (debugger.m6502().delCondBreak(args[0])) commandResult << "removed breakif " << Base::toString(args[0]); else commandResult << red("no such breakif"); @@ -938,7 +939,7 @@ void DebuggerParser::executeDeltrap() { int index = args[0]; - if(debugger.cpuDebug().m6502().delCondTrap(index)) + if(debugger.m6502().delCondTrap(index)) { for(uInt32 addr = myTraps[index]->begin; addr <= myTraps[index]->end; ++addr) executeTrapRW(addr, myTraps[index]->read, myTraps[index]->write, false); @@ -1170,7 +1171,7 @@ void DebuggerParser::executeListbreaks() if(count) commandResult << "breaks:" << endl << buf.str(); - StringList conds = debugger.cpuDebug().m6502().getCondBreakNames(); + StringList conds = debugger.m6502().getCondBreakNames(); if(conds.size() > 0) { if(count) @@ -1216,7 +1217,7 @@ void DebuggerParser::executeListfunctions() // "listtraps" void DebuggerParser::executeListtraps() { - StringList names = debugger.cpuDebug().m6502().getCondTrapNames(); + StringList names = debugger.m6502().getCondTrapNames(); if(myTraps.size() != names.size()) { @@ -1691,7 +1692,7 @@ void DebuggerParser::executeTraps(bool read, bool write, const string& command, myTraps[i]->read == read && myTraps[i]->write == write && myTraps[i]->condition == condition) { - if(debugger.cpuDebug().m6502().delCondTrap(i)) + if(debugger.m6502().delCondTrap(i)) { add = false; // @sa666666: please check this: @@ -1705,7 +1706,7 @@ void DebuggerParser::executeTraps(bool read, bool write, const string& command, } if(add) { - uInt32 ret = debugger.cpuDebug().m6502().addCondTrap( + uInt32 ret = debugger.m6502().addCondTrap( YaccParser::getResult(), hasCond ? argStrings[0] : ""); commandResult << "Added trap " << Base::toString(ret); diff --git a/src/debugger/DebuggerParser.hxx b/src/debugger/DebuggerParser.hxx index 196121b04..9638100c3 100644 --- a/src/debugger/DebuggerParser.hxx +++ b/src/debugger/DebuggerParser.hxx @@ -23,12 +23,11 @@ #include class Debugger; +class Settings; class FilesystemNode; struct Command; #include "bspf.hxx" -#include "FrameBuffer.hxx" -#include "Settings.hxx" class DebuggerParser { diff --git a/src/debugger/TIADebug.cxx b/src/debugger/TIADebug.cxx index 69611e7a8..50e972975 100644 --- a/src/debugger/TIADebug.cxx +++ b/src/debugger/TIADebug.cxx @@ -19,6 +19,7 @@ #include "System.hxx" #include "Debugger.hxx" #include "TIA.hxx" +#include "DelayQueueIterator.hxx" #include "TIADebug.hxx" @@ -688,6 +689,66 @@ void TIADebug::setENABLOld(bool b) myTIA.myBall.setENABLOld(b); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TIADebug::strobeWsync() +{ + mySystem.poke(WSYNC, 0); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TIADebug::strobeRsync() +{ + mySystem.poke(RSYNC, 0); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TIADebug::strobeResP0() +{ + mySystem.poke(RESP0, 0); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TIADebug::strobeResP1() +{ + mySystem.poke(RESP1, 0); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TIADebug::strobeResM0() +{ + mySystem.poke(RESM0, 0); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TIADebug::strobeResM1() +{ + mySystem.poke(RESM1, 0); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TIADebug::strobeResBL() +{ + mySystem.poke(RESBL, 0); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TIADebug::strobeHmove() +{ + mySystem.poke(HMOVE, 0); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TIADebug::strobeHmclr() +{ + mySystem.poke(HMCLR, 0); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TIADebug::strobeCxclr() +{ + mySystem.poke(CXCLR, 0); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int TIADebug::frameCount() const { diff --git a/src/debugger/TIADebug.hxx b/src/debugger/TIADebug.hxx index ecf28eee2..38dd9e6dd 100644 --- a/src/debugger/TIADebug.hxx +++ b/src/debugger/TIADebug.hxx @@ -19,17 +19,16 @@ #define TIA_DEBUG_HXX class Debugger; -class TiaDebug; class TIA; - -#include "DebuggerSystem.hxx" -#include "DelayQueueIterator.hxx" -#include "bspf.hxx" +class DelayQueueIterator; // Function type for TIADebug instance methods class TIADebug; using TiaMethod = int (TIADebug::*)() const; +#include "DebuggerSystem.hxx" +#include "bspf.hxx" + // Indices for various IntArray in TiaState enum { P0, P1, M0, M1, BL @@ -144,16 +143,16 @@ class TIADebug : public DebuggerSystem bool collM0_M1() const { return collision(Cx_M0M1); } // TIA strobe registers - void strobeWsync() { mySystem.poke(WSYNC, 0); } - void strobeRsync() { mySystem.poke(RSYNC, 0); } - void strobeResP0() { mySystem.poke(RESP0, 0); } - void strobeResP1() { mySystem.poke(RESP1, 0); } - void strobeResM0() { mySystem.poke(RESM0, 0); } - void strobeResM1() { mySystem.poke(RESM1, 0); } - void strobeResBL() { mySystem.poke(RESBL, 0); } - void strobeHmove() { mySystem.poke(HMOVE, 0); } - void strobeHmclr() { mySystem.poke(HMCLR, 0); } - void strobeCxclr() { mySystem.poke(CXCLR, 0); } + void strobeWsync(); + void strobeRsync(); + void strobeResP0(); + void strobeResP1(); + void strobeResM0(); + void strobeResM1(); + void strobeResBL(); + void strobeHmove(); + void strobeHmclr(); + void strobeCxclr(); // Read-only internal TIA state int scanlines() const; diff --git a/src/debugger/gui/ControllerWidget.hxx b/src/debugger/gui/ControllerWidget.hxx index d72ef351a..5cace2997 100644 --- a/src/debugger/gui/ControllerWidget.hxx +++ b/src/debugger/gui/ControllerWidget.hxx @@ -22,6 +22,7 @@ class GuiObject; class ButtonWidget; #include "Widget.hxx" +#include "Console.hxx" #include "Command.hxx" diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 8c2ec368b..4dbf8410c 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -15,8 +15,10 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ +#include "Cart.hxx" #include "Widget.hxx" #include "Dialog.hxx" +#include "Settings.hxx" #include "TabWidget.hxx" #include "TiaInfoWidget.hxx" #include "TiaOutputWidget.hxx" diff --git a/src/debugger/gui/DebuggerDialog.hxx b/src/debugger/gui/DebuggerDialog.hxx index 9606db3a1..25996497a 100644 --- a/src/debugger/gui/DebuggerDialog.hxx +++ b/src/debugger/gui/DebuggerDialog.hxx @@ -34,9 +34,12 @@ class TiaZoomWidget; class CartDebugWidget; class CartRamWidget; +namespace GUI { + class MessageBox; + struct Rect; +} + #include "Dialog.hxx" -#include "MessageBox.hxx" -#include "Rect.hxx" class DebuggerDialog : public Dialog { diff --git a/src/debugger/gui/RomListSettings.cxx b/src/debugger/gui/RomListSettings.cxx index 848bf701f..ef86e18f2 100644 --- a/src/debugger/gui/RomListSettings.cxx +++ b/src/debugger/gui/RomListSettings.cxx @@ -16,6 +16,7 @@ //============================================================================ #include "OSystem.hxx" +#include "Settings.hxx" #include "FrameBuffer.hxx" #include "Dialog.hxx" #include "DialogContainer.hxx" diff --git a/src/debugger/gui/RomWidget.cxx b/src/debugger/gui/RomWidget.cxx index 4a5a19bc1..76e680624 100644 --- a/src/debugger/gui/RomWidget.cxx +++ b/src/debugger/gui/RomWidget.cxx @@ -17,6 +17,7 @@ #include +#include "Settings.hxx" #include "Debugger.hxx" #include "CartDebug.hxx" #include "DiStella.hxx" diff --git a/src/debugger/gui/TiaOutputWidget.cxx b/src/debugger/gui/TiaOutputWidget.cxx index 77d42c7a7..5dd34cd21 100644 --- a/src/debugger/gui/TiaOutputWidget.cxx +++ b/src/debugger/gui/TiaOutputWidget.cxx @@ -25,6 +25,7 @@ #include "TiaZoomWidget.hxx" #include "Debugger.hxx" #include "DebuggerParser.hxx" +#include "PNGLibrary.hxx" #include "TIADebug.hxx" #include "TIASurface.hxx" #include "TIA.hxx" diff --git a/src/debugger/gui/TiaOutputWidget.hxx b/src/debugger/gui/TiaOutputWidget.hxx index 0626b216c..5be537e91 100644 --- a/src/debugger/gui/TiaOutputWidget.hxx +++ b/src/debugger/gui/TiaOutputWidget.hxx @@ -19,12 +19,12 @@ #define TIA_OUTPUT_WIDGET_HXX class GuiObject; -class FBSurface; +class ContextMenu; class TiaZoomWidget; +class FBSurface; #include "Widget.hxx" #include "Command.hxx" -#include "ContextMenu.hxx" class TiaOutputWidget : public Widget, public CommandSender { diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index bacd0a559..a3ffdfd5e 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -42,6 +42,7 @@ #include "Switches.hxx" #include "M6532.hxx" #include "MouseControl.hxx" +#include "PNGLibrary.hxx" #include "Version.hxx" #include "EventHandler.hxx" @@ -81,6 +82,11 @@ EventHandler::EventHandler(OSystem& osystem) myJoyHandler = make_unique(osystem); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +EventHandler::~EventHandler() +{ +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void EventHandler::initialize() { diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 41731f4d7..03548845e 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -22,12 +22,13 @@ class Console; class OSystem; +class MouseControl; class DialogContainer; class EventMappingWidget; #include "Event.hxx" +#include "Control.hxx" #include "StellaKeys.hxx" -#include "MouseControl.hxx" #include "Variant.hxx" #include "bspf.hxx" @@ -82,7 +83,7 @@ class EventHandler Create a new event handler object */ EventHandler(OSystem& osystem); - virtual ~EventHandler() = default; + virtual ~EventHandler(); // Enumeration representing the different states of operation enum State { diff --git a/src/emucore/FrameBuffer.hxx b/src/emucore/FrameBuffer.hxx index 11a8318b6..74f490d06 100644 --- a/src/emucore/FrameBuffer.hxx +++ b/src/emucore/FrameBuffer.hxx @@ -34,57 +34,9 @@ namespace GUI { #include "FBSurface.hxx" #include "TIASurface.hxx" #include "TIAConstants.hxx" +#include "FrameBufferConstants.hxx" #include "bspf.hxx" -// Return values for initialization of framebuffer window -enum FBInitStatus { - kSuccess, - kFailComplete, - kFailTooLarge, - kFailNotSupported -}; - -// Positions for onscreen/overlaid messages -enum MessagePosition { - kTopLeft, - kTopCenter, - kTopRight, - kMiddleLeft, - kMiddleCenter, - kMiddleRight, - kBottomLeft, - kBottomCenter, - kBottomRight -}; - -// Colors indices to use for the various GUI elements -enum { - kColor = 256, - kBGColor, - kBGColorLo, - kBGColorHi, - kShadowColor, - kTextColor, - kTextColorHi, - kTextColorEm, - kDlgColor, - kWidColor, - kWidFrameColor, - kBtnColor, - kBtnColorHi, - kBtnTextColor, - kBtnTextColorHi, - kCheckColor, - kScrollColor, - kScrollColorHi, - kSliderColor, - kSliderColorHi, - kDbgChangedColor, - kDbgChangedTextColor, - kDbgColorHi, - kNumColors -}; - // Contains all relevant info for the dimensions of a video screen // Also takes care of the case when the image should be 'centered' // within the given screen: diff --git a/src/emucore/FrameBufferConstants.hxx b/src/emucore/FrameBufferConstants.hxx new file mode 100644 index 000000000..b3ef735cc --- /dev/null +++ b/src/emucore/FrameBufferConstants.hxx @@ -0,0 +1,72 @@ +//============================================================================ +// +// 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-2017 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. +//============================================================================ + +// FIXME - perhaps add to namespace or something + +#ifndef FRAMEBUFFER_CONSTANTS_HXX +#define FRAMEBUFFER_CONSTANTS_HXX + +// Return values for initialization of framebuffer window +enum FBInitStatus { + kSuccess, + kFailComplete, + kFailTooLarge, + kFailNotSupported +}; + +// Positions for onscreen/overlaid messages +enum MessagePosition { + kTopLeft, + kTopCenter, + kTopRight, + kMiddleLeft, + kMiddleCenter, + kMiddleRight, + kBottomLeft, + kBottomCenter, + kBottomRight +}; + +// Colors indices to use for the various GUI elements +enum { + kColor = 256, + kBGColor, + kBGColorLo, + kBGColorHi, + kShadowColor, + kTextColor, + kTextColorHi, + kTextColorEm, + kDlgColor, + kWidColor, + kWidFrameColor, + kBtnColor, + kBtnColorHi, + kBtnTextColor, + kBtnTextColorHi, + kCheckColor, + kScrollColor, + kScrollColorHi, + kSliderColor, + kSliderColorHi, + kDbgChangedColor, + kDbgChangedTextColor, + kDbgColorHi, + kNumColors +}; + +#endif // FRAMEBUFFER_CONSTANTS_HXX diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index d8eece728..69ac30530 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -41,12 +41,14 @@ #include "MD5.hxx" #include "Cart.hxx" #include "CartDetector.hxx" +#include "FrameBuffer.hxx" #include "Settings.hxx" #include "PropsSet.hxx" #include "EventHandler.hxx" #include "Menu.hxx" #include "CommandMenu.hxx" #include "Launcher.hxx" +#include "PNGLibrary.hxx" #include "Widget.hxx" #include "Console.hxx" #include "Random.hxx" diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx index b3b136467..cd8d0fead 100644 --- a/src/emucore/OSystem.hxx +++ b/src/emucore/OSystem.hxx @@ -26,6 +26,8 @@ class Console; class Debugger; class Launcher; class Menu; +class FrameBuffer; +class PNGLibrary; class Properties; class PropertiesSet; class Random; @@ -35,10 +37,9 @@ class Sound; class StateManager; class VideoDialog; -#include "Cart.hxx" +#include "EventHandler.hxx" #include "FSNode.hxx" -#include "FrameBuffer.hxx" -#include "PNGLibrary.hxx" +#include "FrameBufferConstants.hxx" #include "bspf.hxx" struct TimingInfo { diff --git a/src/emucore/PointingDevice.cxx b/src/emucore/PointingDevice.cxx index 205eaaa0e..b103847b6 100644 --- a/src/emucore/PointingDevice.cxx +++ b/src/emucore/PointingDevice.cxx @@ -15,6 +15,8 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ +#include + #include "Control.hxx" #include "Event.hxx" #include "System.hxx" diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 0ba91bf4b..b78e9ba61 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -18,6 +18,7 @@ #include "bspf.hxx" #include "OSystem.hxx" +#include "Console.hxx" #include "Joystick.hxx" #include "Paddles.hxx" #include "PointingDevice.hxx" diff --git a/src/gui/RomInfoWidget.cxx b/src/gui/RomInfoWidget.cxx index 33de534dc..ed43a753c 100644 --- a/src/gui/RomInfoWidget.cxx +++ b/src/gui/RomInfoWidget.cxx @@ -18,6 +18,9 @@ #include "FrameBuffer.hxx" #include "OSystem.hxx" #include "Settings.hxx" +#include "Props.hxx" +#include "PNGLibrary.hxx" +#include "Rect.hxx" #include "Widget.hxx" #include "TIAConstants.hxx" diff --git a/src/gui/RomInfoWidget.hxx b/src/gui/RomInfoWidget.hxx index 11d4494f9..9c7b188dd 100644 --- a/src/gui/RomInfoWidget.hxx +++ b/src/gui/RomInfoWidget.hxx @@ -18,15 +18,15 @@ #ifndef ROM_INFO_WIDGET_HXX #define ROM_INFO_WIDGET_HXX -#include +class FBSurface; +class Properties; +namespace GUI { + struct Size; +} -#include "Props.hxx" #include "Widget.hxx" -#include "Command.hxx" -#include "Rect.hxx" #include "bspf.hxx" - class RomInfoWidget : public Widget { public: