cpu/cpu - Implement stop mode

This commit is contained in:
madmaurice 2023-08-29 23:46:36 +02:00
parent 4e506a4d3c
commit 2ab37c6468
2 changed files with 4 additions and 0 deletions

View file

@ -54,6 +54,8 @@ Cpu::Cpu(Mem_device* bus)
void Cpu::step()
{
if(stopped) return;
if(!handleInterrupts()) // if no isr has been called, decode an instruction
{
if (halted)
@ -82,6 +84,7 @@ void Cpu::reset()
state.IF = 0;
halted = false;
stopped = false;
}
u8 Cpu::readPC8()

View file

@ -92,6 +92,7 @@ struct Cpu_state {
u8 IF;
bool halted;
bool stopped;
void setAF(u16 v);
u16 getAF();