aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/segment.h
diff options
context:
space:
mode:
authorMatthew Hoops2010-05-18 04:17:58 +0000
committerMatthew Hoops2010-05-18 04:17:58 +0000
commit3dda73d9a2b65da0dad2d184c52f5ebbee682b59 (patch)
treeb6169db546b692ff9ef889826deda4bfa0b76bf4 /engines/sci/engine/segment.h
parent0fe2ba6a0dd1bc7a3edda7ed8deaeba10f39ab9b (diff)
downloadscummvm-rg350-3dda73d9a2b65da0dad2d184c52f5ebbee682b59.tar.gz
scummvm-rg350-3dda73d9a2b65da0dad2d184c52f5ebbee682b59.tar.bz2
scummvm-rg350-3dda73d9a2b65da0dad2d184c52f5ebbee682b59.zip
Add initial support for KQ6 Mac. Wrapper functions for read/writing to pointers are now used (found in util.*) for code that has different endianness in SCI1.1+ Mac games. Add support for Mac 'snd ' and 'CURS' resources. QFG1 Mac is not yet playable due to script compression.
svn-id: r49070
Diffstat (limited to 'engines/sci/engine/segment.h')
-rw-r--r--engines/sci/engine/segment.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 0b60675a6b..28959f087a 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -29,6 +29,7 @@
#include "common/serializer.h"
#include "sci/engine/vm.h"
#include "sci/engine/vm_types.h" // for reg_t
+#include "sci/util.h"
namespace Sci {
@@ -228,16 +229,16 @@ public:
reg_t getClassScriptSelector() { return _variables[4]; }
void setClassScriptSelector(reg_t value) { _variables[4] = value; }
- Selector getVarSelector(uint16 i) { return *(_baseVars + i); }
+ Selector getVarSelector(uint16 i) { return READ_SCI11ENDIAN_UINT16(_baseVars + i); }
reg_t getFunction(uint16 i) {
uint16 offset = (getSciVersion() < SCI_VERSION_1_1) ? _methodCount + 1 + i : i * 2 + 2;
- return make_reg(_pos.segment, READ_LE_UINT16((byte *) (_baseMethod + offset)));
+ return make_reg(_pos.segment, READ_SCI11ENDIAN_UINT16((byte *) (_baseMethod + offset)));
}
Selector getFuncSelector(uint16 i) {
uint16 offset = (getSciVersion() < SCI_VERSION_1_1) ? i : i * 2 + 1;
- return READ_LE_UINT16((byte *) (_baseMethod + offset));
+ return READ_SCI11ENDIAN_UINT16((byte *) (_baseMethod + offset));
}
/**
@@ -280,14 +281,14 @@ public:
_baseMethod = (uint16 *)(data + READ_LE_UINT16(data + SCRIPT_FUNCTAREAPTR_OFFSET));
_methodCount = READ_LE_UINT16(_baseMethod - 1);
} else {
- _variables.resize(READ_LE_UINT16(data + 2));
- _baseVars = (uint16 *)(buf + READ_LE_UINT16(data + 4));
- _baseMethod = (uint16 *)(buf + READ_LE_UINT16(data + 6));
- _methodCount = READ_LE_UINT16(_baseMethod);
+ _variables.resize(READ_SCI11ENDIAN_UINT16(data + 2));
+ _baseVars = (uint16 *)(buf + READ_SCI11ENDIAN_UINT16(data + 4));
+ _baseMethod = (uint16 *)(buf + READ_SCI11ENDIAN_UINT16(data + 6));
+ _methodCount = READ_SCI11ENDIAN_UINT16(_baseMethod);
}
for (uint i = 0; i < _variables.size(); i++)
- _variables[i] = make_reg(0, READ_LE_UINT16(data + (i * 2)));
+ _variables[i] = make_reg(0, READ_SCI11ENDIAN_UINT16(data + (i * 2)));
}
reg_t getVariable(uint var) { return _variables[var]; }