From ec5265e2e6db6f544fc14c993842552e19f21ef9 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Thu, 26 Apr 2012 14:13:06 -0500 Subject: add map/group constants into constants.asm map 18.3 and 7.14 are both "Route 10" ? Need to confirm that they are both, in fact, "Route 10". Even if they both point to the same map, we can call them 10a and 10b so that the map constants will work. generate_map_constants and generate_map_constant_labels have been updated to deal with left-over issues in various labels and obscure characters. original-commit-id: 8f2221aa703b3ed0d98003a055c65ea794144b64 --- crystal.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'crystal.py') diff --git a/crystal.py b/crystal.py index d658928..56d3d08 100644 --- a/crystal.py +++ b/crystal.py @@ -1014,7 +1014,9 @@ def generate_map_constant_labels(): cmap = map_names[map_group][map_id] name = cmap["name"] name = name.replace("Pokémon Center", "PokeCenter").\ - replace(" ", "_") + replace(" ", "_").\ + replace("-", "_").\ + replace("é", "e") constant_label = map_name_cleaner(name).upper() map_internal_ids[i] = {"label": constant_label, "map_id": map_id, @@ -1031,17 +1033,19 @@ def generate_map_constants(): generate_map_constant_labels() globals, groups, maps = "", "", "" for (id, each) in map_internal_ids.items(): - groups += "GROUP_"+each["label"] + " EQU $%.2x" % (each["map_group"]) + label = each["label"].replace("-", "_").replace("é", "e").upper() + + groups += "GROUP_"+ label + " EQU $%.2x" % (each["map_group"]) groups += "\n" - maps += "MAP_"+each["label"] + " EQU $%.2x" % (each["map_id"]) + maps += "MAP_"+ label + " EQU $%.2x" % (each["map_id"]) maps += "\n" - globals += each["label"] + " EQU $%.2x" % (id) + globals += label + " EQU $%.2x" % (id) globals += "\n" #for multi-byte constants: #print each["label"] + " EQUS \"$%.2x,$%.2x\"" % (each["map_group"], each["map_id"]) print globals print groups - #print maps + print maps from pokemon_constants import pokemon_constants -- cgit v1.2.3