[Scummvm-git-logs] scummvm branch-2-6 -> a1134cf26508454bc2a9a18c9f77173f7d692170
sev-
noreply at scummvm.org
Wed Jun 8 13:17:37 UTC 2022
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:
4686756aa0 SCUMM: Fix random number generation in SCUMM6
a1134cf265 NEWS: Mention SCUMM RNG fix
Commit: 4686756aa0a2dca77ef117ca04f33fc822d7582b
https://github.com/scummvm/scummvm/commit/4686756aa0a2dca77ef117ca04f33fc822d7582b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-06-08T15:17:18+02:00
Commit Message:
SCUMM: Fix random number generation in SCUMM6
Now it matches disassembly and particularly fixes RNG in
Backyard Sports games.
Changed paths:
engines/scumm/script_v6.cpp
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index a51ecb92bce..7abf1608905 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -1345,8 +1345,8 @@ void ScummEngine_v6::o6_loadRoomWithEgo() {
}
void ScummEngine_v6::o6_getRandomNumber() {
- int rnd;
- rnd = _rnd.getRandomNumber(ABS(pop()));
+ int rnd = _rnd.getRandomNumber(0x7fff);
+ rnd = rnd % (pop() + 1);
if (VAR_RANDOM_NR != 0xFF)
VAR(VAR_RANDOM_NR) = rnd;
push(rnd);
@@ -1355,7 +1355,8 @@ void ScummEngine_v6::o6_getRandomNumber() {
void ScummEngine_v6::o6_getRandomNumberRange() {
int max = pop();
int min = pop();
- int rnd = _rnd.getRandomNumberRng(min, max);
+ int rnd = _rnd.getRandomNumber(0x7fff);
+ rnd = min + (rnd % (max - min + 1));
if (VAR_RANDOM_NR != 0xFF)
VAR(VAR_RANDOM_NR) = rnd;
push(rnd);
@@ -2901,10 +2902,10 @@ void ScummEngine_v6::o6_delayFrames() {
// WORKAROUND: At startup, Moonbase Commander will pause for 20 frames before
// showing the Infogrames logo. The purpose of this break is to give time for the
// GameSpy Arcade application to fill with the Online game infomation.
- //
+ //
// [0000] (84) localvar2 = max(readConfigFile.number(":var263:","user","wait-for-gamespy"),10)
// [0029] (08) delayFrames((localvar2 * 2))
- //
+ //
// But since we don't support GameSpy and have our own Online support, this break
// has become redundant and only wastes time.
if (_game.id == GID_MOONBASE && vm.slot[_currentScript].number == 69) {
Commit: a1134cf26508454bc2a9a18c9f77173f7d692170
https://github.com/scummvm/scummvm/commit/a1134cf26508454bc2a9a18c9f77173f7d692170
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-06-08T15:17:28+02:00
Commit Message:
NEWS: Mention SCUMM RNG fix
Changed paths:
NEWS.md
diff --git a/NEWS.md b/NEWS.md
index e94076d09ce..3a3b457346c 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -153,6 +153,7 @@ For a more comprehensive changelog of the latest experimental code, see:
Run Games sold in their Monkey Island 30th Anniversary Anthology, if using
the default DISK4 image, which is corrupted. It's possible to recover a
working image from the KryoFlux dumps they also provided.
+ - Fixed random number generation which fixes throwing in Backyard Baseball.
Sherlock:
- Fixed slowdown in Serrated Scalpel intro when playing the game from a small
More information about the Scummvm-git-logs
mailing list