/* */
/* */
/* */
-/* (C) 2003-2009, Ullrich von Bassewitz */
+/* (C) 2003-2012, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* -- Exported functions -- */
ScreenInitChip,
ScreenCreateInstance,
- ScreenDestroyInstance,
+ ScreenDestroyInstance,
ScreenWrite,
ScreenWrite,
ScreenRead,
};
/* Defines for console screen */
-static const XColor FgColor = {
- 0, 32*256, 141*256, 32*256, 0, 0 /* green */
+static const XColor GreenColor = {
+ 0, 32*256, 141*256, 32*256, 0, 0 /* green */
+};
+static const XColor AmberColor = {
+ 0, 255*256, 204*256, 51*256, 0, 0 /* amber */
+};
+static const XColor WhiteColor = {
+ 0, 224*256, 224*256, 224*256, 0, 0 /* white */
};
static const XColor BgColor = {
0, 0*256, 0*256, 0*256, 0, 0 /* black */
unsigned Rows;
unsigned Cols;
- /* Window dimensions, 384*288 (PAL) */
+ /* Window dimensions, determined by char resolution and char set */
unsigned XTotal;
unsigned YTotal;
XSizeHints SizeHints;
XWMHints WMHints;
Cursor C;
+ unsigned CharColor;
+
/* Allocate the instance data */
ScreenInstance* V = VScreen = Sim->Malloc (sizeof (ScreenInstance));
Sim->Error ("Screen: Need color display");
}
+ /* Determine the character color */
+ CharColor = (unsigned) CfgGetNum (CfgInfo, "charcolor", 0, 2, 0);
+
/* Get all needed colors */
- V->FgColor = FgColor;
+ switch (CharColor) {
+ case 1: V->FgColor = AmberColor; break;
+ case 2: V->FgColor = WhiteColor; break;
+ default: V->FgColor = GreenColor; break;
+ }
V->BgColor = BgColor;
CM = DefaultColormap (V->ScreenDisplay, V->Screen);
if (XAllocColor (V->ScreenDisplay, CM, &V->FgColor) == 0) {
XDefineCursor (V->ScreenDisplay, V->ScreenWindow, C);
/* Select input events */
- XSelectInput (V->ScreenDisplay, V->ScreenWindow, ExposureMask | StructureNotifyMask);
+ XSelectInput (V->ScreenDisplay, V->ScreenWindow, ExposureMask | StructureNotifyMask | KeyPressMask);
/* Show the window */
XMapRaised (V->ScreenDisplay, V->ScreenWindow);
switch (Event.type) {
case Expose:
- /* Calculate the area to redraw, then update the screen */
+ /* Calculate the area to redraw, then update the screen */
X1 = Event.xexpose.x;
Y1 = Event.xexpose.y;
X2 = Event.xexpose.x + Event.xexpose.width - 1;
XRefreshKeyboardMapping (&Event.xmapping);
break;
+ case KeyPress:
+ break;
+
+ default:
+ /* Ignore anything else */
+ break;
+
}
}