Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifdef intraFont_6XX
- //5.00のcptblをデータ化したもの
- #include "cptbl_500.h"
- #endif
- int cccLoadTable(const char *filename, unsigned char cp) {
- if (cp >= CCC_N_CP) return CCC_ERROR_UNSUPPORTED;
- void* table_data = NULL;
- unsigned int filesize = 0;
- /* read in (compressed) table_data */
- #ifdef intraFont_6XX
- //include in cptbl_500.h
- table_data = (void*)data_cptbl;
- filesize = size_cptbl;
- #else
- SceUID fd = sceIoOpen(filename, PSP_O_RDONLY, 0777);
- if (fd < 0) return CCC_ERROR_FILE_READ;
- filesize = sceIoLseek(fd, 0, SEEK_END);
- sceIoLseek(fd, 0, SEEK_SET);
- table_data = (void*)malloc(filesize);
- if (!table_data) {
- sceIoClose(fd);
- return CCC_ERROR_MEM_ALLOC;
- }
- if (sceIoRead(fd, table_data, filesize) != filesize) {
- sceIoClose(fd);
- free(table_data);
- return CCC_ERROR_FILE_READ;
- }
- sceIoClose(fd);
- #endif
- /* decompress requested tables */
- unsigned int *header = (unsigned int*)table_data;
- while (header[0]) {
- if ((cp == 0) || (cp == header[0])) {
- void* table = (void*)malloc(header[4]);
Add Comment
Please, Sign In to add comment