aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2007-10-19 23:00:43 +0000
committerSven Hesse2007-10-19 23:00:43 +0000
commitdd5be6826a081742c91ce8e9c36bf623b7754300 (patch)
treee05d6020a52a2fd95df2bf103995ff9b48667590 /engines/gob
parent41d67964b1c267447e769dcc724d841a8154bd9e (diff)
downloadscummvm-rg350-dd5be6826a081742c91ce8e9c36bf623b7754300.tar.gz
scummvm-rg350-dd5be6826a081742c91ce8e9c36bf623b7754300.tar.bz2
scummvm-rg350-dd5be6826a081742c91ce8e9c36bf623b7754300.zip
Fixing the Gob3 CD crash on ARM systems/ports
svn-id: r29235
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/game_v1.cpp4
-rw-r--r--engines/gob/game_v2.cpp4
-rw-r--r--engines/gob/global.h5
-rw-r--r--engines/gob/gob.h4
4 files changed, 9 insertions, 8 deletions
diff --git a/engines/gob/game_v1.cpp b/engines/gob/game_v1.cpp
index c6830686fe..5a968b0619 100644
--- a/engines/gob/game_v1.cpp
+++ b/engines/gob/game_v1.cpp
@@ -1060,14 +1060,14 @@ void Game_v1::collisionsBlock(void) {
_vm->_util->prepareStr(_collStr);
if (strcmp(_tempStr, _collStr) == 0) {
- VAR(17)++;
+ WRITE_VAR(17, VAR(17) + 1);
WRITE_VAR(17 + var_26, 1);
break;
}
} while (READ_LE_UINT16(descArray[var_24].ptr - 2) > pos);
collStackPos++;
} else {
- VAR(17 + var_26) = 2;
+ WRITE_VAR(17 + var_26, 2);
}
var_24++;
var_26++;
diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp
index 37acf204b6..561f05c530 100644
--- a/engines/gob/game_v2.cpp
+++ b/engines/gob/game_v2.cpp
@@ -1094,14 +1094,14 @@ void Game_v2::collisionsBlock(void) {
_vm->_util->prepareStr(_collStr);
if (strcmp(_tempStr, _collStr) == 0) {
- VAR(17)++;
+ WRITE_VAR(17, VAR(17) + 1);
WRITE_VAR(17 + var_26, 1);
break;
}
} while (READ_LE_UINT16(descArray[var_24].ptr - 2) > pos);
collStackPos++;
} else {
- VAR(17 + var_26) = 2;
+ WRITE_VAR(17 + var_26, 2);
}
var_24++;
var_26++;
diff --git a/engines/gob/global.h b/engines/gob/global.h
index 6dab0c0bc6..3682e0b5fc 100644
--- a/engines/gob/global.h
+++ b/engines/gob/global.h
@@ -27,6 +27,7 @@
#define GOB_GLOBAL_H
#include "common/file.h"
+#include "common/endian.h"
#include "gob/video.h"
@@ -156,11 +157,11 @@ public:
}
void writeVar(uint32 offset, uint32 val) {
- (*(uint32 *)(_inter_variables + offset)) = val;
+ WRITE_UINT32(_inter_variables + offset, val);
writeVarSize(offset, 3);
}
void writeVar(uint32 offset, uint16 val) {
- (*(uint16 *)(_inter_variables + offset)) = val;
+ WRITE_UINT16(_inter_variables + offset, val);
writeVarSize(offset, 1);
}
void writeVar(uint32 offset, uint8 val) {
diff --git a/engines/gob/gob.h b/engines/gob/gob.h
index 4bd0ab96c3..6f83fce1a2 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -63,8 +63,8 @@ class Adlib;
#define WRITE_VAR_UINT16(var, val) WRITE_VARO_UINT16((var) << 2, (val))
#define WRITE_VAR_UINT8(var, val) WRITE_VARO_UINT8((var) << 2, (val))
#define WRITE_VAR_STR(var, str) WRITE_VARO_STR((var) << 2, (str))
-#define READ_VARO_UINT32(offs) (*((uint32 *) VARP(offs)))
-#define READ_VARO_UINT16(offs) (*((uint16 *) VARP(offs)))
+#define READ_VARO_UINT32(offs) READ_UINT32(VARP(offs))
+#define READ_VARO_UINT16(offs) READ_UINT16(VARP(offs))
#define READ_VARO_UINT8(offs) (*((uint8 *) VARP(offs)))
#define READ_VAR_UINT32(var) READ_VARO_UINT32((var) << 2)
#define READ_VAR_UINT16(var) READ_VARO_UINT16((var) << 2)