From 641d7badb70e58c4fbab04fa70212e6e7b7cdaaa Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Sun, 20 Feb 2022 00:15:43 +0000 Subject: [PATCH] Fix GTE directly referencing psxRegs It should reference the 'regs' function argument instead. This makes it possible to use the latest Lightrec code with its new API, which has internal CP2 registers, without having to copy the registers back and forth between the internal ones and the psxRegs ones. Signed-off-by: Paul Cercueil --- libpcsxcore/gte.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpcsxcore/gte.c b/libpcsxcore/gte.c index 5164a892..4459600f 100644 --- a/libpcsxcore/gte.c +++ b/libpcsxcore/gte.c @@ -154,8 +154,8 @@ // sign-extended by bug in original hardware, according to Nocash docs // GTE section 'Screen Offset and Distance'. The emulator does this // sign extension when it is loaded to GTE by CTC2. -//#define gteH (psxRegs.CP2C.p[26].sw.l) -#define gteH (psxRegs.CP2C.p[26].w.l) +//#define gteH (regs->CP2C.p[26].sw.l) +#define gteH (regs->CP2C.p[26].w.l) #define gteDQA (regs->CP2C.p[27].sw.l) #define gteDQB (((s32 *)regs->CP2C.r)[28]) #define gteZSF3 (regs->CP2C.p[29].sw.l) -- 2.39.5