make PCNT stuff optional
authornotaz <notasas@gmail.com>
Tue, 7 Dec 2010 10:45:07 +0000 (12:45 +0200)
committernotaz <notasas@gmail.com>
Tue, 14 Dec 2010 13:25:04 +0000 (15:25 +0200)
Makefile
frontend/main.c
frontend/pcnt.h
frontend/plugin.c

index 2716f8d..bf3eee2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,7 @@ ifndef DEBUG
 CFLAGS += -O2
 endif
 #DRC_DBG = 1
+#PCNT = 1
 TARGET = pcsx
 
 all: $(TARGET)
index fd1c119..86aff34 100644 (file)
@@ -73,6 +73,8 @@ int main(int argc, char *argv[])
        int i;
 
        tmp = dlopen("/lib/libdl.so.2", RTLD_LAZY);
+       if (tmp == NULL)
+               tmp = dlopen("/lib32/libdl.so.2", RTLD_LAZY);
        if (tmp != NULL)
                real_getenv = dlsym(tmp, "getenv");
        if (real_getenv == NULL) {
@@ -217,7 +219,8 @@ int main(int argc, char *argv[])
                if (loadst) {
                        StatesC = loadst - 1;
                        char *state_filename = get_state_filename(StatesC);
-                       LoadState(state_filename);
+                       int ret = LoadState(state_filename);
+                       printf("%s state %s\n", ret ? "failed to load" : "loaded", state_filename);
                        free(state_filename);
                }
 
index 57bc88a..d3eedfa 100644 (file)
@@ -6,6 +6,8 @@ enum pcounters {
        PCNT_CNT
 };
 
+#ifdef PCNT
+
 extern unsigned int pcounters[PCNT_CNT];
 extern unsigned int pcounter_starts[PCNT_CNT];
 
@@ -50,3 +52,15 @@ static inline unsigned int pcnt_get(void)
        return val;
 }
 
+#else
+
+#define pcnt_start(id)
+#define pcnt_end(id)
+#define pcnt_hook_plugins()
+
+static inline void pcnt_print(float fps)
+{
+       printf("%2.1f\n", fps);
+}
+
+#endif
index 6cde989..bcf3885 100644 (file)
@@ -199,6 +199,8 @@ void *plugin_link(enum builtint_plugins_e id, const char *sym)
        return NULL;
 }
 
+#ifdef PCNT
+
 /* basic profile stuff */
 #include "pcnt.h"
 
@@ -275,3 +277,4 @@ void pcnt_hook_plugins(void)
        hook_it(SPU_playCDDAchannel);
 }
 
+#endif