The NCR 53C810 is now threaded;
Reverted my IDIV fixes - fixes font glitches in Windows XP and possibly other things as well; Slight fix to line repeat detection in pclog_ex().
This commit is contained in:
@@ -64,9 +64,10 @@ static int opSETALC(uint32_t fetchdat)
|
||||
|
||||
static int opF6_a16(uint32_t fetchdat)
|
||||
{
|
||||
int32_t tempsrc, tempdst, tempws, tempws2 = 0;
|
||||
int tempws, tempws2 = 0;
|
||||
uint16_t tempw, src16;
|
||||
uint8_t src, dst;
|
||||
int8_t temps;
|
||||
|
||||
fetch_ea_16(fetchdat);
|
||||
dst = geteab(); if (cpu_state.abrt) return 1;
|
||||
@@ -130,32 +131,24 @@ static int opF6_a16(uint32_t fetchdat)
|
||||
PREFETCH_RUN(is486 ? 16 : 14, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 0);
|
||||
break;
|
||||
case 0x38: /*IDIV AL,b*/
|
||||
if (dst == 0) {
|
||||
x86_int(0); /* Divide by zero. */
|
||||
return 1;
|
||||
}
|
||||
|
||||
tempsrc = (int16_t) AX;
|
||||
tempdst = (int8_t) dst;
|
||||
|
||||
tempws = tempsrc / tempdst;
|
||||
|
||||
if ((tempws > 127) || (tempws < -128)) {
|
||||
x86_int(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
tempws = (int8_t) tempws;
|
||||
tempws2 = (int8_t) (tempsrc % tempdst);
|
||||
|
||||
AH = (uint8_t) tempws2;
|
||||
AL = (uint8_t) tempws;
|
||||
|
||||
if (!cpu_iscyrix) {
|
||||
flags_rebuild();
|
||||
flags|=0x8D5; /*Not a Cyrix*/
|
||||
}
|
||||
|
||||
tempws = (int)(int16_t)AX;
|
||||
if (dst != 0) tempws2 = tempws / (int)((int8_t)dst);
|
||||
temps = tempws2 & 0xff;
|
||||
if (dst && ((int)temps == tempws2))
|
||||
{
|
||||
AH = (tempws % (int)((int8_t)dst)) & 0xff;
|
||||
AL = tempws2 & 0xff;
|
||||
if (!cpu_iscyrix)
|
||||
{
|
||||
flags_rebuild();
|
||||
flags|=0x8D5; /*Not a Cyrix*/
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x86_int(0);
|
||||
return 1;
|
||||
}
|
||||
CLOCK_CYCLES(19);
|
||||
PREFETCH_RUN(19, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 0);
|
||||
break;
|
||||
@@ -168,9 +161,10 @@ static int opF6_a16(uint32_t fetchdat)
|
||||
}
|
||||
static int opF6_a32(uint32_t fetchdat)
|
||||
{
|
||||
int tempsrc, tempdst, tempws, tempws2 = 0;
|
||||
int tempws, tempws2 = 0;
|
||||
uint16_t tempw, src16;
|
||||
uint8_t src, dst;
|
||||
int8_t temps;
|
||||
|
||||
fetch_ea_32(fetchdat);
|
||||
dst = geteab(); if (cpu_state.abrt) return 1;
|
||||
@@ -234,32 +228,24 @@ static int opF6_a32(uint32_t fetchdat)
|
||||
PREFETCH_RUN(is486 ? 16 : 14, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 1);
|
||||
break;
|
||||
case 0x38: /*IDIV AL,b*/
|
||||
if (dst == 0) {
|
||||
x86_int(0); /* Divide by zero. */
|
||||
return 1;
|
||||
}
|
||||
|
||||
tempsrc = (int16_t) AX;
|
||||
tempdst = (int8_t) dst;
|
||||
|
||||
tempws = tempsrc / tempdst;
|
||||
|
||||
if ((tempws > 127) || (tempws < -128)) {
|
||||
x86_int(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
tempws = (int8_t) tempws;
|
||||
tempws2 = (int8_t) (tempsrc % tempdst);
|
||||
|
||||
AH = (uint8_t) tempws2;
|
||||
AL = (uint8_t) tempws;
|
||||
|
||||
if (!cpu_iscyrix) {
|
||||
flags_rebuild();
|
||||
flags|=0x8D5; /*Not a Cyrix*/
|
||||
}
|
||||
|
||||
tempws = (int)(int16_t)AX;
|
||||
if (dst != 0) tempws2 = tempws / (int)((int8_t)dst);
|
||||
temps = tempws2 & 0xff;
|
||||
if (dst && ((int)temps == tempws2))
|
||||
{
|
||||
AH = (tempws % (int)((int8_t)dst)) & 0xff;
|
||||
AL = tempws2 & 0xff;
|
||||
if (!cpu_iscyrix)
|
||||
{
|
||||
flags_rebuild();
|
||||
flags|=0x8D5; /*Not a Cyrix*/
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x86_int(0);
|
||||
return 1;
|
||||
}
|
||||
CLOCK_CYCLES(19);
|
||||
PREFETCH_RUN(19, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 1);
|
||||
break;
|
||||
@@ -276,7 +262,8 @@ static int opF6_a32(uint32_t fetchdat)
|
||||
static int opF7_w_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t templ, templ2;
|
||||
int32_t tempsrc, tempdst, tempws, tempws2 = 0;
|
||||
int tempws, tempws2 = 0;
|
||||
int16_t temps16;
|
||||
uint16_t src, dst;
|
||||
|
||||
fetch_ea_16(fetchdat);
|
||||
@@ -339,32 +326,21 @@ static int opF7_w_a16(uint32_t fetchdat)
|
||||
CLOCK_CYCLES(is486 ? 24 : 22);
|
||||
PREFETCH_RUN(is486 ? 24 : 22, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 0);
|
||||
break;
|
||||
case 0x38: /*IDIV DX:AX,w*/
|
||||
if (dst == 0) {
|
||||
x86_int(0); /* Divide by zero. */
|
||||
return 1;
|
||||
}
|
||||
|
||||
templ = (uint32_t) DX;
|
||||
templ = (templ << 16) | AX;
|
||||
tempsrc = (int32_t) templ;
|
||||
tempdst = (int16_t) dst;
|
||||
|
||||
tempws = tempsrc / tempdst;
|
||||
|
||||
if ((tempws > 32767) || (tempws < -32768)) {
|
||||
x86_int(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
tempws = (int16_t) tempws;
|
||||
tempws2 = (int16_t) (tempsrc % tempdst);
|
||||
|
||||
DX = (uint16_t) tempws2;
|
||||
AX = (uint16_t) tempws;
|
||||
|
||||
if (!cpu_iscyrix) setznp16(AX); /*Not a Cyrix*/
|
||||
|
||||
case 0x38: /*IDIV AX,w*/
|
||||
tempws = (int)((DX << 16)|AX);
|
||||
if (dst) tempws2 = tempws / (int)((int16_t)dst);
|
||||
temps16 = tempws2 & 0xffff;
|
||||
if ((dst != 0) && ((int)temps16 == tempws2))
|
||||
{
|
||||
DX = tempws % (int)((int16_t)dst);
|
||||
AX = tempws2 & 0xffff;
|
||||
if (!cpu_iscyrix) setznp16(AX); /*Not a Cyrix*/
|
||||
}
|
||||
else
|
||||
{
|
||||
x86_int(0);
|
||||
return 1;
|
||||
}
|
||||
CLOCK_CYCLES(27);
|
||||
PREFETCH_RUN(27, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 0);
|
||||
break;
|
||||
@@ -378,7 +354,8 @@ static int opF7_w_a16(uint32_t fetchdat)
|
||||
static int opF7_w_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t templ, templ2;
|
||||
int tempsrc, tempdst, tempws, tempws2 = 0;
|
||||
int tempws, tempws2 = 0;
|
||||
int16_t temps16;
|
||||
uint16_t src, dst;
|
||||
|
||||
fetch_ea_32(fetchdat);
|
||||
@@ -441,32 +418,21 @@ static int opF7_w_a32(uint32_t fetchdat)
|
||||
CLOCK_CYCLES(is486 ? 24 : 22);
|
||||
PREFETCH_RUN(is486 ? 24 : 22, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 1);
|
||||
break;
|
||||
case 0x38: /*IDIV DX:AX,w*/
|
||||
if (dst == 0) {
|
||||
x86_int(0); /* Divide by zero. */
|
||||
return 1;
|
||||
}
|
||||
|
||||
templ = (uint32_t) DX;
|
||||
templ = (templ << 16) | AX;
|
||||
tempsrc = (int32_t) templ;
|
||||
tempdst = (int16_t) dst;
|
||||
|
||||
tempws = tempsrc / tempdst;
|
||||
|
||||
if ((tempws > 32767) || (tempws < -32768)) {
|
||||
x86_int(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
tempws = (int16_t) tempws;
|
||||
tempws2 = (int16_t) (tempsrc % tempdst);
|
||||
|
||||
DX = (uint16_t) tempws2;
|
||||
AX = (uint16_t) tempws;
|
||||
|
||||
if (!cpu_iscyrix) setznp16(AX); /*Not a Cyrix*/
|
||||
|
||||
case 0x38: /*IDIV AX,w*/
|
||||
tempws = (int)((DX << 16)|AX);
|
||||
if (dst) tempws2 = tempws / (int)((int16_t)dst);
|
||||
temps16 = tempws2 & 0xffff;
|
||||
if ((dst != 0) && ((int)temps16 == tempws2))
|
||||
{
|
||||
DX = tempws % (int)((int16_t)dst);
|
||||
AX = tempws2 & 0xffff;
|
||||
if (!cpu_iscyrix) setznp16(AX); /*Not a Cyrix*/
|
||||
}
|
||||
else
|
||||
{
|
||||
x86_int(0);
|
||||
return 1;
|
||||
}
|
||||
CLOCK_CYCLES(27);
|
||||
PREFETCH_RUN(27, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 1);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user