changeset 44:c32b6fc0951b

Update to newer dmlib API.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 21 Oct 2014 14:53:04 +0300
parents e0c74862387d
children ac7f374dfe00
files krapula.c
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/krapula.c	Tue Oct 21 14:02:18 2014 +0300
+++ b/krapula.c	Tue Oct 21 14:53:04 2014 +0300
@@ -338,6 +338,11 @@
     engine->optDataPath  = NULL;
     engine->optResFlags  = DRF_USE_PACK | DRF_PRELOAD_RES;
 
+    engine->optAudioSetup    = DM_ASETUP_JSS;
+    engine->optAfmt.freq     = 44100;
+    engine->optAfmt.format   = AUDIO_S16SYS;
+    engine->optAfmt.channels = 2;
+
     engine->optVidSetup  = DM_VSETUP_ASPECT;
     engine->optVidWidth  = 640;
     engine->optVidHeight = 480;
@@ -385,10 +390,10 @@
         return DMERR_INIT_FAIL;
     }
     
-    jvmSetCallback(engine->dev, jmpExec, engine->plr);
-    jmpSetModule(engine->plr, mod);
-    jmpPlayOrder(engine->plr, 0);
-    jvmSetGlobalVol(engine->dev, 55);
+    jvmSetCallback(engine->jssDev, jmpExec, engine->jssPlr);
+    jmpSetModule(engine->jssPlr, mod);
+    jmpPlayOrder(engine->jssPlr, 0);
+    jvmSetGlobalVol(engine->jssDev, 55);
 
     return DMERR_OK;
 }
@@ -658,14 +663,14 @@
             nollattu = TRUE;
         }
 
-        JSS_LOCK(engine->plr);
+        JSS_LOCK(engine->jssPlr);
         for (hit = FALSE, ch = 0; ch < 6; ch++)
-        if (engine->plr->channels[ch].nextInstrument == 0)
+        if (engine->jssPlr->channels[ch].nextInstrument == 0)
         {
             hit = TRUE;
             break;
         }
-        JSS_UNLOCK(engine->plr);
+        JSS_UNLOCK(engine->jssPlr);
 
         if (hit && !fadeActive)
         {