Committed old work on Soccer U32. Too far from being finished.

svn-id: r20613
This commit is contained in:
Eugene Sandulenko 2006-02-12 13:45:57 +00:00
parent 25460eb0fa
commit faec3622b3
4 changed files with 85 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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 {