From fc2b5ee106b8a595cb63ae7edd9140b3988684d3 Mon Sep 17 00:00:00 2001 From: yabause Date: Sun, 23 Nov 2008 14:52:43 +0000 Subject: [PATCH] Some changes to the "memory profiling" feature: - gtk frontend and core now use the same preprocessor definition to protect their code. - removed the #define from the code and added a configure switch. --- desmume/configure.ac | 5 +++++ desmume/src/MMU.cpp | 1 - desmume/src/gtk/main.cpp | 6 ++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/desmume/configure.ac b/desmume/configure.ac index 0d3fbb776..7bebc01a3 100644 --- a/desmume/configure.ac +++ b/desmume/configure.ac @@ -202,6 +202,11 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING(--enable-debug, enable debug information), AC_DEFINE(DEBUG)) +dnl - Enable memory profiling +AC_ARG_ENABLE(memory-profiling, + AC_HELP_STRING(--enable-memory-profiling, enable memory profiling information), + AC_DEFINE(PROFILE_MEMORY_ACCESS)) + dnl -- set maintainer mode AM_MAINTAINER_MODE AC_SUBST(USE_MAINTAINER_MODE) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index 11978236e..92fac77be 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -100,7 +100,6 @@ void mmu_log_debug(u32 adr, u8 proc, const char *fmt, ...) /* * */ -//#define PROFILE_MEMORY_ACCESS 1 #define EARLY_MEMORY_ACCESS 1 #define INTERNAL_DTCM_READ 1 diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index 0ade333ec..5d4c2b354 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -43,9 +43,7 @@ #define EMULOOP_PRIO (G_PRIORITY_HIGH_IDLE + 20) -#define ENABLE_MEMORY_PROFILING 1 - -#ifdef ENABLE_MEMORY_PROFILING +#ifdef PROFILE_MEMORY_ACCESS #include #endif @@ -915,7 +913,7 @@ static gint Key_Press(GtkWidget *w, GdkEventKey *e) ADD_KEY( Cur_Keypad, Key ); if(desmume_running()) update_keypad(Cur_Keypad); -#ifdef ENABLE_MEMORY_PROFILING +#ifdef PROFILE_MEMORY_ACCESS if ( e->keyval == GDK_Tab) { print_memory_profiling(); }