fix: Use flush_pipeline16 when branch exchange changes CPU to thumb mode

Former-commit-id: 6f9c01c6f7ad7be2889a18ca66f7d310fcaa7c35
This commit is contained in:
Michel Heily 2020-02-11 00:13:56 +02:00
parent c7a484fda5
commit 7736154b50

View file

@ -54,14 +54,14 @@ impl Core {
if addr.bit(0) {
addr = addr & !0x1;
self.cpsr.set_state(CpuState::THUMB);
self.pc = addr;
self.flush_pipeline16(sb);
} else {
addr = addr & !0x3;
self.cpsr.set_state(CpuState::ARM);
self.pc = addr;
self.flush_pipeline32(sb);
}
self.pc = addr;
self.flush_pipeline32(sb); // +1S+1N
}
/// Cycles 2S+1N