From 49d1da5e7e0e9ba3aecc8fc02285ca537623c3ea Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Mon, 27 Aug 2012 23:51:35 +0200 Subject: [PATCH] Video_Software: Fix stuff. --- .../Plugin_VideoSoftware/Src/BPMemLoader.cpp | 18 ++++++++++++------ .../Plugin_VideoSoftware/Src/Rasterizer.cpp | 7 +++++-- .../Plugin_VideoSoftware/Src/SWPixelEngine.cpp | 2 +- .../Plugin_VideoSoftware/Src/SWPixelEngine.h | 18 ++++++++++++------ .../Plugins/Plugin_VideoSoftware/Src/Tev.cpp | 9 ++++++--- 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/BPMemLoader.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/BPMemLoader.cpp index ad730a485c..4de9f435fa 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/BPMemLoader.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/BPMemLoader.cpp @@ -92,12 +92,18 @@ void SWBPWritten(int address, int newvalue) break; case BPMEM_CLEAR_PIXEL_PERF: // TODO: Parameter? - SWPixelEngine::pereg.perfZcompInputZcomploc = 0; - SWPixelEngine::pereg.perfZcompOutputZcomploc = 0; - SWPixelEngine::pereg.perfZcompInput = 0; - SWPixelEngine::pereg.perfZcompOutput = 0; - SWPixelEngine::pereg.perfBlendInput = 0; - SWPixelEngine::pereg.perfEfbCopyClocks = 0; + SWPixelEngine::pereg.perfZcompInputZcomplocLo = 0; + SWPixelEngine::pereg.perfZcompInputZcomplocHi = 0; + SWPixelEngine::pereg.perfZcompOutputZcomplocLo = 0; + SWPixelEngine::pereg.perfZcompOutputZcomplocHi = 0; + SWPixelEngine::pereg.perfZcompInputLo = 0; + SWPixelEngine::pereg.perfZcompInputHi = 0; + SWPixelEngine::pereg.perfZcompOutputLo = 0; + SWPixelEngine::pereg.perfZcompOutputHi = 0; + SWPixelEngine::pereg.perfBlendInputLo = 0; + SWPixelEngine::pereg.perfBlendInputHi = 0; + SWPixelEngine::pereg.perfEfbCopyClocksLo = 0; + SWPixelEngine::pereg.perfEfbCopyClocksHi = 0; break; case BPMEM_LOADTLUT0: // This one updates bpmem.tlutXferSrc, no need to do anything here. break; diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp index a23d85f27f..c9c3b8c26c 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp @@ -129,14 +129,17 @@ inline void Draw(s32 x, s32 y, s32 xi, s32 yi) if (bpmem.zcontrol.zcomploc) { // TODO: Verify that perf regs are being incremented even if test is disabled - SWPixelEngine::pereg.perfZcompInputZcomploc++; + if (++SWPixelEngine::pereg.perfZcompInputZcomplocLo == 0) + SWPixelEngine::pereg.perfZcompInputZcomplocHi++; + if (bpmem.zmode.testenable) { // early z if (!EfbInterface::ZCompare(x, y, z)) return; } - SWPixelEngine::pereg.perfZcompOutputZcomploc++; + if (++SWPixelEngine::pereg.perfZcompOutputZcomplocLo == 0) + SWPixelEngine::pereg.perfZcompOutputZcomplocHi++; } RasterBlockPixel& pixel = rasterBlock.Pixel[xi][yi]; diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWPixelEngine.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWPixelEngine.cpp index 63885513f5..d489d033ae 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWPixelEngine.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWPixelEngine.cpp @@ -82,7 +82,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress) if (address > 0x16) { - ERROR_LOG(PIXELENGINE, "addr %#08x, ret %#08x; %#08x, %#08x, %#08x, %#08x, %#08x, %#08x\n", address, _uReturnValue, pereg.perfZcompInputZcomploc, pereg.perfZcompOutputZcomploc, pereg.perfZcompInput, pereg.perfZcompOutput, pereg.perfBlendInput, pereg.perfEfbCopyClocks); + ERROR_LOG(PIXELENGINE, "addr %#08x, ret %#08x\n", address, _uReturnValue); } } diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWPixelEngine.h b/Source/Plugins/Plugin_VideoSoftware/Src/SWPixelEngine.h index 764488c32e..7deb69a164 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWPixelEngine.h +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWPixelEngine.h @@ -146,12 +146,18 @@ namespace SWPixelEngine u16 boxTop; u16 boxBottom; - u16 perfZcompInputZcomploc; - u16 perfZcompOutputZcomploc; - u16 perfZcompInput; - u16 perfZcompOutput; - u16 perfBlendInput; - u16 perfEfbCopyClocks; + u16 perfZcompInputZcomplocLo; + u16 perfZcompInputZcomplocHi; + u16 perfZcompOutputZcomplocLo; + u16 perfZcompOutputZcomplocHi; + u16 perfZcompInputLo; + u16 perfZcompInputHi; + u16 perfZcompOutputLo; + u16 perfZcompOutputHi; + u16 perfBlendInputLo; + u16 perfBlendInputHi; + u16 perfEfbCopyClocksLo; + u16 perfEfbCopyClocksHi; }; extern PEReg pereg; diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Tev.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/Tev.cpp index 83d9de2784..fad8806a9f 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Tev.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Tev.cpp @@ -787,13 +787,15 @@ void Tev::Draw() if (!bpmem.zcontrol.zcomploc) { - SWPixelEngine::pereg.perfZcompInput++; + if (++SWPixelEngine::pereg.perfZcompInputLo == 0) + SWPixelEngine::pereg.perfZcompInputHi++; if (bpmem.zmode.testenable) { if (!EfbInterface::ZCompare(Position[0], Position[1], Position[2])) return; } - SWPixelEngine::pereg.perfZcompOutput++; + if (++SWPixelEngine::pereg.perfZcompOutputLo == 0) + SWPixelEngine::pereg.perfZcompOutputHi++; } #if ALLOW_TEV_DUMPS @@ -818,7 +820,8 @@ void Tev::Draw() INCSTAT(swstats.thisFrame.tevPixelsOut); - SWPixelEngine::pereg.perfBlendInput++; + if (++SWPixelEngine::pereg.perfBlendInputLo) + SWPixelEngine::pereg.perfBlendInputHi++; EfbInterface::BlendTev(Position[0], Position[1], output); }