aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/script_v4.cpp
diff options
context:
space:
mode:
authorFlorian Kagerer2010-10-01 19:24:52 +0000
committerFlorian Kagerer2010-10-01 19:24:52 +0000
commit0d8f4a22ae51d5943014a4c5f3ba610686039a24 (patch)
tree4f2ba902f2681c10f1f9949efc9424bcc93e14c1 /engines/scumm/script_v4.cpp
parentbe1d196da5dbbabaef0bfa835b51e9c82c407645 (diff)
downloadscummvm-rg350-0d8f4a22ae51d5943014a4c5f3ba610686039a24.tar.gz
scummvm-rg350-0d8f4a22ae51d5943014a4c5f3ba610686039a24.tar.bz2
scummvm-rg350-0d8f4a22ae51d5943014a4c5f3ba610686039a24.zip
SCUMM/FM-TOWNS: fix palette and other graphics issues
This commit should fix at least the following bugs/feature requests: #1032859, #1252088, #1055391, #1315968, #1315938, #1742106, #812891. The FM-Towns version of Scumm games use a mixed graphics mode with 2 layers (one with 32767 colors and one with 16 colors). Among other things I have added a screen output class which emulates this dual layer approach which allows specific hardware effects like enabling and disabling layers (e.g. in the voodoo priestess scene in MI1). Old savegames (saved before this update) will load, but you’ll encounter palette glitches in the verb/inventory screen, since the 16 color palette for layer 2 is not contained in your savegame. This will be true at least for version 5 games. Certain scene change actions (which require the verb/inventory part to be redrawn) might correct this (e.g. try looking at the treasure map in MI1 and closing it). Version 3 games should be okay, since they use a static text palette which is never changed and which will be reset after loading a savegame. This update requires a USE_RGB_COLORS setting for proper operation. 8 bit users will get a warning that they’ll have to expect palette glitches . Apart from that the engine in 8 bit mode should not only still work okay, but also benefit from some of the other (non palette related) improvements (e.g. bug #1032859 should be fixed even in 8 bit mode). Japanese font drawing hasn’t been improved much yet. This will be a separate task. svn-id: r52966
Diffstat (limited to 'engines/scumm/script_v4.cpp')
-rw-r--r--engines/scumm/script_v4.cpp57
1 files changed, 5 insertions, 52 deletions
diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp
index 6dc3004432..8e1feb7388 100644
--- a/engines/scumm/script_v4.cpp
+++ b/engines/scumm/script_v4.cpp
@@ -111,62 +111,15 @@ void ScummEngine_v4::o4_oldRoomEffect() {
if ((_opcode & 0x1F) == 3) {
a = getVarOrDirectWord(PARAM_1);
-#if 1
if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {
- // FIXME / TODO: OK the first thing to note is: at least in Zak256,
- // maybe also in other games, this opcode does a bit more. I added
- // some stubs here, but somebody with a full IDA or more knowledge
- // about this will have to fill in the gaps. At least now we know
- // that something is missing here :-)
-
if (a == 4) {
- //printf("o5_oldRoomEffect ODDBALL: _opcode = 0x%x, a = 0x%x\n", _opcode, a);
- // No idea what byte_2FCCF is, but it's a globale boolean flag.
- // I only add it here as a temporary hack to make the pseudo code compile.
- // Maybe it is just there as a reentry protection guard, given
- // how it is used? It might also correspond to _screenEffectFlag.
- int byte_2FCCF = 0;
-
- // For now, we force a redraw of the screen background. This
- // way the Zak end credits seem to work mostly correct.
- VirtScreen *vs = &_virtscr[kMainVirtScreen];
- restoreBackground(Common::Rect(0, vs->topline, vs->w, vs->topline + vs->h));
- vs->setDirtyRange(0, vs->h);
- updateDirtyScreen(kMainVirtScreen);
-
- if (byte_2FCCF) {
- // Here now "sub_1C44" is called, which sets byte_2FCCF to 0 then
- // calls yet another sub (which also reads byte_2FCCF):
-
- byte_2FCCF = 0;
- //call sub_0BB3
-
-
- // Now sub_085C is called. This is quite simply: it sets
- // 0xF000 bytes. starting at 0x40000 to 0. No idea what that
- // buffer is, maybe a screen buffer, though. Note that
- // 0xF000 = 320*192.
- // Maybe this is also the charset mask being cleaned?
-
- // call sub_085C
-
-
- // And then sub_1C54 is called, which is almost identical to
- // the above sub_1C44, only it sets byte_2FCCF to 1:
-
- byte_2FCCF = 1;
- // call sub_0BB3
-
- } else {
- // Here only sub_085C is called (see comment above)
-
- // call sub_085C
- }
- return;
+ _textSurface.fillRect(Common::Rect(0, 0, _textSurface.w * _textSurfaceMultiplier, _textSurface.h * _textSurfaceMultiplier), 0);
+ if (_townsScreen)
+ _townsScreen->clearLayer(1);
+ return;
}
-#endif
-
}
+
if (a) {
_switchRoomEffect = (byte)(a & 0xFF);
_switchRoomEffect2 = (byte)(a >> 8);