Workaround for Ridge Racer V
The game seems to have problems when the media takes too long to completely read data.
The data processed by the game appears to get offset, causing some loop to never end, which ends with the scratchpad overflowing.
Unfortunately, I could not understand how the whole reading system worked because data seemed to be copied around memory, along with the reading state also being passed around various functions too.
This workaround changes sceCdGetReadPos() to always return 0 on the EE, so that the game will not observe any incremental updates to reading progress (but it will remain responsive). It will then process all data requested at once, when sceCdSync() indicates completion.
This game has 3 threads: the main thread, the server thread for rspu2drv (the tentative sound library) and the libcdvd callback thread.
The three semaphores that are created and remain throughout runtime belong to libcdvd. The old version of libcdvd has the glitch that causes the N-command semaphore to be always incremented past the maximum, but it is not a problem because libcdvd still has a check on the RPC completion status.
The Japanese version was compiled with SDK 1.4, while the US and European versions were made with SDK 1.5.
Since I seem incapable of passing even the first circuit, I haven't been able to tell if it really worsened performance or not.
So here it is, for the floor to decide on whether it's worth replicating for all RRV releases, for only USB mode:
https://www.sendspace.com/file/jxchul
Related commit:
https://github.com/sp193/Open-PS2-Loader/commit/9891e376f0b56cbf3c9459771a7c5ff3c3b41d10
This is currently only for the NTSC-U/C release.
***
On a side note, I think it ought to be mentioned somewhere that OPL's CDVDFSV implementation is not fully compatible with early games, as the structure used by sceCdRead() for alignment correction was different (16-byte alignment was a norm). But reading with sceCdRead() from the EE will work fine, if reading is done with addresses aligned to multiples of 64.
(btw is better to keep MODE 6 ON for a safer power-off I think…), no need for MODE 2 anymore.
You should switch off the PS2 properly with the shutdown button combo or by pressing the power button once. Mode 6 exists for compatibility with games that cannot work with IGR.
- when playing from SMB the HDD remains spinning (it even blinks the orange light sometimes), it's just normal??
Are you saying that your HDD cannot be shut down when SMB is used?
The LED is controlled by software, so it is impossible for it to blink on its own.
EDIT: please read my reply below.
- OPL still can't list all games if they are missing the ID prefix. Here the games I played from SMB:
Did this happen, after
commit ac5de9b3? If so, then I don't know what's wrong anymore...
Btw, in Menus (and in certain parts of the intro) there's a little audio stutter once every 10 secs (similar to the one there was even from HDD with previous OPL builds). It isn't much annoying.
You can avoid the stutter enabling MODE 2, but then you'll have the BSOD after the usual loading screen.
But was the game already like that on its original media? If so, then it is a consequence of the game's design.
Regarding games not being viewable in OPL game list unless including ID prefix. Here is my list:
CD
SLUS_202.57.Frogger The Great Quest
DVD
SCUS_974.02.Killzone
SLUS_202.14.State of Emergency
SLUS_203.14.Time Splitters 2
SLUS_205.71.TY Tasmanian Tiger
SLUS_207.31.Tony Hawks Underground
SLUS_208.51.Ace Combat 05
SLUS_208.72.Juiced
SLUS_209.21.ESPN NHL 2K5
SLUS_214.13.Thrillville
SLUS_215.61.Major League BB 2K7
SLUS_217.59.Lego Indiana Jones
I could not figure out what the common problem is with these games. This was tested in an older version of OPL but I can retest if you have a particular version you want me to test with.
Thanks.
Did this happen, after
commit ac5de9b3? If so, then I don't know what's wrong anymore...
That commit was meant to address this age-old problem, by replacing the code for parsing the filename with something closer to the official version.