[sky9x] Background music

This commit is contained in:
bsongis
2012-10-03 21:27:32 +00:00
parent fa97e9366d
commit 5d20400f86
21 changed files with 206 additions and 234 deletions
+7 -2
View File
@@ -1950,7 +1950,7 @@ void evalFunctions()
#endif
#if defined(PCBSKY9X) && defined(SDCARD)
else if (sd->func == FUNC_PLAY_TRACK) {
else if (sd->func == FUNC_PLAY_TRACK || sd->func == FUNC_BACKGND_MUSIC) {
if (IS_PLAYING(i+1)) {
switch_mask = 0;
}
@@ -1959,7 +1959,7 @@ void evalFunctions()
strncpy(lfn+sizeof(SOUNDS_PATH), sd->param, sizeof(sd->param));
lfn[sizeof(SOUNDS_PATH)+sizeof(sd->param)] = '\0';
strcat(lfn+sizeof(SOUNDS_PATH), SOUNDS_EXT);
PLAY_FILE(lfn, i+1);
PLAY_FILE(lfn, sd->func==FUNC_BACKGND_MUSIC ? PLAY_BACKGROUND : 0, i+1);
}
}
else if (sd->func == FUNC_PLAY_VALUE) {
@@ -2016,6 +2016,11 @@ void evalFunctions()
activeFunctionSwitches |= switch_mask;
}
else {
#if defined(PCBSKY9X) && defined(SDCARD)
if (sd->func == FUNC_BACKGND_MUSIC) {
STOP_PLAY(i+1);
}
#endif
activeFunctionSwitches &= (~switch_mask);
if (momentary)
newActiveFunctions |= (activeFunctions & function_mask);