Made some more methods const.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3015 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-10-25 20:14:09 +00:00
parent 6d753fd335
commit ba926bc4f6
3 changed files with 27 additions and 29 deletions

View File

@ -20,15 +20,13 @@
#ifndef CPU_DEBUG_HXX
#define CPU_DEBUG_HXX
class EquateList;
#include "Array.hxx"
#include "M6502.hxx"
#include "System.hxx"
#include "DebuggerSystem.hxx"
// pointer types for CpuDebug instance methods
typedef int (CpuDebug::*CPUDEBUG_INT_METHOD)();
typedef int (CpuDebug::*CPUDEBUG_INT_METHOD)() const;
// call the pointed-to method on the (global) CPU debugger object.
#define CALL_CPUDEBUG_METHOD(method) ( ( Debugger::debugger().cpuDebug().*method)() )
@ -50,25 +48,25 @@ class CpuDebug : public DebuggerSystem
const DebuggerState& getOldState() { return myOldState; }
void saveOldState();
string toString() { return ""; } // Not needed, since CPU stuff is always visible
string toString() { 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() { return mySystem.m6502().PC; }
int sp() { return mySystem.m6502().SP; }
int a() { return mySystem.m6502().A; }
int x() { return mySystem.m6502().X; }
int y() { return mySystem.m6502().Y; }
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; }
// These return int, not boolean!
int n() { return mySystem.m6502().N; }
int v() { return mySystem.m6502().V; }
int b() { return mySystem.m6502().B; }
int d() { return mySystem.m6502().D; }
int i() { return mySystem.m6502().I; }
int z() { return !mySystem.m6502().notZ; }
int c() { return mySystem.m6502().C; }
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; }
void setPC(int pc);
void setSP(int sp);

View File

@ -657,31 +657,31 @@ uInt8 TIADebug::hmBL(int newVal)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::frameCount()
int TIADebug::frameCount() const
{
return myTIA.myFrameCounter;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::scanlines()
int TIADebug::scanlines() const
{
return myTIA.scanlines();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::clocksThisLine()
int TIADebug::clocksThisLine() const
{
return myTIA.clocksThisLine();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vsync()
bool TIADebug::vsync() const
{
return (myTIA.myVSYNC & 2) == 2;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vblank()
bool TIADebug::vblank() const
{
return (myTIA.myVBLANK & 2) == 2;
}

View File

@ -30,7 +30,7 @@ class TIA;
// pointer types for TIADebug instance methods
// (used by TiaMethodExpression)
class TIADebug;
typedef int (TIADebug::*TIADEBUG_INT_METHOD)();
typedef int (TIADebug::*TIADEBUG_INT_METHOD)() const;
// call the pointed-to method on the (global) debugger object.
#define CALL_TIADEBUG_METHOD(method) ( ( Debugger::debugger().tiaDebug().*method)() )
@ -155,13 +155,13 @@ class TIADebug : public DebuggerSystem
void strobeCxclr() { mySystem.poke(CXCLR, 0); }
// Read-only internal TIA state
int scanlines();
int frameCount();
int clocksThisLine();
bool vsync();
bool vblank();
int vsyncAsInt() { return int(vsync()); } // so we can use _vsync pseudo-register
int vblankAsInt() { return int(vblank()); } // so we can use _vblank pseudo-register
int scanlines() const;
int frameCount() const;
int clocksThisLine() const;
bool vsync() const;
bool vblank() const;
int vsyncAsInt() const { return int(vsync()); } // so we can use _vsync pseudo-register
int vblankAsInt() const { return int(vblank()); } // so we can use _vblank pseudo-register
private:
/** Display a color patch for color at given index in the palette */