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.
This commit is contained in:
riccardom 2010-01-26 15:33:45 +00:00
parent 3b9af24780
commit 5d6a64797f
2 changed files with 7 additions and 5 deletions

View File

@ -4,7 +4,7 @@ include $(top_srcdir)/src/desmume.mk
AM_CPPFLAGS += $(SDL_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(GLIB_CFLAGS) $(GTHREAD_CFLAGS) AM_CPPFLAGS += $(SDL_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(GLIB_CFLAGS) $(GTHREAD_CFLAGS)
bin_PROGRAMS = desmume-cli 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) desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS)
if HAVE_GDB_STUB if HAVE_GDB_STUB
desmume_cli_LDADD += ../gdbstub/libgdbstub.a desmume_cli_LDADD += ../gdbstub/libgdbstub.a

View File

@ -55,6 +55,7 @@
#include "../mic.h" #include "../mic.h"
#include "../firmware.h" #include "../firmware.h"
#include "../GPU_osd.h" #include "../GPU_osd.h"
#include "gtk/desmume_config.h"
#ifdef GDB_STUB #ifdef GDB_STUB
#include "../gdbstub.h" #include "../gdbstub.h"
#endif #endif
@ -748,6 +749,8 @@ int main(int argc, char ** argv) {
int boost = 0; int boost = 0;
int error; int error;
GKeyFile *keyfile;
#ifdef DISPLAY_FPS #ifdef DISPLAY_FPS
u32 fps_timing = 0; u32 fps_timing = 0;
u32 fps_frame_counter = 0; u32 fps_frame_counter = 0;
@ -922,8 +925,9 @@ int main(int argc, char ** argv) {
/* Initialize joysticks */ /* Initialize joysticks */
if(!init_joy()) return 1; if(!init_joy()) return 1;
/* Load our own keyboard configuration */ /* Load keyboard and joystick configuration */
set_kb_keys(cli_kb_cfg); keyfile = desmume_config_read_file(cli_kb_cfg);
desmume_config_dispose(keyfile);
if ( !my_config.disable_limiter) { if ( !my_config.disable_limiter) {
/* create the semaphore used for fps limiting */ /* create the semaphore used for fps limiting */
@ -1005,8 +1009,6 @@ int main(int argc, char ** argv) {
#endif #endif
} }
/* Unload joystick */ /* Unload joystick */
uninit_joy(); uninit_joy();