├── .gitignore
├── .idea
├── Falcom.iml
├── misc.xml
├── modules.xml
├── vcs.xml
└── workspace.xml
├── CMakeLists.txt
├── README.md
├── common
├── include
│ ├── asuka.h
│ ├── freetype
│ │ ├── config
│ │ │ ├── ftconfig.h
│ │ │ ├── ftheader.h
│ │ │ ├── ftmodule.h
│ │ │ ├── ftoption.h
│ │ │ └── ftstdlib.h
│ │ ├── freetype.h
│ │ ├── ftadvanc.h
│ │ ├── ftautoh.h
│ │ ├── ftbbox.h
│ │ ├── ftbdf.h
│ │ ├── ftbitmap.h
│ │ ├── ftbzip2.h
│ │ ├── ftcache.h
│ │ ├── ftcffdrv.h
│ │ ├── ftchapters.h
│ │ ├── ftcid.h
│ │ ├── fterrdef.h
│ │ ├── fterrors.h
│ │ ├── ftfntfmt.h
│ │ ├── ftgasp.h
│ │ ├── ftglyph.h
│ │ ├── ftgxval.h
│ │ ├── ftgzip.h
│ │ ├── ftimage.h
│ │ ├── ftincrem.h
│ │ ├── ftlcdfil.h
│ │ ├── ftlist.h
│ │ ├── ftlzw.h
│ │ ├── ftmac.h
│ │ ├── ftmm.h
│ │ ├── ftmodapi.h
│ │ ├── ftmoderr.h
│ │ ├── ftotval.h
│ │ ├── ftoutln.h
│ │ ├── ftpcfdrv.h
│ │ ├── ftpfr.h
│ │ ├── ftrender.h
│ │ ├── ftsizes.h
│ │ ├── ftsnames.h
│ │ ├── ftstroke.h
│ │ ├── ftsynth.h
│ │ ├── ftsystem.h
│ │ ├── fttrigon.h
│ │ ├── ftttdrv.h
│ │ ├── fttypes.h
│ │ ├── ftwinfnt.h
│ │ ├── t1tables.h
│ │ ├── ttnameid.h
│ │ ├── tttables.h
│ │ ├── tttags.h
│ │ └── ttunpat.h
│ ├── ft2build.h
│ ├── iconv.h
│ ├── kvec.h
│ ├── png.h
│ ├── pngconf.h
│ ├── pnglibconf.h
│ ├── zconf.h
│ └── zlib.h
└── lib
│ ├── libfreetype.a
│ ├── libiconv.a
│ ├── libpng.a
│ └── libz.a
├── edao-patch
├── PCSG00246.txt
└── src
│ ├── .clang_complete
│ ├── Makefile
│ ├── hook.c
│ ├── hook.h
│ ├── hook_stub.s
│ ├── khash.h
│ ├── log.c
│ ├── log.h
│ ├── main.c
│ ├── memcpy_asm.S
│ ├── tools.c
│ ├── tools.h
│ ├── translator.c
│ └── translator.h
├── font2png
└── src
│ ├── Makefile
│ └── font2png.c
├── makefont
└── src
│ ├── Makefile
│ ├── codeconvert.c
│ ├── codeconvert.h
│ ├── easyfont.c
│ ├── easyfont.h
│ ├── makefont.c
│ └── makefont.h
└── scripts
├── CheckCNJPMatch.py
├── Common.py
├── CompareLength.py
├── ExtractNotTranslate.py
├── GenSJISCodeTable.py
├── GenUTF8CodeTable.py
├── ImportCodeTable.TBL
├── MakeCodeTable.py
├── MakeJPCNMap.py
├── MoveExtra.py
├── MoveOutput.bat
├── PackJPCNMap.py
├── ProcessEbootText.py
├── ReportDiff.py
├── ReportNotMatch.py
├── ShiftJisCodeTable.png
├── nidformat.py
└── vitadump.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Object files
5 | *.o
6 | *.ko
7 | *.obj
8 | *.elf
9 |
10 | # Linker output
11 | *.ilk
12 | *.map
13 | *.exp
14 |
15 | # Precompiled Headers
16 | *.gch
17 | *.pch
18 |
19 | # Libraries
20 | *.lib
21 | *.la
22 | *.lo
23 |
24 | # Shared objects (inc. Windows DLLs)
25 | *.dll
26 | *.so
27 | *.so.*
28 | *.dylib
29 |
30 | # Executables
31 | *.exe
32 | *.out
33 | *.app
34 | *.i*86
35 | *.x86_64
36 | *.hex
37 |
38 | # Debug files
39 | *.dSYM/
40 | *.su
41 | *.idb
42 | *.pdb
43 |
44 | # Kernel Module Compile Results
45 | *.mod*
46 | *.cmd
47 | .tmp_versions/
48 | modules.order
49 | Module.symvers
50 | Mkfile.old
51 | dkms.conf
52 |
53 |
54 | #CMake
55 | cmake-build-*
56 |
57 |
58 | #PS Vita
59 | *.velf
60 | *.suprx
61 | *.skprx
62 | *.bin
63 | *.swp
64 | *.fnt
65 | *.dat
66 | *.new
67 |
--------------------------------------------------------------------------------
/.idea/Falcom.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.8)
2 | project(Falcom C)
3 |
4 |
5 | include_directories(common/include)
6 | include_directories(/opt/local/include)
7 | #include_directories(/Users/asuka/local/vitasdk/arm-vita-eabi/include)
8 | #link_directories(common/lib)
9 | link_directories(/opt/local/lib)
10 |
11 | set(CMAKE_C_FLAGS "-Wl, -Wall -std=gnu11 -g")
12 |
13 |
14 |
15 | set(FONT2PNG_SOURCE_FILES
16 | font2png/src/font2png.c)
17 |
18 | add_executable(font2png ${FONT2PNG_SOURCE_FILES})
19 | target_link_libraries(font2png png z m)
20 |
21 |
22 | set (MAKEFONT_SOURCE_FILES
23 | makefont/src/easyfont.c
24 | makefont/src/easyfont.h
25 | makefont/src/makefont.c
26 | makefont/src/makefont.h makefont/src/codeconvert.h makefont/src/codeconvert.c)
27 |
28 | add_executable(makefont ${MAKEFONT_SOURCE_FILES})
29 | target_link_libraries(makefont freetype png z iconv)
30 |
31 |
32 |
33 | set(EDAOPATCH_SOURCE_FILES
34 | edao-patch/src/hook.c
35 | edao-patch/src/log.c
36 | edao-patch/src/main.c
37 | edao-patch/src/tools.c
38 | edao-patch/src/translator.c edao-patch/src/memcpy_asm.S)
39 |
40 |
41 | add_executable(edao-patch ${EDAOPATCH_SOURCE_FILES})
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Falcom
2 |
3 | PSV 碧之轨迹EVO 汉化程序源码
4 |
5 | 发布地址:https://tieba.baidu.com/p/6302452900
6 |
7 | 汉化使用PC版文本,查字典方式
8 |
9 | 即先做一个 PC日文-PC中文的字典,当PSV游戏显示日文时,Hook相关函数,获取日文原文做为Key,去字典里查Value,查到了就显示出来
10 |
11 | 目前的汉化测试补丁还很不完整,EVO和老版之间有差异的文本没有汉化,新增剧情没有汉化,图片也没有汉化
12 |
13 | 我自己大概是没什么时间继续下去了
14 |
15 | 如果你想继续汉化碧轨EVO或者零轨EVO,可以提个Issue联系我,我会看到的
16 |
--------------------------------------------------------------------------------
/common/include/asuka.h:
--------------------------------------------------------------------------------
1 | #ifndef ASUKA_H
2 | #define ASUKA_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | //macros
10 |
11 | #define IN
12 | #define OUT
13 | #define OPT
14 |
15 | #define GET_VALUE(buff, index, type) (*(type*)((unsigned char*)buff + index))
16 |
17 | #define ALIGN(x, align) (((x) + ((align) - 1)) & ~((align) - 1))
18 |
19 |
20 | //tool functions
21 | static inline
22 | void* load_file(const char* filename, uint32_t* size)
23 | {
24 | if (!filename)
25 | {
26 | return NULL;
27 | }
28 |
29 | FILE* fp_src = fopen(filename, "rb");
30 | if (fp_src == NULL)
31 | {
32 | return NULL;
33 | }
34 |
35 | uint32_t filesize = 0;
36 |
37 | fseek(fp_src, 0, SEEK_END);
38 | filesize = ftell(fp_src);
39 | fseek(fp_src, 0, SEEK_SET);
40 |
41 | void* buffer = malloc(filesize);
42 | if (!buffer)
43 | {
44 | fclose(fp_src);
45 | return NULL;
46 | }
47 |
48 | fread(buffer, filesize, 1, fp_src);
49 | fclose(fp_src);
50 |
51 | if (size)
52 | {
53 | *size = filesize;
54 | }
55 | return buffer;
56 | }
57 |
58 | static inline
59 | void free_file(void* file_buff)
60 | {
61 | if(!file_buff)
62 | {
63 | return;
64 | }
65 | free(file_buff);
66 | }
67 |
68 |
69 | static inline
70 | int write_new_file(const char* filename, uint8_t* buffer, uint32_t len)
71 | {
72 | if (!filename || !buffer)
73 | {
74 | return -1;
75 | }
76 |
77 | FILE* fdst = fopen(filename, "wb");
78 | if (!fdst)
79 | {
80 | return -1;
81 | }
82 | fwrite(buffer, len, 1, fdst);
83 | fclose(fdst);
84 | }
85 |
86 |
87 |
88 | #endif //ASUKA_H
--------------------------------------------------------------------------------
/common/include/freetype/config/ftmodule.h:
--------------------------------------------------------------------------------
1 | /* This is a generated file. */
2 | FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
3 | FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
4 | FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
5 | FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
6 | FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
7 | FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
8 | FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
9 | FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
10 | FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
11 | FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
12 | FT_USE_MODULE( FT_Module_Class, autofit_module_class )
13 | FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
14 | FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
15 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
16 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
17 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
18 | FT_USE_MODULE( FT_Module_Class, psaux_module_class )
19 | FT_USE_MODULE( FT_Module_Class, psnames_module_class )
20 | /* EOF */
21 |
--------------------------------------------------------------------------------
/common/include/freetype/config/ftstdlib.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ftstdlib.h */
4 | /* */
5 | /* ANSI-specific library and header configuration file (specification */
6 | /* only). */
7 | /* */
8 | /* Copyright 2002-2017 by */
9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 | /* */
11 | /* This file is part of the FreeType project, and may only be used, */
12 | /* modified, and distributed under the terms of the FreeType project */
13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 | /* this file you indicate that you have read the license and */
15 | /* understand and accept it fully. */
16 | /* */
17 | /***************************************************************************/
18 |
19 |
20 | /*************************************************************************/
21 | /* */
22 | /* This file is used to group all #includes to the ANSI C library that */
23 | /* FreeType normally requires. It also defines macros to rename the */
24 | /* standard functions within the FreeType source code. */
25 | /* */
26 | /* Load a file which defines FTSTDLIB_H_ before this one to override it. */
27 | /* */
28 | /*************************************************************************/
29 |
30 |
31 | #ifndef FTSTDLIB_H_
32 | #define FTSTDLIB_H_
33 |
34 |
35 | #include
36 |
37 | #define ft_ptrdiff_t ptrdiff_t
38 |
39 |
40 | /**********************************************************************/
41 | /* */
42 | /* integer limits */
43 | /* */
44 | /* UINT_MAX and ULONG_MAX are used to automatically compute the size */
45 | /* of `int' and `long' in bytes at compile-time. So far, this works */
46 | /* for all platforms the library has been tested on. */
47 | /* */
48 | /* Note that on the extremely rare platforms that do not provide */
49 | /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
50 | /* old Crays where `int' is 36 bits), we do not make any guarantee */
51 | /* about the correct behaviour of FT2 with all fonts. */
52 | /* */
53 | /* In these case, `ftconfig.h' will refuse to compile anyway with a */
54 | /* message like `couldn't find 32-bit type' or something similar. */
55 | /* */
56 | /**********************************************************************/
57 |
58 |
59 | #include
60 |
61 | #define FT_CHAR_BIT CHAR_BIT
62 | #define FT_USHORT_MAX USHRT_MAX
63 | #define FT_INT_MAX INT_MAX
64 | #define FT_INT_MIN INT_MIN
65 | #define FT_UINT_MAX UINT_MAX
66 | #define FT_LONG_MIN LONG_MIN
67 | #define FT_LONG_MAX LONG_MAX
68 | #define FT_ULONG_MAX ULONG_MAX
69 |
70 |
71 | /**********************************************************************/
72 | /* */
73 | /* character and string processing */
74 | /* */
75 | /**********************************************************************/
76 |
77 |
78 | #include
79 |
80 | #define ft_memchr memchr
81 | #define ft_memcmp memcmp
82 | #define ft_memcpy memcpy
83 | #define ft_memmove memmove
84 | #define ft_memset memset
85 | #define ft_strcat strcat
86 | #define ft_strcmp strcmp
87 | #define ft_strcpy strcpy
88 | #define ft_strlen strlen
89 | #define ft_strncmp strncmp
90 | #define ft_strncpy strncpy
91 | #define ft_strrchr strrchr
92 | #define ft_strstr strstr
93 |
94 |
95 | /**********************************************************************/
96 | /* */
97 | /* file handling */
98 | /* */
99 | /**********************************************************************/
100 |
101 |
102 | #include
103 |
104 | #define FT_FILE FILE
105 | #define ft_fclose fclose
106 | #define ft_fopen fopen
107 | #define ft_fread fread
108 | #define ft_fseek fseek
109 | #define ft_ftell ftell
110 | #define ft_sprintf sprintf
111 |
112 |
113 | /**********************************************************************/
114 | /* */
115 | /* sorting */
116 | /* */
117 | /**********************************************************************/
118 |
119 |
120 | #include
121 |
122 | #define ft_qsort qsort
123 |
124 |
125 | /**********************************************************************/
126 | /* */
127 | /* memory allocation */
128 | /* */
129 | /**********************************************************************/
130 |
131 |
132 | #define ft_scalloc calloc
133 | #define ft_sfree free
134 | #define ft_smalloc malloc
135 | #define ft_srealloc realloc
136 |
137 |
138 | /**********************************************************************/
139 | /* */
140 | /* miscellaneous */
141 | /* */
142 | /**********************************************************************/
143 |
144 |
145 | #define ft_strtol strtol
146 | #define ft_getenv getenv
147 |
148 |
149 | /**********************************************************************/
150 | /* */
151 | /* execution control */
152 | /* */
153 | /**********************************************************************/
154 |
155 |
156 | #include
157 |
158 | #define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
159 | /* jmp_buf is defined as a macro */
160 | /* on certain platforms */
161 |
162 | #define ft_longjmp longjmp
163 | #define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
164 |
165 |
166 | /* the following is only used for debugging purposes, i.e., if */
167 | /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
168 |
169 | #include
170 |
171 |
172 | #endif /* FTSTDLIB_H_ */
173 |
174 |
175 | /* END */
176 |
--------------------------------------------------------------------------------
/common/include/freetype/ftbbox.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ftbbox.h */
4 | /* */
5 | /* FreeType exact bbox computation (specification). */
6 | /* */
7 | /* Copyright 1996-2017 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | /*************************************************************************/
20 | /* */
21 | /* This component has a _single_ role: to compute exact outline bounding */
22 | /* boxes. */
23 | /* */
24 | /* It is separated from the rest of the engine for various technical */
25 | /* reasons. It may well be integrated in `ftoutln' later. */
26 | /* */
27 | /*************************************************************************/
28 |
29 |
30 | #ifndef FTBBOX_H_
31 | #define FTBBOX_H_
32 |
33 |
34 | #include
35 | #include FT_FREETYPE_H
36 |
37 | #ifdef FREETYPE_H
38 | #error "freetype.h of FreeType 1 has been loaded!"
39 | #error "Please fix the directory search order for header files"
40 | #error "so that freetype.h of FreeType 2 is found first."
41 | #endif
42 |
43 |
44 | FT_BEGIN_HEADER
45 |
46 |
47 | /*************************************************************************/
48 | /* */
49 | /* */
50 | /* outline_processing */
51 | /* */
52 | /*************************************************************************/
53 |
54 |
55 | /*************************************************************************/
56 | /* */
57 | /* */
58 | /* FT_Outline_Get_BBox */
59 | /* */
60 | /* */
61 | /* Compute the exact bounding box of an outline. This is slower */
62 | /* than computing the control box. However, it uses an advanced */
63 | /* algorithm that returns _very_ quickly when the two boxes */
64 | /* coincide. Otherwise, the outline Bézier arcs are traversed to */
65 | /* extract their extrema. */
66 | /* */
67 | /* */
68 | /* outline :: A pointer to the source outline. */
69 | /* */
70 | /*