diff --git a/scumm/intern.h b/scumm/intern.h index f6245480217..baaff2bbeb6 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -753,6 +753,7 @@ protected: void o72_traceStatus(); void o72_unknownCF(); void o72_drawWizImage(); + void o72_kernelGetFunctions(); void o72_jumpToScript(); void o72_openFile(); void o72_readFile(); diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index c8b73c8fda9..6f86469752d 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -295,7 +295,7 @@ void ScummEngine_v72he::setupOpcodes() { OPCODE(o6_distObjectPt), OPCODE(o6_distPtPt), /* C8 */ - OPCODE(o60_kernelGetFunctions), + OPCODE(o72_kernelGetFunctions), OPCODE(o70_kernelSetFunctions), OPCODE(o6_delayFrames), OPCODE(o6_pickOneOf), @@ -1856,6 +1856,38 @@ void ScummEngine_v72he::flushWizBuffer() { _wizImagesNum = 0; } +void ScummEngine_v72he::o72_kernelGetFunctions() { + int args[29]; + int retval; + ArrayHeader *ah; + getStackList(args, ARRAYSIZE(args)); + + switch (args[0]) { + case 1: + writeVar(0, 0); + defineArray(0, kByteArray, 0, 0, 0, virtScreenSave(0, args[1], args[2], args[3], args[4])); + retval = readVar(0); + ah = (ArrayHeader *)getResourceAddress(rtString, retval); + virtScreenSave(ah->data, args[1], args[2], args[3], args[4]); + push(retval); + break; + case 1001: + { + double a = args[1] * M_PI / 180.; + push((int)(sin(a) * 100000)); + } + break; + case 1002: + { + double a = args[1] * M_PI / 180.; + push((int)(cos(a) * 100000)); + } + break; + default: + error("o72_kernelGetFunctions: default case %d", args[0]); + } +} + void ScummEngine_v72he::o72_drawWizImage() { WizImage wi; wi.flags = pop(); diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp index afad98009da..ce16a21538a 100644 --- a/scumm/script_v80he.cpp +++ b/scumm/script_v80he.cpp @@ -294,7 +294,7 @@ void ScummEngine_v80he::setupOpcodes() { OPCODE(o6_distObjectPt), OPCODE(o6_distPtPt), /* C8 */ - OPCODE(o60_kernelGetFunctions), + OPCODE(o72_kernelGetFunctions), OPCODE(o70_kernelSetFunctions), OPCODE(o6_delayFrames), OPCODE(o6_pickOneOf), diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index e02dc944c90..3a2209b9eb0 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -294,7 +294,7 @@ void ScummEngine_v90he::setupOpcodes() { OPCODE(o6_distObjectPt), OPCODE(o6_distPtPt), /* C8 */ - OPCODE(o60_kernelGetFunctions), + OPCODE(o72_kernelGetFunctions), OPCODE(o70_kernelSetFunctions), OPCODE(o6_delayFrames), OPCODE(o6_pickOneOf),