grumpycoders / pcsx-redux

The PCSX-Redux project is a collection of tools, research, hardware design, and libraries aiming at development and reverse engineering on the PlayStation 1. The core product itself, PCSX-Redux, is yet another fork of the Playstation emulator, PCSX.
https://pcsx-redux.consoledev.net
GNU General Public License v2.0
617 stars 93 forks source link

Difference between RCOS output on Nugget vs original PsyQ #1569

Open gustavopezzi opened 6 months ago

gustavopezzi commented 6 months ago

Describe the bug

The rcos in the Nugget implementation outputs different values than the rcos function in the original PsyQ 32-bit. I am including in this submission:

Both binaries were generated using the same code. They contain a simple for-loop iterating angles from -8192 to 8192 outputting their rcos.

for (a = -8192; a <= 8192; a++) {
  printf("rcos(%d) = %d", a, rcos(a));
}

Expected behavior

I would expect the output of both functions to output be the same values given the same input.

Steps to reproduce the bug

Compile and build two projects. One using Nugget with a modern toolchain and one using Windows XP 32-bit original PsyQ.

They run the same code:

for (a = -8192; a <= 8192; a++) {
  printf("rcos(%d) = %d", a, rcos(a));
}

Operating System

Windows 11

PCSX-Redux version

This is not emulator-specific.

CPU model

Intel Core i5 8th Gen

GPU model & Drivers

Integrated/On-Board Graphics

BIOS version

OpenBIOS

Options

Iso checks

No response

Logs

No response

Additional information

Hopefully, with both binaries provided, it will be possible to disassemble and see the cosine table offsets and check what is going on.

nicolasnoble commented 6 months ago

So this is hopefully fixed with #1557, but (1) I need to regenerate all of the libraries, (2) verify any other potential breakage, and (3) manage to get in touch with @ABelliqueux in order to republish the regenerated library files.

ABelliqueux commented 6 months ago

:clap: Here I am !