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:
gabest11
2011-02-18 01:56:05 +00:00
parent 85899961be
commit d44def8c0b
49 changed files with 390 additions and 347 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
#pragma pack(push, 1)
__aligned32 class GPUDrawingEnvironment
__aligned(class, 32) GPUDrawingEnvironment
{
public:
GPURegSTATUS STATUS;
-2
View File
@@ -82,5 +82,3 @@ public:
void SaveBMP(const string& path, const GSVector4i& r, int tp, int cx, int cy);
};
#pragma warning(default: 4244)
+2 -2
View File
@@ -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;
+8 -6
View File
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2007-2009 Gabest
* http://www.gabest.org
*
@@ -6,15 +6,15 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
@@ -90,7 +90,7 @@ protected:
void Dump(const string& s, uint32 TP, const GSVector4i& r, int inc = true)
{
//if(m_perfmon.GetFrame() < 1000)
//if(m_perfmon.GetFrame() < 1000)
//if((m_env.TWIN.u32 & 0xfffff) == 0)
//if(!m_env.STATUS.ME && !m_env.STATUS.MD)
return;
@@ -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)
+1 -1
View File
@@ -26,7 +26,7 @@
#pragma pack(push, 1)
__aligned32 struct GPUVertex
__aligned(struct, 32) GPUVertex
{
union
{
+1 -1
View File
@@ -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
{
+2 -2
View File
@@ -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;
+7 -7
View File
@@ -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);
+3 -3
View File
@@ -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;
+6 -4
View File
@@ -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)
+1 -1
View File
@@ -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;
+4 -4
View File
@@ -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;
}
+1 -1
View File
@@ -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();
};
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -25,7 +25,7 @@
#pragma pack(push, 1)
__aligned32 class GSDrawingEnvironment
__aligned(class, 32) GSDrawingEnvironment
{
public:
GIFRegPRIM PRIM;
+10 -10
View File
@@ -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;
+19 -28
View File
@@ -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,31 +70,25 @@ 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
__aligned(struct, 128) psm_t
{
struct
{
pixelAddress pa, bn;
readPixel rp;
readPixelAddr rpa;
writePixel wp;
writePixelAddr wpa;
readTexel rt;
readTexelAddr rta;
writeFrameAddr wfa;
writeImage wi;
readImage ri;
readTexture rtx, rtxP;
readTextureBlock rtxb, rtxbP;
uint16 bpp, trbpp, pal, fmt;
GSVector2i bs, pgs;
int* rowOffset[8];
short* blockOffset;
};
uint8 dummy[128];
} psm_t;
pixelAddress pa, bn;
readPixel rp;
readPixelAddr rpa;
writePixel wp;
writePixelAddr wpa;
readTexel rt;
readTexelAddr rta;
writeFrameAddr wfa;
writeImage wi;
readImage ri;
readTexture rtx, rtxP;
readTextureBlock rtxb, rtxbP;
uint16 bpp, trbpp, pal, fmt;
GSVector2i bs, pgs;
int* rowOffset[8];
short* blockOffset;
};
static psm_t m_psm[64];
@@ -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)
+1 -1
View File
@@ -27,7 +27,7 @@
#include "GSThread.h"
#include "GSAlignedClass.h"
__aligned32 class GSRasterizerData
__aligned(class, 32) GSRasterizerData
{
public:
GSVector4i scissor;
+3 -4
View File
@@ -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;

Some files were not shown because too many files have changed in this diff Show More