aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/util.cpp
diff options
context:
space:
mode:
authormd52011-03-03 19:34:11 +0200
committermd52011-03-03 19:34:11 +0200
commit51437ba5e6e418d7e79cf341606bc6c1c50fd50b (patch)
tree8375cf8727b5af39dc844f3d176afa575b0576b1 /engines/sci/util.cpp
parent1aed9a1f3401477d4d56e278fec63cd90fafd81d (diff)
downloadscummvm-rg350-51437ba5e6e418d7e79cf341606bc6c1c50fd50b.tar.gz
scummvm-rg350-51437ba5e6e418d7e79cf341606bc6c1c50fd50b.tar.bz2
scummvm-rg350-51437ba5e6e418d7e79cf341606bc6c1c50fd50b.zip
SCI: Fixed path finding in Amiga SCI1 games
Added wrapper functions to read/write from dynmem segments, as these are treated as BE in Amiga versions (as we treat them like raw data instead of reg_t's), whereas the rest are LE. Thanks to waltervn and wjp for their help on this
Diffstat (limited to 'engines/sci/util.cpp')
-rw-r--r--engines/sci/util.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/engines/sci/util.cpp b/engines/sci/util.cpp
index f6a2465682..6bc08e6b63 100644
--- a/engines/sci/util.cpp
+++ b/engines/sci/util.cpp
@@ -30,6 +30,20 @@
namespace Sci {
+uint16 READ_SCI1ENDIAN_UINT16(const void *ptr) {
+ if (g_sci->getPlatform() == Common::kPlatformAmiga && getSciVersion() >= SCI_VERSION_1_EGA_ONLY && getSciVersion() <= SCI_VERSION_1_LATE)
+ return READ_BE_UINT16(ptr);
+
+ return READ_LE_UINT16(ptr);
+}
+
+void WRITE_SCI1ENDIAN_UINT16(void *ptr, uint16 val) {
+ if (g_sci->getPlatform() == Common::kPlatformAmiga && getSciVersion() >= SCI_VERSION_1_EGA_ONLY && getSciVersion() <= SCI_VERSION_1_LATE)
+ WRITE_BE_UINT16(ptr, val);
+
+ WRITE_LE_UINT16(ptr, val);
+}
+
uint16 READ_SCI11ENDIAN_UINT16(const void *ptr) {
if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_1_1)
return READ_BE_UINT16(ptr);