mirror of https://github.com/mgba-emu/mgba.git
Ability to disable sound
This commit is contained in:
parent
ca80e5f32b
commit
76f02be757
|
@ -42,6 +42,7 @@ void GBAAudioInit(struct GBAAudio* audio) {
|
|||
audio->sampleRate = 0x8000;
|
||||
audio->soundcntLo = 0;
|
||||
audio->soundcntHi = 0;
|
||||
audio->soundcntX = 0;
|
||||
audio->sampleInterval = GBA_ARM7TDMI_FREQUENCY / audio->sampleRate;
|
||||
|
||||
CircleBufferInit(&audio->left, GBA_AUDIO_SAMPLES * sizeof(int32_t));
|
||||
|
@ -67,7 +68,7 @@ int32_t GBAAudioProcessEvents(struct GBAAudio* audio, int32_t cycles) {
|
|||
audio->eventDiff += cycles;
|
||||
while (audio->nextEvent <= 0) {
|
||||
audio->nextEvent = INT_MAX;
|
||||
|
||||
if (audio->enable) {
|
||||
audio->nextCh1 -= audio->eventDiff;
|
||||
audio->nextCh2 -= audio->eventDiff;
|
||||
audio->nextCh3 -= audio->eventDiff;
|
||||
|
@ -140,6 +141,7 @@ int32_t GBAAudioProcessEvents(struct GBAAudio* audio, int32_t cycles) {
|
|||
audio->nextEvent = audio->nextCh4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
audio->nextSample -= audio->eventDiff;
|
||||
if (audio->nextSample <= 0) {
|
||||
|
|
Loading…
Reference in New Issue