diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-11-13 00:24:15 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-11-13 00:24:15 -0600 |
commit | 51b1f6e642436f1f45c36c86243e58769fe38cd4 (patch) | |
tree | b8076db4c1c3497966dd81baa644b0f184011dd7 | |
parent | 2b23c09e57fbf1d3079326298bcc8ec4e867e69f (diff) |
flip the wram labels dictionary
-rw-r--r-- | pokemontools/wram.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pokemontools/wram.py b/pokemontools/wram.py index 6d2c2cc..80244e3 100644 --- a/pokemontools/wram.py +++ b/pokemontools/wram.py @@ -112,6 +112,8 @@ class WRAMProcessor(object): self.setup_hram_constants() self.setup_gbhw_constants() + self.reformat_wram_labels() + def read_wram_sections(self): """ Opens the wram file and calls read_bss_sections. @@ -166,3 +168,14 @@ class WRAMProcessor(object): """ self.gbhw_constants = self.read_gbhw_constants() return self.gbhw_constants + + def reformat_wram_labels(self): + """ + Flips the wram_constants dictionary the other way around to access + addresses by label. + """ + self.wram = {} + + for (address, labels) in self.wram_constants.iteritems(): + for label in labels: + self.wram[label] = address |