bsnes-plus icon indicating copy to clipboard operation
bsnes-plus copied to clipboard

Logging DMA transfers to Debugger log

Open jeffythedragonslayer opened this issue 2 years ago • 0 comments

How could I get started logging more events to the log that's at the bottom of the Debugger window? I would like to make it easier to debug some of my DMAs, so I tried making this change:

--- a/bsnes/snes/cpu/dma/dma.cpp
+++ b/bsnes/snes/cpu/dma/dma.cpp
@@ -30,6 +30,10 @@ uint8 CPU::dma_read(uint32 abus) {
 }
 
 void CPU::dma_transfer(bool direction, uint8 bbus, uint32 abus) {
+#if defined(DEBUGGER)
+      debugger.echo(string() << "DMA Transfer started.  Direction=" << direction << " bbus: " << bbus << " abus: " << '\n');
+#endif
+

But got this error:

Compiling snes/cpu/cpu.cpp...
In file included from snes/cpu/cpu.cpp:16:
snes/cpu/dma/dma.cpp: In member function ‘void SNES::CPU::dma_transfer(bool, SNES::uint8, SNES::uint32)’:
snes/cpu/dma/dma.cpp:34:16: error: ‘class SNES::Debugger’ has no member named ‘echo’
   34 |       debugger.echo(string() << "DMA Transfer started.  Direction=" << direction << " bbus: " << bbus << " abus: " << '\n');
      |                ^~~~

What would be the correct way to go about implementing this?

jeffythedragonslayer avatar Jun 24 '22 01:06 jeffythedragonslayer