From 6eb1071dec2e1bc8aab8fd28fbb3724a900a18e5 Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Wed, 19 Apr 2023 20:03:11 +0200 Subject: [PATCH] Wrap I/O register reads This can cause issues in big-endian platforms otherwise --- cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu.c b/cpu.c index 4d8e4f8..a2742dc 100644 --- a/cpu.c +++ b/cpu.c @@ -1475,7 +1475,7 @@ void set_cpu_mode(cpu_mode_type new_mode) #define cpu_has_interrupt() \ (!(reg[REG_CPSR] & 0x80) && read_ioreg(REG_IME) && \ - (read_ioreg(REG_IE) & io_registers[REG_IF])) + (read_ioreg(REG_IE) & read_ioreg(REG_IF))) // Returns whether the CPU has a pending interrupt. cpu_alert_type check_interrupt() {