Applied the fix to the optional 486 implementation as well.
This commit is contained in:
@@ -341,7 +341,7 @@ block_ended:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!x86_was_reset && ins_fetch_fault)
|
if (is386 && !x86_was_reset && ins_fetch_fault)
|
||||||
x86gen();
|
x86gen();
|
||||||
} else if (new_ne) {
|
} else if (new_ne) {
|
||||||
flags_rebuild();
|
flags_rebuild();
|
||||||
|
|||||||
@@ -276,11 +276,7 @@ exec386_dynarec_int(void)
|
|||||||
cpu_block_end = 0;
|
cpu_block_end = 0;
|
||||||
x86_was_reset = 0;
|
x86_was_reset = 0;
|
||||||
|
|
||||||
# ifdef USE_DEBUG_REGS_486
|
|
||||||
if (trap & 2) {
|
|
||||||
# else
|
|
||||||
if (trap == 2) {
|
if (trap == 2) {
|
||||||
# endif
|
|
||||||
/* Handle the T bit in the new TSS first. */
|
/* Handle the T bit in the new TSS first. */
|
||||||
CPU_BLOCK_END();
|
CPU_BLOCK_END();
|
||||||
goto block_ended;
|
goto block_ended;
|
||||||
@@ -297,13 +293,6 @@ exec386_dynarec_int(void)
|
|||||||
cpu_state.ea_seg = &cpu_state.seg_ds;
|
cpu_state.ea_seg = &cpu_state.seg_ds;
|
||||||
cpu_state.ssegs = 0;
|
cpu_state.ssegs = 0;
|
||||||
|
|
||||||
# ifdef USE_DEBUG_REGS_486
|
|
||||||
if (UNLIKELY(cpu_386_check_instruction_fault())) {
|
|
||||||
x86gen();
|
|
||||||
goto block_ended;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
|
|
||||||
fetchdat = fastreadl_fetch(cs + cpu_state.pc);
|
fetchdat = fastreadl_fetch(cs + cpu_state.pc);
|
||||||
# ifdef ENABLE_386_DYNAREC_LOG
|
# ifdef ENABLE_386_DYNAREC_LOG
|
||||||
if (in_smm)
|
if (in_smm)
|
||||||
@@ -370,13 +359,7 @@ exec386_dynarec_int(void)
|
|||||||
|
|
||||||
block_ended:
|
block_ended:
|
||||||
if (!cpu_state.abrt && !new_ne && trap) {
|
if (!cpu_state.abrt && !new_ne && trap) {
|
||||||
# ifdef USE_DEBUG_REGS_486
|
|
||||||
//pclog("Debug trap 0x%X\n", trap);
|
|
||||||
if (trap & 2) dr[6] |= 0x8000;
|
|
||||||
if (trap & 1) dr[6] |= 0x4000;
|
|
||||||
# else
|
|
||||||
dr[6] |= (trap == 2) ? 0x8000 : 0x4000;
|
dr[6] |= (trap == 2) ? 0x8000 : 0x4000;
|
||||||
# endif
|
|
||||||
|
|
||||||
trap = 0;
|
trap = 0;
|
||||||
# ifndef USE_NEW_DYNAREC
|
# ifndef USE_NEW_DYNAREC
|
||||||
@@ -902,6 +885,9 @@ exec386(int32_t cycs)
|
|||||||
cycdiff = 0;
|
cycdiff = 0;
|
||||||
oldcyc = cycles;
|
oldcyc = cycles;
|
||||||
while (cycdiff < cycle_period) {
|
while (cycdiff < cycle_period) {
|
||||||
|
#ifdef USE_DEBUG_REGS_486
|
||||||
|
int ins_fetch_fault = 0;
|
||||||
|
#endif
|
||||||
ins_cycles = cycles;
|
ins_cycles = cycles;
|
||||||
|
|
||||||
#ifndef USE_NEW_DYNAREC
|
#ifndef USE_NEW_DYNAREC
|
||||||
@@ -919,8 +905,14 @@ exec386(int32_t cycs)
|
|||||||
cpu_state.ssegs = 0;
|
cpu_state.ssegs = 0;
|
||||||
|
|
||||||
#ifdef USE_DEBUG_REGS_486
|
#ifdef USE_DEBUG_REGS_486
|
||||||
if (UNLIKELY(cpu_386_check_instruction_fault())) {
|
if (is386)
|
||||||
|
ins_fetch_fault = cpu_386_check_instruction_fault();
|
||||||
|
|
||||||
|
/* Breakpoint fault has priority over other faults. */
|
||||||
|
if ((cpu_state.abrt == 0) & ins_fetch_fault) {
|
||||||
x86gen();
|
x86gen();
|
||||||
|
ins_fetch_fault = 0;
|
||||||
|
/* No instructions executed at this point. */
|
||||||
goto block_ended;
|
goto block_ended;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -972,11 +964,13 @@ exec386(int32_t cycs)
|
|||||||
block_ended:
|
block_ended:
|
||||||
#endif
|
#endif
|
||||||
if (cpu_state.abrt) {
|
if (cpu_state.abrt) {
|
||||||
|
uint8_t oop = opcode;
|
||||||
flags_rebuild();
|
flags_rebuild();
|
||||||
tempi = cpu_state.abrt & ABRT_MASK;
|
tempi = cpu_state.abrt & ABRT_MASK;
|
||||||
cpu_state.abrt = 0;
|
cpu_state.abrt = 0;
|
||||||
x86_doabrt(tempi);
|
x86_doabrt(tempi);
|
||||||
if (cpu_state.abrt) {
|
if (cpu_state.abrt) {
|
||||||
|
pclog("Double fault - %02X\n", oop);
|
||||||
cpu_state.abrt = 0;
|
cpu_state.abrt = 0;
|
||||||
#ifndef USE_NEW_DYNAREC
|
#ifndef USE_NEW_DYNAREC
|
||||||
CS = oldcs;
|
CS = oldcs;
|
||||||
@@ -993,6 +987,11 @@ block_ended:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_DEBUG_REGS_486
|
||||||
|
if (is386 && !x86_was_reset && ins_fetch_fault)
|
||||||
|
x86gen();
|
||||||
|
#endif
|
||||||
} else if (new_ne) {
|
} else if (new_ne) {
|
||||||
flags_rebuild();
|
flags_rebuild();
|
||||||
|
|
||||||
@@ -1005,20 +1004,14 @@ block_ended:
|
|||||||
} else if (trap) {
|
} else if (trap) {
|
||||||
flags_rebuild();
|
flags_rebuild();
|
||||||
#ifdef USE_DEBUG_REGS_486
|
#ifdef USE_DEBUG_REGS_486
|
||||||
if (trap & 1)
|
if (trap & 2) dr[6] |= 0x8000;
|
||||||
dr[6] |= 0x4000;
|
if (trap & 1) dr[6] |= 0x4000;
|
||||||
if (trap & 2)
|
|
||||||
dr[6] |= 0x8000;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
trap = 0;
|
trap = 0;
|
||||||
#ifndef USE_NEW_DYNAREC
|
#ifndef USE_NEW_DYNAREC
|
||||||
oldcs = CS;
|
oldcs = CS;
|
||||||
#endif
|
#endif
|
||||||
cpu_state.oldpc = cpu_state.pc;
|
cpu_state.oldpc = cpu_state.pc;
|
||||||
#ifndef USE_DEBUG_REGS_486
|
|
||||||
dr[6] |= 0x4000;
|
|
||||||
#endif
|
|
||||||
x86_int(1);
|
x86_int(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user