Fixed trap handling.

This commit is contained in:
TomW 2014-03-29 17:35:50 +00:00
commit 7bfadae7f2

View file

@ -15,6 +15,8 @@ int nmi_enable = 1;
int inscounts[256]; int inscounts[256];
uint32_t oldpc2; uint32_t oldpc2;
int trap;
#define check_io_perm(port) if (!IOPLp || (eflags&VM_FLAG)) \ #define check_io_perm(port) if (!IOPLp || (eflags&VM_FLAG)) \
{ \ { \
int tempi = checkio(port); \ int tempi = checkio(port); \
@ -385,6 +387,7 @@ void x86_int_sw(int num)
loadcs(readmemw(0,addr+2)); loadcs(readmemw(0,addr+2));
} }
cycles-=70; cycles-=70;
trap = 0;
} }
void x86illegal() void x86illegal()
@ -1236,7 +1239,6 @@ void exec386(int cycs)
int tempi; int tempi;
int cycdiff; int cycdiff;
int oldcyc; int oldcyc;
int trap = flags & T_FLAG;
cycles+=cycs; cycles+=cycs;
// output=3; // output=3;
@ -1327,12 +1329,11 @@ opcodestart:
} }
cycdiff=oldcyc-cycles; cycdiff=oldcyc-cycles;
if (trap && (flags&T_FLAG)) if (trap)
{ {
flags_rebuild(); flags_rebuild();
// oldpc=pc; // oldpc=pc;
// oldcs=CS; // oldcs=CS;
// pclog("TRAP!!! %04X:%04X\n",CS,pc);
if (msw&1) if (msw&1)
{ {
pmodeint(1,0); pmodeint(1,0);