aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2002-04-17 03:11:37 +0000
committerJames Brown2002-04-17 03:11:37 +0000
commitb4844d701a936fef55962a30efc3ecafa9536722 (patch)
treed4641c59ec9a99c896fe3c88cba44bdbbc63a3a5
parent23feb3083cfbc3164d27d06c032fa6e7eb5f93ba (diff)
downloadscummvm-rg350-b4844d701a936fef55962a30efc3ecafa9536722.tar.gz
scummvm-rg350-b4844d701a936fef55962a30efc3ecafa9536722.tar.bz2
scummvm-rg350-b4844d701a936fef55962a30efc3ecafa9536722.zip
Add Amiga palette option (-a)
svn-id: r3971
-rw-r--r--gameDetector.cpp7
-rw-r--r--gameDetector.h1
-rw-r--r--gfx.cpp29
-rw-r--r--gfx.h1
4 files changed, 24 insertions, 14 deletions
diff --git a/gameDetector.cpp b/gameDetector.cpp
index 58c1afd6b7..d43c910202 100644
--- a/gameDetector.cpp
+++ b/gameDetector.cpp
@@ -46,7 +46,7 @@ static const char USAGE_STRING[] =
"\tr - emulate roland mt32 instruments\n"
"\tf - fullscreen mode\n"
"\tg<mode> - graphics mode. normal,2x,3x,2xsai,super2xsai,supereagle\n"
- "\ta - load autosave game (for recovering from crashes)\n"
+ "\ta - specify game is amiga version\n"
;
void GameDetector::parseCommandLine(int argc, char **argv)
@@ -70,7 +70,7 @@ void GameDetector::parseCommandLine(int argc, char **argv)
while (*s) {
switch (tolower(*s)) {
case 'a':
- _restore = true;
+ _amiga = true;
break;
case 'b':
if (*(s + 1) == '\0')
@@ -388,6 +388,9 @@ int GameDetector::detectMain(int argc, char **argv)
_gameDataPath = strdup("");
}
+ if (_amiga)
+ _features = _features | GF_AMIGA;
+
return (0);
}
diff --git a/gameDetector.h b/gameDetector.h
index 43473e3fa9..5fb53cc804 100644
--- a/gameDetector.h
+++ b/gameDetector.h
@@ -37,6 +37,7 @@ public:
byte _music_volume;
byte _sfx_volume;
bool _mt32emulate;
+ bool _amiga;
uint16 _debugMode;
uint16 _noSubtitles;
diff --git a/gfx.cpp b/gfx.cpp
index 443ea86061..c5e69bbb5b 100644
--- a/gfx.cpp
+++ b/gfx.cpp
@@ -749,9 +749,13 @@ void Gdi::decompressBitmap()
_useOrDecompress = false;
byte code = *_smap_ptr++;
-
assert(_numLinesToProcess);
+ if (_vm->_features & GF_AMIGA)
+ _palette_mod = 16;
+ else
+ _palette_mod = 0;
+
switch (code) {
case 1:
unkDecode7();
@@ -1053,7 +1057,7 @@ void Gdi::unkDecode1()
do {
_currentX = 8;
do {
- FILL_BITS * dst++ = color;
+ FILL_BITS * dst++ = color + _palette_mod;;
againPos:;
@@ -1071,7 +1075,7 @@ void Gdi::unkDecode1()
if (!--_tempNumLines)
return;
}
- *dst++ = color;
+ *dst++ = color + _palette_mod;
} while (--reps);
bits >>= 8;
bits |= (*src++) << (cl - 8);
@@ -1105,7 +1109,7 @@ void Gdi::unkDecode2()
_currentX = 8;
do {
FILL_BITS if (color != _transparency)
- *dst = color;
+ *dst = color + _palette_mod;
dst++;
if (!READ_BIT) {
} else if (!READ_BIT) {
@@ -1140,7 +1144,7 @@ void Gdi::unkDecode3()
_currentX = 8;
do {
FILL_BITS if (color != _transparency)
- *dst = color;
+ *dst = color + _palette_mod;
dst++;
againPos:;
@@ -1172,7 +1176,7 @@ void Gdi::unkDecode3()
if (!--_tempNumLines)
return;
}
- *dst++ = color;
+ *dst++ = color + _palette_mod;
} while (--reps);
}
bits >>= 8;
@@ -1205,7 +1209,7 @@ void Gdi::unkDecode4()
_tempNumLines = _numLinesToProcess;
do {
FILL_BITS if (color != _transparency)
- *dst = color;
+ *dst = color + _palette_mod;
dst += 320;
if (!READ_BIT) {
} else if (!READ_BIT) {
@@ -1239,7 +1243,7 @@ void Gdi::unkDecode5()
do {
_currentX = 8;
do {
- FILL_BITS * dst++ = color;
+ FILL_BITS * dst++ = color + _palette_mod;
if (!READ_BIT) {
} else if (!READ_BIT) {
FILL_BITS color = bits & _decomp_mask;
@@ -1271,7 +1275,7 @@ void Gdi::unkDecode6()
do {
_tempNumLines = _numLinesToProcess;
do {
- FILL_BITS * dst = color;
+ FILL_BITS * dst = color + _palette_mod;
dst += 320;
if (!READ_BIT) {
} else if (!READ_BIT) {
@@ -2191,8 +2195,7 @@ void Scumm::setCursorHotspot2(int x, int y)
byte Scumm::isMaskActiveAt(int l, int t, int r, int b, byte *mem)
{
int w, h, i;
- if (_features & GF_SMALL_HEADER)
- return 0;
+
l >>= 3;
if (l < 0)
l = 0;
@@ -2210,8 +2213,10 @@ byte Scumm::isMaskActiveAt(int l, int t, int r, int b, byte *mem)
do {
for (i = 0; i <= w; i++)
- if (mem[i])
+ if (mem[i]) {
+ //printf("memi is %d\n", mem[i]);
return true;
+ }
mem += 40;
} while (--h);
diff --git a/gfx.h b/gfx.h
index adf06ed7fe..5bef005c08 100644
--- a/gfx.h
+++ b/gfx.h
@@ -128,6 +128,7 @@ struct Gdi {
byte *_mask_ptr_dest;
byte *_z_plane_ptr;
+ byte _palette_mod;
byte _decomp_shr, _decomp_mask;
byte _transparency;
uint16 _vertStripNextInc;