diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-11-13 19:02:23 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-11-13 19:02:23 -0600 |
commit | 8be80027e87c80678b1d0a453c866d79a9af47b2 (patch) | |
tree | 13a5469cedb76fd2c52dddd7efbbbcf5118c6be3 /pokemontools/wram.py | |
parent | b44e7b6dee19c9029e68747315e4fc84e741a86b (diff) | |
parent | 4a002c193b2225f9e370bf640b0c547252e42cd1 (diff) |
Merge branch 'master' into battle-handling
Diffstat (limited to 'pokemontools/wram.py')
-rw-r--r-- | pokemontools/wram.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pokemontools/wram.py b/pokemontools/wram.py index 60001aa..e1b9212 100644 --- a/pokemontools/wram.py +++ b/pokemontools/wram.py @@ -5,6 +5,10 @@ RGBDS BSS section and constant parsing. import os +# TODO: parse these constants from constants.asm +NUM_OBJECTS = 0x10 +OBJECT_LENGTH = 0x10 + def make_wram_labels(wram_sections): wram_labels = {} for section in wram_sections: @@ -108,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. @@ -162,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_labels dictionary the other way around to access + addresses by label. + """ + self.wram = {} + + for (address, labels) in self.wram_labels.iteritems(): + for label in labels: + self.wram[label] = address |