From 35a7bb01931be1bdeac41e298e071babd87cee19 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 30 Nov 2025 12:12:03 +0200 Subject: [PATCH] Fix lightpen without crosshair blank screen --- custom.cpp | 1 + drawing.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/custom.cpp b/custom.cpp index 8887471d..0b218a16 100644 --- a/custom.cpp +++ b/custom.cpp @@ -5414,6 +5414,7 @@ static void vsync_handler_post(void) vsync_cycles = get_cycles(); vhposr_prev = 0xffffffff; + lineoptimizations_draw_always = drawing_can_lineoptimizations() == false; } static void copper_check(int n) diff --git a/drawing.cpp b/drawing.cpp index 40e30bdb..00a4f85f 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -1886,11 +1886,11 @@ static void lightpen_update(struct vidbuffer *vb, int lpnum) } if (currprefs.lightpen_crosshair && lightpen_active) { - for (int i = 0; i < LIGHTPEN_HEIGHT; i++) { - int line = lightpen_y[lpnum] + i - LIGHTPEN_HEIGHT / 2; - if (line >= 0 && line < max_ypos_thisframe1) { - if (lightpen_active & (1 << lpnum)) { - if (denise_lock()) { + if (denise_lock()) { + for (int i = 0; i < LIGHTPEN_HEIGHT; i++) { + int line = lightpen_y[lpnum] + i - LIGHTPEN_HEIGHT / 2; + if (line >= 0 && line < max_ypos_thisframe1) { + if (lightpen_active & (1 << lpnum)) { draw_lightpen_cursor(vb->monitor_id, lightpen_x[lpnum], i, line, cx > 0, lpnum); } } @@ -1929,7 +1929,7 @@ bool drawing_can_lineoptimizations(void) currprefs.cs_color_burst || currprefs.gfx_grayscale || currprefs.monitoremu) { return false; } - if (lightpen_active || debug_dma >= 2 || debug_heatmap >= 2) { + if ((lightpen_active && currprefs.lightpen_crosshair) || debug_dma >= 2 || debug_heatmap >= 2) { return false; } return true; -- 2.47.3