From e10aa928c16fc5b71f05c34df230f4c23ddb0036 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 24 Nov 2007 21:56:36 +0000 Subject: Implement soccer opcode 1006. Nothing is tested and is pure processing of bb86 utility. svn-id: r29630 --- engines/scumm/he/logic_he.cpp | 22 ++++++++++++++++++++++ engines/scumm/he/logic_he.h | 6 +++++- 2 files changed, 27 insertions(+), 1 deletion(-) (limited to 'engines/scumm/he') diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp index 925a86675f..7620cf61cb 100644 --- a/engines/scumm/he/logic_he.cpp +++ b/engines/scumm/he/logic_he.cpp @@ -827,6 +827,11 @@ int LogicHEsoccer::versionID() { return 1; } +LogicHEsoccer::LogicHEsoccer(ScummEngine_v90he *vm) : LogicHE(vm) { + // Originally it used 0x1b0d bytes + _userDataD = (double *)calloc(1732, sizeof(double)); +} + int32 LogicHEsoccer::dispatch(int op, int numArgs, int32 *args) { int res = 0; @@ -901,4 +906,21 @@ int LogicHEsoccer::op_1004(int32 *args) { return 1; } +int LogicHEsoccer::op_1006(int32 *args) { + double a1 = args[1] * 0.01; + double a2 = args[2] * 0.01; + double a3 = args[3] * 0.01; + double var108, var109; + + _userDataD[529] = args[4]; + + var108 = atan2(a1, a3) * _userDataD[523] - args[4]; + var109 = _userDataD[526] - _userDataD[528] + (_userDataD[521] - atan2(_userDataD[524] - a2, a3)) * _userDataD[522]; + + writeScummVar(108, (int32)var108); + writeScummVar(109, (int32)var109); + + return 1; +} + } // End of namespace Scumm diff --git a/engines/scumm/he/logic_he.h b/engines/scumm/he/logic_he.h index 0fbe27b125..f9e59f7db6 100644 --- a/engines/scumm/he/logic_he.h +++ b/engines/scumm/he/logic_he.h @@ -112,8 +112,11 @@ private: }; class LogicHEsoccer : public LogicHE { +private: + double *_userDataD; + public: - LogicHEsoccer(ScummEngine_v90he *vm) : LogicHE(vm) {} + LogicHEsoccer(ScummEngine_v90he *vm); int versionID(); int32 dispatch(int op, int numArgs, int32 *args); @@ -123,6 +126,7 @@ private: int op_1002(int32 *args); int op_1003(int32 *args); int op_1004(int32 *args); + int op_1006(int32 *args); }; } // End of namespace Scumm -- cgit v1.2.3