From 2b23c09e57fbf1d3079326298bcc8ec4e867e69f Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Wed, 13 Nov 2013 00:09:05 -0600 Subject: include some constants for wram.asm UNfortunately these aren't being parsed from files at the moment. --- pokemontools/wram.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pokemontools/wram.py') diff --git a/pokemontools/wram.py b/pokemontools/wram.py index 60001aa..6d2c2cc 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: -- cgit v1.2.3 From 51b1f6e642436f1f45c36c86243e58769fe38cd4 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Wed, 13 Nov 2013 00:24:15 -0600 Subject: flip the wram labels dictionary --- pokemontools/wram.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pokemontools/wram.py') 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 -- cgit v1.2.3 From e4067faa60b58793076da8ff4b4170c4a911822f Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Wed, 13 Nov 2013 00:28:59 -0600 Subject: use the correct wram_labels variable in wram.py --- pokemontools/wram.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pokemontools/wram.py') diff --git a/pokemontools/wram.py b/pokemontools/wram.py index 80244e3..e1b9212 100644 --- a/pokemontools/wram.py +++ b/pokemontools/wram.py @@ -171,11 +171,11 @@ class WRAMProcessor(object): def reformat_wram_labels(self): """ - Flips the wram_constants dictionary the other way around to access + Flips the wram_labels dictionary the other way around to access addresses by label. """ self.wram = {} - for (address, labels) in self.wram_constants.iteritems(): + for (address, labels) in self.wram_labels.iteritems(): for label in labels: self.wram[label] = address -- cgit v1.2.3