From aa88d8b790c8fcc8cf0a4e6f7497a3b36eb129c1 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Fri, 16 Jul 2010 21:51:35 +0000 Subject: [PATCH] Since apparently no one feels like fixing SMG FIFO overflows, commit iceman4love77's fix. No idea if it works or what it does, he seemed pretty confident that it works though. Only fail once if EFB pokes are requested in DX9/DX11. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5888 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Core/VideoCommon/Src/CommandProcessor.cpp | 2 +- .../Plugins/Plugin_VideoDX11/Src/Render.cpp | 17 ++++++++++------ Source/Plugins/Plugin_VideoDX9/Src/Render.cpp | 20 +++++++++++-------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 7ee11e5a1f..82e599432b 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -495,7 +495,7 @@ void Write16(const u16 _Value, const u32 _Address) case FIFO_HI_WATERMARK_HI: WriteHigh((u32 &)fifo.CPHiWatermark, _Value); // Tune this when you see lots of FIFO overflown by GatherPipe - HiWatermark_Tighter = fifo.CPHiWatermark - 32 * 50; + HiWatermark_Tighter = fifo.CPHiWatermark - 32 * 20; DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_HI_WATERMARK_HI : %04x", _Value); break; diff --git a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp index d5a81ee5ec..2e904eb880 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp @@ -604,6 +604,15 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y) if (!g_ActiveConfig.bEFBAccessEnable) return 0; + if (type == POKE_Z || type == POKE_COLOR) + { + static bool alert_only_once = true; + if (!alert_only_once) return 0; + PanicAlert("Poke EFB not implemented"); + alert_only_once = false; + return 0; + } + // get the rectangular target region covered by the EFB pixel EFBRectangle efbPixelRc; efbPixelRc.left = x; @@ -674,16 +683,12 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y) z = ((u32)(val * 0xffffff)); break; - case POKE_Z: - PanicAlert("Poke Z-buffer not implemented"); - break; - case PEEK_COLOR: z = ((u32*)map.pData)[0]; break; - case POKE_COLOR: - PanicAlert("Poke color EFB not implemented"); + // TODO: Implement POKE_Z and POKE_COLOR + default: break; } D3D::context->Unmap(read_tex, 0); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index 0639557338..15dc7bde67 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -632,6 +632,15 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y) if (!g_ActiveConfig.bEFBAccessEnable) return 0; + if (type == POKE_Z || type == POKE_COLOR) + { + static bool alert_only_once = true; + if (!alert_only_once) return 0; + PanicAlert("Poke EFB not implemented"); + alert_only_once = false; + return 0; + } + // Get the working buffer LPDIRECT3DSURFACE9 pBuffer = (type == PEEK_Z || type == POKE_Z) ? FBManager.GetEFBDepthRTSurface() : FBManager.GetEFBColorRTSurface(); @@ -792,19 +801,14 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y) z = ((u32)(val * 0xffffff)); } break; - case POKE_Z: - // TODO: Get that Z value to poke from somewhere - //((float *)drect.pBits)[0] = val; - PanicAlert("Poke Z-buffer not implemented"); - break; case PEEK_COLOR: z = ((u32 *)drect.pBits)[0]; break; case POKE_COLOR: - // TODO: Get that ARGB value to poke from somewhere - //((float*)drect.pBits)[0] = val; - PanicAlert("Poke color EFB not implemented"); + + // TODO: Implement POKE_Z and POKE_COLOR + default: break; }