mirror of https://github.com/PCSX2/pcsx2.git
Fixed many gcc errors, there are still plenty. Intel's compiler might be a better alternative.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4311 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
85899961be
commit
d44def8c0b
|
@ -25,7 +25,7 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned32 class GPUDrawingEnvironment
|
||||
__aligned(class, 32) GPUDrawingEnvironment
|
||||
{
|
||||
public:
|
||||
GPURegSTATUS STATUS;
|
||||
|
|
|
@ -82,5 +82,3 @@ public:
|
|||
|
||||
void SaveBMP(const string& path, const GSVector4i& r, int tp, int cx, int cy);
|
||||
};
|
||||
|
||||
#pragma warning(default: 4244)
|
|
@ -56,7 +56,7 @@ union GPUScanlineSelector
|
|||
operator uint32() const {return key;}
|
||||
};
|
||||
|
||||
__aligned32 struct GPUScanlineGlobalData
|
||||
__aligned(struct, 32) GPUScanlineGlobalData
|
||||
{
|
||||
GPUScanlineSelector sel;
|
||||
|
||||
|
@ -66,7 +66,7 @@ __aligned32 struct GPUScanlineGlobalData
|
|||
GSVector4i twin; // TWW, TWH, TWX, TWY
|
||||
};
|
||||
|
||||
__aligned32 struct GPUScanlineLocalData
|
||||
__aligned(struct, 32) GPUScanlineLocalData
|
||||
{
|
||||
const GPUScanlineGlobalData* gd;
|
||||
|
||||
|
|
|
@ -103,7 +103,9 @@ protected:
|
|||
#ifdef DEBUG
|
||||
dir = 2;
|
||||
#endif
|
||||
m_mem.SaveBMP(format("c:\\temp%d\\%04d_%s.bmp", dir, s_n, s), r, TP, m_env.CLUT.X, m_env.CLUT.Y);
|
||||
string path = format("c:\\temp%d\\%04d_%s.bmp", dir, s_n, s.c_str());
|
||||
|
||||
m_mem.SaveBMP(path, r, TP, m_env.CLUT.X, m_env.CLUT.Y);
|
||||
}
|
||||
|
||||
void Dump(const string& s, int inc = true)
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned32 struct GPUVertex
|
||||
__aligned(struct, 32) GPUVertex
|
||||
{
|
||||
union
|
||||
{
|
||||
|
|
|
@ -239,7 +239,7 @@ static INT32 _GSopen(void* dsp, char* title, int renderer, int threads = -1)
|
|||
|
||||
s_gs->m_wnd.Show();
|
||||
|
||||
*(HWND*)dsp = (HWND)s_gs->m_wnd.GetHandle();
|
||||
*(HWND*)dsp = s_gs->m_wnd.GetHandle();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -815,7 +815,7 @@ union
|
|||
};
|
||||
};
|
||||
REG_END2
|
||||
__forceinline bool IsRepeating() {return ((uint32)1 << TW) > (TBW << 6);}
|
||||
__forceinline bool IsRepeating() {return (1 << TW) > (int)(TBW << 6);}
|
||||
REG_END2
|
||||
|
||||
REG64_(GIFReg, TEX1)
|
||||
|
@ -1078,7 +1078,7 @@ REG128_SET(GIFPackedReg)
|
|||
GIFPackedNOP NOP;
|
||||
REG_SET_END
|
||||
|
||||
__aligned32 struct GIFPath
|
||||
__aligned(struct, 32) GIFPath
|
||||
{
|
||||
GIFTag tag;
|
||||
uint32 reg;
|
||||
|
|
|
@ -1188,7 +1188,7 @@ public:
|
|||
|
||||
#else
|
||||
/*
|
||||
__aligned32 uint32 block[8 * 8];
|
||||
__aligned(uint32, 32) block[8 * 8];
|
||||
|
||||
UnpackBlock4HL(src, srcpitch, block);
|
||||
|
||||
|
@ -1303,7 +1303,7 @@ public:
|
|||
|
||||
#else
|
||||
/*
|
||||
__aligned32 uint32 block[8 * 8];
|
||||
__aligned(uint32, 32) block[8 * 8];
|
||||
|
||||
UnpackBlock4HH(src, srcpitch, block);
|
||||
|
||||
|
@ -1454,7 +1454,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned32 uint8 block[16 * 16];
|
||||
__aligned(uint8, 32) block[16 * 16];
|
||||
|
||||
ReadBlock8<true>(src, (uint8*)block, sizeof(block) / 16);
|
||||
|
||||
|
@ -1529,7 +1529,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned32 uint8 block[(32 / 2) * 16];
|
||||
__aligned(uint8, 32) block[(32 / 2) * 16];
|
||||
|
||||
ReadBlock4<true>(src, (uint8*)block, sizeof(block) / 16);
|
||||
|
||||
|
@ -1570,7 +1570,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned32 uint32 block[8 * 8];
|
||||
__aligned(uint32, 32) block[8 * 8];
|
||||
|
||||
ReadBlock32<true>(src, (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
@ -1611,7 +1611,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned32 uint32 block[8 * 8];
|
||||
__aligned(uint32, 32) block[8 * 8];
|
||||
|
||||
ReadBlock32<true>(src, (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
@ -1652,7 +1652,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned32 uint32 block[8 * 8];
|
||||
__aligned(uint32, 32) block[8 * 8];
|
||||
|
||||
ReadBlock32<true>(src, (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
class GSLocalMemory;
|
||||
|
||||
__aligned32 class GSClut : public GSAlignedClass<32>
|
||||
__aligned(class, 32) GSClut : public GSAlignedClass<32>
|
||||
{
|
||||
GSLocalMemory* m_mem;
|
||||
|
||||
|
@ -37,7 +37,7 @@ __aligned32 class GSClut : public GSAlignedClass<32>
|
|||
uint32* m_buff32;
|
||||
uint64* m_buff64;
|
||||
|
||||
__aligned32 struct WriteState
|
||||
__aligned(struct, 32) WriteState
|
||||
{
|
||||
GIFRegTEX0 TEX0;
|
||||
GIFRegTEXCLUT TEXCLUT;
|
||||
|
@ -45,7 +45,7 @@ __aligned32 class GSClut : public GSAlignedClass<32>
|
|||
bool IsDirty(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT);
|
||||
} m_write;
|
||||
|
||||
__aligned32 struct ReadState
|
||||
__aligned(struct, 32) ReadState
|
||||
{
|
||||
GIFRegTEX0 TEX0;
|
||||
GIFRegTEXA TEXA;
|
||||
|
|
|
@ -28,20 +28,22 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
struct MergeConstantBuffer
|
||||
class MergeConstantBuffer
|
||||
{
|
||||
public:
|
||||
GSVector4 BGColor;
|
||||
|
||||
struct MergeConstantBuffer() {memset(this, 0, sizeof(*this));}
|
||||
MergeConstantBuffer() {memset(this, 0, sizeof(*this));}
|
||||
};
|
||||
|
||||
struct InterlaceConstantBuffer
|
||||
class InterlaceConstantBuffer
|
||||
{
|
||||
public:
|
||||
GSVector2 ZrH;
|
||||
float hH;
|
||||
float _pad[1];
|
||||
|
||||
struct InterlaceConstantBuffer() {memset(this, 0, sizeof(*this));}
|
||||
InterlaceConstantBuffer() {memset(this, 0, sizeof(*this));}
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
|
|
@ -174,7 +174,7 @@ bool GSDevice11::Create(GSWnd* wnd)
|
|||
//scd.BufferDesc.RefreshRate.Numerator = 60;
|
||||
//scd.BufferDesc.RefreshRate.Denominator = 1;
|
||||
scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
|
||||
scd.OutputWindow = (HWND)m_wnd->GetHandle();
|
||||
scd.OutputWindow = m_wnd->GetHandle();
|
||||
scd.SampleDesc.Count = 1;
|
||||
scd.SampleDesc.Quality = 0;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ GSDevice9::~GSDevice9()
|
|||
|
||||
// if supported and null != msaa_desc, msaa_desc will contain requested Count and Quality
|
||||
|
||||
static bool IsMsaaSupported(IDirect3D9* d3d, D3DFORMAT depth_format, uint msaaCount, DXGI_SAMPLE_DESC* msaa_desc = NULL)
|
||||
static bool IsMsaaSupported(IDirect3D9* d3d, D3DFORMAT depth_format, uint32 msaaCount, DXGI_SAMPLE_DESC* msaa_desc = NULL)
|
||||
{
|
||||
if(msaaCount > 16) return false;
|
||||
|
||||
|
@ -117,7 +117,7 @@ static D3DFORMAT BestD3dFormat(IDirect3D9* d3d, int msaaCount = 0, DXGI_SAMPLE_D
|
|||
|
||||
// return: 32, 24, or 0 if not supported. if 1==msaa, considered as msaa=0
|
||||
|
||||
uint GSDevice9::GetMaxDepth(uint msaa = 0)
|
||||
uint32 GSDevice9::GetMaxDepth(uint32 msaa = 0)
|
||||
{
|
||||
CComPtr<IDirect3D9> d3d;
|
||||
|
||||
|
@ -376,7 +376,7 @@ bool GSDevice9::Reset(int w, int h)
|
|||
memset(&m_pp, 0, sizeof(m_pp));
|
||||
|
||||
m_pp.Windowed = TRUE;
|
||||
m_pp.hDeviceWindow = (HWND)m_wnd->GetHandle();
|
||||
m_pp.hDeviceWindow = m_wnd->GetHandle();
|
||||
m_pp.SwapEffect = D3DSWAPEFFECT_FLIP;
|
||||
m_pp.BackBufferFormat = D3DFMT_X8R8G8B8;
|
||||
m_pp.BackBufferWidth = 1;
|
||||
|
@ -408,7 +408,7 @@ bool GSDevice9::Reset(int w, int h)
|
|||
flags |= D3DCREATE_PUREDEVICE;
|
||||
}
|
||||
|
||||
hr = m_d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, (HWND)m_wnd->GetHandle(), flags, &m_pp, &m_dev);
|
||||
hr = m_d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_wnd->GetHandle(), flags, &m_pp, &m_dev);
|
||||
|
||||
if(FAILED(hr)) return false;
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ public:
|
|||
bool HasStencil() { return m_depth_format == D3DFMT_D24S8; }
|
||||
bool HasDepth32() { return m_depth_format != D3DFMT_D24S8; }
|
||||
|
||||
static uint GetMaxDepth(uint msaaCount);
|
||||
static uint32 GetMaxDepth(uint32 msaaCount);
|
||||
static void ForceValidMsaaConfig();
|
||||
|
||||
};
|
||||
|
|
|
@ -30,7 +30,7 @@ class GSDeviceDX : public GSDevice
|
|||
public:
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned32 struct VSConstantBuffer
|
||||
__aligned(struct, 32) VSConstantBuffer
|
||||
{
|
||||
GSVector4 VertexScale;
|
||||
GSVector4 VertexOffset;
|
||||
|
@ -86,7 +86,7 @@ public:
|
|||
VSSelector() : key(0) {}
|
||||
};
|
||||
|
||||
__aligned32 struct PSConstantBuffer
|
||||
__aligned(struct, 32) PSConstantBuffer
|
||||
{
|
||||
GSVector4 FogColor_AREF;
|
||||
GSVector4 HalfTexel;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned32 class GSDrawingContext
|
||||
__aligned(class, 32) GSDrawingContext
|
||||
{
|
||||
public:
|
||||
GIFRegXYOFFSET XYOFFSET;
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
GIFRegFRAME FRAME;
|
||||
GIFRegZBUF ZBUF;
|
||||
|
||||
__aligned32 struct
|
||||
__aligned(struct, 32)
|
||||
{
|
||||
GSVector4i dx10;
|
||||
GSVector4 dx9;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned32 class GSDrawingEnvironment
|
||||
__aligned(class, 32) GSDrawingEnvironment
|
||||
{
|
||||
public:
|
||||
GIFRegPRIM PRIM;
|
||||
|
|
|
@ -628,7 +628,7 @@ void GSLocalMemory::WriteImageLeftRight(int l, int r, int y, int h, const uint8*
|
|||
template<int psm, int bsx, int bsy, int trbpp>
|
||||
void GSLocalMemory::WriteImageTopBottom(int l, int r, int y, int h, const uint8* src, int srcpitch, const GIFRegBITBLTBUF& BITBLTBUF)
|
||||
{
|
||||
__aligned32 uint8 buff[64]; // merge buffer for one column
|
||||
__aligned(uint8, 32) buff[64]; // merge buffer for one column
|
||||
|
||||
uint32 bp = BITBLTBUF.DBP;
|
||||
uint32 bw = BITBLTBUF.DBW;
|
||||
|
@ -1438,7 +1438,7 @@ void GSLocalMemory::ReadTexture24(const GSOffset* RESTRICT o, const GSVector4i&
|
|||
|
||||
void GSLocalMemory::ReadTexture16(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA)
|
||||
{
|
||||
__aligned32 uint16 block[16 * 8];
|
||||
__aligned(uint16, 32) block[16 * 8];
|
||||
|
||||
FOREACH_BLOCK_START(r, 16, 8, 32)
|
||||
{
|
||||
|
@ -1451,7 +1451,7 @@ void GSLocalMemory::ReadTexture16(const GSOffset* RESTRICT o, const GSVector4i&
|
|||
|
||||
void GSLocalMemory::ReadTexture16S(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA)
|
||||
{
|
||||
__aligned32 uint16 block[16 * 8];
|
||||
__aligned(uint16, 32) block[16 * 8];
|
||||
|
||||
FOREACH_BLOCK_START(r, 16, 8, 32)
|
||||
{
|
||||
|
@ -1548,7 +1548,7 @@ void GSLocalMemory::ReadTexture24Z(const GSOffset* RESTRICT o, const GSVector4i&
|
|||
|
||||
void GSLocalMemory::ReadTexture16Z(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA)
|
||||
{
|
||||
__aligned32 uint16 block[16 * 8];
|
||||
__aligned(uint16, 32) block[16 * 8];
|
||||
|
||||
FOREACH_BLOCK_START(r, 16, 8, 32)
|
||||
{
|
||||
|
@ -1561,7 +1561,7 @@ void GSLocalMemory::ReadTexture16Z(const GSOffset* RESTRICT o, const GSVector4i&
|
|||
|
||||
void GSLocalMemory::ReadTexture16SZ(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA)
|
||||
{
|
||||
__aligned32 uint16 block[16 * 8];
|
||||
__aligned(uint16, 32) block[16 * 8];
|
||||
|
||||
FOREACH_BLOCK_START(r, 16, 8, 32)
|
||||
{
|
||||
|
@ -1597,7 +1597,7 @@ void GSLocalMemory::ReadTextureBlock24(uint32 bp, uint8* dst, int dstpitch, cons
|
|||
|
||||
void GSLocalMemory::ReadTextureBlock16(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const
|
||||
{
|
||||
__aligned32 uint16 block[16 * 8];
|
||||
__aligned(uint16, 32) block[16 * 8];
|
||||
|
||||
ReadBlock16<true>(BlockPtr(bp), (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
@ -1606,7 +1606,7 @@ void GSLocalMemory::ReadTextureBlock16(uint32 bp, uint8* dst, int dstpitch, cons
|
|||
|
||||
void GSLocalMemory::ReadTextureBlock16S(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const
|
||||
{
|
||||
__aligned32 uint16 block[16 * 8];
|
||||
__aligned(uint16, 32) block[16 * 8];
|
||||
|
||||
ReadBlock16<true>(BlockPtr(bp), (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
@ -1671,7 +1671,7 @@ void GSLocalMemory::ReadTextureBlock24Z(uint32 bp, uint8* dst, int dstpitch, con
|
|||
|
||||
void GSLocalMemory::ReadTextureBlock16Z(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const
|
||||
{
|
||||
__aligned32 uint16 block[16 * 8];
|
||||
__aligned(uint16, 32) block[16 * 8];
|
||||
|
||||
ReadBlock16<true>(BlockPtr(bp), (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
@ -1680,7 +1680,7 @@ void GSLocalMemory::ReadTextureBlock16Z(uint32 bp, uint8* dst, int dstpitch, con
|
|||
|
||||
void GSLocalMemory::ReadTextureBlock16SZ(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const
|
||||
{
|
||||
__aligned32 uint16 block[16 * 8];
|
||||
__aligned(uint16, 32) block[16 * 8];
|
||||
|
||||
ReadBlock16<true>(BlockPtr(bp), (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
@ -1851,7 +1851,7 @@ void GSLocalMemory::ReadTextureBlock4HHP(uint32 bp, uint8* dst, int dstpitch, co
|
|||
|
||||
//
|
||||
|
||||
HRESULT GSLocalMemory::SaveBMP(const string& fn, uint32 bp, uint32 bw, uint32 psm, int w, int h)
|
||||
bool GSLocalMemory::SaveBMP(const string& fn, uint32 bp, uint32 bw, uint32 psm, int w, int h)
|
||||
{
|
||||
int pitch = w * 4;
|
||||
int size = pitch * h;
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#pragma warning(disable: 4100) // warning C4100: 'TEXA' : unreferenced formal parameter
|
||||
|
||||
#include "GS.h"
|
||||
#include "GSTables.h"
|
||||
#include "GSVector.h"
|
||||
|
@ -72,9 +70,7 @@ public:
|
|||
typedef void (GSLocalMemory::*readTexture)(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA);
|
||||
typedef void (GSLocalMemory::*readTextureBlock)(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const;
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
__aligned(struct, 128) psm_t
|
||||
{
|
||||
pixelAddress pa, bn;
|
||||
readPixel rp;
|
||||
|
@ -94,10 +90,6 @@ public:
|
|||
short* blockOffset;
|
||||
};
|
||||
|
||||
uint8 dummy[128];
|
||||
|
||||
} psm_t;
|
||||
|
||||
static psm_t m_psm[64];
|
||||
|
||||
static const int m_vmsize = 1024 * 1024 * 4;
|
||||
|
@ -891,7 +883,6 @@ public:
|
|||
|
||||
//
|
||||
|
||||
HRESULT SaveBMP(const string& fn, uint32 bp, uint32 bw, uint32 psm, int w, int h);
|
||||
bool SaveBMP(const string& fn, uint32 bp, uint32 bw, uint32 psm, int w, int h);
|
||||
};
|
||||
|
||||
#pragma warning(default: 4244)
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "GSThread.h"
|
||||
#include "GSAlignedClass.h"
|
||||
|
||||
__aligned32 class GSRasterizerData
|
||||
__aligned(class, 32) GSRasterizerData
|
||||
{
|
||||
public:
|
||||
GSVector4i scissor;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
GSRendererDX11::GSRendererDX11()
|
||||
: GSRendererDX<GSVertexHW11>(new GSTextureCache11(this), GSVector2(-0.5f, -0.5f))
|
||||
{
|
||||
InitVertexKick<GSRendererDX11>();
|
||||
InitVertexKick(GSRendererDX11);
|
||||
}
|
||||
|
||||
bool GSRendererDX11::CreateDevice(GSDevice* dev)
|
||||
|
@ -43,8 +43,7 @@ void GSRendererDX11::VertexKick(bool skip)
|
|||
{
|
||||
GSVertexHW11& dst = m_vl.AddTail();
|
||||
|
||||
dst.vi[0] = m_v.vi[0];
|
||||
dst.vi[1] = m_v.vi[1];
|
||||
dst = *(GSVertexHW11*)&m_v;
|
||||
|
||||
#ifdef USE_UPSCALE_HACKS
|
||||
|
||||
|
@ -99,7 +98,7 @@ void GSRendererDX11::VertexKick(bool skip)
|
|||
dst.ST.S = (float)m_v.UV.U - Uadjust;
|
||||
dst.ST.T = (float)m_v.UV.V - Vadjust;
|
||||
}
|
||||
else if (tme)
|
||||
else if(tme)
|
||||
{
|
||||
// Wip :p
|
||||
//dst.XYZ.X += 5;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
GSRendererDX9::GSRendererDX9()
|
||||
: GSRendererDX<GSVertexHW9>(new GSTextureCache9(this))
|
||||
{
|
||||
InitVertexKick<GSRendererDX9>();
|
||||
InitVertexKick(GSRendererDX9);
|
||||
}
|
||||
|
||||
bool GSRendererDX9::CreateDevice(GSDevice* dev)
|
||||
|
@ -60,19 +60,21 @@ bool GSRendererDX9::CreateDevice(GSDevice* dev)
|
|||
template<uint32 prim, uint32 tme, uint32 fst>
|
||||
void GSRendererDX9::VertexKick(bool skip)
|
||||
{
|
||||
GSVertexHW9& dst = m_vl.AddTail();
|
||||
|
||||
dst.p = GSVector4(((GSVector4i)m_v.XYZ).upl16());
|
||||
GSVector4 p = GSVector4(((GSVector4i)m_v.XYZ).upl16());
|
||||
|
||||
if(tme && !fst)
|
||||
{
|
||||
dst.p = dst.p.xyxy(GSVector4((float)m_v.XYZ.Z, m_v.RGBAQ.Q));
|
||||
p = p.xyxy(GSVector4((float)m_v.XYZ.Z, m_v.RGBAQ.Q));
|
||||
}
|
||||
else
|
||||
{
|
||||
dst.p = dst.p.xyxy(GSVector4::load((float)m_v.XYZ.Z));
|
||||
p = p.xyxy(GSVector4::load((float)m_v.XYZ.Z));
|
||||
}
|
||||
|
||||
GSVertexHW9& dst = m_vl.AddTail();
|
||||
|
||||
dst.p = p;
|
||||
|
||||
int Uadjust = 0;
|
||||
int Vadjust = 0;
|
||||
|
||||
|
@ -138,8 +140,8 @@ void GSRendererDX9::VertexKick(bool skip)
|
|||
}
|
||||
}
|
||||
|
||||
dst.c0 = m_v.RGBAQ.u32[0];
|
||||
dst.c1 = m_v.FOG.u32[1];
|
||||
dst._c0() = m_v.RGBAQ.u32[0];
|
||||
dst._c1() = m_v.FOG.u32[1];
|
||||
|
||||
//
|
||||
|
||||
|
@ -198,18 +200,18 @@ void GSRendererDX9::VertexKick(bool skip)
|
|||
break;
|
||||
case GS_LINELIST:
|
||||
case GS_LINESTRIP:
|
||||
if(PRIM->IIP == 0) {v[0].c0 = v[1].c0;}
|
||||
if(PRIM->IIP == 0) {v[0]._c0() = v[1]._c0();}
|
||||
break;
|
||||
case GS_TRIANGLELIST:
|
||||
case GS_TRIANGLESTRIP:
|
||||
case GS_TRIANGLEFAN:
|
||||
if(PRIM->IIP == 0) {v[0].c0 = v[1].c0 = v[2].c0;}
|
||||
if(PRIM->IIP == 0) {v[0]._c0() = v[1]._c0() = v[2]._c0();}
|
||||
break;
|
||||
case GS_SPRITE:
|
||||
if(PRIM->IIP == 0) {v[0].c0 = v[1].c0;}
|
||||
if(PRIM->IIP == 0) {v[0]._c0() = v[1]._c0();}
|
||||
v[0].p.z = v[1].p.z;
|
||||
v[0].p.w = v[1].p.w;
|
||||
v[0].c1 = v[1].c1;
|
||||
v[0]._c1() = v[1]._c1();
|
||||
v[2] = v[1];
|
||||
v[3] = v[1];
|
||||
v[1].p.y = v[0].p.y;
|
||||
|
|
|
@ -74,7 +74,7 @@ class GSRendererHW : public GSRendererT<Vertex>
|
|||
int y = ((int)m_vertices[i].p.y - oy) >> 4;
|
||||
|
||||
// video[y * 448 + x] = m_vertices[i].c0;
|
||||
video[(y << 8) + (y << 7) + (y << 6) + x] = m_vertices[i].c0;
|
||||
video[(y << 8) + (y << 7) + (y << 6) + x] = m_vertices[i]._c0();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -140,9 +140,9 @@ class GSRendererHW : public GSRendererT<Vertex>
|
|||
|
||||
for(int i = 0, j = m_count; i < j; i++)
|
||||
{
|
||||
if(m_vertices[i].r == 0 && m_vertices[i].g != 0 && m_vertices[i].b != 0)
|
||||
if(m_vertices[i]._r() == 0 && m_vertices[i]._g() != 0 && m_vertices[i]._b() != 0)
|
||||
{
|
||||
m_vertices[i].r = (m_vertices[i].g + m_vertices[i].b) / 2;
|
||||
m_vertices[i]._r() = (m_vertices[i]._g() + m_vertices[i]._b()) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -257,9 +257,11 @@ class GSRendererHW : public GSRendererT<Vertex>
|
|||
{
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
m_vertices[i].a = m_vertices[i].a >= 0x80 ? 0xff : m_vertices[i].a * 2;
|
||||
uint8 a = m_vertices[i]._a();
|
||||
|
||||
m_mem.WritePixel32(i & 7, i >> 3, m_vertices[i].c0, FBP, FBW);
|
||||
m_vertices[i]._a() = a >= 0x80 ? 0xff : a * 2;
|
||||
|
||||
m_mem.WritePixel32(i & 7, i >> 3, m_vertices[i]._c0(), FBP, FBW);
|
||||
}
|
||||
|
||||
m_mem.m_clut.Invalidate();
|
||||
|
@ -270,9 +272,11 @@ class GSRendererHW : public GSRendererT<Vertex>
|
|||
{
|
||||
for(int i = 0; i < 256; i++)
|
||||
{
|
||||
m_vertices[i].a = m_vertices[i].a >= 0x80 ? 0xff : m_vertices[i].a * 2;
|
||||
uint8 a = m_vertices[i]._a();
|
||||
|
||||
m_mem.WritePixel32(i & 15, i >> 4, m_vertices[i].c0, FBP, FBW);
|
||||
m_vertices[i]._a() = a >= 0x80 ? 0xff : a * 2;
|
||||
|
||||
m_mem.WritePixel32(i & 15, i >> 4, m_vertices[i]._c0(), FBP, FBW);
|
||||
}
|
||||
|
||||
m_mem.m_clut.Invalidate();
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
GSRendererNull()
|
||||
: GSRendererT<GSVertexNull>()
|
||||
{
|
||||
InitVertexKick<GSRendererNull>();
|
||||
InitVertexKick(GSRendererNull);
|
||||
}
|
||||
|
||||
template<uint32 prim, uint32 tme, uint32 fst> void VertexKick(bool skip)
|
||||
|
|
|
@ -27,13 +27,13 @@ const GSVector4 g_pos_scale(1.0f / 16, 1.0f / 16, 1.0f, 128.0f);
|
|||
GSRendererSW::GSRendererSW(int threads)
|
||||
: GSRendererT()
|
||||
{
|
||||
InitVertexKick(GSRendererSW);
|
||||
|
||||
m_tc = new GSTextureCacheSW(this);
|
||||
|
||||
memset(m_texture, 0, sizeof(m_texture));
|
||||
|
||||
m_rl.Create<GSDrawScanline>(threads);
|
||||
|
||||
InitVertexKick<GSRendererSW>();
|
||||
}
|
||||
|
||||
GSRendererSW::~GSRendererSW()
|
||||
|
|
|
@ -101,7 +101,7 @@ union GSScanlineSelector
|
|||
}
|
||||
};
|
||||
|
||||
__aligned32 struct GSScanlineGlobalData // per batch variables, this is like a pixel shader constant buffer
|
||||
__aligned(struct, 32) GSScanlineGlobalData // per batch variables, this is like a pixel shader constant buffer
|
||||
{
|
||||
GSScanlineSelector sel;
|
||||
|
||||
|
@ -129,7 +129,7 @@ __aligned32 struct GSScanlineGlobalData // per batch variables, this is like a p
|
|||
GSVector4i frb, fga;
|
||||
};
|
||||
|
||||
__aligned32 struct GSScanlineLocalData // per prim variables, each thread has its own
|
||||
__aligned(struct, 32) GSScanlineLocalData // per prim variables, each thread has its own
|
||||
{
|
||||
const GSScanlineGlobalData* gd;
|
||||
|
||||
|
|
|
@ -173,19 +173,25 @@ void GSSettingsDlg::OnInit()
|
|||
|
||||
bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code)
|
||||
{
|
||||
if(id == IDC_MSAAEDIT && code == EN_CHANGE)//validate and possibly warn user when changing msaa
|
||||
{//post change
|
||||
if(id == IDC_MSAAEDIT && code == EN_CHANGE) // validate and possibly warn user when changing msaa
|
||||
{
|
||||
//post change
|
||||
|
||||
bool dx9 = false;
|
||||
INT_PTR i;
|
||||
|
||||
if(ComboBoxGetSelData(IDC_RENDERER, i))
|
||||
{
|
||||
dx9 = i >= 0 && i <= 2;
|
||||
}
|
||||
|
||||
if (dx9){
|
||||
if(dx9)
|
||||
{
|
||||
uint32 requestedMsaa = (int)SendMessage(GetDlgItem(m_hWnd, IDC_MSAA), UDM_GETPOS, 0, 0); // valid from OnCommand?
|
||||
uint32 derivedDepth = GSDevice9::GetMaxDepth(requestedMsaa);
|
||||
|
||||
uint requestedMsaa= (int)SendMessage(GetDlgItem(m_hWnd, IDC_MSAA), UDM_GETPOS, 0, 0);//valid from OnCommand?
|
||||
uint derivedDepth=GSDevice9::GetMaxDepth(requestedMsaa);
|
||||
|
||||
if (derivedDepth==0){
|
||||
if(derivedDepth == 0)
|
||||
{
|
||||
//FIXME: Ugly UI: HW AA is currently a uint spinbox but usually only some values are supported (e.g. only 2/4/8 or a similar set).
|
||||
// Better solution would be to use a drop-down with only valid msaa values such that we don't need this. Maybe some day.
|
||||
// Known bad behavior: When manually deleting a HW AA value to put another instead (e.g. 2 -> delete -> 4)
|
||||
|
@ -194,27 +200,42 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code)
|
|||
// z bits than 0, even if it's not different than the previous value (i.e. 2 in our example) z bits.
|
||||
|
||||
//Find valid msaa values, regardless of derived z buffer bits
|
||||
string supportedAa="";
|
||||
for (int i=2; i<=16; i++)
|
||||
if (GSDevice9::GetMaxDepth(i)){
|
||||
if (supportedAa.length()) supportedAa+="/";
|
||||
|
||||
string supportedAa = "";
|
||||
|
||||
for(int i = 2; i <= 16; i++)
|
||||
{
|
||||
if(GSDevice9::GetMaxDepth(i))
|
||||
{
|
||||
if(supportedAa.length()) supportedAa += "/";
|
||||
|
||||
supportedAa += format("%d", i);
|
||||
}
|
||||
|
||||
if (!supportedAa.length())
|
||||
supportedAa="None";
|
||||
|
||||
string s=format("AA=%d is not supported.\nSupported AA values: %s.", (int)requestedMsaa, supportedAa.c_str());
|
||||
MessageBox(hWnd, s.c_str(),"Warning", MB_OK|MB_ICONWARNING);
|
||||
SendMessage(GetDlgItem(m_hWnd, IDC_MSAA), UDM_SETPOS, 0, requestedMsaa=m_lastValidMsaa);//revert value from inside OnCommand? is this OK?
|
||||
|
||||
} else if (derivedDepth < GSDevice9::GetMaxDepth(m_lastValidMsaa)){
|
||||
string s=format("AA=%d will force GSdx to degrade Z buffer\nfrom 32 to 24 bit, which will probably cause glitches\n(changing 'Logarithmic Z' might help some).\n\nContinue?", (int)requestedMsaa);
|
||||
//s+= format("\nlastMsaa=%d, lastDepth=%d, newMsaa=%d, newDepth=%d", (int)m_lastValidMsaa, (int)GSDevice9::GetMaxDepth(m_lastValidMsaa), (int)requestedMsaa, (int)GSDevice9::GetMaxDepth(requestedMsaa));
|
||||
if (IDOK!=MessageBox(hWnd, s.c_str(), "Warning", MB_OKCANCEL|MB_ICONWARNING))
|
||||
SendMessage(GetDlgItem(m_hWnd, IDC_MSAA), UDM_SETPOS, 0, requestedMsaa=m_lastValidMsaa);//revert value from inside OnCommand? is this OK?
|
||||
|
||||
}
|
||||
|
||||
if(!supportedAa.length())
|
||||
{
|
||||
supportedAa="None";
|
||||
}
|
||||
|
||||
string s = format("AA=%d is not supported.\nSupported AA values: %s.", (int)requestedMsaa, supportedAa.c_str());
|
||||
|
||||
MessageBox(hWnd, s.c_str(),"Warning", MB_OK | MB_ICONWARNING);
|
||||
|
||||
SendMessage(GetDlgItem(m_hWnd, IDC_MSAA), UDM_SETPOS, 0, requestedMsaa = m_lastValidMsaa); // revert value from inside OnCommand? is this OK?
|
||||
}
|
||||
else if(derivedDepth < GSDevice9::GetMaxDepth(m_lastValidMsaa))
|
||||
{
|
||||
string s = format("AA=%d will force GSdx to degrade Z buffer\nfrom 32 to 24 bit, which will probably cause glitches\n(changing 'Logarithmic Z' might help some).\n\nContinue?", (int)requestedMsaa);
|
||||
|
||||
//s+= format("\nlastMsaa=%d, lastDepth=%d, newMsaa=%d, newDepth=%d", (int)m_lastValidMsaa, (int)GSDevice9::GetMaxDepth(m_lastValidMsaa), (int)requestedMsaa, (int)GSDevice9::GetMaxDepth(requestedMsaa));
|
||||
|
||||
if(IDOK != MessageBox(hWnd, s.c_str(), "Warning", MB_OKCANCEL|MB_ICONWARNING))
|
||||
{
|
||||
SendMessage(GetDlgItem(m_hWnd, IDC_MSAA), UDM_SETPOS, 0, requestedMsaa=m_lastValidMsaa); // revert value from inside OnCommand? is this OK?
|
||||
}
|
||||
}
|
||||
|
||||
m_lastValidMsaa=requestedMsaa;
|
||||
|
||||
UpdateControls();
|
||||
|
|
|
@ -35,7 +35,7 @@ protected:
|
|||
void OnInit();
|
||||
bool OnCommand(HWND hWnd, UINT id, UINT code);
|
||||
|
||||
uint m_lastValidMsaa; //used to revert to previous dialog value if the user changed to invalid one, or lesser one and canceled
|
||||
uint32 m_lastValidMsaa; //used to revert to previous dialog value if the user changed to invalid one, or lesser one and canceled
|
||||
|
||||
public:
|
||||
GSSettingsDlg( bool isOpen2 );
|
||||
|
|
|
@ -27,15 +27,15 @@
|
|||
//#define DISABLE_DATE
|
||||
|
||||
GSState::GSState()
|
||||
: m_mt(false)
|
||||
: m_version(6)
|
||||
, m_mt(false)
|
||||
, m_irq(NULL)
|
||||
, m_regs(NULL)
|
||||
, m_crc(0)
|
||||
, m_options(0)
|
||||
, m_path3hack(0)
|
||||
, m_regs(NULL)
|
||||
, m_q(1.0f)
|
||||
, m_vprim(1)
|
||||
, m_version(6)
|
||||
, m_crc(0)
|
||||
, m_options(0)
|
||||
, m_frameskip(0)
|
||||
{
|
||||
m_sssize = 0;
|
||||
|
@ -166,11 +166,11 @@ void GSState::SetFrameSkip(int skip)
|
|||
{
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZF2] = &GSState::GIFPackedRegHandlerXYZF2;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZ2] = &GSState::GIFPackedRegHandlerXYZ2;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_CLAMP_1] = (GIFPackedRegHandler)&GSState::GIFRegHandlerCLAMP<0>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_CLAMP_2] = (GIFPackedRegHandler)&GSState::GIFRegHandlerCLAMP<1>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_CLAMP_1] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerCLAMP<0>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_CLAMP_2] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerCLAMP<1>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_FOG] = &GSState::GIFPackedRegHandlerFOG;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZF3] = (GIFPackedRegHandler)&GSState::GIFRegHandlerXYZF3;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZ3] = (GIFPackedRegHandler)&GSState::GIFRegHandlerXYZ3;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZF3] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerXYZF3;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZ3] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerXYZ3;
|
||||
|
||||
m_fpGIFRegHandlers[GIF_A_D_REG_PRIM] = &GSState::GIFRegHandlerPRIM;
|
||||
m_fpGIFRegHandlers[GIF_A_D_REG_RGBAQ] = &GSState::GIFRegHandlerRGBAQ;
|
||||
|
@ -202,28 +202,28 @@ void GSState::Reset()
|
|||
|
||||
void GSState::ResetHandlers()
|
||||
{
|
||||
for(int i = 0; i < countof(m_fpGIFPackedRegHandlers); i++)
|
||||
for(size_t i = 0; i < countof(m_fpGIFPackedRegHandlers); i++)
|
||||
{
|
||||
m_fpGIFPackedRegHandlers[i] = &GSState::GIFPackedRegHandlerNull;
|
||||
}
|
||||
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_PRIM] = (GIFPackedRegHandler)&GSState::GIFRegHandlerPRIM;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_PRIM] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerPRIM;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_RGBA] = &GSState::GIFPackedRegHandlerRGBA;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_STQ] = &GSState::GIFPackedRegHandlerSTQ;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_UV] = &GSState::GIFPackedRegHandlerUV;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZF2] = &GSState::GIFPackedRegHandlerXYZF2;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZ2] = &GSState::GIFPackedRegHandlerXYZ2;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_TEX0_1] = (GIFPackedRegHandler)&GSState::GIFRegHandlerTEX0<0>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_TEX0_2] = (GIFPackedRegHandler)&GSState::GIFRegHandlerTEX0<1>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_CLAMP_1] = (GIFPackedRegHandler)&GSState::GIFRegHandlerCLAMP<0>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_CLAMP_2] = (GIFPackedRegHandler)&GSState::GIFRegHandlerCLAMP<1>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_TEX0_1] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerTEX0<0>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_TEX0_2] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerTEX0<1>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_CLAMP_1] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerCLAMP<0>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_CLAMP_2] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerCLAMP<1>;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_FOG] = &GSState::GIFPackedRegHandlerFOG;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZF3] = (GIFPackedRegHandler)&GSState::GIFRegHandlerXYZF3;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZ3] = (GIFPackedRegHandler)&GSState::GIFRegHandlerXYZ3;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZF3] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerXYZF3;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_XYZ3] = (GIFPackedRegHandler)(GIFRegHandler)&GSState::GIFRegHandlerXYZ3;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_A_D] = &GSState::GIFPackedRegHandlerA_D;
|
||||
m_fpGIFPackedRegHandlers[GIF_REG_NOP] = &GSState::GIFPackedRegHandlerNOP;
|
||||
|
||||
for(int i = 0; i < countof(m_fpGIFRegHandlers); i++)
|
||||
for(size_t i = 0; i < countof(m_fpGIFRegHandlers); i++)
|
||||
{
|
||||
m_fpGIFRegHandlers[i] = &GSState::GIFRegHandlerNull;
|
||||
}
|
||||
|
@ -548,7 +548,7 @@ void GSState::GIFRegHandlerXYZ2(const GIFReg* r)
|
|||
VertexKick(false);
|
||||
}
|
||||
|
||||
void GSState::ApplyTEX0(uint i, GIFRegTEX0& TEX0)
|
||||
void GSState::ApplyTEX0(int i, GIFRegTEX0& TEX0)
|
||||
{
|
||||
// even if TEX0 did not change, a new palette may have been uploaded and will overwrite the currently queued for drawing
|
||||
|
||||
|
@ -586,7 +586,7 @@ template<int i> void GSState::GIFRegHandlerTEX0(const GIFReg* r)
|
|||
if(TEX0.TW > 10) TEX0.TW = 10;
|
||||
if(TEX0.TH > 10) TEX0.TH = 10;
|
||||
|
||||
ApplyTEX0( i, TEX0 );
|
||||
ApplyTEX0(i, TEX0);
|
||||
}
|
||||
|
||||
template<int i> void GSState::GIFRegHandlerCLAMP(const GIFReg* r)
|
||||
|
@ -650,7 +650,7 @@ template<int i> void GSState::GIFRegHandlerTEX2(const GIFReg* r)
|
|||
// It ignores these fields (uses existing values in the context):
|
||||
// TFX, TCC, TH, TW, TBW, and TBP0
|
||||
|
||||
uint64 mask = 0xFFFFFFE003F00000ui64; // TEX2 bits
|
||||
uint64 mask = 0xFFFFFFE003F00000ull; // TEX2 bits
|
||||
GIFRegTEX0 TEX0;
|
||||
TEX0.u64 = (m_env.CTXT[i].TEX0.u64 & ~mask) | (r->u64 & mask);
|
||||
|
||||
|
@ -1637,7 +1637,7 @@ int GSState::Freeze(GSFreezeData* fd, bool sizeonly)
|
|||
WriteState(data, &m_tr.y);
|
||||
WriteState(data, m_mem.m_vm8, m_mem.m_vmsize);
|
||||
|
||||
for(int i = 0; i < countof(m_path); i++)
|
||||
for(size_t i = 0; i < countof(m_path); i++)
|
||||
{
|
||||
m_path[i].tag.NREG = m_path[i].nreg;
|
||||
m_path[i].tag.NLOOP = m_path[i].nloop;
|
||||
|
@ -1671,7 +1671,8 @@ int GSState::Defrost(const GSFreezeData* fd)
|
|||
|
||||
if(version > m_version)
|
||||
{
|
||||
fprintf(stderr, "GSdx: Savestate version is incompatible. Load aborted.\n" );
|
||||
printf("GSdx: Savestate version is incompatible. Load aborted.\n" );
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1732,7 +1733,7 @@ int GSState::Defrost(const GSFreezeData* fd)
|
|||
|
||||
m_tr.total = 0; // TODO: restore transfer state
|
||||
|
||||
for(int i = 0; i < countof(m_path); i++)
|
||||
for(size_t i = 0; i < countof(m_path); i++)
|
||||
{
|
||||
ReadState(&m_path[i].tag, data);
|
||||
ReadState(&m_path[i].reg, data);
|
||||
|
@ -1750,7 +1751,7 @@ int GSState::Defrost(const GSFreezeData* fd)
|
|||
|
||||
m_env.UpdateDIMX();
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
for(size_t i = 0; i < 2; i++)
|
||||
{
|
||||
m_env.CTXT[i].UpdateScissor();
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ class GSState : public GSAlignedClass<32>
|
|||
|
||||
GIFRegHandler m_fpGIFRegHandlers[256];
|
||||
|
||||
void ApplyTEX0(uint i, GIFRegTEX0& TEX0);
|
||||
void ApplyTEX0(int i, GIFRegTEX0& TEX0);
|
||||
void ApplyPRIM(const GIFRegPRIM& PRIM);
|
||||
|
||||
void GIFRegHandlerNull(const GIFReg* r);
|
||||
|
@ -135,48 +135,23 @@ protected:
|
|||
VertexKickPtr m_vk[8][2][2];
|
||||
VertexKickPtr m_vkf;
|
||||
|
||||
template<class T> void InitVertexKick()
|
||||
{
|
||||
m_vk[GS_POINTLIST][0][0] = (VertexKickPtr)&T::VertexKick<GS_POINTLIST, 0, 0>;
|
||||
m_vk[GS_POINTLIST][0][1] = (VertexKickPtr)&T::VertexKick<GS_POINTLIST, 0, 0>;
|
||||
m_vk[GS_POINTLIST][1][0] = (VertexKickPtr)&T::VertexKick<GS_POINTLIST, 1, 0>;
|
||||
m_vk[GS_POINTLIST][1][1] = (VertexKickPtr)&T::VertexKick<GS_POINTLIST, 1, 1>;
|
||||
#define InitVertexKick3(T, P, N, M) \
|
||||
m_vk[P][N][M] = (VertexKickPtr)&T::VertexKick<P, N, M>;
|
||||
|
||||
m_vk[GS_LINELIST][0][0] = (VertexKickPtr)&T::VertexKick<GS_LINELIST, 0, 0>;
|
||||
m_vk[GS_LINELIST][0][1] = (VertexKickPtr)&T::VertexKick<GS_LINELIST, 0, 0>;
|
||||
m_vk[GS_LINELIST][1][0] = (VertexKickPtr)&T::VertexKick<GS_LINELIST, 1, 0>;
|
||||
m_vk[GS_LINELIST][1][1] = (VertexKickPtr)&T::VertexKick<GS_LINELIST, 1, 1>;
|
||||
#define InitVertexKick2(T, P) \
|
||||
InitVertexKick3(T, P, 0, 0) \
|
||||
InitVertexKick3(T, P, 0, 1) \
|
||||
InitVertexKick3(T, P, 1, 0) \
|
||||
InitVertexKick3(T, P, 1, 1) \
|
||||
|
||||
m_vk[GS_LINESTRIP][0][0] = (VertexKickPtr)&T::VertexKick<GS_LINESTRIP, 0, 0>;
|
||||
m_vk[GS_LINESTRIP][0][1] = (VertexKickPtr)&T::VertexKick<GS_LINESTRIP, 0, 0>;
|
||||
m_vk[GS_LINESTRIP][1][0] = (VertexKickPtr)&T::VertexKick<GS_LINESTRIP, 1, 0>;
|
||||
m_vk[GS_LINESTRIP][1][1] = (VertexKickPtr)&T::VertexKick<GS_LINESTRIP, 1, 1>;
|
||||
|
||||
m_vk[GS_TRIANGLELIST][0][0] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLELIST, 0, 0>;
|
||||
m_vk[GS_TRIANGLELIST][0][1] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLELIST, 0, 0>;
|
||||
m_vk[GS_TRIANGLELIST][1][0] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLELIST, 1, 0>;
|
||||
m_vk[GS_TRIANGLELIST][1][1] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLELIST, 1, 1>;
|
||||
|
||||
m_vk[GS_TRIANGLESTRIP][0][0] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLESTRIP, 0, 0>;
|
||||
m_vk[GS_TRIANGLESTRIP][0][1] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLESTRIP, 0, 0>;
|
||||
m_vk[GS_TRIANGLESTRIP][1][0] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLESTRIP, 1, 0>;
|
||||
m_vk[GS_TRIANGLESTRIP][1][1] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLESTRIP, 1, 1>;
|
||||
|
||||
m_vk[GS_TRIANGLEFAN][0][0] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLEFAN, 0, 0>;
|
||||
m_vk[GS_TRIANGLEFAN][0][1] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLEFAN, 0, 0>;
|
||||
m_vk[GS_TRIANGLEFAN][1][0] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLEFAN, 1, 0>;
|
||||
m_vk[GS_TRIANGLEFAN][1][1] = (VertexKickPtr)&T::VertexKick<GS_TRIANGLEFAN, 1, 1>;
|
||||
|
||||
m_vk[GS_SPRITE][0][0] = (VertexKickPtr)&T::VertexKick<GS_SPRITE, 0, 0>;
|
||||
m_vk[GS_SPRITE][0][1] = (VertexKickPtr)&T::VertexKick<GS_SPRITE, 0, 0>;
|
||||
m_vk[GS_SPRITE][1][0] = (VertexKickPtr)&T::VertexKick<GS_SPRITE, 1, 0>;
|
||||
m_vk[GS_SPRITE][1][1] = (VertexKickPtr)&T::VertexKick<GS_SPRITE, 1, 1>;
|
||||
|
||||
m_vk[GS_INVALID][0][0] = &GSState::VertexKickNull;
|
||||
m_vk[GS_INVALID][0][1] = &GSState::VertexKickNull;
|
||||
m_vk[GS_INVALID][1][0] = &GSState::VertexKickNull;
|
||||
m_vk[GS_INVALID][1][1] = &GSState::VertexKickNull;
|
||||
}
|
||||
#define InitVertexKick(T) \
|
||||
InitVertexKick2(T, GS_POINTLIST) \
|
||||
InitVertexKick2(T, GS_LINELIST) \
|
||||
InitVertexKick2(T, GS_LINESTRIP) \
|
||||
InitVertexKick2(T, GS_TRIANGLELIST) \
|
||||
InitVertexKick2(T, GS_TRIANGLEFAN) \
|
||||
InitVertexKick2(T, GS_SPRITE) \
|
||||
InitVertexKick2(T, GS_INVALID) \
|
||||
|
||||
void UpdateVertexKick()
|
||||
{
|
||||
|
|
|
@ -41,8 +41,9 @@ extern const uint8 clutTableT16I4[16];
|
|||
struct D3D9Blend
|
||||
{
|
||||
int bogus;
|
||||
D3DBLENDOP op;
|
||||
D3DBLEND src, dst;
|
||||
int op;
|
||||
int src;
|
||||
int dst;
|
||||
};
|
||||
|
||||
extern const D3D9Blend blendMapD3D9[3*3*3*3];
|
||||
|
|
|
@ -174,9 +174,12 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
|
|||
if(m_renderer->CanUpscale())
|
||||
{
|
||||
int multiplier = m_renderer->upscale_Multiplier();
|
||||
|
||||
if (multiplier > 1) //it's limited to a maximum of 4 on reading the config
|
||||
{
|
||||
|
||||
#if 0 //#ifdef USE_UPSCALE_HACKS //not happy with this yet..
|
||||
|
||||
float x = 1.0f;
|
||||
float y = 1.0f;
|
||||
|
||||
|
@ -187,14 +190,14 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
|
|||
case 4: x = 3.875f; y = 3.875f; break; // not helping much
|
||||
default: __assume(0);
|
||||
}
|
||||
dst->m_texture->SetScale( GSVector2(x, y) );
|
||||
|
||||
dst->m_texture->SetScale(GSVector2::_(x, y));
|
||||
#else
|
||||
dst->m_texture->SetScale( GSVector2((float)multiplier, (float)multiplier) );
|
||||
dst->m_texture->SetScale(GSVector2((float)multiplier, (float)multiplier));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
GSVector4i fr = m_renderer->GetFrameRect();
|
||||
|
||||
int ww = (int)(fr.left + m_renderer->GetDisplayRect().width());
|
||||
|
@ -205,7 +208,8 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
|
|||
hh *= 2;
|
||||
}
|
||||
|
||||
//This vp2 fix doesn't work most of the time
|
||||
// This vp2 fix doesn't work most of the time
|
||||
|
||||
if(hh < 512 && m_renderer->m_context->SCISSOR.SCAY1 == 511) // vp2
|
||||
{
|
||||
hh = 512;
|
||||
|
|
|
@ -357,17 +357,29 @@ void GSDevice11::SetupOM(OMDepthStencilSelector dssel, OMBlendSelector bsel, uin
|
|||
|
||||
// SRC* -> SRC1*
|
||||
// Yes, this casting mess really is needed. I want to go back to C
|
||||
if (bd.RenderTarget[0].SrcBlend >= 3 && bd.RenderTarget[0].SrcBlend <= 6)
|
||||
|
||||
if(bd.RenderTarget[0].SrcBlend >= 3 && bd.RenderTarget[0].SrcBlend <= 6)
|
||||
{
|
||||
bd.RenderTarget[0].SrcBlend = (D3D11_BLEND)((int)bd.RenderTarget[0].SrcBlend + 13);
|
||||
if (bd.RenderTarget[0].DestBlend >= 3 && bd.RenderTarget[0].DestBlend <= 6)
|
||||
}
|
||||
|
||||
if(bd.RenderTarget[0].DestBlend >= 3 && bd.RenderTarget[0].DestBlend <= 6)
|
||||
{
|
||||
bd.RenderTarget[0].DestBlend = (D3D11_BLEND)((int)bd.RenderTarget[0].DestBlend + 13);
|
||||
}
|
||||
|
||||
// Not very good but I don't wanna write another 81 row table
|
||||
if (bsel.negative) {
|
||||
if (bd.RenderTarget[0].BlendOp == D3D11_BLEND_OP_ADD)
|
||||
|
||||
if(bsel.negative)
|
||||
{
|
||||
if(bd.RenderTarget[0].BlendOp == D3D11_BLEND_OP_ADD)
|
||||
{
|
||||
bd.RenderTarget[0].BlendOp = D3D11_BLEND_OP_REV_SUBTRACT;
|
||||
else if (bd.RenderTarget[0].BlendOp == D3D11_BLEND_OP_REV_SUBTRACT)
|
||||
}
|
||||
else if(bd.RenderTarget[0].BlendOp == D3D11_BLEND_OP_REV_SUBTRACT)
|
||||
{
|
||||
bd.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
|
||||
}
|
||||
else
|
||||
; // god knows, best just not to mess with it for now
|
||||
}
|
||||
|
|
|
@ -284,19 +284,25 @@ void GSDevice9::SetupOM(OMDepthStencilSelector dssel, OMBlendSelector bsel, uint
|
|||
{
|
||||
int i = ((bsel.a * 3 + bsel.b) * 3 + bsel.c) * 3 + bsel.d;
|
||||
|
||||
bs->BlendOp = blendMapD3D9[i].op;
|
||||
bs->SrcBlend = blendMapD3D9[i].src;
|
||||
bs->DestBlend = blendMapD3D9[i].dst;
|
||||
bs->BlendOp = (D3DBLENDOP)blendMapD3D9[i].op;
|
||||
bs->SrcBlend = (D3DBLEND)blendMapD3D9[i].src;
|
||||
bs->DestBlend = (D3DBLEND)blendMapD3D9[i].dst;
|
||||
bs->BlendOpAlpha = D3DBLENDOP_ADD;
|
||||
bs->SrcBlendAlpha = D3DBLEND_ONE;
|
||||
bs->DestBlendAlpha = D3DBLEND_ZERO;
|
||||
|
||||
// Not very good but I don't wanna write another 81 row table
|
||||
if (bsel.negative) {
|
||||
if (bs->BlendOp == D3DBLENDOP_ADD)
|
||||
|
||||
if(bsel.negative)
|
||||
{
|
||||
if(bs->BlendOp == D3DBLENDOP_ADD)
|
||||
{
|
||||
bs->BlendOp = D3DBLENDOP_REVSUBTRACT;
|
||||
else if (bs->BlendOp == D3DBLENDOP_REVSUBTRACT)
|
||||
}
|
||||
else if(bs->BlendOp == D3DBLENDOP_REVSUBTRACT)
|
||||
{
|
||||
bs->BlendOp = D3DBLENDOP_ADD;
|
||||
}
|
||||
else
|
||||
; // god knows, best just not to mess with it for now
|
||||
}
|
||||
|
@ -308,12 +314,13 @@ void GSDevice9::SetupOM(OMDepthStencilSelector dssel, OMBlendSelector bsel, uint
|
|||
const string afixstr = format("%d >> 7", afix);
|
||||
const char *col[3] = {"Cs", "Cd", "0"};
|
||||
const char *alpha[3] = {"As", "Ad", afixstr.c_str()};
|
||||
printf("Impossible blend for D3D: (%s - %s) * %s + %s\n",
|
||||
col[bsel.a], col[bsel.b], alpha[bsel.c], col[bsel.d]);
|
||||
|
||||
printf("Impossible blend for D3D: (%s - %s) * %s + %s\n", col[bsel.a], col[bsel.b], alpha[bsel.c], col[bsel.d]);
|
||||
}
|
||||
}
|
||||
|
||||
// this is not a typo; dx9 uses BGRA rather than the gs native RGBA, unlike dx10
|
||||
|
||||
if(bsel.wr) bs->RenderTargetWriteMask |= D3DCOLORWRITEENABLE_BLUE;
|
||||
if(bsel.wg) bs->RenderTargetWriteMask |= D3DCOLORWRITEENABLE_GREEN;
|
||||
if(bsel.wb) bs->RenderTargetWriteMask |= D3DCOLORWRITEENABLE_RED;
|
||||
|
|
|
@ -25,13 +25,14 @@
|
|||
#include "svnrev.h"
|
||||
#include "xbyak/xbyak_util.h"
|
||||
|
||||
static struct GSUtilMaps
|
||||
static class GSUtilMaps
|
||||
{
|
||||
public:
|
||||
uint8 PrimClassField[8];
|
||||
uint32 CompatibleBitsField[64][2];
|
||||
uint32 SharedBitsField[64][2];
|
||||
|
||||
struct GSUtilMaps()
|
||||
GSUtilMaps()
|
||||
{
|
||||
PrimClassField[GS_POINTLIST] = GS_POINT_CLASS;
|
||||
PrimClassField[GS_LINELIST] = GS_LINE_CLASS;
|
||||
|
@ -167,7 +168,9 @@ bool GSUtil::CheckSSE()
|
|||
Xbyak::util::Cpu cpu;
|
||||
Xbyak::util::Cpu::Type type;
|
||||
|
||||
#if _M_SSE >= 0x402
|
||||
#if _M_SSE >= 0x500
|
||||
type = Xbyak::util::Cpu::tAVX;
|
||||
#elif _M_SSE >= 0x402
|
||||
type = Xbyak::util::Cpu::tSSE42;
|
||||
#elif _M_SSE >= 0x401
|
||||
type = Xbyak::util::Cpu::tSSE41;
|
||||
|
@ -217,7 +220,9 @@ char* GSUtil::GetLibName()
|
|||
sl.push_back(format("MSVC %d.%02d", _MSC_VER / 100, _MSC_VER % 100));
|
||||
#endif
|
||||
|
||||
#if _M_SSE >= 0x402
|
||||
#if _M_SSE >= 0x500
|
||||
sl.push_back("AVX");
|
||||
#elif _M_SSE >= 0x402
|
||||
sl.push_back("SSE42");
|
||||
#elif _M_SSE >= 0x401
|
||||
sl.push_back("SSE41");
|
||||
|
|
|
@ -43,7 +43,7 @@ typedef GSVector2T<int> GSVector2i;
|
|||
|
||||
class GSVector4;
|
||||
|
||||
__aligned16 class GSVector4i
|
||||
__aligned(class, 16) GSVector4i
|
||||
{
|
||||
public:
|
||||
union
|
||||
|
@ -734,12 +734,7 @@ public:
|
|||
|
||||
template<int i> __forceinline GSVector4i srl() const
|
||||
{
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4556)
|
||||
|
||||
return GSVector4i(_mm_srli_si128(m, i));
|
||||
|
||||
#pragma warning(pop)
|
||||
}
|
||||
|
||||
template<int i> __forceinline GSVector4i srl(const GSVector4i& v)
|
||||
|
@ -761,12 +756,7 @@ public:
|
|||
|
||||
template<int i> __forceinline GSVector4i sll() const
|
||||
{
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4556)
|
||||
|
||||
return GSVector4i(_mm_slli_si128(m, i));
|
||||
|
||||
#pragma warning(pop)
|
||||
}
|
||||
|
||||
__forceinline GSVector4i sra16(int i) const
|
||||
|
@ -2253,7 +2243,7 @@ public:
|
|||
__forceinline static GSVector4i xfffe(const GSVector4i& v) {return xffffffff(v).sll16( 1);}
|
||||
};
|
||||
|
||||
__aligned16 class GSVector4
|
||||
__aligned(class, 16) GSVector4
|
||||
{
|
||||
public:
|
||||
union
|
||||
|
@ -2633,7 +2623,7 @@ public:
|
|||
|
||||
template<bool aligned> __forceinline static GSVector4 load(const void* p)
|
||||
{
|
||||
return GSVector4(aligned ? _mm_load_ps((__m128*)p) : _mm_loadu_ps((__m128*)p));
|
||||
return GSVector4(aligned ? _mm_load_ps((const float*)p) : _mm_loadu_ps((const float*)p));
|
||||
}
|
||||
|
||||
__forceinline static void storel(void* p, const GSVector4& v)
|
||||
|
@ -2643,8 +2633,8 @@ public:
|
|||
|
||||
template<bool aligned> __forceinline static void store(void* p, const GSVector4& v)
|
||||
{
|
||||
if(aligned) _mm_store_ps((__m128*)p, v.m);
|
||||
else _mm_storeu_ps((__m128*)p, v.m);
|
||||
if(aligned) _mm_store_ps((float*)p, v.m);
|
||||
else _mm_storeu_ps((float*)p, v.m);
|
||||
}
|
||||
|
||||
__forceinline static void expand(const GSVector4i& v, GSVector4& a, GSVector4& b, GSVector4& c, GSVector4& d)
|
||||
|
@ -2902,7 +2892,7 @@ __forceinline GSVector4 GSVector4::cast(const GSVector4i& v)
|
|||
|
||||
class GSVector8;
|
||||
|
||||
__aligned32 class GSVector8i
|
||||
__aligned(class, 32) GSVector8i
|
||||
{
|
||||
public:
|
||||
union
|
||||
|
@ -3016,7 +3006,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
__aligned32 class GSVector8
|
||||
__aligned(class, 32) GSVector8
|
||||
{
|
||||
public:
|
||||
union
|
||||
|
|
|
@ -28,22 +28,12 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned32 struct GSVertex
|
||||
__aligned(struct, 32) GSVertex
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
GIFRegST ST;
|
||||
GIFRegRGBAQ RGBAQ;
|
||||
GIFRegXYZ XYZ;
|
||||
GIFRegFOG FOG;
|
||||
};
|
||||
|
||||
struct {GSVector4i vi[2];};
|
||||
struct {GSVector4 vf[2];};
|
||||
};
|
||||
|
||||
GIFRegUV UV;
|
||||
|
||||
GSVertex() {memset(this, 0, sizeof(*this));}
|
||||
|
|
|
@ -26,37 +26,28 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned32 union GSVertexHW9
|
||||
__aligned(struct, 32) GSVertexHW9
|
||||
{
|
||||
struct
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
GSVector4 t;
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 _pad[2];
|
||||
union {struct {uint8 r, g, b, a;}; uint32 c0;};
|
||||
union {struct {uint8 ta0, ta1, res, f;}; uint32 c1;};
|
||||
};
|
||||
};
|
||||
|
||||
GSVector4 p;
|
||||
};
|
||||
|
||||
struct {GSVector4i vi[2];};
|
||||
struct {GSVector4 vf[2];};
|
||||
// t.z = union {struct {uint8 r, g, b, a;}; uint32 c0;};
|
||||
// t.w = union {struct {uint8 ta0, ta1, res, f;}; uint32 c1;}
|
||||
|
||||
GSVertexHW9& operator = (GSVertexHW9& v) {vi[0] = v.vi[0]; vi[1] = v.vi[1]; return *this;}
|
||||
GSVertexHW9& operator = (GSVertexHW9& v) {t = v.t; p = v.p; return *this;}
|
||||
|
||||
float GetQ() {return p.w;}
|
||||
float& _q() {return p.w;}
|
||||
|
||||
uint8& _r() {return t.u8[8];}
|
||||
uint8& _g() {return t.u8[9];}
|
||||
uint8& _b() {return t.u8[10];}
|
||||
uint8& _a() {return t.u8[11];}
|
||||
|
||||
uint32& _c0() {return t.u32[2];}
|
||||
uint32& _c1() {return t.u32[3];}
|
||||
};
|
||||
|
||||
__aligned32 union GSVertexHW11
|
||||
__aligned(union, 32) GSVertexHW11
|
||||
{
|
||||
struct
|
||||
{
|
||||
|
@ -85,12 +76,26 @@ __aligned32 union GSVertexHW11
|
|||
};
|
||||
};
|
||||
|
||||
struct {GSVector4i vi[2];};
|
||||
struct {GSVector4 vf[2];};
|
||||
GSVertexHW11& operator = (GSVertexHW11& v)
|
||||
{
|
||||
GSVector4i* RESTRICT src = (GSVector4i*)&v;
|
||||
GSVector4i* RESTRICT dst = (GSVector4i*)this;
|
||||
|
||||
GSVertexHW11& operator = (GSVertexHW11& v) {vi[0] = v.vi[0]; vi[1] = v.vi[1]; return *this;}
|
||||
dst[0] = src[0];
|
||||
dst[1] = src[1];
|
||||
|
||||
float GetQ() {return q;}
|
||||
return *this;
|
||||
}
|
||||
|
||||
float& _q() {return q;}
|
||||
|
||||
uint8& _r() {return r;}
|
||||
uint8& _g() {return g;}
|
||||
uint8& _b() {return b;}
|
||||
uint8& _a() {return a;}
|
||||
|
||||
uint32& _c0() {return c0;}
|
||||
uint32& _c1() {return c1;}
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
|
|
@ -19,7 +19,5 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "GSVertexSW.h"
|
||||
|
|
|
@ -23,15 +23,9 @@
|
|||
|
||||
#include "GSVector.h"
|
||||
|
||||
__aligned32 union GSVertexSW
|
||||
__aligned(struct, 32) GSVertexSW
|
||||
{
|
||||
struct {GSVector4 c, p, t;};
|
||||
struct {GSVector4 v[3];};
|
||||
struct {float f[12];};
|
||||
|
||||
#if _M_SSE >= 0x500
|
||||
struct {GSVector8 cp, t_;};
|
||||
#endif
|
||||
GSVector4 c, p, t;
|
||||
|
||||
GSVertexSW() {}
|
||||
GSVertexSW(const GSVertexSW& v) {*this = v;}
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "GSVertexTrace.h"
|
||||
#include "GSUtil.h"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
class GSState;
|
||||
|
||||
__aligned32 class GSVertexTrace
|
||||
__aligned(class, 32) GSVertexTrace
|
||||
{
|
||||
struct Vertex {GSVector4i c; GSVector4 p, t;};
|
||||
struct VertexAlpha {int min, max; bool valid;};
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include "GSdx.h"
|
||||
#include "GSWnd.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
|
||||
GSWnd::GSWnd()
|
||||
: m_hWnd(NULL)
|
||||
, m_IsManaged(true)
|
||||
|
@ -159,6 +161,7 @@ void GSWnd::Detach()
|
|||
// that means its big, ugly, and in the way.
|
||||
DestroyWindow(m_hWnd);
|
||||
}
|
||||
|
||||
m_hWnd = NULL;
|
||||
m_IsManaged = true;
|
||||
}
|
||||
|
@ -177,7 +180,7 @@ GSVector4i GSWnd::GetClientRect()
|
|||
|
||||
bool GSWnd::SetWindowText(const char* title)
|
||||
{
|
||||
if( !m_IsManaged ) return false;
|
||||
if(!m_IsManaged) return false;
|
||||
|
||||
::SetWindowText(m_hWnd, title);
|
||||
|
||||
|
@ -186,7 +189,7 @@ bool GSWnd::SetWindowText(const char* title)
|
|||
|
||||
void GSWnd::Show()
|
||||
{
|
||||
if( !m_IsManaged ) return;
|
||||
if(!m_IsManaged) return;
|
||||
|
||||
//SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
|
||||
|
||||
|
@ -199,14 +202,14 @@ void GSWnd::Show()
|
|||
|
||||
void GSWnd::Hide()
|
||||
{
|
||||
if( !m_IsManaged ) return;
|
||||
if(!m_IsManaged) return;
|
||||
|
||||
ShowWindow(m_hWnd, SW_HIDE);
|
||||
}
|
||||
|
||||
void GSWnd::HideFrame()
|
||||
{
|
||||
if( !m_IsManaged ) return;
|
||||
if(!m_IsManaged) return;
|
||||
|
||||
SetWindowLong(m_hWnd, GWL_STYLE, GetWindowLong(m_hWnd, GWL_STYLE) & ~(WS_CAPTION|WS_THICKFRAME));
|
||||
|
||||
|
@ -216,3 +219,5 @@ void GSWnd::HideFrame()
|
|||
|
||||
m_HasFrame = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -25,10 +25,11 @@
|
|||
|
||||
class GSWnd
|
||||
{
|
||||
HWND m_hWnd;
|
||||
bool m_IsManaged; // set true when we're attached to a 3rdparty window that's amanged by the emulator
|
||||
bool m_HasFrame;
|
||||
|
||||
HWND m_hWnd;
|
||||
|
||||
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
virtual LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
|
@ -37,11 +38,11 @@ public:
|
|||
virtual ~GSWnd();
|
||||
|
||||
bool Create(const string& title, int w, int h);
|
||||
bool Attach(HWND hWnd, bool isManaged=true);
|
||||
bool Attach(HWND hWnd, bool isManaged = true);
|
||||
void Detach();
|
||||
bool IsManaged() const { return m_IsManaged; }
|
||||
|
||||
void* GetHandle() {return m_hWnd;}
|
||||
HWND GetHandle() {return m_hWnd;}
|
||||
|
||||
GSVector4i GetClientRect();
|
||||
|
||||
|
|
|
@ -85,24 +85,12 @@
|
|||
<Unit filename="GSCrc.h" />
|
||||
<Unit filename="GSDevice.cpp" />
|
||||
<Unit filename="GSDevice.h" />
|
||||
<Unit filename="GSDevice10.cpp">
|
||||
<Option compile="0" />
|
||||
<Option link="0" />
|
||||
<Option target="<{~None~}>" />
|
||||
</Unit>
|
||||
<Unit filename="GSDevice10.h" />
|
||||
<Unit filename="GSDevice11.cpp">
|
||||
<Option compile="0" />
|
||||
<Option link="0" />
|
||||
<Option target="<{~None~}>" />
|
||||
</Unit>
|
||||
<Unit filename="GSDevice11.h" />
|
||||
<Unit filename="GSDevice7.cpp">
|
||||
<Option compile="0" />
|
||||
<Option link="0" />
|
||||
<Option target="<{~None~}>" />
|
||||
</Unit>
|
||||
<Unit filename="GSDevice7.h" />
|
||||
<Unit filename="GSDevice9.cpp">
|
||||
<Option compile="0" />
|
||||
<Option link="0" />
|
||||
|
@ -112,8 +100,6 @@
|
|||
<Unit filename="GSDeviceDX.h" />
|
||||
<Unit filename="GSDeviceNull.cpp" />
|
||||
<Unit filename="GSDeviceNull.h" />
|
||||
<Unit filename="GSDeviceOGL.cpp" />
|
||||
<Unit filename="GSDeviceOGL.h" />
|
||||
<Unit filename="GSDialog.cpp" />
|
||||
<Unit filename="GSDialog.h" />
|
||||
<Unit filename="GSDirtyRect.cpp" />
|
||||
|
@ -138,8 +124,6 @@
|
|||
<Unit filename="GSRenderer.h" />
|
||||
<Unit filename="GSRendererDX.cpp" />
|
||||
<Unit filename="GSRendererDX.h" />
|
||||
<Unit filename="GSRendererDX10.cpp" />
|
||||
<Unit filename="GSRendererDX10.h" />
|
||||
<Unit filename="GSRendererDX11.cpp" />
|
||||
<Unit filename="GSRendererDX11.h" />
|
||||
<Unit filename="GSRendererDX9.cpp" />
|
||||
|
@ -148,8 +132,6 @@
|
|||
<Unit filename="GSRendererHW.h" />
|
||||
<Unit filename="GSRendererNull.cpp" />
|
||||
<Unit filename="GSRendererNull.h" />
|
||||
<Unit filename="GSRendererOGL.cpp" />
|
||||
<Unit filename="GSRendererOGL.h" />
|
||||
<Unit filename="GSRendererSW.cpp" />
|
||||
<Unit filename="GSRendererSW.h" />
|
||||
<Unit filename="GSScanlineEnvironment.h" />
|
||||
|
@ -165,11 +147,9 @@
|
|||
<Unit filename="GSTables.h" />
|
||||
<Unit filename="GSTexture.cpp" />
|
||||
<Unit filename="GSTexture.h" />
|
||||
<Unit filename="GSTexture10.cpp" />
|
||||
<Unit filename="GSTexture10.h" />
|
||||
<Unit filename="GSTexture11.cpp" />
|
||||
<Unit filename="GSTexture11.h" />
|
||||
<Unit filename="GSTexture7.cpp" />
|
||||
<Unit filename="GSTexture7.h" />
|
||||
<Unit filename="GSTexture9.cpp" />
|
||||
<Unit filename="GSTexture9.h" />
|
||||
|
@ -181,18 +161,13 @@
|
|||
<Unit filename="GSTextureCache11.h" />
|
||||
<Unit filename="GSTextureCache9.cpp" />
|
||||
<Unit filename="GSTextureCache9.h" />
|
||||
<Unit filename="GSTextureCacheOGL.cpp" />
|
||||
<Unit filename="GSTextureCacheOGL.h" />
|
||||
<Unit filename="GSTextureCacheSW.cpp" />
|
||||
<Unit filename="GSTextureCacheSW.h" />
|
||||
<Unit filename="GSTextureFX.cpp" />
|
||||
<Unit filename="GSTextureFX10.cpp" />
|
||||
<Unit filename="GSTextureFX11.cpp" />
|
||||
<Unit filename="GSTextureFX9.cpp" />
|
||||
<Unit filename="GSTextureNull.cpp" />
|
||||
<Unit filename="GSTextureNull.h" />
|
||||
<Unit filename="GSTextureOGL.cpp" />
|
||||
<Unit filename="GSTextureOGL.h" />
|
||||
<Unit filename="GSThread.cpp" />
|
||||
<Unit filename="GSThread.h" />
|
||||
<Unit filename="GSUtil.cpp" />
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
#ifdef _WINDOWS
|
||||
HMODULE GetModuleHandle();
|
||||
#else
|
||||
void *GetModuleHandle();
|
||||
void* GetModuleHandle();
|
||||
#endif
|
||||
|
||||
string GetConfig(const char* entry, const char* value);
|
||||
|
|
|
@ -37,3 +37,25 @@ string format(const char* fmt, ...)
|
|||
|
||||
return s;
|
||||
}
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(HAVE_ALIGNED_MALLOC)
|
||||
|
||||
// declare linux equivalents (alignment must be power of 2 (1,2,4...2^15)
|
||||
|
||||
void* pcsx2_aligned_malloc(size_t size, size_t alignment)
|
||||
{
|
||||
assert(alignment <= 0x8000);
|
||||
uptr r = (uptr)malloc(size + --alignment + 2);
|
||||
uptr o = (r + 2 + alignment) & ~(uptr)alignment;
|
||||
if (!r) return NULL;
|
||||
((u16*)o)[-1] = (u16)(o-r);
|
||||
return (void*)o;
|
||||
}
|
||||
|
||||
void pcsx2_aligned_free(void* p)
|
||||
{
|
||||
if (!p) return;
|
||||
free((void*)((uptr)p-((u16*)p)[-1]));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#pragma warning(disable: 4996 4995 4324 4100 4101 4201)
|
||||
|
||||
#ifdef _WINDOWS
|
||||
|
||||
// The following macros define the minimum required platform. The minimum required platform
|
||||
|
@ -44,6 +42,7 @@
|
|||
|
||||
// stdc
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
|
@ -52,18 +51,53 @@
|
|||
#include <vector>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <hash_map>
|
||||
#include <hash_set>
|
||||
#include <algorithm>
|
||||
|
||||
// Let's take advantage of the work that's already been done on making things cross-platform by bringing this in.
|
||||
|
||||
#include "Pcsx2Defs.h"
|
||||
//#include "Pcsx2Defs.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#define __aligned(t, n) __declspec(align(n)) t
|
||||
|
||||
#else
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// GCC / Intel Compilers Section
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
#define __aligned(t, n) t __attribute__((aligned(n)))
|
||||
#define __assume(cond) ((void)0) // GCC has no equivalent for __assume
|
||||
|
||||
// Inlining note: GCC needs ((unused)) attributes defined on inlined functions to suppress
|
||||
// warnings when a static inlined function isn't used in the scope of a single file (which
|
||||
// happens *by design* like all the friggen time >_<)
|
||||
|
||||
//# define __fastcall __attribute__((fastcall))
|
||||
# ifdef NDEBUG
|
||||
# define __forceinline __attribute__((always_inline,unused))
|
||||
# else
|
||||
# define __forceinline __attribute__((unused))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#include <hash_map>
|
||||
#include <hash_set>
|
||||
|
||||
using namespace stdext;
|
||||
|
||||
#else
|
||||
|
||||
#include <ext/hash_map>
|
||||
#include <ext/hash_set>
|
||||
|
||||
using namespace __gnu_cxx;
|
||||
|
||||
#endif
|
||||
|
||||
extern string format(const char* fmt, ...);
|
||||
|
@ -93,7 +127,7 @@ typedef signed long long int64;
|
|||
#define EXPORT_C extern "C" __declspec(dllexport) void __stdcall
|
||||
#define EXPORT_C_(type) extern "C" __declspec(dllexport) type __stdcall
|
||||
|
||||
#define ALIGN_STACK(n) __aligned(n) int __dummy;
|
||||
#define ALIGN_STACK(n) __aligned(int, n) __dummy;
|
||||
|
||||
#ifndef RESTRICT
|
||||
#ifdef __INTEL_COMPILER
|
||||
|
@ -154,7 +188,7 @@ typedef signed long long int64;
|
|||
|
||||
#define MXCSR (_MM_DENORMALS_ARE_ZERO | _MM_MASK_MASK | _MM_ROUND_NEAREST | _MM_FLUSH_ZERO_ON)
|
||||
|
||||
#if _MSC_VER < 1500
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1500
|
||||
|
||||
__forceinline __m128i _mm_castps_si128(__m128 a) {return *(__m128i*)&a;}
|
||||
__forceinline __m128 _mm_castsi128_ps(__m128i a) {return *(__m128*)&a;}
|
||||
|
@ -203,3 +237,10 @@ typedef signed long long int64;
|
|||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(HAVE_ALIGNED_MALLOC)
|
||||
|
||||
extern void* _aligned_malloc(size_t size, size_t alignment);
|
||||
extern void _aligned_free(void* p);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4995;4324;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings>4996;4995;4324;4100;4101;4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(DXSDK_DIR)include</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
utility class and functions for Xbyak
|
||||
@note this header is UNDER CONSTRUCTION!
|
||||
*/
|
||||
#include "xbyak/xbyak.h"
|
||||
#include "xbyak.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#if (_MSC_VER < 1400) && defined(XBYAK32)
|
||||
|
|
Loading…
Reference in New Issue