mirror of https://github.com/mgba-emu/mgba.git
PSP2: Audio fixes
This commit is contained in:
parent
ab8321ac34
commit
9f5626a748
1
CHANGES
1
CHANGES
|
@ -50,6 +50,7 @@ Bugfixes:
|
||||||
- Core: Fix ordering events when scheduling during events
|
- Core: Fix ordering events when scheduling during events
|
||||||
- GBA: Reset WAITCNT properly
|
- GBA: Reset WAITCNT properly
|
||||||
- GBA Serialize: Fix loading states in Hblank
|
- GBA Serialize: Fix loading states in Hblank
|
||||||
|
- PSP2: Fix more issues causing poor audio
|
||||||
Misc:
|
Misc:
|
||||||
- GBA Timer: Use global cycles for timers
|
- GBA Timer: Use global cycles for timers
|
||||||
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
||||||
|
|
|
@ -234,8 +234,7 @@ static void _requestImage(struct mImageSource* source, const void** buffer, size
|
||||||
static void _postAudioBuffer(struct mAVStream* stream, blip_t* left, blip_t* right) {
|
static void _postAudioBuffer(struct mAVStream* stream, blip_t* left, blip_t* right) {
|
||||||
UNUSED(stream);
|
UNUSED(stream);
|
||||||
MutexLock(&audioContext.mutex);
|
MutexLock(&audioContext.mutex);
|
||||||
struct GBAStereoSample* samples = &audioContext.buffer[audioContext.writeOffset];
|
while (audioContext.samples + PSP2_SAMPLES >= PSP2_AUDIO_BUFFER_SIZE) {
|
||||||
while (audioContext.samples == PSP2_AUDIO_BUFFER_SIZE) {
|
|
||||||
if (!frameLimiter) {
|
if (!frameLimiter) {
|
||||||
blip_clear(left);
|
blip_clear(left);
|
||||||
blip_clear(right);
|
blip_clear(right);
|
||||||
|
@ -244,6 +243,7 @@ static void _postAudioBuffer(struct mAVStream* stream, blip_t* left, blip_t* rig
|
||||||
}
|
}
|
||||||
ConditionWait(&audioContext.cond, &audioContext.mutex);
|
ConditionWait(&audioContext.cond, &audioContext.mutex);
|
||||||
}
|
}
|
||||||
|
struct GBAStereoSample* samples = &audioContext.buffer[audioContext.writeOffset];
|
||||||
blip_read_samples(left, &samples[0].left, PSP2_SAMPLES, true);
|
blip_read_samples(left, &samples[0].left, PSP2_SAMPLES, true);
|
||||||
blip_read_samples(right, &samples[0].right, PSP2_SAMPLES, true);
|
blip_read_samples(right, &samples[0].right, PSP2_SAMPLES, true);
|
||||||
audioContext.samples += PSP2_SAMPLES;
|
audioContext.samples += PSP2_SAMPLES;
|
||||||
|
@ -403,6 +403,8 @@ void mPSP2UnloadROM(struct mGUIRunner* runner) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
audioContext.running = false;
|
||||||
|
ThreadJoin(audioThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mPSP2Paused(struct mGUIRunner* runner) {
|
void mPSP2Paused(struct mGUIRunner* runner) {
|
||||||
|
|
Loading…
Reference in New Issue