git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 91a2b459f9c4c983094f5d1742bc0abcd13be6fd
parent d48037beec0bd0b39e6fc378f4e394f073ec5392
Author: Maximilian Mader <max@bastelstu.be>
Date:   Wed, 13 Jul 2022 15:47:53 +0200

Initialize the SDL audio system in the driver

Diffstat:
MSDL/audio/sdl.c5+++++
MSDL/main.c2+-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/SDL/audio/sdl.c b/SDL/audio/sdl.c @@ -67,6 +67,11 @@ static void _audio_queue_sample(GB_sample_t *sample) static bool _audio_init(void) { + if (SDL_Init(SDL_INIT_AUDIO) != 0) { + printf("Failed to initialize SDL audio: %s", SDL_GetError()); + return false; + } + /* Configure Audio */ memset(&want_aspec, 0, sizeof(want_aspec)); want_aspec.freq = AUDIO_FREQUENCY; diff --git a/SDL/main.c b/SDL/main.c @@ -820,7 +820,7 @@ int main(int argc, char **argv) signal(SIGINT, debugger_interrupt); - SDL_Init(SDL_INIT_EVERYTHING); + SDL_Init(SDL_INIT_EVERYTHING & ~SDL_INIT_AUDIO); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, configuration.allow_background_controllers? "1" : "0"); if ((console_supported = CON_start(completer))) {

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.