Protected mode improvements :
- LTR now sets TSS state to busy - LMSW preserves ET bit in CR0 - Fixed PC size in 16-bit system segment on CALL/JMP Patch from Greatpsycho
This commit is contained in:
parent
29bef61a3e
commit
51ed6ea341
2 changed files with 15 additions and 6 deletions
|
|
@ -212,6 +212,9 @@ static int op0F00_common(uint32_t fetchdat, int ea32)
|
||||||
access = readmemb(0, addr + 5);
|
access = readmemb(0, addr + 5);
|
||||||
granularity = readmemb(0, addr + 6) & 0x80;
|
granularity = readmemb(0, addr + 6) & 0x80;
|
||||||
if (cpu_state.abrt) return 1;
|
if (cpu_state.abrt) return 1;
|
||||||
|
access |= 2;
|
||||||
|
writememb(0, addr + 5, access);
|
||||||
|
if (cpu_state.abrt) return 1;
|
||||||
tr.seg = sel;
|
tr.seg = sel;
|
||||||
tr.limit = limit;
|
tr.limit = limit;
|
||||||
tr.access = access;
|
tr.access = access;
|
||||||
|
|
@ -365,7 +368,12 @@ static int op0F01_common(uint32_t fetchdat, int is32, int is286, int ea32)
|
||||||
}
|
}
|
||||||
tempw = geteaw(); if (cpu_state.abrt) return 1;
|
tempw = geteaw(); if (cpu_state.abrt) return 1;
|
||||||
if (msw & 1) tempw |= 1;
|
if (msw & 1) tempw |= 1;
|
||||||
if (!is386) tempw &= 0xF;
|
if (is386)
|
||||||
|
{
|
||||||
|
tempw &= ~0x10;
|
||||||
|
tempw |= (msw & 0x10);
|
||||||
|
}
|
||||||
|
else tempw &= 0xF;
|
||||||
msw = tempw;
|
msw = tempw;
|
||||||
PREFETCH_RUN(2, 2, rmdat, 0,0,(cpu_mod == 3) ? 0:1,0, ea32);
|
PREFETCH_RUN(2, 2, rmdat, 0,0,(cpu_mod == 3) ? 0:1,0, ea32);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
11
src/x86seg.c
11
src/x86seg.c
|
|
@ -704,8 +704,8 @@ void loadcsjmp(uint16_t seg, uint32_t oxpc)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
type=segdat[2]&0xF00;
|
type=segdat[2]&0xF00;
|
||||||
if (type==0x400) newpc=segdat[0];
|
newpc=segdat[0];
|
||||||
else newpc=segdat[0]|(segdat[3]<<16);
|
if (type&0x800) newpc|=segdat[3]<<16;
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case 0x400: /*Call gate*/
|
case 0x400: /*Call gate*/
|
||||||
|
|
@ -810,6 +810,7 @@ void loadcsjmp(uint16_t seg, uint32_t oxpc)
|
||||||
case 0x900: /*386 Task gate*/
|
case 0x900: /*386 Task gate*/
|
||||||
// pclog("Task gate\n");
|
// pclog("Task gate\n");
|
||||||
cpu_state.pc=oxpc;
|
cpu_state.pc=oxpc;
|
||||||
|
optype=JMP;
|
||||||
cpl_override=1;
|
cpl_override=1;
|
||||||
taskswitch286(seg,segdat,segdat[2]&0x800);
|
taskswitch286(seg,segdat,segdat[2]&0x800);
|
||||||
flags &= ~NT_FLAG;
|
flags &= ~NT_FLAG;
|
||||||
|
|
@ -965,8 +966,8 @@ void loadcscall(uint16_t seg)
|
||||||
segdat[2]=readmemw(0,addr+4);
|
segdat[2]=readmemw(0,addr+4);
|
||||||
segdat[3]=readmemw(0,addr+6); cpl_override=0; if (cpu_state.abrt) return;
|
segdat[3]=readmemw(0,addr+6); cpl_override=0; if (cpu_state.abrt) return;
|
||||||
type=segdat[2]&0xF00;
|
type=segdat[2]&0xF00;
|
||||||
if (type==0x400) newpc=segdat[0];
|
newpc=segdat[0];
|
||||||
else newpc=segdat[0]|(segdat[3]<<16);
|
if (type&0x800) newpc|=segdat[3]<<16;
|
||||||
|
|
||||||
if (csout) pclog("Code seg call - %04X - %04X %04X %04X\n",seg,segdat[0],segdat[1],segdat[2]);
|
if (csout) pclog("Code seg call - %04X - %04X %04X %04X\n",seg,segdat[0],segdat[1],segdat[2]);
|
||||||
if (segdat[2]&0x1000)
|
if (segdat[2]&0x1000)
|
||||||
|
|
@ -1183,7 +1184,7 @@ void loadcscall(uint16_t seg)
|
||||||
if (!(segdat2[2]&0x8000))
|
if (!(segdat2[2]&0x8000))
|
||||||
{
|
{
|
||||||
pclog("Call gate loading SS not present\n");
|
pclog("Call gate loading SS not present\n");
|
||||||
x86np("Call gate loading SS not present\n", newss & 0xfffc);
|
x86ss("Call gate loading SS not present\n", newss & 0xfffc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!stack32) oldsp &= 0xFFFF;
|
if (!stack32) oldsp &= 0xFFFF;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue