Remove redundant oldcs variable - when processing an exception, oldcs and CS are the same.
This commit is contained in:
parent
427aa72a15
commit
ca89a51478
5 changed files with 2 additions and 38 deletions
|
|
@ -50,7 +50,6 @@ extern int oddeven;
|
||||||
int inttype;
|
int inttype;
|
||||||
|
|
||||||
|
|
||||||
uint32_t oldcs2;
|
|
||||||
uint32_t oldecx;
|
uint32_t oldecx;
|
||||||
|
|
||||||
uint32_t *eal_r, *eal_w;
|
uint32_t *eal_r, *eal_w;
|
||||||
|
|
@ -233,10 +232,8 @@ void exec386(int cycs)
|
||||||
/* testr[0]=EAX; testr[1]=EBX; testr[2]=ECX; testr[3]=EDX;
|
/* testr[0]=EAX; testr[1]=EBX; testr[2]=ECX; testr[3]=EDX;
|
||||||
testr[4]=ESI; testr[5]=EDI; testr[6]=EBP; testr[7]=ESP;*/
|
testr[4]=ESI; testr[5]=EDI; testr[6]=EBP; testr[7]=ESP;*/
|
||||||
/* testr[8]=flags;*/
|
/* testr[8]=flags;*/
|
||||||
// oldcs2=oldcs;
|
|
||||||
// oldpc2=oldpc;
|
// oldpc2=oldpc;
|
||||||
|
|
||||||
oldcs=CS;
|
|
||||||
cpu_state.oldpc = cpu_state.pc;
|
cpu_state.oldpc = cpu_state.pc;
|
||||||
cpu_state.op32 = use32;
|
cpu_state.op32 = use32;
|
||||||
|
|
||||||
|
|
@ -283,7 +280,6 @@ dontprint=0;
|
||||||
if (cpu_state.abrt)
|
if (cpu_state.abrt)
|
||||||
{
|
{
|
||||||
cpu_state.abrt = 0;
|
cpu_state.abrt = 0;
|
||||||
CS = oldcs;
|
|
||||||
cpu_state.pc = cpu_state.oldpc;
|
cpu_state.pc = cpu_state.oldpc;
|
||||||
pclog("Double fault %i\n", ins);
|
pclog("Double fault %i\n", ins);
|
||||||
pmodeint(8, 0);
|
pmodeint(8, 0);
|
||||||
|
|
@ -302,7 +298,6 @@ dontprint=0;
|
||||||
{
|
{
|
||||||
flags_rebuild();
|
flags_rebuild();
|
||||||
// oldpc=pc;
|
// oldpc=pc;
|
||||||
// oldcs=CS;
|
|
||||||
if (msw&1)
|
if (msw&1)
|
||||||
{
|
{
|
||||||
pmodeint(1,0);
|
pmodeint(1,0);
|
||||||
|
|
@ -323,7 +318,6 @@ dontprint=0;
|
||||||
else if (nmi && nmi_enable && nmi_mask)
|
else if (nmi && nmi_enable && nmi_mask)
|
||||||
{
|
{
|
||||||
cpu_state.oldpc = cpu_state.pc;
|
cpu_state.oldpc = cpu_state.pc;
|
||||||
oldcs = CS;
|
|
||||||
// pclog("NMI\n");
|
// pclog("NMI\n");
|
||||||
x86_int(2);
|
x86_int(2);
|
||||||
nmi_enable = 0;
|
nmi_enable = 0;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ int oddeven=0;
|
||||||
int inttype;
|
int inttype;
|
||||||
|
|
||||||
|
|
||||||
uint32_t oldcs2;
|
|
||||||
uint32_t oldecx;
|
uint32_t oldecx;
|
||||||
|
|
||||||
uint32_t *eal_r, *eal_w;
|
uint32_t *eal_r, *eal_w;
|
||||||
|
|
@ -531,8 +530,6 @@ void exec386_dynarec(int cycs)
|
||||||
// output=3;
|
// output=3;
|
||||||
while (cycles>0)
|
while (cycles>0)
|
||||||
{
|
{
|
||||||
oldcs = CS;
|
|
||||||
|
|
||||||
oldcyc=cycles;
|
oldcyc=cycles;
|
||||||
// if (output && CACHE_ON()) pclog("Block %04x:%04x %04x:%08x\n", CS, pc, SS,ESP);
|
// if (output && CACHE_ON()) pclog("Block %04x:%04x %04x:%08x\n", CS, pc, SS,ESP);
|
||||||
if (!CACHE_ON()) /*Interpret block*/
|
if (!CACHE_ON()) /*Interpret block*/
|
||||||
|
|
@ -542,7 +539,6 @@ void exec386_dynarec(int cycs)
|
||||||
// if (output) pclog("Interpret block at %04x:%04x %04x %04x %04x %04x %04x %04x %04x\n", CS, pc, AX, BX, CX, DX, SI, DI, SP);
|
// if (output) pclog("Interpret block at %04x:%04x %04x %04x %04x %04x %04x %04x %04x\n", CS, pc, AX, BX, CX, DX, SI, DI, SP);
|
||||||
while (!cpu_block_end)
|
while (!cpu_block_end)
|
||||||
{
|
{
|
||||||
oldcs=CS;
|
|
||||||
cpu_state.oldpc = cpu_state.pc;
|
cpu_state.oldpc = cpu_state.pc;
|
||||||
cpu_state.op32 = use32;
|
cpu_state.op32 = use32;
|
||||||
|
|
||||||
|
|
@ -696,7 +692,6 @@ inrecomp=0;
|
||||||
// if (output) pclog("Recompile block at %04x:%04x %04x %04x %04x %04x %04x %04x ESP=%04x %04x %02x%02x:%02x%02x %02x%02x:%02x%02x %02x%02x:%02x%02x\n", CS, pc, AX, BX, CX, DX, SI, DI, ESP, BP, ram[0x116330+0x6df4+0xa+3], ram[0x116330+0x6df4+0xa+2], ram[0x116330+0x6df4+0xa+1], ram[0x116330+0x6df4+0xa+0], ram[0x11d136+3],ram[0x11d136+2],ram[0x11d136+1],ram[0x11d136+0], ram[(0x119abe)+0x3],ram[(0x119abe)+0x2],ram[(0x119abe)+0x1],ram[(0x119abe)+0x0]);
|
// if (output) pclog("Recompile block at %04x:%04x %04x %04x %04x %04x %04x %04x ESP=%04x %04x %02x%02x:%02x%02x %02x%02x:%02x%02x %02x%02x:%02x%02x\n", CS, pc, AX, BX, CX, DX, SI, DI, ESP, BP, ram[0x116330+0x6df4+0xa+3], ram[0x116330+0x6df4+0xa+2], ram[0x116330+0x6df4+0xa+1], ram[0x116330+0x6df4+0xa+0], ram[0x11d136+3],ram[0x11d136+2],ram[0x11d136+1],ram[0x11d136+0], ram[(0x119abe)+0x3],ram[(0x119abe)+0x2],ram[(0x119abe)+0x1],ram[(0x119abe)+0x0]);
|
||||||
while (!cpu_block_end)
|
while (!cpu_block_end)
|
||||||
{
|
{
|
||||||
oldcs=CS;
|
|
||||||
cpu_state.oldpc = cpu_state.pc;
|
cpu_state.oldpc = cpu_state.pc;
|
||||||
cpu_state.op32 = use32;
|
cpu_state.op32 = use32;
|
||||||
|
|
||||||
|
|
@ -775,7 +770,6 @@ inrecomp=0;
|
||||||
// if (output) pclog("Recompile block at %04x:%04x %04x %04x %04x %04x %04x %04x ESP=%04x %04x %02x%02x:%02x%02x %02x%02x:%02x%02x %02x%02x:%02x%02x\n", CS, pc, AX, BX, CX, DX, SI, DI, ESP, BP, ram[0x116330+0x6df4+0xa+3], ram[0x116330+0x6df4+0xa+2], ram[0x116330+0x6df4+0xa+1], ram[0x116330+0x6df4+0xa+0], ram[0x11d136+3],ram[0x11d136+2],ram[0x11d136+1],ram[0x11d136+0], ram[(0x119abe)+0x3],ram[(0x119abe)+0x2],ram[(0x119abe)+0x1],ram[(0x119abe)+0x0]);
|
// if (output) pclog("Recompile block at %04x:%04x %04x %04x %04x %04x %04x %04x ESP=%04x %04x %02x%02x:%02x%02x %02x%02x:%02x%02x %02x%02x:%02x%02x\n", CS, pc, AX, BX, CX, DX, SI, DI, ESP, BP, ram[0x116330+0x6df4+0xa+3], ram[0x116330+0x6df4+0xa+2], ram[0x116330+0x6df4+0xa+1], ram[0x116330+0x6df4+0xa+0], ram[0x11d136+3],ram[0x11d136+2],ram[0x11d136+1],ram[0x11d136+0], ram[(0x119abe)+0x3],ram[(0x119abe)+0x2],ram[(0x119abe)+0x1],ram[(0x119abe)+0x0]);
|
||||||
while (!cpu_block_end)
|
while (!cpu_block_end)
|
||||||
{
|
{
|
||||||
oldcs=CS;
|
|
||||||
cpu_state.oldpc = cpu_state.pc;
|
cpu_state.oldpc = cpu_state.pc;
|
||||||
cpu_state.op32 = use32;
|
cpu_state.op32 = use32;
|
||||||
|
|
||||||
|
|
@ -854,7 +848,6 @@ inrecomp=0;
|
||||||
if (cpu_state.abrt)
|
if (cpu_state.abrt)
|
||||||
{
|
{
|
||||||
cpu_state.abrt = 0;
|
cpu_state.abrt = 0;
|
||||||
CS = oldcs;
|
|
||||||
cpu_state.pc = cpu_state.oldpc;
|
cpu_state.pc = cpu_state.oldpc;
|
||||||
pclog("Double fault %i\n", ins);
|
pclog("Double fault %i\n", ins);
|
||||||
pmodeint(8, 0);
|
pmodeint(8, 0);
|
||||||
|
|
@ -873,7 +866,6 @@ inrecomp=0;
|
||||||
trap = 0;
|
trap = 0;
|
||||||
flags_rebuild();
|
flags_rebuild();
|
||||||
// oldpc=pc;
|
// oldpc=pc;
|
||||||
// oldcs=CS;
|
|
||||||
if (msw&1)
|
if (msw&1)
|
||||||
{
|
{
|
||||||
pmodeint(1,0);
|
pmodeint(1,0);
|
||||||
|
|
@ -894,7 +886,6 @@ inrecomp=0;
|
||||||
else if (nmi && nmi_enable && nmi_mask)
|
else if (nmi && nmi_enable && nmi_mask)
|
||||||
{
|
{
|
||||||
cpu_state.oldpc = cpu_state.pc;
|
cpu_state.oldpc = cpu_state.pc;
|
||||||
oldcs = CS;
|
|
||||||
// pclog("NMI\n");
|
// pclog("NMI\n");
|
||||||
x86_int(2);
|
x86_int(2);
|
||||||
nmi_enable = 0;
|
nmi_enable = 0;
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,6 @@ void writememl(uint32_t s, uint32_t a, uint32_t v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint16_t oldcs;
|
|
||||||
int oldcpl;
|
int oldcpl;
|
||||||
|
|
||||||
int tempc;
|
int tempc;
|
||||||
|
|
@ -481,7 +480,6 @@ void makeznptable()
|
||||||
}
|
}
|
||||||
int timetolive=0;
|
int timetolive=0;
|
||||||
|
|
||||||
extern uint32_t oldcs2;
|
|
||||||
extern uint32_t oldpc2;
|
extern uint32_t oldpc2;
|
||||||
|
|
||||||
int indump = 0;
|
int indump = 0;
|
||||||
|
|
@ -571,7 +569,7 @@ void dumpregs()
|
||||||
else
|
else
|
||||||
printf("AX=%04X BX=%04X CX=%04X DX=%04X DI=%04X SI=%04X BP=%04X SP=%04X\n",AX,BX,CX,DX,DI,SI,BP,SP);
|
printf("AX=%04X BX=%04X CX=%04X DX=%04X DI=%04X SI=%04X BP=%04X SP=%04X\n",AX,BX,CX,DX,DI,SI,BP,SP);
|
||||||
printf("PC=%04X CS=%04X DS=%04X ES=%04X SS=%04X FLAGS=%04X\n",cpu_state.pc,CS,DS,ES,SS,cpu_state.flags);
|
printf("PC=%04X CS=%04X DS=%04X ES=%04X SS=%04X FLAGS=%04X\n",cpu_state.pc,CS,DS,ES,SS,cpu_state.flags);
|
||||||
printf("%04X:%04X %04X:%04X\n",oldcs,cpu_state.oldpc, oldcs2, oldpc2);
|
printf("%04X %04X\n",cpu_state.oldpc, oldpc2);
|
||||||
printf("%i ins\n",ins);
|
printf("%i ins\n",ins);
|
||||||
if (is386)
|
if (is386)
|
||||||
printf("In %s mode\n",(msw&1)?((cpu_state.eflags&VM_FLAG)?"V86":"protected"):"real");
|
printf("In %s mode\n",(msw&1)?((cpu_state.eflags&VM_FLAG)?"V86":"protected"):"real");
|
||||||
|
|
@ -1142,7 +1140,6 @@ void execx86(int cycs)
|
||||||
{
|
{
|
||||||
// old83=old82;
|
// old83=old82;
|
||||||
// old82=old8;
|
// old82=old8;
|
||||||
// old8=oldpc|(oldcs<<16);
|
|
||||||
// if (pc==0x96B && cs==0x9E040) { printf("Hit it\n"); output=1; timetolive=150; }
|
// if (pc==0x96B && cs==0x9E040) { printf("Hit it\n"); output=1; timetolive=150; }
|
||||||
// if (pc<0x8000) printf("%04X : %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %02X %04X %i\n",pc,AX,BX,CX,DX,cs>>4,ds>>4,es>>4,ss>>4,DI,SI,BP,SP,opcode,flags,disctime);
|
// if (pc<0x8000) printf("%04X : %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %02X %04X %i\n",pc,AX,BX,CX,DX,cs>>4,ds>>4,es>>4,ss>>4,DI,SI,BP,SP,opcode,flags,disctime);
|
||||||
cycdiff=cycles;
|
cycdiff=cycles;
|
||||||
|
|
@ -1152,7 +1149,6 @@ void execx86(int cycs)
|
||||||
nextcyc=0;
|
nextcyc=0;
|
||||||
// if (output) printf("CLOCK %i %i\n",cycdiff,cycles);
|
// if (output) printf("CLOCK %i %i\n",cycdiff,cycles);
|
||||||
fetchclocks=0;
|
fetchclocks=0;
|
||||||
oldcs=CS;
|
|
||||||
cpu_state.oldpc = cpu_state.pc;
|
cpu_state.oldpc = cpu_state.pc;
|
||||||
opcodestart:
|
opcodestart:
|
||||||
opcode=FETCH();
|
opcode=FETCH();
|
||||||
|
|
@ -3092,7 +3088,7 @@ void execx86(int cycs)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0xF4: /*HLT*/
|
case 0xF4: /*HLT*/
|
||||||
// printf("IN HLT!!!! %04X:%04X %08X %08X %08X\n",oldcs,oldpc,old8,old82,old83);
|
// printf("IN HLT!!!! %04X %08X %08X %08X\n",oldpc,old8,old82,old83);
|
||||||
/* if (!(flags & I_FLAG))
|
/* if (!(flags & I_FLAG))
|
||||||
{
|
{
|
||||||
pclog("HLT\n");
|
pclog("HLT\n");
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
uint16_t oldcs;
|
|
||||||
extern uint32_t rmdat32;
|
extern uint32_t rmdat32;
|
||||||
int oldcpl;
|
int oldcpl;
|
||||||
|
|
||||||
|
|
|
||||||
16
src/x86seg.c
16
src/x86seg.c
|
|
@ -95,7 +95,6 @@ void x86seg_reset()
|
||||||
void x86_doabrt(int x86_abrt)
|
void x86_doabrt(int x86_abrt)
|
||||||
{
|
{
|
||||||
// ingpf = 1;
|
// ingpf = 1;
|
||||||
CS = oldcs;
|
|
||||||
cpu_state.pc = cpu_state.oldpc;
|
cpu_state.pc = cpu_state.oldpc;
|
||||||
cpu_state.seg_cs.access = oldcpl << 5;
|
cpu_state.seg_cs.access = oldcpl << 5;
|
||||||
// pclog("x86_doabrt - %02X %08X %04X:%08X %i\n", x86_abrt, abrt_error, CS, pc, ins);
|
// pclog("x86_doabrt - %02X %08X %04X:%08X %i\n", x86_abrt, abrt_error, CS, pc, ins);
|
||||||
|
|
@ -730,7 +729,6 @@ void loadcsjmp(uint16_t seg, uint32_t oxpc)
|
||||||
// pclog("Call gate\n");
|
// pclog("Call gate\n");
|
||||||
cgate32=(type&0x800);
|
cgate32=(type&0x800);
|
||||||
cgate16=!cgate32;
|
cgate16=!cgate32;
|
||||||
oldcs=CS;
|
|
||||||
cpu_state.oldpc = cpu_state.pc;
|
cpu_state.oldpc = cpu_state.pc;
|
||||||
if ((DPL < CPL) || (DPL < (seg&3)))
|
if ((DPL < CPL) || (DPL < (seg&3)))
|
||||||
{
|
{
|
||||||
|
|
@ -1267,8 +1265,6 @@ void loadcscall(uint16_t seg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// x86abort("Call gate with count %i\n",count);
|
// x86abort("Call gate with count %i\n",count);
|
||||||
// PUSHL(oldcs);
|
|
||||||
// PUSHL(oldpc); if (cpu_state.abrt) return;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1305,8 +1301,6 @@ void loadcscall(uint16_t seg)
|
||||||
}
|
}
|
||||||
// if (output) pclog("Stack %04X\n",SP);
|
// if (output) pclog("Stack %04X\n",SP);
|
||||||
// if (count) x86abort("Call gate with count\n");
|
// if (count) x86abort("Call gate with count\n");
|
||||||
// PUSHW(oldcs);
|
|
||||||
// PUSHW(oldpc); if (cpu_state.abrt) return;
|
|
||||||
}
|
}
|
||||||
cycles -= timing_call_pm_gate_inner;
|
cycles -= timing_call_pm_gate_inner;
|
||||||
break;
|
break;
|
||||||
|
|
@ -1318,16 +1312,6 @@ void loadcscall(uint16_t seg)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/
|
case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/
|
||||||
/* if (type==0xC00)
|
|
||||||
{
|
|
||||||
PUSHL(oldcs);
|
|
||||||
PUSHL(oldpc); if (cpu_state.abrt) return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PUSHW(oldcs);
|
|
||||||
PUSHW(oldpc); if (cpu_state.abrt) return;
|
|
||||||
}*/
|
|
||||||
CS=seg2;
|
CS=seg2;
|
||||||
do_seg_load(&cpu_state.seg_cs, segdat);
|
do_seg_load(&cpu_state.seg_cs, segdat);
|
||||||
if (CPL==3 && oldcpl!=3) flushmmucache_cr3();
|
if (CPL==3 && oldcpl!=3) flushmmucache_cr3();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue