From 4f4e3fad85775f502d7d5863e906e589d3e8c3f3 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 3 May 2014 14:55:13 -0400 Subject: [PATCH] BPMemory: Clean up and rename some variables and comments This is about the register number, not the opcode. --- Source/Core/VideoCommon/BPMemory.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Core/VideoCommon/BPMemory.cpp b/Source/Core/VideoCommon/BPMemory.cpp index 1f74d8d36d..785d96292d 100644 --- a/Source/Core/VideoCommon/BPMemory.cpp +++ b/Source/Core/VideoCommon/BPMemory.cpp @@ -15,16 +15,15 @@ void BPWritten(const BPCmd& bp); // Call browser: OpcodeDecoding.cpp ExecuteDisplayList > Decode() > LoadBPReg() void LoadBPReg(u32 value0) { - //handle the mask register - int opcode = value0 >> 24; - int oldval = ((u32*)&bpmem)[opcode]; + int regNum = value0 >> 24; + int oldval = ((u32*)&bpmem)[regNum]; int newval = (oldval & ~bpmem.bpMask) | (value0 & bpmem.bpMask); int changes = (oldval ^ newval) & 0xFFFFFF; - BPCmd bp = {opcode, changes, newval}; + BPCmd bp = {regNum, changes, newval}; - //reset the mask register - if (opcode != 0xFE) + // Reset the mask register if we're not trying to set it ourselves. + if (regNum != BPMEM_BP_MASK) bpmem.bpMask = 0xFFFFFF; BPWritten(bp);