Skip to content

Commit

Permalink
Remove halt mask handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Veikko Soininen committed Feb 17, 2018
1 parent c44effe commit 01fa989
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/lib/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}

Expand Down
1 change: 0 additions & 1 deletion src/lib/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/lib/cpu_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 01fa989

Please sign in to comment.