[Scummvm-git-logs] scummvm master -> 1e54610169354a569ba28499936a532096da8cf3

sev- sev at scummvm.org
Sat Jun 19 12:32:13 UTC 2021


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0a9bf3708f DS: Update the MaxMod callback manually
1e54610169 BBVS: Fix hang when starting the Loogie minigame on the DS


Commit: 0a9bf3708f2852165d5f9e888f375d8fe35619e3
    https://github.com/scummvm/scummvm/commit/0a9bf3708f2852165d5f9e888f375d8fe35619e3
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2021-06-19T14:32:10+02:00

Commit Message:
DS: Update the MaxMod callback manually

Changed paths:
    backends/events/ds/ds-events.cpp
    backends/mixer/maxmod/maxmod-mixer.cpp
    backends/mixer/maxmod/maxmod-mixer.h
    backends/platform/ds/osystem_ds.cpp


diff --git a/backends/events/ds/ds-events.cpp b/backends/events/ds/ds-events.cpp
index 4f2ee92f68..95bd038a84 100644
--- a/backends/events/ds/ds-events.cpp
+++ b/backends/events/ds/ds-events.cpp
@@ -26,6 +26,9 @@
 #include "backends/platform/ds/osystem_ds.h"
 
 bool DSEventSource::pollEvent(Common::Event &event) {
+	// Ensure the mixer and timers are updated frequently
+	g_system->delayMillis(0);
+
 	if (_eventQueue.empty()) {
 		if (!_firstPoll) {
 			_firstPoll = true;
diff --git a/backends/mixer/maxmod/maxmod-mixer.cpp b/backends/mixer/maxmod/maxmod-mixer.cpp
index 161274c75a..e28d28f834 100644
--- a/backends/mixer/maxmod/maxmod-mixer.cpp
+++ b/backends/mixer/maxmod/maxmod-mixer.cpp
@@ -70,7 +70,7 @@ void MaxModMixerManager::init() {
 	_stream.callback = on_stream_request;
 	_stream.format = MM_STREAM_16BIT_STEREO;
 	_stream.timer = MM_TIMER2;
-	_stream.manual = 0;
+	_stream.manual = 1;
 
 	mmStreamOpen( &_stream );
 
@@ -91,4 +91,9 @@ int MaxModMixerManager::resumeAudio() {
 	return 0;
 }
 
+void MaxModMixerManager::updateAudio() {
+	if (!_audioSuspended)
+		mmStreamUpdate();
+}
+
 #endif
diff --git a/backends/mixer/maxmod/maxmod-mixer.h b/backends/mixer/maxmod/maxmod-mixer.h
index 774a007a01..0e6c78b208 100644
--- a/backends/mixer/maxmod/maxmod-mixer.h
+++ b/backends/mixer/maxmod/maxmod-mixer.h
@@ -52,6 +52,11 @@ public:
 	 */
 	virtual int resumeAudio();
 
+	/**
+	 * Updates the audio system
+	 */
+	void updateAudio();
+
 protected:
 	mm_stream _stream;
 	int _freq, _bufSize;
diff --git a/backends/platform/ds/osystem_ds.cpp b/backends/platform/ds/osystem_ds.cpp
index ce96045db7..81d7722a32 100644
--- a/backends/platform/ds/osystem_ds.cpp
+++ b/backends/platform/ds/osystem_ds.cpp
@@ -85,7 +85,7 @@ void OSystem_DS::initBackend() {
 	_timerManager = new DefaultTimerManager();
 	timerStart(0, ClockDivider_1, (u16)TIMER_FREQ(1000), timerTickHandler);
 
-	_mixerManager = new MaxModMixerManager(11025, 4096);
+	_mixerManager = new MaxModMixerManager(11025, 32768);
 	_mixerManager->init();
 
 	BaseBackend::initBackend();
@@ -102,9 +102,11 @@ uint32 OSystem_DS::getMillis(bool skipRecord) {
 void OSystem_DS::delayMillis(uint msecs) {
 	int st = getMillis();
 
-	while (st + msecs >= getMillis());
-
 	doTimerCallback();
+	if (_mixerManager)
+		((MaxModMixerManager *)_mixerManager)->updateAudio();
+
+	while (st + msecs >= getMillis());
 }
 
 void OSystem_DS::doTimerCallback(int interval) {


Commit: 1e54610169354a569ba28499936a532096da8cf3
    https://github.com/scummvm/scummvm/commit/1e54610169354a569ba28499936a532096da8cf3
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2021-06-19T14:32:10+02:00

Commit Message:
BBVS: Fix hang when starting the Loogie minigame on the DS

Changed paths:
    engines/bbvs/minigames/bbloogie.cpp


diff --git a/engines/bbvs/minigames/bbloogie.cpp b/engines/bbvs/minigames/bbloogie.cpp
index 6e45c16faf..e23d2b6c1c 100644
--- a/engines/bbvs/minigames/bbloogie.cpp
+++ b/engines/bbvs/minigames/bbloogie.cpp
@@ -495,7 +495,7 @@ bool MinigameBbLoogie::updateStatus0(int mouseX, int mouseY, uint mouseButtons)
 			_playerSounds2 = kBeavisSounds2;
 			_playerSounds2Count = 13;
 			playSound(15);
-			while (isSoundPlaying(15)) { }
+			while (isSoundPlaying(15)) { _vm->_system->delayMillis(10); }
 		} else {
 			// Butt-head
 			_playerKind = 1;
@@ -505,7 +505,7 @@ bool MinigameBbLoogie::updateStatus0(int mouseX, int mouseY, uint mouseButtons)
 			_playerSounds2 = kButtheadSounds2;
 			_playerSounds2Count = 10;
 			playSound(23);
-			while (isSoundPlaying(23)) { }
+			while (isSoundPlaying(23)) { _vm->_system->delayMillis(10); }
 		}
 		_gameState = _fromMainGame ? kGSMainGame : kGSStandaloneGame;
 		initObjects1();




More information about the Scummvm-git-logs mailing list