mirror of https://github.com/mgba-emu/mgba.git
GBA Audio: Fix crash if audio FIFOs and timers get out of sync
This commit is contained in:
parent
1a3873da67
commit
a4c2571d98
1
CHANGES
1
CHANGES
|
@ -23,6 +23,7 @@ Other fixes:
|
|||
- Core: Fix inconsistencies with setting game-specific overrides (fixes mgba.io/i/2963)
|
||||
- Debugger: Fix writing to specific segment in command-line debugger
|
||||
- GB: Fix uninitialized save data when loading undersized temporary saves
|
||||
- GBA Audio: Fix crash if audio FIFOs and timers get out of sync
|
||||
- GBA Memory: Let raw access read high MMIO addresses
|
||||
- Qt: Fix savestate preview sizes with different scales (fixes mgba.io/i/2560)
|
||||
- Qt: Fix potential crash when configuring shortcuts
|
||||
|
|
|
@ -321,6 +321,9 @@ void GBAAudioSampleFIFO(struct GBAAudio* audio, int fifoId, int32_t cycles) {
|
|||
int bits = 2 << GBARegisterSOUNDBIASGetResolution(audio->soundbias);
|
||||
until += 1 << (9 - GBARegisterSOUNDBIASGetResolution(audio->soundbias));
|
||||
until >>= 9 - GBARegisterSOUNDBIASGetResolution(audio->soundbias);
|
||||
if (UNLIKELY(bits < until)) {
|
||||
until = bits;
|
||||
}
|
||||
int i;
|
||||
for (i = bits - until; i < bits; ++i) {
|
||||
channel->samples[i] = channel->internalSample;
|
||||
|
|
Loading…
Reference in New Issue