Commit graph

7 commits

Author SHA1 Message Date
nick-less 2ae1f01f36 fix compile error under macos 2021-03-17 20:01:44 +01:00
tevorbl 6fe335b9e9 another fix for printf(float) on m68k platform
bug caused by this instruction:

  fmove.l fp0,d0 

problem was caused by a conflict between the fpu emulator (softfloat) and the compiler.

the emulator implemented this as a purely arithmetic move & conversion,
but the compiler assumed that the result could be interpreted as a logical (ie unsigned) conversion.
rightly or wrongly.


for example, if fp0 contained the value 2576980377.0  which is unsigned integer -1717987328
the emulator would treat this as an integer overflow and move 0x7fffffff (INT_MAX) into d0.

The complier on the other hand would assume that d0 contained 2576980377 (the unsigned value).

I don't know which is correct, but this is my fix for the time being.
2020-06-02 13:00:03 +01:00
tevorbl 04fe0aa53e fixed floats in printf in linux59k platform
problem was implementation of fint & fintrz floating point ops in m68kfpu.c
Both these ops truncated the integer to 32 bits instead of leaving it as an extended precision floating point number

Changed the implementation to use 64 bit ints instead of 32 bit ints.
2020-06-01 20:53:29 +01:00
tevorbl e5da3227d9 fpu bug fix for fgetmant op
- inserted missing break
- use temp variable instead of manipulating dest register

fgetexp changed to directly convert int to floatx80
2020-05-30 13:37:04 +01:00
tevorbl 799900f45a update platform linux68k
latest version of musashi engine
includes floating point emulation
(plus a few patches to add in missing opcodes needed by ack - see tags JFF & TBB)

added a few missing linux syscalls in sim.c

pascal now runs pretty well
quick test with modula2 passes

c gets the floating point numbers wrong, so more work needed here

other languages untested

plat/linux68k/emu/build.lua is probably not quite right - the softfloat directory is compiled in the wrong place
2020-05-28 13:06:08 +01:00
George Koehler 6f9e418f94 Remove extra #include <stdio.h> to fix uint
From my request at https://github.com/kstenerud/Musashi/pull/31

There was a conflict between Musahi's uint and OpenBSD's uint:

    $ cc -o m68kmake m68kmake.c
    $ ./m68kmake
    $ cc -DM68K_COMPILE_FOR_MAME=0 -c m68kcpu.c
    In file included from m68kcpu.c:565:
    In file included from /usr/include/stdio.h:46:
    /usr/include/sys/types.h:58:22: error: cannot combine with previous 'int'
          declaration specifier
    typedef unsigned int    uint;           /* Sys V compatibility */
                            ^
    ./m68kcpu.h:75:25: note: expanded from macro 'uint'
    #define uint   unsigned int
                            ^
    1 error generated.
2018-06-10 16:24:35 -04:00
David Given 0eb89d5d95 Add a clean copy of the Musashi emulator. 2018-06-05 17:04:47 +09:00