From 046fdb5bc953ee0acbcc60d6e921dbfd64a613ca Mon Sep 17 00:00:00 2001 From: SimoneN64 Date: Wed, 25 Oct 2023 22:59:41 +0200 Subject: [PATCH] These are annoying if inlined --- src/backend/core/Interpreter.cpp | 20 ++++++++++++++++++++ src/backend/core/Interpreter.hpp | 22 ++-------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/backend/core/Interpreter.cpp b/src/backend/core/Interpreter.cpp index ffa3cb57..58484579 100644 --- a/src/backend/core/Interpreter.cpp +++ b/src/backend/core/Interpreter.cpp @@ -1,6 +1,26 @@ #include namespace n64 { + +bool Interpreter::ShouldServiceInterrupt() { + bool interrupts_pending = (regs.cop0.status.im & regs.cop0.cause.interruptPending) != 0; + bool interrupts_enabled = regs.cop0.status.ie == 1; + bool currently_handling_exception = regs.cop0.status.exl == 1; + bool currently_handling_error = regs.cop0.status.erl == 1; + + return interrupts_pending && interrupts_enabled && + !currently_handling_exception && !currently_handling_error; +} + +void Interpreter::CheckCompareInterrupt() { + regs.cop0.count++; + regs.cop0.count &= 0x1FFFFFFFF; + if(regs.cop0.count == (u64)regs.cop0.compare << 1) { + regs.cop0.cause.ip7 = 1; + UpdateInterrupt(mem.mmio.mi, regs); + } +} + int Interpreter::Step() { CheckCompareInterrupt(); diff --git a/src/backend/core/Interpreter.hpp b/src/backend/core/Interpreter.hpp index fd384b95..e1aeca6d 100644 --- a/src/backend/core/Interpreter.hpp +++ b/src/backend/core/Interpreter.hpp @@ -13,26 +13,8 @@ private: u64 cop2Latch{}; friend struct Cop1; #define check_address_error(mask, vaddr) (((!regs.cop0.is_64bit_addressing) && (s32)(vaddr) != (vaddr)) || (((vaddr) & (mask)) != 0)) - - [[nodiscard]] FORCE_INLINE bool ShouldServiceInterrupt() override { - bool interrupts_pending = (regs.cop0.status.im & regs.cop0.cause.interruptPending) != 0; - bool interrupts_enabled = regs.cop0.status.ie == 1; - bool currently_handling_exception = regs.cop0.status.exl == 1; - bool currently_handling_error = regs.cop0.status.erl == 1; - - return interrupts_pending && interrupts_enabled && - !currently_handling_exception && !currently_handling_error; - } - - FORCE_INLINE void CheckCompareInterrupt() override { - regs.cop0.count++; - regs.cop0.count &= 0x1FFFFFFFF; - if(regs.cop0.count == (u64)regs.cop0.compare << 1) { - regs.cop0.cause.ip7 = 1; - UpdateInterrupt(mem.mmio.mi, regs); - } - } - + bool ShouldServiceInterrupt() override; + void CheckCompareInterrupt() override; void cop2Decode(u32); void special(u32); void regimm(u32);