[hatari-devel] YM2149 register dump from Hatari debugger

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi all,

I was experimenting with Ym2149 sound effects lately, including the
construction of input for XBIOS 32. I needed a quick method of seeing
what values have been written to the YM2149 lately and I simply added a
callback to the debugger info command:

CPU=$35ab0, VBL=46425, FrameCycles=68, HBL=0, LineCycles=68, DSP=N/A
$035ab0 : 6606                                 bne.s     $35ab8
> info ym2149
YM2149 register contents
Reg $00 : $00
Reg $01 : $00
Reg $02 : $00
Reg $03 : $00
Reg $04 : $00
Reg $05 : $00
Reg $06 : $00
Reg $07 : $FF
Reg $08 : $00
Reg $09 : $00
Reg $0A : $00
Reg $0B : $00
Reg $0C : $00
Reg $0D : $00
Reg $0E : $27
Reg $0F : $00
> c
Returning to emulation...

I have attached the small patch, please review and include if ok. It is
probably of not much use to most of us but some may have a benefit ;)

Regards,
Matthias

-- 
http://final-memory.org/

diff -r 2b50561c3bac src/debug/debugInfo.c
--- a/src/debug/debugInfo.c	Do Mai 29 19:58:34 2014 +0300
+++ b/src/debug/debugInfo.c	Fr Mai 30 16:56:49 2014 +0200
@@ -29,6 +29,7 @@
 #include "history.h"
 #include "ioMem.h"
 #include "m68000.h"
+#include "psg.h"
 #include "stMemory.h"
 #include "tos.h"
 #include "screen.h"
@@ -370,6 +371,20 @@
 }
 
 /* ------------------------------------------------------------------
+ * YM2149 register content dump
+ */
+static void DebugInfo_YM2149(Uint32 dummy)
+{
+	Uint8 idx;
+
+	fprintf(stderr, "YM2149 register contents\n");
+	for(idx = 0; idx < 16; idx++)
+	{
+		fprintf(stderr, "Reg $%02X : $%02X\n", idx, PSGRegisters[idx]);
+	}
+}
+
+/* ------------------------------------------------------------------
  * Falcon HW information
  */
 
@@ -896,7 +911,8 @@
 	{ false,"vdi",       VDI_Info,             NULL, "Show VDI vector contents (with <value>, show opcodes)" },
 	{ false,"videl",     DebugInfo_Videl,      NULL, "Show Falcon Videl HW registers values" },
 	{ false,"video",     DebugInfo_Video,      NULL, "Show Video related values" },
-	{ false,"xbios",     XBios_Info,           NULL, "Show XBIOS opcodes" }
+	{ false,"xbios",     XBios_Info,           NULL, "Show XBIOS opcodes" },
+	{ false,"ym2149",    DebugInfo_YM2149,     NULL, "Show YM2149 registers" },
 };
 
 static int LockedFunction = 6; /* index for the "default" function */


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/