From 29a5c6a45b90e64cf5d618da4cdcd6e6da3425fb Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Wed, 18 Aug 2010 21:38:43 +0000 Subject: SCUMM/FM-TOWNS: start rewriting audio code - Start rewriting audio code for FM-TOWNS versions of Loom, Indy3 and Monkey Island 1 using the recently added code in towns_audio.cpp (Zak should work the same way, but I can't test, since I don't own that one). - All sound types (pcm, euphony and cd audio) now support volume and balance control (e.g. try walking into/out of the kitchen and opening/closing the door in the Scumm Bar in Monkey Island 1 or walking into/out of the circus tent). - Pcm sounds now support proper loop start/end and note offsets (e.g. try out the hammer sound in the forge in LOOM for example). - some other minor improvements - The FM-Towns versions of Indy 4 and Monkey Island 2 are not affected. I don't have Monkey Island 2, but I presume that it will work like Indy 4. Adding support for these will be a separate task, since they work quite differently. svn-id: r52198 --- engines/scumm/saveload.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines/scumm/saveload.cpp') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 3cc619f630..ca48a2b86a 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -32,6 +32,7 @@ #include "scumm/charset.h" #include "scumm/imuse_digi/dimuse.h" #include "scumm/imuse/imuse.h" +#include "player_towns.h" #include "scumm/he/intern_he.h" #include "scumm/object.h" #include "scumm/resource.h" @@ -447,6 +448,9 @@ bool ScummEngine::loadState(int slot, bool compat) { // Update volume settings syncSoundSettings(); + if (_townsPlayer && (hdr.ver >= VER(81))) + _townsPlayer->restoreAfterLoad(); + // Init NES costume data if (_game.platform == Common::kPlatformNES) { if (hdr.ver < VER(47)) @@ -1394,6 +1398,11 @@ void ScummEngine::saveOrLoad(Serializer *s) { _imuse->save_or_load(s, this); } + + // Save/load FM-Towns audio status + if (_townsPlayer) + _townsPlayer->saveLoadWithSerializer(s); + // // Save/load the charset renderer state // -- cgit v1.2.3 From 0d8f4a22ae51d5943014a4c5f3ba610686039a24 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Fri, 1 Oct 2010 19:24:52 +0000 Subject: 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 --- engines/scumm/saveload.cpp | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'engines/scumm/saveload.cpp') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index ca48a2b86a..a1747db690 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1294,9 +1294,36 @@ void ScummEngine::saveOrLoad(Serializer *s) { // // Save/load palette data // - if (_16BitPalette) { + if (_16BitPalette && !(_game.platform == Common::kPlatformFMTowns && s->isLoading() && s->getVersion() < VER(82))) { s->saveLoadArrayOf(_16BitPalette, 512, sizeof(_16BitPalette[0]), sleUint16); } + + // FM-Towns specific (extra palette data, color cycle data, etc.) + if (s->getVersion() >= VER(82)) { + const SaveLoadEntry townsFields[] = { + MKLINE(Common::Rect, left, sleInt16, VER(82)), + MKLINE(Common::Rect, top, sleInt16, VER(82)), + MKLINE(Common::Rect, right, sleInt16, VER(82)), + MKLINE(Common::Rect, bottom, sleInt16, VER(82)), + MKEND() + }; + + const SaveLoadEntry townsExtraEntries[] = { + MKLINE(ScummEngine, _townsOverrideShadowColor, sleUint8, VER(82)), + MKLINE(ScummEngine, _numCyclRects, sleUint8, VER(82)), + MKLINE(ScummEngine, _townsPaletteFlags, sleUint8, VER(82)), + MKLINE(ScummEngine, _townsClearLayerFlag, sleUint8, VER(82)), + MKLINE(ScummEngine, _townsActiveLayerFlags, sleUint8, VER(82)), + MKEND() + }; + + s->saveLoadArrayOf(_textPalette, 48, sizeof(_textPalette[0]), sleUint8); + s->saveLoadArrayOf(_cyclRects, 10, sizeof(_cyclRects[0]), townsFields); + s->saveLoadArrayOf(&_curStringRect, 1, sizeof(_curStringRect), townsFields); + s->saveLoadArrayOf(_townsCharsetColorMap, 16, sizeof(_townsCharsetColorMap[0]), sleUint8); + s->saveLoadEntries(this, townsExtraEntries); + } + if (_shadowPaletteSize) { s->saveLoadArrayOf(_shadowPalette, _shadowPaletteSize, 1, sleByte); // _roomPalette didn't show up until V21 save games @@ -1459,6 +1486,17 @@ void ScummEngine_v5::saveOrLoad(Serializer *s) { // This is probably only needed for Loom. s->saveLoadEntries(this, cursorEntries); + + // Reset cursors for old FM-Towns savegames saved with 256 color setting. + // Otherwise the cursor will be messed up when displayed in the new hi color setting. + if (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2 && s->isLoading() && s->getVersion() < VER(82)) { + if (_game.id == GID_LOOM) { + redefineBuiltinCursorFromChar(1, 1); + redefineBuiltinCursorHotspot(1, 0, 0); + } else { + resetCursors(); + } + } } #ifdef ENABLE_SCUMM_7_8 -- cgit v1.2.3 From 5af782c5d279b0b3b54ee041bb50c8fec2d35fd3 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Tue, 5 Oct 2010 19:04:52 +0000 Subject: SCUMM/FM-TOWNS: disable new graphics code in DS port svn-id: r53033 --- engines/scumm/saveload.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/scumm/saveload.cpp') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index a1747db690..28ec6c182f 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1298,6 +1298,7 @@ void ScummEngine::saveOrLoad(Serializer *s) { s->saveLoadArrayOf(_16BitPalette, 512, sizeof(_16BitPalette[0]), sleUint16); } +#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE // FM-Towns specific (extra palette data, color cycle data, etc.) if (s->getVersion() >= VER(82)) { const SaveLoadEntry townsFields[] = { @@ -1323,6 +1324,7 @@ void ScummEngine::saveOrLoad(Serializer *s) { s->saveLoadArrayOf(_townsCharsetColorMap, 16, sizeof(_townsCharsetColorMap[0]), sleUint8); s->saveLoadEntries(this, townsExtraEntries); } +#endif if (_shadowPaletteSize) { s->saveLoadArrayOf(_shadowPalette, _shadowPaletteSize, 1, sleByte); -- cgit v1.2.3