mirror of
https://github.com/MiSTer-devel/Life_MiSTer.git
synced 2026-04-19 03:04:22 +00:00
Includes a script for converting RLE formatted patterns into mem and some highlife patterns to demo.
16 lines
434 B
Python
16 lines
434 B
Python
#!/usr/bin/python3
|
|
|
|
import sys
|
|
import matplotlib.pyplot as plt
|
|
import numpy as np
|
|
|
|
output = []
|
|
|
|
for char in open(sys.argv[1], 'rb').read():
|
|
value, repeat = 255 * (char >> 7), (char & 0x7f)
|
|
output.extend([value] * (repeat+1))
|
|
|
|
print("Expected / actual: ", 1125*2200, len(output))
|
|
output = bytearray(output + (1125*2200 - len(output))*[0])
|
|
plt.imshow(np.array(output).reshape(1125, 2200))
|
|
plt.savefig("matplotlib.png", dpi=1200) |