[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.8,2.9 resource.cpp,1.34,1.35 script_v8.cpp,2.9,2.10

Max Horn fingolfin at users.sourceforge.net
Mon Dec 23 09:22:03 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv6931

Modified Files:
	intern.h resource.cpp script_v8.cpp 
Log Message:
some flesh to the V8 bones

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -d -r2.8 -r2.9
--- intern.h	23 Dec 2002 15:46:53 -0000	2.8
+++ intern.h	23 Dec 2002 17:21:09 -0000	2.9
@@ -410,7 +410,7 @@
 
 	void o8_dim();
 	void o8_dim2();
-	void o8_arrayAssign();
+	void o8_arrayOps();
 	void o8_printLine();
 	void o8_printCursor();
 	void o8_printDebug();

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- resource.cpp	23 Dec 2002 16:17:23 -0000	1.34
+++ resource.cpp	23 Dec 2002 17:21:09 -0000	1.35
@@ -1656,8 +1656,6 @@
 }
 
 
-
-
 bool Scumm::isGlobInMemory(int type, int idx)
 {
 	if (!validateResource("isGlobInMemory", type, idx))

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -d -r2.9 -r2.10
--- script_v8.cpp	23 Dec 2002 15:46:53 -0000	2.9
+++ script_v8.cpp	23 Dec 2002 17:21:09 -0000	2.10
@@ -183,7 +183,7 @@
 		/* 74 */
 		OPCODE(o8_dim2),
 		OPCODE(o6_wordArrayIndexedWrite),
-		OPCODE(o8_arrayAssign),
+		OPCODE(o8_arrayOps),
 		OPCODE(o8_unknown),
 		/* 78 */
 		OPCODE(o8_unknown),
@@ -424,14 +424,60 @@
 
 void Scumm_v8::o8_dim()
 {
+	byte subOp = fetchScriptByte();
+	int array = fetchScriptWord();
+	
+	switch (subOp) {
+	case 0x0A:		// SO_ARRAY_SCUMMVAR
+		defineArray(array, 5, 0, pop());
+		break;
+	case 0x0B:		// SO_ARRAY_STRING
+		defineArray(array, 4, 0, pop());
+		break;
+	case 0x0C:		// SO_ARRAY_UNDIM
+		nukeArray(array);
+		break;
+	default:
+		error("o8_dim: default case %d", subOp);
+	}
 }
 
 void Scumm_v8::o8_dim2()
 {
+	byte subOp = fetchScriptByte();
+	int array = fetchScriptWord(), a, b;
+	
+	switch (subOp) {
+	case 0x0A:		// SO_ARRAY_SCUMMVAR
+		b = pop();
+		a = pop();
+		defineArray(array, 5, a, b);
+		break;
+	case 0x0B:		// SO_ARRAY_STRING
+		b = pop();
+		a = pop();
+		defineArray(array, 4, a, b);
+		break;
+	case 0x0C:		// SO_ARRAY_UNDIM
+		nukeArray(array);
+		break;
+	default:
+		error("o8_dim2: default case %d", subOp);
+	}
 }
 
-void Scumm_v8::o8_arrayAssign()
+void Scumm_v8::o8_arrayOps()
 {
+	byte subOp = fetchScriptByte();
+	int array = fetchScriptWord();
+	
+	switch (subOp) {
+	case 0x14:		// SO_ASSIGN_STRING
+	case 0x15:		// SO_ASSIGN_SCUMMVAR_LIST
+	case 0x16:		// SO_ASSIGN_2DIM_LIST
+	default:
+		error("o8_arrayOps: default case %d (array %d)", subOp, array);
+	}
 }
 
 void Scumm_v8::o8_printLine()
@@ -478,25 +524,64 @@
 {
 	// TODO
 	byte subOp = fetchScriptByte();
+	int resid = pop();
+
 	switch (subOp) {
 	case 0x3C:		// SO_HEAP_LOAD_CHARSET Load character set to heap
+		ensureResourceLoaded(rtCharset, resid);	// FIXME - is this correct?
+		break;
 	case 0x3D:		// SO_HEAP_LOAD_COSTUME Load costume to heap
+		ensureResourceLoaded(rtCostume, resid);
+		break;
 	case 0x3E:		// SO_HEAP_LOAD_OBJECT Load object to heap
+		// TODO - is 'object' in COMI the same as FlObject in Sam&Max ?!?
+		break;
 	case 0x3F:		// SO_HEAP_LOAD_ROOM Load room to heap
+		ensureResourceLoaded(rtRoom, resid);
+		break;
 	case 0x40:		// SO_HEAP_LOAD_SCRIPT Load script to heap
+		ensureResourceLoaded(rtScript, resid);
+		break;
 	case 0x41:		// SO_HEAP_LOAD_SOUND Load sound to heap
+		ensureResourceLoaded(rtSound, resid);
+		break;
+
 	case 0x42:		// SO_HEAP_LOCK_COSTUME Lock costume in heap
+		lock(rtCostume, resid);
+		break;
 	case 0x43:		// SO_HEAP_LOCK_ROOM Lock room in heap
+		lock(rtRoom, resid);
+		break;
 	case 0x44:		// SO_HEAP_LOCK_SCRIPT Lock script in heap
+		lock(rtScript, resid);
+		break;
 	case 0x45:		// SO_HEAP_LOCK_SOUND Lock sound in heap
+		lock(rtSound, resid);
+		break;
 	case 0x46:		// SO_HEAP_UNLOCK_COSTUME Unlock costume
+		unlock(rtCostume, resid);
+		break;
 	case 0x47:		// SO_HEAP_UNLOCK_ROOM Unlock room
+		unlock(rtRoom, resid);
+		break;
 	case 0x48:		// SO_HEAP_UNLOCK_SCRIPT Unlock script
+		unlock(rtScript, resid);
+		break;
 	case 0x49:		// SO_HEAP_UNLOCK_SOUND Unlock sound
+		unlock(rtSound, resid);
+		break;
 	case 0x4A:		// SO_HEAP_NUKE_COSTUME Remove costume from heap
+		setResourceCounter(rtCostume, resid, 0x7F);
+		break;
 	case 0x4B:		// SO_HEAP_NUKE_ROOM Remove room from heap
+		setResourceCounter(rtRoom, resid, 0x7F);
+		break;
 	case 0x4C:		// SO_HEAP_NUKE_SCRIPT Remove script from heap
+		setResourceCounter(rtScript, resid, 0x7F);
+		break;
 	case 0x4D:		// SO_HEAP_NUKE_SOUND Remove sound from heap
+		setResourceCounter(rtSound, resid, 0x7F);
+		break;
 	default:
 		error("o8_resourceRoutines: default case %d", subOp);
 	}





More information about the Scummvm-git-logs mailing list