mirror of
https://github.com/transistorfet/moa.git
synced 2024-06-07 03:29:27 +00:00
Added hack to return instructions to correctly adjust PC
This commit is contained in:
parent
fa3e484288
commit
1a65f50ba0
|
@ -801,18 +801,27 @@ impl M68k {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.set_sr(sr);
|
self.set_sr(sr);
|
||||||
self.set_pc(addr)?;
|
if let Err(err) = self.set_pc(addr) {
|
||||||
|
self.state.pc -= 2;
|
||||||
|
return Err(err);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Instruction::RTR => {
|
Instruction::RTR => {
|
||||||
let ccr = self.pop_word()?;
|
let ccr = self.pop_word()?;
|
||||||
let addr = self.pop_long()?;
|
let addr = self.pop_long()?;
|
||||||
self.set_sr((self.state.sr & 0xFF00) | (ccr & 0x00FF));
|
self.set_sr((self.state.sr & 0xFF00) | (ccr & 0x00FF));
|
||||||
self.set_pc(addr)?;
|
if let Err(err) = self.set_pc(addr) {
|
||||||
|
self.state.pc -= 2;
|
||||||
|
return Err(err);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Instruction::RTS => {
|
Instruction::RTS => {
|
||||||
self.debugger.stack_tracer.pop_return();
|
self.debugger.stack_tracer.pop_return();
|
||||||
let addr = self.pop_long()?;
|
let addr = self.pop_long()?;
|
||||||
self.set_pc(addr)?;
|
if let Err(err) = self.set_pc(addr) {
|
||||||
|
self.state.pc -= 2;
|
||||||
|
return Err(err);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//Instruction::RTD(i16) => {
|
//Instruction::RTD(i16) => {
|
||||||
//},
|
//},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user