aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2018-08-20 04:33:13 +0300
committerFilippos Karapetis2018-08-21 03:36:06 +0300
commit89785ea804819b554106420a8f105cf27581903f (patch)
tree277369ec884bcffb6ef90f8db5c20b864016f184 /engines/sci
parentd529692a5afff61313482742060b00d000814b5c (diff)
downloadscummvm-rg350-89785ea804819b554106420a8f105cf27581903f.tar.gz
scummvm-rg350-89785ea804819b554106420a8f105cf27581903f.tar.bz2
scummvm-rg350-89785ea804819b554106420a8f105cf27581903f.zip
SCI32: Add stub for kWinDLL - used in Hoyle 5
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kernel.h2
-rw-r--r--engines/sci/engine/kernel_tables.h2
-rw-r--r--engines/sci/engine/kmisc.cpp32
3 files changed, 35 insertions, 1 deletions
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 5ab9abe151..404aa5af67 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 b60d6ccce8..74c50cd5cf 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 49d2d9fa08..277abd528c 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) {