MCPcopy Create free account
hub / github.com/Inori/GPCS4 / WriteExpTabDefination

Function WriteExpTabDefination

Tools/GenerateCode.py:187–227  ·  view source on GitHub ↗
(dst, mod_name, lib_dic)

Source from the content-addressed store, hash-verified

185 return func_tab_name
186
187def WriteExpTabDefination(dst, mod_name, lib_dic):
188 fmt_mod_name = GetModFolderName(mod_name)
189 for lib_name in lib_dic:
190 func_tab_name = GetFuncTableName(fmt_mod_name, lib_name)
191 lib_def_line = 'static const SCE_EXPORT_FUNCTION {}[] =\n'.format(func_tab_name)
192
193 dst.write(lib_def_line)
194 dst.write('{\n')
195
196 func_list = lib_dic[lib_name]
197 for nid, func in func_list:
198 func_ent_line = '\t{{ 0x{0:016X}, "{1:}", (void*){1:} }},\n'.format(nid, func)
199 dst.write(func_ent_line)
200
201 dst.write('\tSCE_FUNCTION_ENTRY_END\n')
202 dst.write('};\n')
203 dst.write('\n')
204
205
206 lib_ent_name = 'g_p{}_LibTable'.format(fmt_mod_name)
207 lib_ent_def = 'static const SCE_EXPORT_LIBRARY {}[] =\n'.format(lib_ent_name)
208 dst.write(lib_ent_def)
209 dst.write('{\n')
210
211 for lib_name in lib_dic:
212 func_tab_name = GetFuncTableName(fmt_mod_name, lib_name)
213 lib_ent_line = '\t{{ "{}", {} }},\n'.format(lib_name, func_tab_name)
214 dst.write(lib_ent_line)
215
216 dst.write('\tSCE_LIBRARY_ENTRY_END\n')
217 dst.write('};\n')
218 dst.write('\n')
219
220 mod_def_name = GetExpModuleName(mod_name)
221 mod_def_line = 'const SCE_EXPORT_MODULE {} =\n'.format(mod_def_name)
222 dst.write(mod_def_line)
223 dst.write('{\n')
224 dst.write('\t"{}",\n'.format(mod_name))
225 dst.write('\t{}\n'.format(lib_ent_name))
226 dst.write('};\n')
227 dst.write('\n\n')
228
229
230def WriteInclude(dst, h_name):

Callers 1

WriteSourceFilesFunction · 0.85

Calls 5

GetModFolderNameFunction · 0.85
GetFuncTableNameFunction · 0.85
GetExpModuleNameFunction · 0.85
formatMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected