[Scummvm-git-logs] scummvm master -> 071e55756ef714d93f39710b75034e64d9f71950
sdelamarre
noreply at scummvm.org
Tue Jul 16 19:30:42 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
071e55756e GOB: Fix a crash at startup in some Inca2 versions
Commit: 071e55756ef714d93f39710b75034e64d9f71950
https://github.com/scummvm/scummvm/commit/071e55756ef714d93f39710b75034e64d9f71950
Author: Simon Delamarre (simon.delamarre14 at gmail.com)
Date: 2024-07-16T21:29:53+02:00
Commit Message:
GOB: Fix a crash at startup in some Inca2 versions
There are some "goblin" opcodes (i.e. game-specific opcodes) not related
to the (currently skipped) space shooter, that must be handled
differently.
Changed paths:
engines/gob/inter.h
engines/gob/inter_inca2.cpp
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index c2d8b9f945d..7a0c705ad2b 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -584,6 +584,7 @@ protected:
void setupOpcodesGob() override;
void oInca2_spaceShooter(OpFuncParams ¶ms);
+ void oInca2_goblinFunc(OpFuncParams ¶ms);
};
class Inter_v4 : public Inter_v3 {
diff --git a/engines/gob/inter_inca2.cpp b/engines/gob/inter_inca2.cpp
index 0c3cc8eb657..0ab35211621 100644
--- a/engines/gob/inter_inca2.cpp
+++ b/engines/gob/inter_inca2.cpp
@@ -49,7 +49,7 @@ void Inter_Inca2::setupOpcodesDraw() {
void Inter_Inca2::setupOpcodesFunc() {
Inter_v3::setupOpcodesFunc();
- OPCODEFUNC(0x25, oInca2_spaceShooter);
+ OPCODEFUNC(0x25, oInca2_goblinFunc);
}
void Inter_Inca2::setupOpcodesGob() {
@@ -57,11 +57,23 @@ void Inter_Inca2::setupOpcodesGob() {
void Inter_Inca2::oInca2_spaceShooter(OpFuncParams ¶ms) {
// TODO: Not yet implemented. We'll pretend we won the match for now
- _vm->_game->_script->skip(4);
uint16 resVar = _vm->_game->_script->readUint16();
_vm->_game->_script->skip(4);
WRITE_VAR(resVar, 1);
}
+void Inter_Inca2::oInca2_goblinFunc(OpFuncParams ¶ms) {
+ OpGobParams gobParams;
+ int16 cmd = _vm->_game->_script->readInt16();
+
+ gobParams.paramCount = _vm->_game->_script->readInt16();
+ gobParams.extraData = cmd;
+
+ if (cmd == 100 || cmd == 200 || cmd == 218) // TODO: Non-space shooter opcodes found in disassembly, yet to be implemented
+ executeOpcodeGob(cmd, gobParams); // Will print the warning "unimplemented opcodeGob"
+ else
+ oInca2_spaceShooter(params); // Space shooter opcodes, also to be implemented (NOTE: there are actually several of them)
+}
+
} // End of namespace Gob
More information about the Scummvm-git-logs
mailing list