[Scummvm-cvs-logs] SF.net SVN: scummvm: [21763] scummvm/trunk/engines/simon
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Mon Apr 10 03:21:04 CEST 2006
Revision: 21763
Author: eriktorbjorn
Date: 2006-04-10 03:18:55 -0700 (Mon, 10 Apr 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21763&view=rev
Log Message:
-----------
Split the playTune opcode into Simon 1, Simon 2 and FF versions. The FF version
was wrong before, but since it is a no-op, it probably never caused any
problems.
Modified Paths:
--------------
scummvm/trunk/engines/simon/items.cpp
scummvm/trunk/engines/simon/simon.h
Modified: scummvm/trunk/engines/simon/items.cpp
===================================================================
--- scummvm/trunk/engines/simon/items.cpp 2006-04-10 10:07:56 UTC (rev 21762)
+++ scummvm/trunk/engines/simon/items.cpp 2006-04-10 10:18:55 UTC (rev 21763)
@@ -193,7 +193,7 @@
// 125 - 129
&SimonEngine::o_here,
&SimonEngine::o_doClassIcons,
- &SimonEngine::o_playTune,
+ NULL,
&SimonEngine::o_waitEndTune,
&SimonEngine::o_ifEndTune,
// 130 - 134
@@ -291,6 +291,7 @@
opcode_table[83] = &SimonEngine::o1_rescan;
opcode_table[98] = &SimonEngine::o1_animate;
opcode_table[99] = &SimonEngine::o1_stopAnimate;
+ opcode_table[127] = &SimonEngine::o1_playTune;
opcode_table[181] = &SimonEngine::o1_mouseOff;
opcode_table[182] = &SimonEngine::o1_loadBeard;
opcode_table[183] = &SimonEngine::o1_unloadBeard;
@@ -302,6 +303,7 @@
opcode_table[83] = &SimonEngine::o2_rescan;
opcode_table[98] = &SimonEngine::o2_animate;
opcode_table[99] = &SimonEngine::o2_stopAnimate;
+ opcode_table[127] = &SimonEngine::o2_playTune;
opcode_table[181] = &SimonEngine::o2_mouseOff;
opcode_table[188] = &SimonEngine::o2_isShortText;
opcode_table[189] = &SimonEngine::o2_clearMarks;
@@ -317,6 +319,7 @@
opcode_table[122] = &SimonEngine::o3_oracleTextDown;
opcode_table[123] = &SimonEngine::o3_oracleTextUp;
opcode_table[124] = &SimonEngine::o3_ifTime;
+ opcode_table[127] = &SimonEngine::o3_playTune;
opcode_table[131] = &SimonEngine::o3_setTime;
opcode_table[133] = &SimonEngine::o3_loadUserGame;
opcode_table[134] = &SimonEngine::o3_listSaveGames;
@@ -1033,36 +1036,6 @@
mouseOn();
}
-void SimonEngine::o_playTune() {
- // 127: deals with music
- int music = getVarOrWord();
- int track = getVarOrWord();
-
- // Jamieson630:
- // This appears to be a "load or play music" command.
- // The music resource is specified, and optionally
- // a track as well. Normally we see two calls being
- // made, one to load the resource and another to
- // actually start a track (so the resource is
- // effectively preloaded so there's no latency when
- // starting playback).
- if (getGameType() == GType_SIMON2) {
- int loop = getVarOrByte();
-
- midi.setLoop(loop != 0);
- if (_lastMusicPlayed != music)
- _nextMusicToPlay = music;
- else
- midi.startTrack(track);
- } else {
- if (music != _lastMusicPlayed) {
- _lastMusicPlayed = music;
- loadMusic(music);
- midi.startTrack(track);
- }
- }
-}
-
void SimonEngine::o_waitEndTune() {
// 128: dummy instruction
getVarOrWord();
@@ -1622,6 +1595,27 @@
kill_sprite_simon1(getVarOrWord());
}
+void SimonEngine::o1_playTune() {
+ // 127: deals with music
+ int music = getVarOrWord();
+ int track = getVarOrWord();
+
+ // Jamieson630:
+ // This appears to be a "load or play music" command.
+ // The music resource is specified, and optionally
+ // a track as well. Normally we see two calls being
+ // made, one to load the resource and another to
+ // actually start a track (so the resource is
+ // effectively preloaded so there's no latency when
+ // starting playback).
+
+ if (music != _lastMusicPlayed) {
+ _lastMusicPlayed = music;
+ loadMusic(music);
+ midi.startTrack(track);
+ }
+}
+
void SimonEngine::o1_mouseOff() {
// 181: force mouseOff
scriptMouseOff();
@@ -1707,6 +1701,28 @@
kill_sprite_simon2(a, b);
}
+void SimonEngine::o2_playTune() {
+ // 127: deals with music
+ int music = getVarOrWord();
+ int track = getVarOrWord();
+ int loop = getVarOrByte();
+
+ // Jamieson630:
+ // This appears to be a "load or play music" command.
+ // The music resource is specified, and optionally
+ // a track as well. Normally we see two calls being
+ // made, one to load the resource and another to
+ // actually start a track (so the resource is
+ // effectively preloaded so there's no latency when
+ // starting playback).
+
+ midi.setLoop(loop != 0);
+ if (_lastMusicPlayed != music)
+ _nextMusicToPlay = music;
+ else
+ midi.startTrack(track);
+}
+
void SimonEngine::o2_mouseOff() {
// 181: force mouseOff
scriptMouseOff();
@@ -1795,6 +1811,13 @@
setScriptCondition(false);
}
+void SimonEngine::o3_playTune() {
+ // 127: usually deals with music, but is a no-op in FF.
+ getVarOrWord();
+ getVarOrWord();
+ getVarOrByte();
+}
+
void SimonEngine::o3_setTime() {
// 131
time(&_timeStore);
Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h 2006-04-10 10:07:56 UTC (rev 21762)
+++ scummvm/trunk/engines/simon/simon.h 2006-04-10 10:18:55 UTC (rev 21763)
@@ -884,7 +884,6 @@
void o_defObj();
void o_here();
void o_doClassIcons();
- void o_playTune();
void o_waitEndTune();
void o_ifEndTune();
void o_setAdjNoun();
@@ -932,6 +931,7 @@
void o1_rescan();
void o1_animate();
void o1_stopAnimate();
+ void o1_playTune();
void o1_mouseOff();
void o1_loadBeard();
void o1_unloadBeard();
@@ -943,6 +943,7 @@
void o2_rescan();
void o2_animate();
void o2_stopAnimate();
+ void o2_playTune();
void o2_mouseOff();
void o2_isShortText();
void o2_clearMarks();
@@ -955,6 +956,7 @@
void o3_oracleTextDown();
void o3_oracleTextUp();
void o3_ifTime();
+ void o3_playTune();
void o3_setTime();
void o3_loadUserGame();
void o3_listSaveGames();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list