mirror of https://github.com/stella-emu/stella.git
Added label support in disassembler for (indirect), (indirect,x), and
(indirect),y addressing modes. Added scanline and frame counters to prompt. They're showing the wrong values during stepping right now :( git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@581 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
b2903a36ca
commit
741efd226a
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,9 @@ class TIADebug {
|
|||
~TIADebug();
|
||||
|
||||
int scanlines();
|
||||
int frameCount();
|
||||
bool vsync();
|
||||
void updateTIA();
|
||||
|
||||
private:
|
||||
TIA *myTIA;
|
||||
|
|
|
@ -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 <cassert>
|
||||
|
@ -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++;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 <stdio.h>
|
||||
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue