summaryrefslogtreecommitdiff
path: root/opl/examples
diff options
context:
space:
mode:
Diffstat (limited to 'opl/examples')
-rw-r--r--opl/examples/Makefile.am2
-rw-r--r--opl/examples/droplay.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/opl/examples/Makefile.am b/opl/examples/Makefile.am
index 3dc07d46..7c2c7c8a 100644
--- a/opl/examples/Makefile.am
+++ b/opl/examples/Makefile.am
@@ -3,6 +3,6 @@ AM_CFLAGS = -I..
noinst_PROGRAMS=droplay
-droplay_LDADD = ../libopl.a @LDFLAGS@ @SDL_LIBS@
+droplay_LDADD = ../libopl.a @LDFLAGS@ @SDL_LIBS@ @SDLMIXER_LIBS@
droplay_SOURCES = droplay.c
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;
}