[Scummvm-cvs-logs] scummvm master -> 065e83e44fd16571b251b227c8fb5ffaccbadbed

bluegr md5 at scummvm.org
Mon Jun 18 11:22:50 CEST 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
065e83e44f SCI: Store script sizes in 32-bit integers


Commit: 065e83e44fd16571b251b227c8fb5ffaccbadbed
    https://github.com/scummvm/scummvm/commit/065e83e44fd16571b251b227c8fb5ffaccbadbed
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-06-18T02:20:07-07:00

Commit Message:
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

Changed paths:
    engines/sci/console.cpp
    engines/sci/engine/scriptdebug.cpp



diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 7e9f9b1..9179511 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 6242dc4..f55884b 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];






More information about the Scummvm-git-logs mailing list