import agb import pstring pstring_factory = pstring.PString("../table.tbl") vrom = agb.Agbrom() erom = agb.Agbrom(agb.FREPATH) dout = [] eout = [] dbase = vrom.pointer(0x1c0) ebase = erom.pointer(0x1c0) for i in range(0, 0x71): doff = dbase + 13 * i eoff = ebase + 13 * i print(i, hex(vrom.pointer(doff)), hex(erom.pointer(eoff))) dout.append(pstring_factory.hex2str(vrom, doff).capitalize()) eout.append( pstring_factory.hex2str(erom, eoff).capitalize( ) if i < 0x4E else pstring_factory.hex2str(vrom, doff).capitalize()) open("D:/temp/ability_names_ger.txt", "w+").write("\n".join(["=" + m for m in dout])) open("D:/temp/ability_names_en.txt", "w+").write("\n".join(["=" + m for m in eout]))
import pstring import agb rom = agb.Agbrom() ps = pstring.PString("../table.tbl") out = ".align 4\n.global map_namespaces\nmap_namespaces:\n" + "\n".join( ["\tstr_mapnamespace_" + str(i + 0x58) for i in range(109)]) + "\n\n" consts = {} sout = "" namespaces = 0x3F1504 for i in range(109): name = ps.hex2str(rom, rom.pointer(namespaces + i * 4)) sout += ".string str_mapnamespace_" + str( i + 0x58) + " GER\n\t=" + name + "\n.end\n\n" consts[i + 0x58] = pstring.cap(name) fd = open("D:/temp/namespaces.txt", "w+") fd.write(sout) fd.close() fd = open("D:/temp/namespaces.s", "w+") fd.write(out) fd.close() fd = open("D:/temp/namespaces_const.py", "w+") fd.write(str(consts)) fd.close()