diff options
author | Tauwasser <Tauwasser@tauwasser.eu> | 2018-06-01 01:59:53 +0200 |
---|---|---|
committer | Tauwasser <Tauwasser@tauwasser.eu> | 2018-06-01 02:00:33 +0200 |
commit | ebe6e6344981539e42694cdd5899b303389c0fb6 (patch) | |
tree | 36bb26c9356461cd38d9998904aaedacb0e0273d /tools/disasm_coverage.py | |
parent | a7e358cd7e3bb99b3189afe753831656fcc0c354 (diff) |
tools/disasm_coverage: fix counting error and remove debug print statement
Code wrongly assumed if end - beg + 1 < bpp then y_beg == y_end && x_beg == x_end, but
that's obviously not always the case.
Signed-off-by: Tauwasser <Tauwasser@tauwasser.eu>
Diffstat (limited to 'tools/disasm_coverage.py')
-rw-r--r-- | tools/disasm_coverage.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/disasm_coverage.py b/tools/disasm_coverage.py index bb5c9fd..b1d2195 100644 --- a/tools/disasm_coverage.py +++ b/tools/disasm_coverage.py @@ -7,6 +7,7 @@ import argparse from mapreader import MapReader import png from colorsys import hls_to_rgb +import sys if __name__ == "__main__": # argument parser @@ -49,7 +50,7 @@ if __name__ == "__main__": #print('beg {0} end {1}: {2}/{3} -- {4}/{5}'.format(beg, end, y_beg, x_beg, y_end, x_end)) # special case y_beg/x_beg and y_end/x_end - if (end - beg + 1 < bpp): + if (y_beg == y_end and x_beg == x_end): hit_data[y_beg][x_beg] += end - beg + 1 else: @@ -65,7 +66,6 @@ if __name__ == "__main__": for x in range(x_line_beg, x_line_end + 1): hit_data[y][x] += bpp - with open(args.filename, 'wb') as pngfile: @@ -76,7 +76,6 @@ if __name__ == "__main__": row_png_data = () for col in row: - if (0 != col): rgb = [255 * x for x in hls_to_rgb(120/360, 1.0 - (col/bpp * (100 - 15))/100, 100/100)] row_png_data += tuple(rgb) |