Wrap I/O register reads

This can cause issues in big-endian platforms otherwise
This commit is contained in:
David Guillen Fandos 2023-04-19 20:03:11 +02:00
parent 413157dedd
commit 6eb1071dec
1 changed files with 1 additions and 1 deletions

2
cpu.c
View File

@ -1475,7 +1475,7 @@ void set_cpu_mode(cpu_mode_type new_mode)
#define cpu_has_interrupt() \ #define cpu_has_interrupt() \
(!(reg[REG_CPSR] & 0x80) && read_ioreg(REG_IME) && \ (!(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. // Returns whether the CPU has a pending interrupt.
cpu_alert_type check_interrupt() { cpu_alert_type check_interrupt() {