Analysis, hwtest and fixes made by Opus 5.5. Tested by me.
(confirmed) Fixes #13792
Bug: Madagascar: Escape 2 Africa (#13792) reports its save as broken because its funcStat rejects the save when fileListNum < fileNum. When a save has more files than fileListMax, RPCS3 reports every file in fileNum and sizeKB but caps fileListNum. A PS3 also caps fileNum and sizeKB for games built with SDK 0x26FFFF or older (the game uses 0x230001). With fileListMax 0 it counts no file on any SDK. From SDK 0x270000 onward with fileListMax β₯ 1 it counts every file, as upstream does.
Fix: Before the existing loop, cut the sorted file list to fileListMax when sdk_ver <= 0x26FFFF or fileListMax is 0 (+6/β0, the loop is unchanged).
Results (hwtest, save with 3 files, fileNum / fileListNum / sizeKB):
filenum_hwtest_19905.zip
ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββββββββββββββββ¬βββββββββββββ¬βββββββββββββ
β SDK β fileListMax β upstream β this PR β PS3 β
ββββββββββββββΌββββββββββββββΌββββββββββββββββββββββββββββΌβββββββββββββΌβββββββββββββ€
β β€ 0x26FFFF β 0 β 3 / 0 / 53* β 0 / 0 / 35 β 0 / 0 / 35 β
ββββββββββββββΌββββββββββββββΌββββββββββββββββββββββββββββΌβββββββββββββΌβββββββββββββ€
β β€ 0x26FFFF β 1 β 3 / 1 / 53 (game: BROKEN) β 1 / 1 / 49 β 1 / 1 / 49 β
ββββββββββββββΌββββββββββββββΌββββββββββββββββββββββββββββΌβββββββββββββΌβββββββββββββ€
β β₯ 0x270000 β 0 β 3 / 0 / 53* β 0 / 0 / 35 β 0 / 0 / 35 β
ββββββββββββββΌββββββββββββββΌββββββββββββββββββββββββββββΌβββββββββββββΌβββββββββββββ€
β β₯ 0x270000 β 1 β 3 / 1 / 53* β 3 / 1 / 53 β 3 / 1 / 53 β
ββββββββββββββΌββββββββββββββΌββββββββββββββββββββββββββββΌβββββββββββββΌβββββββββββββ€
β any β 8 β 3 / 3 / 53 β 3 / 3 / 53 β 3 / 3 / 53 β
ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββββββββββββββββ΄βββββββββββββ΄βββββββββββββ
From the code, not run on upstream.
The SDK threshold was narrowed down on the PS3 with probes from 0x00230001 to 0x00470001, including 0x0025FFFFβ0x00270000.
The same values hold for all 11 funcStat functions tested and for 3 file mixes.
fileListMax decides, not bufSize.
The output of this PR is identical to the PS3 output in every test. Madagascar 2 shows "Continue" again and loads its save.