[Scummvm-git-logs] scummvm master -> 9ed43c6fa56272293e26814bdfeb3d22a14e4df3

bluegr noreply at scummvm.org
Tue Sep 12 10:56:05 UTC 2023


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:
9ed43c6fa5 SCI: Tweak dissassembly for push opcodes


Commit: 9ed43c6fa56272293e26814bdfeb3d22a14e4df3
    https://github.com/scummvm/scummvm/commit/9ed43c6fa56272293e26814bdfeb3d22a14e4df3
Author: Ralph Caraveo (deckarep at gmail.com)
Date: 2023-09-12T13:56:01+03:00

Commit Message:
SCI: Tweak dissassembly for push opcodes

Tweak in scriptdebug.cpp disassembler logic because the new logging wasn't quite working how it was expected.

- These opcodes weren't showing up with their selectors in all scenarios
- Improve output formatting

Changed paths:
    engines/sci/engine/scriptdebug.cpp


diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 0910705d728..ed1b6dd1264 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -153,6 +153,11 @@ reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag,
 #endif
 
 	static const char *defaultSeparator = "\t\t; ";
+	
+	// Provide additional selector name context for push0, push1, push2 opcodes.
+	if (opcode >= op_push0 && opcode <= op_push2) {
+		debugN("\t%s%s", defaultSeparator, kernel->getSelectorName(opcode - op_push0).c_str());
+	}
 
 	i = 0;
 	while (g_sci->_opcode_formats[opcode][i]) {
@@ -256,10 +261,8 @@ reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag,
 					separator = ", ";
 				}
 
-				// Provide additional selector name context for all integer push scenarios.
-				if (opcode >= op_push0 && opcode <= op_push2) {
-    				debugN("%s%s", separator, kernel->getSelectorName(opcode - op_push0).c_str());
-				} else if (opcode == op_pushi && param_value < kernel->getSelectorNamesSize()) {
+				// Provide additional selector name context for pushi opcodes.
+				if (opcode == op_pushi && param_value < kernel->getSelectorNamesSize()) {
 					debugN("%s%s", separator, kernel->getSelectorName(param_value).c_str());
 				}
 			}




More information about the Scummvm-git-logs mailing list