shithub: choc

Download patch

ref: a10180a460f6425cd308719584aa58ab4fcb63fb
parent: 9cc843c60027cb9365f3eaae3028343769d17a26
author: Simon Howard <[email protected]>
date: Sat Aug 29 17:26:43 EDT 2009

Use OPL_Delay to wait 1ms for timer to expire when doing OPL detect.

Subversion-branch: /branches/opl-branch
Subversion-revision: 1638

--- a/opl/examples/droplay.c
+++ b/opl/examples/droplay.c
@@ -81,11 +81,16 @@
 
     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);
 
--- a/src/i_oplmusic.c
+++ b/src/i_oplmusic.c
@@ -202,6 +202,8 @@
         GetStatus();
     }
 
+    OPL_Delay(1);
+
     // Read status
     result2 = GetStatus();