diff options
author | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
commit | 75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch) | |
tree | f29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/sci/engine/kernel_tables.h | |
parent | 48ee83b88957dab86bc763e9ef21a70179fa8679 (diff) | |
parent | e9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff) | |
download | scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2 scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip |
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend
changes into the branch. I suppose the gp2x backend and probably all new
backends, i.e. gph, dingux etc., might not compile anymore.
Since I have no way of testing those it would be nice if porters could look
into getting those up to speed in this branch.
svn-id: r53399
Diffstat (limited to 'engines/sci/engine/kernel_tables.h')
-rw-r--r-- | engines/sci/engine/kernel_tables.h | 142 |
1 files changed, 94 insertions, 48 deletions
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index e71e97e95d..d2c95053d5 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -81,6 +81,8 @@ struct SciKernelMapSubEntry { #define SIG_EVERYWHERE SIG_SCIALL, SIGFOR_ALL #define MAP_CALL(_name_) #_name_, k##_name_ +#define MAP_EMPTY(_name_) #_name_, kEmpty +#define MAP_DUMMY(_name_) #_name_, kDummy // version, subId, function-mapping, signature, workarounds static const SciKernelMapSubEntry kDoSound_subops[] = { @@ -248,7 +250,7 @@ static const SciKernelMapSubEntry kFileIO_subops[] = { static const SciKernelMapSubEntry kList_subops[] = { { SIG_SCI21, 0, MAP_CALL(NewList), "", NULL }, { SIG_SCI21, 1, MAP_CALL(DisposeList), "l", NULL }, - { SIG_SCI21, 2, MAP_CALL(NewNode), ".", NULL }, + { SIG_SCI21, 2, MAP_CALL(NewNode), ".(.)", NULL }, { SIG_SCI21, 3, MAP_CALL(FirstNode), "[l0]", NULL }, { SIG_SCI21, 4, MAP_CALL(LastNode), "l", NULL }, { SIG_SCI21, 5, MAP_CALL(EmptyList), "l", NULL }, @@ -257,20 +259,14 @@ static const SciKernelMapSubEntry kList_subops[] = { { SIG_SCI21, 8, MAP_CALL(NodeValue), "[n0]", NULL }, { SIG_SCI21, 9, MAP_CALL(AddAfter), "lnn.", NULL }, { SIG_SCI21, 10, MAP_CALL(AddToFront), "ln.", NULL }, - { SIG_SCI21, 11, MAP_CALL(AddToEnd), "ln.", NULL }, + { SIG_SCI21, 11, MAP_CALL(AddToEnd), "ln(.)", NULL }, { SIG_SCI21, 12, MAP_CALL(AddBefore), "ln.", NULL }, { SIG_SCI21, 13, MAP_CALL(MoveToFront), "ln", NULL }, { SIG_SCI21, 14, MAP_CALL(MoveToEnd), "ln", NULL }, { SIG_SCI21, 15, MAP_CALL(FindKey), "l.", NULL }, { SIG_SCI21, 16, MAP_CALL(DeleteKey), "l.", NULL }, { SIG_SCI21, 17, MAP_CALL(ListAt), "li", NULL }, - // FIXME: This doesn't seem to be ListIndexOf. In Torin demo, an index is - // passed as a second parameter instead of an object. Thus, it seems to - // be something like ListAt instead... If we swap the two subops though, - // Torin demo crashes complaining that it tried to send to a non-object, - // therefore the semantics might be different here (signature was l[o0]) - // In SQ6 object is passed right when skipping the intro - { SIG_SCI21, 18, MAP_CALL(StubNull), "l[io]", NULL }, + { SIG_SCI21, 18, MAP_CALL(ListIndexOf) , "l[io]", NULL }, { SIG_SCI21, 19, MAP_CALL(ListEachElementDo), "li(.*)", NULL }, { SIG_SCI21, 20, MAP_CALL(ListFirstTrue), "li(.*)", NULL }, { SIG_SCI21, 21, MAP_CALL(ListAllTrue), "li(.*)", NULL }, @@ -323,13 +319,13 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(Display), SIG_EVERYWHERE, "[ir]([ir!]*)", NULL, kDisplay_workarounds }, // ^ we allow invalid references here, because kDisplay gets called with those in e.g. pq3 during intro // restoreBits() checks and skips invalid handles, so that's fine. Sierra SCI behaved the same - { MAP_CALL(DirLoop), SIG_EVERYWHERE, "oi", NULL, NULL }, + { MAP_CALL(DirLoop), SIG_EVERYWHERE, "oi", NULL, kDirLoop_workarounds }, { MAP_CALL(DisposeClone), SIG_EVERYWHERE, "o", NULL, NULL }, { MAP_CALL(DisposeList), SIG_EVERYWHERE, "l", NULL, NULL }, { MAP_CALL(DisposeScript), SIG_EVERYWHERE, "i(i*)", NULL, kDisposeScript_workarounds }, { MAP_CALL(DisposeWindow), SIG_EVERYWHERE, "i(i)", NULL, NULL }, { MAP_CALL(DoAudio), SIG_EVERYWHERE, "i(.*)", NULL, NULL }, // subop - { MAP_CALL(DoAvoider), SIG_EVERYWHERE, "o", NULL, NULL }, + { MAP_CALL(DoAvoider), SIG_EVERYWHERE, "o(i)", NULL, NULL }, { MAP_CALL(DoBresen), SIG_EVERYWHERE, "o", NULL, NULL }, { MAP_CALL(DoSound), SIG_EVERYWHERE, "i(.*)", kDoSound_subops, NULL }, { MAP_CALL(DoSync), SIG_EVERYWHERE, "i(.*)", NULL, NULL }, // subop @@ -409,12 +405,13 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(PriCoord), SIG_EVERYWHERE, "i", NULL, NULL }, { MAP_CALL(Random), SIG_EVERYWHERE, "i(i)(i)", NULL, NULL }, { MAP_CALL(ReadNumber), SIG_EVERYWHERE, "r", NULL, NULL }, + { MAP_CALL(RemapColors), SIG_EVERYWHERE, "i(i)(i)(i)(i)(i)", NULL, NULL }, { MAP_CALL(ResCheck), SIG_EVERYWHERE, "ii(iiii)", NULL, NULL }, { MAP_CALL(RespondsTo), SIG_EVERYWHERE, ".i", NULL, NULL }, { MAP_CALL(RestartGame), SIG_EVERYWHERE, "", NULL, NULL }, - { MAP_CALL(RestoreGame), SIG_EVERYWHERE, "rir", NULL, NULL }, + { MAP_CALL(RestoreGame), SIG_EVERYWHERE, "[r0]i[r0]", NULL, NULL }, { MAP_CALL(Said), SIG_EVERYWHERE, "[r0]", NULL, NULL }, - { MAP_CALL(SaveGame), SIG_EVERYWHERE, "rir(r)", NULL, NULL }, + { MAP_CALL(SaveGame), SIG_EVERYWHERE, "[r0]i[r0](r)", NULL, NULL }, { MAP_CALL(ScriptID), SIG_EVERYWHERE, "[io](i)", NULL, NULL }, { MAP_CALL(SetCursor), SIG_SCI21, SIGFOR_ALL, "i(i)([io])(i*)", NULL, NULL }, // TODO: SCI2.1 may supply an object optionally (mother goose sci21 right on startup) - find out why @@ -430,11 +427,12 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(SetVideoMode), SIG_EVERYWHERE, "i", NULL, NULL }, { MAP_CALL(ShakeScreen), SIG_EVERYWHERE, "(i)(i)", NULL, NULL }, { MAP_CALL(ShowMovie), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_CALL(Show), SIG_EVERYWHERE, "i", NULL, NULL }, { MAP_CALL(SinDiv), SIG_EVERYWHERE, "ii", NULL, NULL }, { MAP_CALL(Sort), SIG_EVERYWHERE, "ooo", NULL, NULL }, { MAP_CALL(Sqrt), SIG_EVERYWHERE, "i", NULL, NULL }, { MAP_CALL(StrAt), SIG_EVERYWHERE, "ri(i)", NULL, kStrAt_workarounds }, - { MAP_CALL(StrCat), SIG_EVERYWHERE, "rr", NULL, NULL }, + { MAP_CALL(StrCat), SIG_EVERYWHERE, "rr", NULL, kStrCat_workarounds }, { MAP_CALL(StrCmp), SIG_EVERYWHERE, "rr(i)", NULL, NULL }, { MAP_CALL(StrCpy), SIG_EVERYWHERE, "r[r0](i)", NULL, NULL }, { MAP_CALL(StrEnd), SIG_EVERYWHERE, "r", NULL, NULL }, @@ -454,8 +452,25 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(ValidPath), SIG_EVERYWHERE, "r", NULL, NULL }, { MAP_CALL(Wait), SIG_EVERYWHERE, "i", NULL, NULL }, + // Unimplemented SCI0-SCI1.1 unused functions, always mapped to kDummy + { MAP_DUMMY(InspectObj), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(ShowSends), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(ShowObjs), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(ShowFree), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(StackUsage), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(Profiler), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(ShiftScreen), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(ListOps), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(ATan), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(Record), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(PlayBack), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(DbugStr), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + + // ======================================================================================================= + #ifdef ENABLE_SCI32 // SCI2 Kernel Functions + // TODO: whoever knows his way through those calls, fix the signatures. { MAP_CALL(AddPlane), SIG_EVERYWHERE, "o", NULL, NULL }, { MAP_CALL(AddScreenItem), SIG_EVERYWHERE, "o", NULL, NULL }, { MAP_CALL(Array), SIG_EVERYWHERE, "(.*)", NULL, NULL }, @@ -471,15 +486,22 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(ListEachElementDo), SIG_EVERYWHERE, "li(.*)", NULL, NULL }, { MAP_CALL(ListFirstTrue), SIG_EVERYWHERE, "li(.*)", NULL, NULL }, { MAP_CALL(ListIndexOf), SIG_EVERYWHERE, "l[o0]", NULL, NULL }, - { MAP_CALL(OnMe), SIG_EVERYWHERE, "iio(.*)", NULL, NULL }, + { "OnMe", kIsOnMe, SIG_EVERYWHERE, "iioi", NULL, NULL }, { MAP_CALL(RepaintPlane), SIG_EVERYWHERE, "o", NULL, NULL }, + { MAP_CALL(SetShowStyle), SIG_EVERYWHERE, "ioiiiii(i)", NULL, NULL }, { MAP_CALL(String), SIG_EVERYWHERE, "(.*)", NULL, NULL }, { MAP_CALL(UpdatePlane), SIG_EVERYWHERE, "o", NULL, NULL }, { MAP_CALL(UpdateScreenItem), SIG_EVERYWHERE, "o", NULL, NULL }, + // SCI2 empty functions + + // Purge is used by the memory manager in SSCI to ensure that X number of bytes (the so called "unmovable + // memory") are available. We have our own memory manager and garbage collector, thus we ignore this call. + { MAP_EMPTY(Purge), SIG_EVERYWHERE, "i", NULL, NULL }, + // SCI2.1 Kernel Functions - { MAP_CALL(CD), SIG_EVERYWHERE, "(.*)", NULL, NULL }, - { MAP_CALL(IsOnMe), SIG_EVERYWHERE, "iio(.*)", NULL, NULL }, + { MAP_CALL(CD), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_CALL(IsOnMe), SIG_EVERYWHERE, "iioi", NULL, NULL }, { MAP_CALL(List), SIG_SCI21, SIGFOR_ALL, "(.*)", kList_subops, NULL }, { MAP_CALL(MulDiv), SIG_EVERYWHERE, "iii", NULL, NULL }, { MAP_CALL(PlayVMD), SIG_EVERYWHERE, "(.*)", NULL, NULL }, @@ -487,8 +509,32 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(Save), SIG_EVERYWHERE, "(.*)", NULL, NULL }, { MAP_CALL(Text), SIG_EVERYWHERE, "(.*)", NULL, NULL }, { MAP_CALL(AddPicAt), SIG_EVERYWHERE, "oiii", NULL, NULL }, - { NULL, NULL, SIG_EVERYWHERE, NULL, NULL, NULL } + { MAP_CALL(GetWindowsOption), SIG_EVERYWHERE, "i", NULL, NULL }, + { MAP_CALL(WinHelp), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_CALL(WinDLL), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_CALL(PrintDebug), SIG_EVERYWHERE, "ri", NULL, NULL }, + + // SCI2.1 empty functions + + // SetWindowsOption is used to set Windows specific options, like for example the title bar visibility of + // the game window in Phantasmagoria 2. We ignore these settings completely. + { MAP_EMPTY(SetWindowsOption), SIG_EVERYWHERE, "ii", NULL, NULL }, + + // Unimplemented SCI2.1 unused functions, always mapped to kDummy + { MAP_DUMMY(InspectObject), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + // Profiler (same as SCI0-SCI1.1) + // Record (same as SCI0-SCI1.1) + // PlayBack (same as SCI0-SCI1.1) + { MAP_DUMMY(MonoOut), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(SetFatalStr), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(IntegrityChecking),SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(CheckIntegrity), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(MarkMemory), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(GetSierraProfileInt), SIG_EVERYWHERE, "(.*)", NULL, NULL }, + { MAP_DUMMY(GetSierraProfileString), SIG_EVERYWHERE, "(.*)", NULL, NULL }, #endif + + { NULL, NULL, SIG_EVERYWHERE, NULL, NULL, NULL } }; /** Default kernel name table. */ @@ -502,7 +548,7 @@ static const char *s_defaultKernelNames[] = { /*0x06*/ "IsObject", /*0x07*/ "RespondsTo", /*0x08*/ "DrawPic", - /*0x09*/ "Dummy", // Show + /*0x09*/ "Show", /*0x0a*/ "PicNotValid", /*0x0b*/ "Animate", /*0x0c*/ "SetNowSeen", @@ -574,20 +620,20 @@ static const char *s_defaultKernelNames[] = { /*0x4a*/ "ReadNumber", /*0x4b*/ "BaseSetter", /*0x4c*/ "DirLoop", - /*0x4d*/ "CanBeHere", // CantBeHere in newer SCI versions + /*0x4d*/ "CanBeHere", // CantBeHere in newer SCI versions /*0x4e*/ "OnControl", /*0x4f*/ "InitBresen", /*0x50*/ "DoBresen", - /*0x51*/ "Platform", // DoAvoider (SCI0) + /*0x51*/ "Platform", // DoAvoider (SCI0) /*0x52*/ "SetJump", - /*0x53*/ "SetDebug", - /*0x54*/ "Dummy", // InspectObj - /*0x55*/ "Dummy", // ShowSends - /*0x56*/ "Dummy", // ShowObjs - /*0x57*/ "Dummy", // ShowFree + /*0x53*/ "SetDebug", // for debugging + /*0x54*/ "InspectObj", // for debugging + /*0x55*/ "ShowSends", // for debugging + /*0x56*/ "ShowObjs", // for debugging + /*0x57*/ "ShowFree", // for debugging /*0x58*/ "MemoryInfo", - /*0x59*/ "Dummy", // StackUsage - /*0x5a*/ "Dummy", // Profiler + /*0x59*/ "StackUsage", // for debugging + /*0x5a*/ "Profiler", // for debugging /*0x5b*/ "GetMenu", /*0x5c*/ "SetMenu", /*0x5d*/ "GetSaveFiles", @@ -608,33 +654,33 @@ static const char *s_defaultKernelNames[] = { /*0x6c*/ "Graph", /*0x6d*/ "Joystick", // End of kernel function table for SCI0 - /*0x6e*/ "Dummy", // ShiftScreen + /*0x6e*/ "ShiftScreen", // never called? /*0x6f*/ "Palette", /*0x70*/ "MemorySegment", /*0x71*/ "Intersections", // MoveCursor (SCI1 late), PalVary (SCI1.1) /*0x72*/ "Memory", - /*0x73*/ "Dummy", // ListOps + /*0x73*/ "ListOps", // never called? /*0x74*/ "FileIO", /*0x75*/ "DoAudio", /*0x76*/ "DoSync", /*0x77*/ "AvoidPath", - /*0x78*/ "Sort", // StrSplit (SCI01) - /*0x79*/ "Dummy", // ATan + /*0x78*/ "Sort", // StrSplit (SCI01) + /*0x79*/ "ATan", // never called? /*0x7a*/ "Lock", /*0x7b*/ "StrSplit", - /*0x7c*/ "GetMessage", // Message (SCI1.1) + /*0x7c*/ "GetMessage", // Message (SCI1.1) /*0x7d*/ "IsItSkip", /*0x7e*/ "MergePoly", /*0x7f*/ "ResCheck", /*0x80*/ "AssertPalette", /*0x81*/ "TextColors", /*0x82*/ "TextFonts", - /*0x83*/ "Dummy", // Record - /*0x84*/ "Dummy", // PlayBack + /*0x83*/ "Record", // for debugging + /*0x84*/ "PlayBack", // for debugging /*0x85*/ "ShowMovie", /*0x86*/ "SetVideoMode", /*0x87*/ "SetQuitStr", - /*0x88*/ "Dummy" // DbugStr + /*0x88*/ "DbugStr" // for debugging }; #ifdef ENABLE_SCI32 @@ -757,13 +803,13 @@ static const char *sci2_default_knames[] = { /*0x70*/ "InPolygon", /*0x71*/ "MergePoly", /*0x72*/ "SetDebug", - /*0x73*/ "InspectObject", + /*0x73*/ "InspectObject", // for debugging /*0x74*/ "MemoryInfo", - /*0x75*/ "Profiler", - /*0x76*/ "Record", - /*0x77*/ "PlayBack", - /*0x78*/ "MonoOut", - /*0x79*/ "SetFatalStr", + /*0x75*/ "Profiler", // for debugging + /*0x76*/ "Record", // for debugging + /*0x77*/ "PlayBack", // for debugging + /*0x78*/ "MonoOut", // for debugging + /*0x79*/ "SetFatalStr", // for debugging /*0x7a*/ "GetCWD", /*0x7b*/ "ValidPath", /*0x7c*/ "FileIO", @@ -775,10 +821,10 @@ static const char *sci2_default_knames[] = { /*0x82*/ "Array", /*0x83*/ "String", /*0x84*/ "RemapColors", - /*0x85*/ "IntegrityChecking", - /*0x86*/ "CheckIntegrity", + /*0x85*/ "IntegrityChecking", // for debugging + /*0x86*/ "CheckIntegrity", // for debugging /*0x87*/ "ObjectIntersect", - /*0x88*/ "MarkMemory", + /*0x88*/ "MarkMemory", // for debugging /*0x89*/ "TextWidth", /*0x8a*/ "PointSize", @@ -934,7 +980,7 @@ static const char *sci21_default_knames[] = { /*0x7c*/ "SetQuitStr", /*0x7d*/ "GetConfig", /*0x7e*/ "Table", - /*0x7f*/ "WinHelp", // Windows only + /*0x7f*/ "WinHelp", // Windows only /*0x80*/ "Dummy", /*0x81*/ "Dummy", /*0x82*/ "Dummy", @@ -956,8 +1002,8 @@ static const char *sci21_default_knames[] = { /*0x92*/ "PlayVMD", /*0x93*/ "SetHotRectangles", /*0x94*/ "MulDiv", - /*0x95*/ "GetSierraProfileInt", // Windows only - /*0x96*/ "GetSierraProfileString", // Windows only + /*0x95*/ "GetSierraProfileInt", // , Windows only + /*0x96*/ "GetSierraProfileString", // , Windows only /*0x97*/ "SetWindowsOption", // Windows only /*0x98*/ "GetWindowsOption", // Windows only /*0x99*/ "WinDLL", // Windows only |