cpu/cpu - Implement stop mode
This commit is contained in:
parent
4e506a4d3c
commit
2ab37c6468
2 changed files with 4 additions and 0 deletions
|
@ -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()
|
||||
|
|
|
@ -92,6 +92,7 @@ struct Cpu_state {
|
|||
u8 IF;
|
||||
|
||||
bool halted;
|
||||
bool stopped;
|
||||
|
||||
void setAF(u16 v);
|
||||
u16 getAF();
|
||||
|
|
Loading…
Reference in a new issue