1
0
mirror of https://github.com/simh/simh.git synced 2026-01-26 12:02:14 +00:00

MicroVAX2: Added new video device (VCB02)

This commit is contained in:
Matt Burke
2019-04-10 22:01:52 -07:00
committed by Mark Pizzolato
parent dfd011a9b3
commit 4babf7f529
18 changed files with 4554 additions and 73 deletions

View File

@@ -75,6 +75,7 @@ static const char *window_name;
static uint32 *colors = NULL;
static uint32 ncolors = 0, size_colors = 0;
static uint32 *surface = NULL;
static uint32 ws_palette[2]; /* Monochrome palette */
typedef struct cursor {
Uint8 *data;
Uint8 *mask;
@@ -394,11 +395,13 @@ ws_init(const char *name, int xp, int yp, int colors, void *dptr)
ypixels = yp;
window_name = name;
surface = (uint32 *)realloc (surface, xpixels*ypixels*sizeof(*surface));
for (i=0; i<xpixels*ypixels; i++)
surface[i] = vid_mono_palette[0];
ret = (0 == vid_open ((DEVICE *)dptr, name, xp*pix_size, yp*pix_size, 0));
if (ret)
vid_set_cursor (1, arrow_cursor->width, arrow_cursor->height, arrow_cursor->data, arrow_cursor->mask, arrow_cursor->hot_x, arrow_cursor->hot_y);
ws_palette[0] = vid_map_rgb (0x00, 0x00, 0x00); /* black */
ws_palette[1] = vid_map_rgb (0xFF, 0xFF, 0xFF); /* white */
for (i=0; i<xpixels*ypixels; i++)
surface[i] = ws_palette[0];
return ret;
}
@@ -415,7 +418,7 @@ ws_color_rgb(int r, int g, int b)
{
uint32 color, i;
color = sim_end ? (0xFF000000 | ((r & 0xFF00) << 8) | (g & 0xFF00) | ((b & 0xFF00) >> 8)) : (0x000000FF | (r & 0xFF00) | ((g & 0xFF00) << 8) | ((b & 0xFF00) << 16));
color = vid_map_rgb ((r >> 8) & 0xFF, (g >> 8) & 0xFF, (b >> 8) & 0xFF);
for (i=0; i<ncolors; i++) {
if (colors[i] == color)
return &colors[i];
@@ -424,8 +427,8 @@ ws_color_rgb(int r, int g, int b)
colors = (uint32 *)realloc (colors, (ncolors + 1000) * sizeof (*colors));
size_colors += 1000;
if (size_colors == 1000) {
colors[0] = vid_mono_palette[0];
colors[1] = vid_mono_palette[1];
colors[0] = ws_palette[0];
colors[1] = ws_palette[1];
ncolors = 2;
}
}
@@ -437,13 +440,13 @@ ws_color_rgb(int r, int g, int b)
void *
ws_color_black(void)
{
return (void *)&vid_mono_palette[0];
return (void *)&ws_palette[0];
}
void *
ws_color_white(void)
{
return (void *)&vid_mono_palette[1];
return (void *)&ws_palette[1];
}
void