diff options
author | Simon Howard | 2009-03-11 20:20:05 +0000 |
---|---|---|
committer | Simon Howard | 2009-03-11 20:20:05 +0000 |
commit | 962d6dcf12e740c26c3be035884b310e74947d97 (patch) | |
tree | c203a8b77b6228c95c813171d512973b1d463829 | |
parent | b796c64d34847434d053aeacca5b6ec10ace2450 (diff) | |
download | chocolate-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
-rw-r--r-- | opl/opl.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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 { |