- Fix the opcode formats for some opcodes in SCI32 (some arguments are now words instead of bytes).

- Fix the SCI2.1 kernel table.
- Add DoSound detection for SCI2.

svn-id: r43762
This commit is contained in:
Matthew Hoops 2009-08-26 22:11:31 +00:00
parent 0a40bb4d88
commit 2ceafbae77
3 changed files with 163 additions and 169 deletions

View File

@ -172,182 +172,160 @@ static const char *sci2_default_knames[] = {
};
static const char *sci21_default_knames[] = {
/*0x00*/ "LNew",
/*0x01*/ "LDispose",
/*0x02*/ "LNewNode",
/*0x03*/ "LFirstNode",
/*0x04*/ "LLastNode",
/*0x05*/ "LEmpty",
/*0x06*/ "LNextNode",
/*0x07*/ "LPrevNode",
/*0x08*/ "LNodeValue",
/*0x09*/ "LAddAfter",
/*0x0a*/ "LAddToFront",
/*0x0b*/ "LAddToEnd",
/*0x0c*/ "LAddBefore",
/*0x0d*/ "LMoveToFront",
/*0x0e*/ "LMoveToEnd",
/*0x0f*/ "LFindKey",
/*0x10*/ "LDeleteKey",
/*0x11*/ "LAt",
/*0x12*/ "LIndexOf",
/*0x13*/ "LEachElementDo",
/*0x14*/ "LFirstTrue",
/*0x15*/ "LAllTrue",
/*0x16*/ "LSort",
/*0x17*/ "Load",
/*0x18*/ "UnLoad",
/*0x19*/ "ScriptID",
/*0x1a*/ "DisposeScript",
/*0x1b*/ "Lock",
/*0x1c*/ "ResCheck",
/*0x1d*/ "Purge",
/*0x1e*/ "SetLanguage",
/*0x1f*/ "Dummy",
/*0x20*/ "Dummy",
/*0x21*/ "Clone",
/*0x22*/ "DisposeClone",
/*0x23*/ "RespondsTo",
/*0x24*/ "FindSelector",
/*0x25*/ "FindClass",
/*0x00*/ "Load",
/*0x01*/ "UnLoad",
/*0x02*/ "ScriptID",
/*0x03*/ "DisposeScript",
/*0x04*/ "Lock",
/*0x05*/ "ResCheck",
/*0x06*/ "Purge",
/*0x07*/ "SetLanguage",
/*0x08*/ "Dummy",
/*0x09*/ "Dummy",
/*0x0a*/ "Clone",
/*0x0b*/ "DisposeClone",
/*0x0c*/ "RespondsTo",
/*0x0d*/ "FindSelector",
/*0x0e*/ "FindClass",
/*0x0f*/ "Dummy",
/*0x10*/ "Dummy",
/*0x11*/ "Dummy",
/*0x12*/ "Dummy",
/*0x13*/ "Dummy",
/*0x14*/ "SetNowSeen",
/*0x15*/ "NumLoops",
/*0x16*/ "NumCels",
/*0x17*/ "IsOnMe",
/*0x18*/ "AddMagnify",
/*0x19*/ "DeleteMagnify",
/*0x1a*/ "CelRect",
/*0x1b*/ "BaseLineSpan",
/*0x1c*/ "CelWide",
/*0x1d*/ "CelHigh",
/*0x1e*/ "AddScreenItem",
/*0x1f*/ "DeleteScreenItem",
/*0x20*/ "UpdateScreenItem",
/*0x21*/ "FrameOut",
/*0x22*/ "CelInfo",
/*0x23*/ "Bitmap",
/*0x24*/ "CelLink",
/*0x25*/ "Dummy",
/*0x26*/ "Dummy",
/*0x27*/ "Dummy",
/*0x28*/ "Dummy",
/*0x29*/ "Dummy",
/*0x2a*/ "Dummy",
/*0x2b*/ "SetNowSeen",
/*0x2c*/ "NumLoops",
/*0x2d*/ "NumCels",
/*0x2e*/ "IsOnMe",
/*0x2f*/ "AddMagnify",
/*0x30*/ "DeleteMagnify",
/*0x31*/ "CelRect",
/*0x32*/ "BaseLineSpan",
/*0x33*/ "CelWide",
/*0x34*/ "CelHigh",
/*0x35*/ "AddScreenItem",
/*0x36*/ "DeleteScreenItem",
/*0x37*/ "UpdateScreenItem",
/*0x38*/ "FrameOut",
/*0x39*/ "CelInfo",
/*0x3a*/ "Bitmap",
/*0x3b*/ "CelLink",
/*0x3c*/ "Dummy",
/*0x3d*/ "Dummy",
/*0x3e*/ "Dummy",
/*0x3f*/ "AddPlane",
/*0x40*/ "DeletePlane",
/*0x41*/ "UpdatePlane",
/*0x42*/ "RepaintPlane",
/*0x43*/ "GetHighPlanePri",
/*0x44*/ "GetHighItemPri",
/*0x45*/ "SetShowStyle",
/*0x46*/ "ShowStylePercent",
/*0x47*/ "SetScroll",
/*0x48*/ "MovePlaneItems",
/*0x49*/ "ShakeScreen",
/*0x4a*/ "Dummy",
/*0x4b*/ "Dummy",
/*0x4c*/ "Dummy",
/*0x28*/ "AddPlane",
/*0x29*/ "DeletePlane",
/*0x2a*/ "UpdatePlane",
/*0x2b*/ "RepaintPlane",
/*0x2c*/ "GetHighPlanePri",
/*0x2d*/ "GetHighItemPri",
/*0x2e*/ "SetShowStyle",
/*0x2f*/ "ShowStylePercent",
/*0x30*/ "SetScroll",
/*0x31*/ "MovePlaneItems",
/*0x32*/ "ShakeScreen",
/*0x33*/ "Dummy",
/*0x34*/ "Dummy",
/*0x35*/ "Dummy",
/*0x36*/ "Dummy",
/*0x37*/ "IsHiRes",
/*0x38*/ "SetVideoMode",
/*0x39*/ "ShowMovie",
/*0x3a*/ "Robot",
/*0x3b*/ "CreateTextBitmap",
/*0x3c*/ "Random",
/*0x3d*/ "Abs",
/*0x3e*/ "Sqrt",
/*0x3f*/ "GetAngle",
/*0x40*/ "GetDistance",
/*0x41*/ "ATan",
/*0x42*/ "SinMult",
/*0x43*/ "CosMult",
/*0x44*/ "SinDiv",
/*0x45*/ "CosDiv",
/*0x46*/ "Text",
/*0x47*/ "Dummy",
/*0x48*/ "Message",
/*0x49*/ "Font",
/*0x4a*/ "EditText",
/*0x4b*/ "InputText",
/*0x4c*/ "ScrollWindow",
/*0x4d*/ "Dummy",
/*0x4e*/ "IsHiRes",
/*0x4f*/ "SetVideoMode",
/*0x50*/ "ShowMovie",
/*0x51*/ "Robot",
/*0x52*/ "CreateTextBitmap",
/*0x53*/ "Random",
/*0x54*/ "Abs",
/*0x55*/ "Sqrt",
/*0x56*/ "GetAngle",
/*0x57*/ "GetDistance",
/*0x58*/ "ATan",
/*0x59*/ "SinMult",
/*0x5a*/ "CosMult",
/*0x5b*/ "SinDiv",
/*0x5c*/ "CosDiv",
/*0x5d*/ "Text",
/*0x5e*/ "Dummy",
/*0x5f*/ "Message",
/*0x60*/ "Font",
/*0x61*/ "EditText",
/*0x62*/ "InputText",
/*0x63*/ "ScrollWindow",
/*0x64*/ "Dummy",
/*0x65*/ "Dummy",
/*0x66*/ "Dummy",
/*0x67*/ "GetEvent",
/*0x68*/ "GlobalToLocal",
/*0x69*/ "LocalToGlobal",
/*0x6a*/ "MapKeyToDir",
/*0x6b*/ "HaveMouse",
/*0x6c*/ "SetCursor",
/*0x6d*/ "VibrateMouse",
/*0x6e*/ "Dummy",
/*0x6f*/ "Dummy",
/*0x70*/ "Dummy",
/*0x71*/ "Array",
/*0x72*/ "String",
/*0x73*/ "FileIO",
/*0x74*/ "BaseSetter",
/*0x75*/ "DirLoop",
/*0x76*/ "CanBeHere",
/*0x77*/ "InitBresen",
/*0x78*/ "DoBresen",
/*0x79*/ "SetJump",
/*0x7a*/ "AvoidPath",
/*0x7b*/ "InPolygon",
/*0x7c*/ "MergePoly",
/*0x7d*/ "ObjectIntersect",
/*0x7e*/ "Dummy",
/*0x7f*/ "MemoryInfo",
/*0x80*/ "DeviceInfo",
/*0x81*/ "Palette",
/*0x82*/ "PalVary",
/*0x83*/ "PalCycle",
/*0x84*/ "RemapColors",
/*0x85*/ "AddLine",
/*0x86*/ "DeleteLine",
/*0x87*/ "UpdateLine",
/*0x88*/ "AddPolygon",
/*0x89*/ "DeletePolygon",
/*0x8a*/ "UpdatePolygon",
/*0x8b*/ "DoSound",
/*0x8c*/ "DoAudio",
/*0x8d*/ "DoSync",
/*0x8e*/ "Save",
/*0x8f*/ "GetTime",
/*0x90*/ "Platform",
/*0x91*/ "CD",
/*0x92*/ "SetQuitStr",
/*0x93*/ "GetConfig",
/*0x94*/ "Table",
/*0x4e*/ "Dummy",
/*0x4f*/ "Dummy",
/*0x50*/ "GetEvent",
/*0x51*/ "GlobalToLocal",
/*0x52*/ "LocalToGlobal",
/*0x53*/ "MapKeyToDir",
/*0x54*/ "HaveMouse",
/*0x55*/ "SetCursor",
/*0x56*/ "VibrateMouse",
/*0x57*/ "Dummy",
/*0x58*/ "Dummy",
/*0x59*/ "Dummy",
/*0x5a*/ "List",
/*0x5b*/ "Array",
/*0x5c*/ "String",
/*0x5d*/ "FileIO",
/*0x5e*/ "BaseSetter",
/*0x5f*/ "DirLoop",
/*0x60*/ "CanBeHere",
/*0x61*/ "InitBresen",
/*0x62*/ "DoBresen",
/*0x63*/ "SetJump",
/*0x64*/ "AvoidPath",
/*0x65*/ "InPolygon",
/*0x66*/ "MergePoly",
/*0x67*/ "ObjectIntersect",
/*0x68*/ "Dummy",
/*0x69*/ "MemoryInfo",
/*0x6a*/ "DeviceInfo",
/*0x6b*/ "Palette",
/*0x6c*/ "PalVary",
/*0x6d*/ "PalCycle",
/*0x6e*/ "RemapColors",
/*0x6f*/ "AddLine",
/*0x70*/ "DeleteLine",
/*0x71*/ "UpdateLine",
/*0x72*/ "AddPolygon",
/*0x73*/ "DeletePolygon",
/*0x74*/ "UpdatePolygon",
/*0x75*/ "DoSound",
/*0x76*/ "DoAudio",
/*0x77*/ "DoSync",
/*0x78*/ "Save",
/*0x79*/ "GetTime",
/*0x7a*/ "Platform",
/*0x7b*/ "CD",
/*0x7c*/ "SetQuitStr",
/*0x7d*/ "GetConfig",
/*0x7e*/ "Table",
/*0x7f*/ "Dummy",
/*0x80*/ "Dummy",
/*0x81*/ "Dummy",
/*0x82*/ "Dummy",
/*0x83*/ "Dummy",
/*0x84*/ "Dummy",
/*0x85*/ "Dummy",
/*0x86*/ "Dummy",
/*0x87*/ "Dummy",
/*0x88*/ "Dummy",
/*0x89*/ "Dummy",
/*0x8a*/ "LoadChunk",
/*0x8b*/ "SetPalStyleRange"
/*0x8c*/ "AddPicAt",
/*0x8d*/ "Dummy",
/*0x8e*/ "NewRoom",
/*0x8f*/ "Dummy",
/*0x90*/ "Priority",
/*0x91*/ "MorphOn",
/*0x92*/ "PlayVMD",
/*0x93*/ "SetHotRectangles",
/*0x94*/ "MulDiv",
/*0x95*/ "Dummy",
/*0x96*/ "Dummy",
/*0x97*/ "Dummy",
/*0x98*/ "Dummy",
/*0x99*/ "Dummy",
/*0x9a*/ "Dummy",
/*0x9b*/ "Dummy",
/*0x9c*/ "Dummy",
/*0x9d*/ "Dummy",
/*0x9e*/ "Dummy",
/*0x9f*/ "Dummy",
/*0xa0*/ "LoadChunk",
/*0xa1*/ "SetPalStyleRange"
/*0xa2*/ "AddPicAt",
/*0xa3*/ "Dummy",
/*0xa4*/ "NewRoom",
/*0xa5*/ "Dummy",
/*0xa6*/ "Priority",
/*0xa7*/ "MorphOn",
/*0xa8*/ "PlayVMD",
/*0xa9*/ "SetHotRectangles",
/*0xaa*/ "MulDiv",
/*0xab*/ "Dummy",
/*0xac*/ "Dummy",
/*0xad*/ "Dummy",
/*0xae*/ "Dummy",
/*0xaf*/ "Dummy"
/*0x99*/ "Dummy"
};
void Kernel::setKernelNamesSci2() {

View File

@ -94,6 +94,19 @@ void script_adjust_opcode_formats(SciVersion version) {
g_opcode_formats[op_lofsa][0] = Script_Offset;
g_opcode_formats[op_lofss][0] = Script_Offset;
}
#ifdef ENABLE_SCI32
// In SCI32, some arguments are now words instead of bytes
if (version >= SCI_VERSION_2) {
g_opcode_formats[op_calle][2] = Script_Word;
g_opcode_formats[op_callk][1] = Script_Word;
g_opcode_formats[op_super][1] = Script_Word;
g_opcode_formats[op_send][0] = Script_Word;
g_opcode_formats[op_self][0] = Script_Word;
g_opcode_formats[op_call][1] = Script_Word;
g_opcode_formats[op_callb][1] = Script_Word;
}
#endif
}
#if 1

View File

@ -280,6 +280,9 @@ EngineState::DoSoundType EngineState::detectDoSoundType() {
_doSoundType = kDoSoundTypeSci1Early;
break;
case 0x13E:
#ifdef ENABLE_SCI32
case 0x14B:
#endif
_doSoundType = kDoSoundTypeSci1Late;
}
}