diff options
author | Simon Howard | 2011-06-13 22:21:37 +0000 |
---|---|---|
committer | Simon Howard | 2011-06-13 22:21:37 +0000 |
commit | 391e7466b1efb7cbede4a1c356a210d9e7ee616b (patch) | |
tree | 90d13346d9cd3636df44290ded13d59ae3712543 /opl/opl_win32.c | |
parent | fa328faf056affa216f2f3a8764ca0d56262efe9 (diff) | |
parent | 822664b4ff873d462370e9e96a9d91e6066c221d (diff) | |
download | chocolate-doom-391e7466b1efb7cbede4a1c356a210d9e7ee616b.tar.gz chocolate-doom-391e7466b1efb7cbede4a1c356a210d9e7ee616b.tar.bz2 chocolate-doom-391e7466b1efb7cbede4a1c356a210d9e7ee616b.zip |
Merge from trunk.
Subversion-branch: /branches/raven-branch
Subversion-revision: 2347
Diffstat (limited to 'opl/opl_win32.c')
-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 |