Merge pull request #5153 from Kikoarl/feat/ces-sjis-cp932-profile-init

feat(ces): implement sceCesUcsProfileInitSJis1997Cp932
This commit is contained in:
Dean 2026-10-14 14:27:11 +13:00 committed by GitHub
commit 0af3f150fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View File

@ -115,6 +115,11 @@ const uint8_t* APS5_VABI sceCesRefersUcsProfileCp1251(void) {
return CP1251_PROFILE;
}
void* APS5_VABI sceCesUcsProfileInitSJis1997Cp932(void* sheet) {
if (!sheet) return nullptr;
return sheet;
}
int APS5_VABI sceCesMbcsUcsContextInit(void* context, const void* profile) {
(void)profile;
if (!context) return CES_ERROR_INVALID_PARAMETER;

View File

@ -9,6 +9,7 @@ const std::uint8_t* APS5_VABI sceCesRefersUcsProfileCp1251(void);
int APS5_VABI sceCesMbcsUcsContextInit(void*, const void*);
int APS5_VABI sceCesSbcToUtf8(const std::uint8_t*, std::uint8_t, std::uint8_t*, std::uint32_t, std::uint32_t*);
int APS5_VABI sceCesUtf8ToSbc(const std::uint8_t*, std::uint32_t, std::uint32_t*, const std::uint8_t*, std::uint8_t*);
void* APS5_VABI sceCesUcsProfileInitSJis1997Cp932(void*);
}
static void Require(bool value) { if (!value) std::abort(); }
@ -106,4 +107,9 @@ int main() {
char context[256] = {};
Require(sceCesMbcsUcsContextInit(context, cyrillic) == 0);
Require(sceCesMbcsUcsContextInit(nullptr, cyrillic) == invalidParameter);
char sheet[256] = {};
Require(sceCesUcsProfileInitSJis1997Cp932(sheet) == sheet);
Require(sceCesUcsProfileInitSJis1997Cp932(nullptr) == nullptr);
Require(sceCesMbcsUcsContextInit(context, sheet) == 0);
}

View File

@ -3,3 +3,5 @@
### Silent stubs
- [sceCesMbcsUcsContextInit](../../../core/libs/prx/libSceCesCs/Export.cpp) (libSceCesCs) - returns success without writing to the context, and returns the invalid-parameter error for a null context. The signature `int sceCesMbcsUcsContextInit(union* context, const union* mbcsUcsPrf)` follows the [Orbital IDA type database](https://github.com/AlexAltea/orbital/blob/master/tools/ida/db_types.json); the context layout and its size are unknown, so nothing is stored. PPSA15246 calls it and imports no other function that takes the context; no conversion through an initialized context exists. `sceCesRefersUcsProfileCp1251` returns a profile accepted by `sceCesSbcToUtf8` and `sceCesUtf8ToSbc` only, with the Windows-1251 table of Microsoft's [bestfit1251.txt](https://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1251.txt), where byte 0x98 (unassigned) maps to U+0098 like the unassigned Cp1252 bytes; the console behavior for that byte is not verified
- [sceCesUcsProfileInitSJis1997Cp932](../../../core/libs/prx/libSceCesCs/Export.cpp) (libSceCesCs) - returns the sheet argument without writing profile tables to it, and returns null for a null pointer; Shift-JIS conversion tables are unimplemented. The signature `union* sceCesUcsProfileInitSJis1997Cp932(SceCesUcsProfileSheet* sheet)` follows the [Orbital IDA type database](https://github.com/AlexAltea/orbital/blob/master/tools/ida/db_types.json)