From 5d6a64797f9779e11f775ec383c3190740da0528 Mon Sep 17 00:00:00 2001 From: riccardom Date: Tue, 26 Jan 2010 15:33:45 +0000 Subject: [PATCH] Read configuration from ini file Use gtk frontend desmume_config.* machinery to read the ini file. This should fixup joystick not working correctly as reported in #2897620. --- desmume/src/cli/Makefile.am | 2 +- desmume/src/cli/main.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/desmume/src/cli/Makefile.am b/desmume/src/cli/Makefile.am index 143783535..5d977af2e 100644 --- a/desmume/src/cli/Makefile.am +++ b/desmume/src/cli/Makefile.am @@ -4,7 +4,7 @@ include $(top_srcdir)/src/desmume.mk AM_CPPFLAGS += $(SDL_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(GLIB_CFLAGS) $(GTHREAD_CFLAGS) bin_PROGRAMS = desmume-cli -desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp +desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp ../gtk/desmume_config.h ../gtk/desmume_config.cpp desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS) if HAVE_GDB_STUB desmume_cli_LDADD += ../gdbstub/libgdbstub.a diff --git a/desmume/src/cli/main.cpp b/desmume/src/cli/main.cpp index cc52c8f09..61126d59c 100644 --- a/desmume/src/cli/main.cpp +++ b/desmume/src/cli/main.cpp @@ -55,6 +55,7 @@ #include "../mic.h" #include "../firmware.h" #include "../GPU_osd.h" +#include "gtk/desmume_config.h" #ifdef GDB_STUB #include "../gdbstub.h" #endif @@ -748,6 +749,8 @@ int main(int argc, char ** argv) { int boost = 0; int error; + GKeyFile *keyfile; + #ifdef DISPLAY_FPS u32 fps_timing = 0; u32 fps_frame_counter = 0; @@ -922,8 +925,9 @@ int main(int argc, char ** argv) { /* Initialize joysticks */ if(!init_joy()) return 1; - /* Load our own keyboard configuration */ - set_kb_keys(cli_kb_cfg); + /* Load keyboard and joystick configuration */ + keyfile = desmume_config_read_file(cli_kb_cfg); + desmume_config_dispose(keyfile); if ( !my_config.disable_limiter) { /* create the semaphore used for fps limiting */ @@ -1005,8 +1009,6 @@ int main(int argc, char ** argv) { #endif } - - /* Unload joystick */ uninit_joy();