Skip to content

feat(libSceCesCs): add sceCesRefersUcsProfileCp1251 and sceCesMbcsUcsContextInit - #3824

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
xXPBSXx:fix/ces-cp1251-profile
Oct 12, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
xXPBSXx:fix/ces-cp1251-profile

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds sceCesRefersUcsProfileCp1251 and sceCesMbcsUcsContextInit to libSceCesCs, which PPSA15246 imports.

  • sceCesRefersUcsProfileCp1251 returns a profile that sceCesSbcToUtf8 and sceCesUtf8ToSbc accept next to the existing Cp1252 one, with the Windows-1251 table of Microsoft's bestfit1251.txt (byte 0x98, unassigned there, maps to U+0098 like the unassigned Cp1252 bytes; the console behavior for that byte is not verified).
  • sceCesMbcsUcsContextInit(context, profile) returns the invalid-parameter error for a null context and success otherwise without writing to the context: its layout and size are unknown. The signature follows the Orbital IDA type database. Listed in docs/dev/TechnicalDebt.md.

guest_ces_tests gets a Cp1251 round-trip case.

Tested

Windows, main a11c8f7 plus this branch: python tools/check_conventions.py --base upstream/main passes; ctest -R guest_ces passes. Not tested on Linux and not run against PPSA15246 with this branch; no conversion through an initialized context exists.

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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

…ContextInit

PPSA15246 (Teardown) imports both from the module-named libSceCesCs-module and
stops at the loader without them. Cp1251 joins Cp1252 in sceCesSbcToUtf8 and
sceCesUtf8ToSbc; the context initializer succeeds without storing anything
because its layout is unknown (listed in TechnicalDebt.md).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Progress report (bab7b32 → 50ca599)

📈 System libraries: 86.48% (+0.01%, +2 implemented functions)

✅ 2 implemented
Library Name
libSceCesCs sceCesMbcsUcsContextInit
libSceCesCs sceCesRefersUcsProfileCp1251
⚪ 1 behaviourally empty (constant return or throw)
Library Name
libSceCesCs sceCesRefersUcsProfileCp1251

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the Cp1251 table and the profile handling check out (all 128 entries match the Windows-1251 codec; guest_ces passes on a Linux build and fails to link without the change). Two things to fix:

  • core/libs/prx/libSceCesCs-module/CMakeLists.txt: the only -module targets on main are libSceFont-module and libSceFontFt-module, which exist because a title loads the library under that name. Please show that PPSA15246 (or another title) loads libSceCesCs-module, with a test that uses the target, or drop it from this PR. As is, it compiles the same exports a second time and nothing builds or tests it (EXCLUDE_FROM_ALL).
  • docs/dev/TechnicalDebt.md:47: the new line is the last one of "Silent stubs", where other open PRs append (#2850 already touches the neighbouring line, so this will conflict). Please place it a few lines away from the end of the section.

…lDebt line

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@xXPBSXx

xXPBSXx commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, both points addressed in the new commit on this branch:

  • libSceCesCs-module is removed. I have no evidence that a title loads the library under that name (PPSA15246's sce_module folder holds only libc.prx), and nothing built or tested the target, so it does not belong here.
  • The sceCesMbcsUcsContextInit / Cp1251 TechnicalDebt line moved a few lines up inside "Silent stubs", away from the last line.

Tested: check_conventions.py --base upstream/main passes, ctest -R guest_ces passes (Windows).

AI-assisted (Claude Code).

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the Cp1251 table (128 entries), both profiles in sceCesSbcToUtf8/sceCesUtf8ToSbc, guest_ces (passes; fails to link without the change) and the TechnicalDebt placement; both review points are addressed. Merging.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 11, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 11, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 12, 2026
@oneandonlydean
oneandonlydean merged commit 773f8de into boykopovar:main Oct 12, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants