Fix errors with trap flag and interrupts
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1387
This commit is contained in:
parent
66e76bc0d5
commit
63cd8d1b5d
2 changed files with 11 additions and 3 deletions
|
@ -115,6 +115,9 @@ static struct {
|
|||
PhysPt seg_prefix_base;
|
||||
bool rep_zero;
|
||||
GetEATable * ea_table;
|
||||
struct {
|
||||
bool skip;
|
||||
} trap;
|
||||
} core;
|
||||
|
||||
#include "instructions.h"
|
||||
|
@ -197,9 +200,10 @@ static Bits CPU_Core_Normal_Decode_Trap(void) {
|
|||
|
||||
Bits oldCycles = CPU_Cycles;
|
||||
CPU_Cycles = 1;
|
||||
core.trap.skip=false;
|
||||
|
||||
Bits ret=CPU_Core_Normal_Decode();
|
||||
|
||||
Interrupt(1);
|
||||
if (!core.trap.skip) Interrupt(1);
|
||||
|
||||
CPU_Cycles = oldCycles-1;
|
||||
cpudecoder = &CPU_Core_Normal_Decode;
|
||||
|
|
|
@ -496,6 +496,7 @@
|
|||
break;
|
||||
case 0x02: /* MOV SS,Ew */
|
||||
CPU_SetSegGeneral(ss,val);
|
||||
CPU_Cycles++; //Always do another instruction
|
||||
break;
|
||||
case 0x03: /* MOV DS,Ew */
|
||||
CPU_SetSegGeneral(ds,val);break;
|
||||
|
@ -759,7 +760,8 @@
|
|||
if (DEBUG_Breakpoint()) {
|
||||
return debugCallback;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
core.trap.skip=true;
|
||||
if (!Interrupt(3)) return CBRET_NONE;
|
||||
goto decode_start;
|
||||
CASE_B(0xcd) /* INT Ib */
|
||||
|
@ -771,6 +773,7 @@
|
|||
return debugCallback;
|
||||
}
|
||||
#endif
|
||||
core.trap.skip=true;
|
||||
if (!Interrupt(num)) return CBRET_NONE;
|
||||
goto decode_start; //Restore IP with a LOADIP
|
||||
}
|
||||
|
@ -778,6 +781,7 @@
|
|||
CASE_B(0xce) /* INTO */
|
||||
if (get_OF()) {
|
||||
LEAVECORE;
|
||||
core.trap.skip=true;
|
||||
if (!Interrupt(4)) return CBRET_NONE;
|
||||
goto decode_start; //Restore IP with a LOADIP
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue