From b4080b2cae2f8e2700e318b97e369915e8995796 Mon Sep 17 00:00:00 2001 From: Ingo Saitz Date: Fri, 19 Nov 2021 15:09:56 +0100 Subject: [PATCH] Linux: Call NDS_Init() early Since NDS_Init takes no arguments, it should not hurt to call it early in the gtk frontend, too. This fixes the segfault in issue #415, although I could not get it to run a r4 kernel in a quick test. --- desmume/src/frontend/posix/gtk/desmume.cpp | 2 -- desmume/src/frontend/posix/gtk/main.cpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/desmume/src/frontend/posix/gtk/desmume.cpp b/desmume/src/frontend/posix/gtk/desmume.cpp index b11d029a0..5b2c3d939 100644 --- a/desmume/src/frontend/posix/gtk/desmume.cpp +++ b/desmume/src/frontend/posix/gtk/desmume.cpp @@ -32,8 +32,6 @@ BOOL click = FALSE; void desmume_init( int disable_sound) { - NDS_Init(); - if ( !disable_sound) { SPU_ChangeSoundCore(SNDCORE_SDL, 735 * 4); } diff --git a/desmume/src/frontend/posix/gtk/main.cpp b/desmume/src/frontend/posix/gtk/main.cpp index ac5f5a368..f74f5add6 100644 --- a/desmume/src/frontend/posix/gtk/main.cpp +++ b/desmume/src/frontend/posix/gtk/main.cpp @@ -3599,6 +3599,8 @@ int main (int argc, char *argv[]) // The global menu screws up the window size... unsetenv("UBUNTU_MENUPROXY"); + // this must be called as early as possible + NDS_Init(); my_config.parse(argc, argv); init_configured_features( &my_config);