diff options
-rw-r--r-- | engines/sci/engine/kernel.h | 2 | ||||
-rw-r--r-- | engines/sci/engine/kernel_tables.h | 2 | ||||
-rw-r--r-- | engines/sci/engine/kmisc.cpp | 32 |
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) { |