aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2011-12-27 23:49:35 +0000
committerD G Turner2011-12-27 23:49:35 +0000
commit56191e3928ef78a09ff3549f06d4e0ea795a5863 (patch)
tree8294ad02ad189b6d8dc699e0c3771a99204b9d6c
parent4ac19d8870d4c154f10f3e4288986b387a08fd41 (diff)
downloadscummvm-rg350-56191e3928ef78a09ff3549f06d4e0ea795a5863.tar.gz
scummvm-rg350-56191e3928ef78a09ff3549f06d4e0ea795a5863.tar.bz2
scummvm-rg350-56191e3928ef78a09ff3549f06d4e0ea795a5863.zip
DREAMWEB: Move 3 sound related variables out of data blob.
-rwxr-xr-xdevtools/tasmrecover/tasm-recover3
-rw-r--r--engines/dreamweb/dreambase.h4
-rw-r--r--engines/dreamweb/dreamgen.cpp2
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/dreamweb.cpp3
-rw-r--r--engines/dreamweb/people.cpp2
-rw-r--r--engines/dreamweb/sound.cpp28
-rw-r--r--engines/dreamweb/sprite.cpp8
-rw-r--r--engines/dreamweb/stubs.cpp2
-rw-r--r--engines/dreamweb/talk.cpp4
-rw-r--r--engines/dreamweb/titles.cpp2
11 files changed, 34 insertions, 27 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 5c9ec51511..dad24bf5e6 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -133,6 +133,9 @@ p = parser(skip_binary_data = [
# vars.asm
'currentset',
'currentsample',
+ 'ch0playing',
+ 'ch0repeat',
+ 'ch1playing',
'icons1',
'icons2',
'tempcharset',
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index b4159db26c..a9f8ee7ec9 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -172,8 +172,12 @@ public:
bool _subtitles;
bool _foreignRelease;
+ // sound related
uint8 _roomsSample;
uint8 _currentSample;
+ uint8 _channel0Playing;
+ uint8 _channel0Repeat;
+ uint8 _channel1Playing;
// from backdrop.cpp
void doBlocks();
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 8b69c84a1c..f9262fb126 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -67,7 +67,7 @@ void DreamGenContext::__start() {
//0x0110: .... .... .... ....
0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0120: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, };
+ 0x00, 0x00, 0x00, };
ds.assign(src, src + sizeof(src));
dreamweb();
}
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index d283cd1c35..f999c6f6dc 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -268,9 +268,6 @@ static const uint16 kLineendy = 302;
static const uint16 kLinepointer = 304;
static const uint16 kLinedirection = 305;
static const uint16 kLinelength = 306;
-static const uint16 kCh0playing = 307;
-static const uint16 kCh0repeat = 308;
-static const uint16 kCh1playing = 309;
static const uint16 kBlocktextdat = (0);
static const uint16 kPersonframes = (0);
static const uint16 kDebuglevel1 = (0);
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 468999e1ba..39ef5eb301 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -415,6 +415,9 @@ DreamBase::DreamBase(DreamWeb::DreamWebEngine *en) :
_quitRequested = false;
_currentSample = 0xff;
+ _channel0Playing = 0;
+ _channel0Repeat = 0;
+ _channel1Playing = 0xff;
_backdropBlocks = 0;
_reelList = 0;
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 7adc2b1220..ca7bf07866 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -148,7 +148,7 @@ void DreamBase::madmanText() {
if (isCD()) {
if (data.byte(kSpeechcount) >= 63)
return;
- if (data.byte(kCh1playing) != 255)
+ if (_channel1Playing != 255)
return;
origCount = data.byte(kSpeechcount);
++data.byte(kSpeechcount);
diff --git a/engines/dreamweb/sound.cpp b/engines/dreamweb/sound.cpp
index 1eefedaae2..ac98ad21d5 100644
--- a/engines/dreamweb/sound.cpp
+++ b/engines/dreamweb/sound.cpp
@@ -56,30 +56,30 @@ void DreamBase::volumeAdjust() {
}
void DreamBase::playChannel0(uint8 index, uint8 repeat) {
- data.byte(kCh0playing) = index;
+ _channel0Playing = index;
if (index >= 12)
index -= 12;
- data.byte(kCh0repeat) = repeat;
+ _channel0Repeat = repeat;
}
void DreamBase::playChannel1(uint8 index) {
- if (data.byte(kCh1playing) == 7)
+ if (_channel1Playing == 7)
return;
- data.byte(kCh1playing) = index;
+ _channel1Playing = index;
if (index >= 12)
index -= 12;
}
void DreamBase::cancelCh0() {
- data.byte(kCh0repeat) = 0;
- data.byte(kCh0playing) = 255;
+ _channel0Repeat = 0;
+ _channel0Playing = 255;
engine->stopSound(0);
}
void DreamBase::cancelCh1() {
- data.byte(kCh1playing) = 255;
+ _channel1Playing = 255;
engine->stopSound(1);
}
@@ -93,10 +93,10 @@ void DreamBase::loadRoomsSample() {
Common::String sampleName = Common::String::format("DREAMWEB.V%02d", sample);
_currentSample = sample;
- uint8 ch0 = data.byte(kCh0playing);
+ uint8 ch0 = _channel0Playing;
if (ch0 >= 12 && ch0 != 255)
cancelCh0();
- uint8 ch1 = data.byte(kCh1playing);
+ uint8 ch1 = _channel1Playing;
if (ch1 >= 12)
cancelCh1();
engine->loadSounds(1, sampleName.c_str());
@@ -210,13 +210,13 @@ void DreamWebEngine::soundHandler() {
volume = (8 - volume) * Audio::Mixer::kMaxChannelVolume / 8;
_mixer->setChannelVolume(_channelHandle[0], volume);
- uint8 ch0 = _base.data.byte(DreamGen::kCh0playing);
+ uint8 ch0 = _base._channel0Playing;
if (ch0 == 255)
ch0 = 0;
- uint8 ch1 = _base.data.byte(DreamGen::kCh1playing);
+ uint8 ch1 = _base._channel1Playing;
if (ch1 == 255)
ch1 = 0;
- uint8 ch0loop = _base.data.byte(DreamGen::kCh0repeat);
+ uint8 ch0loop = _base._channel0Repeat;
if (_channel0 != ch0) {
_channel0 = ch0;
@@ -231,11 +231,11 @@ void DreamWebEngine::soundHandler() {
}
}
if (!_mixer->isSoundHandleActive(_channelHandle[0])) {
- _base.data.byte(DreamGen::kCh0playing) = 255;
+ _base._channel0Playing = 255;
_channel0 = 0;
}
if (!_mixer->isSoundHandleActive(_channelHandle[1])) {
- _base.data.byte(DreamGen::kCh1playing) = 255;
+ _base._channel1Playing = 255;
_channel1 = 0;
}
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index d1b7934a2e..cc7631439a 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -495,7 +495,7 @@ void DreamBase::showRain() {
}
}
- if (data.byte(kCh1playing) != 255)
+ if (_channel1Playing != 255)
return;
if (data.byte(kReallocation) == 2 && data.byte(kBeenmugged) != 1)
return;
@@ -506,7 +506,7 @@ void DreamBase::showRain() {
return;
uint8 soundIndex;
- if (data.byte(kCh0playing) != 6)
+ if (_channel0Playing != 6)
soundIndex = 4;
else
soundIndex = 7;
@@ -677,7 +677,7 @@ void DreamBase::intro1Text() {
if (data.byte(kIntrocount) != 2 && data.byte(kIntrocount) != 4 && data.byte(kIntrocount) != 6)
return;
- if (isCD() && data.byte(kCh1playing) != 255) {
+ if (isCD() && _channel1Playing != 255) {
data.byte(kIntrocount)--;
} else {
if (data.byte(kIntrocount) == 2)
@@ -750,7 +750,7 @@ void DreamBase::textForEnd() {
}
void DreamBase::textForMonkHelper(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount) {
- if (isCD() && data.byte(kCh1playing) != 255)
+ if (isCD() && _channel1Playing != 255)
data.byte(kIntrocount)--;
else
setupTimedTemp(textIndex, voiceIndex, x, y, countToTimed, timeCount);
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index f62e651b1b..d61146e9c8 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -2550,7 +2550,7 @@ void DreamBase::atmospheres() {
continue;
if (a->_mapX != data.byte(kMapx) || a->_mapY != data.byte(kMapy))
continue;
- if (a->_sound != data.byte(kCh0playing)) {
+ if (a->_sound != _channel0Playing) {
if (data.byte(kLocation) == 45 && data.word(kReeltowatch) == 45)
continue; // "web"
diff --git a/engines/dreamweb/talk.cpp b/engines/dreamweb/talk.cpp
index d27d920891..992fea29a8 100644
--- a/engines/dreamweb/talk.cpp
+++ b/engines/dreamweb/talk.cpp
@@ -223,7 +223,7 @@ bool DreamBase::hangOnPQ() {
return true;
}
- if (data.byte(kSpeechloaded) == 1 && data.byte(kCh1playing) == 255) {
+ if (data.byte(kSpeechloaded) == 1 && _channel1Playing == 255) {
speechFlag++;
if (speechFlag == 40)
break;
@@ -236,7 +236,7 @@ bool DreamBase::hangOnPQ() {
}
void DreamBase::redes() {
- if (data.byte(kCh1playing) != 255 || data.byte(kTalkmode) != 2) {
+ if (_channel1Playing != 255 || data.byte(kTalkmode) != 2) {
blank();
return;
}
diff --git a/engines/dreamweb/titles.cpp b/engines/dreamweb/titles.cpp
index 8576fd4eb2..f30283e45a 100644
--- a/engines/dreamweb/titles.cpp
+++ b/engines/dreamweb/titles.cpp
@@ -58,7 +58,7 @@ void DreamBase::monkSpeaking() {
do {
engine->waitForVSync();
- } while (data.byte(kCh1playing) != 255);
+ } while (_channel1Playing != 255);
}
data.byte(kVolumedirection) = 1;