diff --git a/src/lib/cpu.c b/src/lib/cpu.c index 5761bca..24b800b 100644 --- a/src/lib/cpu.c +++ b/src/lib/cpu.c @@ -21,8 +21,6 @@ void cpu_reset(registers *reg) reg->halt = false; reg->stop = false; - reg->halt_mask = 0xFF; - reg->timer.tick = 0; reg->timer.div = 0; } @@ -55,12 +53,10 @@ static inline void check_halt_release(registers *reg, memory *mem) { uint8_t if_flags = mmu_read_byte(mem, MEM_IF_ADDR); if_flags &= mmu_read_byte(mem, MEM_IE_ADDR); - if_flags &= reg->halt_mask; if (if_flags) { reg->halt = false; - reg->halt_mask = 0xFF; } } diff --git a/src/lib/cpu.h b/src/lib/cpu.h index 0ea1f49..65c34a2 100644 --- a/src/lib/cpu.h +++ b/src/lib/cpu.h @@ -45,7 +45,6 @@ struct registers_s { uint16_t m, t; } clock; bool halt, stop; - uint8_t halt_mask; struct { unsigned int tick, div, t_timer; } timer; diff --git a/src/lib/cpu_inline.h b/src/lib/cpu_inline.h index 2bc22b5..acc721a 100644 --- a/src/lib/cpu_inline.h +++ b/src/lib/cpu_inline.h @@ -123,7 +123,6 @@ static inline void nop(registers *reg) static inline void halt(registers *reg, memory *mem) { reg->halt = true; - reg->halt_mask = ~mmu_read_byte(mem, MEM_IF_ADDR); reg->clock.last.t = 4; }