vic_palette.h
1 /* 2 Copyright Frank Bösing, 2017 3 4 This file is part of Teensy64. 5 6 Teensy64 is free software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 Teensy64 is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with Teensy64. If not, see <http://www.gnu.org/licenses/>. 18 19 Diese Datei ist Teil von Teensy64. 20 21 Teensy64 ist Freie Software: Sie können es unter den Bedingungen 22 der GNU General Public License, wie von der Free Software Foundation, 23 Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 24 veröffentlichten Version, weiterverbreiten und/oder modifizieren. 25 26 Teensy64 wird in der Hoffnung, dass es nützlich sein wird, aber 27 OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 28 Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 29 Siehe die GNU General Public License für weitere Details. 30 31 Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 32 Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>. 33 34 */ 35 36 /* choose your "display"-type */ 37 38 #if 1 // color display (default) 39 40 // MACROS moved to vic implementations 41 42 #elif 0 // B&W TV for real retro feeling. Looks great (ILI 9341 only) 43 #define PALETTE(r,g,b) ( ((((int)( 0.299f * r + 0.587f * g + 0.114f * b )) & 0xF8) << 8 ) | \ 44 ( (((int) ( 0.299f * r + 0.587f * g + 0.114f * b )) & 0xFC) << 3 ) | \ 45 ( (((int) ( 0.299f * r + 0.587f * g + 0.114f * b )) & 0xFF) >> 3 )) 46 47 48 #elif 0 // green display (ILI 9341 only) 49 #define PALETTE(r,g,b) ( ( 0 ) | \ 50 ( (((int) ( 0.299f * r + 0.587f * g + 0.114f * b )) & 0xFC) << 3 ) | \ 51 ( 0 )) 52 // TODO: amber display 53 #endif 54 55 56 57 /* chose one of these palettes: 58 VGA is 256 colors only (rrrgggbb) , subtle differences might not be visible 59 */ 60 61 #if 1 // "Deekay" (default) 62 static const uint16_t palette[16] = { 63 PALETTE(0x00,0x00,0x00), PALETTE(0xff,0xff,0xff), PALETTE(0x88,0x20,0x00), PALETTE(0x68,0xd0,0xa8), // black, white, red, cyan, 64 PALETTE(0xa8,0x38,0xa0), PALETTE(0x50,0xb8,0x18), PALETTE(0x18,0x10,0x90), PALETTE(0xf0,0xe8,0x58), // purple, green, blue, yellow 65 PALETTE(0xa0,0x48,0x00), PALETTE(0x47,0x2b,0x1b), PALETTE(0xc8,0x78,0x70), PALETTE(0x48,0x48,0x48), // orange, brown, lightred, grey1, 66 PALETTE(0x80,0x80,0x80), PALETTE(0x98,0xff,0x98), PALETTE(0x50,0x90,0xd0), PALETTE(0xb8,0xb8,0xb8) // grey2, lightgreen, lightblue, grey3 67 }; 68 69 #elif 0 // VICE vice.vpl 70 static const uint16_t palette[16] = { 71 PALETTE(0x00,0x00,0x00), PALETTE(0xFD,0xFE,0xFC), PALETTE(0xBE,0x1a,0x24), PALETTE(0x30,0xe6,0xc6), // black, white, red, cyan, 72 PALETTE(0xb4,0x1a,0xe2), PALETTE(0x1f,0xd2,0x1e), PALETTE(0x21,0x1b,0xae), PALETTE(0xdf,0xf6,0x0a), // purple, green, blue, yellow 73 PALETTE(0xb8,0x41,0x04), PALETTE(0x6a,0x33,0x04), PALETTE(0xfe,0x4a,0x57), PALETTE(0x42,0x45,0x40), // orange, brown, lightred, grey1, 74 PALETTE(0x70,0x74,0x6f), PALETTE(0x59,0xfe,0x59), PALETTE(0x5f,0x53,0xfe), PALETTE(0xa4,0xa7,0xa2) // grey2, lightgreen, lightblue, grey3 75 }; 76 77 78 #elif 0 // "PEPTO" http://www.pepto.de/projects/colorvic/2001/ 79 static const uint16_t palette[16] = { 80 0x0000, 0xFFFF, 0x69A5, 0x7536, 0x69F0, 0x5C68, 0x314F, 0xBE2D,// black, white, red, cyan, purple, green, blue, yellow 81 0x6A64, 0x41C0, 0x9B2B, 0x4228, 0x6B6D, 0x9E90, 0x6AF6, 0x94B2 // orange, brown, lightred, grey1, grey2, lightgreen, lightblue, grey3 82 }; 83 84 85 #elif 0 // "GODOT" http://www.godot64.de/german/hpalet.htm 86 static const uint16_t palette[16] = { 87 PALETTE(0x00,0x00,0x00), PALETTE(0xff,0xff,0xff), PALETTE(0x88,0x00,0x00), PALETTE(0xaa,0xff,0xee), // black, white, red, cyan, 88 PALETTE(0xcc,0x44,0xcc), PALETTE(0x00,0xcc,0x55), PALETTE(0x00,0x00,0xaa), PALETTE(0xee,0xee,0x77), // purple, green, blue, yellow 89 PALETTE(0xdd,0x88,0x55), PALETTE(0x66,0x44,0x00), PALETTE(0xff,0x77,0x77), PALETTE(0x33,0x33,0x33), // orange, brown, lightred, grey1, 90 PALETTE(0x77,0x77,0x77), PALETTE(0xaa,0xff,0x66), PALETTE(0x00,0x88,0xff), PALETTE(0xbb,0xbb,0xbb) // grey2, lightgreen, lightblue, grey3 91 }; 92 93 94 #elif 0 // "FRODO" 95 static const uint16_t palette[16] = { 96 PALETTE(0x00,0x00,0x00), PALETTE(0xff,0xff,0xff), PALETTE(0xcc,0x00,0x00), PALETTE(0x00,0xff,0xcc), // black, white, red, cyan, 97 PALETTE(0xff,0x00,0xff), PALETTE(0x00,0xcc,0x00), PALETTE(0x00,0x00,0xcc), PALETTE(0xff,0xff,0x00), // purple, green, blue, yellow 98 PALETTE(0xff,0x88,0x00), PALETTE(0x88,0x44,0x00), PALETTE(0xff,0x88,0x88), PALETTE(0x44,0x44,0x44), // orange, brown, lightred, grey1, 99 PALETTE(0x88,0x88,0x88), PALETTE(0x88,0xff,0x88), PALETTE(0x88,0x88,0xff), PALETTE(0xcc,0xcc,0xcc) // grey2, lightgreen, lightblue, grey3 100 }; 101 102 103 #elif 0 //RGB (full saturated colors - only good for testing) 104 static const uint16_t palette[16] = { 105 PALETTE(0x00,0x00,0x00), PALETTE(0xff,0xff,0xff), PALETTE(0xff,0x00,0x00), PALETTE(0x00,0xff,0xff), // black, white, red, cyan, 106 PALETTE(0xff,0x00,0xff), PALETTE(0x00,0xff,0x00), PALETTE(0x00,0x00,0xff), PALETTE(0xff,0xff,0x00), // purple, green, blue, yellow 107 PALETTE(0xff,0x80,0x00), PALETTE(0x80,0x40,0x00), PALETTE(0xff,0x80,0x80), PALETTE(0x40,0x40,0x40), // orange, brown, lightred, grey1, 108 PALETTE(0x80,0x80,0x80), PALETTE(0x80,0xff,0x80), PALETTE(0x80,0x80,0xff), PALETTE(0xc0,0xc0,0xc0) // grey2, lightgreen, lightblue, grey3 109 }; 110 #endif 111 112 #undef BW