Changes
/* Optimized Z80 Assembler version */
<br>
= Optimized version = == In Z80 Assembler version ==
The unlocking sequence can be reconstituted from simple bit operations instead of being stored in memory.
<br>
== In Python == <pre>def unlock_asic(): b, c, h, l = 0xBC, 0xFF, 0x90, 0xEA # Initialize registers port_out(b, c) port_out(b, 0) while c != 0x4D: port_out(b, c) h, l = l, ((h << 1) | (h >> 7)) & 0xFF # Rotate h and swap h, l c = ((c >> 1) & ~(1 << 3)) | (l & 0x88) # Modify c port_out(b, 0xCD) port_out(b, 0xCD) def port_out(port, value): print(f"Port: {hex(port)}xx Out: {hex(value)}") unlock_asic()</pre> <br> =Visual representation==
As one may see, the nybbles in the sequence are based on two 4bit shift registers.
<br>
For one reason or another, Amstrad has patented the verification mechanism ([[Media:Patent GB2243701A.pdf|GB2243701A]]).