aboutsummaryrefslogtreecommitdiff
path: root/scumm/script_v7he.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scumm/script_v7he.cpp')
-rw-r--r--scumm/script_v7he.cpp66
1 files changed, 65 insertions, 1 deletions
diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp
index af72a58fea..cfcc05d166 100644
--- a/scumm/script_v7he.cpp
+++ b/scumm/script_v7he.cpp
@@ -30,6 +30,7 @@
#include "scumm/intern.h"
#include "scumm/object.h"
#include "scumm/resource.h"
+#include "scumm/resource_v7he.h"
#include "scumm/scumm.h"
#include "scumm/sound.h"
#include "scumm/verbs.h"
@@ -184,7 +185,7 @@ void ScummEngine_v7he::setupOpcodes() {
OPCODE(o6_cutscene),
OPCODE(o6_stopMusic),
OPCODE(o6_freezeUnfreeze),
- OPCODE(o6_cursorCommand),
+ OPCODE(o7_cursorCommand),
/* 6C */
OPCODE(o6_breakHere),
OPCODE(o6_ifClassOfIs),
@@ -699,4 +700,67 @@ void ScummEngine_v7he::o7_startSound() {
}
+void ScummEngine_v7he::o7_cursorCommand() {
+ int a, i;
+ int args[16];
+ int subOp = fetchScriptByte();
+
+ switch (subOp) {
+ case 0x90: // SO_CURSOR_ON Turn cursor on
+ _cursor.state = 1;
+ verbMouseOver(0);
+ break;
+ case 0x91: // SO_CURSOR_OFF Turn cursor off
+ _cursor.state = 0;
+ verbMouseOver(0);
+ break;
+ case 0x92: // SO_USERPUT_ON
+ _userPut = 1;
+ break;
+ case 0x93: // SO_USERPUT_OFF
+ _userPut = 0;
+ break;
+ case 0x94: // SO_CURSOR_SOFT_ON Turn soft cursor on
+ _cursor.state++;
+ if (_cursor.state > 1)
+ error("Cursor state greater than 1 in script");
+ verbMouseOver(0);
+ break;
+ case 0x95: // SO_CURSOR_SOFT_OFF Turn soft cursor off
+ _cursor.state--;
+ verbMouseOver(0);
+ break;
+ case 0x96: // SO_USERPUT_SOFT_ON
+ _userPut++;
+ break;
+ case 0x97: // SO_USERPUT_SOFT_OFF
+ _userPut--;
+ break;
+ case 0x99: // SO_CURSOR_IMAGE Set cursor image
+ _Win32ResExtractor->setCursor(pop()); /* Difference */
+ break;
+ case 0x9A: // SO_CURSOR_HOTSPOT Set cursor hotspot
+ a = pop();
+ setCursorHotspot(pop(), a);
+ break;
+ case 0x9C: // SO_CHARSET_SET
+ initCharset(pop());
+ break;
+ case 0x9D: // SO_CHARSET_COLOR
+ getStackList(args, ARRAYSIZE(args));
+ for (i = 0; i < 16; i++)
+ _charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)args[i];
+ break;
+ case 0xD6: // SO_CURSOR_TRANSPARENT Set cursor transparent color
+ makeCursorColorTransparent(pop());
+ break;
+ default:
+ error("o6_cursorCommand: default case %x", subOp);
+ }
+
+ VAR(VAR_CURSORSTATE) = _cursor.state;
+ VAR(VAR_USERPUT) = _userPut;
+}
+
+
} // End of namespace Scumm