GSdx: fixed a few more typos in GSVector4i, the black screen bug should be gone

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1192 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2009-05-15 11:11:26 +00:00
parent a1507e6044
commit 441aee367e
16 changed files with 59 additions and 56 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)
{

View File

@ -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);
};

View File

@ -26,7 +26,7 @@
struct GSRasterizerStats
{
__int64 ticks;
int64 ticks;
int prims, pixels;
GSRasterizerStats()
@ -46,8 +46,8 @@ template<class KEY, class VALUE> 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<KEY, ActivePtr*>::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<UINT64, CG*>::iterator i = m_cgmap.find(key);
hash_map<uint64, CG*>::iterator i = m_cgmap.find(key);
if(i != m_cgmap.end())
{

View File

@ -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)
{

View File

@ -22,8 +22,6 @@
#include "stdafx.h"
#include "GSPerfMon.h"
extern "C" unsigned __int64 __rdtsc();
GSPerfMon::GSPerfMon()
: m_total(0)
, m_begin(0)

View File

@ -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();

View File

@ -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<IRasterizer*>::reverse_iterator i = rbegin(); i != rend(); i++)
{

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -564,7 +564,7 @@ template<int i> 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);

View File

@ -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);

View File

@ -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<int i> GSVector4i insert64(__int64 a) const
template<int i> GSVector4i insert64(int64 a) const
{
return GSVector4i(_mm_insert_epi64(m, a, i));
}
#endif
template<int i> __int64 extract64() const
template<int i> 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<src + 0>() & 0xf]);
v = v.insert64<1>((__int64)ptr[extract8<src + 0>() >> 4]);
v = loadq((int64)ptr[extract8<src + 0>() & 0xf]);
v = v.insert64<1>((int64)ptr[extract8<src + 0>() >> 4]);
return v;
}
@ -1350,8 +1350,8 @@ public:
{
GSVector4i v;
v = loadq((__int64)ptr[extract8<src + 0>()]);
v = v.insert64<1>((__int64)ptr[extract8<src + 1>()]);
v = loadq((int64)ptr[extract8<src + 0>()]);
v = v.insert64<1>((int64)ptr[extract8<src + 1>()]);
return v;
}
@ -1360,8 +1360,8 @@ public:
{
GSVector4i v;
v = loadq((__int64)ptr[extract16<src + 0>()]);
v = v.insert64<1>((__int64)ptr[extract16<src + 1>()]);
v = loadq((int64)ptr[extract16<src + 0>()]);
v = v.insert64<1>((int64)ptr[extract16<src + 1>()]);
return v;
}
@ -1370,8 +1370,8 @@ public:
{
GSVector4i v;
v = loadq((__int64)ptr[extract32<src + 0>()]);
v = v.insert64<1>((__int64)ptr[extract32<src + 1>()]);
v = loadq((int64)ptr[extract32<src + 0>()]);
v = v.insert64<1>((int64)ptr[extract32<src + 1>()]);
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);
}

View File

@ -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 <ddraw.h>
@ -149,4 +155,3 @@ typedef signed long long int64;
#include <smmintrin.h>
#endif