From bf6ed51b870df050c8f093f2944f91e30244c1cd Mon Sep 17 00:00:00 2001 From: "sl1nk3.s" Date: Mon, 28 Dec 2009 19:13:06 +0000 Subject: [PATCH] Fix an issue with BPMEM_LOADTLUT, thanks to revned @ issue 1831, also fix a speed issue int the FIFO loop introduced recently (ZWW was ~20% slower) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4739 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/InputCommon/Src/DirectInputBase.h | 5 ----- Source/Core/VideoCommon/Src/BPStructs.cpp | 7 ++++--- Source/Core/VideoCommon/Src/Fifo.cpp | 15 +++++++-------- Source/Core/VideoCommon/VideoCommon.vcproj | 2 +- Source/PluginSpecs/pluginspecs_pad.h | 2 +- Source/Plugins/Plugin_VideoDX9/Src/Render.cpp | 8 ++++++-- .../Plugin_VideoSoftware/Src/BPMemLoader.cpp | 5 +++-- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Source/Core/InputCommon/Src/DirectInputBase.h b/Source/Core/InputCommon/Src/DirectInputBase.h index a6b1fba183..22f7fb5d2e 100644 --- a/Source/Core/InputCommon/Src/DirectInputBase.h +++ b/Source/Core/InputCommon/Src/DirectInputBase.h @@ -19,17 +19,12 @@ #define _DIRECTINPUTBASE_H - -// Include -// ------------------- #include // System #include #define DIRECTINPUT_VERSION 0x0800 // DirectInput #include -//#include "ConsoleWindow.h" // Common - class DInput diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index 665a299458..befd0ad21f 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.cpp @@ -55,7 +55,7 @@ void BPWritten(const BPCmd& bp) some bp cases check the changes variable, because they might not have to be updated all the time NOTE: it seems not all bp cases like checking changes, so calling if (bp.changes == 0 ? false : true) had to be ditched and the games seem to work fine with out it. - NOTE2: Yet Another Gamecube Documentation calls them Bypass Registers but possibly completely wrong + NOTE2: Yet Another Gamecube Documentation calls them Bypass Raster State Registers but possibly completely wrong NOTE3: This controls the register groups: RAS1/2, SU, TF, TEV, C/Z, PEC TODO: Turn into function table. The (future) DisplayList (DL) jit can then call the functions directly, getting rid of dynamic dispatch. Unfortunately, few games use DLs properly - most\ @@ -247,8 +247,9 @@ void BPWritten(const BPCmd& bp) break; } - case BPMEM_LOADTLUT0: // Load a Texture Look Up Table - case BPMEM_LOADTLUT1: + case BPMEM_LOADTLUT0: // This one updates bpmem.tlutXferSrc, no need to do anything here. + break; + case BPMEM_LOADTLUT1: // Load a Texture Look Up Table { DVSTARTSUBPROFILE("LoadBPReg:GXLoadTlut"); diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 8c129ff87d..072bbaad28 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -133,8 +133,8 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize) while (fifoStateRun) { video_initialize.pPeekMessages(); - if (g_ActiveConfig.bEFBAccessEnable) - VideoFifo_CheckEFBAccess(); + + VideoFifo_CheckEFBAccess(); VideoFifo_CheckSwapRequest(); // check if we are able to run this buffer @@ -197,12 +197,11 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize) CommandProcessor::FifoCriticalLeave(); -/* - video_initialize.pPeekMessages(); - if (g_ActiveConfig.bEFBAccessEnable) - VideoFifo_CheckEFBAccess(); + // Those two are pretty important and must be called in the FIFO Loop. + // If we don't, s_swapRequested (OGL only) or s_efbAccessRequested won't be set to false + // leading the CPU thread to wait in Video_BeginField or Video_AccessEFB thus slowing things down. + VideoFifo_CheckEFBAccess(); VideoFifo_CheckSwapRequest(); -*/ } Common::AtomicStore(_fifo.CPReadIdle, 1); CommandProcessor::SetFifoIdleFromVideoPlugin(); @@ -211,7 +210,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize) { Common::YieldCPU(); } - } + } fifo_exit_event.Set(); } diff --git a/Source/Core/VideoCommon/VideoCommon.vcproj b/Source/Core/VideoCommon/VideoCommon.vcproj index a999d88369..ddb334f928 100644 --- a/Source/Core/VideoCommon/VideoCommon.vcproj +++ b/Source/Core/VideoCommon/VideoCommon.vcproj @@ -1,7 +1,7 @@ > 10; PixelEngine::pereg.boxTop = newvalue & 0x3ff; break; - case BPMEM_LOADTLUT0: // Load a Texture Look Up Table - case BPMEM_LOADTLUT1: + case BPMEM_LOADTLUT0: // This one updates bpmem.tlutXferSrc, no need to do anything here. + break; + case BPMEM_LOADTLUT1: // Load a Texture Look Up Table { u32 tlutTMemAddr = (newvalue & 0x3FF) << 9; u32 tlutXferCount = (newvalue & 0x1FFC00) >> 5;