From 6daab43bf7dcf6ecf7f14da0b62c46850c06e42c Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Tue, 10 Jun 2003 21:09:12 +0000 Subject: [PATCH] fixed both fptan and fpatan. Xcom now works flawsless Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1050 --- src/fpu/fpu_instructions.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fpu/fpu_instructions.h b/src/fpu/fpu_instructions.h index 52d7e83e..d5953d30 100644 --- a/src/fpu/fpu_instructions.h +++ b/src/fpu/fpu_instructions.h @@ -104,7 +104,8 @@ static void FPU_FSQRT(void){ } static void FPU_FPATAN(void){ Bitu top = FPU_GET_TOP(); - fpu.regs[top].d = atan(fpu.regs[top].d); + fpu.regs[(top+1)&7].d = atan(fpu.regs[(top+1)&7].d/fpu.regs[top].d); + FPU_FPOP(); FPU_SET_C2(0); //flags and such :) return; @@ -112,6 +113,7 @@ static void FPU_FPATAN(void){ static void FPU_FPTAN(void){ Bitu top = FPU_GET_TOP(); fpu.regs[top].d = tan(fpu.regs[top].d); + FPU_PUSH(1.0); FPU_SET_C2(0); //flags and such :) return;