diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-12-11 17:42:00 -0800 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-12-11 17:42:00 -0800 |
commit | d8f4e687ebc49d4b135f0d8b7f10a643114a0d8a (patch) | |
tree | bfb0feb39738766841af70993bb41c54c1152339 | |
parent | 58de3846c732a5e3e856ea8935a6e6ab830af82a (diff) | |
parent | b0fa67a51191a9ddc2a4ce548ade0243b6be554c (diff) |
Merge pull request #60 from yenatch/dependencies
wram: fix section address allocation
-rw-r--r-- | pokemontools/wram.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pokemontools/wram.py b/pokemontools/wram.py index 8affd26..dbff309 100644 --- a/pokemontools/wram.py +++ b/pokemontools/wram.py @@ -52,16 +52,16 @@ def read_bss_sections(bss): if '[' in type_: address = int(bracket_value(type_).replace('$','0x'), 16) else: - if address == None or bank != section['bank']: - for type__, addr in [ - ('VRAM', 0x8000), - ('SRAM', 0xa000), - ('WRAM0', 0xc000), - ('WRAMX', 0xd000), - ('HRAM', 0xff80), - ]: - if type__ == type_ and section['type'] == type__: - address = addr + types = { + 'VRAM': 0x8000, + 'SRAM': 0xa000, + 'WRAM0': 0xc000, + 'WRAMX': 0xd000, + 'HRAM': 0xff80, + } + if address == None or bank != section['bank'] or section['type'] != type_: + if type_ in types.keys(): + address = types[type_] # else: keep going from this address section = { |