-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakeflash.py
25 lines (21 loc) · 2.14 KB
/
makeflash.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Fabrication flash
# Olivier Lecluse
# Ronan Jahier
# digirule 2A simulator
# Licence GNU General Public License v3.0
killTheBit = [2,32,3,1,255,22,255,6,253,17,255,5,255,28,5]
luminos = [2,129,25,2,252,3,0,255,3,255,254,3,24,255,3,124,254,3,60,255,3,60,254,3,124,255,3,24,254,3,255,255,3,0,254,3,124,255,3,24,254,3,60,255,3,60,254,3,24,255,3,124,254,28,5]
# Adder par Jaap Scherphuis, source joint
adder = [2, 16, 3, 4, 252, 3, 0, 254, 3, 0, 255, 3, 128, 240, 20, 240, 28, 27, 3, 128, 240, 6, 255, 16, 128, 5, 255, 6, 253, 5, 241, 6, 242, 16, 255, 13, 241, 5, 243, 17, 255, 12, 127, 5, 255, 27, 7, 243, 28, 54, 9, 254, 5, 254, 6, 241, 5, 242, 28, 14]
# Complement a2 par olivier Lecluse, source joint
ca2 = [2, 0, 25, 2, 252, 8, 0, 11, 255, 5, 254, 7, 255, 240, 6, 253, 17, 255, 5, 255, 11, 240, 27, 0, 253, 29, 32, 28, 5, 1, 1, 1, 3, 128, 241, 20, 241, 28, 35, 31]
# mastermind par Emmanuel Lazard, source joint
mastermind = [3, 4, 252, 3, 0, 213, 34, 12, 7, 5, 236, 34, 12, 7, 5, 237, 34, 12, 7, 5, 238, 34, 12, 7, 5, 239, 3, 0, 255, 7, 236, 244, 7, 237, 245, 7, 238, 246, 7, 239, 247, 3, 4, 254, 6, 253, 8, 0, 26, 0, 252, 28, 44, 5, 251, 3, 255, 250, 19, 250, 23, 251, 27, 1, 252, 28, 58, 4, 243, 9, 254, 5, 78, 5, 88, 6, 250, 11, 255, 27, 0, 252, 28, 92, 19, 248, 3, 42, 255, 3, 43, 250, 4, 239, 9, 254, 5, 100, 7, 250, 255, 6, 253, 8, 0, 27, 0, 252, 28, 101, 20, 254, 28, 44, 3, 4, 250, 3, 4, 251, 6, 244, 11, 240, 27, 0, 252, 28, 137, 19, 249, 3, 41, 244, 3, 44, 240, 19, 121, 19, 133, 20, 251, 28, 120, 3, 244, 121, 3, 244, 133, 19, 123, 19, 136, 20, 250, 28, 117, 3, 240, 123, 3, 240, 136, 8, 0, 19, 248, 18, 248, 26, 0, 252, 28, 186, 22, 250, 6, 250, 8, 16, 5, 250, 28, 169, 19, 249, 18, 249, 26, 0, 252, 28, 201, 22, 248, 19, 248, 28, 188, 6, 250, 9, 248, 5, 254, 3, 0, 248, 19, 213, 3, 255, 255, 27, 7, 253, 28, 215, 26, 7, 253, 28, 220, 10, 240, 26, 0, 252, 28, 0, 28, 26, 1, 1]
flash = [killTheBit, luminos, adder, ca2, mastermind, [], [], []]
with open('flash_memory.txt', 'w', encoding='utf-8') as f:
for prog in flash:
for i in range(256):
if i>=len(prog):
f.write('0\n')
else:
f.write(str(prog[i])+'\n')