X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fpcnt.h;h=545f0c43ae79c36d2bf9078df18ac88780bea88a;hp=3969aa4ec7688d17e3a6ab8db30c3d8aafea3da5;hb=a2d91a5d28651b7cfa6d411208da5f86bc168dfe;hpb=19e57cbf170d1ce49f00097f3cc3a4ed96d77374 diff --git a/frontend/pcnt.h b/frontend/pcnt.h index 3969aa4e..545f0c43 100644 --- a/frontend/pcnt.h +++ b/frontend/pcnt.h @@ -4,13 +4,21 @@ enum pcounters { PCNT_GPU, PCNT_SPU, PCNT_BLIT, + PCNT_GTE, PCNT_TEST, PCNT_CNT }; #ifdef PCNT -static const char *pcnt_names[PCNT_CNT] = { "", "gpu", "spu", "blit", "test" }; +#ifndef __ARM_ARCH_7A__ +#include +#define PCNT_DIV 1 +#else +#define PCNT_DIV 1000 +#endif + +static const char *pcnt_names[PCNT_CNT] = { "", "gpu", "spu", "blit", "gte", "test" }; #define PCNT_FRAMES 10 @@ -32,7 +40,7 @@ static inline void pcnt_print(float fps) int i; for (i = 0; i < PCNT_CNT; i++) - pcounters[i] /= 1000 * PCNT_FRAMES; + pcounters[i] /= PCNT_DIV * PCNT_FRAMES; rem = total = pcounters[PCNT_ALL]; for (i = 1; i < PCNT_CNT; i++) @@ -78,7 +86,13 @@ static inline unsigned int pcnt_get(void) __asm__ volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(val)); #else - val = 0; + // all slow on ARM :( + //struct timespec tv; + //clock_gettime(CLOCK_MONOTONIC_RAW, &tv); + //val = tv.tv_sec * 1000000000 + tv.tv_nsec; + struct timeval tv; + gettimeofday(&tv, NULL); + val = tv.tv_sec * 1000000 + tv.tv_usec; #endif return val; } @@ -96,6 +110,9 @@ static inline void pcnt_init(void) #endif } +void pcnt_gte_start(int op); +void pcnt_gte_end(int op); + #else #define pcnt_start(id)