From 79bcdc6c3887a69ca4d4288f52a950c60cebb106 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 11 Jan 2010 12:31:35 +0000 Subject: [PATCH] Fix ANTIGOK1.EXE and other basic programs compiled with the same compiler that use load zero, change sign, write as BCD as template for reading in negative values. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3531 --- src/fpu/fpu_instructions.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fpu/fpu_instructions.h b/src/fpu/fpu_instructions.h index ec2f810d..bfc564ef 100644 --- a/src/fpu/fpu_instructions.h +++ b/src/fpu/fpu_instructions.h @@ -106,7 +106,7 @@ static Real64 FPU_FLD80(PhysPt addr) { Bit64s sign = (test.begin&0x8000)?1:0; FPU_Reg result; result.ll = (sign <<63)|(exp64final << 52)| mant64; - return result.d; + return result.d; //mant64= test.mant80/2***64 * 2 **53 } @@ -239,7 +239,7 @@ static void FPU_FST_I64(PhysPt addr) { static void FPU_FBST(PhysPt addr) { FPU_Reg val = fpu.regs[TOP]; bool sign = false; - if(val.d<0.0){ //sign + if(fpu.regs[TOP].ll & LONGTYPE(0x8000000000000000)) { //sign sign=true; val.d=-val.d; } @@ -519,7 +519,7 @@ static void FPU_FXTRACT(void) { Bit64s exp80final = (exp80>>52) - BIAS64; Real64 mant = test.d / (pow(2.0,static_cast(exp80final))); fpu.regs[TOP].d = static_cast(exp80final); - FPU_PUSH(mant); + FPU_PUSH(mant); } static void FPU_FCHS(void){