From fa014867cfe6bde10467761e1241b646ecb0460f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 1 Jul 2010 20:16:42 +0000 Subject: SCI: Mark the ShiftScreen, ListOps and ATan SCI1 kernel functions as unused (dummy) - we haven't seen them being used anywhere. Added a check and an error in case a kernel function which is considered to be unused is called. svn-id: r50567 --- engines/sci/engine/kernel.cpp | 17 +++-------------- engines/sci/engine/vm.cpp | 5 +++++ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index b0c369605e..58619986cb 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -170,18 +170,18 @@ static const char *s_defaultKernelNames[] = { /*0x6c*/ "Graph", /*0x6d*/ "Joystick", // End of kernel function table for SCI0 - /*0x6e*/ "ShiftScreen", + /*0x6e*/ "Dummy", // ShiftScreen /*0x6f*/ "Palette", /*0x70*/ "MemorySegment", /*0x71*/ "Intersections", // MoveCursor (SCI1 late), PalVary (SCI1.1) /*0x72*/ "Memory", - /*0x73*/ "ListOps", + /*0x73*/ "Dummy", // ListOps /*0x74*/ "FileIO", /*0x75*/ "DoAudio", /*0x76*/ "DoSync", /*0x77*/ "AvoidPath", /*0x78*/ "Sort", // StrSplit (SCI01) - /*0x79*/ "ATan", + /*0x79*/ "Dummy", // ATan /*0x7a*/ "Lock", /*0x7b*/ "StrSplit", /*0x7c*/ "GetMessage", // Message (SCI1.1) @@ -429,17 +429,6 @@ static SciKernelMapEntry s_kernelMap[] = { #endif }; -#if 0 - // Stub functions - /*09*/ { "Show", kShow, "i" }, - { "ShiftScreen", kShiftScreen, ".*" }, - { "ListOps", kListOps, ".*" }, - { "ATan", kATan, ".*" }, - { "Record", kRecord, ".*" }, - { "PlayBack", kPlayBack, ".*" }, - { "DbugStr", kDbugStr, ".*" }, -#endif - Kernel::Kernel(ResourceManager *resMan, SegManager *segMan) : _resMan(resMan), _segMan(segMan), _invalid("") { loadSelectorNames(); diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 32aad38880..49049585ee 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -852,6 +852,11 @@ static void callKernelFunc(EngineState *s, int kernelFuncNr, int argc) { } warning("%s", warningMsg.c_str()); + + // Make sure that the game doesn't call a function that is considered unused. If + // that happens, error out. + if (kernelCall.origName == "Dummy") + error("Kernel function %d was called, which was considered to be unused", kernelFuncNr); } } -- cgit v1.2.3