summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BPStructs.cpp
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2021-04-22 20:57:56 -0700
committerPokechu22 <Pokechu022@gmail.com>2021-12-18 15:21:36 -0800
commitb5fd35f95145ecc8f88a179229ed69b390eb76be (patch)
tree7b6700d35c609ba6a43fcdf55a12d6756e9a206b /Source/Core/VideoCommon/BPStructs.cpp
parent04418262063bf6034bc2be172a64eb99a9e9a2bb (diff)
Refactor OpcodeDecoding and FIFO analyzer to use callbacks
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/BPStructs.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp
index 0fc4ca6785..503ef6154f 100644
--- a/Source/Core/VideoCommon/BPStructs.cpp
+++ b/Source/Core/VideoCommon/BPStructs.cpp
@@ -716,29 +716,27 @@ static void BPWritten(const BPCmd& bp, int cycles_into_future)
bp.newvalue);
}
-// Call browser: OpcodeDecoding.cpp ExecuteDisplayList > Decode() > LoadBPReg()
-void LoadBPReg(u32 value0, int cycles_into_future)
+// Call browser: OpcodeDecoding.cpp RunCallback::OnBP()
+void LoadBPReg(u8 reg, u32 value, int cycles_into_future)
{
- int regNum = value0 >> 24;
- int oldval = ((u32*)&bpmem)[regNum];
- int newval = (oldval & ~bpmem.bpMask) | (value0 & bpmem.bpMask);
+ int oldval = ((u32*)&bpmem)[reg];
+ int newval = (oldval & ~bpmem.bpMask) | (value & bpmem.bpMask);
int changes = (oldval ^ newval) & 0xFFFFFF;
- BPCmd bp = {regNum, changes, newval};
+ BPCmd bp = {reg, changes, newval};
// Reset the mask register if we're not trying to set it ourselves.
- if (regNum != BPMEM_BP_MASK)
+ if (reg != BPMEM_BP_MASK)
bpmem.bpMask = 0xFFFFFF;
BPWritten(bp, cycles_into_future);
}
-void LoadBPRegPreprocess(u32 value0, int cycles_into_future)
+void LoadBPRegPreprocess(u8 reg, u32 value, int cycles_into_future)
{
- int regNum = value0 >> 24;
- // masking could hypothetically be a problem
- u32 newval = value0 & 0xffffff;
- switch (regNum)
+ // masking via BPMEM_BP_MASK could hypothetically be a problem
+ u32 newval = value & 0xffffff;
+ switch (reg)
{
case BPMEM_SETDRAWDONE:
if ((newval & 0xff) == 0x02)