diff options
author | Travis Howell | 2005-05-28 08:37:44 +0000 |
---|---|---|
committer | Travis Howell | 2005-05-28 08:37:44 +0000 |
commit | 151f09ed539ea5ba70712041345d75597d33a7ec (patch) | |
tree | fd027ea67436d945f27fcff94e1b889226ea04a6 | |
parent | b65974b7b40d2a93a8e33d0979fa235381a05c7d (diff) | |
download | scummvm-rg350-151f09ed539ea5ba70712041345d75597d33a7ec.tar.gz scummvm-rg350-151f09ed539ea5ba70712041345d75597d33a7ec.tar.bz2 scummvm-rg350-151f09ed539ea5ba70712041345d75597d33a7ec.zip |
Sync opcode names and add HE72+ version of o_systemOps.
svn-id: r18278
-rw-r--r-- | scumm/intern.h | 11 | ||||
-rw-r--r-- | scumm/script_v100he.cpp | 6 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 6 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 6 | ||||
-rw-r--r-- | scumm/script_v6he.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 38 | ||||
-rw-r--r-- | scumm/script_v7he.cpp | 54 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 6 | ||||
-rw-r--r-- | scumm/script_v80he.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 2 |
10 files changed, 90 insertions, 43 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index cb57a157ee..a52d5ec57c 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -161,7 +161,7 @@ protected: void o5_putActor(); void o5_putActorAtObject(); void o5_putActorInRoom(); - void o5_quitPauseRestart(); + void o5_systemOps(); void o5_resourceRoutines(); void o5_roomOps(); void o5_saveLoadGame(); @@ -671,7 +671,7 @@ protected: void o6_getActorAnimCounter1(); void o6_soundKludge(); void o6_isAnyOf(); - void o6_quitPauseRestart(); + void o6_systemOps(); void o6_isActorInBox(); void o6_delay(); void o6_delaySeconds(); @@ -839,7 +839,7 @@ protected: void o70_pickupObject(); void o70_getActorRoom(); void o70_resourceRoutines(); - void o70_quitPauseRestart(); + void o70_systemOps(); void o70_kernelSetFunctions(); void o70_seekFilePos(); void o70_copyString(); @@ -978,6 +978,7 @@ protected: void o72_verbOps(); void o72_findObject(); void o72_arrayOps(); + void o72_systemOps(); void o72_talkActor(); void o72_talkEgo(); void o72_dimArray(); @@ -1249,7 +1250,7 @@ protected: void o100_startSound(); void o100_setSpriteInfo(); void o100_startScript(); - void o100_quitPauseRestart(); + void o100_systemOps(); void o100_cursorCommand(); void o100_wait(); void o100_writeFile(); @@ -1363,7 +1364,7 @@ protected: void o8_cameraOps(); void o8_verbOps(); - void o8_system(); + void o8_systemOps(); void o8_startVideo(); void o8_kernelSetFunctions(); void o8_kernelGetFunctions(); diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index 284818efb9..5f78d0d9e9 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -212,7 +212,7 @@ void ScummEngine_v100he::setupOpcodes() { OPCODE(o6_wordArrayIndexedWrite), OPCODE(o6_sub), /* 88 */ - OPCODE(o100_quitPauseRestart), + OPCODE(o100_systemOps), OPCODE(o6_invalid), OPCODE(o72_setTimer), OPCODE(o100_cursorCommand), @@ -2052,7 +2052,7 @@ void ScummEngine_v100he::o100_startScript() { runScript(script, (flags == 128 || flags == 129), (flags == 130 || flags == 129), args); } -void ScummEngine_v100he::o100_quitPauseRestart() { +void ScummEngine_v100he::o100_systemOps() { byte subOp = fetchScriptByte(); subOp -= 61; @@ -2072,7 +2072,7 @@ void ScummEngine_v100he::o100_quitPauseRestart() { // Update palette break; default: - error("o100_quitPauseRestart invalid case %d", subOp); + error("o100_systemOps invalid case %d", subOp); } } diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index b868cf2420..06c67ebfc0 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -229,7 +229,7 @@ void ScummEngine_v5::setupOpcodes() { OPCODE(o5_getRandomNr), OPCODE(o5_and), /* 98 */ - OPCODE(o5_quitPauseRestart), + OPCODE(o5_systemOps), OPCODE(o5_doSentence), OPCODE(o5_move), OPCODE(o5_multiply), @@ -1673,7 +1673,7 @@ void ScummEngine_v5::o5_putActorInRoom() { a->putActor(0, 0, 0); } -void ScummEngine_v5::o5_quitPauseRestart() { +void ScummEngine_v5::o5_systemOps() { byte subOp = fetchScriptByte(); switch (subOp) { case 1: // SO_RESTART @@ -1686,7 +1686,7 @@ void ScummEngine_v5::o5_quitPauseRestart() { shutDown(); break; default: - error("o5_quitPauseRestart: unknown subopcode %d", subOp); + error("o5_systemOps: unknown subopcode %d", subOp); } } diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 6e7fe6bd31..47dc0974fb 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -266,7 +266,7 @@ void ScummEngine_v6::setupOpcodes() { /* AC */ OPCODE(o6_soundKludge), OPCODE(o6_isAnyOf), - OPCODE(o6_quitPauseRestart), + OPCODE(o6_systemOps), OPCODE(o6_isActorInBox), /* B0 */ OPCODE(o6_delay), @@ -2266,7 +2266,7 @@ void ScummEngine_v6::o6_isAnyOf() { push(0); } -void ScummEngine_v6::o6_quitPauseRestart() { +void ScummEngine_v6::o6_systemOps() { byte subOp = fetchScriptByte(); switch (subOp) { case 158: // SO_RESTART @@ -2279,7 +2279,7 @@ void ScummEngine_v6::o6_quitPauseRestart() { shutDown(); break; default: - error("o6_quitPauseRestart invalid case %d", subOp); + error("o6_systemOps invalid case %d", subOp); } } diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index 414fa4e402..a444a6397c 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -285,7 +285,7 @@ void ScummEngine_v60he::setupOpcodes() { /* AC */ OPCODE(o6_invalid), OPCODE(o6_isAnyOf), - OPCODE(o6_quitPauseRestart), + OPCODE(o6_systemOps), OPCODE(o6_isActorInBox), /* B0 */ OPCODE(o6_delay), diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index d4929821c2..1ab4f0620c 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -261,7 +261,7 @@ void ScummEngine_v72he::setupOpcodes() { /* AC */ OPCODE(o6_invalid), OPCODE(o6_isAnyOf), - OPCODE(o70_quitPauseRestart), + OPCODE(o72_systemOps), OPCODE(o6_isActorInBox), /* B0 */ OPCODE(o6_delay), @@ -1563,6 +1563,42 @@ void ScummEngine_v72he::o72_arrayOps() { } } +void ScummEngine_v72he::o72_systemOps() { + byte string[1024]; + + byte subOp = fetchScriptByte(); + + switch (subOp) { + case 22: // HE80+ + clearDrawObjectQueue(); + break; + case 26: // HE80+ + gdi.copyVirtScreenBuffers(Common::Rect(_screenWidth, _screenHeight)); + updatePalette(); + break; + case 158: + restart(); + break; + case 160: + // Confirm shutdown + shutDown(); + break; + case 244: + shutDown(); + break; + case 251: + copyScriptString(string, sizeof(string)); + debug(0, "Start executable (%s)", string); + break; + case 252: + copyScriptString(string, sizeof(string)); + debug(0, "Start game (%s)", string); + break; + default: + error("o72_systemOps invalid case %d", subOp); + } +} + void ScummEngine_v72he::o72_talkActor() { Actor *a; diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index ca883aa06e..7bd2a66d77 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -259,7 +259,7 @@ void ScummEngine_v70he::setupOpcodes() { /* AC */ OPCODE(o6_invalid), OPCODE(o6_isAnyOf), - OPCODE(o70_quitPauseRestart), + OPCODE(o70_systemOps), OPCODE(o6_isActorInBox), /* B0 */ OPCODE(o6_delay), @@ -666,41 +666,51 @@ void ScummEngine_v70he::o70_resourceRoutines() { } } -void ScummEngine_v70he::o70_quitPauseRestart() { +void ScummEngine_v70he::o70_systemOps() { + byte *src, string[256]; + int id, len; + byte subOp = fetchScriptByte(); - int par1; switch (subOp) { - case 22: // HE80+ - clearDrawObjectQueue(); - break; - case 26: // HE80+ - // Clear screen - // Update palette - break; - case 158: // SO_RESTART + case 158: restart(); break; case 160: - // FIXME: check + // Confirm shutdown shutDown(); break; - case 250: - par1 = pop(); - warning("stub: o70_quitPauseRestart subOpcode %d", subOp); - break; - case 253: - par1 = pop(); - warning("stub: o70_quitPauseRestart subOpcode %d", subOp); - case 244: // SO_QUIT + case 244: shutDown(); break; + case 250: + id = pop(); + src = getStringAddress(id); + len = resStrLen(src) + 1; + memcpy(string, src, len); + debug(0, "Start executable (%s)", string); + break; case 251: + convertMessageToString(_scriptPointer, string, sizeof(string)); + len = resStrLen(_scriptPointer); + _scriptPointer += len + 1; + debug(0, "Start executable (%s)", string); + break; case 252: - warning("stub: o70_quitPauseRestart subOpcode %d", subOp); + convertMessageToString(_scriptPointer, string, sizeof(string)); + len = resStrLen(_scriptPointer); + _scriptPointer += len + 1; + debug(0, "Start game (%s)", string); + break; + case 253: + id = pop(); + src = getStringAddress(id); + len = resStrLen(src) + 1; + memcpy(string, src, len); + debug(0, "Start game (%s)", string); break; default: - warning("o70_quitPauseRestart invalid case %d", subOp); + error("o70_systemOps invalid case %d", subOp); } } diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 3b7755b82b..1381c66f13 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -265,7 +265,7 @@ void ScummEngine_v8::setupOpcodes() { OPCODE(o6_startMusic), OPCODE(o6_stopSound), OPCODE(o6_soundKludge), - OPCODE(o8_system), + OPCODE(o8_systemOps), /* B4 */ OPCODE(o6_saveRestoreVerbs), OPCODE(o6_setObjectName), @@ -1177,7 +1177,7 @@ void ScummEngine_v8::o8_verbOps() { } } -void ScummEngine_v8::o8_system() { +void ScummEngine_v8::o8_systemOps() { byte subOp = fetchScriptByte(); switch (subOp) { case 0x28: // SO_SYSTEM_RESTART Restart game @@ -1187,7 +1187,7 @@ void ScummEngine_v8::o8_system() { shutDown(); break; default: - error("o8_system: invalid case 0x%x", subOp); + error("o8_systemOps: invalid case 0x%x", subOp); } } diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp index d16ff17b23..d86235c079 100644 --- a/scumm/script_v80he.cpp +++ b/scumm/script_v80he.cpp @@ -261,7 +261,7 @@ void ScummEngine_v80he::setupOpcodes() { /* AC */ OPCODE(o80_drawWizPolygon), OPCODE(o6_isAnyOf), - OPCODE(o70_quitPauseRestart), + OPCODE(o72_systemOps), OPCODE(o6_isActorInBox), /* B0 */ OPCODE(o6_delay), diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 5c8dd8fe78..e6b288fc67 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -260,7 +260,7 @@ void ScummEngine_v90he::setupOpcodes() { /* AC */ OPCODE(o80_drawWizPolygon), OPCODE(o6_isAnyOf), - OPCODE(o70_quitPauseRestart), + OPCODE(o72_systemOps), OPCODE(o6_isActorInBox), /* B0 */ OPCODE(o6_delay), |