diff options
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 2 | ||||
-rw-r--r-- | engines/dreamweb/dreambase.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 21 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamweb.cpp | 2 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 14 |
6 files changed, 18 insertions, 25 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 2f58475398..78630f8668 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -647,6 +647,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'usewinch', 'usewindow', 'viewfolder', + 'volumeadjust', 'waitframes', 'walkandexamine', 'walking', @@ -1130,7 +1131,6 @@ generator = cpp(context, "DreamGen", blacklist = [ 'intromusic' : 'introMusic', 'quitkey' : 'quitKey', 'processtrigger' : 'processTrigger', - 'volumeadjust' : 'volumeAdjust', 'randomnum2' : 'randomNum2', 'loadsecondsample' : 'loadSecondSample', 'transfercontoex' : 'transferConToEx', diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h index 0d701c53ce..310a4102b5 100644 --- a/engines/dreamweb/dreambase.h +++ b/engines/dreamweb/dreambase.h @@ -57,6 +57,9 @@ public: uint8 getNumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16 *offset); uint8 kernChars(uint8 firstChar, uint8 secondChar, uint8 width); + // from stubs.cpp + void volumeAdjust(); + // from vgagrafx.cpp void printUnderMon(); void cls(); diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index b54dc63858..477f409ca5 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -7141,27 +7141,6 @@ tensc: cs.byte(di+7) = al; } -void DreamGenContext::volumeAdjust() { - STACK_CHECK; - al = data.byte(kVolumedirection); - _cmp(al, 0); - if (flags.z()) - return /* (volok) */; - al = data.byte(kVolume); - _cmp(al, data.byte(kVolumeto)); - if (flags.z()) - goto volfinish; - _add(data.byte(kVolumecount), 64); - if (!flags.z()) - return /* (volok) */; - al = data.byte(kVolume); - _add(al, data.byte(kVolumedirection)); - data.byte(kVolume) = al; - return; -volfinish: - data.byte(kVolumedirection) = 0; -} - void DreamGenContext::entryTexts() { STACK_CHECK; _cmp(data.byte(kLocation), 21); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 5e5f94c88a..7b7b3add32 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -766,7 +766,6 @@ public: void alleyBarkSound(); void quitKey(); void processTrigger(); - void volumeAdjust(); void transferConToEx(); void adjustDown(); void withWhat(); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 3151a5963d..6a9f57b302 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -463,9 +463,7 @@ bool DreamWebEngine::loadSpeech(const Common::String &filename) { void DreamWebEngine::soundHandler() { _context.data.byte(DreamGen::kSubtitles) = ConfMan.getBool("subtitles"); - _context.push(_context.ax); _context.volumeAdjust(); - _context.ax = _context.pop(); uint volume = _context.data.byte(DreamGen::kVolume); //.vol file loaded into soundbuf:0x4000 diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index f6d3225edc..165585b974 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1135,6 +1135,7 @@ void DreamGenContext::fadeDOS() { } } + void DreamGenContext::eraseOldObs() { if (data.byte(kNewobs) == 0) return; @@ -2453,6 +2454,19 @@ Frame * DreamGenContext::tempGraphics3() { return (Frame *)getSegment(data.word(kTempgraphics3)).ptr(0, 0); } +void DreamBase::volumeAdjust() { + if (data.byte(kVolumedirection) == 0) + return; + if (data.byte(kVolume) != data.byte(kVolumeto)) { + data.byte(kVolumecount) += 64; + // Only modify the volume every 256/64 = 4th time around + if (data.byte(kVolumecount) == 0) + data.byte(kVolume) += data.byte(kVolumedirection); + } else { + data.byte(kVolumedirection) = 0; + } +} + void DreamGenContext::playChannel0(uint8 index, uint8 repeat) { if (data.byte(kSoundint) == 255) return; |