washingtondc-emu / washingtondc

Open-source Sega Dreamcast emulator
http://www.washemu.org
GNU General Public License v3.0
240 stars 7 forks source link

can't get in-game on SoulCalibur #89

Closed snickerbockers closed 4 years ago

snickerbockers commented 4 years ago

This game used to work. Now it fails to get in-game because it hits an ERROR_UNIMPLEMENTED caused by taking the FSQRT of a negative value. Not sure when this bug first appeared, but it was probably back in 2019 when I added proper FPU support to the JIT.

snickerbockers commented 4 years ago

apparently it's always been doing this and I'm only seeing an error now because I added the error six months ago and then forgot about it...

77b82a8b4ee77dab0edfdc17523fa4f665fc0060 is the first bad commit commit 77b82a8b4ee77dab0edfdc17523fa4f665fc0060 Author: snickerbockers snickerbockers@washemu.org Date: Fri Apr 24 11:25:33 2020 -0700

sh4: raise an ERROR_UNIMPLEMENTED for negative square roots

:040000 040000 ef07a59bff4d7e441ab37c164219d6da988ae1b7 2dfc3db702c8ad8d8f861a76ba6abd9ac3bdc085 M src

snickerbockers commented 4 years ago

According to the SH-4 software manual, the correct behavior is to set V flags (bits 16 and 6) in FPSCR and then either return NaN or to raise a CPU exception depending on whether or not bit 11 is set.

snickerbockers commented 4 years ago

For the record, this only happens at PC=8C0107F4 . It does continually happen for the entire duration of the game.

snickerbockers commented 4 years ago

fixed by c7cd2dc7def5ba654c992506601b251b215280e3