aboutsummaryrefslogtreecommitdiff
path: root/scumm/midiparser_ro.cpp
diff options
context:
space:
mode:
authorJamieson Christian2003-08-16 09:34:19 +0000
committerJamieson Christian2003-08-16 09:34:19 +0000
commit121b00a6f718f4b691c77708120083da2fedd018 (patch)
tree9a28315710f3a7b870ccecd4637bb1fe78f4974a /scumm/midiparser_ro.cpp
parent8281c2eecc64a1d4a97cc29e2f0af7bfc14cbf3a (diff)
downloadscummvm-rg350-121b00a6f718f4b691c77708120083da2fedd018.tar.gz
scummvm-rg350-121b00a6f718f4b691c77708120083da2fedd018.tar.bz2
scummvm-rg350-121b00a6f718f4b691c77708120083da2fedd018.zip
Corrected timing mechanism for RO music streams.
RO streams have built-in timer markers (the unknown 0xA0 mentioned in FR [742249]) that override automated methods of updating VAR_MUSIC_TIMER. Since these timer markers do not seem to be present in AD resources, the old mechanism is used if MD_ADLIB is the current MidiDriver. svn-id: r9720
Diffstat (limited to 'scumm/midiparser_ro.cpp')
-rw-r--r--scumm/midiparser_ro.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/scumm/midiparser_ro.cpp b/scumm/midiparser_ro.cpp
index 67d61a82f3..4f01a3e5fe 100644
--- a/scumm/midiparser_ro.cpp
+++ b/scumm/midiparser_ro.cpp
@@ -33,11 +33,15 @@
class MidiParser_RO : public MidiParser {
protected:
+ int _markerCount; // Number of markers encountered in stream so far
+
+protected:
void compressToType0();
void parseNextEvent (EventInfo &info);
public:
bool loadMusic (byte *data, uint32 size);
+ uint32 getTime() { return (uint32) _markerCount * 1000000; }
};
@@ -53,7 +57,10 @@ void MidiParser_RO::parseNextEvent (EventInfo &info) {
do {
info.start = _position._play_pos;
info.event = *(_position._play_pos++);
- if (info.command() == 0xA) continue;
+ if (info.command() == 0xA) {
+ ++_markerCount;
+ continue;
+ } // end if
if (info.event == 0xF0) {
byte delay = *(_position._play_pos++);
@@ -107,6 +114,7 @@ bool MidiParser_RO::loadMusic (byte *data, uint32 size) {
_num_tracks = 1;
_ppqn = 120;
_tracks[0] = pos + 2;
+ _markerCount = 0;
// Note that we assume the original data passed in
// will persist beyond this call, i.e. we do NOT