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:
@@ -15,7 +15,7 @@ pub fn fmt16(comptime cond: u4) InstrFn {
|
||||
if (!checkCond(cpu.cpsr, cond)) return;
|
||||
|
||||
cpu.r[15] +%= sext(u32, u8, opcode & 0xFF) << 1;
|
||||
cpu.pipe.flush();
|
||||
cpu.pipe.reload(u16, cpu);
|
||||
}
|
||||
}.inner;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ pub fn fmt18() InstrFn {
|
||||
// B but conditional
|
||||
fn inner(cpu: *Arm7tdmi, _: *Bus, opcode: u16) void {
|
||||
cpu.r[15] +%= sext(u32, u11, opcode & 0x7FF) << 1;
|
||||
cpu.pipe.flush();
|
||||
cpu.pipe.reload(u16, cpu);
|
||||
}
|
||||
}.inner;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ pub fn fmt19(comptime is_low: bool) InstrFn {
|
||||
cpu.r[15] = cpu.r[14] +% (offset << 1);
|
||||
cpu.r[14] = next_opcode | 1;
|
||||
|
||||
cpu.pipe.flush();
|
||||
cpu.pipe.reload(u16, cpu);
|
||||
} else {
|
||||
// Instruction 1
|
||||
const lr_offset = sext(u32, u11, offset) << 12;
|
||||
|
Reference in New Issue
Block a user