From f0538721a3cc55a909462f42af077a749aca5e38 Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 25 Dec 2013 06:11:03 -0500 Subject: battle_animations: dont combine print and text conversion --- pokemontools/battle_animations.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pokemontools/battle_animations.py b/pokemontools/battle_animations.py index 96f0090..f32ed1b 100644 --- a/pokemontools/battle_animations.py +++ b/pokemontools/battle_animations.py @@ -277,18 +277,19 @@ def dump_battle_anims(table_address=0xc906f, num_anims=278): asms = sort_asms(asms) return asms -def print_asm_list(asms): - # incbin any unknown areas - # not really needed since there are no gaps +def asm_list_to_text(asms): + output = '' last = asms[0][0] for addr, asm, last_addr in asms: if addr > last: - print '\nINCBIN "baserom.gbc", $%x, $%x - $%x\n\n' % (last, addr, last) + # incbin any unknown areas + output += '\nINCBIN "baserom.gbc", $%x, $%x - $%x\n\n\n' % (last, addr, last) if addr >= last: - print asm + output += asm + '\n' last = last_addr + return output if __name__ == '__main__': asms = dump_battle_anims() - print_asm_list(asms) + print asm_list_to_text(asms) -- cgit v1.2.3