summaryrefslogtreecommitdiff
path: root/opl/examples
diff options
context:
space:
mode:
authorSimon Howard2009-08-29 21:26:43 +0000
committerSimon Howard2009-08-29 21:26:43 +0000
commita10180a460f6425cd308719584aa58ab4fcb63fb (patch)
tree1a77550555077e375811fcd2027c48e3c2cc9b73 /opl/examples
parent9cc843c60027cb9365f3eaae3028343769d17a26 (diff)
downloadchocolate-doom-a10180a460f6425cd308719584aa58ab4fcb63fb.tar.gz
chocolate-doom-a10180a460f6425cd308719584aa58ab4fcb63fb.tar.bz2
chocolate-doom-a10180a460f6425cd308719584aa58ab4fcb63fb.zip
Use OPL_Delay to wait 1ms for timer to expire when doing OPL detect.
Subversion-branch: /branches/opl-branch Subversion-revision: 1638
Diffstat (limited to 'opl/examples')
-rw-r--r--opl/examples/droplay.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/opl/examples/droplay.c b/opl/examples/droplay.c
index 4c2fc2f8..d53a427b 100644
--- a/opl/examples/droplay.c
+++ b/opl/examples/droplay.c
@@ -81,11 +81,16 @@ int DetectOPL(void)
WriteReg(OPL_REG_TIMER_CTRL, 0x60);
WriteReg(OPL_REG_TIMER_CTRL, 0x80);
+
val1 = OPL_ReadPort(OPL_REGISTER_PORT) & 0xe0;
+
WriteReg(OPL_REG_TIMER1, 0xff);
WriteReg(OPL_REG_TIMER_CTRL, 0x21);
- OPL_Delay(50);
+
+ OPL_Delay(1);
+
val2 = OPL_ReadPort(OPL_REGISTER_PORT) & 0xe0;
+
WriteReg(OPL_REG_TIMER_CTRL, 0x60);
WriteReg(OPL_REG_TIMER_CTRL, 0x80);