summaryrefslogtreecommitdiff
path: root/crystal.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-04-26 14:13:06 -0500
committerBryan Bishop <kanzure@gmail.com>2012-04-26 14:13:06 -0500
commitec5265e2e6db6f544fc14c993842552e19f21ef9 (patch)
treee21d360b07847e05e72cb80368ce9b0e878d84ed /crystal.py
parent74292fa9226bc216391c4244a724939f7c9659ad (diff)
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
Diffstat (limited to 'crystal.py')
-rw-r--r--crystal.py14
1 files changed, 9 insertions, 5 deletions
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