Added the ability to invert LCD colors for the Toshiba T1000 and T1200, and the Amstrad PPC512/640.
This commit is contained in:
@@ -108,7 +108,8 @@ typedef struct {
|
|||||||
stat;
|
stat;
|
||||||
uint8_t plane_write, /* 1512/200 */
|
uint8_t plane_write, /* 1512/200 */
|
||||||
plane_read, /* 1512/200 */
|
plane_read, /* 1512/200 */
|
||||||
border; /* 1512/200 */
|
border, /* 1512/200 */
|
||||||
|
invert; /* 512/640 */
|
||||||
int fontbase; /* 1512/200 */
|
int fontbase; /* 1512/200 */
|
||||||
int linepos,
|
int linepos,
|
||||||
displine;
|
displine;
|
||||||
@@ -1695,8 +1696,17 @@ vid_init_200(amstrad_t *ams)
|
|||||||
|
|
||||||
overscan_x = overscan_y = 16;
|
overscan_x = overscan_y = 16;
|
||||||
|
|
||||||
|
if (ams->type == AMS_PC200)
|
||||||
|
vid->invert = 0;
|
||||||
|
else
|
||||||
|
vid->invert = device_get_config_int("invert");
|
||||||
|
if (vid->invert) {
|
||||||
|
blue = makecol(0x1C, 0x71, 0x31);
|
||||||
|
green = makecol(0x0f, 0x21, 0x3f);
|
||||||
|
} else {
|
||||||
green = makecol(0x1C, 0x71, 0x31);
|
green = makecol(0x1C, 0x71, 0x31);
|
||||||
blue = makecol(0x0f, 0x21, 0x3f);
|
blue = makecol(0x0f, 0x21, 0x3f);
|
||||||
|
}
|
||||||
cgapal_rebuild();
|
cgapal_rebuild();
|
||||||
set_lcd_cols(0);
|
set_lcd_cols(0);
|
||||||
|
|
||||||
@@ -1954,6 +1964,9 @@ device_config_t vid_ppc512_config[] =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"invert", "Invert LCD colors", CONFIG_BINARY, "", 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"", "", -1
|
"", "", -1
|
||||||
}
|
}
|
||||||
|
@@ -118,7 +118,8 @@ typedef struct t1000_t
|
|||||||
int vc;
|
int vc;
|
||||||
int dispon;
|
int dispon;
|
||||||
int vsynctime;
|
int vsynctime;
|
||||||
uint8_t video_options, backlight;
|
uint8_t video_options;
|
||||||
|
uint8_t backlight, invert;
|
||||||
|
|
||||||
uint8_t *vram;
|
uint8_t *vram;
|
||||||
} t1000_t;
|
} t1000_t;
|
||||||
@@ -588,6 +589,15 @@ static void t1000_recalcattrs(t1000_t *t1000)
|
|||||||
* are bold */
|
* are bold */
|
||||||
|
|
||||||
/* Set up colours */
|
/* Set up colours */
|
||||||
|
if (t1000->invert) {
|
||||||
|
if (t1000->backlight) {
|
||||||
|
grey = makecol(0x2D, 0x39, 0x5A);
|
||||||
|
blue = makecol(0x85, 0xa0, 0xD6);
|
||||||
|
} else {
|
||||||
|
grey = makecol(0x0f, 0x21, 0x3f);
|
||||||
|
blue = makecol(0x1C, 0x71, 0x31);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (t1000->backlight) {
|
if (t1000->backlight) {
|
||||||
blue = makecol(0x2D, 0x39, 0x5A);
|
blue = makecol(0x2D, 0x39, 0x5A);
|
||||||
grey = makecol(0x85, 0xa0, 0xD6);
|
grey = makecol(0x85, 0xa0, 0xD6);
|
||||||
@@ -595,6 +605,7 @@ static void t1000_recalcattrs(t1000_t *t1000)
|
|||||||
blue = makecol(0x0f, 0x21, 0x3f);
|
blue = makecol(0x0f, 0x21, 0x3f);
|
||||||
grey = makecol(0x1C, 0x71, 0x31);
|
grey = makecol(0x1C, 0x71, 0x31);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialise the attribute mapping. Start by defaulting everything
|
/* Initialise the attribute mapping. Start by defaulting everything
|
||||||
* to grey on blue, and with bold set by bit 3 */
|
* to grey on blue, and with bold set by bit 3 */
|
||||||
@@ -686,7 +697,9 @@ static void *t1000_init(const device_t *info)
|
|||||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_t1000);
|
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_t1000);
|
||||||
|
|
||||||
t1000->internal = 1;
|
t1000->internal = 1;
|
||||||
|
|
||||||
t1000->backlight = device_get_config_int("backlight");
|
t1000->backlight = device_get_config_int("backlight");
|
||||||
|
t1000->invert = device_get_config_int("invert");
|
||||||
|
|
||||||
/* 16k video RAM */
|
/* 16k video RAM */
|
||||||
t1000->vram = malloc(0x4000);
|
t1000->vram = malloc(0x4000);
|
||||||
@@ -749,6 +762,9 @@ static const device_config_t t1000_config[] =
|
|||||||
{
|
{
|
||||||
"backlight", "Enable backlight", CONFIG_BINARY, "", 1
|
"backlight", "Enable backlight", CONFIG_BINARY, "", 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"invert", "Invert colors", CONFIG_BINARY, "", 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.type = -1
|
.type = -1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user