[Scummvm-git-logs] scummvm branch-2-3 -> 127306a90a5b669a060521af9ab00a4f95054fff

mduggan mgithub at guarana.org
Wed Sep 8 01:01: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:
24093ec783 ULTIMA8: Reduce incorrect global warnings in U8
127306a90a ULTIMA8: Increase process loop detection theeshold


Commit: 24093ec7834e3bcbe0ec47f824199c74ae3a1c3b
    https://github.com/scummvm/scummvm/commit/24093ec7834e3bcbe0ec47f824199c74ae3a1c3b
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-09-08T10:00:44+09:00

Commit Message:
ULTIMA8: Reduce incorrect global warnings in U8

Because the games have different global sizes, the logic for when to print a
pop-to-global warning was wrong.  It should warn for size > 2 in Crusader
(where the globals are *bytes*), or if the size popped doesn't fit in
the number of *bits* for U8.

Changed paths:
    engines/ultima/ultima8/usecode/uc_machine.cpp


diff --git a/engines/ultima/ultima8/usecode/uc_machine.cpp b/engines/ultima/ultima8/usecode/uc_machine.cpp
index f3fa903de1..8526f3ca89 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.cpp
+++ b/engines/ultima/ultima8/usecode/uc_machine.cpp
@@ -1234,12 +1234,12 @@ void UCMachine::execProcess(UCProcess *p) {
 		case 0x4F:
 			// 4F xx xx yy
 			// pop value into global xxxx size yy bits
-			ui16a = cs->readUint16LE();
-			ui16b = cs->readByte();
-			ui32a = p->_stack.pop2();
+			ui16a = cs->readUint16LE();	// pos
+			ui16b = cs->readByte();		// len
+			ui32a = p->_stack.pop2();	// val
 			_globals->setEntries(ui16a, ui16b, ui32a);
 
-			if ((GAME_IS_U8 && (ui32a & ~(((1 << ui16b) - 1)))) || ui16b > 2) {
+			if ((GAME_IS_U8 && (ui32a & ~(((1 << ui16b) - 1)))) || (GAME_IS_CRUSADER && (ui16b > 2))) {
 				perr << "Warning: value popped into a flag it doesn't fit in (" << ConsoleStream::hex
 					 << ui16a << " " << ui16b << " " << ui32a << ")" << Std::endl;
 			}


Commit: 127306a90a5b669a060521af9ab00a4f95054fff
    https://github.com/scummvm/scummvm/commit/127306a90a5b669a060521af9ab00a4f95054fff
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-09-08T10:00:50+09:00

Commit Message:
ULTIMA8: Increase process loop detection theeshold

As reported in #12913, the current process loop detection can incorrectly fire
on certain U8 map transitions.  Bump the threshold way up to avoid problems.
This will result in a nasty pause in Crusader: No Remorse Map 3, but it's
better than breaking U8.

Changed paths:
    engines/ultima/ultima8/kernel/kernel.cpp


diff --git a/engines/ultima/ultima8/kernel/kernel.cpp b/engines/ultima/ultima8/kernel/kernel.cpp
index 0a200d38fa..65cf06bd1e 100644
--- a/engines/ultima/ultima8/kernel/kernel.cpp
+++ b/engines/ultima/ultima8/kernel/kernel.cpp
@@ -173,7 +173,12 @@ void Kernel::runProcesses() {
 			// we can work out what it is avoid the game totally hanging at this
 			// point.
 			//
-			if (num_run > 8096 && !p->is_terminated()) {
+			// If this threshold is set too low, it can cause issues with U8 map
+			// transitions (eg, bug #12913).  If it's too high, Crusader locks up
+			// for a really long time at this point.  Set it high enough that
+			// a process going through all map items should still terminate.
+			//
+			if (num_run > 65536 && !p->is_terminated()) {
 				warning("Seem to be stuck in process loop - killing current process");
 				p->fail();
 			}




More information about the Scummvm-git-logs mailing list