aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-05-10 22:35:12 +0000
committerMax Horn2003-05-10 22:35:12 +0000
commit5be0ce7adc9952ff065c7ec04cab4b87eb7b0e28 (patch)
treeeb14397b4e391d1c3c4e4c799b70fa438da34bb1 /scumm
parentf412952667e36a023b239b8ee62994635ca375a5 (diff)
downloadscummvm-rg350-5be0ce7adc9952ff065c7ec04cab4b87eb7b0e28.tar.gz
scummvm-rg350-5be0ce7adc9952ff065c7ec04cab4b87eb7b0e28.tar.bz2
scummvm-rg350-5be0ce7adc9952ff065c7ec04cab4b87eb7b0e28.zip
work around some illegal var access' in COMI/V8 - there are more, but I am not always sure if avoiding the access is the proper fix; maybe in some cases we should just define that var for V8 to the proper value?
svn-id: r7425
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp3
-rw-r--r--scumm/script_v6.cpp6
-rw-r--r--scumm/scummvm.cpp5
3 files changed, 9 insertions, 5 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index f7379e03c2..a262dbeed9 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -2724,8 +2724,9 @@ void Scumm::cyclePalette() {
byte *start, *end;
byte tmp[3];
- if (_features & GF_AFTER_V2) {
+ if (VAR_TIMER == 0xFF) {
// FIXME - no idea if this is right :-/
+ // Needed for both V2 and V8 at this time
valueToAdd = VAR(VAR_TIMER_NEXT);
} else {
valueToAdd = VAR(VAR_TIMER);
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 16f04701dd..7b69a6578c 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -1155,7 +1155,8 @@ void Scumm_v6::o6_loadRoomWithEgo() {
void Scumm_v6::o6_getRandomNumber() {
int rnd;
rnd = _rnd.getRandomNumber(pop());
- VAR(VAR_V6_RANDOM_NR) = rnd;
+ if (VAR_V6_RANDOM_NR != 0xFF)
+ VAR(VAR_V6_RANDOM_NR) = rnd;
push(rnd);
}
@@ -1163,7 +1164,8 @@ void Scumm_v6::o6_getRandomNumberRange() {
int max = pop();
int min = pop();
int rnd = _rnd.getRandomNumberRng(min, max);
- VAR(VAR_V6_RANDOM_NR) = rnd;
+ if (VAR_V6_RANDOM_NR != 0xFF)
+ VAR(VAR_V6_RANDOM_NR) = rnd;
push(rnd);
}
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 4f48a6c2f8..0e90b8945b 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -856,8 +856,9 @@ int Scumm::scummLoop(int delta) {
VAR(VAR_TMR_1) += delta;
VAR(VAR_TMR_2) += delta;
VAR(VAR_TMR_3) += delta;
- VAR(VAR_TMR_4) += delta;
}
+ if (VAR_TMR_4 != 0xFF)
+ VAR(VAR_TMR_4) += delta;
if (delta > 15)
delta = 15;
@@ -1066,7 +1067,7 @@ load_game:
/* show or hide mouse */
_system->show_mouse(_cursor.state > 0);
- if (!(_features & GF_AFTER_V2))
+ if (VAR_TIMER != 0xFF)
VAR(VAR_TIMER) = 0;
return VAR(VAR_TIMER_NEXT);