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;
}
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;
}
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
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;
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);
}
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);
}
}
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
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;
}