[Scummvm-cvs-logs] CVS: scummvm/scumm script_v2.cpp,2.12,2.13

Pawel Kolodziejski aquadran at users.sourceforge.net
Mon Apr 21 07:35:38 CEST 2003


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

Modified Files:
	script_v2.cpp 
Log Message:
added o2_resourceRoutines opcode

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.12
retrieving revision 2.13
diff -u -d -r2.12 -r2.13
--- script_v2.cpp	21 Apr 2003 14:09:16 -0000	2.12
+++ script_v2.cpp	21 Apr 2003 14:20:18 -0000	2.13
@@ -666,10 +666,60 @@
 }
 
 void Scumm_v2::o2_resourceRoutines() {
- int arg1 = getVarOrDirectByte(0x80);
- int arg2 = fetchScriptByte();
+	int resid = getVarOrDirectByte(0x80);
+	int opcode = fetchScriptByte();
 
- printf("o2_resourceRoutines(%d)\n", arg2);
+	if (((opcode & 0x0f) == 0) || ((opcode & 0x0f) == 1)) {
+		switch (opcode & 0xf1) {
+		case 96:
+			lock(rtSound, resid);
+			return;
+		case 97:
+			unlock(rtSound, resid);
+			return;
+		case 80:
+			lock(rtScript, resid);
+			return;
+		case 81:
+			unlock(rtScript, resid);
+			return;
+		case 32:
+			lock(rtCostume, resid);
+			return;
+		case 33:
+			unlock(rtCostume, resid);
+			return;
+		case 48:
+			lock(rtRoom, resid);
+			return;
+		case 49:
+			unlock(rtRoom, resid);
+			return;
+		default:
+			error("o2_resourceRoutines: unknown lock/unlock opcode");
+		}
+	} else {
+		switch (opcode & 0xf1) {
+		case 96:
+		case 80:
+		case 32:
+		case 48:
+			return;
+		case 97:
+			ensureResourceLoaded(rtSound, resid);
+			return;
+		case 81:
+			ensureResourceLoaded(rtScript, resid);
+			return;
+		case 33:
+			ensureResourceLoaded(rtCostume, resid);
+			return;
+		case 49:
+			ensureResourceLoaded(rtRoom, resid);
+		default:
+			error("o2_resourceRoutines: unknown load/nuke opcode");
+		}
+	}
 }
 
 void Scumm_v2::o2_verbOps() {





More information about the Scummvm-git-logs mailing list