summaryrefslogtreecommitdiff
path: root/opl
diff options
context:
space:
mode:
authorSimon Howard2009-03-11 20:20:05 +0000
committerSimon Howard2009-03-11 20:20:05 +0000
commit962d6dcf12e740c26c3be035884b310e74947d97 (patch)
treec203a8b77b6228c95c813171d512973b1d463829 /opl
parentb796c64d34847434d053aeacca5b6ec10ace2450 (diff)
downloadchocolate-doom-962d6dcf12e740c26c3be035884b310e74947d97.tar.gz
chocolate-doom-962d6dcf12e740c26c3be035884b310e74947d97.tar.bz2
chocolate-doom-962d6dcf12e740c26c3be035884b310e74947d97.zip
Debug trace code for register writes.
Subversion-branch: /branches/opl-branch Subversion-revision: 1462
Diffstat (limited to 'opl')
-rw-r--r--opl/opl.c15
1 files changed, 14 insertions, 1 deletions
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
{