aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/script_v5.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_v5.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_v5.cpp')
-rw-r--r--engines/scumm/script_v5.cpp56
1 files changed, 43 insertions, 13 deletions
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 8d986afc66..56c9f11445 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -1617,7 +1617,7 @@ void ScummEngine_v5::o5_resourceRoutines() {
void ScummEngine_v5::o5_roomOps() {
int a = 0, b = 0, c, d, e;
- const bool paramsBeforeOpcode = (_game.version == 3 && _game.platform != Common::kPlatformPCEngine);
+ const bool paramsBeforeOpcode = (_game.version == 3 && (_game.platform != Common::kPlatformPCEngine || _game.platform != Common::kPlatformFMTowns));
if (paramsBeforeOpcode) {
a = getVarOrDirectWord(PARAM_1);
@@ -1714,21 +1714,51 @@ void ScummEngine_v5::o5_roomOps() {
if (a) {
if (_game.platform == Common::kPlatformFMTowns) {
switch (a) {
- case 8: // compose kMainVirtScreen over a screen buffer
- case 9: // call 0x110:0x20 _ax=0x601 _edx=2
- case 10: // call 0x110:0x20 _ax=0x601 _edx=3
- case 11: // clear screen 0x1C:0x45000 sizeof(640 * 320)
- case 12: // call 0x110:0x20 _ax=0x601 _edx=0
- case 13: // call 0x110:0x20 _ax=0x601 _edx=1
- case 16: // enable clearing of a screen buffer in drawBitmap()
- case 17: // disable clearing of a screen buffer in drawBitmap()
- case 18: // clear a screen buffer
+ case 8:
+ towns_drawStripToScreen(&_virtscr[kMainVirtScreen], 0, _virtscr[kMainVirtScreen].topline, 0, 0, _virtscr[kMainVirtScreen].w, _virtscr[kMainVirtScreen].topline + _virtscr[kMainVirtScreen].h);
+ _townsScreen->update();
+ return;
+ case 9:
+ _townsActiveLayerFlags = 2;
+ _townsScreen->toggleLayers(_townsActiveLayerFlags);
+ return;
+ case 10:
+ _townsActiveLayerFlags = 3;
+ _townsScreen->toggleLayers(_townsActiveLayerFlags);
+ return;
+ case 11:
+ _townsScreen->clearLayer(1);
+ return;
+ case 12:
+ _townsActiveLayerFlags = 0;
+ _townsScreen->toggleLayers(_townsActiveLayerFlags);
+ return;
+ case 13:
+ _townsActiveLayerFlags = 1;
+ _townsScreen->toggleLayers(_townsActiveLayerFlags);
+ return;
+ case 16: // enable clearing of layer 2 buffer in drawBitmap()
+ _townsPaletteFlags |= 2;
+ return;
+ case 17: // disable clearing of layer 2 buffer in drawBitmap()
+ _townsPaletteFlags &= ~2;
+ return;
+ case 18: // clear kMainVirtScreen layer 2 buffer
+ _textSurface.fillRect(Common::Rect(0, _virtscr[kMainVirtScreen].topline * _textSurfaceMultiplier, _textSurface.pitch, (_virtscr[kMainVirtScreen].topline + _virtscr[kMainVirtScreen].h) * _textSurfaceMultiplier), 0);
case 19: // enable palette operations (palManipulate(), cyclePalette() etc.)
+ _townsPaletteFlags |= 1;
+ return;
case 20: // disable palette operations
- case 21: // disable clearing of screen 0x1C:0x5000 sizeof(640 * 320) in initScreens()
- case 22: // enable clearing of screen 0x1C:0x5000 sizeof(640 * 320) in initScreens()
+ _townsPaletteFlags &= ~1;
+ return;
+ case 21: // disable clearing of layer 0 in initScreens()
+ _townsClearLayerFlag = 1;
+ return;
+ case 22: // enable clearing of layer 0 in initScreens()
+ _townsClearLayerFlag = 0;
+ return;
case 30:
- debug(0, "o5_roomOps: unhandled FM-TOWNS fadeEffect %d", a);
+ _townsOverrideShadowColor = 3;
return;
}
}