Improved STI fix.

This commit is contained in:
OBattler
2020-11-21 04:02:58 +01:00
parent ba35c158db
commit b83a32ccf8
2 changed files with 18 additions and 17 deletions

View File

@@ -257,6 +257,9 @@ exec386(int cycs)
if (!use32) cpu_state.pc &= 0xffff; if (!use32) cpu_state.pc &= 0xffff;
#endif #endif
if (cpu_end_block_after_ins)
cpu_end_block_after_ins--;
if (cpu_state.abrt) { if (cpu_state.abrt) {
flags_rebuild(); flags_rebuild();
tempi = cpu_state.abrt & ABRT_MASK; tempi = cpu_state.abrt & ABRT_MASK;
@@ -329,8 +332,6 @@ exec386(int cycs)
} }
} }
cpu_end_block_after_ins = 0;
ins_cycles -= cycles; ins_cycles -= cycles;
tsc += ins_cycles; tsc += ins_cycles;

View File

@@ -349,6 +349,12 @@ exec386_dynarec_int(void)
if (((cs + cpu_state.pc) >> 12) != pccache) if (((cs + cpu_state.pc) >> 12) != pccache)
CPU_BLOCK_END(); CPU_BLOCK_END();
if (cpu_end_block_after_ins) {
cpu_end_block_after_ins--;
if (!cpu_end_block_after_ins)
CPU_BLOCK_END();
}
if (cpu_state.abrt) if (cpu_state.abrt)
CPU_BLOCK_END(); CPU_BLOCK_END();
if (smi_line) if (smi_line)
@@ -357,14 +363,8 @@ exec386_dynarec_int(void)
CPU_BLOCK_END(); CPU_BLOCK_END();
else if (nmi && nmi_enable && nmi_mask) else if (nmi && nmi_enable && nmi_mask)
CPU_BLOCK_END(); CPU_BLOCK_END();
else if ((cpu_state.flags & I_FLAG) && pic.int_pending) else if ((cpu_state.flags & I_FLAG) && pic.int_pending && !cpu_end_block_after_ins)
CPU_BLOCK_END(); CPU_BLOCK_END();
if (cpu_end_block_after_ins) {
cpu_end_block_after_ins--;
if (!cpu_end_block_after_ins)
CPU_BLOCK_END();
}
} }
if (trap) { if (trap) {
@@ -585,21 +585,21 @@ exec386_dynarec_dyn(void)
#endif #endif
CPU_BLOCK_END(); CPU_BLOCK_END();
if (cpu_end_block_after_ins) {
cpu_end_block_after_ins--;
if (!cpu_end_block_after_ins)
CPU_BLOCK_END();
}
if (smi_line) if (smi_line)
CPU_BLOCK_END(); CPU_BLOCK_END();
else if (cpu_state.flags & T_FLAG) else if (cpu_state.flags & T_FLAG)
CPU_BLOCK_END(); CPU_BLOCK_END();
else if (nmi && nmi_enable && nmi_mask) else if (nmi && nmi_enable && nmi_mask)
CPU_BLOCK_END(); CPU_BLOCK_END();
else if ((cpu_state.flags & I_FLAG) && pic.int_pending) else if ((cpu_state.flags & I_FLAG) && pic.int_pending && !cpu_end_block_after_ins)
CPU_BLOCK_END(); CPU_BLOCK_END();
if (cpu_end_block_after_ins) {
cpu_end_block_after_ins--;
if (!cpu_end_block_after_ins)
CPU_BLOCK_END();
}
if (cpu_state.abrt) { if (cpu_state.abrt) {
if (!(cpu_state.abrt & ABRT_EXPECTED)) if (!(cpu_state.abrt & ABRT_EXPECTED))
codegen_block_remove(); codegen_block_remove();
@@ -683,7 +683,7 @@ exec386_dynarec_dyn(void)
CPU_BLOCK_END(); CPU_BLOCK_END();
else if (nmi && nmi_enable && nmi_mask) else if (nmi && nmi_enable && nmi_mask)
CPU_BLOCK_END(); CPU_BLOCK_END();
else if ((cpu_state.flags & I_FLAG) && pic.int_pending) else if ((cpu_state.flags & I_FLAG) && pic.int_pending && !cpu_end_block_after_ins)
CPU_BLOCK_END(); CPU_BLOCK_END();
if (cpu_end_block_after_ins) { if (cpu_end_block_after_ins) {