From f735fa43dffc92702b509243ff8fcc926d539e10 Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Thu, 11 Aug 2022 19:41:03 -0600 Subject: [PATCH] update core --- mupen64plus-core/src/device/r4300/cp0.c | 2 -- mupen64plus-core/src/device/r4300/cp0.h | 1 - mupen64plus-core/src/device/r4300/mips_instructions.def | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/mupen64plus-core/src/device/r4300/cp0.c b/mupen64plus-core/src/device/r4300/cp0.c index 0e70536..99dcc78 100644 --- a/mupen64plus-core/src/device/r4300/cp0.c +++ b/mupen64plus-core/src/device/r4300/cp0.c @@ -74,7 +74,6 @@ void poweron_cp0(struct cp0* cp0) cp0->half_count = 0; cp0->last_addr = UINT32_C(0xbfc00000); cp0->latch = 0; - cp0->instruction_counter = 0; init_interrupt(cp0); @@ -149,7 +148,6 @@ void cp0_startup_cycles(struct r4300_core* r4300) void cp0_base_cycle(struct r4300_core* r4300) { - ++r4300->cp0.instruction_counter; cp0_add_cycles(r4300, 1); } diff --git a/mupen64plus-core/src/device/r4300/cp0.h b/mupen64plus-core/src/device/r4300/cp0.h index 81bcc99..fb8355a 100644 --- a/mupen64plus-core/src/device/r4300/cp0.h +++ b/mupen64plus-core/src/device/r4300/cp0.h @@ -206,7 +206,6 @@ struct cp0 struct tlb tlb; uint8_t half_count; uint32_t latch; - uint32_t instruction_counter; }; #ifndef NEW_DYNAREC diff --git a/mupen64plus-core/src/device/r4300/mips_instructions.def b/mupen64plus-core/src/device/r4300/mips_instructions.def index f0c1678..a2659d6 100644 --- a/mupen64plus-core/src/device/r4300/mips_instructions.def +++ b/mupen64plus-core/src/device/r4300/mips_instructions.def @@ -1287,9 +1287,9 @@ static uint32_t set_random_reg(struct r4300_core* r4300) { uint32_t* cp0_regs = r4300_cp0_regs(&r4300->cp0); if (cp0_regs[CP0_WIRED_REG] > 31) - return (UINT32_MAX - r4300->cp0.instruction_counter) & 0x3F; + return (UINT32_MAX - cp0_regs[CP0_COUNT_REG]) & 0x3F; else - return (UINT32_MAX - r4300->cp0.instruction_counter) % (32 - cp0_regs[CP0_WIRED_REG]) + cp0_regs[CP0_WIRED_REG]; + return (UINT32_MAX - cp0_regs[CP0_COUNT_REG]) % (32 - cp0_regs[CP0_WIRED_REG]) + cp0_regs[CP0_WIRED_REG]; } DECLARE_INSTRUCTION(TLBWR)