chore: instantly refill the pipeline on flush
I believe this to be necessary in order to get hardware interrupts working. thumb.gba test 108 fails but I'm committing anyways (despite the regression) because this is kind of rebase/merge hell and I have something that at least sort of works rn
This commit is contained in:
@@ -77,10 +77,18 @@ pub fn fmt5(comptime op: u2, comptime h1: u1, comptime h2: u1) InstrFn {
|
||||
},
|
||||
0b11 => {
|
||||
// BX
|
||||
cpu.cpsr.t.write(src & 1 == 1);
|
||||
cpu.r[15] = src & 0xFFFF_FFFE;
|
||||
const thumb = src & 1 == 1;
|
||||
cpu.r[15] = src & ~@as(u32, 1);
|
||||
cpu.cpsr.t.write(thumb);
|
||||
|
||||
if (thumb) cpu.pipe.reload(u16, cpu) else cpu.pipe.reload(u32, cpu);
|
||||
|
||||
// Pipeline alrady flushed
|
||||
return; // FIXME: Is this necessary? (Refactor out?)
|
||||
},
|
||||
}
|
||||
|
||||
if (dst_idx == 0xF) cpu.pipe.reload(u16, cpu);
|
||||
}
|
||||
}.inner;
|
||||
}
|
||||
|
Reference in New Issue
Block a user