aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-18 23:55:01 +0200
committerWillem Jan Palenstijn2013-05-08 20:47:44 +0200
commit102299630901d08a44ef3aec367fcbcae065b9fe (patch)
tree98db4bbe0c54176c0a43e2f5076f8b3d63b8065c /engines/agi
parent583f9abaf98f64895546b75573e9442ca47426e3 (diff)
parent78ba3210a57094086d44b25d5a8507c33ce9bef3 (diff)
downloadscummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.tar.gz
scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.tar.bz2
scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.zip
Merge branch 'master'
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/console.cpp22
-rw-r--r--engines/agi/console.h4
-rw-r--r--engines/agi/logic.h2
-rw-r--r--engines/agi/lzw.h2
-rw-r--r--engines/agi/op_cmd.cpp2
-rw-r--r--engines/agi/op_test.cpp2
-rw-r--r--engines/agi/opcodes.cpp12
-rw-r--r--engines/agi/preagi_winnie.h2
8 files changed, 23 insertions, 25 deletions
diff --git a/engines/agi/console.cpp b/engines/agi/console.cpp
index dd06736290..b9a64bc572 100644
--- a/engines/agi/console.cpp
+++ b/engines/agi/console.cpp
@@ -35,7 +35,6 @@ Console::Console(AgiEngine *vm) : GUI::Debugger() {
DCmd_Register("debug", WRAP_METHOD(Console, Cmd_Debug));
DCmd_Register("cont", WRAP_METHOD(Console, Cmd_Cont));
DCmd_Register("agiver", WRAP_METHOD(Console, Cmd_Agiver));
- DCmd_Register("crc", WRAP_METHOD(Console, Cmd_Crc));
DCmd_Register("flags", WRAP_METHOD(Console, Cmd_Flags));
DCmd_Register("logic0", WRAP_METHOD(Console, Cmd_Logic0));
DCmd_Register("objs", WRAP_METHOD(Console, Cmd_Objs));
@@ -119,12 +118,6 @@ bool Console::Cmd_RunOpcode(int argc, const char **argv) {
return true;
}
-bool Console::Cmd_Crc(int argc, const char **argv) {
- DebugPrintf("command removed from scummvm\n");
-
- return true;
-}
-
bool Console::Cmd_Agiver(int argc, const char **argv) {
int ver, maj, min;
@@ -278,22 +271,17 @@ bool Console::Cmd_BT(int argc, const char **argv) {
MickeyConsole::MickeyConsole(MickeyEngine *mickey) : GUI::Debugger() {
_mickey = mickey;
- DCmd_Register("curRoom", WRAP_METHOD(MickeyConsole, Cmd_CurRoom));
- DCmd_Register("gotoRoom", WRAP_METHOD(MickeyConsole, Cmd_GotoRoom));
+ DCmd_Register("room", WRAP_METHOD(MickeyConsole, Cmd_Room));
DCmd_Register("drawPic", WRAP_METHOD(MickeyConsole, Cmd_DrawPic));
DCmd_Register("drawObj", WRAP_METHOD(MickeyConsole, Cmd_DrawObj));
}
-bool MickeyConsole::Cmd_CurRoom(int argc, const char **argv) {
+bool MickeyConsole::Cmd_Room(int argc, const char **argv) {
+ if (argc == 2)
+ _mickey->debugGotoRoom(atoi(argv[1]));
+
_mickey->debugCurRoom();
- return true;
-}
-bool MickeyConsole::Cmd_GotoRoom(int argc, const char **argv) {
- if (argc != 2)
- DebugPrintf("Usage: %s <Room number>\n", argv[0]);
- else
- _mickey->debugGotoRoom(atoi(argv[1]));
return true;
}
diff --git a/engines/agi/console.h b/engines/agi/console.h
index 5f69460907..f8025e0562 100644
--- a/engines/agi/console.h
+++ b/engines/agi/console.h
@@ -49,7 +49,6 @@ private:
bool Cmd_SetFlag(int argc, const char **argv);
bool Cmd_SetObj(int argc, const char **argv);
bool Cmd_RunOpcode(int argc, const char **argv);
- bool Cmd_Crc(int argc, const char **argv);
bool Cmd_Agiver(int argc, const char **argv);
bool Cmd_Flags(int argc, const char **argv);
bool Cmd_Vars(int argc, const char **argv);
@@ -75,8 +74,7 @@ public:
private:
MickeyEngine *_mickey;
- bool Cmd_CurRoom(int argc, const char **argv);
- bool Cmd_GotoRoom(int argc, const char **argv);
+ bool Cmd_Room(int argc, const char **argv);
bool Cmd_DrawPic(int argc, const char **argv);
bool Cmd_DrawObj(int argc, const char **argv);
};
diff --git a/engines/agi/logic.h b/engines/agi/logic.h
index fecc2e3b8a..14137f01d2 100644
--- a/engines/agi/logic.h
+++ b/engines/agi/logic.h
@@ -37,6 +37,6 @@ struct AgiLogic {
const char **texts; /**< message list */
};
-} // End of namespace Agi
+} // End of namespace Agi
#endif /* AGI_LOGIC_H */
diff --git a/engines/agi/lzw.h b/engines/agi/lzw.h
index e3fbafe584..c732491e8e 100644
--- a/engines/agi/lzw.h
+++ b/engines/agi/lzw.h
@@ -27,6 +27,6 @@ namespace Agi {
void lzwExpand(uint8 *, uint8 *, int32);
-} // End of namespace Agi
+} // End of namespace Agi
#endif /* AGI_LZW_H */
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 5334407eb8..9d899b1855 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -1399,7 +1399,7 @@ void cmdDistance(AgiGame *state, uint8 *p) {
// a zombie or the zombie getting turned away by the scarab) we make it appear the
// zombie is far away from Rosella if the zombie is not already up and chasing her.
enum zombieStates {ZOMBIE_SET_TO_RISE_UP, ZOMBIE_RISING_UP, ZOMBIE_CHASING_EGO};
- uint8 zombieStateVarNumList[] = {155, 156, (_v[vCurRoom] == 16) ? 162 : 158};
+ uint8 zombieStateVarNumList[] = {155, 156, (uint8)((_v[vCurRoom] == 16) ? 162 : 158)};
uint8 zombieNum = p2 - 221; // Zombie's number (In range 0-2)
uint8 zombieStateVarNum = zombieStateVarNumList[zombieNum]; // Number of the variable containing zombie's state
uint8 zombieState = _v[zombieStateVarNum]; // Zombie's state
diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp
index 4d5e6fffe1..124a1cfcb7 100644
--- a/engines/agi/op_test.cpp
+++ b/engines/agi/op_test.cpp
@@ -82,7 +82,7 @@ void condIsSet(AgiGame *state, uint8 *p) {
}
void condIsSetV(AgiGame *state, uint8 *p) {
- state->testResult = testIsSet(getvar(p[1]));
+ state->testResult = testIsSet(getvar(p[0]));
}
void condIsSetV1(AgiGame *state, uint8 *p) {
diff --git a/engines/agi/opcodes.cpp b/engines/agi/opcodes.cpp
index 7a427bd94f..807ab2dc2c 100644
--- a/engines/agi/opcodes.cpp
+++ b/engines/agi/opcodes.cpp
@@ -376,6 +376,18 @@ void AgiEngine::setupOpcodes() {
logicNamesTest = insV1Test;
logicNamesCmd = insV1;
}
+
+ // Alter opcode parameters for specific games
+ // TODO: This could be either turned into a game feature, or a version
+ // specific check, instead of a game version check
+
+ // The Apple IIGS versions of MH1 and Goldrush both have a parameter for
+ // show.mouse and hide.mouse. Fixes bugs #3577754 and #3426946.
+ if ((getGameID() == GID_MH1 || getGameID() == GID_GOLDRUSH) &&
+ getPlatform() == Common::kPlatformApple2GS) {
+ logicNamesCmd[176].args = "n"; // hide.mouse
+ logicNamesCmd[178].args = "n"; // show.mouse
+ }
}
}
diff --git a/engines/agi/preagi_winnie.h b/engines/agi/preagi_winnie.h
index 96ae65997e..f34c80cec1 100644
--- a/engines/agi/preagi_winnie.h
+++ b/engines/agi/preagi_winnie.h
@@ -355,6 +355,6 @@ private:
void printStrWinnie(char *szMsg);
};
-} // End of namespace Agi
+} // End of namespace Agi
#endif