]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix lightpen without crosshair blank screen
authorToni Wilen <twilen@winuae.net>
Sun, 30 Nov 2025 10:12:03 +0000 (12:12 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 30 Nov 2025 10:12:03 +0000 (12:12 +0200)
custom.cpp
drawing.cpp

index 8887471d1644d6bfc9f0da47888c9837f1918e8f..0b218a162d485e4a51ab56627459c31459b7fe63 100644 (file)
@@ -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)
index 40e30bdb67dc0e6cdfb23a0d60eb679b4ca07bfd..00a4f85f036e00c593e4f50f9f2aca7e0d314c02 100644 (file)
@@ -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;