From d870188d21801d2deaa93522f0a53cc70e72ed88 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 15 May 2015 20:40:09 +0200 Subject: [PATCH] gsdx: sed/o/off/ --- plugins/GSdx/GS.cpp | 6 +- plugins/GSdx/GSClut.cpp | 18 +-- .../GSDrawScanlineCodeGenerator.x64.avx.cpp | 6 +- .../GSDrawScanlineCodeGenerator.x86.avx.cpp | 6 +- .../GSDrawScanlineCodeGenerator.x86.avx2.cpp | 6 +- .../GSdx/GSDrawScanlineCodeGenerator.x86.cpp | 6 +- plugins/GSdx/GSLocalMemory.cpp | 114 +++++++++--------- plugins/GSdx/GSLocalMemory.h | 56 ++++----- plugins/GSdx/GSRenderer.cpp | 8 +- plugins/GSdx/GSRendererCL.cpp | 20 +-- plugins/GSdx/GSRendererCS.cpp | 26 ++-- plugins/GSdx/GSRendererCS.h | 4 +- plugins/GSdx/GSRendererDX.cpp | 6 +- plugins/GSdx/GSRendererDX9.cpp | 6 +- plugins/GSdx/GSRendererOGL.cpp | 8 +- plugins/GSdx/GSRendererSW.cpp | 16 +-- plugins/GSdx/GSState.cpp | 6 +- plugins/GSdx/GSTextureCache.cpp | 56 ++++----- plugins/GSdx/GSTextureCache.h | 6 +- plugins/GSdx/GSTextureCache11.cpp | 8 +- plugins/GSdx/GSTextureCache9.cpp | 8 +- plugins/GSdx/GSTextureCacheOGL.cpp | 8 +- plugins/GSdx/GSTextureCacheSW.cpp | 10 +- plugins/GSdx/GSVertexTrace.cpp | 6 +- plugins/GSdx/stdafx.cpp | 6 +- 25 files changed, 213 insertions(+), 213 deletions(-) diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index d949868f3d..df768b8c47 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -1342,13 +1342,13 @@ EXPORT_C GSBenchmark(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow printf("%6d %6d | ", (int)((float)trlen * n / (end - start) / 1000), (int)((float)(w * h) * n / (end - start) / 1000)); - const GSOffset* o = mem->GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); + const GSOffset* off = mem->GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); start = clock(); for(int j = 0; j < n; j++) { - (mem->*rtx)(o, r, ptr, w * 4, TEXA); + (mem->*rtx)(off, r, ptr, w * 4, TEXA); } end = clock(); @@ -1361,7 +1361,7 @@ EXPORT_C GSBenchmark(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow for(int j = 0; j < n; j++) { - (mem->*rtxP)(o, r, ptr, w, TEXA); + (mem->*rtxP)(off, r, ptr, w, TEXA); } end = clock(); diff --git a/plugins/GSdx/GSClut.cpp b/plugins/GSdx/GSClut.cpp index 01c3cda8fb..14d414b1fa 100644 --- a/plugins/GSdx/GSClut.cpp +++ b/plugins/GSdx/GSClut.cpp @@ -185,10 +185,10 @@ void GSClut::WriteCLUT16S_I4_CSM1(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& T template void GSClut::WriteCLUT32_CSM2(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) { - GSOffset* o = m_mem->GetOffset(TEX0.CBP, TEXCLUT.CBW, PSM_PSMCT32); + GSOffset* off = m_mem->GetOffset(TEX0.CBP, TEXCLUT.CBW, PSM_PSMCT32); - uint32* RESTRICT s = &m_mem->m_vm32[o->pixel.row[TEXCLUT.COV]]; - int* RESTRICT col = &o->pixel.col[0][TEXCLUT.COU << 4]; + uint32* RESTRICT s = &m_mem->m_vm32[off->pixel.row[TEXCLUT.COV]]; + int* RESTRICT col = &off->pixel.col[0][TEXCLUT.COU << 4]; uint16* RESTRICT clut = m_clut + ((TEX0.CSA & 15) << 4); @@ -203,10 +203,10 @@ template void GSClut::WriteCLUT32_CSM2(const GIFRegTEX0& TEX0, const GIFR template void GSClut::WriteCLUT16_CSM2(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) { - GSOffset* o = m_mem->GetOffset(TEX0.CBP, TEXCLUT.CBW, PSM_PSMCT16); + GSOffset* off = m_mem->GetOffset(TEX0.CBP, TEXCLUT.CBW, PSM_PSMCT16); - uint16* RESTRICT s = &m_mem->m_vm16[o->pixel.row[TEXCLUT.COV]]; - int* RESTRICT col = &o->pixel.col[0][TEXCLUT.COU << 4]; + uint16* RESTRICT s = &m_mem->m_vm16[off->pixel.row[TEXCLUT.COV]]; + int* RESTRICT col = &off->pixel.col[0][TEXCLUT.COU << 4]; uint16* RESTRICT clut = m_clut + (TEX0.CSA << 4); @@ -218,10 +218,10 @@ template void GSClut::WriteCLUT16_CSM2(const GIFRegTEX0& TEX0, const GIFR template void GSClut::WriteCLUT16S_CSM2(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) { - GSOffset* o = m_mem->GetOffset(TEX0.CBP, TEXCLUT.CBW, PSM_PSMCT16S); + GSOffset* off = m_mem->GetOffset(TEX0.CBP, TEXCLUT.CBW, PSM_PSMCT16S); - uint16* RESTRICT s = &m_mem->m_vm16[o->pixel.row[TEXCLUT.COV]]; - int* RESTRICT col = &o->pixel.col[0][TEXCLUT.COU << 4]; + uint16* RESTRICT s = &m_mem->m_vm16[off->pixel.row[TEXCLUT.COV]]; + int* RESTRICT col = &off->pixel.col[0][TEXCLUT.COU << 4]; uint16* RESTRICT clut = m_clut + (TEX0.CSA << 4); diff --git a/plugins/GSdx/GSDrawScanlineCodeGenerator.x64.avx.cpp b/plugins/GSdx/GSDrawScanlineCodeGenerator.x64.avx.cpp index 317130456a..56b82ca070 100644 --- a/plugins/GSdx/GSDrawScanlineCodeGenerator.x64.avx.cpp +++ b/plugins/GSdx/GSDrawScanlineCodeGenerator.x64.avx.cpp @@ -571,13 +571,13 @@ void GSDrawScanlineCodeGenerator::TestZ(const Xmm& temp1, const Xmm& temp2) if(m_sel.zoverflow || m_sel.zpsm == 0) { - // GSVector4i o = GSVector4i::x80000000(); + // GSVector4i off = GSVector4i::x80000000(); vpcmpeqd(xmm2, xmm2); vpslld(xmm2, 31); - // GSVector4i zso = zs - o; - // GSVector4i zdo = zd - o; + // GSVector4i zso = zs - off; + // GSVector4i zdo = zd - off; vpsubd(xmm0, xmm2); vpsubd(xmm1, xmm2); diff --git a/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx.cpp b/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx.cpp index 6148f33b9f..33872215c1 100644 --- a/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx.cpp +++ b/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx.cpp @@ -660,13 +660,13 @@ void GSDrawScanlineCodeGenerator::TestZ(const Xmm& temp1, const Xmm& temp2) if(m_sel.zoverflow || m_sel.zpsm == 0) { - // GSVector4i o = GSVector4i::x80000000(); + // GSVector4i off = GSVector4i::x80000000(); vpcmpeqd(temp1, temp1); vpslld(temp1, 31); - // GSVector4i zso = zs - o; - // GSVector4i zdo = zd - o; + // GSVector4i zso = zs - off; + // GSVector4i zdo = zd - off; vpsubd(xmm0, temp1); vpsubd(xmm1, temp1); diff --git a/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx2.cpp b/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx2.cpp index f06b853916..d616311a1e 100644 --- a/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx2.cpp +++ b/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx2.cpp @@ -661,13 +661,13 @@ void GSDrawScanlineCodeGenerator::TestZ(const Ymm& temp1, const Ymm& temp2) if(m_sel.zoverflow || m_sel.zpsm == 0) { - // GSVector8i o = GSVector8i::x80000000(); + // GSVector8i off = GSVector8i::x80000000(); vpcmpeqd(temp1, temp1); vpslld(temp1, 31); - // GSVector8i zso = zs - o; - // GSVector8i zdo = zd - o; + // GSVector8i zso = zs - off; + // GSVector8i zdo = zd - off; vpsubd(ymm0, temp1); vpsubd(ymm1, temp1); diff --git a/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.cpp b/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.cpp index eb95e857ce..de976c117d 100644 --- a/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.cpp +++ b/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.cpp @@ -664,13 +664,13 @@ void GSDrawScanlineCodeGenerator::TestZ(const Xmm& temp1, const Xmm& temp2) if(m_sel.zoverflow || m_sel.zpsm == 0) { - // GSVector4i o = GSVector4i::x80000000(); + // GSVector4i off = GSVector4i::x80000000(); pcmpeqd(temp1, temp1); pslld(temp1, 31); - // GSVector4i zso = zs - o; - // GSVector4i zdo = zd - o; + // GSVector4i zso = zs - off; + // GSVector4i zdo = zd - off; psubd(xmm0, temp1); psubd(xmm1, temp1); diff --git a/plugins/GSdx/GSLocalMemory.cpp b/plugins/GSdx/GSLocalMemory.cpp index 5519dfebb6..cf3d395793 100644 --- a/plugins/GSdx/GSLocalMemory.cpp +++ b/plugins/GSdx/GSLocalMemory.cpp @@ -37,10 +37,10 @@ int _offset = dstpitch * h; \ for(int y = _r.top; y < _r.bottom; y += h >> 3, _dst += _offset) \ { \ - uint32 _base = o->block.row[y]; \ + uint32 _base = off->block.row[y]; \ for(int x = _r.left; x < _r.right; x += w >> 3) \ { \ - const uint8* src = BlockPtr(_base + o->block.col[x]); \ + const uint8* src = BlockPtr(_base + off->block.col[x]); \ uint8* dst = &_dst[x * bpp]; \ #define FOREACH_BLOCK_END }} @@ -474,11 +474,11 @@ GSOffset* GSLocalMemory::GetOffset(uint32 bp, uint32 bw, uint32 psm) return i->second; } - GSOffset* o = new GSOffset(bp, bw, psm); + GSOffset* off = new GSOffset(bp, bw, psm); - m_omap[hash] = o; + m_omap[hash] = off; - return o; + return off; } GSPixelOffset* GSLocalMemory::GetPixelOffset(const GIFRegFRAME& FRAME, const GIFRegZBUF& ZBUF) @@ -505,14 +505,14 @@ GSPixelOffset* GSLocalMemory::GetPixelOffset(const GIFRegFRAME& FRAME, const GIF return i->second; } - GSPixelOffset* o = (GSPixelOffset*)_aligned_malloc(sizeof(GSPixelOffset), 32); + GSPixelOffset* off = (GSPixelOffset*)_aligned_malloc(sizeof(GSPixelOffset), 32); - o->hash = hash; - o->fbp = fbp; - o->zbp = zbp; - o->fpsm = fpsm; - o->zpsm = zpsm; - o->bw = bw; + off->hash = hash; + off->fbp = fbp; + off->zbp = zbp; + off->fpsm = fpsm; + off->zpsm = zpsm; + off->bw = bw; pixelAddress fpa = m_psm[fpsm].pa; pixelAddress zpa = m_psm[zpsm].pa; @@ -522,19 +522,19 @@ GSPixelOffset* GSLocalMemory::GetPixelOffset(const GIFRegFRAME& FRAME, const GIF for(int i = 0; i < 2048; i++) { - o->row[i].x = (int)fpa(0, i, fbp, bw) << fs; - o->row[i].y = (int)zpa(0, i, zbp, bw) << zs; + off->row[i].x = (int)fpa(0, i, fbp, bw) << fs; + off->row[i].y = (int)zpa(0, i, zbp, bw) << zs; } for(int i = 0; i < 2048; i++) { - o->col[i].x = m_psm[fpsm].rowOffset[0][i] << fs; - o->col[i].y = m_psm[zpsm].rowOffset[0][i] << zs; + off->col[i].x = m_psm[fpsm].rowOffset[0][i] << fs; + off->col[i].y = m_psm[zpsm].rowOffset[0][i] << zs; } - m_pomap[hash] = o; + m_pomap[hash] = off; - return o; + return off; } GSPixelOffset4* GSLocalMemory::GetPixelOffset4(const GIFRegFRAME& FRAME, const GIFRegZBUF& ZBUF) @@ -561,14 +561,14 @@ GSPixelOffset4* GSLocalMemory::GetPixelOffset4(const GIFRegFRAME& FRAME, const G return i->second; } - GSPixelOffset4* o = (GSPixelOffset4*)_aligned_malloc(sizeof(GSPixelOffset4), 32); + GSPixelOffset4* off = (GSPixelOffset4*)_aligned_malloc(sizeof(GSPixelOffset4), 32); - o->hash = hash; - o->fbp = fbp; - o->zbp = zbp; - o->fpsm = fpsm; - o->zpsm = zpsm; - o->bw = bw; + off->hash = hash; + off->fbp = fbp; + off->zbp = zbp; + off->fpsm = fpsm; + off->zpsm = zpsm; + off->bw = bw; pixelAddress fpa = m_psm[fpsm].pa; pixelAddress zpa = m_psm[zpsm].pa; @@ -578,19 +578,19 @@ GSPixelOffset4* GSLocalMemory::GetPixelOffset4(const GIFRegFRAME& FRAME, const G for(int i = 0; i < 2048; i++) { - o->row[i].x = (int)fpa(0, i, fbp, bw) << fs; - o->row[i].y = (int)zpa(0, i, zbp, bw) << zs; + off->row[i].x = (int)fpa(0, i, fbp, bw) << fs; + off->row[i].y = (int)zpa(0, i, zbp, bw) << zs; } for(int i = 0; i < 512; i++) { - o->col[i].x = m_psm[fpsm].rowOffset[0][i * 4] << fs; - o->col[i].y = m_psm[zpsm].rowOffset[0][i * 4] << zs; + off->col[i].x = m_psm[fpsm].rowOffset[0][i * 4] << fs; + off->col[i].y = m_psm[zpsm].rowOffset[0][i * 4] << zs; } - m_po4map[hash] = o; + m_po4map[hash] = off; - return o; + return off; } static bool cmp_vec2x(const GSVector2i& a, const GSVector2i& b) {return a.x < b.x;} @@ -611,17 +611,17 @@ vector* GSLocalMemory::GetPage2TileMap(const GIFRegTEX0& TEX0) int tw = std::max(1 << TEX0.TW, bs.x); int th = std::max(1 << TEX0.TH, bs.y); - const GSOffset* o = GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); + const GSOffset* off = GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); hash_map > tmp; // key = page, value = y:x, 7 bits each, max 128x128 tiles for the worst case (1024x1024 32bpp 8x8 blocks) for(int y = 0; y < th; y += bs.y) { - uint32 base = o->block.row[y >> 3]; + uint32 base = off->block.row[y >> 3]; for(int x = 0, i = y << 7; x < tw; x += bs.x, i += bs.x) { - uint32 page = (base + o->block.col[x >> 3]) >> 5; + uint32 page = (base + off->block.col[x >> 3]) >> 5; if(page < MAX_PAGES) { @@ -1422,10 +1422,10 @@ void GSLocalMemory::ReadImageX(int& tx, int& ty, uint8* dst, int len, GIFRegBITB for(int ex8 = ex - 8; len >= 8 && x <= ex8; len -= 8, x += 8, pd += 8) { - int o = offset[x]; + int off = offset[x]; - GSVector4i::store(&pd[0], GSVector4i::load(&ps[o + 0], &ps[o + 4])); - GSVector4i::store(&pd[4], GSVector4i::load(&ps[o + 8], &ps[o + 12])); + GSVector4i::store(&pd[0], GSVector4i::load(&ps[off + 0], &ps[off + 4])); + GSVector4i::store(&pd[4], GSVector4i::load(&ps[off + 8], &ps[off + 12])); for(int i = 0; i < 8; i++) ASSERT(pd[i] == ps[offset[x + i]]); } @@ -1608,7 +1608,7 @@ void GSLocalMemory::ReadImageX(int& tx, int& ty, uint8* dst, int len, GIFRegBITB /////////////////// -void GSLocalMemory::ReadTexture32(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture32(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { FOREACH_BLOCK_START(r, 8, 8, 32) { @@ -1617,7 +1617,7 @@ void GSLocalMemory::ReadTexture32(const GSOffset* RESTRICT o, const GSVector4i& FOREACH_BLOCK_END } -void GSLocalMemory::ReadTexture24(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture24(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { if(TEXA.AEM) { @@ -1637,7 +1637,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) +void GSLocalMemory::ReadTexture16(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { if(TEXA.AEM) { @@ -1657,7 +1657,7 @@ void GSLocalMemory::ReadTexture16(const GSOffset* RESTRICT o, const GSVector4i& } } -void GSLocalMemory::ReadTexture8(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture8(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { const uint32* pal = m_clut; @@ -1668,7 +1668,7 @@ void GSLocalMemory::ReadTexture8(const GSOffset* RESTRICT o, const GSVector4i& r FOREACH_BLOCK_END } -void GSLocalMemory::ReadTexture4(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture4(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { const uint64* pal = m_clut; @@ -1679,7 +1679,7 @@ void GSLocalMemory::ReadTexture4(const GSOffset* RESTRICT o, const GSVector4i& r FOREACH_BLOCK_END } -void GSLocalMemory::ReadTexture8H(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture8H(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { const uint32* pal = m_clut; @@ -1690,7 +1690,7 @@ void GSLocalMemory::ReadTexture8H(const GSOffset* RESTRICT o, const GSVector4i& FOREACH_BLOCK_END } -void GSLocalMemory::ReadTexture4HL(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture4HL(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { const uint32* pal = m_clut; @@ -1701,7 +1701,7 @@ void GSLocalMemory::ReadTexture4HL(const GSOffset* RESTRICT o, const GSVector4i& FOREACH_BLOCK_END } -void GSLocalMemory::ReadTexture4HH(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture4HH(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { const uint32* pal = m_clut; @@ -1786,9 +1786,9 @@ void GSLocalMemory::ReadTextureBlock4HH(uint32 bp, uint8* dst, int dstpitch, con /////////////////// -void GSLocalMemory::ReadTexture(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { - const psm_t& psm = m_psm[o->psm]; + const psm_t& psm = m_psm[off->psm]; readTexel rt = psm.rt; readTexture rtx = psm.rtx; @@ -1799,9 +1799,9 @@ void GSLocalMemory::ReadTexture(const GSOffset* RESTRICT o, const GSVector4i& r, { GIFRegTEX0 TEX0; - TEX0.TBP0 = o->bp; - TEX0.TBW = o->bw; - TEX0.PSM = o->psm; + TEX0.TBP0 = off->bp; + TEX0.TBW = off->bw; + TEX0.PSM = off->psm; GSVector4i cr = r.ralign(psm.bs); @@ -1854,19 +1854,19 @@ void GSLocalMemory::ReadTexture(const GSOffset* RESTRICT o, const GSVector4i& r, if(!cr.rempty()) { - (this->*rtx)(o, cr, dst + (cr.left - r.left) * sizeof(32), dstpitch, TEXA); + (this->*rtx)(off, cr, dst + (cr.left - r.left) * sizeof(32), dstpitch, TEXA); } } } else { - (this->*rtx)(o, r, dst, dstpitch, TEXA); + (this->*rtx)(off, r, dst, dstpitch, TEXA); } } // 32/8 -void GSLocalMemory::ReadTexture8P(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture8P(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { FOREACH_BLOCK_START(r, 16, 16, 8) { @@ -1875,7 +1875,7 @@ void GSLocalMemory::ReadTexture8P(const GSOffset* RESTRICT o, const GSVector4i& FOREACH_BLOCK_END } -void GSLocalMemory::ReadTexture4P(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture4P(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { FOREACH_BLOCK_START(r, 32, 16, 8) { @@ -1884,7 +1884,7 @@ void GSLocalMemory::ReadTexture4P(const GSOffset* RESTRICT o, const GSVector4i& FOREACH_BLOCK_END } -void GSLocalMemory::ReadTexture8HP(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture8HP(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { FOREACH_BLOCK_START(r, 8, 8, 8) { @@ -1893,7 +1893,7 @@ void GSLocalMemory::ReadTexture8HP(const GSOffset* RESTRICT o, const GSVector4i& FOREACH_BLOCK_END } -void GSLocalMemory::ReadTexture4HLP(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture4HLP(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { FOREACH_BLOCK_START(r, 8, 8, 8) { @@ -1902,7 +1902,7 @@ void GSLocalMemory::ReadTexture4HLP(const GSOffset* RESTRICT o, const GSVector4i FOREACH_BLOCK_END } -void GSLocalMemory::ReadTexture4HHP(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) +void GSLocalMemory::ReadTexture4HHP(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) { FOREACH_BLOCK_START(r, 8, 8, 8) { diff --git a/plugins/GSdx/GSLocalMemory.h b/plugins/GSdx/GSLocalMemory.h index 591e654369..5504a9bb20 100644 --- a/plugins/GSdx/GSLocalMemory.h +++ b/plugins/GSdx/GSLocalMemory.h @@ -93,7 +93,7 @@ public: typedef uint32 (GSLocalMemory::*readTexelAddr)(uint32 addr, const GIFRegTEXA& TEXA) const; typedef void (GSLocalMemory::*writeImage)(int& tx, int& ty, const uint8* src, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG); typedef void (GSLocalMemory::*readImage)(int& tx, int& ty, uint8* dst, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG) const; - typedef void (GSLocalMemory::*readTexture)(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + typedef void (GSLocalMemory::*readTexture)(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); typedef void (GSLocalMemory::*readTextureBlock)(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const; __aligned(struct, 128) psm_t @@ -670,15 +670,15 @@ public: WriteFrame16(PixelAddress16SZ(x, y, bp, bw), c); } - __forceinline void WritePixel32(uint8* RESTRICT src, uint32 pitch, GSOffset* o, const GSVector4i& r) + __forceinline void WritePixel32(uint8* RESTRICT src, uint32 pitch, GSOffset* off, const GSVector4i& r) { src -= r.left * sizeof(uint32); for(int y = r.top; y < r.bottom; y++, src += pitch) { uint32* RESTRICT s = (uint32*)src; - uint32* RESTRICT d = &m_vm32[o->pixel.row[y]]; - int* RESTRICT col = o->pixel.col[0]; + uint32* RESTRICT d = &m_vm32[off->pixel.row[y]]; + int* RESTRICT col = off->pixel.col[0]; for(int x = r.left; x < r.right; x++) { @@ -687,15 +687,15 @@ public: } } - __forceinline void WritePixel24(uint8* RESTRICT src, uint32 pitch, GSOffset* o, const GSVector4i& r) + __forceinline void WritePixel24(uint8* RESTRICT src, uint32 pitch, GSOffset* off, const GSVector4i& r) { src -= r.left * sizeof(uint32); for(int y = r.top; y < r.bottom; y++, src += pitch) { uint32* RESTRICT s = (uint32*)src; - uint32* RESTRICT d = &m_vm32[o->pixel.row[y]]; - int* RESTRICT col = o->pixel.col[0]; + uint32* RESTRICT d = &m_vm32[off->pixel.row[y]]; + int* RESTRICT col = off->pixel.col[0]; for(int x = r.left; x < r.right; x++) { @@ -704,15 +704,15 @@ public: } } - __forceinline void WritePixel16(uint8* RESTRICT src, uint32 pitch, GSOffset* o, const GSVector4i& r) + __forceinline void WritePixel16(uint8* RESTRICT src, uint32 pitch, GSOffset* off, const GSVector4i& r) { src -= r.left * sizeof(uint16); for(int y = r.top; y < r.bottom; y++, src += pitch) { uint16* RESTRICT s = (uint16*)src; - uint16* RESTRICT d = &m_vm16[o->pixel.row[y]]; - int* RESTRICT col = o->pixel.col[0]; + uint16* RESTRICT d = &m_vm16[off->pixel.row[y]]; + int* RESTRICT col = off->pixel.col[0]; for(int x = r.left; x < r.right; x++) { @@ -721,15 +721,15 @@ public: } } - __forceinline void WriteFrame16(uint8* RESTRICT src, uint32 pitch, GSOffset* o, const GSVector4i& r) + __forceinline void WriteFrame16(uint8* RESTRICT src, uint32 pitch, GSOffset* off, const GSVector4i& r) { src -= r.left * sizeof(uint32); for(int y = r.top; y < r.bottom; y++, src += pitch) { uint32* RESTRICT s = (uint32*)src; - uint16* RESTRICT d = &m_vm16[o->pixel.row[y]]; - int* RESTRICT col = o->pixel.col[0]; + uint16* RESTRICT d = &m_vm16[off->pixel.row[y]]; + int* RESTRICT col = off->pixel.col[0]; for(int x = r.left; x < r.right; x++) { @@ -876,16 +876,16 @@ public: // * => 32 - void ReadTexture32(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture24(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture16(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture8(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture4(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture8H(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture4HL(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture4HH(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture32(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture24(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture16(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture8(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture4(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture8H(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture4HL(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture4HH(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); void ReadTextureBlock32(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const; void ReadTextureBlock24(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const; @@ -898,11 +898,11 @@ public: // pal ? 8 : 32 - void ReadTexture8P(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture4P(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture8HP(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture4HLP(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); - void ReadTexture4HHP(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture8P(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture4P(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture8HP(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture4HLP(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + void ReadTexture4HHP(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); void ReadTextureBlock8P(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const; void ReadTextureBlock4P(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const; @@ -912,7 +912,7 @@ public: // - template void ReadTexture(const GSOffset* RESTRICT o, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); + template void ReadTexture(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA); // diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index a851005ffc..64a9b8f027 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -221,19 +221,19 @@ bool GSRenderer::Merge(int field) src[i] = GSVector4(r) * scale / GSVector4(tex[i]->GetSize()).xyxy(); - GSVector2 o(0, 0); + GSVector2 off(0, 0); if(dr[i].top - baseline >= 4) // 2? { - o.y = tex[i]->GetScale().y * (dr[i].top - baseline); + off.y = tex[i]->GetScale().y * (dr[i].top - baseline); if(m_regs->SMODE2.INT && m_regs->SMODE2.FFMD) { - o.y /= 2; + off.y /= 2; } } - dst[i] = GSVector4(o).xyxy() + scale * GSVector4(r.rsize()); + dst[i] = GSVector4(off).xyxy() + scale * GSVector4(r.rsize()); fs.x = max(fs.x, (int)(dst[i].z + 0.5f)); fs.y = max(fs.y, (int)(dst[i].w + 0.5f)); diff --git a/plugins/GSdx/GSRendererCL.cpp b/plugins/GSdx/GSRendererCL.cpp index e4b22d63e2..ade70dae71 100644 --- a/plugins/GSdx/GSRendererCL.cpp +++ b/plugins/GSdx/GSRendererCL.cpp @@ -197,7 +197,7 @@ const GSVector4 g_pos_scale(1.0f / 16, 1.0f / 16, 1.0f, 1.0f); template void GSRendererCL::ConvertVertexBuffer(GSVertexCL* RESTRICT dst, const GSVertex* RESTRICT src, size_t count) { - GSVector4i o = (GSVector4i)m_context->XYOFFSET; + GSVector4i off = (GSVector4i)m_context->XYOFFSET; GSVector4 st_scale = GSVector4(16 << m_context->TEX0.TW, 16 << m_context->TEX0.TH, 1, 0); for(int i = (int)m_vertex.next; i > 0; i--, src++, dst++) @@ -206,7 +206,7 @@ void GSRendererCL::ConvertVertexBuffer(GSVertexCL* RESTRICT dst, const GSVertex* GSVector4i xyzuvf(src->m[1]); - dst->p = (GSVector4(xyzuvf.upl16() - o) * g_pos_scale).xyxy(GSVector4::cast(xyzuvf.ywyw())); // pass zf as uints + dst->p = (GSVector4(xyzuvf.upl16() - off) * g_pos_scale).xyxy(GSVector4::cast(xyzuvf.ywyw())); // pass zf as uints GSVector4 t = GSVector4::zero(); @@ -571,9 +571,9 @@ void GSRendererCL::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GS { if(LOG) {fprintf(s_fp, "w %05x %d %d, %d %d %d %d\n", BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM, r.x, r.y, r.z, r.w); fflush(s_fp);} - GSOffset* o = m_mem.GetOffset(BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM); + GSOffset* off = m_mem.GetOffset(BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM); - o->GetPagesAsBits(r, m_tmp_pages); + off->GetPagesAsBits(r, m_tmp_pages); if(!m_synced) { @@ -607,9 +607,9 @@ void GSRendererCL::InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const GS if(!m_synced) { - GSOffset* o = m_mem.GetOffset(BITBLTBUF.SBP, BITBLTBUF.SBW, BITBLTBUF.SPSM); + GSOffset* off = m_mem.GetOffset(BITBLTBUF.SBP, BITBLTBUF.SBW, BITBLTBUF.SPSM); - o->GetPagesAsBits(r, m_tmp_pages); + off->GetPagesAsBits(r, m_tmp_pages); for(int i = 0; i < 4; i++) { @@ -1191,9 +1191,9 @@ bool GSRendererCL::SetupParameter(TFXJob* job, TFXParameter* pb, GSVertexCL* ver GSVector4i* src_pages = job->GetSrcPages(); - GSOffset* o = m_mem.GetOffset(context->TEX0.TBP0, context->TEX0.TBW, context->TEX0.PSM); + GSOffset* off = m_mem.GetOffset(context->TEX0.TBP0, context->TEX0.TBW, context->TEX0.PSM); - o->GetPagesAsBits(r, m_tmp_pages); + off->GetPagesAsBits(r, m_tmp_pages); for(int i = 0; i < 4; i++) { @@ -1324,9 +1324,9 @@ bool GSRendererCL::SetupParameter(TFXJob* job, TFXParameter* pb, GSVertexCL* ver GetTextureMinMax(r, MIP_TEX0, MIP_CLAMP, job->sel.ltf); - GSOffset* o = m_mem.GetOffset(MIP_TEX0.TBP0, MIP_TEX0.TBW, MIP_TEX0.PSM); + GSOffset* off = m_mem.GetOffset(MIP_TEX0.TBP0, MIP_TEX0.TBW, MIP_TEX0.PSM); - o->GetPagesAsBits(r, m_tmp_pages); + off->GetPagesAsBits(r, m_tmp_pages); for(int i = 0; i < 4; i++) { diff --git a/plugins/GSdx/GSRendererCS.cpp b/plugins/GSdx/GSRendererCS.cpp index acf5fde766..30fe022239 100644 --- a/plugins/GSdx/GSRendererCS.cpp +++ b/plugins/GSdx/GSRendererCS.cpp @@ -354,11 +354,11 @@ GSTexture* GSRendererCS::GetOutput(int i) GSVector4i r(0, 0, w, h); GSVector4i r2 = r.ralign(psm.bs); - GSOffset* o = m_mem.GetOffset(DISPFB.Block(), DISPFB.FBW, DISPFB.PSM); + GSOffset* off = m_mem.GetOffset(DISPFB.Block(), DISPFB.FBW, DISPFB.PSM); - Read(o, r2, false); + Read(off, r2, false); - (m_mem.*psm.rtx)(o, r2, m_output, 1024 * 4, m_env.TEXA); + (m_mem.*psm.rtx)(off, r2, m_output, 1024 * 4, m_env.TEXA); m_texture[i]->Update(r, m_output, 1024 * 4); @@ -682,9 +682,9 @@ void GSRendererCS::Draw() void GSRendererCS::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r) { - GSOffset* o = m_mem.GetOffset(BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM); + GSOffset* off = m_mem.GetOffset(BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM); - Read(o, r, true); // TODO: fully overwritten pages are not needed to be read, only invalidated (important) + Read(off, r, true); // TODO: fully overwritten pages are not needed to be read, only invalidated (important) // TODO: false deps, 8H/4HL/4HH texture sharing pages with 24-bit target // TODO: invalidate texture cache @@ -692,12 +692,12 @@ void GSRendererCS::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GS void GSRendererCS::InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool clut) { - GSOffset* o = m_mem.GetOffset(BITBLTBUF.SBP, BITBLTBUF.SBW, BITBLTBUF.SPSM); + GSOffset* off = m_mem.GetOffset(BITBLTBUF.SBP, BITBLTBUF.SBW, BITBLTBUF.SPSM); - Read(o, r, false); + Read(off, r, false); } -void GSRendererCS::Write(GSOffset* o, const GSVector4i& r) +void GSRendererCS::Write(GSOffset* off, const GSVector4i& r) { GSDevice11* dev = (GSDevice11*)m_dev; @@ -711,7 +711,7 @@ void GSRendererCS::Write(GSOffset* o, const GSVector4i& r) box.bottom = 1; box.back = 1; - uint32* pages = o->GetPages(r); + uint32* pages = off->GetPages(r); for(size_t i = 0; pages[i] != GSOffset::EOP; i++) { @@ -739,14 +739,14 @@ void GSRendererCS::Write(GSOffset* o, const GSVector4i& r) ctx->UpdateSubresource(m_vm, 0, &box, m_mem.m_vm8 + page * PAGE_SIZE, 0, 0); */ if(0) - printf("[%lld] write %05x %d %d (%d)\n", __rdtsc(), o->bp, o->bw, o->psm, page); + printf("[%lld] write %05x %d %d (%d)\n", __rdtsc(), off->bp, off->bw, off->psm, page); } } delete [] pages; } -void GSRendererCS::Read(GSOffset* o, const GSVector4i& r, bool invalidate) +void GSRendererCS::Read(GSOffset* off, const GSVector4i& r, bool invalidate) { GSDevice11* dev = (GSDevice11*)m_dev; @@ -760,7 +760,7 @@ void GSRendererCS::Read(GSOffset* o, const GSVector4i& r, bool invalidate) box.bottom = 1; box.back = 1; - uint32* pages = o->GetPages(r); + uint32* pages = off->GetPages(r); for(size_t i = 0; pages[i] != GSOffset::EOP; i++) { @@ -799,7 +799,7 @@ void GSRendererCS::Read(GSOffset* o, const GSVector4i& r, bool invalidate) ctx->Unmap(m_pb, 0); if(0) - printf("[%lld] read %05x %d %d (%d)\n", __rdtsc(), o->bp, o->bw, o->psm, page); + printf("[%lld] read %05x %d %d (%d)\n", __rdtsc(), off->bp, off->bw, off->psm, page); } } } diff --git a/plugins/GSdx/GSRendererCS.h b/plugins/GSdx/GSRendererCS.h index 5b4aada591..185356c658 100644 --- a/plugins/GSdx/GSRendererCS.h +++ b/plugins/GSdx/GSRendererCS.h @@ -114,8 +114,8 @@ class GSRendererCS : public GSRenderer hash_map > m_ps1; CComPtr m_ps_cb; - void Write(GSOffset* o, const GSVector4i& r); - void Read(GSOffset* o, const GSVector4i& r, bool invalidate); + void Write(GSOffset* off, const GSVector4i& r); + void Read(GSOffset* off, const GSVector4i& r, bool invalidate); struct OffsetBuffer { diff --git a/plugins/GSdx/GSRendererDX.cpp b/plugins/GSdx/GSRendererDX.cpp index e080a9c22e..103fb50928 100644 --- a/plugins/GSdx/GSRendererDX.cpp +++ b/plugins/GSdx/GSRendererDX.cpp @@ -63,10 +63,10 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc if(dev->HasStencil()) { GSVector4 s = GSVector4(rtscale.x / rtsize.x, rtscale.y / rtsize.y); - GSVector4 o = GSVector4(-1.0f, 1.0f); + GSVector4 off = GSVector4(-1.0f, 1.0f); - GSVector4 src = ((m_vt.m_min.p.xyxy(m_vt.m_max.p) + o.xxyy()) * s.xyxy()).sat(o.zzyy()); - GSVector4 dst = src * 2.0f + o.xxxx(); + GSVector4 src = ((m_vt.m_min.p.xyxy(m_vt.m_max.p) + off.xxyy()) * s.xyxy()).sat(off.zzyy()); + GSVector4 dst = src * 2.0f + off.xxxx(); GSVertexPT1 vertices[] = { diff --git a/plugins/GSdx/GSRendererDX9.cpp b/plugins/GSdx/GSRendererDX9.cpp index 670f5b474f..e8c16a1040 100644 --- a/plugins/GSdx/GSRendererDX9.cpp +++ b/plugins/GSdx/GSRendererDX9.cpp @@ -243,10 +243,10 @@ void GSRendererDX9::UpdateFBA(GSTexture* rt) // ia GSVector4 s = GSVector4(rt->GetScale().x / rt->GetWidth(), rt->GetScale().y / rt->GetHeight()); - GSVector4 o = GSVector4(-1.0f, 1.0f); + GSVector4 off = GSVector4(-1.0f, 1.0f); - GSVector4 src = ((m_vt.m_min.p.xyxy(m_vt.m_max.p) + o.xxyy()) * s.xyxy()).sat(o.zzyy()); - GSVector4 dst = src * 2.0f + o.xxxx(); + GSVector4 src = ((m_vt.m_min.p.xyxy(m_vt.m_max.p) + off.xxyy()) * s.xyxy()).sat(off.zzyy()); + GSVector4 dst = src * 2.0f + off.xxxx(); GSVertexPT1 vertices[] = { diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index dcf48fe785..1b7110690b 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -303,8 +303,8 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour } else if (DATE) { // TODO: do I need to clamp the value (if yes how? rintersect with rt?) GSVector4 si = GSVector4(rtscale.x, rtscale.y); - GSVector4 o = GSVector4(-1.0f, 1.0f); // Round value - GSVector4 b = m_vt.m_min.p.xyxy(m_vt.m_max.p) + o.xxyy(); + GSVector4 off = GSVector4(-1.0f, 1.0f); // Round value + GSVector4 b = m_vt.m_min.p.xyxy(m_vt.m_max.p) + off.xxyy(); GSVector4i ri = GSVector4i(b * si.xyxy()); // Reduce the quantity of clean function @@ -319,8 +319,8 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour } else { GSVector4 s = GSVector4(rtscale.x / rtsize.x, rtscale.y / rtsize.y); - GSVector4 src = (b * s.xyxy()).sat(o.zzyy()); - GSVector4 dst = src * 2.0f + o.xxxx(); + GSVector4 src = (b * s.xyxy()).sat(off.zzyy()); + GSVector4 dst = src * 2.0f + off.xxxx(); GSVertexPT1 vertices[] = { diff --git a/plugins/GSdx/GSRendererSW.cpp b/plugins/GSdx/GSRendererSW.cpp index de474ea4d1..60456f8693 100644 --- a/plugins/GSdx/GSRendererSW.cpp +++ b/plugins/GSdx/GSRendererSW.cpp @@ -336,7 +336,7 @@ void GSRendererSW::ConvertVertexBuffer(GSVertexSW* RESTRICT dst, const GSVertex* #else - GSVector4i o = (GSVector4i)m_context->XYOFFSET; + GSVector4i off = (GSVector4i)m_context->XYOFFSET; GSVector4 tsize = GSVector4(0x10000 << m_context->TEX0.TW, 0x10000 << m_context->TEX0.TH, 1, 0); for(int i = (int)m_vertex.next; i > 0; i--, src++, dst++) @@ -347,14 +347,14 @@ void GSRendererSW::ConvertVertexBuffer(GSVertexSW* RESTRICT dst, const GSVertex* GSVector4i xyzuvf(src->m[1]); - GSVector4i xy = xyzuvf.upl16() - o; + GSVector4i xy = xyzuvf.upl16() - off; GSVector4i zf = xyzuvf.ywww().min_u32(GSVector4i::xffffff00()); #else uint32 z = src->XYZ.Z; - GSVector4i xy = GSVector4i::load((int)src->XYZ.u32[0]).upl16() - o; + GSVector4i xy = GSVector4i::load((int)src->XYZ.u32[0]).upl16() - off; GSVector4i zf = GSVector4i((int)std::min(z, 0xffffff00), src->FOG); // NOTE: larger values of z may roll over to 0 when converting back to uint32 later #endif @@ -681,9 +681,9 @@ void GSRendererSW::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GS { if(LOG) {fprintf(s_fp, "w %05x %d %d, %d %d %d %d\n", BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM, r.x, r.y, r.z, r.w); fflush(s_fp);} - GSOffset* o = m_mem.GetOffset(BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM); + GSOffset* off = m_mem.GetOffset(BITBLTBUF.DBP, BITBLTBUF.DBW, BITBLTBUF.DPSM); - o->GetPages(r, m_tmp_pages); + off->GetPages(r, m_tmp_pages); // check if the changing pages either used as a texture or a target @@ -700,7 +700,7 @@ void GSRendererSW::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GS } } - m_tc->InvalidatePages(m_tmp_pages, o->psm); // if texture update runs on a thread and Sync(5) happens then this must come later + m_tc->InvalidatePages(m_tmp_pages, off->psm); // if texture update runs on a thread and Sync(5) happens then this must come later } void GSRendererSW::InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool clut) @@ -709,9 +709,9 @@ void GSRendererSW::InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const GS if(!m_rl->IsSynced()) { - GSOffset* o = m_mem.GetOffset(BITBLTBUF.SBP, BITBLTBUF.SBW, BITBLTBUF.SPSM); + GSOffset* off = m_mem.GetOffset(BITBLTBUF.SBP, BITBLTBUF.SBW, BITBLTBUF.SPSM); - o->GetPages(r, m_tmp_pages); + off->GetPages(r, m_tmp_pages); for(uint32* RESTRICT p = m_tmp_pages; *p != GSOffset::EOP; p++) { diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 2b0c118252..00c6b1e05d 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -963,14 +963,14 @@ template void GSState::GIFRegHandlerTEX2(const GIFReg* RESTRICT r) template void GSState::GIFRegHandlerXYOFFSET(const GIFReg* RESTRICT r) { - GSVector4i o = (GSVector4i)r->XYOFFSET & GSVector4i::x0000ffff(); + GSVector4i off = (GSVector4i)r->XYOFFSET & GSVector4i::x0000ffff(); - if(!o.eq(m_env.CTXT[i].XYOFFSET)) + if(!off.eq(m_env.CTXT[i].XYOFFSET)) { Flush(); } - m_env.CTXT[i].XYOFFSET = o; + m_env.CTXT[i].XYOFFSET = off; m_env.CTXT[i].UpdateScissor(); diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 4997cc8893..a61372c2c2 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -317,13 +317,13 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int // Goal: invalidate data sent to the GPU when the source (GS memory) is modified // Called each time you want to write to the GS memory -void GSTextureCache::InvalidateVideoMem(GSOffset* o, const GSVector4i& rect, bool target) +void GSTextureCache::InvalidateVideoMem(GSOffset* off, const GSVector4i& rect, bool target) { - if(!o) return; // Fixme. Crashes Dual Hearts, maybe others as well. Was fine before r1549. + if(!off) return; // Fixme. Crashes Dual Hearts, maybe others as well. Was fine before r1549. - uint32 bp = o->bp; - uint32 bw = o->bw; - uint32 psm = o->psm; + uint32 bp = off->bp; + uint32 bw = off->bw; + uint32 psm = off->psm; if(!target) { @@ -348,7 +348,7 @@ void GSTextureCache::InvalidateVideoMem(GSOffset* o, const GSVector4i& rect, boo uint32* pages = (uint32*)m_temp; - o->GetPages(rect, pages, &r); + off->GetPages(rect, pages, &r); bool found = false; @@ -454,11 +454,11 @@ void GSTextureCache::InvalidateVideoMem(GSOffset* o, const GSVector4i& rect, boo // Goal: retrive the data from the GPU to the GS memory. // Called each time you want to read from the GS memory -void GSTextureCache::InvalidateLocalMem(GSOffset* o, const GSVector4i& r) +void GSTextureCache::InvalidateLocalMem(GSOffset* off, const GSVector4i& r) { - uint32 bp = o->bp; - uint32 psm = o->psm; - //uint32 bw = o->bw; + uint32 bp = off->bp; + uint32 psm = off->psm; + //uint32 bw = off->bw; // No depth handling please. if (psm == PSM_PSMZ32 || psm == PSM_PSMZ24 || psm == PSM_PSMZ16 || psm == PSM_PSMZ16S) @@ -698,10 +698,10 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con //{ // for(int dx = 0; dx < dw; dx += blockWidth) // { - // int o = dy * dw / blockHeight + dx; + // int off = dy * dw / blockHeight + dx; - // int sx = o % sw; - // int sy = o / sw; + // int sx = off % sw; + // int sy = off / sw; // GSVector4 sr = GSVector4(GSVector4i(sx, sy).xyxy() + br) * scale / size; // GSVector4 dr = GSVector4(GSVector4i(dx, dy).xyxy() + br) * scale; @@ -951,7 +951,7 @@ void GSTextureCache::Source::Update(const GSVector4i& rect) m_complete = true; // lame, but better than nothing } - const GSOffset* o = m_renderer->m_context->offset.tex; + const GSOffset* off = m_renderer->m_context->offset.tex; uint32 blocks = 0; @@ -959,11 +959,11 @@ void GSTextureCache::Source::Update(const GSVector4i& rect) { for(int y = r.top; y < r.bottom; y += bs.y) { - uint32 base = o->block.row[y >> 3]; + uint32 base = off->block.row[y >> 3]; for(int x = r.left, i = (y << 7) + x; x < r.right; x += bs.x, i += bs.x) { - uint32 block = base + o->block.col[x >> 3]; + uint32 block = base + off->block.col[x >> 3]; if(block < MAX_BLOCKS) { @@ -988,11 +988,11 @@ void GSTextureCache::Source::Update(const GSVector4i& rect) { for(int y = r.top; y < r.bottom; y += bs.y) { - uint32 base = o->block.row[y >> 3]; + uint32 base = off->block.row[y >> 3]; for(int x = r.left; x < r.right; x += bs.x) { - uint32 block = base + o->block.col[x >> 3]; + uint32 block = base + off->block.col[x >> 3]; if(block < MAX_BLOCKS) { @@ -1071,7 +1071,7 @@ void GSTextureCache::Source::Flush(uint32 count) GSLocalMemory& mem = m_renderer->m_mem; - const GSOffset* o = m_renderer->m_context->offset.tex; + const GSOffset* off = m_renderer->m_context->offset.tex; GSLocalMemory::readTexture rtx = psm.rtx; @@ -1095,7 +1095,7 @@ void GSTextureCache::Source::Flush(uint32 count) if((r > tr).mask() & 0xff00) { - (mem.*rtx)(o, r, buff, pitch, m_TEXA); + (mem.*rtx)(off, r, buff, pitch, m_TEXA); m_texture->Update(r.rintersect(tr), buff, pitch); } @@ -1105,13 +1105,13 @@ void GSTextureCache::Source::Flush(uint32 count) if(m_texture->Map(m, &r)) { - (mem.*rtx)(o, r, m.bits, m.pitch, plainTEXA); + (mem.*rtx)(off, r, m.bits, m.pitch, plainTEXA); m_texture->Unmap(); } else { - (mem.*rtx)(o, r, buff, pitch, plainTEXA); + (mem.*rtx)(off, r, buff, pitch, plainTEXA); m_texture->Update(r, buff, pitch); } @@ -1156,7 +1156,7 @@ void GSTextureCache::Target::Update() if(GSTexture* t = m_renderer->m_dev->CreateTexture(w, h)) { - const GSOffset* o = m_renderer->m_mem.GetOffset(m_TEX0.TBP0, m_TEX0.TBW, m_TEX0.PSM); + const GSOffset* off = m_renderer->m_mem.GetOffset(m_TEX0.TBP0, m_TEX0.TBW, m_TEX0.PSM); GIFRegTEXA TEXA; @@ -1168,7 +1168,7 @@ void GSTextureCache::Target::Update() if(t->Map(m)) { - m_renderer->m_mem.ReadTexture(o, r, m.bits, m.pitch, TEXA); + m_renderer->m_mem.ReadTexture(off, r, m.bits, m.pitch, TEXA); t->Unmap(); } @@ -1176,7 +1176,7 @@ void GSTextureCache::Target::Update() { int pitch = ((w + 3) & ~3) * 4; - m_renderer->m_mem.ReadTexture(o, r, m_temp, pitch, TEXA); + m_renderer->m_mem.ReadTexture(off, r, m_temp, pitch, TEXA); t->Update(r.rsize(), m_temp, pitch); } @@ -1201,7 +1201,7 @@ void GSTextureCache::Target::Update() // GSTextureCache::SourceMap -void GSTextureCache::SourceMap::Add(Source* s, const GIFRegTEX0& TEX0, const GSOffset* o) +void GSTextureCache::SourceMap::Add(Source* s, const GIFRegTEX0& TEX0, const GSOffset* off) { m_surfaces.insert(s); @@ -1228,11 +1228,11 @@ void GSTextureCache::SourceMap::Add(Source* s, const GIFRegTEX0& TEX0, const GSO for(int y = 0; y < th; y += bs.y) { - uint32 base = o->block.row[y >> 3]; + uint32 base = off->block.row[y >> 3]; for(int x = 0; x < tw; x += bs.x) { - uint32 page = (base + o->block.col[x >> 3]) >> 5; + uint32 page = (base + off->block.col[x >> 3]) >> 5; if(page < MAX_PAGES) { diff --git a/plugins/GSdx/GSTextureCache.h b/plugins/GSdx/GSTextureCache.h index 2a748bf19e..ccaf76e151 100644 --- a/plugins/GSdx/GSTextureCache.h +++ b/plugins/GSdx/GSTextureCache.h @@ -98,7 +98,7 @@ public: SourceMap() : m_used(false) {memset(m_pages, 0, sizeof(m_pages));} - void Add(Source* s, const GIFRegTEX0& TEX0, const GSOffset* o); + void Add(Source* s, const GIFRegTEX0& TEX0, const GSOffset* off); void RemoveAll(); void RemoveAt(Source* s); }; @@ -134,8 +134,8 @@ public: Target* LookupTarget(const GIFRegTEX0& TEX0, int w, int h, int type, bool used); Target* LookupTarget(const GIFRegTEX0& TEX0, int w, int h); - void InvalidateVideoMem(GSOffset* o, const GSVector4i& r, bool target = true); - void InvalidateLocalMem(GSOffset* o, const GSVector4i& r); + void InvalidateVideoMem(GSOffset* off, const GSVector4i& r, bool target = true); + void InvalidateLocalMem(GSOffset* off, const GSVector4i& r); void IncAge(); bool UserHacks_HalfPixelOffset; diff --git a/plugins/GSdx/GSTextureCache11.cpp b/plugins/GSdx/GSTextureCache11.cpp index dd90eafe47..ed00b17194 100644 --- a/plugins/GSdx/GSTextureCache11.cpp +++ b/plugins/GSdx/GSTextureCache11.cpp @@ -72,19 +72,19 @@ void GSTextureCache11::Read(Target* t, const GSVector4i& r) { // TODO: block level write - GSOffset* o = m_renderer->m_mem.GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); + GSOffset* off = m_renderer->m_mem.GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); switch(TEX0.PSM) { case PSM_PSMCT32: - m_renderer->m_mem.WritePixel32(m.bits, m.pitch, o, r); + m_renderer->m_mem.WritePixel32(m.bits, m.pitch, off, r); break; case PSM_PSMCT24: - m_renderer->m_mem.WritePixel24(m.bits, m.pitch, o, r); + m_renderer->m_mem.WritePixel24(m.bits, m.pitch, off, r); break; case PSM_PSMCT16: case PSM_PSMCT16S: - m_renderer->m_mem.WritePixel16(m.bits, m.pitch, o, r); + m_renderer->m_mem.WritePixel16(m.bits, m.pitch, off, r); break; default: ASSERT(0); diff --git a/plugins/GSdx/GSTextureCache9.cpp b/plugins/GSdx/GSTextureCache9.cpp index 49f4941790..1d75f1a908 100644 --- a/plugins/GSdx/GSTextureCache9.cpp +++ b/plugins/GSdx/GSTextureCache9.cpp @@ -70,19 +70,19 @@ void GSTextureCache9::Read(Target* t, const GSVector4i& r) { // TODO: block level write - GSOffset* o = m_renderer->m_mem.GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); + GSOffset* off = m_renderer->m_mem.GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); switch(TEX0.PSM) { case PSM_PSMCT32: - m_renderer->m_mem.WritePixel32(m.bits, m.pitch, o, r); + m_renderer->m_mem.WritePixel32(m.bits, m.pitch, off, r); break; case PSM_PSMCT24: - m_renderer->m_mem.WritePixel24(m.bits, m.pitch, o, r); + m_renderer->m_mem.WritePixel24(m.bits, m.pitch, off, r); break; case PSM_PSMCT16: case PSM_PSMCT16S: - m_renderer->m_mem.WriteFrame16(m.bits, m.pitch, o, r); + m_renderer->m_mem.WriteFrame16(m.bits, m.pitch, off, r); break; default: ASSERT(0); diff --git a/plugins/GSdx/GSTextureCacheOGL.cpp b/plugins/GSdx/GSTextureCacheOGL.cpp index 920afba190..437db47e9f 100644 --- a/plugins/GSdx/GSTextureCacheOGL.cpp +++ b/plugins/GSdx/GSTextureCacheOGL.cpp @@ -77,19 +77,19 @@ void GSTextureCacheOGL::Read(Target* t, const GSVector4i& r) { // TODO: block level write - GSOffset* o = m_renderer->m_mem.GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); + GSOffset* off = m_renderer->m_mem.GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM); switch(TEX0.PSM) { case PSM_PSMCT32: - m_renderer->m_mem.WritePixel32(m.bits, m.pitch, o, r); + m_renderer->m_mem.WritePixel32(m.bits, m.pitch, off, r); break; case PSM_PSMCT24: - m_renderer->m_mem.WritePixel24(m.bits, m.pitch, o, r); + m_renderer->m_mem.WritePixel24(m.bits, m.pitch, off, r); break; case PSM_PSMCT16: case PSM_PSMCT16S: - m_renderer->m_mem.WritePixel16(m.bits, m.pitch, o, r); + m_renderer->m_mem.WritePixel16(m.bits, m.pitch, off, r); break; default: ASSERT(0); diff --git a/plugins/GSdx/GSTextureCacheSW.cpp b/plugins/GSdx/GSTextureCacheSW.cpp index 3700e52795..8d1a2ba6f3 100644 --- a/plugins/GSdx/GSTextureCacheSW.cpp +++ b/plugins/GSdx/GSTextureCacheSW.cpp @@ -251,7 +251,7 @@ bool GSTextureCacheSW::Texture::Update(const GSVector4i& rect) GSLocalMemory& mem = m_state->m_mem; - const GSOffset* RESTRICT o = m_offset; + const GSOffset* RESTRICT off = m_offset; uint32 blocks = 0; @@ -274,11 +274,11 @@ bool GSTextureCacheSW::Texture::Update(const GSVector4i& rect) { for(int y = r.top; y < r.bottom; y += bs.y, dst += block_pitch) { - uint32 base = o->block.row[y]; + uint32 base = off->block.row[y]; for(int x = r.left, i = (y << 7) + x; x < r.right; x += bs.x, i += bs.x) { - uint32 block = base + o->block.col[x]; + uint32 block = base + off->block.col[x]; if(block < MAX_BLOCKS) { @@ -301,11 +301,11 @@ bool GSTextureCacheSW::Texture::Update(const GSVector4i& rect) { for(int y = r.top; y < r.bottom; y += bs.y, dst += block_pitch) { - uint32 base = o->block.row[y]; + uint32 base = off->block.row[y]; for(int x = r.left; x < r.right; x += bs.x) { - uint32 block = base + o->block.col[x]; + uint32 block = base + off->block.col[x]; if(block < MAX_BLOCKS) { diff --git a/plugins/GSdx/GSVertexTrace.cpp b/plugins/GSdx/GSVertexTrace.cpp index 1a979f0411..bd5409ea6f 100644 --- a/plugins/GSdx/GSVertexTrace.cpp +++ b/plugins/GSdx/GSVertexTrace.cpp @@ -445,11 +445,11 @@ void GSVertexTrace::FindMinMax(const void* vertex, const uint32* index, int coun #endif - GSVector4 o(context->XYOFFSET); + GSVector4 off(context->XYOFFSET); GSVector4 s(1.0f / 16, 1.0f / 16, 2.0f, 1.0f); - m_min.p = (GSVector4(pmin) - o) * s; - m_max.p = (GSVector4(pmax) - o) * s; + m_min.p = (GSVector4(pmin) - off) * s; + m_max.p = (GSVector4(pmax) - off) * s; if(tme) { diff --git a/plugins/GSdx/stdafx.cpp b/plugins/GSdx/stdafx.cpp index 6cc39e5e57..3d07dbe444 100644 --- a/plugins/GSdx/stdafx.cpp +++ b/plugins/GSdx/stdafx.cpp @@ -113,10 +113,10 @@ void* _aligned_malloc(size_t size, size_t alignment) { ASSERT(alignment <= 0x8000); size_t r = (size_t)malloc(size + --alignment + 2); - size_t o = (r + 2 + alignment) & ~(size_t)alignment; + size_t off = (r + 2 + alignment) & ~(size_t)alignment; if(!r) return NULL; - ((uint16*)o)[-1] = (uint16)(o-r); - return (void*)o; + ((uint16*)off)[-1] = (uint16)(off-r); + return (void*)off; } void _aligned_free(void* p)