Moved more variables into cpu_state structure.
This commit is contained in:
parent
c664682758
commit
eb126fd822
50 changed files with 1454 additions and 1481 deletions
22
src/386.c
22
src/386.c
|
|
@ -46,7 +46,7 @@ uint32_t rmdat32;
|
|||
#define fetchdat rmdat32
|
||||
uint32_t backupregs[16];
|
||||
extern int oddeven;
|
||||
int inttype,abrt;
|
||||
int inttype;
|
||||
|
||||
|
||||
uint32_t oldcs2;
|
||||
|
|
@ -172,8 +172,8 @@ static inline void fetch_ea_16_long(uint32_t rmdat)
|
|||
}
|
||||
}
|
||||
|
||||
#define fetch_ea_16(rmdat) cpu_state.pc++; cpu_mod=(rmdat >> 6) & 3; cpu_reg=(rmdat >> 3) & 7; cpu_rm = rmdat & 7; if (cpu_mod != 3) { fetch_ea_16_long(rmdat); if (abrt) return 0; }
|
||||
#define fetch_ea_32(rmdat) cpu_state.pc++; cpu_mod=(rmdat >> 6) & 3; cpu_reg=(rmdat >> 3) & 7; cpu_rm = rmdat & 7; if (cpu_mod != 3) { fetch_ea_32_long(rmdat); } if (abrt) return 0
|
||||
#define fetch_ea_16(rmdat) cpu_state.pc++; cpu_mod=(rmdat >> 6) & 3; cpu_reg=(rmdat >> 3) & 7; cpu_rm = rmdat & 7; if (cpu_mod != 3) { fetch_ea_16_long(rmdat); if (cpu_state.abrt) return 0; }
|
||||
#define fetch_ea_32(rmdat) cpu_state.pc++; cpu_mod=(rmdat >> 6) & 3; cpu_reg=(rmdat >> 3) & 7; cpu_rm = rmdat & 7; if (cpu_mod != 3) { fetch_ea_32_long(rmdat); } if (cpu_state.abrt) return 0
|
||||
|
||||
#include "x86_flags.h"
|
||||
|
||||
|
|
@ -246,7 +246,7 @@ dontprint=0;
|
|||
opcodestart:
|
||||
fetchdat = fastreadl(cs + cpu_state.pc);
|
||||
|
||||
if (!abrt)
|
||||
if (!cpu_state.abrt)
|
||||
{
|
||||
trap = flags & T_FLAG;
|
||||
opcode = fetchdat & 0xFF;
|
||||
|
|
@ -262,7 +262,7 @@ opcodestart:
|
|||
|
||||
if (!use32) cpu_state.pc &= 0xffff;
|
||||
|
||||
if (abrt)
|
||||
if (cpu_state.abrt)
|
||||
{
|
||||
flags_rebuild();
|
||||
// pclog("Abort\n");
|
||||
|
|
@ -276,19 +276,19 @@ opcodestart:
|
|||
if (testr[6]!=EBP) pclog("EBP corrupted %08X\n",pc);
|
||||
if (testr[7]!=ESP) pclog("ESP corrupted %08X\n",pc);*/
|
||||
/* if (testr[8]!=flags) pclog("FLAGS corrupted %08X\n",pc);*/
|
||||
tempi = abrt;
|
||||
abrt = 0;
|
||||
tempi = cpu_state.abrt;
|
||||
cpu_state.abrt = 0;
|
||||
x86_doabrt(tempi);
|
||||
if (abrt)
|
||||
if (cpu_state.abrt)
|
||||
{
|
||||
abrt = 0;
|
||||
cpu_state.abrt = 0;
|
||||
CS = oldcs;
|
||||
cpu_state.pc = cpu_state.oldpc;
|
||||
pclog("Double fault %i\n", ins);
|
||||
pmodeint(8, 0);
|
||||
if (abrt)
|
||||
if (cpu_state.abrt)
|
||||
{
|
||||
abrt = 0;
|
||||
cpu_state.abrt = 0;
|
||||
softresetx86();
|
||||
pclog("Triple fault - reset\n");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue