aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/logic
diff options
context:
space:
mode:
authorMatthew Hoops2012-06-08 14:32:13 -0400
committerMatthew Hoops2012-06-08 14:32:13 -0400
commitc735b2acda10dcf2225a38cb50a69c840b6662bc (patch)
tree96849a88a6809907360afb283cce3fafb8dbd384 /engines/scumm/he/logic
parenta643981a385b20ef71a4d1987965f5d1b73fdadc (diff)
downloadscummvm-rg350-c735b2acda10dcf2225a38cb50a69c840b6662bc.tar.gz
scummvm-rg350-c735b2acda10dcf2225a38cb50a69c840b6662bc.tar.bz2
scummvm-rg350-c735b2acda10dcf2225a38cb50a69c840b6662bc.zip
SCUMM: Give football u32 opcodes proper names
Diffstat (limited to 'engines/scumm/he/logic')
-rw-r--r--engines/scumm/he/logic/football.cpp57
1 files changed, 30 insertions, 27 deletions
diff --git a/engines/scumm/he/logic/football.cpp b/engines/scumm/he/logic/football.cpp
index 5a0d423508..87efd7cfb2 100644
--- a/engines/scumm/he/logic/football.cpp
+++ b/engines/scumm/he/logic/football.cpp
@@ -38,14 +38,14 @@ public:
int32 dispatch(int op, int numArgs, int32 *args);
private:
- int op_1004(int32 *args);
- int op_1006(int32 *args);
- int op_1007(int32 *args);
- int op_1010(int32 *args);
- int op_1022(int32 *args);
- int op_1023(int32 *args);
- int op_1024(int32 *args);
- int op_1028();
+ int lineEquation3D(int32 *args);
+ int translateWorldToScreen(int32 *args);
+ int fieldGoalScreenTranslation(int32 *args);
+ int translateScreenToWorld(int32 *args);
+ int nextPoint(int32 *args);
+ int computePlayerBallIntercepts(int32 *args);
+ int computeTwoCircleIntercepts(int32 *args);
+ int largestFreeBlock();
};
int LogicHEfootball::versionID() {
@@ -57,36 +57,36 @@ int32 LogicHEfootball::dispatch(int op, int numArgs, int32 *args) {
switch (op) {
case 1004:
- res = op_1004(args);
+ res = lineEquation3D(args);
break;
case 1006:
- res = op_1006(args);
+ res = translateWorldToScreen(args);
break;
case 1007:
- res = op_1007(args);
+ res = fieldGoalScreenTranslation(args);
break;
case 1010:
- res = op_1010(args);
+ res = translateScreenToWorld(args);
break;
case 1022:
- res = op_1022(args);
+ res = nextPoint(args);
break;
case 1023:
- res = op_1023(args);
+ res = computePlayerBallIntercepts(args);
break;
case 1024:
- res = op_1024(args);
+ res = computeTwoCircleIntercepts(args);
break;
case 1028:
// Backyard Football 2002 only
- res = op_1028();
+ res = largestFreeBlock();
break;
case 8221968:
@@ -129,8 +129,8 @@ int32 LogicHEfootball::dispatch(int op, int numArgs, int32 *args) {
return res;
}
-int LogicHEfootball::op_1004(int32 *args) {
- // Identical to LogicHEsoccer::op_1004
+int LogicHEfootball::lineEquation3D(int32 *args) {
+ // Identical to soccer's 1004 opcode
double res, a2, a4, a5;
a5 = ((double)args[4] - (double)args[1]) / ((double)args[5] - (double)args[2]);
@@ -147,8 +147,8 @@ int LogicHEfootball::op_1004(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1006(int32 *args) {
- // This seems to be more or less the inverse of op_1010
+int LogicHEfootball::translateWorldToScreen(int32 *args) {
+ // This is more or less the inverse of translateScreenToWorld
const double a1 = args[1];
double res;
@@ -173,7 +173,7 @@ int LogicHEfootball::op_1006(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1007(int32 *args) {
+int LogicHEfootball::fieldGoalScreenTranslation(int32 *args) {
double res, temp;
temp = (double)args[1] * 0.32;
@@ -194,8 +194,8 @@ int LogicHEfootball::op_1007(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1010(int32 *args) {
- // This seems to be more or less the inverse of op_1006
+int LogicHEfootball::translateScreenToWorld(int32 *args) {
+ // This is more or less the inverse of translateWorldToScreen
double a1 = (640.0 - (double)args[1] - 26.0) / 1.1588235e-1;
// 2.9411764e-4 = 1/3400
@@ -211,7 +211,7 @@ int LogicHEfootball::op_1010(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1022(int32 *args) {
+int LogicHEfootball::nextPoint(int32 *args) {
double res;
double var10 = args[4] - args[1];
double var8 = args[5] - args[2];
@@ -232,7 +232,7 @@ int LogicHEfootball::op_1022(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1023(int32 *args) {
+int LogicHEfootball::computePlayerBallIntercepts(int32 *args) {
double var10, var18, var20, var28, var30, var30_;
double argf[7];
@@ -278,7 +278,8 @@ int LogicHEfootball::op_1023(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1024(int32 *args) {
+int LogicHEfootball::computeTwoCircleIntercepts(int32 *args) {
+ // Looks like this was just dummied out
writeScummVar(108, 0);
writeScummVar(109, 0);
writeScummVar(110, 0);
@@ -287,8 +288,10 @@ int LogicHEfootball::op_1024(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1028() {
+int LogicHEfootball::largestFreeBlock() {
// Backyard Football 2002 only
+ // The Windows version always sets the variable to this
+ // The Mac version actually checks for the largest free block
writeScummVar(108, 100000000);
return 1;
}