Skip to content

Commit

Permalink
DREAMWEB: Move 'speechloaded' flag out of data blob.
Browse files Browse the repository at this point in the history
  • Loading branch information
digitall committed Dec 28, 2011
1 parent 4f5a708 commit 5492307
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 38 deletions.
1 change: 1 addition & 0 deletions devtools/tasmrecover/tasm-recover
Expand Up @@ -179,6 +179,7 @@ p = parser(skip_binary_data = [
'ch1blocksplayed',
'soundemmpage',
'speechemmpage',
'speechloaded',
'lineroutine',
'increment1',
'increment2',
Expand Down
2 changes: 2 additions & 0 deletions engines/dreamweb/dreambase.h
Expand Up @@ -181,6 +181,8 @@ class DreamBase : public SegmentManager {
uint8 _channel0Repeat;
uint8 _channel1Playing;

bool _speechLoaded;

// from backdrop.cpp
void doBlocks();
uint8 getXAd(const uint8 *setData, uint8 *result);
Expand Down
4 changes: 2 additions & 2 deletions engines/dreamweb/dreamgen.cpp
Expand Up @@ -63,11 +63,11 @@ void DreamGenContext::__start() {
//0x00f0: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0100: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00,
//0x0110: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0120: .... .... .... ....
0x00, 0x00, };
0x00, };
ds.assign(src, src + sizeof(src));
dreamweb();
}
Expand Down
53 changes: 26 additions & 27 deletions engines/dreamweb/dreamgen.h
Expand Up @@ -240,33 +240,32 @@ static const uint16 kAddtogreen = 264;
static const uint16 kAddtored = 265;
static const uint16 kAddtoblue = 266;
static const uint16 kLastsoundreel = 267;
static const uint16 kSpeechloaded = 269;
static const uint16 kVolume = 270;
static const uint16 kVolumeto = 271;
static const uint16 kVolumedirection = 272;
static const uint16 kVolumecount = 273;
static const uint16 kLasthardkey = 274;
static const uint16 kBufferin = 275;
static const uint16 kBufferout = 277;
static const uint16 kWorkspace = 279;
static const uint16 kMainsprites = 281;
static const uint16 kBackdrop = 283;
static const uint16 kRecordspace = 285;
static const uint16 kBlinkframe = 287;
static const uint16 kBlinkcount = 288;
static const uint16 kReasseschanges = 289;
static const uint16 kPointerspath = 290;
static const uint16 kManspath = 291;
static const uint16 kPointerfirstpath = 292;
static const uint16 kFinaldest = 293;
static const uint16 kDestination = 294;
static const uint16 kLinestartx = 295;
static const uint16 kLinestarty = 297;
static const uint16 kLineendx = 299;
static const uint16 kLineendy = 301;
static const uint16 kLinepointer = 303;
static const uint16 kLinedirection = 304;
static const uint16 kLinelength = 305;
static const uint16 kVolume = 269;
static const uint16 kVolumeto = 270;
static const uint16 kVolumedirection = 271;
static const uint16 kVolumecount = 272;
static const uint16 kLasthardkey = 273;
static const uint16 kBufferin = 274;
static const uint16 kBufferout = 276;
static const uint16 kWorkspace = 278;
static const uint16 kMainsprites = 280;
static const uint16 kBackdrop = 282;
static const uint16 kRecordspace = 284;
static const uint16 kBlinkframe = 286;
static const uint16 kBlinkcount = 287;
static const uint16 kReasseschanges = 288;
static const uint16 kPointerspath = 289;
static const uint16 kManspath = 290;
static const uint16 kPointerfirstpath = 291;
static const uint16 kFinaldest = 292;
static const uint16 kDestination = 293;
static const uint16 kLinestartx = 294;
static const uint16 kLinestarty = 296;
static const uint16 kLineendx = 298;
static const uint16 kLineendy = 300;
static const uint16 kLinepointer = 302;
static const uint16 kLinedirection = 303;
static const uint16 kLinelength = 304;
static const uint16 kBlocktextdat = (0);
static const uint16 kPersonframes = (0);
static const uint16 kDebuglevel1 = (0);
Expand Down
2 changes: 2 additions & 0 deletions engines/dreamweb/dreamweb.cpp
Expand Up @@ -419,6 +419,8 @@ DreamBase::DreamBase(DreamWeb::DreamWebEngine *en) :
_channel0Repeat = 0;
_channel1Playing = 0xff;

_speechLoaded = false;

_backdropBlocks = 0;
_reelList = 0;

Expand Down
2 changes: 1 addition & 1 deletion engines/dreamweb/sound.cpp
Expand Up @@ -37,7 +37,7 @@ bool DreamBase::loadSpeech(byte type1, int idx1, byte type2, int idx2) {
//debug("name = %s", name.c_str());
bool result = engine->loadSpeech(name);

data.byte(kSpeechloaded) = result;
_speechLoaded = result;
return result;
}

Expand Down
4 changes: 2 additions & 2 deletions engines/dreamweb/stubs.cpp
Expand Up @@ -944,7 +944,7 @@ void DreamBase::setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8
// FIXME: This fallthrough does not properly support subtitles+speech
// mode. The parameters to setuptimedtemp() are sometimes different
// for speech and for subtitles. See e.g., madmantext()
if ((data.byte(kSpeechloaded) == 1) && !_subtitles)
if (_speechLoaded && !_subtitles)
return;
}
#endif
Expand Down Expand Up @@ -1703,7 +1703,7 @@ bool DreamBase::isCD() {
// This is a hack to guess which version to use with the assumption that if we have a cd version
// we managed to load the speech. At least it is isolated in this function and can be changed.
// Maybe detect the version during game id?
return (data.byte(kSpeechloaded) == 1);
return (_speechLoaded);
}

void DreamBase::showIcon() {
Expand Down
12 changes: 6 additions & 6 deletions engines/dreamweb/talk.cpp
Expand Up @@ -66,7 +66,7 @@ void DreamBase::talk() {

redrawMainScrn();
workToScreenM();
if (data.byte(kSpeechloaded) == 1) {
if (_speechLoaded) {
cancelCh1();
data.byte(kVolumedirection) = (byte)-1;
data.byte(kVolumeto) = 0;
Expand Down Expand Up @@ -98,9 +98,9 @@ void DreamBase::startTalk() {
y = 80;
printDirect(&str, 66, &y, 241, true);

data.byte(kSpeechloaded) = 0;
_speechLoaded = false;
loadSpeech('R', data.byte(kReallocation), 'C', 64*(data.byte(kCharacter) & 0x7F));
if (data.byte(kSpeechloaded) == 1) {
if (_speechLoaded) {
data.byte(kVolumedirection) = 1;
data.byte(kVolumeto) = 6;
playChannel1(50 + 12);
Expand Down Expand Up @@ -155,7 +155,7 @@ void DreamBase::doSomeTalk() {
printDirect(str, 164, 64, 144, false);

loadSpeech('R', data.byte(kReallocation), 'C', (64 * (data.byte(kCharacter) & 0x7F)) + data.byte(kTalkpos));
if (data.byte(kSpeechloaded) != 0)
if (_speechLoaded)
playChannel1(62);

data.byte(kPointermode) = 3;
Expand All @@ -181,7 +181,7 @@ void DreamBase::doSomeTalk() {
printDirect(str, 48, 128, 144, false);

loadSpeech('R', data.byte(kReallocation), 'C', (64 * (data.byte(kCharacter) & 0x7F)) + data.byte(kTalkpos));
if (data.byte(kSpeechloaded) != 0)
if (_speechLoaded)
playChannel1(62);

data.byte(kPointermode) = 3;
Expand Down Expand Up @@ -223,7 +223,7 @@ bool DreamBase::hangOnPQ() {
return true;
}

if (data.byte(kSpeechloaded) == 1 && _channel1Playing == 255) {
if (_speechLoaded && _channel1Playing == 255) {
speechFlag++;
if (speechFlag == 40)
break;
Expand Down

0 comments on commit 5492307

Please sign in to comment.