diff --git a/Src/CPU/68K/68K.cpp b/Src/CPU/68K/68K.cpp index 24c4f3c..9d50982 100644 --- a/Src/CPU/68K/68K.cpp +++ b/Src/CPU/68K/68K.cpp @@ -50,7 +50,7 @@ static IBus *s_Bus = NULL; #ifdef SUPERMODEL_DEBUGGER // Debugger -static CMusashi68KDebug *s_Debug = NULL; +static Debugger::CMusashi68KDebug *s_Debug = NULL; #endif // IRQ callback diff --git a/Src/CPU/68K/68K.h b/Src/CPU/68K/68K.h index 09113a7..99b267b 100644 --- a/Src/CPU/68K/68K.h +++ b/Src/CPU/68K/68K.h @@ -45,7 +45,9 @@ //#endif #ifdef SUPERMODEL_DEBUGGER -class CMusashi68KDebug; +namespace Debugger { + class CMusashi68KDebug; +} #endif // SUPERMODEL_DEBUGGER /****************************************************************************** @@ -75,7 +77,7 @@ public: IBus *Bus; // memory handlers int (*IRQAck)(int); // IRQ acknowledge callback #ifdef SUPERMODEL_DEBUGGER - CMusashi68KDebug *Debug; // holds debugger (if attached) + Debugger::CMusashi68KDebug *Debug; // holds debugger (if attached) #endif // SUPERMODEL_DEBUGGER SM68KCtx(void) @@ -93,7 +95,7 @@ public: Bus = NULL; IRQAck = NULL; } -} M68KCtx; +} M68KCtx;; /****************************************************************************** diff --git a/Src/Debugger/CPU/Musashi68KDebug.cpp b/Src/Debugger/CPU/Musashi68KDebug.cpp index 85509a1..b9dab1c 100755 --- a/Src/Debugger/CPU/Musashi68KDebug.cpp +++ b/Src/Debugger/CPU/Musashi68KDebug.cpp @@ -30,8 +30,8 @@ #include #include -//namespace Debugger -//{ +namespace Debugger +{ UINT32 CMusashi68KDebug::GetReg(CCPUDebug *cpu, unsigned id) { CMusashi68KDebug *m68K = (CMusashi68KDebug*)cpu; @@ -198,6 +198,6 @@ m_bus->Write32(addr, data); CheckWrite32(addr, data); } -//} +} #endif // SUPERMODEL_DEBUGGER \ No newline at end of file diff --git a/Src/Debugger/CPU/Musashi68KDebug.h b/Src/Debugger/CPU/Musashi68KDebug.h index 85ae541..4404f7b 100755 --- a/Src/Debugger/CPU/Musashi68KDebug.h +++ b/Src/Debugger/CPU/Musashi68KDebug.h @@ -32,10 +32,9 @@ #include "CPU/68K/68K.h" #include "Types.h" -using namespace Debugger; // TODO - can't get this namespace to work with 68K.h for some reason - strange Visual Studio errors -//namespace Debugger -//{ +namespace Debugger +{ /* * CCPUDebug implementation for the Musashi Motorola 68000 emulator. */ @@ -53,11 +52,25 @@ using namespace Debugger; ::IBus *m_bus; - void SetM68KContext(); + // Inlined methods - void UpdateM68KContext(M68KCtx *ctx); + void CMusashi68KDebug::SetM68KContext() + { + M68KGetContext(&m_savedCtx); + if (m_savedCtx.Debug != this) + M68KSetContext(m_ctx); + } - void RestoreM68KContext(); + void CMusashi68KDebug::UpdateM68KContext(M68KCtx *ctx) + { + m_ctx = ctx; + } + + void CMusashi68KDebug::RestoreM68KContext() + { + if (m_savedCtx.Debug != this) + M68KSetContext(&m_savedCtx); + } protected: UINT32 GetSP(); @@ -99,27 +112,7 @@ using namespace Debugger; void Write32(UINT32 addr, UINT32 data); }; - - // Inlined methods - - inline void CMusashi68KDebug::SetM68KContext() - { - M68KGetContext(&m_savedCtx); - if (m_savedCtx.Debug != this) - M68KSetContext(m_ctx); - } - - inline void CMusashi68KDebug::UpdateM68KContext(M68KCtx *ctx) - { - m_ctx = ctx; - } - - inline void CMusashi68KDebug::RestoreM68KContext() - { - if (m_savedCtx.Debug != this) - M68KSetContext(&m_savedCtx); - } -//} +} #endif // INCLUDED_MUSASHI68KDEBUG_H #endif // SUPERMODEL_DEBUGGER \ No newline at end of file