From c7c5be19fe0ed1e99242f64f39f98041ba383421 Mon Sep 17 00:00:00 2001 From: yenatch Date: Sun, 16 Aug 2015 20:22:22 -0700 Subject: Add the current address to the output of Decompressed.command_list. --- pokemontools/lz.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pokemontools/lz.py b/pokemontools/lz.py index 334ea1c..f9d1dfe 100644 --- a/pokemontools/lz.py +++ b/pokemontools/lz.py @@ -420,13 +420,14 @@ class Decompressed: text = '' + output_address = 0 for name, attrs in self.used_commands: length = attrs['length'] address = attrs['address'] offset = attrs['offset'] direction = attrs['direction'] - text += '{0}: {1}'.format(name, length) + text += '{2:03x} {0}: {1}'.format(name, length, output_address) text += '\t' + ' '.join( '{:02x}'.format(int(byte)) for byte in self.lz[ address : address + attrs['cmd_length'] ] @@ -434,9 +435,12 @@ class Decompressed: if offset is not None: repeated_data = self.output[ offset : offset + length * direction : direction ] + if name == 'flip': + repeated_data = map(bit_flipped.__getitem__, repeated_data) text += ' [' + ' '.join(map('{:02x}'.format, repeated_data)) + ']' text += '\n' + output_address += length return text -- cgit v1.2.3