summaryrefslogtreecommitdiff
path: root/pokemontools/dump_gfx.py
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2016-04-10 19:08:07 -0400
committeryenatch <yenatch@gmail.com>2016-04-10 19:08:07 -0400
commit050b05e5cec12d76b722c6a0fc84d80abd8dec5e (patch)
tree85225cbf66888a5292e7c1e6e1a3ddc8093b386d /pokemontools/dump_gfx.py
parentdfe657177453423987544798d9763b2938874b42 (diff)
Accidentally moved get_pic_animation out of gfx.py.
Diffstat (limited to 'pokemontools/dump_gfx.py')
-rw-r--r--pokemontools/dump_gfx.py39
1 files changed, 0 insertions, 39 deletions
diff --git a/pokemontools/dump_gfx.py b/pokemontools/dump_gfx.py
index 372b8c3..88f1510 100644
--- a/pokemontools/dump_gfx.py
+++ b/pokemontools/dump_gfx.py
@@ -288,45 +288,6 @@ def rip_bulk_gfx(rom, dest='gfx', crystal=True):
rip_compressed_misc (rom, dest=os.path.join(dest, 'misc'))
-def get_pic_animation(tmap, w, h):
- """
- Generate pic animation data from a combined tilemap of each frame.
- """
- frame_text = ''
- bitmask_text = ''
-
- frames = list(split(tmap, w * h))
- base = frames.pop(0)
- bitmasks = []
-
- for i in xrange(len(frames)):
- frame_text += '\tdw .frame{}\n'.format(i + 1)
-
- for i, frame in enumerate(frames):
- bitmask = map(operator.ne, frame, base)
- if bitmask not in bitmasks:
- bitmasks.append(bitmask)
- which_bitmask = bitmasks.index(bitmask)
-
- mask = iter(bitmask)
- masked_frame = filter(lambda _: mask.next(), frame)
-
- frame_text += '.frame{}\n'.format(i + 1)
- frame_text += '\tdb ${:02x} ; bitmask\n'.format(which_bitmask)
- if masked_frame:
- frame_text += '\tdb {}\n'.format(', '.join(
- map('${:02x}'.format, masked_frame)
- ))
-
- for i, bitmask in enumerate(bitmasks):
- bitmask_text += '; {}\n'.format(i)
- for byte in split(bitmask, 8):
- byte = int(''.join(map(int.__repr__, reversed(byte))), 2)
- bitmask_text += '\tdb %{:08b}\n'.format(byte)
-
- return frame_text, bitmask_text
-
-
def dump_pic_animations(addresses={'bitmasks': 'BitmasksPointers', 'frames': 'FramesPointers'}, pokemon=pokemon_constants, rom=None):
"""
The code to dump pic animations from rom is mysteriously absent.