[Scummvm-cvs-logs] SF.net SVN: scummvm:[40719] scummvm/trunk/engines/sci

waltervn at users.sourceforge.net waltervn at users.sourceforge.net
Tue May 19 04:10:58 CEST 2009


Revision: 40719
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40719&view=rev
Author:   waltervn
Date:     2009-05-19 02:10:58 +0000 (Tue, 19 May 2009)

Log Message:
-----------
SCI: Added some stubs for LSL6CD (lores).

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/kscripts.cpp
    scummvm/trunk/engines/sci/engine/kstring.cpp
    scummvm/trunk/engines/sci/resource.cpp
    scummvm/trunk/engines/sci/resource.h
    scummvm/trunk/engines/sci/vocab_debug.cpp

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-05-19 01:58:51 UTC (rev 40718)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-05-19 02:10:58 UTC (rev 40719)
@@ -203,6 +203,8 @@
 	DEFUN("Message", kMessage, ".*"),
 	DEFUN("DoAudio", kDoAudio, ".*"),
 	DEFUN("DoSync", kDoSync, ".*"),
+	DEFUN("ResCheck", kResCheck, "iii*"),
+	DEFUN("SetQuitStr", kSetQuitStr, "r"),
 
 	// Special and NOP stuff
 	{KF_NEW, NULL, k_Unknown, NULL},
@@ -763,12 +765,12 @@
 	void *retval = s->seg_manager->dereference(pointer, &maxsize);
 
 	if (pointer.offset & (align - 1)) {
-		error("Unaligned pointer read: "PREG" expected with %d alignment!\n", PRINT_REG(pointer), align);
+		warning("Unaligned pointer read: "PREG" expected with %d alignment", PRINT_REG(pointer), align);
 		return NULL;
 	}
 
 	if (entries > maxsize) {
-		error("Trying to dereference pointer "PREG" beyond end of segment!\n", PRINT_REG(pointer));
+		warning("Trying to dereference pointer "PREG" beyond end of segment", PRINT_REG(pointer));
 		return NULL;
 	}
 	return retval;

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2009-05-19 01:58:51 UTC (rev 40718)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2009-05-19 02:10:58 UTC (rev 40719)
@@ -446,6 +446,8 @@
 reg_t kMessage(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kDoSync(EngineState *s, int funct_nr, int argc, reg_t *argv);
+reg_t kResCheck(EngineState *s, int funct_nr, int argc, reg_t *argv);
+reg_t kSetQuitStr(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t k_Unknown(EngineState *s, int funct_nr, int argc, reg_t *argv);
 
 // The Unknown/Unnamed kernel function

Modified: scummvm/trunk/engines/sci/engine/kscripts.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-05-19 01:58:51 UTC (rev 40718)
+++ scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-05-19 02:10:58 UTC (rev 40719)
@@ -154,6 +154,29 @@
 	return s->r_acc;
 }
 
+reg_t kResCheck(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+	ResourceType restype = (ResourceType)(UKPV(0) & 0x7f);
+
+	switch (restype) {
+	case kResourceTypeAudio36:
+	case kResourceTypeSync36: {
+		assert(argc >= 6);
+
+		uint module = UKPV(1);
+		uint noun = UKPV(2);
+		uint verb = UKPV(3);
+		uint cond = UKPV(4);
+		uint seq = UKPV(5);
+		warning("ResCheck: checking for currently unsupported %s resource: module %i; tuple (%i, %i, %i, %i)",
+				getResourceTypeName(restype), module, noun, verb, cond, seq);
+		return NULL_REG;
+	}
+	default:
+		Resource *res = s->resmgr->testResource(restype, UKPV(1));
+		return make_reg(0, res != NULL);
+	}
+}
+
 reg_t kClone(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	reg_t parent_addr = argv[0];
 	Object *parent_obj = obj_get(s, parent_addr);

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-05-19 01:58:51 UTC (rev 40718)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-05-19 02:10:58 UTC (rev 40719)
@@ -803,4 +803,10 @@
 	return NULL_REG;
 }
 
+reg_t kSetQuitStr(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+        char *quitStr = kernel_dereference_char_pointer(s, argv[0], 0);
+        debug("Setting quit string to '%s'", quitStr);
+        return s->r_acc;
+}
+
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2009-05-19 01:58:51 UTC (rev 40718)
+++ scummvm/trunk/engines/sci/resource.cpp	2009-05-19 02:10:58 UTC (rev 40719)
@@ -70,19 +70,20 @@
 	"SCI version is unsupported"
 };
 
-// These are the 18 resource types supported by SCI1
+// These are the 20 resource types supported by SCI1.1
 const char *resourceTypeNames[] = {
 	"view", "pic", "script", "text", "sound",
 	"memory", "vocab", "font", "cursor",
 	"patch", "bitmap", "palette", "cdaudio",
-	"audio", "sync", "message", "map", "heap"
+	"audio", "sync", "message", "map", "heap",
+	"audio36", "sync36"
 };
 
 const char *resourceTypeSuffixes[] = {
 	"v56", "p56", "scr", "tex", "snd",
 	"   ", "voc", "fon", "cur", "pat",
 	"bit", "pal", "cda", "aud", "syn",
-	"msg", "map", "hep"
+	"msg", "map", "hep", "aud", "syn"
 };
 
 const char *getResourceTypeName(ResourceType restype) {

Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h	2009-05-19 01:58:51 UTC (rev 40718)
+++ scummvm/trunk/engines/sci/resource.h	2009-05-19 02:10:58 UTC (rev 40719)
@@ -111,6 +111,8 @@
 	kResourceTypeMessage,
 	kResourceTypeMap,
 	kResourceTypeHeap,
+	kResourceTypeAudio36,
+	kResourceTypeSync36,
 	kResourceTypeInvalid
 };
 

Modified: scummvm/trunk/engines/sci/vocab_debug.cpp
===================================================================
--- scummvm/trunk/engines/sci/vocab_debug.cpp	2009-05-19 01:58:51 UTC (rev 40718)
+++ scummvm/trunk/engines/sci/vocab_debug.cpp	2009-05-19 02:10:58 UTC (rev 40719)
@@ -32,7 +32,7 @@
 // Default kernel name table
 #define SCI0_KNAMES_WELL_DEFINED 0x6e
 #define SCI0_KNAMES_DEFAULT_ENTRIES_NR 0x72
-#define SCI1_KNAMES_DEFAULT_ENTRIES_NR 0x7E
+#define SCI1_KNAMES_DEFAULT_ENTRIES_NR 0x89
 
 static const char *sci0_default_knames[SCI0_KNAMES_DEFAULT_ENTRIES_NR] = {
 	/*0x00*/ "Load",
@@ -233,7 +233,7 @@
 	/*0x4e*/ "OnControl",
 	/*0x4f*/ "InitBresen",
 	/*0x50*/ "DoBresen",
-	/*0x51*/ SCRIPT_UNKNOWN_FUNCTION_STRING, // DoAvoider is not implemented in SCI1
+	/*0x51*/ "Platform",
 	/*0x52*/ "SetJump",
 	/*0x53*/ "SetDebug",
 	/*0x54*/ "InspectObj",
@@ -277,7 +277,18 @@
 	/*0x7a*/ "Lock",         
 	/*0x7b*/ "StrSplit",       
 	/*0x7c*/ "Message",
-	/*0x7d*/ "IsItSkip"
+	/*0x7d*/ "IsItSkip",
+	/*0x7e*/ "MergePoly",
+	/*0x7f*/ "ResCheck",
+	/*0x80*/ "AssertPalette",
+	/*0x81*/ "TextColors",
+	/*0x82*/ "TextFonts",
+	/*0x83*/ "Record",
+	/*0x84*/ "PlayBack",
+	/*0x85*/ SCRIPT_UNKNOWN_FUNCTION_STRING,
+	/*0x86*/ "SetVideoMode",
+	/*0x87*/ "SetQuitStr",
+	/*0x88*/ "DbugStr"
 };
 
 #if 0


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list