dont look at this, it doesnt work
This commit is contained in:
parent
57b1df8487
commit
a7b6a9af4d
|
@ -60,6 +60,10 @@ void CPU::enter() {
|
|||
scheduler.exit(Scheduler::ExitReason::SynchronizeEvent);
|
||||
}
|
||||
|
||||
if (regs.hang == HangType::Wait) this->op_wai();
|
||||
else if (regs.hang == HangType::Stop) this->op_stp();
|
||||
else
|
||||
{
|
||||
if(status.nmi_pending) {
|
||||
status.nmi_pending = false;
|
||||
regs.vector = (regs.e == false ? 0xffea : 0xfffa);
|
||||
|
@ -72,9 +76,8 @@ void CPU::enter() {
|
|||
op_irq();
|
||||
}
|
||||
|
||||
if(regs.hang == HangType::Wait) this->op_wai();
|
||||
else if (regs.hang == HangType::Stop) this->op_stp();
|
||||
else op_step();
|
||||
op_step();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,10 @@ void SA1::enter() {
|
|||
scheduler.exit(Scheduler::ExitReason::SynchronizeEvent);
|
||||
}
|
||||
|
||||
if (regs.hang == HangType::Wait) this->op_wai();
|
||||
else if (regs.hang == HangType::Stop) this->op_stp();
|
||||
else
|
||||
{
|
||||
if(mmio.sa1_rdyb || mmio.sa1_resb) {
|
||||
//SA-1 co-processor is asleep
|
||||
tick();
|
||||
|
@ -34,6 +38,7 @@ void SA1::enter() {
|
|||
|
||||
(this->*opcode_table[op_readpc()])();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SA1::op_irq() {
|
||||
|
|
|
@ -72,20 +72,28 @@ L rd.h = op_readlong(vectorN + 1);
|
|||
}
|
||||
|
||||
void CPUcore::op_stp() {
|
||||
if(regs.hang == HangType::Stop)
|
||||
goto SKIP;
|
||||
regs.hang = HangType::Stop;
|
||||
while(regs.wai = true) {
|
||||
L op_io();
|
||||
scheduler.exit(Scheduler::ExitReason::SynchronizeEvent);
|
||||
if (scheduler.exit_reason.value == Scheduler::ExitReason::SynchronizeEvent) return;
|
||||
SKIP: ;
|
||||
}
|
||||
regs.hang = HangType::None;
|
||||
}
|
||||
|
||||
void CPUcore::op_wai() {
|
||||
if (regs.hang == HangType::Wait)
|
||||
goto SKIP;
|
||||
regs.wai = true;
|
||||
regs.hang = HangType::Wait;
|
||||
while(regs.wai) {
|
||||
L op_io();
|
||||
scheduler.exit(Scheduler::ExitReason::SynchronizeEvent);
|
||||
if(scheduler.exit_reason.value == Scheduler::ExitReason::SynchronizeEvent) return;
|
||||
SKIP: ;
|
||||
}
|
||||
regs.hang = HangType::None;
|
||||
op_io();
|
||||
|
|
|
@ -25,6 +25,7 @@ void CPUcore::core_serialize(serializer &s) {
|
|||
s.integer(regs.wai);
|
||||
s.integer(regs.mdr);
|
||||
s.integer(regs.vector);
|
||||
s.integer((unsigned)regs.hang);
|
||||
|
||||
s.integer(aa.d);
|
||||
s.integer(rd.d);
|
||||
|
|
Loading…
Reference in New Issue