aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/logic
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/logic
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/logic')
-rw-r--r--engines/scumm/he/logic/football.cpp100
1 files changed, 88 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