Fix ca-cyber with C FPU core.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3533
This commit is contained in:
parent
3e936332a5
commit
cfbe192e70
1 changed files with 8 additions and 4 deletions
|
@ -118,12 +118,16 @@ static void FPU_ST80(PhysPt addr,Bitu reg) {
|
|||
} test;
|
||||
Bit64s sign80 = (fpu.regs[reg].ll&LONGTYPE(0x8000000000000000))?1:0;
|
||||
Bit64s exp80 = fpu.regs[reg].ll&LONGTYPE(0x7ff0000000000000);
|
||||
Bit64s exp80final = (exp80>>52) - BIAS64 + BIAS80;
|
||||
Bit64s exp80final = (exp80>>52);
|
||||
Bit64s mant80 = fpu.regs[reg].ll&LONGTYPE(0x000fffffffffffff);
|
||||
Bit64s mant80final = (mant80 << 11);
|
||||
// Elvira wants the 8 and tcalc doesn't
|
||||
if(fpu.regs[reg].d != 0) mant80final |= LONGTYPE(0x8000000000000000);
|
||||
test.begin= (static_cast<Bit16s>(sign80)<<15)| static_cast<Bit16s>(exp80final);
|
||||
if(fpu.regs[reg].d != 0){ //Zero is a special case
|
||||
// Elvira wants the 8 and tcalc doesn't
|
||||
mant80final |= LONGTYPE(0x8000000000000000);
|
||||
//Ca-cyber doesn't like this when result is zero.
|
||||
exp80final += (BIAS80 - BIAS64);
|
||||
}
|
||||
test.begin = (static_cast<Bit16s>(sign80)<<15)| static_cast<Bit16s>(exp80final);
|
||||
test.eind.ll = mant80final;
|
||||
mem_writed(addr,test.eind.l.lower);
|
||||
mem_writed(addr+4,test.eind.l.upper);
|
||||
|
|
Loading…
Add table
Reference in a new issue