feat(libSceCesCs): implement Shift-JIS and EUC-JP scalar conversions #8967

Merged
simonbronk merged 2 commits from upstream-pr/8967 into main 2026-10-23 06:23:57 +00:00
simonbronk commented 2026-10-21 07:46:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T07:46:31Z.


What

Implements 32 libSceCesCs exports that were pending stubs, on the existing CP932 (sceCesUcsProfileInitSJis1997Cp932) and CP51932 (sceCesUcsProfileInitEucJpCp51932) profiles and JIS tables:

  • sceCesSJisTo{Ucs2,Utf8,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}
  • sceCesEucJpTo{Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}
  • sceCes{Ucs2,Utf8,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}To{SJis,EucJp}
  • sceCesSJisCodeToJisX0208, sceCesJisX0208ToSJisCode

Signatures follow the Orbital type database. Each call converts one character and follows the argument checks and error order of the existing sceCesEucJpToUtf8 and sceCesUtf8ToSbc. The Shift-JIS row/cell arithmetic already in decodeMbcs/encodeMbcs moves into two helpers that the new code reuses; behaviour is unchanged. The errors are not console measurements and are recorded in docs/dev/debt/libSceCesCs.md. libSceCesCs goes from 32 to 64 of 284 in tools/progress.py.

Tested

macOS 27 (Apple silicon), clang, C++20: libSceCesCs sources and tests compiled outside CMake, since the full build does not run on macOS. Passing:

  • new guest_ces_japanese: errors, byte orders, a Shift-JIS round trip of every encodable BMP code point, and a round trip of all 94×94 JIS X 0208 cells through the code functions;
  • existing guest_ces and guest_ces_unicode, with no regressions.

The CMake/ctest build on Linux and Windows was not run locally. check_conventions.py and pr_overlap.py are clean. No title tested.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4948195636 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8967). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-21T07:46:31Z. --- ### What Implements 32 libSceCesCs exports that were pending stubs, on the existing CP932 (`sceCesUcsProfileInitSJis1997Cp932`) and CP51932 (`sceCesUcsProfileInitEucJpCp51932`) profiles and JIS tables: - `sceCesSJisTo{Ucs2,Utf8,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}` - `sceCesEucJpTo{Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}` - `sceCes{Ucs2,Utf8,Utf16,Utf16be,Utf16le,Utf32,Utf32be,Utf32le}To{SJis,EucJp}` - `sceCesSJisCodeToJisX0208`, `sceCesJisX0208ToSJisCode` Signatures follow the Orbital type database. Each call converts one character and follows the argument checks and error order of the existing `sceCesEucJpToUtf8` and `sceCesUtf8ToSbc`. The Shift-JIS row/cell arithmetic already in `decodeMbcs`/`encodeMbcs` moves into two helpers that the new code reuses; behaviour is unchanged. The errors are not console measurements and are recorded in `docs/dev/debt/libSceCesCs.md`. libSceCesCs goes from 32 to 64 of 284 in `tools/progress.py`. ### Tested macOS 27 (Apple silicon), clang, C++20: libSceCesCs sources and tests compiled outside CMake, since the full build does not run on macOS. Passing: - new `guest_ces_japanese`: errors, byte orders, a Shift-JIS round trip of every encodable BMP code point, and a round trip of all 94×94 JIS X 0208 cells through the code functions; - existing `guest_ces` and `guest_ces_unicode`, with no regressions. The CMake/ctest build on Linux and Windows was not run locally. `check_conventions.py` and `pr_overlap.py` are clean. No title tested. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ycbuzi commented 2026-10-21 08:28:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T08:28:19Z.


Windows run of 164432c64a merged cleanly onto main f894ba69d3, the CMake/ctest build the description lists as not run. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, BUILD_TESTING=ON.

Built libSceCesCs, its module form and the six test executables with no errors or warnings. ctest --repeat until-fail:2 on guest_ces, guest_ces_module, guest_ces_unicode, guest_ces_unicode_module, guest_ces_japanese and guest_ces_japanese_module: all six pass on both repeats, the new guest_ces_japanese and its module form among them. Not run: Linux, a title.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6311562208 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8967#issuecomment-6311562208). Originally posted by [ycbuzi](https://github.com/ycbuzi) on 2026-10-21T08:28:19Z. --- Windows run of 164432c64a merged cleanly onto `main` f894ba69d3, the CMake/ctest build the description lists as not run. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, `BUILD_TESTING=ON`. Built `libSceCesCs`, its module form and the six test executables with no errors or warnings. `ctest --repeat until-fail:2` on `guest_ces`, `guest_ces_module`, `guest_ces_unicode`, `guest_ces_unicode_module`, `guest_ces_japanese` and `guest_ces_japanese_module`: all six pass on both repeats, the new `guest_ces_japanese` and its module form among them. Not run: Linux, a title.
simonbronk commented 2026-10-21 18:16:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T18:16:53Z.


Linux run of 3990593a1 merged onto main 99844c7ee (clean merge).

Environment: Ubuntu 24.04 x86-64 container under Rosetta on Apple Silicon (Colima), GCC 13, RelWithDebInfo, BUILD_TESTING=ON, ANYPS5_ENABLE_ASAN=ON. ASan builds dynamic executables, so this is not the CI configuration.

Results: the full build has no errors. guest_ces, guest_ces_dbcs, guest_ces_japanese, guest_ces_unicode and their module forms: all pass, with no AddressSanitizer report.

Not run: the static CI configuration, native x86-64 hardware, GPU tests, a title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6323252142 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8967#issuecomment-6323252142). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-21T18:16:53Z. --- Linux run of 3990593a1 merged onto `main` 99844c7ee (clean merge). **Environment:** Ubuntu 24.04 x86-64 container under Rosetta on Apple Silicon (Colima), GCC 13, `RelWithDebInfo`, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_ASAN=ON`. ASan builds dynamic executables, so this is not the CI configuration. **Results:** the full build has no errors. `guest_ces`, `guest_ces_dbcs`, `guest_ces_japanese`, `guest_ces_unicode` and their module forms: all pass, with no AddressSanitizer report. **Not run:** the static CI configuration, native x86-64 hardware, GPU tests, a title. AI-assisted (Claude Code).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!8967
No description provided.