[Scummvm-git-logs] scummvm master -> 16fab2d480bfc586098778fef95ee0d1af66d8fd
bluegr
bluegr at gmail.com
Tue Aug 21 02:39:52 CEST 2018
This automated email contains information about 9 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f18711f3c2 SCI: Update comment
06079340ac SCI32: Add several workarounds for uninitialized reads in Hoyle 5
2877c22097 SCI: Add workaround for buggy script in Hoyle 3 Amiga
5684273ee1 SCI: Add support for text loading in Hoyle 3 Amiga
d529692a5a SCI: Enable detection entry for Hoyle 3 Amiga
89785ea804 SCI32: Add stub for kWinDLL - used in Hoyle 5
16aab5b281 SCI32: Add handling for config settings used in Hoyle 5
52ff27746f SCI32: Fix fade-in for some screens in Hoyle 5
16fab2d480 SCI32: Ignore invalid kernel call when toggling the music in Hoyle 5
Commit: f18711f3c21ef858efafde00df6e4ed908c118b0
https://github.com/scummvm/scummvm/commit/f18711f3c21ef858efafde00df6e4ed908c118b0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-21T03:36:03+03:00
Commit Message:
SCI: Update comment
Changed paths:
engines/sci/engine/script.cpp
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index c1da3f2..94c0c72 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -99,8 +99,7 @@ void Script::load(int script_nr, ResourceManager *resMan, ScriptPatcher *scriptP
// However, since we address the heap with a 16-bit pointer, the
// combined size of the stack and the heap must be 64KB. So far this has
// worked for SCI11, SCI2 and SCI21 games. SCI3 games use a different
- // script format, and theoretically they can exceed the 64KB boundary
- // using relocation.
+ // script format, and they can exceed the 64KB boundary using relocation.
Resource *heap = resMan->findResource(ResourceId(kResourceTypeHeap, script_nr), false);
bufSize += heap->size();
Commit: 06079340ac362b980e8ae9fc42626b44b3a07a06
https://github.com/scummvm/scummvm/commit/06079340ac362b980e8ae9fc42626b44b3a07a06
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-21T03:36:04+03:00
Commit Message:
SCI32: Add several workarounds for uninitialized reads in Hoyle 5
Changed paths:
engines/sci/engine/workarounds.cpp
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index b60aaa5..ab986f6 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -130,7 +130,6 @@ static const uint16 sig_uninitread_hoyle4_1[] = {
// Subroutine offset: 0x2fb2 (script 300)
// Applies to at least: English PC demo
static const uint16 sig_uninitread_hoyle5_1[] = {
-
0x7e, SIG_ADDTOOFFSET(2), // line N
0x7d, 0x68, 0x65, 0x61, 0x72,
0x74, 0x73, 0x2e, 0x73,
@@ -142,6 +141,55 @@ static const uint16 sig_uninitread_hoyle5_1[] = {
SIG_END
};
+// Game: Hoyle 5 (Solitaire)
+// Calling methods: roomScript::changeState, beleaguered_castle::init, strategy::init
+// Subroutine offsets: 0x25f4 (script 6001), 0x1d7a (script 6004), 0x239d (script 6002)
+// Applies to at least: English PC
+static const uint16 sig_uninitread_hoyle5_2[] = {
+ 0x7e, SIG_ADDTOOFFSET(2), // line N
+ 0x7d, SIG_ADDTOOFFSET(8),
+ 0x2e, 0x73, 0x63, 0x00, // file "calculat.sc" / "belcastl.sc" / "strategy.sc"
+ 0x3f, 0x02, // link 02
+ 0x7e, SIG_ADDTOOFFSET(2), // line N
+ 0x8d, 0x00, // lst temp[0]
+ 0x35, 0x00, // ldi 00
+ 0x1a, // eq?
+ SIG_END
+};
+
+// Game: Hoyle 5 (Solitaire)
+// Calling method: roomScript::changeState
+// Subroutine offset: 0x494a (script 6023)
+// Applies to at least: English PC
+static const uint16 sig_uninitread_hoyle5_3[] = {
+ 0x7e, SIG_ADDTOOFFSET(2), // line N
+ 0x7d, 0x67, 0x61, 0x70, 0x73,
+ 0x2e, 0x73, 0x63, 0x00, // file "gaps.sc"
+ 0x3f, 0x02, // link 02
+ 0x7e, SIG_ADDTOOFFSET(2), // line N
+ 0x8d, 0x00, // lst temp[0]
+ 0x35, 0x00, // ldi 00
+ 0x1a, // eq?
+ SIG_END
+};
+
+// Game: Hoyle 5 (Solitaire)
+// Calling method: roomScript::changeState
+// Subroutine offset: 0x2097 (script 6011)
+// Applies to at least: English PC
+static const uint16 sig_uninitread_hoyle5_4[] = {
+ 0x7e, SIG_ADDTOOFFSET(2), // line N
+ 0x7d, 0x6c, 0x61, 0x62, 0x65,
+ 0x6c, 0x6c, 0x65,
+ 0x2e, 0x73, 0x63, 0x00, // file "labelle.sc"
+ 0x3f, 0x02, // link 02
+ 0x7e, SIG_ADDTOOFFSET(2), // line N
+ 0x8d, 0x00, // lst temp[0]
+ 0x35, 0x00, // ldi 00
+ 0x1a, // eq?
+ SIG_END
+};
+
// Game: Jones in the fast lane
// Calling method: weekendText::draw
// Subroutine offset: 0x03d3 (script 232)
@@ -324,6 +372,17 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
{ GID_HOYLE5, -1, 64937, -1, NULL, "select", NULL, 7, 7, { WORKAROUND_FAKE, 0 } }, // clicking the "control" and "options" buttons in the icon bar
{ GID_HOYLE5, -1, 64937, -1, "IconBar", "handleEvent", NULL, 0, 0, { WORKAROUND_FAKE, 0 } }, // clicking on any button in the icon bar
{ GID_HOYLE5, 300, 300, 0, "", "export 2", sig_uninitread_hoyle5_1, 0, 0, { WORKAROUND_FAKE, 0 } }, // after passing around cards in hearts
+ { GID_HOYLE5, 400, 400, 1, "GinHand", "calcRuns", NULL, 4, 4, { WORKAROUND_FAKE, 0 } }, // when starting Gin
+ { GID_HOYLE5, 1100, 1100, 0, "anteButton", "handleEvent", NULL, 1, 1, { WORKAROUND_FAKE, 0 } }, // when exiting Poker
+ { GID_HOYLE5, 6029, 6029, 1, "ControlIcon", "select", NULL, 1, 1, { WORKAROUND_FAKE, 0 } }, // Solitaire: when changing any slider in the Card Flip mini-game's options window
+ { GID_HOYLE5, -1, 6000, 1, "sHand", "handleEvent", NULL, 4, 4, { WORKAROUND_FAKE, 0 } }, // Solitaire: when clicking on an empty card base in any game
+ { GID_HOYLE5, 6001, 6001, 0, "roomScript", "changeState", sig_uninitread_hoyle5_2, 0, 0, { WORKAROUND_FAKE, 0 } }, // Solitaire: when starting Calculation
+ { GID_HOYLE5, 6004, 6004, 0, "roomScript", "changeState", sig_uninitread_hoyle5_2, 0, 0, { WORKAROUND_FAKE, 0 } }, // Solitaire: when starting Beleaguered Castle
+ { GID_HOYLE5, 6004, 6004, 0, "beleaguered_castle", "init", sig_uninitread_hoyle5_2, 0, 0, { WORKAROUND_FAKE, 0 } }, // Solitaire: when starting Beleaguered Castle
+ { GID_HOYLE5, 6023, 6023, 0, "roomScript", "changeState", sig_uninitread_hoyle5_3, 0, 0, { WORKAROUND_FAKE, 0 } }, // Solitaire: when starting Gaps
+ { GID_HOYLE5, 6011, 6011, 0, "roomScript", "changeState", sig_uninitread_hoyle5_4, 0, 0, { WORKAROUND_FAKE, 0 } }, // Solitaire: when starting La Belle Lucie
+ { GID_HOYLE5, 6002, 6002, 0, "roomScript", "changeState", sig_uninitread_hoyle5_2, 0, 0, { WORKAROUND_FAKE, 0 } }, // Solitaire: when starting Strategy
+ { GID_HOYLE5, 6002, 6002, 0, "strategy", "init", sig_uninitread_hoyle5_2, 0, 0, { WORKAROUND_FAKE, 0 } }, // Solitaire: when starting Strategy
{ GID_ISLANDBRAIN, 100, 937, 0, "IconBar", "dispatchEvent", NULL, 58, 58, { WORKAROUND_FAKE, 0 } }, // when using ENTER at the startup menu - bug #5241
{ GID_ISLANDBRAIN, 140, 140, 0, "piece", "init", NULL, 3, 3, { WORKAROUND_FAKE, 1 } }, // first puzzle right at the start, some initialization variable. bnt is done on it, and it should be non-0
{ GID_ISLANDBRAIN, 180, 190, 0, "word", "dispatchEvent", NULL, 14, 15, { WORKAROUND_FAKE, 0 } }, // holding down enter key during the word search puzzle, temps 14 and 15
Commit: 2877c2209794633cf45894adbf786806fb0fe629
https://github.com/scummvm/scummvm/commit/2877c2209794633cf45894adbf786806fb0fe629
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-21T03:36:04+03:00
Commit Message:
SCI: Add workaround for buggy script in Hoyle 3 Amiga
Changed paths:
engines/sci/engine/kscripts.cpp
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 8fd05a7..26dbe9b 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -282,9 +282,13 @@ reg_t kScriptID(EngineState *s, int argc, reg_t *argv) {
return NULL_REG;
}
+ // WORKAROUND: Avoid referencing invalid export 0 in script 601 (Snakes & Ladders) in Hoyle 3 Amiga
+ if (g_sci->getGameId() == GID_HOYLE3 && g_sci->getPlatform() == Common::kPlatformAmiga && script == 601 && argc == 1)
+ return NULL_REG;
+
const uint32 address = scr->validateExportFunc(index, true) + scr->getHeapOffset();
- // Bugfix for the intro speed in PQ2 version 1.002.011.
+ // WORKAROUND: Bugfix for the intro speed in PQ2 version 1.002.011.
// This is taken from the patch by NewRisingSun(NRS) / Belzorash. Global 3
// is used for timing during the intro, and in the problematic version it's
// initialized to 0, whereas it's 6 in other versions. Thus, we assign it
Commit: 5684273ee11d973b1f1ed3a3a51571bb5e3dcaaa
https://github.com/scummvm/scummvm/commit/5684273ee11d973b1f1ed3a3a51571bb5e3dcaaa
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-21T03:36:05+03:00
Commit Message:
SCI: Add support for text loading in Hoyle 3 Amiga
Changed paths:
engines/sci/engine/kernel.cpp
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index fd64198..e828db6 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -880,7 +880,20 @@ Common::String Kernel::lookupText(reg_t address, int index) {
if (address.getSegment())
return _segMan->getString(address);
- Resource *textres = _resMan->findResource(ResourceId(kResourceTypeText, address.getOffset()), false);
+ ResourceId resourceId = ResourceId(kResourceTypeText, address.getOffset());
+ if (g_sci->getGameId() == GID_HOYLE3 && g_sci->getPlatform() == Common::kPlatformAmiga) {
+ // WORKAROUND: In the Amiga version of Hoyle 3, texts are stored as
+ // either text, font or palette types. Seems like the resource type
+ // bits are used as part of the resource numbers. This is the same
+ // as the workaround used in GfxFontFromResource()
+ resourceId = ResourceId(kResourceTypeText, address.getOffset() & 0x7FF);
+ if (!_resMan->testResource(resourceId))
+ resourceId = ResourceId(kResourceTypeFont, address.getOffset() & 0x7FF);
+ if (!_resMan->testResource(resourceId))
+ resourceId = ResourceId(kResourceTypePalette, address.getOffset() & 0x7FF);
+ }
+
+ Resource *textres = _resMan->findResource(resourceId, false);
if (!textres) {
error("text.%03d not found", address.getOffset());
Commit: d529692a5afff61313482742060b00d000814b5c
https://github.com/scummvm/scummvm/commit/d529692a5afff61313482742060b00d000814b5c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-21T03:36:05+03:00
Commit Message:
SCI: Enable detection entry for Hoyle 3 Amiga
The game works correctly now
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 96e05d3..08625dd 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1077,7 +1077,6 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
-#if 0 // TODO: unknown if these files are corrupt
// Hoyle 3 - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.005.000"
// SCI interpreter version 1.000.510
@@ -1087,7 +1086,6 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "143df8aef214a2db34c2d48190742012", 632273},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
-#endif
// Hoyle 3 - English DOS Non-Interactive Demo
// Executable scanning reports "x.yyy.zzz"
Commit: 89785ea804819b554106420a8f105cf27581903f
https://github.com/scummvm/scummvm/commit/89785ea804819b554106420a8f105cf27581903f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-21T03:36:06+03:00
Commit Message:
SCI32: Add stub for kWinDLL - used in Hoyle 5
Changed paths:
engines/sci/engine/kernel.h
engines/sci/engine/kernel_tables.h
engines/sci/engine/kmisc.cpp
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 5ab9abe..404aa5a 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -643,6 +643,8 @@ reg_t kAddLine(EngineState *s, int argc, reg_t *argv);
reg_t kUpdateLine(EngineState *s, int argc, reg_t *argv);
reg_t kDeleteLine(EngineState *s, int argc, reg_t *argv);
+reg_t kWinDLL(EngineState *s, int argc, reg_t *argv);
+
#ifdef ENABLE_SCI32_MAC
// Phantasmagoria Mac Special Kernel Function
reg_t kDoSoundPhantasmagoriaMac(EngineState *s, int argc, reg_t *argv);
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index b60d6cc..74c50cd 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -1010,7 +1010,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_DUMMY(Table), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_DUMMY(LoadChunk), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_DUMMY(Priority), SIG_EVERYWHERE, "(.*)", NULL, NULL },
- { MAP_DUMMY(WinDLL), SIG_EVERYWHERE, "(.*)", NULL, NULL },
+ { MAP_CALL(WinDLL), SIG_SINCE_SCI21MID, SIGFOR_ALL, "ir(r)", NULL, NULL },
{ MAP_DUMMY(DeletePic), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_DUMMY(GetSierraProfileString), SIG_EVERYWHERE, "(.*)", NULL, NULL },
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 49d2d9f..277abd5 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -678,6 +678,38 @@ reg_t kWebConnect(EngineState *s, int argc, reg_t *argv) {
reg_t kWinExec(EngineState *s, int argc, reg_t *argv) {
return NULL_REG;
}
+
+extern void showScummVMDialog(const Common::String &message);
+
+reg_t kWinDLL(EngineState *s, int argc, reg_t *argv) {
+ uint16 operation = argv[0].toUint16();
+ Common::String dllName = s->_segMan->getString(argv[1]);
+
+ switch (operation) {
+ case 0: // load DLL
+ // This is originally a call to LoadLibrary() and to the Watcom function GetIndirectFunctionHandle
+ return make_reg(0, 1000); // fake ID for loaded DLL, normally returned from Windows LoadLibrary()
+ case 1: // free DLL
+ // In the original, FreeLibrary() was called here for the loaded DLL
+ return TRUE_REG;
+ case 2: // call DLL function
+ if (dllName == "PENGIN16.DLL") {
+ // Poker engine logic for Hoyle 5
+ // This is originally a call to the Watcom function InvokeIndirectFunction()
+ // TODO: we need to reverse the logic in PENGIN16.DLL and call it directly
+ //SciArray *data = s->_segMan->lookupArray(argv[2]);
+ warning("The Poker game logic has not been implemented yet");
+ showScummVMDialog("The Poker game logic has not been implemented yet");
+ return NULL_REG;
+ } else {
+ error("kWinDLL: Unknown DLL to invoke: %s", dllName.c_str());
+ return NULL_REG;
+ }
+ default:
+ return NULL_REG;
+ }
+}
+
#endif
reg_t kEmpty(EngineState *s, int argc, reg_t *argv) {
Commit: 16aab5b2817e3d5f1be45124b12f32fd468d3c79
https://github.com/scummvm/scummvm/commit/16aab5b2817e3d5f1be45124b12f32fd468d3c79
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-21T03:36:06+03:00
Commit Message:
SCI32: Add handling for config settings used in Hoyle 5
Changed paths:
engines/sci/engine/kmisc.cpp
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 277abd5..db2b310 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -422,6 +422,12 @@ reg_t kGetConfig(EngineState *s, int argc, reg_t *argv) {
} else if (setting == "jumpto") {
// Hoyle 5 startup.
s->_segMan->strcpy(data, "");
+ } else if (setting == "klonchtsee") {
+ // Hoyle 5 - starting Solitaire.
+ s->_segMan->strcpy(data, "");
+ } else if (setting == "klonchtarr") {
+ // Hoyle 5 - starting Solitaire.
+ s->_segMan->strcpy(data, "");
} else if (setting == "deflang") {
// MGDX 4-language startup.
s->_segMan->strcpy(data, "");
Commit: 52ff27746fd85711d9d1dd4b2772feb8a153ffd5
https://github.com/scummvm/scummvm/commit/52ff27746fd85711d9d1dd4b2772feb8a153ffd5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-21T03:36:07+03:00
Commit Message:
SCI32: Fix fade-in for some screens in Hoyle 5
Changed paths:
engines/sci/graphics/transitions32.cpp
diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp
index 43479a2..cb48927 100644
--- a/engines/sci/graphics/transitions32.cpp
+++ b/engines/sci/graphics/transitions32.cpp
@@ -244,7 +244,19 @@ void GfxTransitions32::kernelSetShowStyle(const uint16 argc, const reg_t planeOb
deleteShowStyle(findIteratorForPlane(planeObj));
}
- return;
+ // Do not add kShowStyleNone types to the showStyles list.
+ //
+ // HACK: Hoyle 5 does a fade out in some screens, and then makes a
+ // kShowStyleNone call to enter the new screen, without a fade in,
+ // thus leaving the whole screen black. By removing ths return,
+ // the code for queuing the kShowStyleNone calls is enabled, and this
+ // wrong behavior is fixed, as the screen palette is restored in the
+ // processNone() call inside processShowStyle(). I wasn't able to find
+ // any other notable difference in the graphics code of the Hoyle 5
+ // interpreter, and disabling this return has no other ill effects for
+ // this game, so this will suffice for now.
+ if (g_sci->getGameId() != GID_HOYLE5)
+ return;
}
if (createNewEntry) {
Commit: 16fab2d480bfc586098778fef95ee0d1af66d8fd
https://github.com/scummvm/scummvm/commit/16fab2d480bfc586098778fef95ee0d1af66d8fd
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-21T03:36:07+03:00
Commit Message:
SCI32: Ignore invalid kernel call when toggling the music in Hoyle 5
Changed paths:
engines/sci/sound/soundcmd.cpp
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 54fdcf5..7012746 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -634,6 +634,12 @@ reg_t SoundCommandParser::kDoSoundSendMidi(EngineState *s, int argc, reg_t *argv
uint16 controller = (argc == 5) ? argv[3].toUint16() : argv[2].toUint16();
uint16 param = (argc == 5) ? argv[4].toUint16() : argv[3].toUint16();
+ // This call is made in Hoyle 5 when toggling the music from the main menu.
+ // Ignore it for this game, since it doesn't use MIDI audio, and this call
+ // looks to be a leftover in Sound::mute (script 64989).
+ if (g_sci->getGameId() == GID_HOYLE5)
+ return s->r_acc;
+
if (argc == 4 && controller == 0xFF) {
midiCmd = 0xE0; // 0xE0: pitch wheel
uint16 pitch = CLIP<uint16>(argv[3].toSint16() + 0x2000, 0x0000, 0x3FFF);
More information about the Scummvm-git-logs
mailing list