[Scummvm-git-logs] scummvm master -> f4526cf007688d02b8c558f048f0889088545fd5
dreammaster
noreply at scummvm.org
Wed May 20 02:29:01 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
e4bbe04dbd MADS: PHANTOM: Remove redundant caching of values to write to the OPL
f4526cf007 MADS: PHANTOM: Break out of intro animview on keypress
Commit: e4bbe04dbd51287776a7831d38befd1855144f9b
https://github.com/scummvm/scummvm/commit/e4bbe04dbd51287776a7831d38befd1855144f9b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-20T12:28:50+10:00
Commit Message:
MADS: PHANTOM: Remove redundant caching of values to write to the OPL
Changed paths:
engines/mads/madsv2/core/asound.cpp
engines/mads/madsv2/core/asound.h
diff --git a/engines/mads/madsv2/core/asound.cpp b/engines/mads/madsv2/core/asound.cpp
index 188974a0089..bfe5908ff5e 100644
--- a/engines/mads/madsv2/core/asound.cpp
+++ b/engines/mads/madsv2/core/asound.cpp
@@ -232,6 +232,8 @@ int ASound::poll() {
}
void ASound::noise() {
+ Common::StackLock slock(_driverMutex);
+
for (int i = 0; i < ADLIB_CHANNEL_COUNT; i++)
noise_inner(i);
}
@@ -427,21 +429,12 @@ void ASound::callFunction(uint16 offset) {
void ASound::write(uint8 reg, uint8 value) {
_adlibPorts[reg] = value;
- _queue.push(Common::Pair<byte, byte>(reg, value));
+ _opl->writeReg(reg, value);
}
void ASound::onTimer() {
Common::StackLock slock(_driverMutex);
-
poll();
- flush();
-}
-
-void ASound::flush() {
- while (!_queue.empty()) {
- auto v = _queue.pop();
- _opl->writeReg(v.first, v.second);
- }
}
uint16 ASound::getRandomNumber() {
diff --git a/engines/mads/madsv2/core/asound.h b/engines/mads/madsv2/core/asound.h
index 3686c1f11f1..8b4e5e31161 100644
--- a/engines/mads/madsv2/core/asound.h
+++ b/engines/mads/madsv2/core/asound.h
@@ -128,7 +128,6 @@ struct AdlibSample {
class ASound : public SoundDriver {
private:
- Common::Queue< Common::Pair<byte, byte> > _queue;
uint16 _callbackCounter = 0; // Period counter
uint16 _callbackPeriod = 0; // Period reload
AdlibChannel *_activeChannelPtr = NULL;
@@ -281,11 +280,6 @@ protected:
*/
void write(uint8 reg, uint8 value);
- /**
- * Flush any pending Adlib register values to the OPL driver
- */
- void flush();
-
/**
* Updates and returns _asound_randomSeed.
*/
@@ -350,6 +344,11 @@ protected:
}
protected:
+ /**
+ * Plays the sound data at a given offset
+ */
+ void playSound(int offset);
+
/**
* Silences every voice and mutes the hardware:
* 1. Reset all 9 channels.
@@ -466,11 +465,6 @@ public:
void setVolume(int volume) override {
// TODO: Does this need implementation?
}
-
- /**
- * Plays a sound
- */
- void playSound(int offset);
};
} // namespace MADSV2
Commit: f4526cf007688d02b8c558f048f0889088545fd5
https://github.com/scummvm/scummvm/commit/f4526cf007688d02b8c558f048f0889088545fd5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-20T12:28:50+10:00
Commit Message:
MADS: PHANTOM: Break out of intro animview on keypress
Changed paths:
engines/mads/madsv2/animview/animview.cpp
diff --git a/engines/mads/madsv2/animview/animview.cpp b/engines/mads/madsv2/animview/animview.cpp
index 582e977a7a5..9a3f365cc2a 100644
--- a/engines/mads/madsv2/animview/animview.cpp
+++ b/engines/mads/madsv2/animview/animview.cpp
@@ -297,7 +297,7 @@ static void run_animation(int animIndex) {
current_error_code = 1;
if (g_engine->hasPendingKey()) {
g_engine->flushKeys();
- error_code = 0;
+ error_code = 1;
current_error_code = 1;
}
if (mouse_get_status(&mouse_x, &mouse_y)) {
@@ -325,11 +325,12 @@ static void run_animation(int animIndex) {
// Check for any keypress
if (g_engine->hasPendingKey()) {
g_engine->flushKeys();
- current_error_code = true;
+ error_code = 1;
+ current_error_code = 1;
}
if (g_engine->shouldQuit())
- current_error_code = true;
+ current_error_code = 1;
} while (timer_read() < timer2);
if (peelFlag) {
@@ -349,21 +350,22 @@ static void run_animation(int animIndex) {
// Check for any keypress or mouse clicks
if (g_engine->hasPendingKey()) {
g_engine->flushKeys();
- current_error_code = true;
+ error_code = 1;
+ current_error_code = 1;
}
int mouseX = 0, mouseY = 0;
if (mouse_get_status(&mouseX, &mouseY))
- current_error_code = true;
+ current_error_code = 1;
if (g_engine->shouldQuit())
- current_error_code = true;
+ current_error_code = 1;
if (!exit_immediately_at_end)
continue;
if (g_engine->_soundManager->command(8))
continue;
- current_error_code = true;
+ current_error_code = 1;
}
}
More information about the Scummvm-git-logs
mailing list