dont look at this, it doesnt work
This commit is contained in:
parent
57b1df8487
commit
a7b6a9af4d
|
@ -60,21 +60,24 @@ void CPU::enter() {
|
|||
scheduler.exit(Scheduler::ExitReason::SynchronizeEvent);
|
||||
}
|
||||
|
||||
if(status.nmi_pending) {
|
||||
status.nmi_pending = false;
|
||||
regs.vector = (regs.e == false ? 0xffea : 0xfffa);
|
||||
op_irq();
|
||||
}
|
||||
|
||||
if(status.irq_pending) {
|
||||
status.irq_pending = false;
|
||||
regs.vector = (regs.e == false ? 0xffee : 0xfffe);
|
||||
op_irq();
|
||||
}
|
||||
|
||||
if(regs.hang == HangType::Wait) this->op_wai();
|
||||
if (regs.hang == HangType::Wait) this->op_wai();
|
||||
else if (regs.hang == HangType::Stop) this->op_stp();
|
||||
else op_step();
|
||||
else
|
||||
{
|
||||
if(status.nmi_pending) {
|
||||
status.nmi_pending = false;
|
||||
regs.vector = (regs.e == false ? 0xffea : 0xfffa);
|
||||
op_irq();
|
||||
}
|
||||
|
||||
if(status.irq_pending) {
|
||||
status.irq_pending = false;
|
||||
regs.vector = (regs.e == false ? 0xffee : 0xfffe);
|
||||
op_irq();
|
||||
}
|
||||
|
||||
op_step();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,20 +19,25 @@ void SA1::enter() {
|
|||
scheduler.exit(Scheduler::ExitReason::SynchronizeEvent);
|
||||
}
|
||||
|
||||
if(mmio.sa1_rdyb || mmio.sa1_resb) {
|
||||
//SA-1 co-processor is asleep
|
||||
tick();
|
||||
synchronize_cpu();
|
||||
continue;
|
||||
}
|
||||
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();
|
||||
synchronize_cpu();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(status.interrupt_pending) {
|
||||
status.interrupt_pending = false;
|
||||
op_irq();
|
||||
continue;
|
||||
}
|
||||
if(status.interrupt_pending) {
|
||||
status.interrupt_pending = false;
|
||||
op_irq();
|
||||
continue;
|
||||
}
|
||||
|
||||
(this->*opcode_table[op_readpc()])();
|
||||
(this->*opcode_table[op_readpc()])();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -72,21 +72,29 @@ 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