Added color clock, CPU cycle, and pixel counters for the current scanline.

Currently they only show up in the prompt, but the TIA and TIADebug
have support for getting the current pixel clock (clocksThisLine()). The
pixel and CPU cyc are derived from the pixel clock.

Actually it's acting a bit funny, I need to find out why...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@687 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
urchlay 2005-07-21 04:10:16 +00:00
parent 59fda8dd1f
commit b9c7b34505
6 changed files with 48 additions and 21 deletions

View File

@ -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.73 2005-07-21 03:26:58 urchlay Exp $
// $Id: Debugger.cxx,v 1.74 2005-07-21 04:10:15 urchlay Exp $
//============================================================================
#include "bspf.hxx"
@ -337,15 +337,19 @@ const string Debugger::cpuState()
result += "/";
formatFlags(state.PSbits, buf);
result += buf;
result += "\n Cyc:";
result += "\n FrameCyc:";
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 += " ScanLine:";
sprintf(buf, "%d", myTiaDebug->scanlines());
result += buf;
result += " Clk/Pix/Cyc:";
int clk = myTiaDebug->clocksThisLine();
sprintf(buf, "%d/%d/%d", clk, clk-68, clk/3);
result += buf;
result += " 6502Ins:";
sprintf(buf, "%d", mySystem->m6502().totalInstructionCount());
result += buf;

View File

@ -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: TIADebug.cxx,v 1.14 2005-07-19 17:59:58 stephena Exp $
// $Id: TIADebug.cxx,v 1.15 2005-07-21 04:10:15 urchlay Exp $
//============================================================================
#include "System.hxx"
@ -123,6 +123,12 @@ int TIADebug::scanlines()
return myTIA->scanlines();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::clocksThisLine()
{
return myTIA->clocksThisLine();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vsync()
{

View File

@ -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: TIADebug.hxx,v 1.12 2005-07-19 17:59:58 stephena Exp $
// $Id: TIADebug.hxx,v 1.13 2005-07-21 04:10:15 urchlay Exp $
//============================================================================
#ifndef TIA_DEBUG_HXX
@ -58,6 +58,7 @@ class TIADebug : public DebuggerSystem
int scanlines();
int frameCount();
int clocksThisLine();
bool vsync();
bool vblank();
string state();

View File

@ -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.55 2005-07-19 02:24:13 urchlay Exp $
// $Id: TIA.cxx,v 1.56 2005-07-21 04:10:15 urchlay Exp $
//============================================================================
#include <cassert>
@ -643,6 +643,14 @@ uInt32 TIA::scanlines() const
return totalClocks/228;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 TIA::clocksThisLine() const
{
// calculate the current scanline
uInt32 totalClocks = (mySystem->cycles() * 3) - myClockWhenFrameStarted;
return totalClocks%228;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::setSound(Sound& sound)
{

View File

@ -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.30 2005-07-19 02:24:13 urchlay Exp $
// $Id: TIA.hxx,v 1.31 2005-07-21 04:10:16 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.30 2005-07-19 02:24:13 urchlay Exp $
@version $Id: TIA.hxx,v 1.31 2005-07-21 04:10:16 urchlay Exp $
*/
class TIA : public Device , public MediaSource
{
@ -172,12 +172,20 @@ class TIA : public Device , public MediaSource
/**
Answers the total number of scanlines the media source generated
in producing the current frame buffer.
in producing the current frame buffer. For partial frames, this
will be the current scanline.
@return The total number of scanlines generated
*/
uInt32 scanlines() const;
/**
Answers the current color clock we've gotten to on this scanline.
@return The current color clock
*/
uInt32 clocksThisLine() const;
/**
Sets the sound device for the TIA.
*/

View File

@ -821,7 +821,7 @@
""
"Cartridge.MD5" "08d60a58a691c7f690162850302dc0e1"
"Cartridge.Name" "Poker Solitaire (V0.27) (PAL) (2001) (B. Watson)"
"Cartridge.Name" "Poker Squares (V0.27) (PAL) (2001) (B. Watson)"
"Display.Format" "PAL"
"Display.YStart" "45"
""
@ -1709,7 +1709,7 @@
""
"Cartridge.MD5" "12d7e0d6b187889f8d150bf7034d1db2"
"Cartridge.Name" "Poker Solitaire (V0.0e) (2001) (B. Watson)"
"Cartridge.Name" "Poker Squares (V0.0e) (2001) (B. Watson)"
""
"Cartridge.MD5" "133a4234512e8c4e9e8c5651469d4a09"
@ -6967,7 +6967,7 @@
""
"Cartridge.MD5" "54785fa29e28aae6038929ba29d33d38"
"Cartridge.Name" "Poker Solitaire (V0.19) (2001) (B. Watson)"
"Cartridge.Name" "Poker Squares (V0.19) (2001) (B. Watson)"
""
"Cartridge.MD5" "545048ccb045f9efc6cf2b125cd0dfa8"
@ -8403,7 +8403,7 @@
""
"Cartridge.MD5" "675ae9c23fa1aae376cea86cad96f9a5"
"Cartridge.Name" "Poker Solitaire (V0.25) (2001) (B. Watson)"
"Cartridge.Name" "Poker Squares (V0.25) (2001) (B. Watson)"
""
"Cartridge.MD5" "67631ea5cfe44066a1e76ddcb6bcb512"
@ -9005,7 +9005,7 @@
""
"Cartridge.MD5" "6e7ed74082f39ad4166c823765a59909"
"Cartridge.Name" "Poker Solitaire (V0.14) (2001) (B. Watson)"
"Cartridge.Name" "Poker Squares (V0.14) (2001) (B. Watson)"
""
"Cartridge.MD5" "6e5d5ba193d2540aec2e847aafb2a5fb"
@ -9824,7 +9824,7 @@
""
"Cartridge.MD5" "78297db7f416af3052dd793b53ff014e"
"Cartridge.Name" "Poker Solitaire (V0.17) (2001) (B. Watson)"
"Cartridge.Name" "Poker Squares (V0.17) (2001) (B. Watson)"
""
"Cartridge.MD5" "77d0a577636e1c9212aeccde9d0baa4b"
@ -11424,7 +11424,7 @@
""
"Cartridge.MD5" "8c136e97c0a4af66da4a249561ed17db"
"Cartridge.Name" "Poker Solitaire (V0.27) (2001) (B. Watson)"
"Cartridge.Name" "Poker Squares (V0.27) (2001) (B. Watson)"
""
"Cartridge.MD5" "8c2fa33048f055f38358d51eefe417db"
@ -16301,7 +16301,7 @@
""
"Cartridge.MD5" "cccfe9e9a11b1dad04beba46eefb7351"
"Cartridge.Name" "Poker Solitaire (V0.25) (PAL) (2001) (B. Watson)"
"Cartridge.Name" "Poker Squares (V0.25) (PAL) (2001) (B. Watson)"
"Display.Format" "PAL"
"Display.YStart" "45"
""
@ -17175,7 +17175,7 @@
""
"Cartridge.MD5" "d74a81fcd89c5cf0bd4c88eb207ebd62"
"Cartridge.Name" "Poker Solitaire (V0.00a) (2001) (B. Watson)"
"Cartridge.Name" "Poker Squares (V0.00a) (2001) (B. Watson)"
""
"Cartridge.MD5" "d787ec6785b0ccfbd844c7866db9667d"
@ -18636,7 +18636,7 @@
""
"Cartridge.MD5" "e879b7093ac4cfad74c88d636ca97d00"
"Cartridge.Name" "Poker Solitaire (V0.0f) (2001) (B. Watson)"
"Cartridge.Name" "Poker Squares (V0.0f) (2001) (B. Watson)"
""
"Cartridge.MD5" "e8a3473bf786cf796d1336d2d03a0008"