renamed '_cycles' into '_icycles' (fits better)

This commit is contained in:
thrust26 2017-12-15 19:12:46 +01:00
parent 50fc9a6733
commit 0d609f6845
8 changed files with 17 additions and 17 deletions

View File

@ -86,15 +86,15 @@
* Added 'Options...' button to debugger which gives access to the options * Added 'Options...' button to debugger which gives access to the options
menu during debugging. menu during debugging.
* Added debugger pseudo-register '_cycles', which gives the number of
CPU cycles of the last instruction.
* Added debugger pseudo-register '_cyclesLo' and '_cyclesHi', which give * Added debugger pseudo-register '_cyclesLo' and '_cyclesHi', which give
the number of CPU cycles that have occurred since emulation started. the number of CPU cycles that have occurred since emulation started.
* Added debugger pseudo-register '_fcycles', which gives the number of * Added debugger pseudo-register '_fcycles', which gives the number of
CPU cycles that have occurred since the frame started. CPU cycles that have occurred since the frame started.
* Added debugger pseudo-register '_icycles', which gives the number of
CPU cycles of the last instruction.
* Extended debugger 'dump' command to take a second argument, indicating * Extended debugger 'dump' command to take a second argument, indicating
the end of the range to dump data. the end of the range to dump data.

View File

@ -738,11 +738,11 @@ that holds 'number of scanlines' on an actual console).</p>
<tr><th>Function</th><th>Description</th></tr> <tr><th>Function</th><th>Description</th></tr>
<tr><td> _bank</td><td> Currently selected bank</td></tr> <tr><td> _bank</td><td> Currently selected bank</td></tr>
<tr><td> _cclocks</td><td> Color clocks on a scanline</td></tr> <tr><td> _cclocks</td><td> Color clocks on a scanline</td></tr>
<tr><td> _cycles</td><td> Number of cycles of last instruction</td></tr>
<tr><td> _cycleshi</td><td> Higher 32 bits of number of cycles since emulation started</td></tr> <tr><td> _cycleshi</td><td> Higher 32 bits of number of cycles since emulation started</td></tr>
<tr><td> _cycleslo</td><td> Lower 32 bits of number of cycles since emulation started</td></tr> <tr><td> _cycleslo</td><td> Lower 32 bits of number of cycles since emulation started</td></tr>
<tr><td> _fcount</td><td> Number of frames since emulation started</td></tr> <tr><td> _fcount</td><td> Number of frames since emulation started</td></tr>
<tr><td> _fcycles</td><td> Number of cycles since frame started</td></tr> <tr><td> _fcycles</td><td> Number of cycles since frame started</td></tr>
<tr><td> _icycles</td><td> Number of cycles of last instruction</td></tr>
<tr><td> _rwport</td><td> Last address to attempt a read from the cart write port</td></tr> <tr><td> _rwport</td><td> Last address to attempt a read from the cart write port</td></tr>
<tr><td> _scan</td><td> Current scanline count</td></tr> <tr><td> _scan</td><td> Current scanline count</td></tr>
<tr><td> _scycles</td><td> Number of cycles in current scanline</td></tr> <tr><td> _scycles</td><td> Number of cycles in current scanline</td></tr>

View File

@ -143,9 +143,9 @@ int CpuDebug::c() const
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int CpuDebug::cycles() const int CpuDebug::icycles() const
{ {
return mySystem.m6502().cycles; return mySystem.m6502().icycles;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -229,7 +229,7 @@ void CpuDebug::setC(bool on)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CpuDebug::setCycles(int cycles) void CpuDebug::setCycles(int cycles)
{ {
my6502.cycles = cycles; my6502.icycles = cycles;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -61,7 +61,7 @@ class CpuDebug : public DebuggerSystem
int z() const; int z() const;
int c() const; int c() const;
int cycles() const; int icycles() const;
void setPC(int pc); void setPC(int pc);
void setSP(int sp); void setSP(int sp);

View File

@ -802,11 +802,11 @@ Debugger::BuiltinFunction Debugger::ourBuiltinFunctions[NUM_BUILTIN_FUNCS] = {
Debugger::PseudoRegister Debugger::ourPseudoRegisters[NUM_PSEUDO_REGS] = { Debugger::PseudoRegister Debugger::ourPseudoRegisters[NUM_PSEUDO_REGS] = {
{ "_bank", "Currently selected bank" }, { "_bank", "Currently selected bank" },
{ "_cclocks", "Color clocks on current scanline" }, { "_cclocks", "Color clocks on current scanline" },
{ "_cycles", "Number of cycles of last instruction" },
{ "_cycleshi", "Higher 32 bits of number of cycles since emulation started" }, { "_cycleshi", "Higher 32 bits of number of cycles since emulation started" },
{ "_cycleslo", "Lower 32 bits of number of cycles since emulation started" }, { "_cycleslo", "Lower 32 bits of number of cycles since emulation started" },
{ "_fcount", "Number of frames since emulation started" }, { "_fcount", "Number of frames since emulation started" },
{ "_fcycles", "Number of cycles since frame started" }, { "_fcycles", "Number of cycles since frame started" },
{ "_icycles", "Number of cycles of last instruction" },
{ "_rwport", "Address at which a read from a write port occurred" }, { "_rwport", "Address at which a read from a write port occurred" },
{ "_scan", "Current scanline count" }, { "_scan", "Current scanline count" },
{ "_scycles", "Number of cycles in current scanline" }, { "_scycles", "Number of cycles in current scanline" },

View File

@ -52,7 +52,7 @@ M6502::M6502(const Settings& settings)
mySettings(settings), mySettings(settings),
A(0), X(0), Y(0), SP(0), IR(0), PC(0), A(0), X(0), Y(0), SP(0), IR(0), PC(0),
N(false), V(false), B(false), D(false), I(false), notZ(false), C(false), N(false), V(false), B(false), D(false), I(false), notZ(false), C(false),
cycles(0), icycles(0),
myNumberOfDistinctAccesses(0), myNumberOfDistinctAccesses(0),
myLastAddress(0), myLastAddress(0),
myLastPeekAddress(0), myLastPeekAddress(0),
@ -100,7 +100,7 @@ void M6502::reset()
PS(BSPF::containsIgnoreCase(cpurandom, "P") ? PS(BSPF::containsIgnoreCase(cpurandom, "P") ?
mySystem->randGenerator().next() : 0x20); mySystem->randGenerator().next() : 0x20);
cycles = 0; icycles = 0;
// Load PC from the reset vector // Load PC from the reset vector
PC = uInt16(mySystem->peek(0xfffc)) | (uInt16(mySystem->peek(0xfffd)) << 8); PC = uInt16(mySystem->peek(0xfffc)) | (uInt16(mySystem->peek(0xfffd)) << 8);
@ -127,7 +127,7 @@ inline uInt8 M6502::peek(uInt16 address, uInt8 flags)
} }
//////////////////////////////////////////////// ////////////////////////////////////////////////
mySystem->incrementCycles(SYSTEM_CYCLES_PER_CPU); mySystem->incrementCycles(SYSTEM_CYCLES_PER_CPU);
cycles += SYSTEM_CYCLES_PER_CPU; icycles += SYSTEM_CYCLES_PER_CPU;
uInt8 result = mySystem->peek(address, flags); uInt8 result = mySystem->peek(address, flags);
myLastPeekAddress = address; myLastPeekAddress = address;
@ -161,7 +161,7 @@ inline void M6502::poke(uInt16 address, uInt8 value, uInt8 flags)
} }
//////////////////////////////////////////////// ////////////////////////////////////////////////
mySystem->incrementCycles(SYSTEM_CYCLES_PER_CPU); mySystem->incrementCycles(SYSTEM_CYCLES_PER_CPU);
cycles += SYSTEM_CYCLES_PER_CPU; icycles += SYSTEM_CYCLES_PER_CPU;
mySystem->poke(address, value, flags); mySystem->poke(address, value, flags);
myLastPokeAddress = address; myLastPokeAddress = address;
@ -243,7 +243,7 @@ bool M6502::execute(uInt32 number)
// Reset the peek/poke address pointers // Reset the peek/poke address pointers
myLastPeekAddress = myLastPokeAddress = myDataAddressForPoke = 0; myLastPeekAddress = myLastPokeAddress = myDataAddressForPoke = 0;
cycles = 0; icycles = 0;
// Fetch instruction at the program counter // Fetch instruction at the program counter
IR = peek(PC++, DISASM_CODE); // This address represents a code section IR = peek(PC++, DISASM_CODE); // This address represents a code section

View File

@ -348,7 +348,7 @@ class M6502 : public Serializable
bool notZ; // Z flag complement for processor status register bool notZ; // Z flag complement for processor status register
bool C; // C flag for processor status register bool C; // C flag for processor status register
uInt8 cycles; // cycles of last instruction uInt8 icycles; // cycles of last instruction
/// Indicates the numer of distinct memory accesses /// Indicates the numer of distinct memory accesses
uInt32 myNumberOfDistinctAccesses; uInt32 myNumberOfDistinctAccesses;

View File

@ -219,8 +219,8 @@ CpuMethod getCpuSpecial(char* ch)
return &CpuDebug::i; return &CpuDebug::i;
else if(BSPF::equalsIgnoreCase(ch, "b")) else if(BSPF::equalsIgnoreCase(ch, "b"))
return &CpuDebug::b; return &CpuDebug::b;
else if(BSPF::equalsIgnoreCase(ch, "_cycles")) else if(BSPF::equalsIgnoreCase(ch, "_icycles"))
return &CpuDebug::cycles; return &CpuDebug::icycles;
else else
return nullptr; return nullptr;
} }