[Scummvm-git-logs] scummvm master -> dfa3c1b67b9046b1b01ae4cef6f26f1585150a6e
somaen
einarjohants at gmail.com
Sat Feb 6 00:33:16 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9abd575302 TINSEL: Don't check for "!= TinselV2" when correcting for V1 chunks
dfa3c1b67b TINSEL: Add NOOP-instruction to pcode, and adjust accordingly.
Commit: 9abd57530212c9b56e1faea12084aada23429659
https://github.com/scummvm/scummvm/commit/9abd57530212c9b56e1faea12084aada23429659
Author: Einar Johan Trøan SømaÌen (somaen at scummvm.org)
Date: 2021-02-06T01:25:55+01:00
Commit Message:
TINSEL: Don't check for "!= TinselV2" when correcting for V1 chunks
This way Noir also avoids this adjustment
Changed paths:
engines/tinsel/scn.cpp
diff --git a/engines/tinsel/scn.cpp b/engines/tinsel/scn.cpp
index 54c53c97bb..c5b8a4ce60 100644
--- a/engines/tinsel/scn.cpp
+++ b/engines/tinsel/scn.cpp
@@ -42,7 +42,7 @@ byte *FindChunk(SCNHANDLE handle, uint32 chunk) {
uint32 add;
// Initial adjustmnet for Tinsel 1 chunk types
- if ((TinselVersion != TINSEL_V2) && (chunk >= CHUNK_SCENE) &&
+ if ((TinselV0 || TinselV1) && (chunk >= CHUNK_SCENE) &&
(chunk != CHUNK_MBSTRING))
--chunk;
Commit: dfa3c1b67b9046b1b01ae4cef6f26f1585150a6e
https://github.com/scummvm/scummvm/commit/dfa3c1b67b9046b1b01ae4cef6f26f1585150a6e
Author: Einar Johan Trøan SømaÌen (somaen at scummvm.org)
Date: 2021-02-06T01:31:20+01:00
Commit Message:
TINSEL: Add NOOP-instruction to pcode, and adjust accordingly.
Changed paths:
engines/tinsel/pcode.cpp
engines/tinsel/tinlib.cpp
diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp
index d87cccaac6..8e27f78a5f 100644
--- a/engines/tinsel/pcode.cpp
+++ b/engines/tinsel/pcode.cpp
@@ -48,6 +48,7 @@ extern int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONT
/** list of all opcodes */
enum OPCODE {
+ OP_NOOP = 0x3F, ///< Do nothing (Actually 0 in Noir, but due to -1 we get this)
OP_HALT = 0, ///< end of program
OP_IMM = 1, ///< loads signed immediate onto stack
OP_ZERO = 2, ///< loads zero onto stack
@@ -625,6 +626,12 @@ void Interpret(CORO_PARAM, INT_CONTEXT *ic) {
if (TinselV0 && ((opcode & OPMASK) > OP_IMM))
opcode += 3;
+ if (TinselV3) {
+ // Discworld Noir adds a NOOP-operation as opcode 0, leaving everything
+ // else 1 higher, so we subtract 1, and add NOOP as the highest opcode instead.
+ opcode -= 1;
+ }
+
debug(7, "ip=%d Opcode %d (-> %d)", ic->ip, opcode, opcode & OPMASK);
switch (opcode & OPMASK) {
case OP_HALT: // end of program
@@ -851,6 +858,12 @@ void Interpret(CORO_PARAM, INT_CONTEXT *ic) {
ic->myEscape = 0;
break;
+ case OP_NOOP:
+ if (!TinselV3) {
+ error("OP_NOOP seen outside Discworld Noir");
+ }
+ break;
+
default:
error("Interpret() - Unknown opcode");
}
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index c4238d4574..c8e969fd27 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -4185,6 +4185,9 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
if (TinselV0) libCode = DW1DEMO_CODES[operand];
else if (!TinselV2) libCode = DW1_CODES[operand];
else if (TinselV2Demo) libCode = DW2DEMO_CODES[operand];
+ else if (TinselV3) {
+ error("TODO: Implement library routines for Discworld Noir");
+ }
else libCode = DW2_CODES[operand];
debug(7, "CallLibraryRoutine op %d (escOn %d, myEscape %d)", operand, pic->escOn, pic->myEscape);
More information about the Scummvm-git-logs
mailing list