summaryrefslogtreecommitdiff
path: root/opl/examples/droplay.c
diff options
context:
space:
mode:
authorSimon Howard2009-08-28 18:04:04 +0000
committerSimon Howard2009-08-28 18:04:04 +0000
commite33a4961331301b1e3a5c65d148050fa33c4c594 (patch)
treebf28e4e1af04818592e64af72320438b69245ed1 /opl/examples/droplay.c
parent480a31094b7621dd7d65ec05a6e36964dca99b66 (diff)
downloadchocolate-doom-e33a4961331301b1e3a5c65d148050fa33c4c594.tar.gz
chocolate-doom-e33a4961331301b1e3a5c65d148050fa33c4c594.tar.bz2
chocolate-doom-e33a4961331301b1e3a5c65d148050fa33c4c594.zip
Working SDL OPL driver.
Subversion-branch: /branches/opl-branch Subversion-revision: 1632
Diffstat (limited to 'opl/examples/droplay.c')
-rw-r--r--opl/examples/droplay.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/opl/examples/droplay.c b/opl/examples/droplay.c
index 89cf6862..5158fbcd 100644
--- a/opl/examples/droplay.c
+++ b/opl/examples/droplay.c
@@ -77,16 +77,20 @@ void ClearAllRegs(void)
int DetectOPL(void)
{
+ int val1, val2;
+
WriteReg(OPL_REG_TIMER_CTRL, 0x60);
WriteReg(OPL_REG_TIMER_CTRL, 0x80);
- int val1 = OPL_ReadPort(OPL_REGISTER_PORT) & 0xe0;
+ val1 = OPL_ReadPort(OPL_REGISTER_PORT) & 0xe0;
WriteReg(OPL_REG_TIMER1, 0xff);
WriteReg(OPL_REG_TIMER_CTRL, 0x21);
- SDL_Delay(50);
- int val2 = OPL_ReadPort(OPL_REGISTER_PORT) & 0xe0;
+ OPL_Delay(50);
+ val2 = OPL_ReadPort(OPL_REGISTER_PORT) & 0xe0;
WriteReg(OPL_REG_TIMER_CTRL, 0x60);
WriteReg(OPL_REG_TIMER_CTRL, 0x80);
+// Temporary hack for SDL driver.
+return 1;
return val1 == 0 && val2 == 0xc0;
}