aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-02-14 05:27:39 +0000
committerTravis Howell2006-02-14 05:27:39 +0000
commitde6aac4e2ff7a79506bcba10d4fe4ad618d4712a (patch)
treef82e6371851d99100ba9a9a315b9ee54851e9e76
parent072013c0f47f1a337aea7f865499460fe78c237b (diff)
downloadscummvm-rg350-de6aac4e2ff7a79506bcba10d4fe4ad618d4712a.tar.gz
scummvm-rg350-de6aac4e2ff7a79506bcba10d4fe4ad618d4712a.tar.bz2
scummvm-rg350-de6aac4e2ff7a79506bcba10d4fe4ad618d4712a.zip
Add setSystemMessage opcode for HE70+ games. Sets the window caption correctly for all languages
svn-id: r20684
-rw-r--r--engines/scumm/gfx.cpp2
-rw-r--r--engines/scumm/intern_he.h4
-rw-r--r--engines/scumm/script_v100he.cpp2
-rw-r--r--engines/scumm/script_v72he.cpp26
-rw-r--r--engines/scumm/script_v7he.cpp32
-rw-r--r--engines/scumm/script_v80he.cpp2
-rw-r--r--engines/scumm/script_v90he.cpp2
7 files changed, 52 insertions, 18 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index dc476a8f0b..6746c7088e 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -1705,8 +1705,6 @@ void Gdi::copyVirtScreenBuffers(Common::Rect rect, int dirtybit) {
byte *src, *dst;
VirtScreen *vs = &_vm->virtscr[0];
- debug(1,"copyVirtScreenBuffers: Left %d Right %d Top %d Bottom %d", rect.left, rect.right, rect.top, rect.bottom);
-
if (rect.top > vs->h || rect.bottom < 0)
return;
diff --git a/engines/scumm/intern_he.h b/engines/scumm/intern_he.h
index de10999fcd..af645fc1fd 100644
--- a/engines/scumm/intern_he.h
+++ b/engines/scumm/intern_he.h
@@ -168,7 +168,7 @@ protected:
void o70_getStringLenForWidth();
void o70_getCharIndexInString();
void o70_setFilePath();
- void o70_setWindowCaption();
+ void o70_setSystemMessage();
void o70_polygonOps();
void o70_polygonHit();
@@ -320,7 +320,7 @@ protected:
void o72_writeINI();
void o72_getResourceSize();
void o72_setFilePath();
- void o72_setWindowCaption();
+ void o72_setSystemMessage();
byte VAR_NUM_ROOMS;
byte VAR_NUM_SCRIPTS;
diff --git a/engines/scumm/script_v100he.cpp b/engines/scumm/script_v100he.cpp
index 790f65e021..3ff7e4a33c 100644
--- a/engines/scumm/script_v100he.cpp
+++ b/engines/scumm/script_v100he.cpp
@@ -183,7 +183,7 @@ void ScummEngine_v100he::setupOpcodes() {
/* 70 */
OPCODE(o6_invalid),
OPCODE(o6_setBoxSet),
- OPCODE(o72_setWindowCaption),
+ OPCODE(o72_setSystemMessage),
OPCODE(o6_shuffle),
/* 74 */
OPCODE(o6_delay),
diff --git a/engines/scumm/script_v72he.cpp b/engines/scumm/script_v72he.cpp
index 0a10e5c22b..fcc18f9fad 100644
--- a/engines/scumm/script_v72he.cpp
+++ b/engines/scumm/script_v72he.cpp
@@ -357,7 +357,7 @@ void ScummEngine_v72he::setupOpcodes() {
/* F8 */
OPCODE(o72_getResourceSize),
OPCODE(o72_setFilePath),
- OPCODE(o72_setWindowCaption),
+ OPCODE(o72_setSystemMessage),
OPCODE(o70_polygonOps),
/* FC */
OPCODE(o70_polygonHit),
@@ -2240,7 +2240,7 @@ void ScummEngine_v72he::o72_getResourceSize() {
type = rtScript;
break;
default:
- error("o80_getResourceSize: default type %d", subOp);
+ error("o72_getResourceSize: default type %d", subOp);
}
ptr = getResourceAddress(type, resid);
@@ -2250,18 +2250,34 @@ void ScummEngine_v72he::o72_getResourceSize() {
}
void ScummEngine_v72he::o72_setFilePath() {
- // File related
byte filename[255];
+
copyScriptString(filename, sizeof(filename));
debug(1,"o72_setFilePath: %s", filename);
}
-void ScummEngine_v72he::o72_setWindowCaption() {
+void ScummEngine_v72he::o72_setSystemMessage() {
byte name[1024];
+
copyScriptString(name, sizeof(name));
byte subOp = fetchScriptByte();
- debug(1,"o72_setWindowCaption: (%d) %s", subOp, name);
+ switch (subOp) {
+ case 240:
+ debug(1,"o72_setSystemMessage: (%d) %s", subOp, name);
+ break;
+ case 241: // Set Version
+ debug(1,"o72_setSystemMessage: (%d) %s", subOp, name);
+ break;
+ case 242:
+ debug(1,"o72_setSystemMessage: (%d) %s", subOp, name);
+ break;
+ case 243: // Set Window Caption
+ _system->setWindowCaption((const char *)name);
+ break;
+ default:
+ error("o72_setSystemMessage: default case %d", subOp);
+ }
}
void ScummEngine_v72he::decodeParseString(int m, int n) {
diff --git a/engines/scumm/script_v7he.cpp b/engines/scumm/script_v7he.cpp
index 10644ba03d..bae2654dae 100644
--- a/engines/scumm/script_v7he.cpp
+++ b/engines/scumm/script_v7he.cpp
@@ -24,6 +24,7 @@
#include "common/stdafx.h"
#include "common/config-manager.h"
+#include "common/system.h"
#include "scumm/actor.h"
#include "scumm/charset.h"
@@ -354,7 +355,7 @@ void ScummEngine_v70he::setupOpcodes() {
/* F8 */
OPCODE(o6_invalid),
OPCODE(o70_setFilePath),
- OPCODE(o70_setWindowCaption),
+ OPCODE(o70_setSystemMessage),
OPCODE(o70_polygonOps),
/* FC */
OPCODE(o70_polygonHit),
@@ -1070,23 +1071,42 @@ void ScummEngine_v70he::o70_getCharIndexInString() {
}
void ScummEngine_v70he::o70_setFilePath() {
- // File related
int len;
byte filename[100];
convertMessageToString(_scriptPointer, filename, sizeof(filename));
-
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
debug(1,"stub o70_setFilePath(%s)", filename);
}
-void ScummEngine_v70he::o70_setWindowCaption() {
+void ScummEngine_v70he::o70_setSystemMessage() {
+ int len;
+ byte name[255];
+
byte subOp = fetchScriptByte();
- int len = resStrLen(_scriptPointer);
- debug(1,"stub o70_setWindowCaption(%d, \"%s\")", subOp, _scriptPointer);
+
+ convertMessageToString(_scriptPointer, name, sizeof(name));
+ len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
+
+ switch (subOp) {
+ case 240:
+ debug(1,"o70_setSystemMessage: (%d) %s", subOp, name);
+ break;
+ case 241: // Set Version
+ debug(1,"o70_setSystemMessage: (%d) %s", subOp, name);
+ break;
+ case 242:
+ debug(1,"o70_setSystemMessage: (%d) %s", subOp, name);
+ break;
+ case 243: // Set Window Caption
+ _system->setWindowCaption((const char *)name);
+ break;
+ default:
+ error("o70_setSystemMessage: default case %d", subOp);
+ }
}
void ScummEngine_v70he::o70_polygonOps() {
diff --git a/engines/scumm/script_v80he.cpp b/engines/scumm/script_v80he.cpp
index 517ce46650..02c3f403d9 100644
--- a/engines/scumm/script_v80he.cpp
+++ b/engines/scumm/script_v80he.cpp
@@ -356,7 +356,7 @@ void ScummEngine_v80he::setupOpcodes() {
/* F8 */
OPCODE(o72_getResourceSize),
OPCODE(o72_setFilePath),
- OPCODE(o72_setWindowCaption),
+ OPCODE(o72_setSystemMessage),
OPCODE(o70_polygonOps),
/* FC */
OPCODE(o70_polygonHit),
diff --git a/engines/scumm/script_v90he.cpp b/engines/scumm/script_v90he.cpp
index 5f01b5ac5d..89b3463837 100644
--- a/engines/scumm/script_v90he.cpp
+++ b/engines/scumm/script_v90he.cpp
@@ -354,7 +354,7 @@ void ScummEngine_v90he::setupOpcodes() {
/* F8 */
OPCODE(o72_getResourceSize),
OPCODE(o72_setFilePath),
- OPCODE(o72_setWindowCaption),
+ OPCODE(o72_setSystemMessage),
OPCODE(o70_polygonOps),
/* FC */
OPCODE(o70_polygonHit),