diff options
author | mid-kid <esteve.varela@gmail.com> | 2020-09-10 18:10:44 +0200 |
---|---|---|
committer | mid-kid <esteve.varela@gmail.com> | 2020-09-10 18:10:44 +0200 |
commit | 6a48df93672e8771e893be040f87178d0607d3ef (patch) | |
tree | 05b52ddee80a4105c70e37349279915b2dc09ab3 /mgbdis/mgbdis.py | |
parent | de17da7d3c0d5b06f4607c15c2aa789b0c8adce0 (diff) |
mgbdis: Allow adjusting width of data tables
Diffstat (limited to 'mgbdis/mgbdis.py')
-rwxr-xr-x | mgbdis/mgbdis.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mgbdis/mgbdis.py b/mgbdis/mgbdis.py index d2fe63e..256a6d3 100755 --- a/mgbdis/mgbdis.py +++ b/mgbdis/mgbdis.py @@ -629,6 +629,9 @@ class Bank: print('Outputting data in range: {} - {}'.format(hex_word(start_address), hex_word(end_address))) values = list() + width = 16 + if arguments: + width = int(arguments, 16) for address in range(start_address, end_address): mem_address = rom_address_to_mem_address(address) @@ -644,8 +647,8 @@ class Bank: values.append(hex_byte(rom.data[address])) - # output max of 16 bytes per line, and ensure any remaining values are output - if len(values) == 16 or (address == end_address - 1 and len(values)): + # output max of width bytes per line, and ensure any remaining values are output + if len(values) == width or (address == end_address - 1 and len(values)): self.append_output(self.format_data(values)) values = list() |