static int lightpen_y1[2], lightpen_y2[2];
static int statusbar_y1, statusbar_y2;
-void putpixel(uae_u8 *buf, uae_u8 *genlockbuf, int bpp, int x, xcolnr c8, int opaq)
+void putpixel(uae_u8 *buf, uae_u8 *genlockbuf, int bpp, int x, xcolnr c8)
{
if (x <= 0)
return;
break;
case 4:
{
- int i;
- if (1 || opaq || currprefs.gf[0].gfx_filter == 0) {
- uae_u32 *p = (uae_u32*)buf + x;
- *p = c8;
- } else {
- for (i = 0; i < 4; i++) {
- int v1 = buf[i + bpp * x];
- int v2 = (c8 >> (i * 8)) & 255;
- v1 = (v1 * 2 + v2 * 3) / 5;
- if (v1 > 255)
- v1 = 255;
- buf[i + bpp * x] = v1;
- }
- }
+ uae_u32 *p = (uae_u32*)buf + x;
+ *p = c8;
break;
}
}
for (int i = 0; i < LIGHTPEN_WIDTH; i++) {
int xx = x + i - LIGHTPEN_WIDTH / 2;
if (*p != '-' && xx >= 0 && xx < vidinfo->drawbuffer.outwidth) {
- putpixel(xlinebuffer, xlinebuffer_genlock, vidinfo->drawbuffer.pixbytes, xx, *p == 'x' ? xcolors[color1] : xcolors[color2], 1);
+ putpixel(xlinebuffer, xlinebuffer_genlock, vidinfo->drawbuffer.pixbytes, xx, *p == 'x' ? xcolors[color1] : xcolors[color2]);
}
p++;
}
color2 = refresh_indicator_colors[pixel - 5];
}
for (int x = 0; x < 8; x++) {
- putpixel(xlinebuffer, NULL, vidinfo->drawbuffer.pixbytes, x, xcolors[color1], 1);
+ putpixel(xlinebuffer, NULL, vidinfo->drawbuffer.pixbytes, x, xcolors[color1]);
}
for (int x = 8; x < 16; x++) {
- putpixel(xlinebuffer, NULL, vidinfo->drawbuffer.pixbytes, x, xcolors[color2], 1);
+ putpixel(xlinebuffer, NULL, vidinfo->drawbuffer.pixbytes, x, xcolors[color2]);
}
}
}
int color = section_toggle ? section_colors[section & 3] : 0;
xlinebuffer = row_map[whereline];
for (int x = 0; x < 4; x++) {
- putpixel(xlinebuffer, NULL, vidinfo->drawbuffer.pixbytes, x, xcolors[color], 1);
+ putpixel(xlinebuffer, NULL, vidinfo->drawbuffer.pixbytes, x, xcolors[color]);
}
}
}
extern void get_custom_topedge (int *x, int *y, bool max);
extern void get_custom_raw_limits (int *pw, int *ph, int *pdx, int *pdy);
void get_custom_mouse_limits (int *pw, int *ph, int *pdx, int *pdy, int dbl);
-extern void putpixel (uae_u8 *buf, uae_u8 *genlockbuf, int bpp, int x, xcolnr c8, int opaq);
+extern void putpixel (uae_u8 *buf, uae_u8 *genlockbuf, int bpp, int x, xcolnr c8);
extern void allocvidbuffer(int monid, struct vidbuffer *buf, int width, int height, int depth);
extern void freevidbuffer(int monid, struct vidbuffer *buf);
extern void check_prefs_picasso(void);
struct gdistruct
{
+ int enabled;
int num;
int width, height, depth;
int wwidth, wheight;
struct gdistruct *gdi = &gdidata[monid];
if (gdi->bits) {
*pitch = gdi->pitch;
- *height = gdi->height;
+ if (height)
+ *height = gdi->height;
return (uae_u8*)gdi->bits;
}
return NULL;
StretchBlt(gdi->hdc, 0, 0, gdi->wwidth, gdi->wheight, gdi->thdc, 0, 0, gdi->width, gdi->height, SRCCOPY);
}
if (gdi->osd.active && gdi->osd.hbm) {
- BLENDFUNCTION bf = { 0 };
- bf.BlendOp = AC_SRC_OVER;
- bf.SourceConstantAlpha = 255;
- bf.AlphaFormat = AC_SRC_ALPHA;
- AlphaBlend(gdi->hdc, gdi->osd.x, gdi->osd.y, gdi->ledwidth, gdi->ledheight, gdi->osd.thdc, 0, 0, gdi->ledwidth, gdi->ledheight, bf);
+ TransparentBlt(gdi->hdc, gdi->osd.x, gdi->osd.y, gdi->ledwidth, gdi->ledheight, gdi->osd.thdc, 0, 0, gdi->ledwidth, gdi->ledheight, 0x000000);
}
}
void gdi_free(int monid, bool immediate)
{
struct gdistruct *gdi = &gdidata[monid];
+ gdi->enabled = 0;
freetexture(monid);
}
gdi->ledheight = TD_TOTAL_HEIGHT * gdi->statusbar_vx;
allocsprite(gdi, &gdi->osd, gdi->ledwidth, gdi->ledheight);
+ gdi->enabled = 1;
+
+ return NULL;
+}
+
+static HDC gdi_getDC(int monid, HDC hdc)
+{
+ struct gdistruct *gdi = &gdidata[monid];
+
+ if (!hdc) {
+ return gdi->hdc;
+ }
return NULL;
}
+static int gdi_isenabled(int monid)
+{
+ struct gdistruct *gdi = &gdidata[monid];
+ return gdi->enabled ? -1 : 0;
+}
+
+static void gdi_clear(int monid)
+{
+ struct gdistruct *gdi = &gdidata[monid];
+}
void gdi_select(void)
{
D3D_showframe = gdi_showframe;
D3D_showframe_special = NULL;
D3D_guimode = gdi_guimode;
- D3D_getDC = NULL;
- D3D_isenabled = NULL;
- D3D_clear = NULL;
+ D3D_getDC = gdi_getDC;
+ D3D_isenabled = gdi_isenabled;
+ D3D_clear = gdi_clear;
D3D_canshaders = NULL;
D3D_goodenough = NULL;
D3D_setcursor = NULL;
for (j = 0; j < td_numbers_width; j++) {
for (int k = 0; k < mult; k++) {
if (*numptr == 'x')
- putpixel(buf, NULL, bpp, x + j * mult + k, c1, 1);
+ putpixel(buf, NULL, bpp, x + j * mult + k, c1);
else if (*numptr == '+')
- putpixel(buf, NULL, bpp, x + j * mult + k, c2, 0);
+ putpixel(buf, NULL, bpp, x + j * mult + k, c2);
}
numptr++;
}
y /= mult;
c1 = ledcolor (0x00ffffff, rc, gc, bc, alpha);
- c2 = ledcolor (0x00000000, rc, gc, bc, alpha);
+ c2 = ledcolor (0x00111111, rc, gc, bc, alpha);
if (td_numbers_pos & TD_RIGHT)
x_start = totalwidth - (td_numbers_padx + VISIBLE_LEDS * td_width) * mult;
num2 = -1;
num3 = 16;
on_rgb = 0xcccccc;
- off_rgb = 0x000000;
+ off_rgb = 0x111111;
am = 2;
} else {
int fps = (gui_data.fps + 5) / 10;
- on_rgb = 0x000000;
- off_rgb = gui_data.fps_color == 1 ? 0xcccc00 : (gui_data.fps_color == 2 ? 0x0000cc : 0x000000);
+ on_rgb = 0x111111;
+ off_rgb = gui_data.fps_color == 1 ? 0xcccc00 : (gui_data.fps_color == 2 ? 0x0000cc : 0x111111);
am = 3;
if (gui_data.fps_color >= 2) {
num1 = -1;
int idle = (gui_data.idle + 5) / 10;
pos = 1;
on_rgb = 0xcc0000;
- off_rgb = 0x000000;
+ off_rgb = 0x111111;
if (gui_data.cpu_halted) {
idle = 0;
on = 1;
if (gui_data.cpu_halted < 0) {
- on_rgb = 0x000000;
+ on_rgb = 0x111111;
num1 = 16; // PPC
num2 = 16;
num3 = 10;
num2 = snd / 10;
num3 = snd % 10;
}
- on_rgb = 0x000000;
+ on_rgb = 0x111111;
if (on < 0)
on_rgb = 0xcccc00; // underflow
else if (on == 2)
on_rgb = 0xcc0000; // really big overflow
else if (on == 1)
on_rgb = 0x0000cc; // "normal" overflow
- off_rgb = 0x000000;
+ off_rgb = 0x111111;
am = 3;
} else if (led == LED_MD) {
// DF3 reused as internal non-volatile ram led (cd32/cdtv)
on_rgb |= 0x00cc00;
if (on & 2)
on_rgb |= 0xcc0000;
- off_rgb = 0x000000;
+ off_rgb = 0x111111;
num1 = -1;
num2 = -1;
num3 = 17;
} else {
continue;
}
- on_rgb |= 0x33000000;
- off_rgb |= 0x33000000;
+ on_rgb |= 0x33111111;
+ off_rgb |= 0x33111111;
if (half > 0) {
int halfon = y >= TD_TOTAL_HEIGHT / 2;
c = ledcolor(on ? (halfon ? on_rgb2 : on_rgb) : off_rgb, rc, gc, bc, alpha);
x = x_start + pos * td_width * mult;
for (int xx = 0; xx < mult; xx++) {
if (!border) {
- putpixel(buf, NULL, bpp, x - mult + xx, cb, 0);
+ putpixel(buf, NULL, bpp, x - mult + xx, cb);
}
for (j = 0; j < td_led_width * mult; j += mult) {
- putpixel(buf, NULL, bpp, x + j + xx, c, 0);
+ putpixel(buf, NULL, bpp, x + j + xx, c);
}
if (!border) {
- putpixel(buf, NULL, bpp, x + j + xx, cb, 0);
+ putpixel(buf, NULL, bpp, x + j + xx, cb);
}
}