diff options
author | James Haley | 2011-04-26 05:49:53 +0000 |
---|---|---|
committer | James Haley | 2011-04-26 05:49:53 +0000 |
commit | ec74db92724c181962479703092365b332b70b0a (patch) | |
tree | d04e551baa4e687dad8296ca7cc98438dac051aa | |
parent | 085797aeb4c05857b315ebf4448322829151aedc (diff) | |
download | chocolate-doom-ec74db92724c181962479703092365b332b70b0a.tar.gz chocolate-doom-ec74db92724c181962479703092365b332b70b0a.tar.bz2 chocolate-doom-ec74db92724c181962479703092365b332b70b0a.zip |
Support for Win32 native OPL output when compiled with Microsoft Visual
C++. Confirmed to work with Aureal Vortex AU8830 in Win98SE by
GhostlyDeath.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2331
-rw-r--r-- | opl/opl_win32.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/opl/opl_win32.c b/opl/opl_win32.c index 29df3643..277ce76c 100644 --- a/opl/opl_win32.c +++ b/opl/opl_win32.c @@ -72,8 +72,35 @@ static void OPL_Win32_PortWrite(opl_port_t port, unsigned int value) ); } -// TODO: MSVC version -// #elif defined(_MSC_VER) && defined(_M_IX6) ... +// haleyjd 20110417: MSVC version +#elif defined(_MSC_VER) && defined(_M_IX86) + +static unsigned int OPL_Win32_PortRead(opl_port_t port) +{ + unsigned char result; + opl_port_t dst_port = opl_port_base + port; + + __asm + { + mov edx, dword ptr [dst_port] + in al, dx + mov byte ptr [result], al + } + + return result; +} + +static void OPL_Win32_PortWrite(opl_port_t port, unsigned int value) +{ + opl_port_t dst_port = opl_port_base + port; + + __asm + { + mov edx, dword ptr [dst_port] + mov al, byte ptr [value] + out dx, al + } +} #else |