From 4d6ac95a44454fe385342ec748d73baa9a58a29f Mon Sep 17 00:00:00 2001 From: Luigi__ Date: Thu, 2 Apr 2009 20:25:45 +0000 Subject: [PATCH] Inlined desmume_cycle() and desmume_running() for speed. --- desmume/src/gtk-glade/desmume.cpp | 10 +++++----- desmume/src/gtk-glade/desmume.h | 8 ++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/desmume/src/gtk-glade/desmume.cpp b/desmume/src/gtk-glade/desmume.cpp index 7055a9025..8647356f0 100755 --- a/desmume/src/gtk-glade/desmume.cpp +++ b/desmume/src/gtk-glade/desmume.cpp @@ -100,12 +100,12 @@ void desmume_toggle() { execute = (execute) ? FALSE : TRUE; } -BOOL desmume_running() +/*INLINE BOOL desmume_running() { return execute; -} +}*/ -void desmume_cycle() +INLINE void desmume_cycle() { u16 keypad; /* Joystick events */ @@ -141,8 +141,6 @@ gboolean EmuLoop(gpointer data) { static int limiter_frame_counter = 0; - ticksCurFrame = SDL_GetTicks(); - fps_FrameCount += Frameskip + 1; if(!fps_SecStart) fps_SecStart = SDL_GetTicks(); if(SDL_GetTicks() - fps_SecStart >= 1000) @@ -165,6 +163,8 @@ gboolean EmuLoop(gpointer data) gtk_widget_queue_draw(pDrawingArea); gtk_widget_queue_draw(pDrawingArea2); + ticksCurFrame = SDL_GetTicks(); + if(!glade_fps_limiter_disabled) { while((ticksCurFrame - ticksPrevFrame) < TICKS_PER_FRAME) diff --git a/desmume/src/gtk-glade/desmume.h b/desmume/src/gtk-glade/desmume.h index df5f3381a..4a6dcc292 100755 --- a/desmume/src/gtk-glade/desmume.h +++ b/desmume/src/gtk-glade/desmume.h @@ -38,8 +38,12 @@ extern void desmume_pause( void); extern void desmume_resume( void); extern void desmume_reset( void); extern void desmume_toggle( void); -extern BOOL desmume_running( void); +//extern BOOL desmume_running( void); +INLINE BOOL desmume_running(void) +{ + return execute; +} -extern void desmume_cycle( void); +extern INLINE void desmume_cycle( void); #endif /*__DESMUME_H__*/