aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/kernel.cpp')
-rw-r--r--engines/sci/engine/kernel.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 6f783d79e8..c99bc4fe47 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -914,28 +914,32 @@ Common::String Kernel::lookupText(reg_t address, int index) {
// TODO: script_adjust_opcode_formats should probably be part of the
// constructor (?) of a VirtualMachine or a ScriptManager class.
void script_adjust_opcode_formats() {
+
+ g_sci->_opcode_formats = new opcode_format[128][4];
+ memcpy(g_sci->_opcode_formats, g_base_opcode_formats, 128*4*sizeof(opcode_format));
+
if (g_sci->_features->detectLofsType() != SCI_VERSION_0_EARLY) {
- g_opcode_formats[op_lofsa][0] = Script_Offset;
- g_opcode_formats[op_lofss][0] = Script_Offset;
+ g_sci->_opcode_formats[op_lofsa][0] = Script_Offset;
+ g_sci->_opcode_formats[op_lofss][0] = Script_Offset;
}
#ifdef ENABLE_SCI32
// In SCI32, some arguments are now words instead of bytes
if (getSciVersion() >= SCI_VERSION_2) {
- g_opcode_formats[op_calle][2] = Script_Word;
- g_opcode_formats[op_callk][1] = Script_Word;
- g_opcode_formats[op_super][1] = Script_Word;
- g_opcode_formats[op_send][0] = Script_Word;
- g_opcode_formats[op_self][0] = Script_Word;
- g_opcode_formats[op_call][1] = Script_Word;
- g_opcode_formats[op_callb][1] = Script_Word;
+ g_sci->_opcode_formats[op_calle][2] = Script_Word;
+ g_sci->_opcode_formats[op_callk][1] = Script_Word;
+ g_sci->_opcode_formats[op_super][1] = Script_Word;
+ g_sci->_opcode_formats[op_send][0] = Script_Word;
+ g_sci->_opcode_formats[op_self][0] = Script_Word;
+ g_sci->_opcode_formats[op_call][1] = Script_Word;
+ g_sci->_opcode_formats[op_callb][1] = Script_Word;
}
if (getSciVersion() >= SCI_VERSION_3) {
// TODO: There are also opcodes in
// here to get the superclass, and possibly the species too.
- g_opcode_formats[0x4d/2][0] = Script_None;
- g_opcode_formats[0x4e/2][0] = Script_None;
+ g_sci->_opcode_formats[0x4d/2][0] = Script_None;
+ g_sci->_opcode_formats[0x4e/2][0] = Script_None;
}
#endif
}