diff options
-rw-r--r-- | scumm/script_v8.cpp | 18 | ||||
-rw-r--r-- | scumm/scumm.h | 2 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 5 |
3 files changed, 22 insertions, 3 deletions
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 4270403ad9..e1ed2b6f95 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1466,7 +1466,8 @@ void Scumm_v8::o8_kernelSetFunctions() warning("o8_kernelSetFunctions: saveGameStampScreenshot(%d, %d, %d, %d, %d, %d)", args[1], args[2], args[3], args[4], args[5], args[6]); break; case 29: // setKeyScript - warning("o8_kernelSetFunctions: setKeyScript(%d, %d)", args[1], args[2]); + keyScriptKey = args[1]; + keyScriptNo = args[2]; break; case 30: // killAllScriptsButMe warning("o8_kernelSetFunctions: killAllScriptsButMe()"); @@ -1515,8 +1516,19 @@ void Scumm_v8::o8_kernelGetFunctions() case 0x74: // isPointInBox push(checkXYInBoxBounds(args[3], args[1], args[2])); break; - case 0xCE: // getRGBSlot case 0xD3: // getKeyState + switch(args[1]) { + case 0x14B: // Left Arrow depressed? + case 0x14D: // Right Arrow depressed? + push(0); + break; + default: + warning("getKeyState(0x%X)\n", args[1]); + push(0); + break; + } + break; + case 0xCE: // getRGBSlot case 0xD7: // getBox push(0); warning("o8_kernelGetFunctions: default case 0x%x (len = %d)", args[0], len); @@ -1541,8 +1553,8 @@ void Scumm_v8::o8_kernelGetFunctions() break; } case 0xD9: // actorHit + warning("actorHit(%d,%d,%d)", args[3], args[2], args[1]); push(0); - warning("o8_kernelGetFunctions: default case 0x%x (len = %d)", args[0], len); break; case 0xDA: // lipSyncWidth case 0xDB: // lipSyncHeight diff --git a/scumm/scumm.h b/scumm/scumm.h index 2e08a0dbda..501dc1e51d 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -330,6 +330,8 @@ public: int checkKeyHit(); void convertKeysToClicks(); + int keyScriptKey, keyScriptNo; + /* Random number generation */ RandomSource _rnd; diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index f9c98be758..28fd3c2f8f 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -1146,6 +1146,11 @@ void Scumm::processKbd() if (!_lastKeyHit) return; + if (keyScriptNo && (keyScriptKey = _lastKeyHit)) { + runScript(keyScriptNo, 0, 0, 0); + return; + } + if (_lastKeyHit == KEY_SET_OPTIONS) { setOptions(); return; |