[Scummvm-cvs-logs] scummvm master -> 56191e3928ef78a09ff3549f06d4e0ea795a5863

digitall digitall at scummvm.org
Wed Dec 28 00:50:36 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
56191e3928 DREAMWEB: Move 3 sound related variables out of data blob.


Commit: 56191e3928ef78a09ff3549f06d4e0ea795a5863
    https://github.com/scummvm/scummvm/commit/56191e3928ef78a09ff3549f06d4e0ea795a5863
Author: D G Turner (digitall at scummvm.org)
Date: 2011-12-27T15:49:35-08:00

Commit Message:
DREAMWEB: Move 3 sound related variables out of data blob.

Changed paths:
    devtools/tasmrecover/tasm-recover
    engines/dreamweb/dreambase.h
    engines/dreamweb/dreamgen.cpp
    engines/dreamweb/dreamgen.h
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/people.cpp
    engines/dreamweb/sound.cpp
    engines/dreamweb/sprite.cpp
    engines/dreamweb/stubs.cpp
    engines/dreamweb/talk.cpp
    engines/dreamweb/titles.cpp



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 5c9ec51..dad24bf 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 b4159db..a9f8ee7 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 8b69c84..f9262fb 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 d283cd1..f999c6f 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 468999e..39ef5eb 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 7adc2b1..ca7bf07 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 1eefeda..ac98ad2 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 d1b7934..cc76314 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 f62e651..d61146e 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 d27d920..992fea2 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 8576fd4..f30283e 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;






More information about the Scummvm-git-logs mailing list