aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2012-06-18 12:20:07 +0300
committerFilippos Karapetis2012-06-18 12:20:07 +0300
commit065e83e44fd16571b251b227c8fb5ffaccbadbed (patch)
tree7d863b2814977373b0f6ff540fcad1021981828e /engines/sci
parent2b50824133ced47f1d8fb6407a1e0212a7eeb41c (diff)
downloadscummvm-rg350-065e83e44fd16571b251b227c8fb5ffaccbadbed.tar.gz
scummvm-rg350-065e83e44fd16571b251b227c8fb5ffaccbadbed.tar.bz2
scummvm-rg350-065e83e44fd16571b251b227c8fb5ffaccbadbed.zip
SCI: Store script sizes in 32-bit integers
Since scripts can be larger than 64KB, and getBufSize() returns a 32-bit integer, adapt variables that store script sizes accordingly
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/console.cpp4
-rw-r--r--engines/sci/engine/scriptdebug.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 7e9f9b1c38..91795117e3 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2630,7 +2630,7 @@ bool Console::cmdViewReference(int argc, const char **argv) {
#endif
default: {
const SegmentRef block = _engine->_gamestate->_segMan->dereference(reg);
- uint16 size = block.maxSize;
+ uint32 size = block.maxSize;
DebugPrintf("raw data\n");
@@ -2936,7 +2936,7 @@ bool Console::cmdDisassembleAddress(int argc, const char **argv) {
uint opCount = 1;
bool printBWTag = false;
bool printBytes = false;
- uint16 size;
+ uint32 size;
if (parse_reg_t(_engine->_gamestate, argv[1], &vpc, false)) {
DebugPrintf("Invalid address passed.\n");
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 6242dc4c93..f55884b1c0 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -72,7 +72,7 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode
SegmentObj *mobj = s->_segMan->getSegment(pos.getSegment(), SEG_TYPE_SCRIPT);
Script *script_entity = NULL;
const byte *scr;
- uint scr_size;
+ uint32 scr_size;
reg_t retval = make_reg(pos.getSegment(), pos.getOffset() + 1);
uint16 param_value = 0xffff; // Suppress GCC warning by setting default value, chose value as invalid to getKernelName etc.
uint i = 0;
@@ -344,7 +344,7 @@ void SciEngine::scriptDebug() {
if (mobj) {
Script *scr = (Script *)mobj;
const byte *code_buf = scr->getBuf();
- uint16 code_buf_size = scr->getBufSize();
+ uint32 code_buf_size = scr->getBufSize();
int opcode = pc.getOffset() >= code_buf_size ? 0 : code_buf[pc.getOffset()];
int op = opcode >> 1;
int paramb1 = pc.getOffset() + 1 >= code_buf_size ? 0 : code_buf[pc.getOffset() + 1];