mirror of https://github.com/mgba-emu/mgba.git
GBA Audio: Fix crash in audio subsampling if timing lockstep breaks
This commit is contained in:
parent
e0b0e45821
commit
b205537558
1
CHANGES
1
CHANGES
|
@ -5,6 +5,7 @@ Emulation fixes:
|
|||
- GBA SIO: Fix MULTI mode SIOCNT bit 7 writes on secondary GBAs (fixes mgba.io/i/3110)
|
||||
Other fixes:
|
||||
- GBA Audio: Fix crash if audio FIFOs and timers get out of sync
|
||||
- GBA Audio: Fix crash in audio subsampling if timing lockstep breaks
|
||||
- GBA Memory: Let raw access read high MMIO addresses
|
||||
- Qt: Fix crash when applying changes to GB I/O registers in I/O view
|
||||
- Qt: Fix LCDC background priority/enable bit being mis-mapped in I/O view
|
||||
|
|
|
@ -268,6 +268,9 @@ void GBAAudioWriteSOUNDBIAS(struct GBAAudio* audio, uint16_t value) {
|
|||
if (oldSampleInterval != audio->sampleInterval) {
|
||||
timestamp -= audio->lastSample;
|
||||
audio->sampleIndex = timestamp >> (9 - GBARegisterSOUNDBIASGetResolution(value));
|
||||
if (audio->sampleIndex < 0 || audio->sampleIndex >= GBA_MAX_SAMPLES) {
|
||||
audio->sampleIndex = 0;
|
||||
}
|
||||
if (audio->p->stream && audio->p->stream->audioRateChanged) {
|
||||
audio->p->stream->audioRateChanged(audio->p->stream, GBA_ARM7TDMI_FREQUENCY / audio->sampleInterval);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue