lfn
serial
ticket/834-toolchain-update
topic/msim-upgrade
topic/simplify-dev-export
Last change
on this file since 3ca7059 was 4f42d52, checked in by Martin Decky <martin@…>, 18 years ago |
force VGA palette to 3:2:3 palette on 8 bpp modes
(this fixes ticket #33)
|
-
Property mode
set to
100644
|
File size:
334 bytes
|
Line | |
---|
1 | #include <stdio.h>
|
---|
2 |
|
---|
3 | #define RED(i) ((i >> 5) & ((1 << 3) - 1))
|
---|
4 | #define GREEN(i) ((i >> 3) & ((1 << 2) - 1))
|
---|
5 | #define BLUE(i) (i & ((1 << 3) - 1))
|
---|
6 |
|
---|
7 | int main(int argc, char *argv[]) {
|
---|
8 | unsigned int i;
|
---|
9 |
|
---|
10 | for (i = 0; i < 256; i++)
|
---|
11 | printf("\t.byte 0x%02x, 0x%02x, 0x%02x, 0x00\n", BLUE(i) * 9, GREEN(i) * 21, RED(i) * 9);
|
---|
12 |
|
---|
13 | return 0;
|
---|
14 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.