From: Toni Wilen Date: Tue, 25 Mar 2025 16:09:45 +0000 (+0200) Subject: Debugger overlay support fix, genlock support. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=c568a57d8cf0fc683dbee79012c550b30aade324;p=francis%2Fwinuae.git Debugger overlay support fix, genlock support. --- diff --git a/debug.cpp b/debug.cpp index 391b5f16..4319b7d8 100644 --- a/debug.cpp +++ b/debug.cpp @@ -1465,12 +1465,16 @@ static uae_u32 ledcolor (uae_u32 c, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u return v; } -static void putpixel (uae_u8 *buf, int x, xcolnr c8) +static void putpixel(uae_u8 *buf, uae_u16 *genlockbuf, int x, xcolnr c8) { if (x <= 0) { return; } + if (genlockbuf) { + genlockbuf[x] = 1; + } + uae_u32 *p = (uae_u32*)buf + x; *p = c8; } @@ -1545,7 +1549,7 @@ static void set_debug_colors(void) static int cycles_toggle; -static void debug_draw_cycles(uae_u8 *buf, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors) +static void debug_draw_cycles(uae_u8 *buf, uae_u16 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors) { int y, x, xx, dx, xplus, yplus; struct dma_rec *dr; @@ -1607,21 +1611,21 @@ static void debug_draw_cycles(uae_u8 *buf, int line, int width, int height, uae_ } if (dr->intlev > intlev) intlev = dr->intlev; - putpixel(buf, xx + 4, c); + putpixel(buf, genlock, xx + 4, c); if (xplus > 1) - putpixel(buf, xx + 4 + 1, c); + putpixel(buf, genlock, xx + 4 + 1, c); if (xplus > 2) - putpixel(buf, xx + 4 + 2, c); + putpixel(buf, genlock, xx + 4 + 2, c); dr++; if (dr->hpos == 0) { break; } } - putpixel (buf, dx + 0, 0); - putpixel (buf, dx + 1, lc(intlevc[intlev])); - putpixel (buf, dx + 2, lc(intlevc[intlev])); - putpixel (buf, dx + 3, 0); + putpixel(buf, genlock, dx + 0, 0); + putpixel(buf, genlock, dx + 1, lc(intlevc[intlev])); + putpixel(buf, genlock, dx + 2, lc(intlevc[intlev])); + putpixel(buf, genlock, dx + 3, 0); } #define HEATMAP_WIDTH 256 @@ -1640,7 +1644,7 @@ struct memory_heatmap uae_u16 type, extra; }; -static void debug_draw_heatmap(uae_u8 *buf, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors) +static void debug_draw_heatmap(uae_u8 *buf, uae_u16 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors) { struct memory_heatmap *mht = heatmap; int dx = 16; @@ -1655,14 +1659,14 @@ static void debug_draw_heatmap(uae_u8 *buf, int line, int width, int height, uae uae_u32 c = heatmap_debug_colors[mht->cnt * DMARECORD_MAX + mht->type]; //c = heatmap_debug_colors[(HEATMAP_COUNT - 1) * DMARECORD_MAX + DMARECORD_CPU_I]; int xx = x + dx; - putpixel(buf, xx, c); + putpixel(buf, genlock, xx, c); if (mht->cnt > 0) mht->cnt--; mht++; } } -void debug_draw(uae_u8 *buf, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors) +void debug_draw(uae_u8 *buf, uae_u16 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors) { if (!heatmap_debug_colors) { heatmap_debug_colors = xcalloc(uae_u32, DMARECORD_MAX * HEATMAP_COUNT); @@ -1682,9 +1686,9 @@ void debug_draw(uae_u8 *buf, int line, int width, int height, uae_u32 *xredcolor } if (heatmap) { - debug_draw_heatmap(buf, line, width, height, xredcolors, xgreencolors, xbluecolors); + debug_draw_heatmap(buf, genlock, line, width, height, xredcolors, xgreencolors, xbluecolors); } else if (dma_record_data) { - debug_draw_cycles(buf, line, width, height, xredcolors, xgreencolors, xbluecolors); + debug_draw_cycles(buf, genlock, line, width, height, xredcolors, xgreencolors, xbluecolors); } } diff --git a/drawing.cpp b/drawing.cpp index 3a513d36..48825656 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -1564,7 +1564,7 @@ static void draw_debug_status_line(int monid, int line) struct vidbuf_description *vidinfo = &adisplays[monid].gfxvidinfo; xlinebuffer = row_map[line]; xlinebuffer_genlock = row_map_genlock[line]; - debug_draw(xlinebuffer, line, vidinfo->inbuffer->outwidth, vidinfo->inbuffer->outheight, xredcolors, xgreencolors, xbluecolors); + debug_draw(xlinebuffer, xlinebuffer_genlock, line, vidinfo->inbuffer->outwidth, vidinfo->inbuffer->outheight, xredcolors, xgreencolors, xbluecolors); } #define LIGHTPEN_HEIGHT 12 @@ -4883,6 +4883,14 @@ void set_drawbuffer(void) if (vidinfo->tempbuffer.bufmem && !drawing_can_lineoptimizations()) { vidinfo->inbuffer = &vidinfo->tempbuffer; + struct vidbuffer *vb = &vidinfo->tempbuffer; + if (!vb->outwidth || !vb->outheight) { + struct vidbuffer *vb2 = &vidinfo->drawbuffer; + vb->outwidth = vb2->outwidth; + vb->outheight = vb2->outheight; + vb->inwidth = vb2->inwidth; + vb->inheight = vb2->inheight; + } } else { vidinfo->inbuffer = &vidinfo->drawbuffer; }