Simon music fixes

svn-id: r7744
This commit is contained in:
Jamieson Christian 2003-05-20 16:43:53 +00:00
parent dab0e4308e
commit a768deb83f
3 changed files with 42 additions and 11 deletions

View File

@ -1434,12 +1434,37 @@ void SimonState::o_unk_132_helper_2(FillOrCopyStruct *fcs, int x) {
void SimonState::o_unk_127() {
int a = getVarOrWord();
int b = getVarOrWord();
if (_game & GF_SIMON2) {
uint c = getVarOrByte();
if (_debugMode)
warning("o_unk_127(%d,%d,%d) not implemented properly", a, b, c);
if (_last_music_played != a) {
if (b == 999) {
// _next_music_to_play = a;
playMusic (a);
_last_music_played = a;
// midi_play (0);
}
}
if (b == _vc72_var1 || b == 999)
return;
if (_vc72_var1 == -1 || _vc72_var1 == 999) {
_vc70_var2 = c;
_vc70_var1 = -1;
_vc72_var3 = -1;
midi_play (b);
_vc72_var1 = b;
} else {
midi_play (b);
// _vc72_var3 = b;
// _vc72_var2 = c;
}
/*
if (_last_music_played == a) {
if (b == _vc72_var1 || b == 999)
return;
@ -1459,12 +1484,16 @@ void SimonState::o_unk_127() {
midi.jump (b, c);
}
} else if (b == 999) {
_next_music_to_play = a;
// _next_music_to_play = a;
playMusic (a);
midi_play (b);
}
*/
} else {
if (a != _last_music_played) {
_last_music_played = a;
playMusic(a);
midi_play (b);
}
}
}

View File

@ -4952,7 +4952,7 @@ void SimonState::go() {
addTimeEvent(0, 1);
openGameFile();
_last_music_played = (uint) - 1;
_last_music_played = -1;
_vga_base_delay = 1;
_start_mainscript = false;
@ -5277,24 +5277,25 @@ bool SimonState::load_game(uint slot) {
return true;
}
void SimonState::midi_play(uint a) {
if (a == 999)
return;
void SimonState::midi_play (uint track) {
if (track == 999)
return;
if (_vc72_var1 == 999) {
//FIXME Original game started music at this point
}
if (_vc72_var1 == 999) {
// _midi_var11 = 0;
midi.jump (track, 0);
// _midi_var12 = 1;
}
}
void SimonState::playMusic(uint music) {
void SimonState::playMusic (uint music) {
if (midi._midi_sfx_toggle)
return;
if (_game & GF_SIMON2) { // Simon 2 music
midi.stop();
_game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music - 1], SEEK_SET);
//FIXME The original game only loaded music file at this point
if (_game & GF_WIN) {
midi.playMultipleSMF (_game_file);
} else {
@ -5334,6 +5335,7 @@ void SimonState::playMusic(uint music) {
midi.playSMF (f, music);
delete f;
}
midi.jump (0, 0);
}
}
}

View File

@ -90,7 +90,7 @@ void MidiParser::onTimer() {
// Process the next info.
_last_event_tick += info.delta;
if (info.event < 0x80) {
printf ("ERROR! Bad command or running status %02X", info.event);
printf ("ERROR! Bad command or running status %02X\n", info.event);
_play_pos = 0;
return;
}