mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
GDI mode statusline update.
This commit is contained in:
parent
965e3b1cfa
commit
300603a807
26
drawing.cpp
26
drawing.cpp
@ -4208,7 +4208,7 @@ static void init_drawing_frame (void)
|
|||||||
static int lightpen_y1[2], lightpen_y2[2];
|
static int lightpen_y1[2], lightpen_y2[2];
|
||||||
static int statusbar_y1, statusbar_y2;
|
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)
|
if (x <= 0)
|
||||||
return;
|
return;
|
||||||
@ -4231,20 +4231,8 @@ void putpixel(uae_u8 *buf, uae_u8 *genlockbuf, int bpp, int x, xcolnr c8, int op
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
int i;
|
uae_u32 *p = (uae_u32*)buf + x;
|
||||||
if (1 || opaq || currprefs.gf[0].gfx_filter == 0) {
|
*p = c8;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4319,7 +4307,7 @@ static void draw_lightpen_cursor(int monid, int x, int y, int line, int onscreen
|
|||||||
for (int i = 0; i < LIGHTPEN_WIDTH; i++) {
|
for (int i = 0; i < LIGHTPEN_WIDTH; i++) {
|
||||||
int xx = x + i - LIGHTPEN_WIDTH / 2;
|
int xx = x + i - LIGHTPEN_WIDTH / 2;
|
||||||
if (*p != '-' && xx >= 0 && xx < vidinfo->drawbuffer.outwidth) {
|
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++;
|
p++;
|
||||||
}
|
}
|
||||||
@ -4429,10 +4417,10 @@ static void refresh_indicator_update(struct vidbuffer *vb)
|
|||||||
color2 = refresh_indicator_colors[pixel - 5];
|
color2 = refresh_indicator_colors[pixel - 5];
|
||||||
}
|
}
|
||||||
for (int x = 0; x < 8; x++) {
|
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++) {
|
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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4617,7 +4605,7 @@ void draw_lines(int end, int section)
|
|||||||
int color = section_toggle ? section_colors[section & 3] : 0;
|
int color = section_toggle ? section_colors[section & 3] : 0;
|
||||||
xlinebuffer = row_map[whereline];
|
xlinebuffer = row_map[whereline];
|
||||||
for (int x = 0; x < 4; x++) {
|
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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -376,7 +376,7 @@ extern void check_custom_limits (void);
|
|||||||
extern void get_custom_topedge (int *x, int *y, bool max);
|
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);
|
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);
|
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 allocvidbuffer(int monid, struct vidbuffer *buf, int width, int height, int depth);
|
||||||
extern void freevidbuffer(int monid, struct vidbuffer *buf);
|
extern void freevidbuffer(int monid, struct vidbuffer *buf);
|
||||||
extern void check_prefs_picasso(void);
|
extern void check_prefs_picasso(void);
|
||||||
|
|||||||
@ -30,6 +30,7 @@ struct gdibm
|
|||||||
|
|
||||||
struct gdistruct
|
struct gdistruct
|
||||||
{
|
{
|
||||||
|
int enabled;
|
||||||
int num;
|
int num;
|
||||||
int width, height, depth;
|
int width, height, depth;
|
||||||
int wwidth, wheight;
|
int wwidth, wheight;
|
||||||
@ -200,7 +201,8 @@ static uae_u8 *gdi_locktexture(int monid, int *pitch, int *height, int fullupdat
|
|||||||
struct gdistruct *gdi = &gdidata[monid];
|
struct gdistruct *gdi = &gdidata[monid];
|
||||||
if (gdi->bits) {
|
if (gdi->bits) {
|
||||||
*pitch = gdi->pitch;
|
*pitch = gdi->pitch;
|
||||||
*height = gdi->height;
|
if (height)
|
||||||
|
*height = gdi->height;
|
||||||
return (uae_u8*)gdi->bits;
|
return (uae_u8*)gdi->bits;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -239,17 +241,14 @@ static void gdi_showframe(int monid)
|
|||||||
StretchBlt(gdi->hdc, 0, 0, gdi->wwidth, gdi->wheight, gdi->thdc, 0, 0, gdi->width, gdi->height, SRCCOPY);
|
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) {
|
if (gdi->osd.active && gdi->osd.hbm) {
|
||||||
BLENDFUNCTION bf = { 0 };
|
TransparentBlt(gdi->hdc, gdi->osd.x, gdi->osd.y, gdi->ledwidth, gdi->ledheight, gdi->osd.thdc, 0, 0, gdi->ledwidth, gdi->ledheight, 0x000000);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gdi_free(int monid, bool immediate)
|
void gdi_free(int monid, bool immediate)
|
||||||
{
|
{
|
||||||
struct gdistruct *gdi = &gdidata[monid];
|
struct gdistruct *gdi = &gdidata[monid];
|
||||||
|
gdi->enabled = 0;
|
||||||
freetexture(monid);
|
freetexture(monid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,9 +270,31 @@ static const TCHAR *gdi_init(HWND ahwnd, int monid, int w_w, int w_h, int depth,
|
|||||||
gdi->ledheight = TD_TOTAL_HEIGHT * gdi->statusbar_vx;
|
gdi->ledheight = TD_TOTAL_HEIGHT * gdi->statusbar_vx;
|
||||||
allocsprite(gdi, &gdi->osd, gdi->ledwidth, gdi->ledheight);
|
allocsprite(gdi, &gdi->osd, gdi->ledwidth, gdi->ledheight);
|
||||||
|
|
||||||
|
gdi->enabled = 1;
|
||||||
|
|
||||||
return NULL;
|
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)
|
void gdi_select(void)
|
||||||
{
|
{
|
||||||
@ -296,9 +317,9 @@ void gdi_select(void)
|
|||||||
D3D_showframe = gdi_showframe;
|
D3D_showframe = gdi_showframe;
|
||||||
D3D_showframe_special = NULL;
|
D3D_showframe_special = NULL;
|
||||||
D3D_guimode = gdi_guimode;
|
D3D_guimode = gdi_guimode;
|
||||||
D3D_getDC = NULL;
|
D3D_getDC = gdi_getDC;
|
||||||
D3D_isenabled = NULL;
|
D3D_isenabled = gdi_isenabled;
|
||||||
D3D_clear = NULL;
|
D3D_clear = gdi_clear;
|
||||||
D3D_canshaders = NULL;
|
D3D_canshaders = NULL;
|
||||||
D3D_goodenough = NULL;
|
D3D_goodenough = NULL;
|
||||||
D3D_setcursor = NULL;
|
D3D_setcursor = NULL;
|
||||||
|
|||||||
@ -90,9 +90,9 @@ static void write_tdnumber(uae_u8 *buf, int bpp, int x, int y, int num, uae_u32
|
|||||||
for (j = 0; j < td_numbers_width; j++) {
|
for (j = 0; j < td_numbers_width; j++) {
|
||||||
for (int k = 0; k < mult; k++) {
|
for (int k = 0; k < mult; k++) {
|
||||||
if (*numptr == 'x')
|
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 == '+')
|
else if (*numptr == '+')
|
||||||
putpixel(buf, NULL, bpp, x + j * mult + k, c2, 0);
|
putpixel(buf, NULL, bpp, x + j * mult + k, c2);
|
||||||
}
|
}
|
||||||
numptr++;
|
numptr++;
|
||||||
}
|
}
|
||||||
@ -171,7 +171,7 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
|
|||||||
y /= mult;
|
y /= mult;
|
||||||
|
|
||||||
c1 = ledcolor (0x00ffffff, rc, gc, bc, alpha);
|
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)
|
if (td_numbers_pos & TD_RIGHT)
|
||||||
x_start = totalwidth - (td_numbers_padx + VISIBLE_LEDS * td_width) * mult;
|
x_start = totalwidth - (td_numbers_padx + VISIBLE_LEDS * td_width) * mult;
|
||||||
@ -252,12 +252,12 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
|
|||||||
num2 = -1;
|
num2 = -1;
|
||||||
num3 = 16;
|
num3 = 16;
|
||||||
on_rgb = 0xcccccc;
|
on_rgb = 0xcccccc;
|
||||||
off_rgb = 0x000000;
|
off_rgb = 0x111111;
|
||||||
am = 2;
|
am = 2;
|
||||||
} else {
|
} else {
|
||||||
int fps = (gui_data.fps + 5) / 10;
|
int fps = (gui_data.fps + 5) / 10;
|
||||||
on_rgb = 0x000000;
|
on_rgb = 0x111111;
|
||||||
off_rgb = gui_data.fps_color == 1 ? 0xcccc00 : (gui_data.fps_color == 2 ? 0x0000cc : 0x000000);
|
off_rgb = gui_data.fps_color == 1 ? 0xcccc00 : (gui_data.fps_color == 2 ? 0x0000cc : 0x111111);
|
||||||
am = 3;
|
am = 3;
|
||||||
if (gui_data.fps_color >= 2) {
|
if (gui_data.fps_color >= 2) {
|
||||||
num1 = -1;
|
num1 = -1;
|
||||||
@ -289,12 +289,12 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
|
|||||||
int idle = (gui_data.idle + 5) / 10;
|
int idle = (gui_data.idle + 5) / 10;
|
||||||
pos = 1;
|
pos = 1;
|
||||||
on_rgb = 0xcc0000;
|
on_rgb = 0xcc0000;
|
||||||
off_rgb = 0x000000;
|
off_rgb = 0x111111;
|
||||||
if (gui_data.cpu_halted) {
|
if (gui_data.cpu_halted) {
|
||||||
idle = 0;
|
idle = 0;
|
||||||
on = 1;
|
on = 1;
|
||||||
if (gui_data.cpu_halted < 0) {
|
if (gui_data.cpu_halted < 0) {
|
||||||
on_rgb = 0x000000;
|
on_rgb = 0x111111;
|
||||||
num1 = 16; // PPC
|
num1 = 16; // PPC
|
||||||
num2 = 16;
|
num2 = 16;
|
||||||
num3 = 10;
|
num3 = 10;
|
||||||
@ -329,14 +329,14 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
|
|||||||
num2 = snd / 10;
|
num2 = snd / 10;
|
||||||
num3 = snd % 10;
|
num3 = snd % 10;
|
||||||
}
|
}
|
||||||
on_rgb = 0x000000;
|
on_rgb = 0x111111;
|
||||||
if (on < 0)
|
if (on < 0)
|
||||||
on_rgb = 0xcccc00; // underflow
|
on_rgb = 0xcccc00; // underflow
|
||||||
else if (on == 2)
|
else if (on == 2)
|
||||||
on_rgb = 0xcc0000; // really big overflow
|
on_rgb = 0xcc0000; // really big overflow
|
||||||
else if (on == 1)
|
else if (on == 1)
|
||||||
on_rgb = 0x0000cc; // "normal" overflow
|
on_rgb = 0x0000cc; // "normal" overflow
|
||||||
off_rgb = 0x000000;
|
off_rgb = 0x111111;
|
||||||
am = 3;
|
am = 3;
|
||||||
} else if (led == LED_MD) {
|
} else if (led == LED_MD) {
|
||||||
// DF3 reused as internal non-volatile ram led (cd32/cdtv)
|
// DF3 reused as internal non-volatile ram led (cd32/cdtv)
|
||||||
@ -362,7 +362,7 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
|
|||||||
on_rgb |= 0x00cc00;
|
on_rgb |= 0x00cc00;
|
||||||
if (on & 2)
|
if (on & 2)
|
||||||
on_rgb |= 0xcc0000;
|
on_rgb |= 0xcc0000;
|
||||||
off_rgb = 0x000000;
|
off_rgb = 0x111111;
|
||||||
num1 = -1;
|
num1 = -1;
|
||||||
num2 = -1;
|
num2 = -1;
|
||||||
num3 = 17;
|
num3 = 17;
|
||||||
@ -371,8 +371,8 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
|
|||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
on_rgb |= 0x33000000;
|
on_rgb |= 0x33111111;
|
||||||
off_rgb |= 0x33000000;
|
off_rgb |= 0x33111111;
|
||||||
if (half > 0) {
|
if (half > 0) {
|
||||||
int halfon = y >= TD_TOTAL_HEIGHT / 2;
|
int halfon = y >= TD_TOTAL_HEIGHT / 2;
|
||||||
c = ledcolor(on ? (halfon ? on_rgb2 : on_rgb) : off_rgb, rc, gc, bc, alpha);
|
c = ledcolor(on ? (halfon ? on_rgb2 : on_rgb) : off_rgb, rc, gc, bc, alpha);
|
||||||
@ -396,13 +396,13 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
|
|||||||
x = x_start + pos * td_width * mult;
|
x = x_start + pos * td_width * mult;
|
||||||
for (int xx = 0; xx < mult; xx++) {
|
for (int xx = 0; xx < mult; xx++) {
|
||||||
if (!border) {
|
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) {
|
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) {
|
if (!border) {
|
||||||
putpixel(buf, NULL, bpp, x + j + xx, cb, 0);
|
putpixel(buf, NULL, bpp, x + j + xx, cb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user