aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he
diff options
context:
space:
mode:
authorMatthew Hoops2012-06-08 19:45:31 -0400
committerMatthew Hoops2012-06-08 19:45:31 -0400
commitf22661e4b931609609fb785b503c1e534bfe14d7 (patch)
tree0815485af02ecc179fbe68a09fe337323eb7a4fc /engines/scumm/he
parentc735b2acda10dcf2225a38cb50a69c840b6662bc (diff)
downloadscummvm-rg350-f22661e4b931609609fb785b503c1e534bfe14d7.tar.gz
scummvm-rg350-f22661e4b931609609fb785b503c1e534bfe14d7.tar.bz2
scummvm-rg350-f22661e4b931609609fb785b503c1e534bfe14d7.zip
SCUMM: Stub off other football2002 u32 opcodes
Diffstat (limited to 'engines/scumm/he')
-rw-r--r--engines/scumm/he/logic/football.cpp100
-rw-r--r--engines/scumm/he/logic_he.cpp3
-rw-r--r--engines/scumm/he/logic_he.h1
3 files changed, 92 insertions, 12 deletions
diff --git a/engines/scumm/he/logic/football.cpp b/engines/scumm/he/logic/football.cpp
index 87efd7cfb2..73f9161d95 100644
--- a/engines/scumm/he/logic/football.cpp
+++ b/engines/scumm/he/logic/football.cpp
@@ -35,17 +35,16 @@ public:
LogicHEfootball(ScummEngine_v90he *vm) : LogicHE(vm) {}
int versionID();
- int32 dispatch(int op, int numArgs, int32 *args);
+ virtual int32 dispatch(int op, int numArgs, int32 *args);
-private:
+protected:
int lineEquation3D(int32 *args);
- int translateWorldToScreen(int32 *args);
+ virtual int translateWorldToScreen(int32 *args);
int fieldGoalScreenTranslation(int32 *args);
- int translateScreenToWorld(int32 *args);
+ virtual int translateScreenToWorld(int32 *args);
int nextPoint(int32 *args);
int computePlayerBallIntercepts(int32 *args);
int computeTwoCircleIntercepts(int32 *args);
- int largestFreeBlock();
};
int LogicHEfootball::versionID() {
@@ -84,11 +83,6 @@ int32 LogicHEfootball::dispatch(int op, int numArgs, int32 *args) {
res = computeTwoCircleIntercepts(args);
break;
- case 1028:
- // Backyard Football 2002 only
- res = largestFreeBlock();
- break;
-
case 8221968:
// Someone had a fun and used his birthday as opcode number
res = getFromArray(args[0], args[1], args[2]);
@@ -288,8 +282,86 @@ int LogicHEfootball::computeTwoCircleIntercepts(int32 *args) {
return 1;
}
-int LogicHEfootball::largestFreeBlock() {
- // Backyard Football 2002 only
+class LogicHEfootball2002 : public LogicHEfootball {
+public:
+ LogicHEfootball2002(ScummEngine_v90he *vm) : LogicHEfootball(vm) {}
+
+ int32 dispatch(int op, int numArgs, int32 *args);
+
+private:
+ int translateWorldToScreen(int32 *args);
+ int translateScreenToWorld(int32 *args);
+ int getDayOfWeek();
+ int initScreenTranslations();
+ int getPlaybookFiles(int32 *args);
+ int largestFreeBlock();
+};
+
+int32 LogicHEfootball2002::dispatch(int op, int numArgs, int32 *args) {
+ int32 res = 0;
+
+ switch (op) {
+ case 1025:
+ res = getDayOfWeek();
+ break;
+
+ case 1026:
+ res = initScreenTranslations();
+ break;
+
+ case 1027:
+ res = getPlaybookFiles(args);
+ break;
+
+ case 1028:
+ res = largestFreeBlock();
+ break;
+
+ case 1029:
+ // Clean-up off heap
+ // Dummied in the Windows U32
+ res = 1;
+ break;
+
+ case 1516:
+ // Start auto LAN game
+ break;
+
+ default:
+ res = LogicHEfootball::dispatch(op, numArgs, args);
+ break;
+ }
+
+ return res;
+}
+
+int LogicHEfootball2002::translateWorldToScreen(int32 *args) {
+ // TODO: Implement modified 2002 version
+ return LogicHEfootball::translateWorldToScreen(args);
+}
+
+int LogicHEfootball2002::translateScreenToWorld(int32 *args) {
+ // TODO: Implement modified 2002 version
+ return LogicHEfootball::translateScreenToWorld(args);
+}
+
+int LogicHEfootball2002::getDayOfWeek() {
+ // TODO: Get day of week, store in var 108
+ return 1;
+}
+
+int LogicHEfootball2002::initScreenTranslations() {
+ // TODO: Set values used by translateWorldToScreen/translateScreenToWorld
+ return 1;
+}
+
+int LogicHEfootball2002::getPlaybookFiles(int32 *args) {
+ // TODO: Get list of playbook files
+ error("STUB: LogicHEfootball2002::getPlaybookFiles()");
+ return 1;
+}
+
+int LogicHEfootball2002::largestFreeBlock() {
// The Windows version always sets the variable to this
// The Mac version actually checks for the largest free block
writeScummVar(108, 100000000);
@@ -300,4 +372,8 @@ LogicHE *makeLogicHEfootball(ScummEngine_v90he *vm) {
return new LogicHEfootball(vm);
}
+LogicHE *makeLogicHEfootball2002(ScummEngine_v90he *vm) {
+ return new LogicHEfootball2002(vm);
+}
+
} // End of namespace Scumm
diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp
index a76c393e13..0f9454ba28 100644
--- a/engines/scumm/he/logic_he.cpp
+++ b/engines/scumm/he/logic_he.cpp
@@ -87,6 +87,9 @@ LogicHE *LogicHE::makeLogicHE(ScummEngine_v90he *vm) {
case GID_FOOTBALL:
return makeLogicHEfootball(vm);
+ case GID_FOOTBALL2002:
+ return makeLogicHEfootball2002(vm);
+
case GID_SOCCER:
case GID_SOCCERMLS:
case GID_SOCCER2004:
diff --git a/engines/scumm/he/logic_he.h b/engines/scumm/he/logic_he.h
index 893dc81b87..93c0569a4f 100644
--- a/engines/scumm/he/logic_he.h
+++ b/engines/scumm/he/logic_he.h
@@ -61,6 +61,7 @@ protected:
LogicHE *makeLogicHErace(ScummEngine_v90he *vm);
LogicHE *makeLogicHEfunshop(ScummEngine_v90he *vm);
LogicHE *makeLogicHEfootball(ScummEngine_v90he *vm);
+LogicHE *makeLogicHEfootball2002(ScummEngine_v90he *vm);
LogicHE *makeLogicHEsoccer(ScummEngine_v90he *vm);
LogicHE *makeLogicHEbaseball2001(ScummEngine_v90he *vm);
LogicHE *makeLogicHEbasketball(ScummEngine_v90he *vm);