diff options
author | Travis Howell | 2009-07-11 11:48:01 +0000 |
---|---|---|
committer | Travis Howell | 2009-07-11 11:48:01 +0000 |
commit | e3398c0cc73999524e92774fb889a0d22eea552b (patch) | |
tree | ff1534d1e5e72f1965b747b21b594ef30d5e16ab /engines/sci/engine/vm.cpp | |
parent | 0577bee93893a55be1b2a067ec18f3c8ad462358 (diff) | |
parent | 2ceea652e62b301adea4628cebe4116191aa4998 (diff) | |
download | scummvm-rg350-e3398c0cc73999524e92774fb889a0d22eea552b.tar.gz scummvm-rg350-e3398c0cc73999524e92774fb889a0d22eea552b.tar.bz2 scummvm-rg350-e3398c0cc73999524e92774fb889a0d22eea552b.zip |
Merged revisions 42360-42361,42364-42366,42368-42378,42380 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
........
r42360 | Kirben | 2009-07-11 10:38:50 +1000 (Sat, 11 Jul 2009) | 1 line
Fix recent regression in AGOSEngine_Simon1::drawImage().
........
r42361 | wjpalenstijn | 2009-07-11 10:47:32 +1000 (Sat, 11 Jul 2009) | 3 lines
Fix SAGA outline generation algorithm for characters
that are copies of earlier characters. (5 characters in IHNM.)
This fixes #1904624.
........
r42364 | Kirben | 2009-07-11 11:40:53 +1000 (Sat, 11 Jul 2009) | 1 line
Fix bug #2819628 - DETECTOR: Atlantis CD sets wrong gui options.
........
r42365 | lordhoto | 2009-07-11 11:54:27 +1000 (Sat, 11 Jul 2009) | 1 line
Fix graphics not updating, when loading a save in Kyra1. This fixes problems when loading saves in rooms like Brynn's temple, which play animations directly on scene enter.
........
r42366 | lordhoto | 2009-07-11 11:54:42 +1000 (Sat, 11 Jul 2009) | 1 line
Removed the now uneeded "Screen::_disableScreen" flag.
........
r42368 | dreammaster | 2009-07-11 15:10:13 +1000 (Sat, 11 Jul 2009) | 1 line
Bugfix to show the mouse cursor when restarting the game after returning to launcher
........
r42369 | dreammaster | 2009-07-11 15:12:17 +1000 (Sat, 11 Jul 2009) | 1 line
Active background screens are now properly freed when the game exits
........
r42370 | dreammaster | 2009-07-11 15:14:42 +1000 (Sat, 11 Jul 2009) | 1 line
Added initialisation of paging screens when the game starts
........
r42371 | thebluegr | 2009-07-11 16:19:29 +1000 (Sat, 11 Jul 2009) | 1 line
Fixed regression in the script parser from commit 42260
........
r42372 | thebluegr | 2009-07-11 16:33:19 +1000 (Sat, 11 Jul 2009) | 1 line
Applied a slightly modified patch from clone2727 which adds static selector names to some demos which are missing them (KQ4, LSL1, LSL3, Iceman and Christmas1992)
........
r42373 | thebluegr | 2009-07-11 16:34:25 +1000 (Sat, 11 Jul 2009) | 1 line
Removed an invalid detection entry
........
r42374 | thebluegr | 2009-07-11 16:43:01 +1000 (Sat, 11 Jul 2009) | 1 line
Applied slightly modified patch 2819002 - "SCI: resource-view-patch on SQ5/German fix"
........
r42375 | thebluegr | 2009-07-11 16:53:39 +1000 (Sat, 11 Jul 2009) | 1 line
Applied patch 2818733 - "SCI: Timer iterator for audio resources played via doSound"
........
r42376 | Kirben | 2009-07-11 17:03:28 +1000 (Sat, 11 Jul 2009) | 1 line
Only error out, if checkStaticSelectorNames() fails.
........
r42377 | dreammaster | 2009-07-11 18:16:55 +1000 (Sat, 11 Jul 2009) | 1 line
Bugfix to properly save the currently playing midi music when saving a scene
........
r42378 | wjpalenstijn | 2009-07-11 19:45:25 +1000 (Sat, 11 Jul 2009) | 1 line
Fix oversight in r42361 and also handle consecutive copied characters in SAGA.
........
r42380 | drmccoy | 2009-07-11 20:24:06 +1000 (Sat, 11 Jul 2009) | 1 line
Explicitely instantiate the decompressWizImage() templates, so that they won't be optimized away, as they are also used in akos.cpp
........
svn-id: r42381
Diffstat (limited to 'engines/sci/engine/vm.cpp')
-rw-r--r-- | engines/sci/engine/vm.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index e0ac60f152..d220547c92 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -552,7 +552,7 @@ void run_vm(EngineState *s, int restoring) { StackPtr s_temp; // Temporary stack pointer int16 opparams[4]; // opcode parameters - scriptState.restadjust = s->restAdjust; + scriptState.restAdjust = s->restAdjust; // &rest adjusts the parameter count by this value // Current execution data: scriptState.xs = &(s->_executionStack.back()); @@ -931,17 +931,17 @@ void run_vm(EngineState *s, int restoring) { case 0x20: { // call int argc = (opparams[1] >> 1) // Given as offset, but we need count - + 1 + scriptState.restadjust; + + 1 + scriptState.restAdjust; StackPtr call_base = scriptState.xs->sp - argc; - scriptState.xs->sp[1].offset += scriptState.restadjust; - - xs_new = add_exec_stack_entry(s, make_reg(scriptState.xs->addr.pc.segment, - scriptState.xs->addr.pc.offset + opparams[0]), - scriptState.xs->sp, scriptState.xs->objp, - (validate_arithmetic(*call_base)) + scriptState.restadjust, - call_base, NULL_SELECTOR, scriptState.xs->objp, - s->_executionStack.size()-1, scriptState.xs->local_segment); - scriptState.restadjust = 0; // Used up the &rest adjustment + scriptState.xs->sp[1].offset += scriptState.restAdjust; + + xs_new = add_exec_stack_entry(s, make_reg(scriptState.xs->addr.pc.segment, + scriptState.xs->addr.pc.offset + opparams[0]), + scriptState.xs->sp, scriptState.xs->objp, + (validate_arithmetic(*call_base)) + scriptState.restAdjust, + call_base, NULL_SELECTOR, scriptState.xs->objp, + s->_executionStack.size()-1, scriptState.xs->local_segment); + scriptState.restAdjust = 0; // Used up the &rest adjustment scriptState.xs->sp = call_base; s->_executionStackPosChanged = true; @@ -953,8 +953,8 @@ void run_vm(EngineState *s, int restoring) { scriptState.xs->sp -= (opparams[1] >> 1) + 1; if (!s->_kernel->hasOldScriptHeader()) { - scriptState.xs->sp -= scriptState.restadjust; - s->restAdjust = 0; // We just used up the restadjust, remember? + scriptState.xs->sp -= scriptState.restAdjust; + s->restAdjust = 0; // We just used up the scriptState.restAdjust, remember? } if (opparams[0] >= (int)s->_kernel->_kernelFuncs.size()) { @@ -963,15 +963,15 @@ void run_vm(EngineState *s, int restoring) { int argc = ASSERT_ARITHMETIC(scriptState.xs->sp[0]); if (!s->_kernel->hasOldScriptHeader()) - argc += scriptState.restadjust; + argc += scriptState.restAdjust; if (s->_kernel->_kernelFuncs[opparams[0]].signature - && !kernel_matches_signature(s, - s->_kernel->_kernelFuncs[opparams[0]].signature, argc, - scriptState.xs->sp + 1)) { + && !kernel_matches_signature(s, + s->_kernel->_kernelFuncs[opparams[0]].signature, argc, + scriptState.xs->sp + 1)) { error("[VM] Invalid arguments to kernel call %x\n", opparams[0]); } else { - s->r_acc = s->_kernel->_kernelFuncs[opparams[0]].fun(s, opparams[0], + s->r_acc = s->_kernel->_kernelFuncs[opparams[0]].fun(s, opparams[0], argc, scriptState.xs->sp + 1); } // Call kernel function @@ -983,33 +983,33 @@ void run_vm(EngineState *s, int restoring) { s->_executionStackPosChanged = true; if (!s->_kernel->hasOldScriptHeader()) - scriptState.restadjust = s->restAdjust; + scriptState.restAdjust = s->restAdjust; } break; case 0x22: // callb - temp = ((opparams[1] >> 1) + scriptState.restadjust + 1); + temp = ((opparams[1] >> 1) + scriptState.restAdjust + 1); s_temp = scriptState.xs->sp; scriptState.xs->sp -= temp; - scriptState.xs->sp[0].offset += scriptState.restadjust; - xs_new = execute_method(s, 0, opparams[0], s_temp, scriptState.xs->objp, + scriptState.xs->sp[0].offset += scriptState.restAdjust; + xs_new = execute_method(s, 0, opparams[0], s_temp, scriptState.xs->objp, scriptState.xs->sp[0].offset, scriptState.xs->sp); - scriptState.restadjust = 0; // Used up the &rest adjustment + scriptState.restAdjust = 0; // Used up the &rest adjustment if (xs_new) // in case of error, keep old stack s->_executionStackPosChanged = true; break; case 0x23: // calle - temp = ((opparams[2] >> 1) + scriptState.restadjust + 1); + temp = ((opparams[2] >> 1) + scriptState.restAdjust + 1); s_temp = scriptState.xs->sp; scriptState.xs->sp -= temp; - scriptState.xs->sp[0].offset += scriptState.restadjust; - xs_new = execute_method(s, opparams[0], opparams[1], s_temp, scriptState.xs->objp, + scriptState.xs->sp[0].offset += scriptState.restAdjust; + xs_new = execute_method(s, opparams[0], opparams[1], s_temp, scriptState.xs->objp, scriptState.xs->sp[0].offset, scriptState.xs->sp); - scriptState.restadjust = 0; // Used up the &rest adjustment + scriptState.restAdjust = 0; // Used up the &rest adjustment if (xs_new) // in case of error, keep old stack s->_executionStackPosChanged = true; @@ -1027,7 +1027,7 @@ void run_vm(EngineState *s, int restoring) { s->_executionStack.pop_back(); s->_executionStackPosChanged = true; - s->restAdjust = scriptState.restadjust; // Update &rest + s->restAdjust = scriptState.restAdjust; // Update &rest return; // "Hard" return } @@ -1059,37 +1059,37 @@ void run_vm(EngineState *s, int restoring) { case 0x25: // send s_temp = scriptState.xs->sp; - scriptState.xs->sp -= ((opparams[0] >> 1) + scriptState.restadjust); // Adjust stack + scriptState.xs->sp -= ((opparams[0] >> 1) + scriptState.restAdjust); // Adjust stack - scriptState.xs->sp[1].offset += scriptState.restadjust; - xs_new = send_selector(s, s->r_acc, s->r_acc, s_temp, - (int)(opparams[0] >> 1) + scriptState.restadjust, scriptState.xs->sp); + scriptState.xs->sp[1].offset += scriptState.restAdjust; + xs_new = send_selector(s, s->r_acc, s->r_acc, s_temp, + (int)(opparams[0] >> 1) + (uint16)scriptState.restAdjust, scriptState.xs->sp); if (xs_new && xs_new != scriptState.xs) s->_executionStackPosChanged = true; - scriptState.restadjust = 0; + scriptState.restAdjust = 0; break; case 0x28: // class - s->r_acc = get_class_address(s, (unsigned)opparams[0], SCRIPT_GET_LOCK, + s->r_acc = get_class_address(s, (unsigned)opparams[0], SCRIPT_GET_LOCK, scriptState.xs->addr.pc); break; case 0x2a: // self s_temp = scriptState.xs->sp; - scriptState.xs->sp -= ((opparams[0] >> 1) + scriptState.restadjust); // Adjust stack + scriptState.xs->sp -= ((opparams[0] >> 1) + scriptState.restAdjust); // Adjust stack - scriptState.xs->sp[1].offset += scriptState.restadjust; - xs_new = send_selector(s, scriptState.xs->objp, scriptState.xs->objp, - s_temp, (int)(opparams[0] >> 1) + scriptState.restadjust, + scriptState.xs->sp[1].offset += scriptState.restAdjust; + xs_new = send_selector(s, scriptState.xs->objp, scriptState.xs->objp, + s_temp, (int)(opparams[0] >> 1) + (uint16)scriptState.restAdjust, scriptState.xs->sp); if (xs_new && xs_new != scriptState.xs) s->_executionStackPosChanged = true; - scriptState.restadjust = 0; + scriptState.restAdjust = 0; break; case 0x2b: // super @@ -1099,24 +1099,24 @@ void run_vm(EngineState *s, int restoring) { error("[VM]: Invalid superclass in object"); else { s_temp = scriptState.xs->sp; - scriptState.xs->sp -= ((opparams[1] >> 1) + scriptState.restadjust); // Adjust stack + scriptState.xs->sp -= ((opparams[1] >> 1) + scriptState.restAdjust); // Adjust stack - scriptState.xs->sp[1].offset += scriptState.restadjust; - xs_new = send_selector(s, r_temp, scriptState.xs->objp, s_temp, - (int)(opparams[1] >> 1) + scriptState.restadjust, + scriptState.xs->sp[1].offset += scriptState.restAdjust; + xs_new = send_selector(s, r_temp, scriptState.xs->objp, s_temp, + (int)(opparams[1] >> 1) + (uint16)scriptState.restAdjust, scriptState.xs->sp); if (xs_new && xs_new != scriptState.xs) s->_executionStackPosChanged = true; - scriptState.restadjust = 0; + scriptState.restAdjust = 0; } break; case 0x2c: // &rest temp = (uint16) opparams[0]; // First argument - scriptState.restadjust = MAX<uint16>(scriptState.xs->argc - temp + 1, 0); // +1 because temp counts the paramcount while argc doesn't + scriptState.restAdjust = MAX<int16>(scriptState.xs->argc - temp + 1, 0); // +1 because temp counts the paramcount while argc doesn't for (; temp <= scriptState.xs->argc; temp++) PUSH32(scriptState.xs->variables_argp[temp]); |