infinite-mac icon indicating copy to clipboard operation
infinite-mac copied to clipboard

All maths operations in PCalc fail

Open stresspanda opened this issue 3 years ago • 2 comments

Any maths operation, even just typing "42" and "=" will lead to an overflow error in PCalc, which suggests something is possibly up with the emulation of the SANE floating point math library? The app did work in the Mac native Basilisk II the last time I tried it (although Basilisk II is now seemingly not running itself on Monterey).

I'm the PCalc author, so if you need help in tracking down the issue, let me know!

stresspanda avatar May 09 '22 22:05 stresspanda

Fascinating. According to https://web.archive.org/web/20040721041219/http://developer.apple.com/technotes/pt/pdf/pt_25.pdf SANE will use the FPU if present

SANE on the Macintosh II The version of SANE provided in the Macintosh II ROM recognizes the presence of the 68881 and uses it for most calculations automatically. SANE still expects (and produces) 80-bit-format Extended values; it converts to and from 96-bit format internally when using the 68881.

Sure enough, if I disable the FPU (by changing the to modelid 5, cpu 3, and fpu false in the preferences file) then it works as expected. Something must be going wrong in the Emscripten compilation of the FPU emulation code.

mihaip avatar May 12 '22 06:05 mihaip

Fun - I suspect that might be causing subtle, or not so subtle, bugs across the board!

stresspanda avatar May 12 '22 22:05 stresspanda