[Scummvm-cvs-logs] CVS: scummvm/sky logic.cpp,1.7,1.8 debug.cpp,1.2,1.3

Oliver Kiehl olki at users.sourceforge.net
Sat Apr 26 02:44:08 CEST 2003


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv32387

Modified Files:
	logic.cpp debug.cpp 
Log Message:
some more endian fixes. runs on my mac now as well


Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/logic.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- logic.cpp	25 Apr 2003 21:41:50 -0000	1.7
+++ logic.cpp	26 Apr 2003 09:43:48 -0000	1.8
@@ -426,7 +426,7 @@
 	if (scr & 0xffff0000)
 		scriptData = moduleStart + (scr >> 16);
 	else
-		scriptData += *(scriptData + (scr & 0x0fff));
+		scriptData += READ_LE_UINT16(scriptData + (scr & 0x0fff));
 
 	uint32 a, b, c;
 	uint16 command, mcode, s;
@@ -434,12 +434,12 @@
 	int16 t;
 
 	for (;;) {
-		command = *scriptData++; // get a command
+		command = READ_LE_UINT16(scriptData++); // get a command
 		SkyDebug::script(command, scriptData);
 
 		switch (command) {
 		case 0: // push_variable
-			s = *scriptData++; // get variable number
+			s = READ_LE_UINT16(scriptData++); // get variable number
 			push( _scriptVariables[s/4] );
 			break;
 		case 1: // less_than
@@ -451,7 +451,7 @@
 				push(0);
 			break;
 		case 2: // push_number
-			push(*scriptData++);
+			push(READ_LE_UINT16(scriptData++));
 			break;
 		case 3: // not_equal
 			a = pop();
@@ -470,14 +470,14 @@
 				push(0);
 			break;
 		case 5: // skip_zero
-			s = *scriptData++;
+			s = READ_LE_UINT16(scriptData++);
 
 			a = pop();
 			if (!a)
 				scriptData += s/2;
 			break;
 		case 6: // pop_var
-			s = *scriptData++;
+			s = READ_LE_UINT16(scriptData++);
 			_scriptVariables[s/4] = pop();
 			break;
 		case 7: // minus
@@ -491,7 +491,7 @@
 			push(b+a);
 			break;
 		case 9: // skip_always
-			s = *scriptData++;
+			s = READ_LE_UINT16(scriptData++);
 			scriptData += s/2;
 			break;
 		case 10: // if_or
@@ -503,7 +503,7 @@
 				push(0);
 			break;
 		case 11: // call_mcode
-			s = *scriptData++;
+			s = READ_LE_UINT16(scriptData++);
 
 			a = s;
 			b = c = 0;
@@ -519,7 +519,7 @@
 			}
 
 			// TODO: save stuff (compare asm code)
-			mcode = *scriptData++/4; // get mcode number
+			mcode = READ_LE_UINT16(scriptData++)/4; // get mcode number
 			SkyDebug::mcode(mcode, a, b, c);
 
 			a = (this->*mcodeTable[mcode]) (a, b, c);
@@ -536,7 +536,7 @@
 				push(0);
 			break;
 		case 14: // switch
-			s = *scriptData++; // get number of cases
+			s = READ_LE_UINT16(scriptData++); // get number of cases
 
 			a = pop(); // and value to switch on
 
@@ -549,20 +549,20 @@
 				scriptData += 2;
 			} while (--s);
 
-			s = *scriptData++;
+			s = READ_LE_UINT16(scriptData++);
 			scriptData += s; // use the default
 			scriptData--;
 			break;
 		case 15: // push_offset
 			// Push a compact access
-			s = *scriptData++;
+			s = READ_LE_UINT16(scriptData++);
 			tmp = (uint16 *)SkyCompact::getCompactElem(compact, s);
 			printf("push_offset: %d\n", *tmp);
 			push(*tmp);
 			break;
 		case 16: // pop_offset
 			// pop a value into a compact
-			s = *scriptData++;
+			s = READ_LE_UINT16(scriptData++);
 			tmp = (uint16 *)SkyCompact::getCompactElem(compact, s);
 			*tmp = (uint16)pop();
 			break;
@@ -575,7 +575,7 @@
 				push(0);
 			break;
 		case 18: // skip_nz
-			t = *scriptData++;
+			t = READ_LE_UINT16(scriptData++);
 			a = pop();
 			if (a)
 				scriptData += t/2;

Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/debug.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- debug.cpp	25 Apr 2003 15:37:52 -0000	1.2
+++ debug.cpp	26 Apr 2003 09:43:48 -0000	1.3
@@ -409,7 +409,7 @@
 	int i;
 	printf("SCRIPT: %s", opcodes[command]);
 	for (i = 0; i < opcode_par[command]; i++)
-		printf(" %d", *(scriptData + i));
+		printf(" %d", READ_LE_UINT16(scriptData + i));
 	printf("\n");
 }
 





More information about the Scummvm-git-logs mailing list