]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
lightpen_offset_gfx
authorToni Wilen <twilen@winuae.net>
Sat, 13 Dec 2025 10:27:24 +0000 (12:27 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 13 Dec 2025 10:27:24 +0000 (12:27 +0200)
cfgfile.cpp
drawing.cpp
include/options.h

index 5dac884aa79a4a587497d6c688d4c1502def1aaf..6f426b7ccf116bfe9b89f9199789e69cd4e50d90 100644 (file)
@@ -2629,7 +2629,8 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_dwrite_strarr(f, _T("monitoremu"), specialmonitorconfignames, p->monitoremu);
 #endif
        cfgfile_dwrite(f, _T("monitoremu_monitor"), _T("%d"), p->monitoremu_mon);
-       cfgfile_dwrite_coords(f, _T("lightpen_offset"), p->lightpen_offset[0], p->lightpen_offset[1]);
+       cfgfile_dwrite_coords(f, _T("lightpen_offset"), p->lightpen_offset[0][0], p->lightpen_offset[0][1]);
+       cfgfile_dwrite_coords(f, _T("lightpen_offset_gfx"), p->lightpen_offset[1][0], p->lightpen_offset[1][1]);
        cfgfile_dwrite_bool(f, _T("lightpen_crosshair"), p->lightpen_crosshair);
 
        cfgfile_dwrite_bool (f, _T("show_leds"), !!(p->leds_on_screen & STATUSLINE_CHIPSET));
@@ -5993,7 +5994,8 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                || cfgfile_yesno(option, value, _T("gfxcard_dacswitch"), &p->rtg_dacswitch)
                || cfgfile_yesno(option, value, _T("gfxcard_multithread"), &p->rtg_multithread)
                || cfgfile_yesno(option, value, _T("synchronize_clock"), &p->tod_hack)
-               || cfgfile_coords(option, value, _T("lightpen_offset"), &p->lightpen_offset[0], &p->lightpen_offset[1])
+               || cfgfile_coords(option, value, _T("lightpen_offset"), &p->lightpen_offset[0][0], &p->lightpen_offset[0][1])
+               || cfgfile_coords(option, value, _T("lightpen_offset_gfx"), &p->lightpen_offset[1][0], &p->lightpen_offset[1][1])
                || cfgfile_yesno(option, value, _T("lightpen_crosshair"), &p->lightpen_crosshair)
 
                || cfgfile_yesno(option, value, _T("kickshifter"), &p->kickshifter)
index c42041ce82d93748c601ac07b89b83eba55ac6e0..b7ca249dbd6374e6e0395a8ecef8d2ff14ff72bf 100644 (file)
@@ -1691,8 +1691,6 @@ static void init_drawing_frame(void)
        thisframe_last_drawn_line = -1;
 }
 
-static int lightpen_y1[2], lightpen_y2[2];
-
 void putpixel(uae_u8 *buf, uae_u8 *genlockbuf, int x, xcolnr c8)
 {
        if (x <= 0)
@@ -1808,12 +1806,12 @@ static const char *lightpen_cursor = {
        "------.....------"
        "------.xxx.------"
        "------.xxx.------"
-       "------.xxx.------"
-       ".......xxx......."
-       ".xxxxxxxxxxxxxxx."
-       ".xxxxxxxxxxxxxxx."
-       ".......xxx......."
-       "------.xxx.------"
+       "-------.x.-------"
+       "......-----......"
+       ".xxxx-------xxxx."
+       ".xxxx-------xxxx."
+       "......-----......"
+       "-------.x.-------"
        "------.xxx.------"
        "------.xxx.------"
        "------.....------"
@@ -1874,8 +1872,8 @@ static void lightpen_update(struct vidbuffer *vb, int lpnum)
        cy >>= linedbl;
        cy += minfirstline;
 
-       cx += currprefs.lightpen_offset[0];
-       cy += currprefs.lightpen_offset[1];
+       cx += currprefs.lightpen_offset[0][0];
+       cy += currprefs.lightpen_offset[0][1];
 
        if (cx <= 0x18 - 1) {
                cx = 0x18 - 1;
@@ -1893,21 +1891,20 @@ static void lightpen_update(struct vidbuffer *vb, int lpnum)
        if (currprefs.lightpen_crosshair && lightpen_active) {
                if (denise_lock()) {
                        for (int i = 0; i < LIGHTPEN_HEIGHT; i++) {
-                               int line = lightpen_y[lpnum] + i - LIGHTPEN_HEIGHT / 2;
+                               int line = lightpen_y[lpnum] + i - LIGHTPEN_HEIGHT / 2 + currprefs.lightpen_offset[1][1];
                                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);
+                                               draw_lightpen_cursor(vb->monitor_id, lightpen_x[lpnum] + currprefs.lightpen_offset[1][0], i, line, cx > 0, lpnum);
                                        }
                                }
                        }
                }
        }
 
-       lightpen_y1[lpnum] = lightpen_y[lpnum] - LIGHTPEN_HEIGHT / 2 - 1 + (thisframe_y_adjust_real >> linedbl);
-       lightpen_y2[lpnum] = lightpen_y1[lpnum] + LIGHTPEN_HEIGHT + 1 + (thisframe_y_adjust_real >> linedbl);
-
        lightpen_cx[lpnum] = out ? -1 : cx;
        lightpen_cy[lpnum] = out ? -1 : cy;
+
+       //write_log("%03d*%03d\n", cx, cy);
 }
 
 static void refresh_indicator_init(void)
@@ -2371,8 +2368,6 @@ void reset_drawing(void)
        init_drawing_frame();
 
        frame_res_cnt = currprefs.gfx_autoresolution_delay;
-       lightpen_y1[0] = lightpen_y2[0] = -1;
-       lightpen_y1[1] = lightpen_y2[1] = -1;
 
        reset_custom_limits();
 
index 5452f854c8f798007bacc87f2374966ba4b53431..07318fc0babf97f55f142292568ed257fcfbde02 100644 (file)
@@ -623,7 +623,7 @@ struct uae_prefs {
        int lightboost_strobo_ratio;
        bool gfx_grayscale;
        bool lightpen_crosshair;
-       int lightpen_offset[2];
+       int lightpen_offset[2][2];
        int gfx_display_sections;
        int gfx_variable_sync;
        bool gfx_windowed_resize;