mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-03 03:05:18 +02:00
The fake disc ID homebrew gets when it has no PARAM.SFO is built from the sum of the bytes of its folder name, summed through a plain char - which is signed on x86 and unsigned on ARM. So the same homebrew folder produced one ID on Windows and a different one on Android, quietly splitting its savestates and per-game config between platforms. Sum through unsigned char, which is what the ARM builds (Android, iOS, Apple Silicon) already did. Uppercasing is now explicit and ASCII-only rather than toupper(). Passing a negative char to toupper() is undefined and trips MSVC's debug CRT assert, so a folder with a non-ASCII name could stop a debug build dead, and what it did with bytes above 0x7F otherwise depended on the locale. ASCII folder names - very nearly all of them - produce exactly the same ID as before. Non-ASCII ones change on the signed-char platforms, to what the unsigned-char ones were already generating. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9