From 065e83e44fd16571b251b227c8fb5ffaccbadbed Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 18 Jun 2012 12:20:07 +0300 Subject: 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 --- engines/sci/engine/scriptdebug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') 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]; -- cgit v1.2.3