cellSaveData: Only cap fileNum and sizeKB for SDK 2.6 and older or fileListMax 0 #19905

Merged
digant73 opened 1:14pm on October 21, 2026 wanted to merge 415 Ξ” into rpcs3/rpcs3 master from
cellsavedata-filenum-cap
This work implements Madagascar: Escape 2 Africa don't save (closed)

Quick summary

Hello developers good afternoon.

I noticed that the game Madagascar 2 simply does not save progress, the game does not save either at the beginning or as the game progresses, the game does not save any time, the other games that I play in the emulator are all normal, only this one has a problem. Could it be some bug going on? Thanks in advance.

Details

No response

Attach a log file

RPCS3.log RPCS3.log.gz

Attach capture files for visual issues

No response

System configuration

RPCS3 v0.0.27-14954-0524f4a5 Alpha | master | FW 4.90 | Windows 11 22H2 Genuine Intel 0000 | 16 Threads | 31.85 GiB RAM | AVX-512+ | FMA3 GPU: NVIDIA GeForce GTX 750 Ti (531.68)

Other details

No response

Diff Delta:
415
Classified as:  General

digant73's Description of Work #13792 Madagascar: Escape 2 Africa don't save

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.


1 total changed file
Loading changes...
You’ve reached the end of the pull request
Please mind the merge button