From 20c718fbfdec7559f1456aa61a0282d009e491aa Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 3 May 2014 23:14:43 -0400 Subject: gfx.py: Forgot to add rom_offset. --- pokemontools/gfx.py | 5 +++++ 1 file changed, 5 insertions(+) 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): """ -- cgit v1.2.3