Created
November 24, 2012 07:22
-
-
Save tuttlem/4138777 to your computer and use it in GitHub Desktop.
Smoke - palette
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setup_palette: | |
mov cx, 255 ; 256 colour indicies to set | |
next_colour_idx: | |
mov al, 255 ; setup al so that we're setting | |
sub al, cl ; colour indicies from low to high | |
mov dx, 3c7h ; this port selects the colour index | |
; that we'll set r,g,b for | |
out dx, al | |
mov dx, 3c9h ; this port sets the r,g,b components | |
; for the selected index | |
shr al, 2 ; rgb intensities are in range of 0..63 | |
; so, divide by 4 to adjust | |
out dx, al ; set the red | |
out dx, al ; set the green | |
out dx, al ; set the blue | |
dec cx ; move onto the next colour | |
jnz next_colour_idx | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment