diff --git a/plugins/GSdx/GPURenderer.h b/plugins/GSdx/GPURenderer.h index bd683a67c5..d6a091fec1 100644 --- a/plugins/GSdx/GPURenderer.h +++ b/plugins/GSdx/GPURenderer.h @@ -331,7 +331,7 @@ public: // osd - static UINT64 s_frame = 0; + static uint64 s_frame = 0; static string s_stats; if(m_perfmon.GetFrame() - s_frame >= 30) diff --git a/plugins/GSdx/GSBlock.h b/plugins/GSdx/GSBlock.h index 2ac27a0f12..7b548bf3bf 100644 --- a/plugins/GSdx/GSBlock.h +++ b/plugins/GSdx/GSBlock.h @@ -928,7 +928,7 @@ public: } } - __forceinline static void ExpandBlock4_32(const uint8* RESTRICT src, uint8* RESTRICT dst, int dstpitch, const UINT64* RESTRICT pal) + __forceinline static void ExpandBlock4_32(const uint8* RESTRICT src, uint8* RESTRICT dst, int dstpitch, const uint64* RESTRICT pal) { for(int j = 0; j < 16; j++, dst += dstpitch) { @@ -936,7 +936,7 @@ public: } } - __forceinline static void ExpandBlock4_16(const uint8* RESTRICT src, uint8* RESTRICT dst, int dstpitch, const UINT64* RESTRICT pal) + __forceinline static void ExpandBlock4_16(const uint8* RESTRICT src, uint8* RESTRICT dst, int dstpitch, const uint64* RESTRICT pal) { for(int j = 0; j < 16; j++, dst += dstpitch) { @@ -1478,7 +1478,7 @@ public: // TODO: ReadAndExpandBlock8_16 - __forceinline static void ReadAndExpandBlock4_32(const uint8* RESTRICT src, uint8* RESTRICT dst, int dstpitch, const UINT64* RESTRICT pal) + __forceinline static void ReadAndExpandBlock4_32(const uint8* RESTRICT src, uint8* RESTRICT dst, int dstpitch, const uint64* RESTRICT pal) { #if _M_SSE >= 0x401 diff --git a/plugins/GSdx/GSDrawScanlineCodeGenerator.cpp b/plugins/GSdx/GSDrawScanlineCodeGenerator.cpp index e87c75c4f8..4ba2fb75b0 100644 --- a/plugins/GSdx/GSDrawScanlineCodeGenerator.cpp +++ b/plugins/GSdx/GSDrawScanlineCodeGenerator.cpp @@ -25,7 +25,7 @@ #include "StdAfx.h" #include "GSDrawScanlineCodeGenerator.h" -GSDrawScanlineCodeGenerator::GSDrawScanlineCodeGenerator(GSScanlineEnvironment& env, UINT64 key, void* ptr, size_t maxsize) +GSDrawScanlineCodeGenerator::GSDrawScanlineCodeGenerator(GSScanlineEnvironment& env, uint64 key, void* ptr, size_t maxsize) : CodeGenerator(maxsize, ptr) , m_env(env) { diff --git a/plugins/GSdx/GSDrawScanlineCodeGenerator.h b/plugins/GSdx/GSDrawScanlineCodeGenerator.h index 2803037200..a131f8c678 100644 --- a/plugins/GSdx/GSDrawScanlineCodeGenerator.h +++ b/plugins/GSdx/GSDrawScanlineCodeGenerator.h @@ -73,5 +73,5 @@ class GSDrawScanlineCodeGenerator : public CodeGenerator void blendr(const Xmm& b, const Xmm& a, const Xmm& mask); public: - GSDrawScanlineCodeGenerator(GSScanlineEnvironment& env, UINT64 key, void* ptr, size_t maxsize); + GSDrawScanlineCodeGenerator(GSScanlineEnvironment& env, uint64 key, void* ptr, size_t maxsize); }; \ No newline at end of file diff --git a/plugins/GSdx/GSFunctionMap.h b/plugins/GSdx/GSFunctionMap.h index 2d7d052d8d..b0acb7daec 100644 --- a/plugins/GSdx/GSFunctionMap.h +++ b/plugins/GSdx/GSFunctionMap.h @@ -26,7 +26,7 @@ struct GSRasterizerStats { - __int64 ticks; + int64 ticks; int prims, pixels; GSRasterizerStats() @@ -46,8 +46,8 @@ template class GSFunctionMap protected: struct ActivePtr { - UINT64 frame, frames; - __int64 ticks, pixels; + uint64 frame, frames; + int64 ticks, pixels; VALUE f; }; @@ -90,7 +90,7 @@ public: memset(p, 0, sizeof(*p)); - p->frame = (UINT64)-1; + p->frame = (uint64)-1; p->f = i != m_map.end() ? (*i).second : GetDefaultFunction(key); @@ -102,7 +102,7 @@ public: return m_active->f; } - void UpdateStats(const GSRasterizerStats& stats, UINT64 frame) + void UpdateStats(const GSRasterizerStats& stats, uint64 frame) { if(m_active) { @@ -119,7 +119,7 @@ public: virtual void PrintStats() { - __int64 ttpf = 0; + int64 ttpf = 0; for(hash_map::iterator i = m_map_active.begin(); i != m_map_active.end(); i++) { @@ -138,12 +138,12 @@ public: if(p->frames > 0) { - __int64 tpp = p->pixels > 0 ? p->ticks / p->pixels : 0; - __int64 tpf = p->frames > 0 ? p->ticks / p->frames : 0; - __int64 ppf = p->frames > 0 ? p->pixels / p->frames : 0; + int64 tpp = p->pixels > 0 ? p->ticks / p->pixels : 0; + int64 tpf = p->frames > 0 ? p->ticks / p->frames : 0; + int64 ppf = p->frames > 0 ? p->pixels / p->frames : 0; printf("[%012I64x]%c %6.2f%% | %5.2f%% | f %4I64d | p %10I64d | tpp %4I64d | tpf %9I64d | ppf %7I64d\n", - (UINT64)key, m_map.find(key) == m_map.end() ? '*' : ' ', + (uint64)key, m_map.find(key) == m_map.end() ? '*' : ' ', (float)(tpf * 10000 / 50000000) / 100, (float)(tpf * 10000 / ttpf) / 100, p->frames, p->pixels, @@ -187,7 +187,7 @@ public: { CG* cg = NULL; - hash_map::iterator i = m_cgmap.find(key); + hash_map::iterator i = m_cgmap.find(key); if(i != m_cgmap.end()) { diff --git a/plugins/GSdx/GSLocalMemory.cpp b/plugins/GSdx/GSLocalMemory.cpp index 0d4605b566..b9c499518d 100644 --- a/plugins/GSdx/GSLocalMemory.cpp +++ b/plugins/GSdx/GSLocalMemory.cpp @@ -1757,7 +1757,7 @@ void GSLocalMemory::ReadTextureBlock8(uint32 bp, uint8* dst, int dstpitch, const void GSLocalMemory::ReadTextureBlock4(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const { - const UINT64* pal = m_clut; + const uint64* pal = m_clut; ReadAndExpandBlock4_32(BlockPtr(bp), dst, dstpitch, pal); } @@ -1906,7 +1906,7 @@ void GSLocalMemory::ReadTexture8NP(const GSVector4i& r, uint8* dst, int dstpitch void GSLocalMemory::ReadTexture4NP(const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA) const { - const UINT64* pal = m_clut; + const uint64* pal = m_clut; if(TEX0.CPSM == PSM_PSMCT32 || TEX0.CPSM == PSM_PSMCT24) { diff --git a/plugins/GSdx/GSPerfMon.cpp b/plugins/GSdx/GSPerfMon.cpp index 3a5f2d297e..82c044c361 100644 --- a/plugins/GSdx/GSPerfMon.cpp +++ b/plugins/GSdx/GSPerfMon.cpp @@ -22,8 +22,6 @@ #include "stdafx.h" #include "GSPerfMon.h" -extern "C" unsigned __int64 __rdtsc(); - GSPerfMon::GSPerfMon() : m_total(0) , m_begin(0) diff --git a/plugins/GSdx/GSPerfMon.h b/plugins/GSdx/GSPerfMon.h index 42463551c5..e6d97e338c 100644 --- a/plugins/GSdx/GSPerfMon.h +++ b/plugins/GSdx/GSPerfMon.h @@ -29,7 +29,7 @@ public: protected: double m_counters[CounterLast]; double m_stats[CounterLast]; - UINT64 m_begin, m_total, m_start, m_frame; + uint64 m_begin, m_total, m_start, m_frame; clock_t m_lastframe; int m_count; @@ -41,8 +41,8 @@ protected: public: GSPerfMon(); - void SetFrame(UINT64 frame) {m_frame = frame;} - UINT64 GetFrame() {return m_frame;} + void SetFrame(uint64 frame) {m_frame = frame;} + uint64 GetFrame() {return m_frame;} void Put(counter_t c, double val = 0); double Get(counter_t c) {return m_stats[c];} void Update(); diff --git a/plugins/GSdx/GSRasterizer.cpp b/plugins/GSdx/GSRasterizer.cpp index b3d0a640a4..741c2dbeca 100644 --- a/plugins/GSdx/GSRasterizer.cpp +++ b/plugins/GSdx/GSRasterizer.cpp @@ -51,7 +51,7 @@ void GSRasterizer::Draw(const GSRasterizerData* data) m_stats.Reset(); - __int64 start = __rdtsc(); + int64 start = __rdtsc(); switch(data->primclass) { @@ -897,7 +897,7 @@ void GSRasterizerList::Draw(const GSRasterizerData* data) m_stats.Reset(); - __int64 start = __rdtsc(); + int64 start = __rdtsc(); for(list::reverse_iterator i = rbegin(); i != rend(); i++) { diff --git a/plugins/GSdx/GSRenderer.h b/plugins/GSdx/GSRenderer.h index 923b1e2003..6ba6ce086b 100644 --- a/plugins/GSdx/GSRenderer.h +++ b/plugins/GSdx/GSRenderer.h @@ -454,7 +454,7 @@ public: // osd - static UINT64 s_frame = 0; + static uint64 s_frame = 0; static string s_stats; if(m_perfmon.GetFrame() - s_frame >= 30) diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index c19c5de96e..79cc37c9ad 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -321,7 +321,7 @@ protected: if(s_dump) { - UINT64 frame = m_perfmon.GetFrame(); + uint64 frame = m_perfmon.GetFrame(); string s; @@ -375,7 +375,7 @@ protected: if(s_dump) { - UINT64 frame = m_perfmon.GetFrame(); + uint64 frame = m_perfmon.GetFrame(); string s; diff --git a/plugins/GSdx/GSRendererSW.h b/plugins/GSdx/GSRendererSW.h index 2b70069b02..8c3d50bc42 100644 --- a/plugins/GSdx/GSRendererSW.h +++ b/plugins/GSdx/GSRendererSW.h @@ -557,7 +557,7 @@ protected: if(s_dump) { - UINT64 frame = m_perfmon.GetFrame(); + uint64 frame = m_perfmon.GetFrame(); string s; @@ -630,7 +630,7 @@ protected: if(s_dump) { - UINT64 frame = m_perfmon.GetFrame(); + uint64 frame = m_perfmon.GetFrame(); string s; diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 93721c5236..20fd4124e1 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -564,7 +564,7 @@ template void GSState::GIFRegHandlerTEX2(GIFReg* r) { // m_env.CTXT[i].TEX2 = r->TEX2; // not used - UINT64 mask = 0xFFFFFFE003F00000ui64; // TEX2 bits + uint64 mask = 0xFFFFFFE003F00000ui64; // TEX2 bits r->u64 = (r->u64 & mask) | (m_env.CTXT[i].TEX0.u64 & ~mask); diff --git a/plugins/GSdx/GSVector.cpp b/plugins/GSdx/GSVector.cpp index 1256e96a6f..a1741d5e0a 100644 --- a/plugins/GSdx/GSVector.cpp +++ b/plugins/GSdx/GSVector.cpp @@ -58,17 +58,17 @@ GSVector4i GSVector4i::fit(int arx, int ary) const if(w * ary > h * arx) { - int w2 = h * arx / ary; - r.left = (r.left + r.right - w2) >> 1; + w = h * arx / ary; + r.left = (r.left + r.right - w) >> 1; if(r.left & 1) r.left++; - r.right = r.left + w2; + r.right = r.left + w; } else { - int h2 = w * ary / arx; - r.top = (r.top + r.bottom - h2) >> 1; + h = w * ary / arx; + r.top = (r.top + r.bottom - h) >> 1; if(r.top & 1) r.top++; - r.bottom = r.top + h2; + r.bottom = r.top + h; } r = r.rintersect(*this); diff --git a/plugins/GSdx/GSVector.h b/plugins/GSdx/GSVector.h index 46a6194ff7..d3dd190e0f 100644 --- a/plugins/GSdx/GSVector.h +++ b/plugins/GSdx/GSVector.h @@ -168,7 +168,7 @@ public: #else - return GSVector4i(min(x, a.x), min(y, a.y), max(z, a.z), max(x, a.w)); + return GSVector4i(min(x, a.x), min(y, a.y), max(z, a.z), max(w, a.w)); #endif } @@ -251,7 +251,7 @@ public: v.x = min(max(x, a.x), b.x); v.y = min(max(y, a.y), b.y); v.z = min(max(z, a.z), b.z); - v.w = min(max(x, a.w), b.w); + v.w = min(max(w, a.w), b.w); return v; } @@ -263,7 +263,7 @@ public: v.x = min(max(x, a.x), a.z); v.y = min(max(y, a.y), a.w); v.z = min(max(z, a.x), a.z); - v.w = min(max(x, a.y), a.w); + v.w = min(max(w, a.y), a.w); return v; } @@ -1049,14 +1049,14 @@ public: #if _M_SSE >= 0x401 - template GSVector4i insert64(__int64 a) const + template GSVector4i insert64(int64 a) const { return GSVector4i(_mm_insert_epi64(m, a, i)); } #endif - template __int64 extract64() const + template int64 extract64() const { if(i == 0) return GSVector4i::storeq(*this); #if _M_SSE >= 0x401 @@ -1340,8 +1340,8 @@ public: { GSVector4i v; - v = loadq((__int64)ptr[extract8() & 0xf]); - v = v.insert64<1>((__int64)ptr[extract8() >> 4]); + v = loadq((int64)ptr[extract8() & 0xf]); + v = v.insert64<1>((int64)ptr[extract8() >> 4]); return v; } @@ -1350,8 +1350,8 @@ public: { GSVector4i v; - v = loadq((__int64)ptr[extract8()]); - v = v.insert64<1>((__int64)ptr[extract8()]); + v = loadq((int64)ptr[extract8()]); + v = v.insert64<1>((int64)ptr[extract8()]); return v; } @@ -1360,8 +1360,8 @@ public: { GSVector4i v; - v = loadq((__int64)ptr[extract16()]); - v = v.insert64<1>((__int64)ptr[extract16()]); + v = loadq((int64)ptr[extract16()]); + v = v.insert64<1>((int64)ptr[extract16()]); return v; } @@ -1370,8 +1370,8 @@ public: { GSVector4i v; - v = loadq((__int64)ptr[extract32()]); - v = v.insert64<1>((__int64)ptr[extract32()]); + v = loadq((int64)ptr[extract32()]); + v = v.insert64<1>((int64)ptr[extract32()]); return v; } @@ -1380,8 +1380,8 @@ public: { GSVector4i v; - v = loadq((__int64)ptr[extract64<0>()]); - v = v.insert64<1>((__int64)ptr[extract64<1>()]); + v = loadq((int64)ptr[extract64<0>()]); + v = v.insert64<1>((int64)ptr[extract64<1>()]); return v; } @@ -1595,7 +1595,7 @@ public: #ifdef _M_AMD64 - static GSVector4i loadq(__int64 i) + static GSVector4i loadq(int64 i) { return GSVector4i(_mm_cvtsi64_si128(i)); } @@ -1636,7 +1636,7 @@ public: #ifdef _M_AMD64 - static __int64 storeq(const GSVector4i& v) + static int64 storeq(const GSVector4i& v) { return _mm_cvtsi128_si64(v.m); } diff --git a/plugins/GSdx/stdafx.h b/plugins/GSdx/stdafx.h index 5d2b8eae29..adf3463f2d 100644 --- a/plugins/GSdx/stdafx.h +++ b/plugins/GSdx/stdafx.h @@ -80,6 +80,12 @@ typedef signed long long int64; #endif #endif +#ifdef __x86_64__ + #define _M_AMD64 +#endif + +extern "C" uint64 __rdtsc(); // TODO: gcc + // directx #include @@ -149,4 +155,3 @@ typedef signed long long int64; #include #endif -