From d267d83cecd440d69300333e8616da8975a334dc Mon Sep 17 00:00:00 2001 From: Hitomi Nakayama Date: Thu, 12 Oct 2023 17:57:33 -0700 Subject: [PATCH] Added warning for SDL init failure --- SDL/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SDL/main.c b/SDL/main.c index 5b2164d..6286b8f 100644 --- a/SDL/main.c +++ b/SDL/main.c @@ -1026,7 +1026,10 @@ int main(int argc, char **argv) signal(SIGINT, debugger_interrupt); signal(SIGUSR1, debugger_reset); - SDL_Init(SDL_INIT_EVERYTHING & ~SDL_INIT_AUDIO); + if (SDL_Init(SDL_INIT_EVERYTHING & ~SDL_INIT_AUDIO) < 0) { + fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); + } + if ((console_supported = CON_start(completer))) { CON_set_repeat_empty(true); CON_printf("SameBoy v" GB_VERSION "\n");