mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 12:44:02 +00:00
DS: Update the MaxMod callback manually
This commit is contained in:
parent
ac596de969
commit
0a9bf3708f
@ -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;
|
||||
|
@ -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
|
||||
|
@ -52,6 +52,11 @@ public:
|
||||
*/
|
||||
virtual int resumeAudio();
|
||||
|
||||
/**
|
||||
* Updates the audio system
|
||||
*/
|
||||
void updateAudio();
|
||||
|
||||
protected:
|
||||
mm_stream _stream;
|
||||
int _freq, _bufSize;
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user