CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/HLE/sceCcc.cpp
Views: 1401
1
// Copyright (c) 2012- PPSSPP Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#include "Common/Data/Encoding/Utf8.h"
19
#include "Common/Data/Encoding/Utf16.h"
20
#include "Common/Data/Encoding/Shiftjis.h"
21
22
#include "Common/Serialize/Serializer.h"
23
#include "Common/Serialize/SerializeFuncs.h"
24
#include "Core/Debugger/MemBlockInfo.h"
25
#include "Core/MemMap.h"
26
#include "Core/HLE/HLE.h"
27
#include "Core/HLE/FunctionWrappers.h"
28
#include "Core/HLE/sceCcc.h"
29
#include "Core/Reporting.h"
30
31
typedef PSPPointer<char> PSPCharPointer;
32
typedef PSPPointer<char16_t> PSPWCharPointer;
33
typedef PSPPointer<const char> PSPConstCharPointer;
34
typedef PSPPointer<const char16_t> PSPConstWCharPointer;
35
36
static u16 errorUTF8;
37
static u16 errorUTF16;
38
static u16 errorSJIS;
39
40
// These tables point directly to PSP memory and map all 64k possible u16 values.
41
static PSPWCharPointer ucs2jisTable;
42
static PSPWCharPointer jis2ucsTable;
43
44
void __CccInit()
45
{
46
errorUTF8 = 0;
47
errorUTF16 = 0;
48
errorSJIS = 0;
49
ucs2jisTable = 0;
50
jis2ucsTable = 0;
51
}
52
53
void __CccDoState(PointerWrap &p)
54
{
55
auto s = p.Section("sceCcc", 1);
56
if (!s)
57
return;
58
59
Do(p, errorUTF8);
60
Do(p, errorUTF16);
61
Do(p, errorSJIS);
62
Do(p, ucs2jisTable);
63
Do(p, jis2ucsTable);
64
}
65
66
static u32 __CccUCStoJIS(u32 c, u32 alt)
67
{
68
// JIS can only be 16-bit at most, UCS can be 32 (even if the table only supports UCS-2.)
69
alt &= 0xFFFF;
70
71
// If it's outside the table or blank in the table, return alt.
72
if (c > 0xFFFF || ucs2jisTable[c] == 0)
73
return alt;
74
return ucs2jisTable[c];
75
}
76
77
static u32 __CccJIStoUCS(u32 c, u32 alt)
78
{
79
// JIS can only be 16-bit at most, UCS can be 32 (even if the table only supports UCS-2.)
80
c &= 0xFFFF;
81
if (jis2ucsTable[c] == 0)
82
return alt;
83
return jis2ucsTable[c];
84
}
85
86
static void sceCccSetTable(u32 jis2ucs, u32 ucs2jis)
87
{
88
// Both tables jis2ucs and ucs2jis have a size of 0x20000 bytes.
89
DEBUG_LOG(Log::sceMisc, "sceCccSetTable(%08x, %08x)", jis2ucs, ucs2jis);
90
ucs2jisTable = ucs2jis;
91
jis2ucsTable = jis2ucs;
92
}
93
94
static int sceCccUTF8toUTF16(u32 dstAddr, u32 dstSize, u32 srcAddr)
95
{
96
const auto src = PSPConstCharPointer::Create(srcAddr);
97
auto dst = PSPWCharPointer::Create(dstAddr);
98
if (!dst.IsValid() || !src.IsValid())
99
{
100
ERROR_LOG(Log::sceMisc, "sceCccUTF8toUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
101
return 0;
102
}
103
104
// Round dstSize down if it represents half a character.
105
const auto dstEnd = PSPWCharPointer::Create(dstAddr + (dstSize & ~1));
106
107
DEBUG_LOG(Log::sceMisc, "sceCccUTF8toUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
108
UTF8 utf(src);
109
int n = 0;
110
while (u32 c = utf.next())
111
{
112
if (dst + UTF16LE::encodeUnits(c) >= dstEnd)
113
break;
114
dst += UTF16LE::encode(dst, c);
115
n++;
116
}
117
118
if (dst < dstEnd)
119
*dst++ = 0;
120
121
NotifyMemInfo(MemBlockFlags::READ, srcAddr, utf.byteIndex(), "sceCcc");
122
NotifyMemInfo(MemBlockFlags::WRITE, dstAddr, dst.ptr - dstAddr, "sceCcc");
123
return n;
124
}
125
126
static int sceCccUTF8toSJIS(u32 dstAddr, u32 dstSize, u32 srcAddr)
127
{
128
const auto src = PSPConstCharPointer::Create(srcAddr);
129
auto dst = PSPCharPointer::Create(dstAddr);
130
if (!dst.IsValid() || !src.IsValid())
131
{
132
ERROR_LOG(Log::sceMisc, "sceCccUTF8toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
133
return 0;
134
}
135
if (!ucs2jisTable.IsValid())
136
{
137
ERROR_LOG(Log::sceMisc, "sceCccUTF8toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
138
return 0;
139
}
140
141
const auto dstEnd = PSPCharPointer::Create(dstAddr + dstSize);
142
143
DEBUG_LOG(Log::sceMisc, "sceCccUTF8toSJIS(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
144
UTF8 utf(src);
145
int n = 0;
146
while (u32 c = utf.next())
147
{
148
if (dst + ShiftJIS::encodeUnits(c) >= dstEnd)
149
break;
150
dst += ShiftJIS::encode(dst, __CccUCStoJIS(c, errorSJIS));
151
n++;
152
}
153
154
if (dst < dstEnd)
155
*dst++ = 0;
156
157
NotifyMemInfo(MemBlockFlags::READ, srcAddr, utf.byteIndex(), "sceCcc");
158
NotifyMemInfo(MemBlockFlags::WRITE, dstAddr, dst.ptr - dstAddr, "sceCcc");
159
return n;
160
}
161
162
static int sceCccUTF16toUTF8(u32 dstAddr, u32 dstSize, u32 srcAddr)
163
{
164
const auto src = PSPConstWCharPointer::Create(srcAddr);
165
auto dst = PSPCharPointer::Create(dstAddr);
166
if (!dst.IsValid() || !src.IsValid())
167
{
168
ERROR_LOG(Log::sceMisc, "sceCccUTF16toUTF8(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
169
return 0;
170
}
171
172
const auto dstEnd = PSPCharPointer::Create(dstAddr + dstSize);
173
174
DEBUG_LOG(Log::sceMisc, "sceCccUTF16toUTF8(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
175
UTF16LE utf(src);
176
int n = 0;
177
while (u32 c = utf.next())
178
{
179
if (dst + UTF8::encodeUnits(c) >= dstEnd)
180
break;
181
dst += UTF8::encode(dst, c);
182
n++;
183
}
184
185
if (dst < dstEnd)
186
*dst++ = 0;
187
188
NotifyMemInfo(MemBlockFlags::READ, srcAddr, utf.shortIndex() * sizeof(uint16_t), "sceCcc");
189
NotifyMemInfo(MemBlockFlags::WRITE, dstAddr, dst.ptr - dstAddr, "sceCcc");
190
return n;
191
}
192
193
static int sceCccUTF16toSJIS(u32 dstAddr, u32 dstSize, u32 srcAddr)
194
{
195
const auto src = PSPConstWCharPointer::Create(srcAddr);
196
auto dst = PSPCharPointer::Create(dstAddr);
197
if (!dst.IsValid() || !src.IsValid())
198
{
199
ERROR_LOG(Log::sceMisc, "sceCccUTF16toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
200
return 0;
201
}
202
if (!ucs2jisTable.IsValid())
203
{
204
ERROR_LOG(Log::sceMisc, "sceCccUTF16toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
205
return 0;
206
}
207
208
const auto dstEnd = PSPCharPointer::Create(dstAddr + dstSize);
209
210
DEBUG_LOG(Log::sceMisc, "sceCccUTF16toSJIS(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
211
UTF16LE utf(src);
212
int n = 0;
213
while (u32 c = utf.next())
214
{
215
if (dst + ShiftJIS::encodeUnits(c) >= dstEnd)
216
break;
217
dst += ShiftJIS::encode(dst, __CccUCStoJIS(c, errorSJIS));
218
n++;
219
}
220
221
if (dst < dstEnd)
222
*dst++ = 0;
223
224
NotifyMemInfo(MemBlockFlags::READ, srcAddr, utf.shortIndex() * sizeof(uint16_t), "sceCcc");
225
NotifyMemInfo(MemBlockFlags::WRITE, dstAddr, dst.ptr - dstAddr, "sceCcc");
226
return n;
227
}
228
229
static int sceCccSJIStoUTF8(u32 dstAddr, u32 dstSize, u32 srcAddr)
230
{
231
const auto src = PSPConstCharPointer::Create(srcAddr);
232
auto dst = PSPCharPointer::Create(dstAddr);
233
if (!dst.IsValid() || !src.IsValid())
234
{
235
ERROR_LOG(Log::sceMisc, "sceCccSJIStoUTF8(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
236
return 0;
237
}
238
if (!jis2ucsTable.IsValid())
239
{
240
ERROR_LOG(Log::sceMisc, "sceCccSJIStoUTF8(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
241
return 0;
242
}
243
244
const auto dstEnd = PSPCharPointer::Create(dstAddr + dstSize);
245
246
DEBUG_LOG(Log::sceMisc, "sceCccSJIStoUTF8(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
247
ShiftJIS sjis(src);
248
int n = 0;
249
while (u32 c = sjis.next())
250
{
251
if (dst + UTF8::encodeUnits(c) >= dstEnd)
252
break;
253
dst += UTF8::encode(dst, __CccJIStoUCS(c, errorUTF8));
254
n++;
255
}
256
257
if (dst < dstEnd)
258
*dst++ = 0;
259
260
NotifyMemInfo(MemBlockFlags::READ, srcAddr, sjis.byteIndex(), "sceCcc");
261
NotifyMemInfo(MemBlockFlags::WRITE, dstAddr, dst.ptr - dstAddr, "sceCcc");
262
return n;
263
}
264
265
static int sceCccSJIStoUTF16(u32 dstAddr, u32 dstSize, u32 srcAddr)
266
{
267
const auto src = PSPConstCharPointer::Create(srcAddr);
268
auto dst = PSPWCharPointer::Create(dstAddr);
269
if (!dst.IsValid() || !src.IsValid())
270
{
271
ERROR_LOG(Log::sceMisc, "sceCccSJIStoUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
272
return 0;
273
}
274
if (!jis2ucsTable.IsValid())
275
{
276
ERROR_LOG(Log::sceMisc, "sceCccSJIStoUTF16(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
277
return 0;
278
}
279
280
const auto dstEnd = PSPWCharPointer::Create(dstAddr + (dstSize & ~1));
281
282
DEBUG_LOG(Log::sceMisc, "sceCccSJIStoUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
283
ShiftJIS sjis(src);
284
int n = 0;
285
while (u32 c = sjis.next())
286
{
287
if (dst + UTF16LE::encodeUnits(c) >= dstEnd)
288
break;
289
dst += UTF16LE::encode(dst, __CccJIStoUCS(c, errorUTF16));
290
n++;
291
}
292
293
if (dst < dstEnd)
294
*dst++ = 0;
295
296
NotifyMemInfo(MemBlockFlags::READ, srcAddr, sjis.byteIndex(), "sceCcc");
297
NotifyMemInfo(MemBlockFlags::WRITE, dstAddr, dst.ptr - dstAddr, "sceCcc");
298
return n;
299
}
300
301
static int sceCccStrlenUTF8(u32 strAddr)
302
{
303
const auto str = PSPConstCharPointer::Create(strAddr);
304
if (!str.IsValid())
305
{
306
ERROR_LOG(Log::sceMisc, "sceCccStrlenUTF8(%08x): invalid pointer", strAddr);
307
return 0;
308
}
309
DEBUG_LOG(Log::sceMisc, "sceCccStrlenUTF8(%08x): invalid pointer", strAddr);
310
return UTF8(str).length();
311
}
312
313
static int sceCccStrlenUTF16(u32 strAddr)
314
{
315
const auto str = PSPConstWCharPointer::Create(strAddr);
316
if (!str.IsValid())
317
{
318
ERROR_LOG(Log::sceMisc, "sceCccStrlenUTF16(%08x): invalid pointer", strAddr);
319
return 0;
320
}
321
DEBUG_LOG(Log::sceMisc, "sceCccStrlenUTF16(%08x): invalid pointer", strAddr);
322
return UTF16LE(str).length();
323
}
324
325
static int sceCccStrlenSJIS(u32 strAddr)
326
{
327
const auto str = PSPCharPointer::Create(strAddr);
328
if (!str.IsValid())
329
{
330
ERROR_LOG(Log::sceMisc, "sceCccStrlenSJIS(%08x): invalid pointer", strAddr);
331
return 0;
332
}
333
DEBUG_LOG(Log::sceMisc, "sceCccStrlenSJIS(%08x): invalid pointer", strAddr);
334
return ShiftJIS(str).length();
335
}
336
337
static u32 sceCccEncodeUTF8(u32 dstAddrAddr, u32 ucs)
338
{
339
auto dstp = PSPPointer<PSPCharPointer>::Create(dstAddrAddr);
340
341
if (!dstp.IsValid() || !dstp->IsValid())
342
{
343
ERROR_LOG(Log::sceMisc, "sceCccEncodeUTF8(%08x, U+%04x): invalid pointer", dstAddrAddr, ucs);
344
return 0;
345
}
346
DEBUG_LOG(Log::sceMisc, "sceCccEncodeUTF8(%08x, U+%04x)", dstAddrAddr, ucs);
347
*dstp += UTF8::encode(*dstp, ucs);
348
return dstp->ptr;
349
}
350
351
static void sceCccEncodeUTF16(u32 dstAddrAddr, u32 ucs)
352
{
353
auto dstp = PSPPointer<PSPWCharPointer>::Create(dstAddrAddr);
354
355
if (!dstp.IsValid() || !dstp->IsValid())
356
{
357
ERROR_LOG(Log::sceMisc, "sceCccEncodeUTF16(%08x, U+%04x): invalid pointer", dstAddrAddr, ucs);
358
return;
359
}
360
DEBUG_LOG(Log::sceMisc, "sceCccEncodeUTF16(%08x, U+%04x)", dstAddrAddr, ucs);
361
// Anything above 0x10FFFF is unencodable, and 0xD800 - 0xDFFF are reserved for surrogate pairs.
362
if (ucs > 0x10FFFF || (ucs & 0xD800) == 0xD800)
363
ucs = errorUTF16;
364
*dstp += UTF16LE::encode(*dstp, ucs);
365
}
366
367
static u32 sceCccEncodeSJIS(u32 dstAddrAddr, u32 jis)
368
{
369
auto dstp = PSPPointer<PSPCharPointer>::Create(dstAddrAddr);
370
371
if (!dstp.IsValid() || !dstp->IsValid())
372
{
373
ERROR_LOG(Log::sceMisc, "sceCccEncodeSJIS(%08x, U+%04x): invalid pointer", dstAddrAddr, jis);
374
return 0;
375
}
376
DEBUG_LOG(Log::sceMisc, "sceCccEncodeSJIS(%08x, U+%04x)", dstAddrAddr, jis);
377
*dstp += ShiftJIS::encode(*dstp, jis);
378
return dstp->ptr;
379
}
380
381
static u32 sceCccDecodeUTF8(u32 dstAddrAddr)
382
{
383
auto dstp = PSPPointer<PSPConstCharPointer>::Create(dstAddrAddr);
384
385
if (!dstp.IsValid() || !dstp->IsValid()) {
386
ERROR_LOG(Log::sceMisc, "sceCccDecodeUTF8(%08x): invalid pointer", dstAddrAddr);
387
// Should crash?
388
return 0;
389
}
390
391
DEBUG_LOG(Log::sceMisc, "sceCccDecodeUTF8(%08x)", dstAddrAddr);
392
UTF8 utf(*dstp);
393
u32 result = utf.next();
394
*dstp += utf.byteIndex();
395
396
if (result == UTF8::INVALID)
397
return errorUTF8;
398
return result;
399
}
400
401
static u32 sceCccDecodeUTF16(u32 dstAddrAddr)
402
{
403
auto dstp = PSPPointer<PSPConstWCharPointer>::Create(dstAddrAddr);
404
405
if (!dstp.IsValid() || !dstp->IsValid()) {
406
ERROR_LOG(Log::sceMisc, "sceCccDecodeUTF16(%08x): invalid pointer", dstAddrAddr);
407
// Should crash?
408
return 0;
409
}
410
411
DEBUG_LOG(Log::sceMisc, "sceCccDecodeUTF16(%08x)", dstAddrAddr);
412
// TODO: Does it do any detection of BOM?
413
UTF16LE utf(*dstp);
414
u32 result = utf.next();
415
*dstp += utf.shortIndex();
416
417
if (result == UTF16LE::INVALID)
418
return errorUTF16;
419
return result;
420
}
421
422
static u32 sceCccDecodeSJIS(u32 dstAddrAddr)
423
{
424
auto dstp = PSPPointer<PSPConstCharPointer>::Create(dstAddrAddr);
425
426
if (!dstp.IsValid() || !dstp->IsValid()) {
427
ERROR_LOG(Log::sceMisc, "sceCccDecodeSJIS(%08x): invalid pointer", dstAddrAddr);
428
// Should crash?
429
return 0;
430
}
431
432
DEBUG_LOG(Log::sceMisc, "sceCccDecodeSJIS(%08x)", dstAddrAddr);
433
ShiftJIS sjis(*dstp);
434
u32 result = sjis.next();
435
*dstp += sjis.byteIndex();
436
437
if (result == ShiftJIS::INVALID)
438
return errorSJIS;
439
return result;
440
}
441
442
static int sceCccIsValidUTF8(u32 c)
443
{
444
WARN_LOG(Log::sceMisc, "UNIMPL sceCccIsValidUTF8(%08x)", c);
445
return c != 0;
446
}
447
448
static int sceCccIsValidUTF16(u32 c)
449
{
450
WARN_LOG(Log::sceMisc, "UNIMPL sceCccIsValidUTF16(%08x)", c);
451
return c != 0;
452
}
453
454
static int sceCccIsValidSJIS(u32 c)
455
{
456
WARN_LOG(Log::sceMisc, "UNIMPL sceCccIsValidSJIS(%08x)", c);
457
return c != 0;
458
}
459
460
static int sceCccIsValidUCS2(u32 c)
461
{
462
WARN_LOG(Log::sceMisc, "UNIMPL sceCccIsValidUCS2(%08x)", c);
463
return c != 0;
464
}
465
466
static int sceCccIsValidUCS4(u32 c)
467
{
468
WARN_LOG(Log::sceMisc, "UNIMPL sceCccIsValidUCS4(%08x)", c);
469
return c != 0;
470
}
471
472
static int sceCccIsValidJIS(u32 c)
473
{
474
WARN_LOG(Log::sceMisc, "UNIMPL sceCccIsValidJIS(%08x)", c);
475
return c != 0;
476
}
477
478
static int sceCccIsValidUnicode(u32 c)
479
{
480
WARN_LOG(Log::sceMisc, "UNIMPL sceCccIsValidUnicode(%08x)", c);
481
return c != 0;
482
}
483
484
static u32 sceCccSetErrorCharUTF8(u32 c)
485
{
486
DEBUG_LOG(Log::sceMisc, "sceCccSetErrorCharUTF8(%08x)", c);
487
int result = errorUTF8;
488
errorUTF8 = c;
489
return result;
490
}
491
492
static u32 sceCccSetErrorCharUTF16(u32 c)
493
{
494
DEBUG_LOG(Log::sceMisc, "sceCccSetErrorCharUTF16(%08x)", c);
495
int result = errorUTF16;
496
errorUTF16 = c;
497
return result;
498
}
499
500
static u32 sceCccSetErrorCharSJIS(u32 c)
501
{
502
DEBUG_LOG(Log::sceMisc, "sceCccSetErrorCharSJIS(%04x)", c);
503
int result = errorSJIS;
504
errorSJIS = c;
505
return result;
506
}
507
508
static u32 sceCccUCStoJIS(u32 c, u32 alt)
509
{
510
if (ucs2jisTable.IsValid())
511
{
512
DEBUG_LOG(Log::sceMisc, "sceCccUCStoJIS(%08x, %08x)", c, alt);
513
return __CccUCStoJIS(c, alt);
514
}
515
else
516
{
517
ERROR_LOG(Log::sceMisc, "sceCccUCStoJIS(%08x, %08x): table not loaded", c, alt);
518
return alt;
519
}
520
}
521
522
static u32 sceCccJIStoUCS(u32 c, u32 alt)
523
{
524
if (jis2ucsTable.IsValid())
525
{
526
DEBUG_LOG(Log::sceMisc, "sceCccUCStoJIS(%08x, %08x)", c, alt);
527
return __CccJIStoUCS(c, alt);
528
}
529
else
530
{
531
ERROR_LOG(Log::sceMisc, "sceCccUCStoJIS(%08x, %08x): table not loaded", c, alt);
532
return alt;
533
}
534
}
535
536
const HLEFunction sceCcc[] =
537
{
538
{0XB4D1CBBF, &WrapV_UU<sceCccSetTable>, "sceCccSetTable", 'v', "xx" },
539
{0X00D1378F, &WrapI_UUU<sceCccUTF8toUTF16>, "sceCccUTF8toUTF16", 'i', "xxx"},
540
{0X6F82EE03, &WrapI_UUU<sceCccUTF8toSJIS>, "sceCccUTF8toSJIS", 'i', "xxx"},
541
{0X41B724A5, &WrapI_UUU<sceCccUTF16toUTF8>, "sceCccUTF16toUTF8", 'i', "xxx"},
542
{0XF1B73D12, &WrapI_UUU<sceCccUTF16toSJIS>, "sceCccUTF16toSJIS", 'i', "xxx"},
543
{0XA62E6E80, &WrapI_UUU<sceCccSJIStoUTF8>, "sceCccSJIStoUTF8", 'i', "xxx"},
544
{0XBEB47224, &WrapI_UUU<sceCccSJIStoUTF16>, "sceCccSJIStoUTF16", 'i', "xxx"},
545
{0XB7D3C112, &WrapI_U<sceCccStrlenUTF8>, "sceCccStrlenUTF8", 'i', "x" },
546
{0X4BDEB2A8, &WrapI_U<sceCccStrlenUTF16>, "sceCccStrlenUTF16", 'i', "x" },
547
{0XD9392CCB, &WrapI_U<sceCccStrlenSJIS>, "sceCccStrlenSJIS", 'i', "x" },
548
{0X92C05851, &WrapU_UU<sceCccEncodeUTF8>, "sceCccEncodeUTF8", 'x', "xx" },
549
{0X8406F469, &WrapV_UU<sceCccEncodeUTF16>, "sceCccEncodeUTF16", 'v', "xx" },
550
{0X068C4320, &WrapU_UU<sceCccEncodeSJIS>, "sceCccEncodeSJIS", 'x', "xx" },
551
{0XC6A8BEE2, &WrapU_U<sceCccDecodeUTF8>, "sceCccDecodeUTF8", 'x', "x" },
552
{0XE0CF8091, &WrapU_U<sceCccDecodeUTF16>, "sceCccDecodeUTF16", 'x', "x" },
553
{0X953E6C10, &WrapU_U<sceCccDecodeSJIS>, "sceCccDecodeSJIS", 'x', "x" },
554
{0X90521AC5, &WrapI_U<sceCccIsValidUTF8>, "sceCccIsValidUTF8", 'i', "x" },
555
{0XCC0A8BDA, &WrapI_U<sceCccIsValidUTF16>, "sceCccIsValidUTF16", 'i', "x" },
556
{0X67BF0D19, &WrapI_U<sceCccIsValidSJIS>, "sceCccIsValidSJIS", 'i', "x" },
557
{0X76E33E9C, &WrapI_U<sceCccIsValidUCS2>, "sceCccIsValidUCS2", 'i', "x" },
558
{0XD2B18485, &WrapI_U<sceCccIsValidUCS4>, "sceCccIsValidUCS4", 'i', "x" },
559
{0XA2D5D209, &WrapI_U<sceCccIsValidJIS>, "sceCccIsValidJIS", 'i', "x" },
560
{0XBD11EEF3, &WrapI_U<sceCccIsValidUnicode>, "sceCccIsValidUnicode", 'i', "x" },
561
{0X17E1D813, &WrapU_U<sceCccSetErrorCharUTF8>, "sceCccSetErrorCharUTF8", 'x', "x" },
562
{0XB8476CF4, &WrapU_U<sceCccSetErrorCharUTF16>, "sceCccSetErrorCharUTF16", 'x', "x" },
563
{0XC56949AD, &WrapU_U<sceCccSetErrorCharSJIS>, "sceCccSetErrorCharSJIS", 'x', "x" },
564
{0X70ECAA10, &WrapU_UU<sceCccUCStoJIS>, "sceCccUCStoJIS", 'x', "xx" },
565
{0XFB7846E2, &WrapU_UU<sceCccJIStoUCS>, "sceCccJIStoUCS", 'x', "xx" },
566
};
567
568
void Register_sceCcc()
569
{
570
RegisterModule("sceCcc", ARRAY_SIZE(sceCcc), sceCcc);
571
}
572
573