[Scummvm-git-logs] scummvm master -> f1d4ff65599f117c2dc9f532599682101df57c04
sluicebox
22204938+sluicebox at users.noreply.github.com
Wed Sep 30 01:45:34 UTC 2020
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ee553afb83 SCI: Re-add Betrayed Alliance 1.2 detection entry
b9f9733fdf SCI: Add fan game Soulshade Asylum detection entry
843dd302d7 SCI: Add support for fan library sciAudio 1.1
4b5260fc34 SCI: Fix volume slider bug in fan games
f1d4ff6559 SCI: Fix boundary checks when drawing font chars
Commit: ee553afb830f5e4ef402c8f906db55e51ddd50be
https://github.com/scummvm/scummvm/commit/ee553afb830f5e4ef402c8f906db55e51ddd50be
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-09-29T18:06:54-07:00
Commit Message:
SCI: Re-add Betrayed Alliance 1.2 detection entry
Mistakenly removed in 00f41300898e907c04512dfc65ce7f3ab3992b7b,
these were not the incorrect hashes reported in ticket 11714.
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index e99ef43436..9f0387b717 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -5548,7 +5548,8 @@ static const struct ADGameDescription SciGameDescriptions[] = {
FANMADE("Aquarius: An Aquatic Experience", "2e23bc3b82f22a454be202ea593fb478", 480, "01555c8de683d25405bda270aa1ff014", 272372),
FANMADE("Betrayed Alliance 1.0", "b1f43f496a83cb8503f290a838b26242", 4062, "e637255aae6191ee92b9e843ad276288", 2367197),
FANMADE("Betrayed Alliance 1.1", "bb776e42e93f8b98006d6481fb73a588", 4080, "ad7bcfa11f914f23ddbe32723700391e", 2391020),
- FANMADE("Betrayed Alliance 1.2", "ade9f8124dae2e6aced8b5bfc0f54411", 4200, "4599d184348e8dfa99a1804f41966177", 2498493),
+ FANMADE("Betrayed Alliance 1.2", "ade9f8124dae2e6aced8b5bfc0f54411", 4200, "4599d184348e8dfa99a1804f41966177", 2498493), // original version
+ FANMADE("Betrayed Alliance 1.2", "30431334d821d23e584d6f4c0a3d5b61", 4206, "42e3a857f589eef8a8567b86b71f7fb9", 2503541), // "stealth updated" version
FANMADE("Bluntman and Chronic (Politically Correct Version)", "c3ef9fa6c7c5fb840078bf28d87c7f8b", 1362, "441636a9f6f86710844868fded868ee7", 596688),
FANMADE("Cascade Quest", "c94efc10d18c040b6e22a1dc6d3adfe1", 3468, "8ada33dfa945f81531e5508240b573de", 1432195),
FANMADE("Circus Quest", "35871f6b4e1df56af4113c0203a0b223", 630, "7d6f97d7935d8733f488d4cb74315e5b", 279627),
Commit: b9f9733fdf4bfe2b3513db849bb7a45d85bc8992
https://github.com/scummvm/scummvm/commit/b9f9733fdf4bfe2b3513db849bb7a45d85bc8992
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-09-29T18:36:37-07:00
Commit Message:
SCI: Add fan game Soulshade Asylum detection entry
Ticket 11552
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 9f0387b717..cda28eaea5 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -5586,6 +5586,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
FANMADE("SCI Studio Template 3.0", "ca0dc8d586e0a8670b7621cde090b532", 354, "58a48ee692a86c0575e6bd0b00a92b9a", 113097),
FANMADE("SCI Quest", "9067e1f1e54436d2dbfce855524bc84a", 552, "ffa7d355cd9223f245289108a696bcd2", 149634),
FANMADE("SCI-Man", "3ab85bd39a86c11f85781764f9db09bb", 468, "bb8f9992f504a242bf0860e3588e150b", 131810),
+ FANMADE("Soulshade Asylum", "965a07e7fb6fd9563b94c969b72cfe2a", 546, "57401d18559985e569085a69edda691e", 244786),
FANMADE("Text Views Demo", "ad0485a96470566517f184ff5dd049f8", 372, "727b946b37588ed334737732c55007c4", 115788),
FANMADE("The Black Cauldron Demo", "5e1ff2833c7f33ebcfa456ba836e2067", 2592, "2f8e6264d2db91bb54982ab8aa18b3b4", 1881839),
FANMADE("The Black Cauldron Final", "cbb4705f0cd73760996e5b27aae54f6a", 2484, "fc3bcaa7783b91bb78faefa345c6b3d9", 1677293),
Commit: 843dd302d721ad685eff6cfc3c3a1d7c1ef44908
https://github.com/scummvm/scummvm/commit/843dd302d721ad685eff6cfc3c3a1d7c1ef44908
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-09-29T18:36:37-07:00
Commit Message:
SCI: Add support for fan library sciAudio 1.1
Used by Soulshade Asylum
Changed paths:
engines/sci/sound/audio.cpp
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp
index 393c38724c..31d00e1dba 100644
--- a/engines/sci/sound/audio.cpp
+++ b/engines/sci/sound/audio.cpp
@@ -71,19 +71,49 @@ void AudioPlayer::handleFanmadeSciAudio(reg_t sciAudioObject, SegManager *segMan
// TODO: This is a bare bones implementation. Only the play/playx and stop commands
// are handled for now - the other commands haven't been observed in any fanmade game
// yet. All the volume related and fading functionality is currently missing.
-
Kernel *kernel = g_sci->getKernel();
+ // get the sciAudio command from the "command" selector.
+ // this property is a string in 1.0 and an integer in 1.1.
+ enum FanmadeSciAudioCommand {
+ kFanmadeSciAudioCommandNone = -1,
+ kFanmadeSciAudioCommandPlayX,
+ kFanmadeSciAudioCommandPlay,
+ kFanmadeSciAudioCommandStop
+ };
+ FanmadeSciAudioCommand sciAudioCommand = kFanmadeSciAudioCommandNone;
reg_t commandReg = readSelector(segMan, sciAudioObject, kernel->findSelector("command"));
- Common::String command = segMan->getString(commandReg);
+ Common::String commandString;
+ if (commandReg.isNumber()) {
+ // sciAudio 1.1
+ sciAudioCommand = (FanmadeSciAudioCommand)commandReg.toUint16();
+ } else {
+ // sciAudio 1.0
+ commandString = segMan->getString(commandReg);
+ if (commandString == "playx") {
+ sciAudioCommand = kFanmadeSciAudioCommandPlayX;
+ } else if (commandString == "play") {
+ sciAudioCommand = kFanmadeSciAudioCommandPlay;
+ } else if (commandString == "stop") {
+ sciAudioCommand = kFanmadeSciAudioCommandStop;
+ }
+ }
- if (command == "play" || command == "playx") {
+ if (sciAudioCommand == kFanmadeSciAudioCommandPlayX ||
+ sciAudioCommand == kFanmadeSciAudioCommandPlay) {
reg_t fileNameReg = readSelector(segMan, sciAudioObject, kernel->findSelector("fileName"));
Common::String fileName = segMan->getString(fileNameReg);
reg_t loopCountReg = readSelector(segMan, sciAudioObject, kernel->findSelector("loopCount"));
- Common::String loopCountStr = segMan->getString(loopCountReg);
- int16 loopCount = atoi(loopCountStr.c_str());
+ int16 loopCount;
+ if (loopCountReg.isNumber()) {
+ // sciAudio 1.1
+ loopCount = loopCountReg.toSint16();
+ } else {
+ // sciAudio 1.0
+ Common::String loopCountStr = segMan->getString(loopCountReg);
+ loopCount = atoi(loopCountStr.c_str());
+ }
// Adjust loopCount for ScummVM's LoopingAudioStream semantics
if (loopCount == -1) {
@@ -148,10 +178,14 @@ void AudioPlayer::handleFanmadeSciAudio(reg_t sciAudioObject, SegManager *segMan
// We only support one audio handle
_mixer->playStream(soundType, &_audioHandle,
Audio::makeLoopingAudioStream((Audio::RewindableAudioStream *)audioStream, loopCount));
- } else if (command == "stop") {
+ } else if (sciAudioCommand == kFanmadeSciAudioCommandStop) {
_mixer->stopHandle(_audioHandle);
} else {
- warning("Unhandled sciAudio command: %s", command.c_str());
+ if (commandReg.isNumber()) {
+ warning("Unhandled sciAudio command: %u", commandReg.getOffset());
+ } else {
+ warning("Unhandled sciAudio command: %s", commandString.c_str());
+ }
}
}
Commit: 4b5260fc346cc40aab447eb5def73cb3d8640aa5
https://github.com/scummvm/scummvm/commit/4b5260fc346cc40aab447eb5def73cb3d8640aa5
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-09-29T18:36:37-07:00
Commit Message:
SCI: Fix volume slider bug in fan games
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 2cc1627e20..00663a3509 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -1735,9 +1735,35 @@ static const uint16 fanmadePatchDemoQuestInfiniteLoop[] = {
PATCH_END
};
+// This patch is for a bug that first appeared in the LSL3 volume dialog and was
+// then copied into the templates included with SCI Studio and SCI Companion,
+// causing it to appear in fan games. See larry3SignatureVolumeSlider.
+//
+// Applies to: Fan games built with the SCI Studio / SCI Companion SCI0 template
+// Responsible method: TheMenuBar:handleEvent
+static const uint16 fangameSignatureVolumeSlider[] = {
+ 0x39, SIG_SELECTOR8(doit), // pushi doit
+ SIG_ADDTOOFFSET(+1), // push1 [ opcode 79 instead of 78 in some games ]
+ SIG_ADDTOOFFSET(+1), // push2 [ opcode 7b instead of 7a in some games ]
+ SIG_MAGICDWORD,
+ 0x39, 0x08, // pushi 08 [ volume ]
+ 0x8d, 0x03, // lst 03 [ uninitialized variable ]
+ 0x43, 0x31, 0x04, // callk DoSound 04 [ set volume and return previous ]
+ SIG_END
+};
+
+static const uint16 fangamePatchVolumeSlider[] = {
+ PATCH_ADDTOOFFSET(+3),
+ 0x39, 0x01, // pushi 01
+ 0x38, PATCH_UINT16(0x0008), // pushi 0008 [ volume ]
+ 0x43, 0x31, 0x02, // callk DoSound 02 [ return volume ]
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry fanmadeSignatures[] = {
{ true, 994, "Cascade Quest: fix auto-saving", 1, fanmadeSignatureCascadeQuestFixAutoSaving, fanmadePatchCascadeQuestFixAutoSaving },
+ { true, 997, "SCI Template: fix volume slider", 1, fangameSignatureVolumeSlider, fangamePatchVolumeSlider },
{ true, 999, "Demo Quest: infinite loop on typo", 1, fanmadeSignatureDemoQuestInfiniteLoop, fanmadePatchDemoQuestInfiniteLoop },
SCI_SIGNATUREENTRY_TERMINATOR
};
Commit: f1d4ff65599f117c2dc9f532599682101df57c04
https://github.com/scummvm/scummvm/commit/f1d4ff65599f117c2dc9f532599682101df57c04
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-09-29T18:39:08-07:00
Commit Message:
SCI: Fix boundary checks when drawing font chars
Adds boundary checks to handle characters with pixels that
are to the left or above the screen. This occurs in the fan
game Soulshade Asylum which draws a large window whose title
is above the screen and not meant to be seen. The window code
clips the rectangles but the text was drawn outside the buffer.
Fixes the existing boundary checks so that the correct pixels
are drawn when there's overlap with the right edge of the screen.
Changed paths:
engines/sci/graphics/scifont.cpp
diff --git a/engines/sci/graphics/scifont.cpp b/engines/sci/graphics/scifont.cpp
index 61fdb1e353..36599637a9 100644
--- a/engines/sci/graphics/scifont.cpp
+++ b/engines/sci/graphics/scifont.cpp
@@ -279,21 +279,27 @@ void GfxFontFromResource::draw(uint16 chr, int16 top, int16 left, byte color, bo
uint16 screenWidth = _screen->fontIsUpscaled() ? _screen->getDisplayWidth() : _screen->getWidth();
uint16 screenHeight = _screen->fontIsUpscaled() ? _screen->getDisplayHeight() : _screen->getHeight();
- int charWidth = MIN<int>(getCharWidth(chr), screenWidth - left);
- int charHeight = MIN<int>(getCharHeight(chr), screenHeight - top);
+ int charWidth = getCharWidth(chr);
+ int charHeight = getCharHeight(chr);
byte b = 0, mask = 0xFF;
- int y = 0;
int16 greyedTop = top;
SciSpan<const byte> charData = getCharData(chr);
- for (int i = 0; i < charHeight; i++, y++) {
+ for (int y = 0; y < charHeight; y++) {
if (greyedOutput)
mask = ((greyedTop++) % 2) ? 0xAA : 0x55;
- for (int done = 0; done < charWidth; done++) {
- if ((done & 7) == 0) // fetching next data byte
+ for (int x = 0; x < charWidth; x++) {
+ if ((x & 7) == 0) // fetching next data byte
b = *(charData++) & mask;
- if (b & 0x80) // if MSB is set - paint it
- _screen->putFontPixel(top, left + done, y, color);
+ if (b & 0x80) { // if MSB is set - paint it
+ int screenX = left + x;
+ int screenY = top + y;
+ if (0 <= screenX && screenX < screenWidth && 0 <= screenY && screenY < screenHeight) {
+ _screen->putFontPixel(top, screenX, y, color);
+ } else {
+ warning("%s glpyh %d drawn out of bounds: %d, %d", _resource->name().c_str(), chr, screenX, screenY);
+ }
+ }
b = b << 1;
}
}
@@ -309,22 +315,27 @@ void GfxFontFromResource::drawToBuffer(uint16 chr, int16 top, int16 left, byte c
return;
}
- int charWidth = MIN<int>(getCharWidth(chr), bufWidth - left);
- int charHeight = MIN<int>(getCharHeight(chr), bufHeight - top);
+ int charWidth = getCharWidth(chr);
+ int charHeight = getCharHeight(chr);
byte b = 0, mask = 0xFF;
- int y = 0;
int16 greyedTop = top;
SciSpan<const byte> charData = getCharData(chr);
- for (int i = 0; i < charHeight; i++, y++) {
+ for (int y = 0; y < charHeight; y++) {
if (greyedOutput)
mask = ((greyedTop++) % 2) ? 0xAA : 0x55;
- for (int done = 0; done < charWidth; done++) {
- if ((done & 7) == 0) // fetching next data byte
+ for (int x = 0; x < charWidth; x++) {
+ if ((x & 7) == 0) // fetching next data byte
b = *(charData++) & mask;
if (b & 0x80) { // if MSB is set - paint it
- int offset = (top + y) * bufWidth + (left + done);
- buffer[offset] = color;
+ int bufX = left + x;
+ int bufY = top + y;
+ if (0 <= bufX && bufX < bufWidth && 0 <= bufY && bufY < bufHeight) {
+ int offset = bufY * bufWidth + bufX;
+ buffer[offset] = color;
+ } else {
+ warning("%s glpyh %d drawn out of bounds: %d, %d", _resource->name().c_str(), chr, bufX, bufY);
+ }
}
b = b << 1;
}
More information about the Scummvm-git-logs
mailing list