summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/i_oplmusic.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/i_oplmusic.c b/src/i_oplmusic.c
index 4ac52754..7bfdc04d 100644
--- a/src/i_oplmusic.c
+++ b/src/i_oplmusic.c
@@ -1363,10 +1363,28 @@ static void I_OPL_PlaySong(void *handle, int looping)
static void I_OPL_PauseSong(void)
{
+ unsigned int i;
+
if (!music_initialised)
{
return;
}
+
+ // Pause OPL callbacks.
+
+ OPL_SetPaused(1);
+
+ // Turn off all main instrument voices (not percussion).
+ // This is what Vanilla does.
+
+ for (i=0; i<OPL_NUM_VOICES; ++i)
+ {
+ if (voices[i].channel != NULL
+ && voices[i].current_instr < percussion_instrs)
+ {
+ VoiceKeyOff(&voices[i]);
+ }
+ }
}
static void I_OPL_ResumeSong(void)
@@ -1375,6 +1393,8 @@ static void I_OPL_ResumeSong(void)
{
return;
}
+
+ OPL_SetPaused(0);
}
static void I_OPL_StopSong(void)