Changed GROW/SHRINK to always be explicit, dropped LFSR_TAG_RM

Generally, less implicit behavior => simpler systems, which is the goal
here.
This commit is contained in:
Christopher Haster
2023-02-25 22:12:08 -06:00
parent 1709aec95b
commit 6f4704474b
3 changed files with 502 additions and 261 deletions

View File

@@ -198,7 +198,9 @@ def show_log(block_size, data, rev, off, *,
j_ += size
if grow is not None:
if (tag & ~0x3f0) == 0x0400 and id == grow[1]:
if ((tag & ~0x3f0) == 0x0400
and id >= grow[1]
and id < grow[1]+grow[2]):
i, p = index(weights, id)
weights[i:i+1] = [p+1, weights[i]-(p+1)]
colors[i:i+1] = [COLORS[colors_i % len(COLORS)], colors[i]]
@@ -214,7 +216,7 @@ def show_log(block_size, data, rev, off, *,
if tag == 0x0006:
i, _ = index(weights, id)
weights[i] += size
grow = j, id
grow = j, id, size
elif tag == 0x0016:
i, _ = index(weights, id)
if weights[i] == size and len(weights) > 1: