From ebe6e6344981539e42694cdd5899b303389c0fb6 Mon Sep 17 00:00:00 2001 From: Tauwasser Date: Fri, 1 Jun 2018 01:59:53 +0200 Subject: 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 --- tools/disasm_coverage.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tools/disasm_coverage.py') 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) -- cgit v1.2.3