[Scummvm-git-logs] scummvm master -> aedb74be6e6785f94c0e98bea37ab5eb225e8e6b
athrxx
noreply at scummvm.org
Sun Apr 14 21:25:47 UTC 2024
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0d2aa5501f SCUMM: (MI1/Mac) - minor sound code cleanup
ac23a92e30 SCUMM: (MI1/Amiga/Hercules/CGA) - fix bug 4535 (Voodoo lady palette glitches)
aedb74be6e SCUMM: (MI1/Amiga) - implement music restart after load
Commit: 0d2aa5501fc925a8c07225ce430339bd9abeafc2
https://github.com/scummvm/scummvm/commit/0d2aa5501fc925a8c07225ce430339bd9abeafc2
Author: athrxx (athrxx at scummvm.org)
Date: 2024-04-14T23:21:36+02:00
Commit Message:
SCUMM: (MI1/Mac) - minor sound code cleanup
Changed paths:
engines/scumm/players/player_mac_loom_monkey.cpp
diff --git a/engines/scumm/players/player_mac_loom_monkey.cpp b/engines/scumm/players/player_mac_loom_monkey.cpp
index 652ee78bbcc..783214ef864 100644
--- a/engines/scumm/players/player_mac_loom_monkey.cpp
+++ b/engines/scumm/players/player_mac_loom_monkey.cpp
@@ -298,7 +298,7 @@ bool MonkeyMacSndLoader::init() {
}
bool MonkeyMacSndLoader::checkResource(const byte *data, uint32 dataSize) const {
- return (dataSize >= 14 && (READ_BE_UINT32(data) == 'Mac0' || READ_BE_UINT32(data) == 'Mac1'));
+ return (dataSize >= 14 && (READ_BE_UINT32(data) == MKTAG('M', 'a', 'c', '0') || READ_BE_UINT32(data) == MKTAG('M', 'a', 'c', '1')));
}
bool MonkeyMacSndLoader::blocked(const byte *data, uint32 dataSize) const {
Commit: ac23a92e306dc892e062006f604a816dff0d940c
https://github.com/scummvm/scummvm/commit/ac23a92e306dc892e062006f604a816dff0d940c
Author: athrxx (athrxx at scummvm.org)
Date: 2024-04-14T23:21:42+02:00
Commit Message:
SCUMM: (MI1/Amiga/Hercules/CGA) - fix bug 4535 (Voodoo lady palette glitches)
MI1 Amiga does set up the shadow palette at the beginning
and also updates it from o5_roomOps()[SO_ROOM_PALETTE].
But it never actually applies any use of the shadow palette when
doing screen palette adjustments. I've also confirmed that the
shadow is ignored in DOS CGA and Hercules mode.
Changed paths:
engines/scumm/palette.cpp
engines/scumm/scumm.cpp
engines/scumm/scumm.h
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 5ea8bd00812..0f7e1bd028c 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -1630,11 +1630,7 @@ void ScummEngine::updatePalette() {
for (i = _palDirtyMin; i <= _palDirtyMax; i++) {
byte *data;
- // In b/w Mac rendering mode, the shadow palette is
- // handled by the renderer itself. See comment in
- // mac_drawStripToScreen().
-
- if (_game.features & GF_SMALL_HEADER && _game.version > 2 && _renderMode != Common::kRenderMacintoshBW)
+ if (_shadowPalRemap)
data = _currentPalette + _shadowPalette[i] * 3;
else
data = _currentPalette + i * 3;
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 5d2ce11b487..5cfb5b72310 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -520,6 +520,10 @@ ScummEngine_v4::ScummEngine_v4(OSystem *syst, const DetectorResult &dr)
: ScummEngine_v5(syst, dr) {
_resourceHeaderSize = 6;
_game.features |= GF_SMALL_HEADER;
+ // MI1 Amiga ignores the shadow palette (bug #4535 - Voodoo lady palette glitches).
+ // I haven't checked other Amiga targets, so I'm limiting it to MI1.
+ _shadowPalRemap = (!(_game.platform == Common::kPlatformAmiga && _game.id == GID_MONKEY_VGA) &&
+ _renderMode != Common::kRenderCGA && _renderMode != Common::kRenderHercA && _renderMode != Common::kRenderHercG);
}
ScummEngine_v3::ScummEngine_v3(OSystem *syst, const DetectorResult &dr)
@@ -527,6 +531,10 @@ ScummEngine_v3::ScummEngine_v3(OSystem *syst, const DetectorResult &dr)
// All v3 and older games only used 16 colors with exception of the GF_OLD256 games.
if (!(_game.features & GF_OLD256))
_game.features |= GF_16COLOR;
+ // In b/w Mac rendering mode, the shadow palette is handled by the renderer itself.
+ // See comment in mac_drawStripToScreen().
+ _shadowPalRemap = (_renderMode != Common::kRenderMacintoshBW &&
+ _renderMode != Common::kRenderCGA && _renderMode != Common::kRenderHercA && _renderMode != Common::kRenderHercG);
}
ScummEngine_v3old::ScummEngine_v3old(OSystem *syst, const DetectorResult &dr)
@@ -538,6 +546,7 @@ ScummEngine_v3old::ScummEngine_v3old(OSystem *syst, const DetectorResult &dr)
ScummEngine_v2::ScummEngine_v2(OSystem *syst, const DetectorResult &dr)
: ScummEngine_v3old(syst, dr) {
+ _shadowPalRemap = false;
_inventoryOffset = 0;
_flashlight.xStrips = 6;
_flashlight.yStrips = 4;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 91e02d699bf..10ad5fdbc52 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1521,6 +1521,7 @@ protected:
int _saveSound = 0;
bool _native_mt32 = false;
bool _copyProtection = false;
+ bool _shadowPalRemap = false;
// Indy4 Amiga specific
uint16 _amigaFirstUsedColor = 0;
Commit: aedb74be6e6785f94c0e98bea37ab5eb225e8e6b
https://github.com/scummvm/scummvm/commit/aedb74be6e6785f94c0e98bea37ab5eb225e8e6b
Author: athrxx (athrxx at scummvm.org)
Date: 2024-04-14T23:21:47+02:00
Commit Message:
SCUMM: (MI1/Amiga) - implement music restart after load
Changed paths:
engines/scumm/players/player_v4a.cpp
engines/scumm/players/player_v4a.h
engines/scumm/saveload.cpp
diff --git a/engines/scumm/players/player_v4a.cpp b/engines/scumm/players/player_v4a.cpp
index d7293d33895..8ddcd5216ae 100644
--- a/engines/scumm/players/player_v4a.cpp
+++ b/engines/scumm/players/player_v4a.cpp
@@ -37,7 +37,8 @@ Player_V4A::Player_V4A(ScummEngine *scumm, Audio::Mixer *mixer)
_musicId(),
_sfxSlots(),
_initState(0),
- _signal(0) {
+ _signal(0),
+ _lastSong(-1) {
assert(scumm);
assert(mixer);
@@ -84,6 +85,7 @@ void Player_V4A::stopAllSounds() {
clearSfxSlots();
} else
_mixer->stopHandle(_musicHandle);
+ _lastSong = -1;
}
void Player_V4A::stopSound(int nr) {
@@ -97,11 +99,13 @@ void Player_V4A::stopSound(int nr) {
else
_mixer->stopHandle(_musicHandle);
_signal = 0;
+ _lastSong = -1;
} else {
const int chan = getSfxChan(nr);
if (chan != -1) {
setSfxSlot(chan, 0);
_tfmxSfx.stopMacroEffect(chan);
+ _lastSong = -1;
}
}
}
@@ -152,6 +156,7 @@ void Player_V4A::startSound(int nr) {
if (!_mixer->isSoundHandleActive(_sfxHandle))
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, &_tfmxSfx, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO);
+ _lastSong = -1;
} else { // Song
debug(3, "player_v4a: play %d: song %i - %02X", nr, index, type);
if (ptr[6] != 0x7F)
@@ -163,7 +168,7 @@ void Player_V4A::startSound(int nr) {
// the Tfmx-player never "ends" the output by itself, so this should be threadsafe
if (!_mixer->isSoundHandleActive(_musicHandle))
_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, &_tfmxMusic, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO);
- _musicId = nr;
+ _musicId = _lastSong = nr;
}
}
@@ -186,4 +191,18 @@ int Player_V4A::getSoundStatus(int nr) const {
return (nr == _musicId) ? _signal : 0;
}
+void Player_V4A::saveLoadWithSerializer(Common::Serializer &ser) {
+ if (ser.isLoading() && ser.getVersion() < VER(118))
+ _lastSong = -1;
+ else
+ ser.syncAsSint16BE(_lastSong, VER(118));
+}
+
+void Player_V4A::restoreAfterLoad() {
+ int snd = _lastSong;
+ stopAllSounds();
+ if (snd != -1)
+ startSound(snd);
+}
+
} // End of namespace Scumm
diff --git a/engines/scumm/players/player_v4a.h b/engines/scumm/players/player_v4a.h
index 0f2e2f2dbb3..e1f3107ddc1 100644
--- a/engines/scumm/players/player_v4a.h
+++ b/engines/scumm/players/player_v4a.h
@@ -48,6 +48,8 @@ public:
void stopAllSounds() override;
int getMusicTimer() override;
int getSoundStatus(int sound) const override;
+ void saveLoadWithSerializer(Common::Serializer &ser) override;
+ void restoreAfterLoad() override;
private:
ScummEngine *const _vm;
@@ -59,6 +61,7 @@ private:
Audio::SoundHandle _sfxHandle;
int _musicId;
+ int16 _lastSong;
uint16 _signal;
struct SfxChan {
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 96dde09f06e..ed12c89f5b3 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -69,7 +69,7 @@ struct SaveInfoSection {
#define SaveInfoSectionSize (4+4+4 + 4+4 + 4+2)
-#define CURRENT_VER 117
+#define CURRENT_VER 118
#define INFOSECTION_VERSION 2
#pragma mark -
More information about the Scummvm-git-logs
mailing list