diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kernel.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/kernel.h | 2 | ||||
-rw-r--r-- | engines/sci/engine/kscripts.cpp | 23 | ||||
-rw-r--r-- | engines/sci/engine/kstring.cpp | 6 | ||||
-rw-r--r-- | engines/sci/resource.cpp | 7 | ||||
-rw-r--r-- | engines/sci/resource.h | 2 | ||||
-rw-r--r-- | engines/sci/vocab_debug.cpp | 17 |
7 files changed, 55 insertions, 8 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 53be31b2a3..2d6c63d413 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -203,6 +203,8 @@ SciKernelFunction kfunct_mappers[] = { 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 @@ static void *_kernel_dereference_pointer(EngineState *s, reg_t pointer, int entr 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; diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index cb5fa36be1..65d79a5da4 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -446,6 +446,8 @@ reg_t kIsItSkip(EngineState *s, int funct_nr, int argc, reg_t *argv); 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 diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index f0de8e6a5f..1c8e5ccdac 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -154,6 +154,29 @@ reg_t kUnLoad(EngineState *s, int funct_nr, int argc, reg_t *argv) { 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); diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index b2e9ebf893..a4fdbc4652 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -803,4 +803,10 @@ reg_t kMessage(EngineState *s, int funct_nr, int argc, reg_t *argv) { 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 diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 71624c4509..8027d8d1db 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -70,19 +70,20 @@ const char *sci_error_types[] = { "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) { diff --git a/engines/sci/resource.h b/engines/sci/resource.h index 5e6f2e7e5e..33daa71e37 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -111,6 +111,8 @@ enum ResourceType { kResourceTypeMessage, kResourceTypeMap, kResourceTypeHeap, + kResourceTypeAudio36, + kResourceTypeSync36, kResourceTypeInvalid }; diff --git a/engines/sci/vocab_debug.cpp b/engines/sci/vocab_debug.cpp index 9dda66d617..fc639b4853 100644 --- a/engines/sci/vocab_debug.cpp +++ b/engines/sci/vocab_debug.cpp @@ -32,7 +32,7 @@ namespace Sci { // 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 @@ static const char *sci1_default_knames[SCI1_KNAMES_DEFAULT_ENTRIES_NR] = { /*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 @@ static const char *sci1_default_knames[SCI1_KNAMES_DEFAULT_ENTRIES_NR] = { /*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 |