diff options
author | yenatch <yenatch@gmail.com> | 2014-05-03 23:14:43 -0400 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2014-05-03 23:14:43 -0400 |
commit | 20c718fbfdec7559f1456aa61a0282d009e491aa (patch) | |
tree | 31a194acd445406cc89c6eb012f930886105debe | |
parent | df7acdb50f27e946ead504567090704a5336f176 (diff) |
gfx.py: Forgot to add rom_offset.
-rw-r--r-- | pokemontools/gfx.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pokemontools/gfx.py b/pokemontools/gfx.py index 3bfeb47..ebf69c6 100644 --- a/pokemontools/gfx.py +++ b/pokemontools/gfx.py @@ -18,6 +18,11 @@ def load_rom(): rom = romstr.RomStr.load(filename=config.rom_path) return bytearray(rom) +def rom_offset(bank, address): + if address < 0x4000 or address >= 0x8000: + return address + return bank * 0x4000 + address - 0x4000 * bool(bank) + def split(list_, interval): """ |