From 05b064d5138c20b2099aae17e9c544d3ebc4743f Mon Sep 17 00:00:00 2001
From: refractionpcsx2 <refraction@gmail.com>
Date: Fri, 30 Jun 2023 18:26:27 +0100
Subject: [PATCH] IOP/Counters: Fix off by 1 error

---
 pcsx2/IopCounters.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pcsx2/IopCounters.cpp b/pcsx2/IopCounters.cpp
index 3ca1a02c6e..bcbca5468a 100644
--- a/pcsx2/IopCounters.cpp
+++ b/pcsx2/IopCounters.cpp
@@ -258,8 +258,8 @@ static __fi void _rcntTestOverflow(int i)
 	// (high bit of the target gets set by rcntWtarget when the target is behind
 	// the counter value, and thus should not be flagged until after an overflow)
 
+	psxCounters[i].count -= maxTarget + 1;
 	psxCounters[i].target &= maxTarget;
-	psxCounters[i].count -= maxTarget;
 }
 
 /*