logoalt Hacker News

flykespiceyesterday at 9:54 PM4 repliesview on HN

I wonder how they will tackle the infamous non-conformant Ps2 floating-point behavior issue, that is the biggest hurdle on emulating Ps2.


Replies

toast0yesterday at 11:11 PM

As of now, it looks like they're ignoring it:

https://github.com/ran-j/PS2Recomp/blob/91678d19778891b4df85...

   #define FPU_ADD_S(a, b) ((float)(a) + (float)(b))
(etc)

But if you wanted to handle it, you'd presumably macro expand the floating point operations to something that matches the PS2 fpu (or comes closer).

mikepurvisyesterday at 9:58 PM

Some context for others who were unaware: https://github.com/PSI-Rockin/DobieStation/issues/51

EDIT here's potentially a better link: https://www.gregorygaines.com/blog/emulating-ps2-floating-po...

realusernameyesterday at 10:46 PM

Probably the same way as the emulator themselves, with a list of titles needing the real PS2 floating point.

A lot of titles don't actually need it and work fine with standard IEEE floating point.

kmeisthaxyesterday at 10:45 PM

PS2 floating-point behavior is one of the few hardware misfeatures so awful it affects emulation of competing systems[0]. The game True Crime: New York City is so dependent on PS2 floating point that the GameCube port installs an error handler just to make 1/0 = 0. Which isn't even PS2 hardware behavior. But it is "close enough" that the game does not immediately throw you into the void every time you step on a physics object.

[0] https://dolphin-emu.org/blog/2021/11/13/dolphin-progress-rep...