From a38a86806b6a72402d07482f7c259c8a4e522762 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Fri, 22 Nov 2013 21:41:11 -0600 Subject: use default config in WRAMProcessor if available Don't override the given configuration. --- pokemontools/wram.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pokemontools/wram.py b/pokemontools/wram.py index e1b9212..1f61ff5 100644 --- a/pokemontools/wram.py +++ b/pokemontools/wram.py @@ -99,9 +99,21 @@ class WRAMProcessor(object): self.config = config self.paths = {} - self.paths["wram"] = os.path.join(self.config.path, "wram.asm") - self.paths["hram"] = os.path.join(self.config.path, "hram.asm") - self.paths["gbhw"] = os.path.join(self.config.path, "gbhw.asm") + + if hasattr(self.config, "wram"): + self.paths["wram"] = self.config.wram + else: + self.paths["wram"] = os.path.join(self.config.path, "wram.asm") + + if hasattr(self.config, "hram"): + self.paths["hram"] = self.config.hram + else: + self.paths["hram"] = os.path.join(self.config.path, "hram.asm") + + if hasattr(self.config, "gbhw"): + self.paths["gbhw"] = self.config.gbhw + else: + self.paths["gbhw"] = os.path.join(self.config.path, "gbhw.asm") def initialize(self): """ -- cgit v1.2.3