diff options
author | yenatch <yenatch@gmail.com> | 2013-11-18 21:03:31 -0500 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2013-11-18 21:03:31 -0500 |
commit | dfc88b9ac0369632bfa93a3859bf26dc2828ae9e (patch) | |
tree | 6243ede1e0a5a0bc2a76abf8c5027e21f1a72471 /pokemontools/wram.py | |
parent | 9d01c85d3bac2a6a7b5826dc2139f69731a901ab (diff) | |
parent | 3027746bd69db504f8d0e311d9f81593337ff236 (diff) |
Merge branch 'master' of github.com:kanzure/pokemon-reverse-engineering-tools
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 |