4 * Copyright 1999 Patrik Stridvall
8 #include "debugtools.h"
13 DEFAULT_DEBUG_CHANNEL(ttydrv
)
15 /**********************************************************************/
17 extern DeviceCaps TTYDRV_DC_DevCaps
;
19 extern PALETTEENTRY
*COLOR_sysPal
;
20 extern int COLOR_gapStart
;
21 extern int COLOR_gapEnd
;
22 extern int COLOR_gapFilled
;
25 extern const PALETTEENTRY COLOR_sysPalTemplate
[NB_RESERVED_COLORS
];
27 /***********************************************************************
28 * TTYDRV_PALETTE_Initialize
30 BOOL
TTYDRV_PALETTE_Initialize(void)
36 TTYDRV_DC_DevCaps
.sizePalette
= 256;
38 COLOR_sysPal
= (PALETTEENTRY
*) xmalloc(sizeof(PALETTEENTRY
) * TTYDRV_DC_DevCaps
.sizePalette
);
40 for(i
=0; i
< TTYDRV_DC_DevCaps
.sizePalette
; i
++ ) {
41 const PALETTEENTRY
*src
;
42 PALETTEENTRY
*dst
= &COLOR_sysPal
[i
];
44 if(i
< NB_RESERVED_COLORS
/2) {
45 src
= &COLOR_sysPalTemplate
[i
];
46 } else if(i
>= TTYDRV_DC_DevCaps
.sizePalette
- NB_RESERVED_COLORS
/2) {
47 src
= &COLOR_sysPalTemplate
[NB_RESERVED_COLORS
+ i
- TTYDRV_DC_DevCaps
.sizePalette
];
49 PALETTEENTRY pe
= { 0, 0, 0, 0 };
53 if((src
->peRed
+ src
->peGreen
+ src
->peBlue
) <= 0xB0) {
57 dst
->peFlags
= PC_SYS_USED
;
62 dst
->peFlags
= PC_SYS_USED
;
66 COLOR_gapStart
= NB_RESERVED_COLORS
/2;
67 COLOR_gapEnd
= NB_RESERVED_COLORS
/2;
72 /***********************************************************************
73 * TTYDRV_PALETTE_Finalize
76 void TTYDRV_PALETTE_Finalize(void)
81 /***********************************************************************
82 * TTYDRV_PALETTE_SetMapping
84 int TTYDRV_PALETTE_SetMapping(
85 PALETTEOBJ
*palPtr
, UINT uStart
, UINT uNum
, BOOL mapOnly
)
87 FIXME("(%p, %u, %u, %d): stub\n", palPtr
, uStart
, uNum
, mapOnly
);
92 /***********************************************************************
93 * TTYDRV_PALETTE_UpdateMapping
95 int TTYDRV_PALETTE_UpdateMapping(PALETTEOBJ
*palPtr
)
97 TRACE("(%p)\n", palPtr
);
102 /***********************************************************************
103 * TTYDRV_PALETTE_IsDark
105 int TTYDRV_PALETTE_IsDark(int pixel
)
107 FIXME("(%d): stub\n", pixel
);