4 * Copyright 1999 Patrik Stridvall
10 #include "debugtools.h"
15 DEFAULT_DEBUG_CHANNEL(ttydrv);
17 /**********************************************************************/
19 extern DeviceCaps TTYDRV_DC_DevCaps;
21 extern PALETTEENTRY *COLOR_sysPal;
22 extern int COLOR_gapStart;
23 extern int COLOR_gapEnd;
24 extern int COLOR_gapFilled;
27 extern const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS];
29 /***********************************************************************
30 * TTYDRV_PALETTE_Initialize
32 BOOL TTYDRV_PALETTE_Initialize(void)
38 COLOR_sysPal = (PALETTEENTRY *) HeapAlloc(GetProcessHeap(), 0, sizeof(PALETTEENTRY) * TTYDRV_DC_DevCaps.sizePalette);
39 if(COLOR_sysPal == NULL) {
40 WARN("No memory to create system palette!");
44 for(i=0; i < TTYDRV_DC_DevCaps.sizePalette; i++ ) {
45 const PALETTEENTRY *src;
46 PALETTEENTRY *dst = &COLOR_sysPal[i];
48 if(i < NB_RESERVED_COLORS/2) {
49 src = &COLOR_sysPalTemplate[i];
50 } else if(i >= TTYDRV_DC_DevCaps.sizePalette - NB_RESERVED_COLORS/2) {
51 src = &COLOR_sysPalTemplate[NB_RESERVED_COLORS + i - TTYDRV_DC_DevCaps.sizePalette];
53 PALETTEENTRY pe = { 0, 0, 0, 0 };
57 if((src->peRed + src->peGreen + src->peBlue) <= 0xB0) {
61 dst->peFlags = PC_SYS_USED;
66 dst->peFlags = PC_SYS_USED;
70 COLOR_gapStart = NB_RESERVED_COLORS/2;
71 COLOR_gapEnd = NB_RESERVED_COLORS/2;
76 /***********************************************************************
77 * TTYDRV_PALETTE_Finalize
80 void TTYDRV_PALETTE_Finalize(void)
85 /***********************************************************************
86 * TTYDRV_PALETTE_SetMapping
88 int TTYDRV_PALETTE_SetMapping(
89 PALETTEOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly)
91 FIXME("(%p, %u, %u, %d): stub\n", palPtr, uStart, uNum, mapOnly);
96 /***********************************************************************
97 * TTYDRV_PALETTE_UpdateMapping
99 int TTYDRV_PALETTE_UpdateMapping(PALETTEOBJ *palPtr)
101 TRACE("(%p)\n", palPtr);
106 /***********************************************************************
107 * TTYDRV_PALETTE_IsDark
109 int TTYDRV_PALETTE_IsDark(int pixel)
111 FIXME("(%d): stub\n", pixel);