A flight down a tunnel of light for DOS, in under 256 bytes. Every pixel asks the x87 for an angle and a depth.
Cyan is amber with red and blue swapped: -11 bytes
Browse filesOne xchg al, ah ahead of a single set of outs replaces the second branch. al still holds the index after the first out, so the second mov al, cl goes too.
failing
1 step in 1 ms
1 file changed
+6−13
@@ -27,7 +27,6 @@ palette:
2727 mov al, cl
2828 out dx, al ; colour index
2929 inc dx ; 0x3C9 takes red, green, blue
30− mov al, cl
3130 and al, 63 ; level
3231 mov ah, al
3332 shr ah, 2 ; level / 4
@@ -35,20 +34,14 @@ palette:
3534 add bl, ah
3635 add bl, ah ; 3 * level / 4
3736 test cl, 64
38− jnz .cyan
39− out dx, al ; amber: red = level
40− mov al, bl
41− out dx, al ; green = 3/4 level
42− mov al, ah
43− out dx, al ; blue = 1/4 level
44− jmp .next
45−.cyan: xchg al, ah
46− out dx, al ; cyan: red = 1/4 level
37+ jz .amber
38+ xchg al, ah ; cyan is amber with red and blue swapped
39+.amber: out dx, al ; red
4740 mov al, bl
48− out dx, al ; green = 3/4 level
41+ out dx, al ; green
4942 mov al, ah
50− out dx, al ; blue = level
51−.next: inc cl
43+ out dx, al ; blue
44+ inc cl
5245 jnz palette
5346
5447 ; --- one frame ----------------------------------------------------------------