From 962d6dcf12e740c26c3be035884b310e74947d97 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 11 Mar 2009 20:20:05 +0000 Subject: Debug trace code for register writes. Subversion-branch: /branches/opl-branch Subversion-revision: 1462 --- opl/opl.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'opl') diff --git a/opl/opl.c b/opl/opl.c index 28609223..9afdd980 100644 --- a/opl/opl.c +++ b/opl/opl.c @@ -30,6 +30,8 @@ #include "opl.h" #include "opl_internal.h" +#define OPL_DEBUG_TRACE + #ifdef HAVE_IOPERM extern opl_driver_t opl_linux_driver; #endif @@ -75,6 +77,9 @@ void OPL_WritePort(opl_port_t port, unsigned int value) { if (driver != NULL) { +#ifdef OPL_DEBUG_TRACE + printf("OPL_write: %i, %x\n", port, value); +#endif driver->write_port_func(port, value); } } @@ -83,7 +88,15 @@ unsigned int OPL_ReadPort(opl_port_t port) { if (driver != NULL) { - return driver->read_port_func(port); + unsigned int result; + + result = driver->read_port_func(port); + +#ifdef OPL_DEBUG_TRACE + printf("OPL_read: %i -> %x\n", port, result); +#endif + + return result; } else { -- cgit v1.2.3