summaryrefslogtreecommitdiff
path: root/opl/examples
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
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')
-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;
}