diff options
author | Tauwasser <Tauwasser@tauwasser.eu> | 2018-06-02 16:51:55 +0200 |
---|---|---|
committer | Tauwasser <Tauwasser@tauwasser.eu> | 2018-06-02 16:51:55 +0200 |
commit | b59e980b32c557616c423b99e3d419fb87acc88d (patch) | |
tree | 155622c19582a54e29a550ab55b5b24c471d56f7 /tools/dump_names.py | |
parent | 3f2e5b7ade24cff77bff9aebe216d6aa466cdc9b (diff) |
tools: rework dump_text and read_charmap to dump control codes
read_charmap was redone using a regular expression as comments and computations
would lead to unexpected results.
dump_names used read_charmap.get_project_dir, so copy it over to not break
stuff.
dump_text now uses a different but similar syntax and has its old dumb mode as
well as control code mode and will by default now respect text end condes
unless --endless option is specified
Signed-off-by: Tauwasser <Tauwasser@tauwasser.eu>
Diffstat (limited to 'tools/dump_names.py')
-rw-r--r-- | tools/dump_names.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/dump_names.py b/tools/dump_names.py index a80677e..81f357a 100644 --- a/tools/dump_names.py +++ b/tools/dump_names.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys, os, io -from read_charmap import get_project_dir, read_charmap +from read_charmap import read_charmap def calc_bank(p): return p // 0x4000 @@ -15,6 +15,12 @@ def get_sym_loc(p): b, a = calc_bank(p), calc_address(p) return '%02x:%04x' % (b, a) +def get_project_dir(): + script_path = os.path.realpath(__file__) + script_dir = os.path.dirname(script_path) + project_dir = os.path.join(script_dir, '..') + return os.path.normpath(project_dir) + def get_baserom_path(): project_dir = get_project_dir() return os.path.join(project_dir, 'baserom.gb') |