From 75019168965c5e6dacdb5e0af39d7eb7a2dc919f Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 6 Nov 2010 06:05:00 +0000 Subject: [PATCH] GregMiscellaneous: zzogl-pg: Move the time functions over to be by the Profile code. git-svn-id: http://pcsx2.googlecode.com/svn/branches/GregMiscellaneous@3999 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zzogl-pg/opengl/Profile.h | 29 +++++++++++++++++++++++++++++ plugins/zzogl-pg/opengl/Util.h | 29 +---------------------------- plugins/zzogl-pg/opengl/targets.cpp | 10 ++-------- 3 files changed, 32 insertions(+), 36 deletions(-) diff --git a/plugins/zzogl-pg/opengl/Profile.h b/plugins/zzogl-pg/opengl/Profile.h index d8c4a0a3c2..2b854de3c1 100644 --- a/plugins/zzogl-pg/opengl/Profile.h +++ b/plugins/zzogl-pg/opengl/Profile.h @@ -35,6 +35,23 @@ extern u64 luPerfFreq; #ifdef __LINUX__ #include +#include // ftime(), struct timeb + +inline unsigned long timeGetTime() +{ + timeb t; + ftime(&t); + + return (unsigned long)(t.time*1000 + t.millitm); +} + +inline unsigned long timeGetPreciseTime() +{ + timespec t; + clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t); + + return t.tv_nsec; +} static __forceinline void InitCPUTicks() { @@ -56,6 +73,18 @@ static __forceinline u64 GetCPUTicks() #else static __aligned16 LARGE_INTEGER lfreq; +inline unsigned long timeGetTime() +{ + // Implement later. + return (unsigned long)0; +} + +inline unsigned long timeGetPreciseTime() +{ + // Implement later. + return 0; +} + static __forceinline void InitCPUTicks() { QueryPerformanceFrequency(&lfreq); diff --git a/plugins/zzogl-pg/opengl/Util.h b/plugins/zzogl-pg/opengl/Util.h index da2e9bb002..b970971578 100644 --- a/plugins/zzogl-pg/opengl/Util.h +++ b/plugins/zzogl-pg/opengl/Util.h @@ -53,6 +53,7 @@ extern "C" u32 CALLBACK PS2EgetLibVersion2(u32 type); extern "C" char* CALLBACK PS2EgetLibName(void); #include "ZZoglMath.h" +#include "Profile.h" #include #include @@ -90,34 +91,6 @@ static __forceinline void pcsx2_aligned_free(void* pmem) #endif -#ifdef __LINUX__ -#include // ftime(), struct timeb - -inline unsigned long timeGetTime() -{ - timeb t; - ftime(&t); - - return (unsigned long)(t.time*1000 + t.millitm); -} - -#include -inline unsigned long timeGetPreciseTime() -{ - timespec t; - clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t); - - return t.tv_nsec; -} - -struct RECT -{ - int left, top; - int right, bottom; -}; - -#endif - #define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) diff --git a/plugins/zzogl-pg/opengl/targets.cpp b/plugins/zzogl-pg/opengl/targets.cpp index 9e75a74f19..07a1dbd38a 100644 --- a/plugins/zzogl-pg/opengl/targets.cpp +++ b/plugins/zzogl-pg/opengl/targets.cpp @@ -2737,16 +2737,16 @@ void FlushTransferRanges(const tex0Info* ptex) #endif +#ifdef __LINUX__ //#define LOG_RESOLVE_PROFILE +#endif template inline void Resolve_32_Bit(const void* psrc, int fbp, int fbw, int fbh, const int psm, u32 fbm) { u32 mask, imask; #ifdef LOG_RESOLVE_PROFILE -#ifdef __LINUX__ u32 startime = timeGetPreciseTime(); -#endif #endif if (PSMT_ISHALF(psm)) /* 16 bit */ @@ -2822,10 +2822,8 @@ inline void Resolve_32_Bit(const void* psrc, int fbp, int fbw, int fbh, const in src -= raw_size; } #ifdef LOG_RESOLVE_PROFILE -#ifdef __LINUX__ ZZLog::Dev_Log("*** 32 bits: execution time %d", timeGetPreciseTime()-startime); #endif -#endif } static const __aligned16 unsigned int pixel_5b_mask[4] = {0x0000001F, 0x0000001F, 0x0000001F, 0x0000001F}; @@ -3061,9 +3059,7 @@ void Resolve_32_Bit_sse2(const void* psrc, int fbp, int fbw, int fbh, u32 fbm) { // Note a basic implementation was done in Resolve_32_Bit function #ifdef LOG_RESOLVE_PROFILE -#ifdef __LINUX__ u32 startime = timeGetPreciseTime(); -#endif #endif u32 pix_mask; if (PSMT_ISHALF(psm)) /* 16 bit format */ @@ -3137,10 +3133,8 @@ void Resolve_32_Bit_sse2(const void* psrc, int fbp, int fbw, int fbh, u32 fbm) } #ifdef LOG_RESOLVE_PROFILE -#ifdef __LINUX__ ZZLog::Dev_Log("*** 32 bits: execution time %d", timeGetPreciseTime()-startime); #endif -#endif } #endif