diff options
author | Martin Kiewitz | 2010-01-17 18:27:57 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-01-17 18:27:57 +0000 |
commit | cb1419ece9afa9f11d8ac5279f8fb8ea34fa960d (patch) | |
tree | 4199ad0a4a0bc412df2fa0dbaa1270496af41e2e | |
parent | 67f22f83d8b6ba94d45249bb7bc87fd253a501d4 (diff) | |
download | scummvm-rg350-cb1419ece9afa9f11d8ac5279f8fb8ea34fa960d.tar.gz scummvm-rg350-cb1419ece9afa9f11d8ac5279f8fb8ea34fa960d.tar.bz2 scummvm-rg350-cb1419ece9afa9f11d8ac5279f8fb8ea34fa960d.zip |
SCI: another speed throttler, delays decrementing cycles/cycleCnt selectors, disabled code just for reference
svn-id: r47342
-rw-r--r-- | engines/sci/engine/vm.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 6174dc838c..ab186ba819 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -1199,10 +1199,28 @@ void run_vm(EngineState *s, int restoring) { s->r_acc = OBJ_PROPERTY(obj, (opparams[0] >> 1)) = ACC_ARITHMETIC_L(1 + /*acc*/); break; - case 0x36: // dpToa + case 0x36: { // dpToa s->r_acc = OBJ_PROPERTY(obj, (opparams[0] >> 1)); +#if 0 + // Speed throttling is possible here as well + // although this opens other issues like mud wrestling in lsl5 uses another local variable for delays + Object *var_container = obj; + if (!(obj->getInfoSelector().offset & SCRIPT_INFO_CLASS)) + var_container = s->_segMan->getObject(obj->getSuperClassSelector()); + uint16 varSelector = var_container->getVarSelector(opparams[0] >> 1); +// printf("%X\n", varSelector); +// printf("%s\n", s->_kernel->getSelectorName(varSelector).c_str()); + if ((varSelector == 0x84) || (varSelector == 0x92))) { + // selectors cycles, cycleCnt from lsl5 hardcoded + uint32 curTime = g_system->getMillis(); + if (s->_lastAnimateTime + 30 > curTime) + break; + s->_lastAnimateTime = curTime; + } +#endif s->r_acc = OBJ_PROPERTY(obj, (opparams[0] >> 1)) = ACC_ARITHMETIC_L(-1 + /*acc*/); break; + } case 0x37: // ipTos validate_arithmetic(OBJ_PROPERTY(obj, (opparams[0] >> 1))); |