aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorVladimir Menshakov2010-01-08 11:05:59 +0000
committerVladimir Menshakov2010-01-08 11:05:59 +0000
commit5f5225ea385b16b99d136fb34f09a0cdc16ba051 (patch)
tree59f3c61f897cf21a0b5c2b4d864dca150f8fab0c /engines
parent35e01ef29a7859f9545d9273b41bc60b1bb18ec5 (diff)
downloadscummvm-rg350-5f5225ea385b16b99d136fb34f09a0cdc16ba051.tar.gz
scummvm-rg350-5f5225ea385b16b99d136fb34f09a0cdc16ba051.tar.bz2
scummvm-rg350-5f5225ea385b16b99d136fb34f09a0cdc16ba051.zip
minor cleanup
svn-id: r47150
Diffstat (limited to 'engines')
-rw-r--r--engines/teenagent/music.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/engines/teenagent/music.cpp b/engines/teenagent/music.cpp
index 3e9731049f..c05b75322c 100644
--- a/engines/teenagent/music.cpp
+++ b/engines/teenagent/music.cpp
@@ -43,7 +43,7 @@ MusicPlayer::~MusicPlayer() {
bool MusicPlayer::load(int id) {
Resources *res = Resources::instance();
- Common::SeekableReadStream *stream = res->mmm.getStream(id);
+ Common::SeekableReadStream *stream = res->mmm.getStream(id);
if (stream == NULL)
return false;
@@ -90,18 +90,24 @@ bool MusicPlayer::load(int id) {
while (!stream->eos()) {
byte cmd = stream->readByte();
+ debug(1, "cmd = %02x", cmd);
- if ((cmd & 0xF0) == 0x50) {
- row.channels[(cmd & 0x0F) - 1].sample = stream->readByte();
- } else if ((cmd & 0xF0) == 0x40) {
- row.channels[(cmd & 0x0F) - 1].volume = (stream->readByte() + 1) * 2;
- } else {
+ if (cmd < 0x40) {
row.channels[0].note = cmd;
row.channels[1].note = stream->readByte();
row.channels[2].note = stream->readByte();
_rows.push_back(row);
+ } else if ((cmd & 0xF0) == 0x50) {
+ byte sample = stream->readByte();
+ //debug(1, "%02x: set sample %02x", cmd, sample);
+ row.channels[(cmd & 0x0F) - 1].sample = sample;
+ } else if ((cmd & 0xF0) == 0x40) {
+ byte vol = stream->readByte();
+ //debug(1, "%02x: set volume %02x -> %02x", cmd, row.channels[(cmd & 0x0F) - 1].volume, vol);
+ row.channels[(cmd & 0x0F) - 1].volume = vol;
+ } else {
+ debug(0, "unhandled music command %02x", cmd);
}
-
}
_currRow = 0;
_id = id;