# HG changeset patch # User Paul Boddie # Date 1357508681 -3600 # Node ID b2dc981a266abca04b279326f416a1b29ee15242 # Parent 5d82dab6add346641377d59c22e4d645b78bca9d Added more details about how palette data would be inverted in order to cause colour flashing, along with a description of VDU 19 activities. diff -r 5d82dab6add3 -r b2dc981a266a ULA.txt --- a/ULA.txt Sun Jan 06 02:23:13 2013 +0100 +++ b/ULA.txt Sun Jan 06 22:44:41 2013 +0100 @@ -308,30 +308,36 @@ having colour complements as pairs. It is conceivable that the interrupt code responsible does the simple thing -and merely inverts the current values for any logical colours for which the -associated physical colour (as supplied as the second parameter to the VDU 19 -call) has the top bit of its four bit value set. These top bits are not +and merely inverts the current values for any logical colours (LC) for which +the associated physical colour (as supplied as the second parameter to the VDU +19 call) has the top bit of its four bit value set. These top bits are not recorded in the palette registers but are presumably recorded separately and used to build bitmaps as follows: - 2 colour 4 colour 16 colour - -------- -------- --------- - 0 00010001 00010001 00010001 - 1 01000100 00100010 00010001 - 2 01000100 00100010 - 3 10001000 00100010 - 4 00010001 - 5 00010001 - 6 00100010 - 7 00100010 - 8 01000100 - 9 01000100 - 10 10001000 - 11 10001000 - 12 01000100 - 13 01000100 - 14 10001000 - 15 10001000 + LC 2 colour 4 colour 16 colour 4-bit value for inversion + -- -------- -------- --------- ------------------------- + 0 00010001 00010001 00010001 1, 1, 1 + 1 01000100 00100010 00010001 4, 2, 1 + 2 01000100 00100010 4, 2 + 3 10001000 00100010 8, 2 + 4 00010001 1 + 5 00010001 1 + 6 00100010 2 + 7 00100010 2 + 8 01000100 4 + 9 01000100 4 + 10 10001000 8 + 11 10001000 8 + 12 01000100 4 + 13 01000100 4 + 14 10001000 8 + 15 10001000 8 + + Inversion value calculation: + + 2 colour formula: 1 << (colour * 2) + 4 colour formula: 1 << colour + 16 colour formula: 1 << ((colour & 2) + ((colour & 8) * 2)) For example, where logical colour 0 has been mapped to a physical colour in the range 8 to 15, a bitmap of 00010001 would be chosen as its contribution to @@ -343,6 +349,8 @@ logical colours in 2 and 4 colour modes, with the 16 colour bitmaps being combined for groups of logical colours as follows: + Logical colours + --------------- 0, 2, 8, 10 4, 6, 12, 14 5, 7, 13, 15 @@ -352,6 +360,14 @@ values in order to perform the value inversion necessary to produce the flashing effect. +Thus, in the VDU 19 operation, the appropriate inversion value would be +calculated for the logical colour, and this value would then be combined with +other inversion values in a dedicated memory location corresponding to the +colour's group as indicated above. Meanwhile, the palette channel values would +be derived from the lower three bits of the specified physical colour and +combined with other palette data in dedicated memory locations corresponding +to the palette registers. + Palette Definition Lists ------------------------