diff options
author | Eugene Sandulenko | 2006-02-12 13:45:57 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-02-12 13:45:57 +0000 |
commit | faec3622b3c87b7052c3522359bc0a3ad04efee4 (patch) | |
tree | 6d0af931868c05d1fcb6f4fae268bd91ee4a77e2 | |
parent | 25460eb0fa44b4991b6b50d89ec1492defa4eadf (diff) | |
download | scummvm-rg350-faec3622b3c87b7052c3522359bc0a3ad04efee4.tar.gz scummvm-rg350-faec3622b3c87b7052c3522359bc0a3ad04efee4.tar.bz2 scummvm-rg350-faec3622b3c87b7052c3522359bc0a3ad04efee4.zip |
Committed old work on Soccer U32. Too far from being finished.
svn-id: r20613
-rw-r--r-- | engines/scumm/logic_he.cpp | 66 | ||||
-rw-r--r-- | engines/scumm/logic_he.h | 13 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 6 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 3 |
4 files changed, 85 insertions, 3 deletions
diff --git a/engines/scumm/logic_he.cpp b/engines/scumm/logic_he.cpp index 76de561721..401a41def5 100644 --- a/engines/scumm/logic_he.cpp +++ b/engines/scumm/logic_he.cpp @@ -623,7 +623,7 @@ int32 LogicHEfootball::dispatch(int op, int numArgs, int32 *args) { default: LogicHE::dispatch(op, numArgs, args); - error("Tell me how to reproduce it"); + error("Tell sev how to reproduce it"); } return res; @@ -769,4 +769,68 @@ int LogicHEfootball::op_1024(int32 *args) { } +/*********************** + * Backyard Soccer + * + */ + +int LogicHEsoccer::versionID() { + return 1; +} + +int32 LogicHEsoccer::dispatch(int op, int numArgs, int32 *args) { + int res = 0; + + switch (op) { + case 1001: + res = op_1001(args); + break; + + case 1002: + res = op_1002(args); + break; + + case 1004: + res = op_1004(args); + break; + + case 8221968: + // Someone had a fun and used his birthday as opcode number + res = getFromArray(args[0], args[1], args[2]); + break; + + default: + // original range is 1001 - 1021 + LogicHE::dispatch(op, numArgs, args); + warning("Tell sev how to reproduce it"); + } + + return res; +} + +int LogicHEsoccer::op_1001(int32 *args) { + return args[0] * sin(args[1]); +} + +int LogicHEsoccer::op_1002(int32 *args) { + return _vm->VAR(2) * args[0]; +} + +int LogicHEsoccer::op_1004(int32 *args) { + double res, a2, a4, a5; + + a5 = ((double)args[4] - (double)args[1]) / ((double)args[5] - (double)args[2]); + a4 = ((double)args[3] - (double)args[0]) / ((double)args[5] - (double)args[2]); + a2 = (double)args[2] - (double)args[0] * a4 - args[1] * a5; + + res = (double)args[6] * a4 + (double)args[7] * a5 + a2; + writeScummVar(108, (int32)res); + + writeScummVar(109, (int32)a2); + writeScummVar(110, (int32)a5); + writeScummVar(111, (int32)a4); + + return 1; +} + } // End of namespace Scumm diff --git a/engines/scumm/logic_he.h b/engines/scumm/logic_he.h index c237f6182c..59476f2e3b 100644 --- a/engines/scumm/logic_he.h +++ b/engines/scumm/logic_he.h @@ -106,6 +106,19 @@ private: int op_1024(int32 *args); }; +class LogicHEsoccer : public LogicHE { +public: + LogicHEsoccer(ScummEngine_v90he *vm) : LogicHE(vm) {} + + int versionID(); + int32 dispatch(int op, int numArgs, int32 *args); + +private: + int op_1001(int32 *args); + int op_1002(int32 *args); + int op_1004(int32 *args); +}; + } // End of namespace Scumm #endif diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 5cd9ef9111..72794ae49c 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -298,7 +298,7 @@ static const ScummGameSettings scumm_settings[] = { GF_USE_KEY | GF_NEW_COSTUMES, Common::kPlatformWindows}, {"BluesABCTimeDemo", "Blue's ABC Time (Demo)", GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY | GF_NEW_COSTUMES, Common::kPlatformWindows}, - {"soccer", "Backyard Soccer", GID_HEGAME, 6, 98, MDT_NONE, + {"soccer", "Backyard Soccer", GID_SOCCER, 6, 98, MDT_NONE, GF_USE_KEY | GF_NEW_COSTUMES, Common::kPlatformWindows}, // Global scripts increased to 2048 @@ -2144,6 +2144,10 @@ void ScummEngine_v90he::scummInit() { _logicHE = new LogicHEfootball(this); break; + case GID_SOCCER: + _logicHE = new LogicHEsoccer(this); + break; + default: _logicHE = new LogicHE(this); break; diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 5509378371..575d2d268e 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -213,7 +213,8 @@ enum ScummGameId { GID_WATER, GID_PUTTRACE, GID_FUNSHOP, // Used for all three funshops - GID_FOOTBALL + GID_FOOTBALL, + GID_SOCCER }; struct SentenceTab { |