diff options
author | yenatch <yenatch@gmail.com> | 2013-12-11 20:28:25 -0500 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2013-12-11 20:28:25 -0500 |
commit | b0fa67a51191a9ddc2a4ce548ade0243b6be554c (patch) | |
tree | 8f0accda362065d579104f803672050cb80dc7ac | |
parent | f35bb2c5cc390ec0008cede2721104592dbcb29d (diff) |
wram: fix section address allocation
who wrote this?
-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 7bc017d..87af4a2 100644 --- a/pokemontools/wram.py +++ b/pokemontools/wram.py @@ -48,16 +48,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 = { |