Skip to content
Permalink
Browse files

Added a debug probe on V99x8 command execution

Requested by Grauw here:
  https://www.msx.org/forum/msx-talk/openmsx/tcl-scritping-to-figure-out-line-interrupt-timings

Example usage:
  debug probe set_bp VDP.commandExecuting 1 {puts stderr [debug probe read VDP.commandExecuting]}
  • Loading branch information...
m9710797 committed Sep 10, 2019
1 parent e0697f2 commit 29eeaffbffe30c27a9860a634f5768d1a715da25
Showing with 10 additions and 0 deletions.
  1. +7 −0 src/video/VDPCmdEngine.cc
  2. +3 −0 src/video/VDPCmdEngine.hh
@@ -1741,6 +1741,11 @@ VDPCmdEngine::VDPCmdEngine(VDP& vdp_, CommandController& commandController)
" vdpcmdinprogress_callback",
"Tcl proc to call when a write to the VDP command engine is "
"detected while the previous command is still in progress.")
, executingProbe(
vdp_.getMotherBoard().getDebugger(),
strCat(vdp.getName(), '.', "commandExecuting"),
"Is the V99x8 VDP is currently executing a command",
false)
, engineTime(EmuTime::zero)
, statusChangeTime(EmuTime::infinity)
, hasExtendedVRAM(vram.getSize() == (192 * 1024))
@@ -1915,6 +1920,7 @@ void VDPCmdEngine::executeCommand(EmuTime::param time)

// Start command.
status |= 0x01;
executingProbe = true;

switch ((scrMode << 4) | (CMD >> 4)) {
case 0x00: case 0x10: case 0x20: case 0x30: case 0x40:
@@ -2567,6 +2573,7 @@ void VDPCmdEngine::commandDone(EmuTime::param time)
{
// Note: TR is not reset yet; it is reset when S#2 is read next.
status &= 0xFE; // reset CE
executingProbe = false;
CMD = 0;
statusChangeTime = EmuTime::infinity;
vram.cmdReadWindow.disable(time);
@@ -4,6 +4,7 @@
#include "VDP.hh"
#include "VDPAccessSlots.hh"
#include "BooleanSetting.hh"
#include "Probe.hh"
#include "TclCallback.hh"
#include "serialize_meta.hh"
#include "openmsx.hh"
@@ -183,6 +184,8 @@ private:
BooleanSetting cmdTraceSetting;
TclCallback cmdInProgressCallback;

Probe<bool> executingProbe;

/** Time at which the next vram access slot is available.
* Only valid when a command is executing.
*/

0 comments on commit 29eeaff

Please sign in to comment.
You can’t perform that action at this time.