aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2005-05-16 19:52:46 +0000
committerEugene Sandulenko2005-05-16 19:52:46 +0000
commite4ac8cb870ead3902bfaf652d8656aa88e45e9a2 (patch)
tree21fb80e40ea6068f73daafb0868ab3a5eefe35a3
parent7fa84d94ad2c723dcce7a5f3baea5a6e2e070578 (diff)
downloadscummvm-rg350-e4ac8cb870ead3902bfaf652d8656aa88e45e9a2.tar.gz
scummvm-rg350-e4ac8cb870ead3902bfaf652d8656aa88e45e9a2.tar.bz2
scummvm-rg350-e4ac8cb870ead3902bfaf652d8656aa88e45e9a2.zip
Fix from Quiteust for boxes in MM NES.
svn-id: r18132
-rw-r--r--scumm/boxes.cpp7
-rw-r--r--scumm/gfx.cpp1
2 files changed, 7 insertions, 1 deletions
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp
index 7a9643204a..88709b0679 100644
--- a/scumm/boxes.cpp
+++ b/scumm/boxes.cpp
@@ -117,6 +117,8 @@ void ScummEngine::setBoxFlags(int box, int val) {
} else {
Box *ptr = getBoxBaseAddr(box);
assert(ptr);
+ if (!ptr)
+ return;
if (_version == 8)
ptr->v8.flags = TO_LE_32(val);
else if (_version <= 2)
@@ -368,6 +370,11 @@ Box *ScummEngine::getBoxBaseAddr(int box) {
if (!ptr || box == 255)
return NULL;
+ // The NES version of Maniac Mansion attempts to set flags for boxes 2-4
+ // when there are only three boxes (0-2) when walking out to the garage.
+ if ((_gameId == GID_MANIAC) && (_platform == Common::kPlatformNES) && (box >= ptr[0]))
+ return NULL;
+
// FIXME: In "pass to adventure", the loom demo, when bobbin enters
// the tent to the elders, box = 2, but ptr[0] = 2 -> errors out.
// Hence we disable the check for now. Maybe in PASS (and other old games)
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 036263afc3..ea0bb4f7ab 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -2124,7 +2124,6 @@ void Gdi::drawStripNESMask(byte *dst, int stripnr, int height) const {
return;
}
for (int y = 0; y < height; y++) {
- // the ? 0xFF : 0x00 here might be backwards - '1' bits indicate that sprites can get hidden
byte c = (((_objectMode ? _NES.masktableObj : _NES.masktable)[y][x >> 3] >> (x & 7)) & 1) ? 0xFF : 0x00;
for (int i = 0; i < 8; i++) {
*dst = c;