--- hatari/src/uae-cpu/fpp.c 2019/04/01 07:13:48 1.1.1.6 +++ hatari/src/uae-cpu/fpp.c 2019/04/09 08:52:13 1.1.1.12 @@ -10,7 +10,7 @@ * This file is distributed under the GNU Public License, version 2 or at * your option any later version. Read the file gpl.txt for details. */ -const char FPP_rcsid[] = "Hatari $Id: fpp.c,v 1.1.1.6 2019/04/01 07:13:48 root Exp $"; +const char FPP_fileid[] = "Hatari fpp.c : " __DATE__ " " __TIME__; #define __USE_ISOC9X /* We might be able to pick up a NaN */ @@ -145,7 +145,11 @@ STATIC_INLINE fptype to_pack (uae_u32 wr *cp++ = ((wrd1 >> 20) & 0xf) + '0'; *cp++ = ((wrd1 >> 16) & 0xf) + '0'; *cp = 0; +#if USE_LONG_DOUBLE + sscanf (str, "%Le", &d); +#else sscanf (str, "%le", &d); +#endif return d; } @@ -156,7 +160,11 @@ STATIC_INLINE void from_pack (fptype src char *cp; char str[100]; +#if USE_LONG_DOUBLE + sprintf (str, "%.16Le", src); +#else sprintf (str, "%.16e", src); +#endif cp = str; *wrd1 = *wrd2 = *wrd3 = 0; if (*cp == '-') { @@ -658,7 +666,7 @@ void ftrapcc_opp (uae_u32 opcode, uaecpt op_illg (opcode); } if (cc) - Exception (7, oldpc - 2); + Exception (7, oldpc - 2, M68000_EXC_SRC_CPU); } void fbcc_opp (uae_u32 opcode, uaecptr pc, uae_u32 extra) @@ -1358,6 +1366,9 @@ void restore_fpu (void) int model, i; model = restore_u32(); + if (model != 0 && (model < 68040 || model > 68060)) { + fprintf(stderr, "Warning: Unexpected CPU model\n"); + } for (i = 0; i < 8; i++) { uae_u32 w1 = restore_u32 ();