aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authoreriktorbjorn2011-07-20 13:15:30 +0200
committereriktorbjorn2011-07-20 13:15:30 +0200
commite25e85fbb047fef895ede97c3c2c73451631052c (patch)
tree444455de955544b98968c759b8ae823104a4c41e /engines/dreamweb
parentcede1a3f5c4e25bd081b1970f43049ef77ae53f2 (diff)
downloadscummvm-rg350-e25e85fbb047fef895ede97c3c2c73451631052c.tar.gz
scummvm-rg350-e25e85fbb047fef895ede97c3c2c73451631052c.tar.bz2
scummvm-rg350-e25e85fbb047fef895ede97c3c2c73451631052c.zip
DREAMWEB: Blacklist and reimplement cancelch0() and cancelch1()
Now any sound playing on the channels is stopped immediately. This fixes missing voice-overs in the intro, makes it possible to skip lines of conversation, and fixes a problem where the sound effect from the Altar Room would keep playing after leaving the room. Possibly other glitches as well.
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreamgen.cpp39
-rw-r--r--engines/dreamweb/dreamgen.h44
-rw-r--r--engines/dreamweb/dreamweb.cpp10
-rw-r--r--engines/dreamweb/dreamweb.h2
-rw-r--r--engines/dreamweb/stubs.cpp13
-rw-r--r--engines/dreamweb/stubs.h3
6 files changed, 84 insertions, 27 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index b8a5e5122b..3c10ea69d1 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -1,5 +1,29 @@
/* PLEASE DO NOT MODIFY THIS FILE. ALL CHANGES WILL BE LOST! LOOK FOR README FOR DETAILS */
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+
+
#include "dreamgen.h"
namespace DreamGen {
@@ -16570,19 +16594,6 @@ endlessloop:
data.word(kCh0blockstocopy) = ax;
}
-void DreamGenContext::cancelch0() {
- STACK_CHECK;
- data.byte(kCh0repeat) = 0;
- data.word(kCh0blockstocopy) = 0;
- data.byte(kCh0playing) = 255;
-}
-
-void DreamGenContext::cancelch1() {
- STACK_CHECK;
- data.word(kCh1blockstocopy) = 0;
- data.byte(kCh1playing) = 255;
-}
-
void DreamGenContext::channel0tran() {
STACK_CHECK;
_cmp(data.byte(kVolume), 0);
@@ -21922,8 +21933,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_makenextblock: makenextblock(); break;
case addr_volumeadjust: volumeadjust(); break;
case addr_loopchannel0: loopchannel0(); break;
- case addr_cancelch0: cancelch0(); break;
- case addr_cancelch1: cancelch1(); break;
case addr_channel0only: channel0only(); break;
case addr_channel1only: channel1only(); break;
case addr_channel0tran: channel0tran(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 032ad5847c..88ecfd53d4 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -3,6 +3,30 @@
/* PLEASE DO NOT MODIFY THIS FILE. ALL CHANGES WILL BE LOST! LOOK FOR README FOR DETAILS */
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+
+
#include "dreamweb/runtime.h"
@@ -180,8 +204,6 @@ public:
static const uint16 addr_channel0tran = 0xc920;
static const uint16 addr_channel1only = 0xc91c;
static const uint16 addr_channel0only = 0xc918;
- static const uint16 addr_cancelch1 = 0xc914;
- static const uint16 addr_cancelch0 = 0xc910;
static const uint16 addr_loopchannel0 = 0xc90c;
static const uint16 addr_volumeadjust = 0xc908;
static const uint16 addr_makenextblock = 0xc904;
@@ -1325,7 +1347,6 @@ public:
void clearbuffers();
void neterror();
void storeit();
- void lockeddoorway();
void isitworn();
void putundertimed();
void dumpmap();
@@ -1454,10 +1475,10 @@ public:
void dumpkeypad();
void dumpzoom();
void endgameseq();
- void cancelch0();
+ //void cancelch0();
void setbotleft();
void findfirstpath();
- void showallfree();
+ void fadescreenup();
void loadold();
void loadtempcharset();
void useslab();
@@ -1512,7 +1533,7 @@ public:
void loadspeech();
//void cls();
//void printsprites();
- void dumptimedtext();
+ void checkifperson();
void showallobs();
void getnumber();
void adjustleft();
@@ -1580,7 +1601,7 @@ public:
void folderhints();
void openhoteldoor();
void removesetobject();
- void checkifperson();
+ void dumptimedtext();
//void frameoutfx();
void blank();
void drinker();
@@ -1634,7 +1655,6 @@ public:
void fadetowhite();
void textformonk();
void loadsavebox();
- void fadescreenup();
void soundend();
void redes();
void errormessage1();
@@ -1682,9 +1702,8 @@ public:
void showmonk();
void diarykeyn();
void set16colpalette();
- void convicons();
- void interviewer();
void sparky();
+ void interviewer();
void purgeanitem();
void madman();
void createpanel();
@@ -1813,6 +1832,7 @@ public:
void pickupob();
void error();
void showopbox();
+ //void cancelch1();
void clearbeforeload();
void biblequote();
void doload();
@@ -1964,7 +1984,7 @@ public:
void initialmoncols();
void checkforshake();
void usebuttona();
- void cancelch1();
+ void showallfree();
//void getnextword();
void generalerror();
void actualload();
@@ -1979,12 +1999,14 @@ public:
void usechurchgate();
void monkandryan();
void allocatebuffers();
+ void convicons();
void swapwithinv();
void usecontrol();
void buttonseven();
void redrawmainscrn();
void finishedwalking();
void findallryan();
+ void lockeddoorway();
void channel0tran();
void buttonpress();
void parseblaster();
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index a5a6c9096a..caf3a987c4 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -477,6 +477,16 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) {
_mixer->playStream(type, &_channelHandle[channel], stream);
}
+void DreamWebEngine::stopSound(uint8 channel) {
+ debug(1, "stopSound(%u)", channel);
+ assert(channel == 0 || channel == 1);
+ _mixer->stopHandle(_channelHandle[channel]);
+ if (channel == 0)
+ _channel0 = 0;
+ else
+ _channel1 = 0;
+}
+
bool DreamWebEngine::loadSpeech(const Common::String &filename) {
if (ConfMan.getBool("speech_mute"))
return false;
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index 1bc2f19d1c..6ada207496 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -111,6 +111,8 @@ public:
Common::Language getLanguage() const { return _language; }
uint8 modifyChar(uint8 c) const;
+ void stopSound(uint8 channel);
+
private:
void keyPressed(uint16 ascii);
void setSpeed(uint speed);
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 96d46110f9..54685a018a 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1241,5 +1241,18 @@ void DreamGenContext::lockmon() {
}
}
+void DreamGenContext::cancelch0() {
+ data.byte(kCh0repeat) = 0;
+ data.word(kCh0blockstocopy) = 0;
+ data.byte(kCh0playing) = 255;
+ engine->stopSound(0);
+}
+
+void DreamGenContext::cancelch1() {
+ data.word(kCh1blockstocopy) = 0;
+ data.byte(kCh1playing) = 255;
+ engine->stopSound(1);
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index a113bf79cd..a3cb680cca 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -69,4 +69,5 @@
void turnpathoffCPP(uint8 param);
void modifychar();
void lockmon();
-
+ void cancelch0();
+ void cancelch1();