[Scummvm-git-logs] scummvm master -> 9fc24ed0b068723d7ce41868f075e481154197c4
csnover
csnover at users.noreply.github.com
Wed Sep 20 03:03:16 CEST 2017
This automated email contains information about 14 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
2f9967524f SCI: Stop EngineState::wait mutating r_acc
b0b1e89abe SCI32: Hide warning about CD-ROM speed setting in kGetSierraProfileInt
d9ad1a3ce5 SCI32: Promote Lighthouse demos to ADGF_TESTING
d36d01b82c SCI32: Add Lighthouse Glider demo to detection table
22d157cee7 SCI32: Flush all events before warping mouse
301d0403cb SCI32: Don't warp the mouse twice when its position has been restricted
836f1bdf44 SCI32: Add audio dump debugger command
eba9526fdd SCI32: Remove never-read default values
d363234129 SCI32: Fix GfxFrameout::addPlane from causing possible leaks
682b8790fd SCI: Allow multi-step tracing with step-over in debugger
6af5133061 SCI32: Put superclass address in r_acc for SCI3 super calls
2dc042d540 NEWS: Extend SCI game versions to reflect SCI3 being supported
52d9d04919 SCI32: Fix inconsistent patch instruction comments
9fc24ed0b0 SCI32: Support RAMA's single sound effects volume
Commit: 2f9967524f610f277c9c5109d1339e3e87957804
https://github.com/scummvm/scummvm/commit/2f9967524f610f277c9c5109d1339e3e87957804
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:29-05:00
Commit Message:
SCI: Stop EngineState::wait mutating r_acc
This wait function is used by kernel calls other than kWait, and
those other functions do not mutate r_acc in SSCI.
Changed paths:
engines/sci/engine/kgraphics.cpp
engines/sci/engine/state.cpp
engines/sci/engine/state.h
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 9bfeb9a..28e054b 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -397,13 +397,13 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) {
reg_t kWait(EngineState *s, int argc, reg_t *argv) {
int sleep_time = argv[0].toUint16();
- s->wait(sleep_time);
+ const int delta = s->wait(sleep_time);
if (g_sci->_guestAdditions->kWaitHook()) {
return NULL_REG;
}
- return s->r_acc;
+ return make_reg(0, delta);
}
reg_t kCoordPri(EngineState *s, int argc, reg_t *argv) {
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index 731f6b7..343a949 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -136,13 +136,14 @@ void EngineState::speedThrottler(uint32 neededSleep) {
}
}
-void EngineState::wait(int16 ticks) {
+int EngineState::wait(int16 ticks) {
uint32 time = g_system->getMillis();
- r_acc = make_reg(0, ((long)time - (long)lastWaitTime) * 60 / 1000);
+ const int tickDelta = ((long)time - (long)lastWaitTime) * 60 / 1000;
lastWaitTime = time;
ticks *= g_debug_sleeptime_factor;
g_sci->sleep(ticks * 1000 / 60);
+ return tickDelta;
}
void EngineState::initGlobals() {
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index b02ace8..21c9a1f 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -126,7 +126,7 @@ public:
uint32 _screenUpdateTime; /**< The last time the game updated the screen */
void speedThrottler(uint32 neededSleep);
- void wait(int16 ticks);
+ int wait(int16 ticks);
#ifdef ENABLE_SCI32
uint32 _eventCounter; /**< total times kGetEvent was invoked since the last call to kFrameOut */
Commit: b0b1e89abe0d4f02245fcbd779275399e06a8965
https://github.com/scummvm/scummvm/commit/b0b1e89abe0d4f02245fcbd779275399e06a8965
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:29-05:00
Commit Message:
SCI32: Hide warning about CD-ROM speed setting in kGetSierraProfileInt
In the DOS interpreters, this function is a no-op. Lighthouse calls
it regardless of platform, so dummy it out for non-Windows
platforms. This is not known to address any particular issue, and
is really just to eliminate the warning about an unknown
configuration setting when starting Lighthouse in a manner that is
compatible with the original interpreter.
Changed paths:
engines/sci/engine/kmisc.cpp
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index af3b7bb..62dc2b2 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -435,6 +435,10 @@ reg_t kGetConfig(EngineState *s, int argc, reg_t *argv) {
// Likely modelled after the Windows 3.1 function GetPrivateProfileInt:
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms724345%28v=vs.85%29.aspx
reg_t kGetSierraProfileInt(EngineState *s, int argc, reg_t *argv) {
+ if (g_sci->getPlatform() != Common::kPlatformWindows) {
+ return s->r_acc;
+ }
+
Common::String category = s->_segMan->getString(argv[0]); // always "config"
category.toLowercase();
Common::String setting = s->_segMan->getString(argv[1]);
Commit: d9ad1a3ce500f821d4c136d7f32b570e52b74936
https://github.com/scummvm/scummvm/commit/d9ad1a3ce500f821d4c136d7f32b570e52b74936
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:29-05:00
Commit Message:
SCI32: Promote Lighthouse demos to ADGF_TESTING
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index cf92dcb..b57ce97 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -2793,7 +2793,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "543124606352bfa5e07696ddf2a669be", 64},
{"resource.000", 0, "5d7714416b612463d750fb9c5690c859", 28952},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO_LIGHTHOUSE_DEMO },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_TESTING, GUIO_LIGHTHOUSE_DEMO },
// Lighthouse - English Windows Demo
// Executable scanning reports "3.000.000", VERSION file reports "1.00"
@@ -2801,7 +2801,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "3bdee7a16926975a4729f75cf6b80a92", 1525},
{"ressci.000", 0, "3c585827fa4a82f4c04a56a0bc52ccee", 11494351},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO_LIGHTHOUSE },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_TESTING, GUIO_LIGHTHOUSE_DEMO },
// Lighthouse - English DOS (from jvprat)
// Executable scanning reports "3.000.000", VERSION file reports "1.1"
Commit: d36d01b82cdf88e40c62851170f06e526d36f352
https://github.com/scummvm/scummvm/commit/d36d01b82cdf88e40c62851170f06e526d36f352
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:29-05:00
Commit Message:
SCI32: Add Lighthouse Glider demo to detection table
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index b57ce97..445f999 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -2803,6 +2803,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_TESTING, GUIO_LIGHTHOUSE_DEMO },
+ // Lighthouse - English Windows Glider Demo
+ // Executable scanning reports "3.000.000"
+ {"lighthouse", "Glider Demo", {
+ {"resmap.000", 0, "fca5bec5f778fc3f86d3176dc4ae6e54", 346},
+ {"ressci.000", 0, "896e81b6d70940c3b0696ef51cee51bc", 3300500},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_TESTING, GUIO_LIGHTHOUSE_DEMO },
+
// Lighthouse - English DOS (from jvprat)
// Executable scanning reports "3.000.000", VERSION file reports "1.1"
{"lighthouse", "", {
Commit: 22d157cee7a75a0dbe9b849d58a55e186a5ddb86
https://github.com/scummvm/scummvm/commit/22d157cee7a75a0dbe9b849d58a55e186a5ddb86
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:29-05:00
Commit Message:
SCI32: Flush all events before warping mouse
This improves the behaviour at the end of PQ4 when navigating the
warehouse with the flashlight by getting rid of mouse events that
may have been queued before the mouse warp to the other side of
the screen is performed. Without this, frequently, those extra
events would then be processed and cause the mouse to jump back to
the opposite side of the screen, triggering another navigation in
the opposite direction.
This patch really only helps when mouse capture is enabled in
ScummVM as well, but it does allow the sequence to be played
pretty much normally in that situation. Additional (pending)
patches to ScummVM itself are needed to move the mouse to the
correct place when mouse capture is off and the system mouse moves
outside of the game window.
Refs Trac#9689.
Changed paths:
engines/sci/graphics/cursor32.cpp
diff --git a/engines/sci/graphics/cursor32.cpp b/engines/sci/graphics/cursor32.cpp
index 1db7402..9bb0d4a 100644
--- a/engines/sci/graphics/cursor32.cpp
+++ b/engines/sci/graphics/cursor32.cpp
@@ -340,6 +340,7 @@ void GfxCursor32::setPosition(const Common::Point &position) {
newPosition.x = (position.x * Ratio(screenWidth, scriptWidth)).toInt();
newPosition.y = (position.y * Ratio(screenHeight, scriptHeight)).toInt();
+ g_sci->getEventManager()->flushEvents();
g_system->warpMouse(newPosition.x, newPosition.y);
deviceMoved(newPosition);
}
Commit: 301d0403cb46cbb268c914c3fdcf070c31781e07
https://github.com/scummvm/scummvm/commit/301d0403cb46cbb268c914c3fdcf070c31781e07
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:29-05:00
Commit Message:
SCI32: Don't warp the mouse twice when its position has been restricted
Changed paths:
engines/sci/graphics/cursor32.cpp
engines/sci/graphics/cursor32.h
diff --git a/engines/sci/graphics/cursor32.cpp b/engines/sci/graphics/cursor32.cpp
index 9bb0d4a..6eb7085 100644
--- a/engines/sci/graphics/cursor32.cpp
+++ b/engines/sci/graphics/cursor32.cpp
@@ -340,9 +340,9 @@ void GfxCursor32::setPosition(const Common::Point &position) {
newPosition.x = (position.x * Ratio(screenWidth, scriptWidth)).toInt();
newPosition.y = (position.y * Ratio(screenHeight, scriptHeight)).toInt();
- g_sci->getEventManager()->flushEvents();
- g_system->warpMouse(newPosition.x, newPosition.y);
- deviceMoved(newPosition);
+ if (!deviceMoved(newPosition)) {
+ g_system->warpMouse(newPosition.x, newPosition.y);
+ }
}
void GfxCursor32::gonnaPaint(Common::Rect paintRect) {
@@ -375,7 +375,7 @@ void GfxCursor32::donePainting() {
}
}
-void GfxCursor32::deviceMoved(Common::Point &position) {
+bool GfxCursor32::deviceMoved(Common::Point &position) {
bool restricted = false;
if (position.x < _restrictedArea.left) {
@@ -403,6 +403,8 @@ void GfxCursor32::deviceMoved(Common::Point &position) {
_position = position;
move();
}
+
+ return restricted;
}
void GfxCursor32::move() {
diff --git a/engines/sci/graphics/cursor32.h b/engines/sci/graphics/cursor32.h
index 00a8b9b..5872744 100644
--- a/engines/sci/graphics/cursor32.h
+++ b/engines/sci/graphics/cursor32.h
@@ -46,7 +46,7 @@ public:
/**
* Called when the hardware mouse moves.
*/
- void deviceMoved(Common::Point &position);
+ bool deviceMoved(Common::Point &position);
/**
* Called by GfxFrameout once for each show
Commit: 836f1bdf441a199e16ef4583975eab8fe377e863
https://github.com/scummvm/scummvm/commit/836f1bdf441a199e16ef4583975eab8fe377e863
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:29-05:00
Commit Message:
SCI32: Add audio dump debugger command
Changed paths:
engines/sci/console.cpp
engines/sci/console.h
engines/sci/sound/audio32.cpp
engines/sci/sound/audio32.h
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 4d8ff17..4c4dfb3 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -53,9 +53,11 @@
#include "video/avi_decoder.h"
#include "sci/video/seq_decoder.h"
#ifdef ENABLE_SCI32
+#include "common/memstream.h"
#include "sci/graphics/frameout.h"
#include "sci/graphics/paint32.h"
#include "sci/graphics/palette32.h"
+#include "sci/sound/decoders/sol.h"
#include "video/coktel_decoder.h"
#endif
@@ -173,6 +175,7 @@ Console::Console(SciEngine *engine) : GUI::Debugger(),
registerCmd("show_instruments", WRAP_METHOD(Console, cmdShowInstruments));
registerCmd("map_instrument", WRAP_METHOD(Console, cmdMapInstrument));
registerCmd("audio_list", WRAP_METHOD(Console, cmdAudioList));
+ registerCmd("audio_dump", WRAP_METHOD(Console, cmdAudioDump));
// Script
registerCmd("addresses", WRAP_METHOD(Console, cmdAddresses));
registerCmd("registers", WRAP_METHOD(Console, cmdRegisters));
@@ -426,6 +429,7 @@ bool Console::cmdHelp(int argc, const char **argv) {
debugPrintf(" show_instruments - Shows the instruments of a specific song, or all songs\n");
debugPrintf(" map_instrument - Dynamically maps an MT-32 instrument to a GM instrument\n");
debugPrintf(" audio_list - Lists currently active digital audio samples (SCI2+)\n");
+ debugPrintf(" audio_dump - Dumps the requested audio resource as an uncompressed wave file (SCI2+)\n");
debugPrintf("\n");
debugPrintf("Script:\n");
debugPrintf(" addresses - Provides information on how to pass addresses\n");
@@ -1452,6 +1456,142 @@ bool Console::cmdAudioList(int argc, const char **argv) {
return true;
}
+bool Console::cmdAudioDump(int argc, const char **argv) {
+#ifdef ENABLE_SCI32
+ if (argc != 2 && argc != 6) {
+ debugPrintf("Dumps the requested audio resource as an uncompressed wave file.\n");
+ debugPrintf("Usage (audio): %s <audio resource id>\n", argv[0]);
+ debugPrintf("Usage (audio36): %s <audio map id> <noun> <verb> <cond> <seq>\n", argv[0]);
+ return true;
+ }
+
+ ResourceId id;
+ if (argc == 2) {
+ id = ResourceId(kResourceTypeAudio, atoi(argv[1]));
+ } else {
+ id = ResourceId(kResourceTypeAudio36, atoi(argv[1]), atoi(argv[2]), atoi(argv[3]), atoi(argv[4]), atoi(argv[5]));
+ }
+
+ Resource *resource = _engine->_resMan->findResource(id, false);
+ if (!resource) {
+ debugPrintf("Not found.\n");
+ return true;
+ }
+
+ Common::MemoryReadStream stream = resource->toStream();
+
+ Common::DumpFile outFile;
+ const Common::String fileName = Common::String::format("%s.wav", id.toString().c_str());
+ if (!outFile.open(fileName)) {
+ debugPrintf("Could not open dump file %s.\n", fileName.c_str());
+ return true;
+ }
+
+ const bool isSol = detectSolAudio(stream);
+ const bool isWave = !isSol && detectWaveAudio(stream);
+ const bool isRaw = !isSol && !isWave;
+
+ if (isSol || isRaw) {
+ uint16 sampleRate = 11025;
+ int numChannels = 1;
+ int bytesPerSample = 1;
+ bool sourceIs8Bit = true;
+ uint32 compressedSize;
+ uint32 decompressedSize;
+
+ if (isSol) {
+ stream.seek(6, SEEK_SET);
+ sampleRate = stream.readUint16LE();
+ const byte flags = stream.readByte();
+ compressedSize = stream.readUint32LE();
+
+ // All AudioStreams must output 16-bit samples
+ bytesPerSample = 2;
+ decompressedSize = compressedSize * bytesPerSample;
+
+ if (flags & kCompressed) {
+ decompressedSize *= 2;
+ }
+ if (flags & k16Bit) {
+ sourceIs8Bit = false;
+ }
+ if (flags & kStereo) {
+ numChannels = 2;
+ }
+ } else {
+ decompressedSize = resource->size();
+ }
+
+ enum {
+ kWaveHeaderSize = 36
+ };
+
+ outFile.writeString("RIFF");
+ outFile.writeUint32LE(kWaveHeaderSize + decompressedSize);
+ outFile.writeString("WAVEfmt ");
+ outFile.writeUint32LE(16);
+ outFile.writeUint16LE(1);
+ outFile.writeUint16LE(numChannels);
+ outFile.writeUint32LE(sampleRate);
+ outFile.writeUint32LE(sampleRate * bytesPerSample * numChannels);
+ outFile.writeUint16LE(bytesPerSample * numChannels);
+ outFile.writeUint16LE(bytesPerSample * 8);
+ outFile.writeString("data");
+ outFile.writeUint32LE(decompressedSize);
+
+ if (isSol) {
+ stream.seek(0, SEEK_SET);
+ Common::ScopedPtr<Audio::SeekableAudioStream> audioStream(makeSOLStream(&stream, DisposeAfterUse::NO));
+
+ if (!audioStream) {
+ debugPrintf("Could not create SOL stream.\n");
+ return true;
+ }
+
+ byte buffer[4096];
+ const int samplesToRead = ARRAYSIZE(buffer) / 2;
+ uint bytesWritten = 0;
+ int samplesRead;
+ while ((samplesRead = audioStream->readBuffer((int16 *)buffer, samplesToRead))) {
+ uint bytesToWrite = samplesRead * bytesPerSample;
+ outFile.write(buffer, bytesToWrite);
+ bytesWritten += bytesToWrite;
+ }
+
+ if (bytesWritten != decompressedSize) {
+ debugPrintf("WARNING: Should have written %u bytes but wrote %u bytes!\n", decompressedSize, bytesWritten);
+ while (bytesWritten < decompressedSize) {
+ outFile.writeByte(0);
+ ++bytesWritten;
+ }
+ }
+
+ const char *bits;
+ if (sourceIs8Bit) {
+ bits = "upconverted 16";
+ } else {
+ bits = "16";
+ }
+
+ debugPrintf("%s-bit %uHz %d-channel SOL audio, %u -> %u bytes\n", bits, sampleRate, numChannels, compressedSize, decompressedSize);
+ } else {
+ outFile.write(resource->data(), resource->size());
+ debugPrintf("%d-bit %uHz %d-channel raw audio, %u bytes\n", bytesPerSample * 8, sampleRate, numChannels, decompressedSize);
+ }
+ } else if (isWave) {
+ outFile.write(resource->data(), resource->size());
+ debugPrintf("Raw wave file\n");
+ } else {
+ error("Impossible situation");
+ }
+
+ debugPrintf("Written to %s successfully.\n", fileName.c_str());
+#else
+ debugPrintf("SCI32 isn't included in this compiled executable\n");
+#endif
+ return true;
+}
+
bool Console::cmdSaveGame(int argc, const char **argv) {
if (argc != 2) {
debugPrintf("Saves the current game state to the hard disk\n");
diff --git a/engines/sci/console.h b/engines/sci/console.h
index 3cc19ad..d5b80b6 100644
--- a/engines/sci/console.h
+++ b/engines/sci/console.h
@@ -122,6 +122,7 @@ private:
bool cmdShowInstruments(int argc, const char **argv);
bool cmdMapInstrument(int argc, const char **argv);
bool cmdAudioList(int argc, const char **argv);
+ bool cmdAudioDump(int argc, const char **argv);
// Script
bool cmdAddresses(int argc, const char **argv);
bool cmdRegisters(int argc, const char **argv);
diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp
index 1b521cd..2f30f7d 100644
--- a/engines/sci/sound/audio32.cpp
+++ b/engines/sci/sound/audio32.cpp
@@ -46,6 +46,46 @@
namespace Sci {
+bool detectSolAudio(Common::SeekableReadStream &stream) {
+ const size_t initialPosition = stream.pos();
+
+ byte header[6];
+ if (stream.read(header, sizeof(header)) != sizeof(header)) {
+ stream.seek(initialPosition);
+ return false;
+ }
+
+ stream.seek(initialPosition);
+
+ if ((header[0] & 0x7f) != kResourceTypeAudio || READ_BE_UINT32(header + 2) != MKTAG('S', 'O', 'L', 0)) {
+ return false;
+ }
+
+ return true;
+}
+
+bool detectWaveAudio(Common::SeekableReadStream &stream) {
+ const size_t initialPosition = stream.pos();
+
+ byte blockHeader[8];
+ if (stream.read(blockHeader, sizeof(blockHeader)) != sizeof(blockHeader)) {
+ stream.seek(initialPosition);
+ return false;
+ }
+
+ stream.seek(initialPosition);
+ const uint32 headerType = READ_BE_UINT32(blockHeader);
+
+ if (headerType != MKTAG('R', 'I', 'F', 'F')) {
+ return false;
+ }
+
+ return true;
+}
+
+#pragma mark -
+#pragma mark MutableLoopAudioStream
+
class MutableLoopAudioStream : public Audio::AudioStream {
public:
MutableLoopAudioStream(Audio::RewindableAudioStream *stream, const bool loop_, const DisposeAfterUse::Flag dispose = DisposeAfterUse::YES) :
@@ -105,43 +145,6 @@ private:
bool _loop;
};
-bool detectSolAudio(Common::SeekableReadStream &stream) {
- const size_t initialPosition = stream.pos();
-
- byte header[6];
- if (stream.read(header, sizeof(header)) != sizeof(header)) {
- stream.seek(initialPosition);
- return false;
- }
-
- stream.seek(initialPosition);
-
- if ((header[0] & 0x7f) != kResourceTypeAudio || READ_BE_UINT32(header + 2) != MKTAG('S', 'O', 'L', 0)) {
- return false;
- }
-
- return true;
-}
-
-bool detectWaveAudio(Common::SeekableReadStream &stream) {
- const size_t initialPosition = stream.pos();
-
- byte blockHeader[8];
- if (stream.read(blockHeader, sizeof(blockHeader)) != sizeof(blockHeader)) {
- stream.seek(initialPosition);
- return false;
- }
-
- stream.seek(initialPosition);
- const uint32 headerType = READ_BE_UINT32(blockHeader);
-
- if (headerType != MKTAG('R', 'I', 'F', 'F')) {
- return false;
- }
-
- return true;
-}
-
#pragma mark -
Audio32::Audio32(ResourceManager *resMan) :
diff --git a/engines/sci/sound/audio32.h b/engines/sci/sound/audio32.h
index a994113e..8b8ec2a 100644
--- a/engines/sci/sound/audio32.h
+++ b/engines/sci/sound/audio32.h
@@ -35,6 +35,9 @@
namespace Sci {
class Console;
+bool detectSolAudio(Common::SeekableReadStream &stream);
+bool detectWaveAudio(Common::SeekableReadStream &stream);
+
#pragma mark AudioChannel
/**
@@ -130,6 +133,8 @@ struct AudioChannel {
int pan;
};
+#pragma mark -
+
/**
* Special audio channel indexes used to select a channel
* for digital audio playback.
Commit: eba9526fdda389d3f82ccd01a845e6e3aed42799
https://github.com/scummvm/scummvm/commit/eba9526fdda389d3f82ccd01a845e6e3aed42799
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:30-05:00
Commit Message:
SCI32: Remove never-read default values
Changed paths:
engines/sci/engine/kscripts.cpp
engines/sci/video/robot_decoder.cpp
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 5a33023..8fd05a7 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -158,7 +158,7 @@ reg_t kResCheck(EngineState *s, int argc, reg_t *argv) {
// GK2 stores some VMDs inside of resource volumes, but usually videos are
// streamed from the filesystem.
if (res == nullptr) {
- const char *format = nullptr;
+ const char *format;
switch (restype) {
case kResourceTypeRobot:
format = "%u.rbt";
diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp
index c0b5ee5..7eaa5cf 100644
--- a/engines/sci/video/robot_decoder.cpp
+++ b/engines/sci/video/robot_decoder.cpp
@@ -1509,7 +1509,7 @@ uint32 RobotDecoder::createCel5(const byte *rawVideoData, const int16 screenItem
assert(bitmap.getHunkPaletteOffset() == (uint32)bitmap.getWidth() * bitmap.getHeight() + SciBitmap::getBitmapHeaderSize());
bitmap.setOrigin(origin);
- byte *targetBuffer = nullptr;
+ byte *targetBuffer;
if (_verticalScaleFactor == 100) {
// direct copy to bitmap
targetBuffer = bitmap.getPixels();
Commit: d363234129484733c55f961215bcb1343d84392e
https://github.com/scummvm/scummvm/commit/d363234129484733c55f961215bcb1343d84392e
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:30-05:00
Commit Message:
SCI32: Fix GfxFrameout::addPlane from causing possible leaks
Changed paths:
engines/sci/graphics/controls32.cpp
engines/sci/graphics/frameout.cpp
engines/sci/graphics/frameout.h
engines/sci/graphics/video32.cpp
diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp
index 7080c10..77dfdc2 100644
--- a/engines/sci/graphics/controls32.cpp
+++ b/engines/sci/graphics/controls32.cpp
@@ -128,7 +128,7 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) {
Plane *plane = new Plane(editorPlaneRect, kPlanePicTransparent);
plane->changePic();
- g_sci->_gfxFrameout->addPlane(*plane);
+ g_sci->_gfxFrameout->addPlane(plane);
CelInfo32 celInfo;
celInfo.type = kCelTypeMem;
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 9a7bfc8..d3e08bf 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -275,7 +275,7 @@ void GfxFrameout::kernelAddPlane(const reg_t object) {
updatePlane(*plane);
} else {
plane = new Plane(object);
- addPlane(*plane);
+ addPlane(plane);
}
}
@@ -351,17 +351,17 @@ int16 GfxFrameout::kernelGetHighPlanePri() {
return _planes.getTopSciPlanePriority();
}
-void GfxFrameout::addPlane(Plane &plane) {
- if (_planes.findByObject(plane._object) == nullptr) {
- plane.clipScreenRect(_screenRect);
- _planes.add(&plane);
- } else {
- plane._deleted = 0;
- if (plane._created == 0) {
- plane._moved = g_sci->_gfxFrameout->getScreenCount();
- }
- _planes.sort();
+void GfxFrameout::addPlane(Plane *plane) {
+ // In SSCI, if a plane with the same object ID already existed, this call
+ // would cancel deletion and update an already-existing plane, but callers
+ // expect the passed plane object to become memory-managed by GfxFrameout,
+ // so doing what SSCI did would end up leaking the Plane objects
+ if (_planes.findByObject(plane->_object) != nullptr) {
+ error("Plane %04x:%04x already exists", PRINT_REG(plane->_object));
}
+
+ plane->clipScreenRect(_screenRect);
+ _planes.add(plane);
}
void GfxFrameout::updatePlane(Plane &plane) {
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index ddaa17c..cd48c78 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -120,15 +120,13 @@ private:
public:
/**
- * Creates and adds a new plane to the plane list, or
- * cancels deletion and updates an already-existing
- * plane if a plane matching the given plane VM object
- * already exists within the current plane list.
+ * Creates and adds a new plane to the plane list. Ownership of the passed
+ * object is transferred to GfxFrameout.
*
* @note This method is on Screen in SCI engine, but it
* is only ever called on `GraphicsMgr.screen`.
*/
- void addPlane(Plane &plane);
+ void addPlane(Plane *plane);
/**
* Deletes a plane within the current plane list.
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index 301092b..91e4861 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -696,7 +696,7 @@ VMDPlayer::EventFlags VMDPlayer::playUntilEvent(const EventFlags flags, const ui
if (!_blackoutRect.isEmpty() && _planeIsOwned) {
_blackoutPlane = new Plane(_blackoutRect);
- g_sci->_gfxFrameout->addPlane(*_blackoutPlane);
+ g_sci->_gfxFrameout->addPlane(_blackoutPlane);
}
if (shouldUseCompositing()) {
@@ -897,7 +897,7 @@ void VMDPlayer::initComposited() {
if (_priority) {
_plane->_priority = _priority;
}
- g_sci->_gfxFrameout->addPlane(*_plane);
+ g_sci->_gfxFrameout->addPlane(_plane);
_screenItem = new ScreenItem(_plane->_object, vmdCelInfo, Common::Point(), vmdScaleInfo);
} else {
_screenItem = new ScreenItem(_plane->_object, vmdCelInfo, Common::Point(_drawRect.left, _drawRect.top), vmdScaleInfo);
@@ -1040,7 +1040,7 @@ void DuckPlayer::open(const GuiResourceId resourceId, const int displayMode, con
if (_doFrameOut) {
_plane = new Plane(_drawRect, kPlanePicColored);
- g_sci->_gfxFrameout->addPlane(*_plane);
+ g_sci->_gfxFrameout->addPlane(_plane);
g_sci->_gfxFrameout->frameOut(true);
}
Commit: 682b8790fd24449286a5a5dc8332c7c7570164b6
https://github.com/scummvm/scummvm/commit/682b8790fd24449286a5a5dc8332c7c7570164b6
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:30-05:00
Commit Message:
SCI: Allow multi-step tracing with step-over in debugger
Changed paths:
engines/sci/console.cpp
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 4c4dfb3..97a6164 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -3479,9 +3479,7 @@ bool Console::cmdTrace(int argc, const char **argv) {
bool Console::cmdStepOver(int argc, const char **argv) {
_debugState.seeking = kDebugSeekStepOver;
_debugState.seekLevel = _engine->_gamestate->_executionStack.size();
- _debugState.debugging = true;
-
- return cmdExit(0, 0);
+ return cmdTrace(argc, argv);
}
bool Console::cmdStepEvent(int argc, const char **argv) {
Commit: 6af5133061997093a4470931b84124ecf22ddd7a
https://github.com/scummvm/scummvm/commit/6af5133061997093a4470931b84124ecf22ddd7a
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:30-05:00
Commit Message:
SCI32: Put superclass address in r_acc for SCI3 super calls
This fixes a problem in Lighthouse 2.0a where the mini-sub would
fail to start playing the animation of the shipwreck when clicking
on the throttle.
In SSCI, in SCI3 only, r_acc was (inadvertently?) set to the
superclass object ID whenever a super call was made. This happened
because OP_super would call to get the superclass object ID, the
calling conventions of the compiler put this return value into EAX,
and then the PMachine message processing code put whatever was in
EAX into r_acc before each message was processed.
In the game code, there are a sequence of steps that look like
this:
* First, throttle::doVerb is called when throttle is clicked on;
* Which calls getRobot::doit to tell the shipwreck robot to start
playing;
* Which calls wreckBot::init to reset the Robot for the animation;
* Which calls Hiliter::hotVerbs(0) to remove cursor hotspots;
* Which calls Hiliter::dispose to clean up since it is not used;
* Which causes Hiliter::verbList to get set to 0.
* Later, verbList is loaded into r_acc, and it is still 0;
* Then, Hiliter::dispose makes a super call to Obj::dispose;
* Then, Obj::dispose does nothing except call kDisposeClone,
which does not mutate r_acc, so r_acc is still 0 from verbList;
* Then we return back through 5 calls to throttle::doVerb;
* Then throttle::doVerb checks that r_acc is non-zero, and if so,
adds wreckBot to theDoits global, allowing the animation to
occur.
In ScummVM, without setting r_acc in the super call, the non-zero
check failed and the wreckBot didn't get put into theDoits, so the
entire sequence fell apart. In SSCI, the non-zero check happened
to succeed because the Obj::dispose super call put the Obj class
into the accumulator. So now we do that too, and now Lighthouse
2.0a works here.
Earlier versions of SSCI used EAX for other things in between the
OP_super call and the message processing, so would set r_acc from
different data, so this change does not apply to those versions.
Changed paths:
engines/sci/engine/vm.cpp
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index b169e0e..785f92b 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -1056,6 +1056,14 @@ void run_vm(EngineState *s) {
if (!r_temp.isPointer())
error("[VM]: Invalid superclass in object");
else {
+ // SCI3 sets r_acc to whatever was in EAX at the start of a
+ // send. In the case of a super call this is the object ID of
+ // the superclass, as determined by the interpreter, rather than
+ // by the game scripts
+ if (getSciVersion() == SCI_VERSION_3) {
+ s->r_acc = r_temp;
+ }
+
s_temp = s->xs->sp;
s->xs->sp -= ((opparams[1] >> 1) + s->r_rest); // Adjust stack
Commit: 2dc042d540da8285fc1ecd47c3da888b6c071acf
https://github.com/scummvm/scummvm/commit/2dc042d540da8285fc1ecd47c3da888b6c071acf
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T19:54:30-05:00
Commit Message:
NEWS: Extend SCI game versions to reflect SCI3 being supported
Changed paths:
NEWS
diff --git a/NEWS b/NEWS
index fd7092f..7ed09c3 100644
--- a/NEWS
+++ b/NEWS
@@ -12,7 +12,7 @@ For a more comprehensive changelog of the latest experimental code, see:
- Added support for Starship Titanic.
- New Games (Sierra SCI2 - SCI2.1):
+ New Games (Sierra SCI2 - SCI3):
- Added support for Gabriel Knight.
- Added support for Gabriel Knight 2.
- Added support for King's Quest VII.
Commit: 52d9d049195d99ffe6215716915fc0769a3bc3c7
https://github.com/scummvm/scummvm/commit/52d9d049195d99ffe6215716915fc0769a3bc3c7
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T20:00:28-05:00
Commit Message:
SCI32: Fix inconsistent patch instruction comments
I missed these lines when going through things earlier.
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index c2f041a..a5d2a67 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -4417,14 +4417,14 @@ static const uint16 pq4CdSpeechAndSubtitlesPatch[] = {
// iconText::select
PATCH_ADDTOOFFSET(+10), // skip over the super code
- 0xc1, 0x5a, // plusag 5Ah (increase 5Ah by one)
- 0xa1, 0x5a, // sag 5Ah (save)
+ 0xc1, 0x5a, // +ag $5a
+ 0xa1, 0x5a, // sag $5a
0x36, // push
- 0x35, 0x04, // ldi 04
+ 0x35, 0x04, // ldi 4
0x28, // uge?
0x31, 0x03, // bnt [skip over follow up code]
0x78, // push1
- 0xa9, 0x5a, // ssg 5Ah (save)
+ 0xa9, 0x5a, // ssg $5a
0x76, // push0
0x41, 0x99, PATCH_UINT16(0x00), // call [our new subroutine which sets view+loop+cel, effectively -103], 0
0x33, 0x2f, // jmp [to end of original select, show call]
Commit: 9fc24ed0b068723d7ce41868f075e481154197c4
https://github.com/scummvm/scummvm/commit/9fc24ed0b068723d7ce41868f075e481154197c4
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-19T20:00:28-05:00
Commit Message:
SCI32: Support RAMA's single sound effects volume
The original installer copied RESOURCE.SFX to the hard drive so
there was only one RESOURCE.SFX on CD 1. Instead of requiring
users to create duplicates, just use the single RESOURCE.SFX if it
exists.
Changed paths:
engines/sci/resource.cpp
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index b73b14b..8d27231 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1926,7 +1926,11 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map) {
volumeName = "RESAUD.001";
}
} else if (resId.getNumber() == 65535) {
- volumeName = Common::String::format("RESSFX.%03d", mapVolumeNr);
+ if (g_sci->getGameId() == GID_RAMA && Common::File::exists("RESOURCE.SFX")) {
+ volumeName = "RESOURCE.SFX";
+ } else {
+ volumeName = Common::String::format("RESSFX.%03d", mapVolumeNr);
+ }
} else {
volumeName = Common::String::format("RESAUD.%03d", mapVolumeNr);
}
More information about the Scummvm-git-logs
mailing list