Fixed >32 bit shifts on 808x CPUs. Fixes Titus the Fox.
This commit is contained in:
parent
b97d525e0c
commit
bb4fbdd9c2
1 changed files with 33 additions and 9 deletions
42
src/808x.c
42
src/808x.c
|
|
@ -2690,9 +2690,17 @@ void execx86(int cycs)
|
||||||
cycles-=((cpu_mod==3)?8:28);
|
cycles-=((cpu_mod==3)?8:28);
|
||||||
break;
|
break;
|
||||||
case 0x20: case 0x30: /*SHL b,CL*/
|
case 0x20: case 0x30: /*SHL b,CL*/
|
||||||
if ((temp<<(c-1))&0x80) flags|=C_FLAG;
|
if (c > 8)
|
||||||
else flags&=~C_FLAG;
|
{
|
||||||
temp<<=c;
|
temp = 0;
|
||||||
|
flags &= ~C_FLAG;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((temp<<(c-1))&0x80) flags|=C_FLAG;
|
||||||
|
else flags&=~C_FLAG;
|
||||||
|
temp<<=c;
|
||||||
|
}
|
||||||
seteab(temp);
|
seteab(temp);
|
||||||
setznp8(temp);
|
setznp8(temp);
|
||||||
cycles-=(c*4);
|
cycles-=(c*4);
|
||||||
|
|
@ -2700,9 +2708,17 @@ void execx86(int cycs)
|
||||||
flags|=A_FLAG;
|
flags|=A_FLAG;
|
||||||
break;
|
break;
|
||||||
case 0x28: /*SHR b,CL*/
|
case 0x28: /*SHR b,CL*/
|
||||||
if ((temp>>(c-1))&1) flags|=C_FLAG;
|
if (c > 8)
|
||||||
else flags&=~C_FLAG;
|
{
|
||||||
temp>>=c;
|
temp = 0;
|
||||||
|
flags &= ~C_FLAG;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((temp>>(c-1))&1) flags|=C_FLAG;
|
||||||
|
else flags&=~C_FLAG;
|
||||||
|
temp>>=c;
|
||||||
|
}
|
||||||
seteab(temp);
|
seteab(temp);
|
||||||
setznp8(temp);
|
setznp8(temp);
|
||||||
cycles-=(c*4);
|
cycles-=(c*4);
|
||||||
|
|
@ -2827,9 +2843,17 @@ void execx86(int cycs)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x28: /*SHR w,CL*/
|
case 0x28: /*SHR w,CL*/
|
||||||
if ((tempw>>(c-1))&1) flags|=C_FLAG;
|
if (c > 16)
|
||||||
else flags&=~C_FLAG;
|
{
|
||||||
tempw>>=c;
|
tempw = 0;
|
||||||
|
flags &= ~C_FLAG;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((tempw>>(c-1))&1) flags|=C_FLAG;
|
||||||
|
else flags&=~C_FLAG;
|
||||||
|
tempw>>=c;
|
||||||
|
}
|
||||||
seteaw(tempw);
|
seteaw(tempw);
|
||||||
setznp16(tempw);
|
setznp16(tempw);
|
||||||
cycles-=(c*4);
|
cycles-=(c*4);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue