all repos — mgba @ e6429cc8a255fc9ee63cb0463b6fae8015b8038f

mGBA Game Boy Advance Emulator

3DS: Fix crash if CSND is not available
Jeffrey Pfau jeffrey@endrift.com
Sun, 30 Aug 2015 22:10:12 -0700
commit

e6429cc8a255fc9ee63cb0463b6fae8015b8038f

parent

ef9bb6ac5c0014b30f32a654e41955c1c74ea545

1 files changed, 4 insertions(+), 2 deletions(-)

jump to
M src/platform/3ds/main.csrc/platform/3ds/main.c

@@ -77,8 +77,10 @@ #if RESAMPLE_LIBRARY == RESAMPLE_BLIP_BUF

blip_set_rates(runner->context.gba->audio.left, GBA_ARM7TDMI_FREQUENCY, 0x8000); blip_set_rates(runner->context.gba->audio.right, GBA_ARM7TDMI_FREQUENCY, 0x8000); #endif - memset(audioLeft, 0, AUDIO_SAMPLES * 2 * sizeof(int16_t)); - memset(audioRight, 0, AUDIO_SAMPLES * 2 * sizeof(int16_t)); + if (hasSound) { + memset(audioLeft, 0, AUDIO_SAMPLES * 2 * sizeof(int16_t)); + memset(audioRight, 0, AUDIO_SAMPLES * 2 * sizeof(int16_t)); + } } static void _gameUnloaded(struct GBAGUIRunner* runner) {