From 954be9e2d9bfca8b33ac1cb36d3226bf2555f2c1 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 5 Aug 2012 05:19:52 +0200 Subject: [PATCH] Handle BP mask register better to avoid useless BP writes (causing flushes) Patch from konpie: http://forums.dolphin-emulator.com/showthread.php?tid=24658 --- Source/Core/VideoCommon/Src/BPMemory.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Core/VideoCommon/Src/BPMemory.cpp b/Source/Core/VideoCommon/Src/BPMemory.cpp index 7272ed0993..7bc976a943 100644 --- a/Source/Core/VideoCommon/Src/BPMemory.cpp +++ b/Source/Core/VideoCommon/Src/BPMemory.cpp @@ -19,15 +19,18 @@ void LoadBPReg(u32 value0) int opcode = value0 >> 24; int oldval = ((u32*)&bpmem)[opcode]; int newval = (oldval & ~bpmem.bpMask) | (value0 & bpmem.bpMask); - int changes = (oldval ^ newval) & 0xFFFFFF; - BPCmd bp = {opcode, changes, newval}; - - //reset the mask register if (opcode != 0xFE) + { + //reset the mask register bpmem.bpMask = 0xFFFFFF; - BPWritten(bp); + int changes = (oldval ^ newval) & 0xFFFFFF; + BPCmd bp = {opcode, changes, newval}; + BPWritten(bp); + } + else + bpmem.bpMask = newval; } void GetBPRegInfo(const u8* data, char* name, size_t name_size, char* desc, size_t desc_size)