diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-08-03 16:51:46 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-08-03 16:51:46 -0500 |
commit | 0403a4a90d473cc0a4bf5c53677c0a84406bc4ad (patch) | |
tree | 1e64b49b6bb9067919413dd0fddf6cd1bcacf760 /pokemontools/parse_consecutive_strings.py | |
parent | a14c36eadb75ea3d6fbc4cb3f382d7c9785d9fe9 (diff) | |
parent | a76acbadd2571c0d73b0797b2b68e205ab882b64 (diff) |
Merge branch 'organizing' into master
Everything works in pokecrystal, so it's time to merge.
Diffstat (limited to 'pokemontools/parse_consecutive_strings.py')
-rw-r--r-- | pokemontools/parse_consecutive_strings.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pokemontools/parse_consecutive_strings.py b/pokemontools/parse_consecutive_strings.py new file mode 100644 index 0000000..4c864ba --- /dev/null +++ b/pokemontools/parse_consecutive_strings.py @@ -0,0 +1,25 @@ +import sys + +import crystal + +rom = crystal.load_rom() + +addr = int(sys.argv[1], 16) +count = int(sys.argv[2]) if len(sys.argv) > 2 else 256 +label_prefix = sys.argv[3] if len(sys.argv) > 3 else "UnknownString" + +ex = None + +for i in range(count): + try: + string = crystal.PokedexText(addr) + asm = string.to_asm() + except Exception as ex: + break + print label_prefix+str(i)+": ; "+hex(addr) + print "\t"+asm + print + addr = string.last_address + +print "; "+hex(addr) +if ex: raise ex |