diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index 1c0c41a0b..eb35266f5 100644 --- a/stella/src/debugger/Debugger.cxx +++ b/stella/src/debugger/Debugger.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Debugger.cxx,v 1.39 2005-06-29 00:31:48 urchlay Exp $ +// $Id: Debugger.cxx,v 1.40 2005-06-29 03:43:37 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -197,9 +197,15 @@ const string Debugger::state() result += "/"; formatFlags(myDebugger->ps(), buf); result += buf; - result += " Cycle "; + result += "\n Cyc:"; sprintf(buf, "%d", mySystem->cycles()); result += buf; + result += " Scan:"; + sprintf(buf, "%d", myTIAdebug->scanlines()); + result += buf; + result += " Frame:"; + sprintf(buf, "%d", myTIAdebug->frameCount()); + result += buf; result += "\n "; result += disassemble(myDebugger->pc(), 1); @@ -388,6 +394,8 @@ int Debugger::step() { int cyc = mySystem->cycles(); mySystem->m6502().execute(1); + myTIAdebug->updateTIA(); + myOSystem->frameBuffer().refreshTIA(true); return mySystem->cycles() - cyc; } @@ -412,6 +420,8 @@ int Debugger::trace() int targetPC = myDebugger->pc() + 3; // return address while(myDebugger->pc() != targetPC) mySystem->m6502().execute(1); + myTIAdebug->updateTIA(); + myOSystem->frameBuffer().refreshTIA(true); return mySystem->cycles() - cyc; } else { return step(); diff --git a/stella/src/debugger/TIADebug.cxx b/stella/src/debugger/TIADebug.cxx index 8c37c6408..4ec874db4 100644 --- a/stella/src/debugger/TIADebug.cxx +++ b/stella/src/debugger/TIADebug.cxx @@ -1,5 +1,6 @@ #include "TIADebug.hxx" +#include "System.hxx" TIADebug::TIADebug(TIA *tia) { myTIA = tia; @@ -8,6 +9,10 @@ TIADebug::TIADebug(TIA *tia) { TIADebug::~TIADebug() { } +int TIADebug::frameCount() { + return myTIA->myFrameCounter; +} + int TIADebug::scanlines() { return myTIA->scanlines(); } @@ -15,3 +20,8 @@ int TIADebug::scanlines() { bool TIADebug::vsync() { return (myTIA->myVSYNC & 2) == 2; } + +void TIADebug::updateTIA() { + // not working the way I expected: + // myTIA->updateFrame(myTIA->mySystem->cycles() * 3); +} diff --git a/stella/src/debugger/TIADebug.hxx b/stella/src/debugger/TIADebug.hxx index d7968e7f6..3b70f3023 100644 --- a/stella/src/debugger/TIADebug.hxx +++ b/stella/src/debugger/TIADebug.hxx @@ -10,7 +10,9 @@ class TIADebug { ~TIADebug(); int scanlines(); + int frameCount(); bool vsync(); + void updateTIA(); private: TIA *myTIA; diff --git a/stella/src/emucore/TIA.cxx b/stella/src/emucore/TIA.cxx index d2236d6d8..f0b4c668c 100644 --- a/stella/src/emucore/TIA.cxx +++ b/stella/src/emucore/TIA.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: TIA.cxx,v 1.44 2005-06-16 00:55:58 stephena Exp $ +// $Id: TIA.cxx,v 1.45 2005-06-29 03:43:37 urchlay Exp $ //============================================================================ #include @@ -102,6 +102,9 @@ TIA::TIA(const Console& console, Settings& settings) computePlayerPositionResetWhenTable(); computePlayerReflectTable(); computePlayfieldMaskTable(); + + // Init stats counters + myFrameCounter = 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -538,6 +541,9 @@ void TIA::update() // Compute the number of scanlines in the frame uInt32 totalClocks = (mySystem->cycles() * 3) - myClockWhenFrameStarted; myScanlineCountForLastFrame = totalClocks / 228; + + // Stats counters + myFrameCounter++; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/emucore/TIA.hxx b/stella/src/emucore/TIA.hxx index b7856c02b..01e386653 100644 --- a/stella/src/emucore/TIA.hxx +++ b/stella/src/emucore/TIA.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: TIA.hxx,v 1.22 2005-06-21 04:30:49 urchlay Exp $ +// $Id: TIA.hxx,v 1.23 2005-06-29 03:43:37 urchlay Exp $ //============================================================================ #ifndef TIA_HXX @@ -42,7 +42,7 @@ class Settings; be displayed on screen. @author Bradford W. Mott - @version $Id: TIA.hxx,v 1.22 2005-06-21 04:30:49 urchlay Exp $ + @version $Id: TIA.hxx,v 1.23 2005-06-29 03:43:37 urchlay Exp $ */ class TIA : public Device , public MediaSource { @@ -256,6 +256,9 @@ class TIA : public Device , public MediaSource bool myColorLossEnabled; private: + // Number of frames displayed by this TIA + int myFrameCounter; + // Pointer to the current frame buffer uInt8* myCurrentFrameBuffer; diff --git a/stella/src/emucore/m6502/src/D6502.cxx b/stella/src/emucore/m6502/src/D6502.cxx index 00f7d9d58..44c5562cd 100644 --- a/stella/src/emucore/m6502/src/D6502.cxx +++ b/stella/src/emucore/m6502/src/D6502.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: D6502.cxx,v 1.9 2005-06-21 04:30:49 urchlay Exp $ +// $Id: D6502.cxx,v 1.10 2005-06-29 03:43:38 urchlay Exp $ //============================================================================ #include @@ -84,22 +84,22 @@ uInt16 D6502::disassemble(uInt16 address, char* buffer, EquateList *equateList) return 1; case M6502::Indirect: - sprintf(buffer, "%s ($%04X) ; %d", M6502::ourInstructionMnemonicTable[opcode], - dpeek(mySystem, address + 1), + sprintf(buffer, "%s (%s) ; %d", M6502::ourInstructionMnemonicTable[opcode], + equateList->getFormatted(dpeek(mySystem, address + 1), 4), M6502::ourInstructionProcessorCycleTable[opcode]); return 3; case M6502::IndirectX: - sprintf(buffer, "%s ($%02X,x) ; %d", + sprintf(buffer, "%s (%s,x) ; %d", M6502::ourInstructionMnemonicTable[opcode], - mySystem->peek(address + 1), + equateList->getFormatted(mySystem->peek(address + 1), 2), M6502::ourInstructionProcessorCycleTable[opcode]); return 2; case M6502::IndirectY: - sprintf(buffer, "%s ($%02X),y ; %d", + sprintf(buffer, "%s (%s),y ; %d", M6502::ourInstructionMnemonicTable[opcode], - mySystem->peek(address + 1), + equateList->getFormatted(mySystem->peek(address + 1), 2), M6502::ourInstructionProcessorCycleTable[opcode]); return 2;