]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix fast mode drawing horizontal centering, fast mode slightly optimized.
authorToni Wilen <twilen@winuae.net>
Sat, 11 Oct 2025 14:34:59 +0000 (17:34 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 11 Oct 2025 14:34:59 +0000 (17:34 +0300)
drawing.cpp
genlinetoscr.cpp
linetoscr_aga_fast.cpp
linetoscr_aga_genlock_fast.cpp
linetoscr_ecs_fast.cpp
linetoscr_ecs_genlock_fast.cpp

index 9cdf2871e6dd9d7b823304492f682c847c282fcc..1b344c381d621ee8e0c9e8e0d9f6367bf13d19af 100644 (file)
@@ -396,7 +396,7 @@ static struct denise_rga rga_denise_fast[DENISE_RGA_SLOT_FAST_TOTAL];
 typedef void (*LINETOSRC_FUNC)(void);
 static LINETOSRC_FUNC lts;
 static bool lts_changed, lts_request;
-typedef void (*LINETOSRC_FUNCF)(int,int,int,int,int,int,int,int,int,uae_u32,uae_u8*,uae_u8*,int,int*,int,struct linestate*);
+typedef void (*LINETOSRC_FUNCF)(int,int,int,int,int,int,int,int,uae_u32,uae_u8**,uae_u8**,int,int*,int,struct linestate*);
 
 static int denise_hcounter, denise_hcounter_next, denise_hcounter_new, denise_hcounter_prev, denise_hcounter_cmp;
 static bool denise_accurate_mode;
@@ -463,7 +463,7 @@ static int aga_delayed_color_idx;
 static uae_u16 aga_delayed_color_val, aga_delayed_color_con2, aga_delayed_color_con3;
 static int aga_unalign0, aga_unalign1, bpl1dat_unalign, reswitch_unalign;
 static uae_u8 loaded_pix, loaded_pixs[4];
-static int hresolution, hresolution_add;
+static int hresolution, hresolution_inv, hresolution_add;
 static bool denise_sprite_blank_active;
 static int delayed_sprite_vblank_ecs;
 static bool denise_burst;
@@ -955,8 +955,8 @@ int get_custom_limits(int *pw, int *ph, int *pdx, int *pdy, int *prealh, int *hr
        w = diwlast - diwfirst;
        dx = diwfirst - (hdisplay_left_border << (RES_MAX + 1)) + (1 << RES_MAX);
 
-       w >>= (RES_MAX - hresolution);
-       dx >>= (RES_MAX - hresolution);
+       w >>= hresolution_inv;
+       dx >>= hresolution_inv;
 
        y2 = plflastline_total;
        y1 = plffirstline_total;
@@ -1358,7 +1358,7 @@ static bool cancenter(void)
                        fd->gfx_filter_autoscale != AUTOSCALE_CENTER);
 }
 
-static void center_image (void)
+static void center_image(void)
 {
        struct amigadisplay *ad = &adisplays[0];
        struct vidbuf_description *vidinfo = &ad->gfxvidinfo;
@@ -1371,16 +1371,16 @@ static void center_image (void)
 
        int w = vidinfo->inbuffer->inwidth;
        int ew = vidinfo->inbuffer->extrawidth;
-       int maxdiw = denisehtotal >> (RES_MAX - currprefs.gfx_resolution);
+       int maxdiw = denisehtotal >> hresolution_inv;
        int xoffset = 0;
 
-       if (currprefs.gfx_overscanmode <= OVERSCANMODE_OVERSCAN && diwlastword_total > 0 && diwlastword_total > diwfirstword_total  && cancenter()) {
+       if (currprefs.gfx_overscanmode <= OVERSCANMODE_OVERSCAN && diwlastword_total > 0 && diwlastword_total > diwfirstword_total && cancenter()) {
 
                visible_left_border = maxdiw - w;
                visible_left_border &= ~((xshift(1, 0)) - 1);
 
-               int ww = (diwlastword_total - diwfirstword_total) >> (RES_MAX - hresolution);
-               int wx = ((diwfirstword_total) >> (RES_MAX - hresolution)) - visible_left_border / 2;
+               int ww = (diwlastword_total - diwfirstword_total) >> hresolution_inv;
+               int wx = ((diwfirstword_total) >> hresolution_inv) - (((hdisplay_left_border - 1) * 4) >> (hresolution_inv + (doublescan == 1 ? 1 : 0)));
 
                if (ww < w && currprefs.gfx_xcenter == 2) {
                        /* Try to center. */
@@ -2984,7 +2984,7 @@ static void update_hblank(void)
 
 static void update_sprres_set(void)
 {
-       denise_spr_add = 1 << (RES_MAX - hresolution);
+       denise_spr_add = 1 << hresolution_inv;
        denise_spr_shiftsize = 1 << (RES_SUPERHIRES - denise_sprres);
 }
 
@@ -3179,6 +3179,7 @@ static void sethresolution(void)
                        hresolution = RES_SUPERHIRES;
                }
        }
+       hresolution_inv = RES_MAX - hresolution;
 }
 
 static void setlasthamcolor(void)
@@ -5682,7 +5683,7 @@ static void draw_denise_line(int gfx_ypos, enum nln_how how, uae_u32 linecnt, in
                        }
                }
 #endif
-               int rshift = RES_MAX - hresolution;
+               int rshift = hresolution_inv;
                int hbstrt_offset2 = (hbstrt_offset - internal_pixel_start_cnt) >> rshift;
                int hbstop_offset2 = (hbstop_offset - internal_pixel_start_cnt) >> rshift;
                uae_u32 *hbstrt_ptr1 = hbstrt_offset2 >= 0 ? buf1t + hbstrt_offset2 : NULL;
@@ -6099,7 +6100,7 @@ static void lts_unaligned_aga(int cnt, int cnt_next, int h)
 
        int dpixcnt = 0;
 
-       int xshift = RES_MAX - hresolution;
+       int xshift = hresolution_inv;
        int xadd = 1 << xshift;
        int denise_res_size2 = denise_res_size << xshift;
        if (denise_res > hresolution) {
@@ -6763,7 +6764,7 @@ void draw_denise_border_line_fast(int gfx_ypos, enum nln_how how, struct linesta
        uae_u32 *buf2p = buf2 != buf1 ? buf2 : NULL;
        uae_u8 *gbufp = gbuf;
 
-       int rshift = RES_MAX - hresolution;
+       int rshift = hresolution_inv;
 
        bool ecsena = ecs_denise && (ls->bplcon0 & 1) != 0;
        bool brdblank = (ls->bplcon3 & 0x20) && ecsena;
@@ -6812,6 +6813,31 @@ void draw_denise_border_line_fast(int gfx_ypos, enum nln_how how, struct linesta
 
 }
 
+static int ltsf_init(int draw_start, int draw_startoffset, int *draw_end, int hbstrt_offset, int hbstop_offset)
+{
+       int end = *draw_end;
+       if (end > hbstrt_offset) {
+               end = hbstrt_offset;
+       }
+       int cnt = *draw_end;
+       if (cnt > draw_startoffset) {
+               cnt = draw_startoffset;
+       }
+       if (cnt > hbstop_offset && hbstop_offset >= draw_start) {
+               cnt = hbstop_offset;
+       }
+       if (cnt > bpl1dat_trigger_offset && bpl1dat_trigger_offset >= draw_start) {
+               cnt = bpl1dat_trigger_offset;
+       }
+       int max = addrdiff(xlinebuffer_end, (uae_u8*)buf1) / sizeof(uae_u32);
+       int w = end - cnt;
+       if (w > max) {
+               end -= w - max;
+       }
+       *draw_end = end;
+       return cnt;
+}
+
 void draw_denise_bitplane_line_fast(int gfx_ypos, enum nln_how how, struct linestate *ls)
 {
        if (ls->strlong_seen) {
@@ -6937,7 +6963,7 @@ void draw_denise_bitplane_line_fast(int gfx_ypos, enum nln_how how, struct lines
        }
 
        int doubling = hresolution - res;
-       int rshift = RES_MAX - hresolution;
+       int rshift = hresolution_inv;
 
        int delay1 = (ls->bplcon1 & 0x0f) | ((ls->bplcon1 & 0x0c00) >> 6);
        int delaymask = (fmode >> res) - 1;
@@ -6988,12 +7014,11 @@ void draw_denise_bitplane_line_fast(int gfx_ypos, enum nln_how how, struct lines
        int draw_end = ls->internal_pixel_cnt >> rshift;
        int draw_startoffset = ls->internal_pixel_start_cnt >> rshift;
 
-
-       //write_log("%03d %03d %03d %03d %03d %03d %03d\n", vpos, hbstop_offset, hbstrt_offset, hstrt_offset, hstop_offset, bpl1dat_trigger_offset, delayoffset);
-
-       uae_u8 bxor = ls->bplcon4 >> 8;
-       buf1 = buf1p;
-       buf2 = buf2p;
+#if 0
+       if (gfx_ypos == 100)
+               write_log("%p %03d %03d %03d %03d %03d %03d %03d %03d %03d %03d\n",
+                       buf1p, gfx_ypos, hbstop_offset, hbstrt_offset, hstrt_offset, hstop_offset, bpl1dat_trigger_offset, draw_start, draw_end, draw_startoffset, delayoffset);
+#endif
 
        int cpadd = doubling < 0 ? (doubling < -1 ? 2 : 1) : 0;
        int bufadd = doubling > 0 ? (doubling > 1 ? 2 : 1) : 0;
@@ -7006,7 +7031,7 @@ void draw_denise_bitplane_line_fast(int gfx_ypos, enum nln_how how, struct lines
                subpix = 0;
        } else if (doubling == 0) {
                cpadds[0] = 1 << cpadd;
-               subpix >>= RES_MAX - hresolution;
+               subpix >>= hresolution_inv;
                cp -= subpix;
                cp2 -= subpix;
        } else if (doubling == 1) {
@@ -7035,8 +7060,24 @@ void draw_denise_bitplane_line_fast(int gfx_ypos, enum nln_how how, struct lines
 
 #if 1
        
-       ltsf(draw_start, draw_end, draw_startoffset, hbstrt_offset, hbstop_offset, hstrt_offset, hstop_offset, bpl1dat_trigger_offset,
-               planecnt, bgcol, cp, cp2, cpadd, cpadds, bufadd, ls);
+       buf1 = buf1p;
+       buf2 = buf2p;
+
+       // if horizontal shift is large enough to skip part of hdiw or bitplane, draw them to temp buffer.
+       if (draw_startoffset > bpl1dat_trigger_offset || draw_startoffset > hbstop_offset || draw_startoffset > hstrt_offset) {
+               buf1 = (uae_u32*)row_tmp8;
+               buf2 = (uae_u32*)row_tmp8;
+               int end = draw_startoffset;
+               int cnt = ltsf_init(draw_start, draw_startoffset, &end, hbstrt_offset, hbstop_offset);
+               ltsf(cnt, end, hbstrt_offset, hbstop_offset, hstrt_offset, hstop_offset, bpl1dat_trigger_offset,
+                       planecnt, bgcol, &cp, &cp2, 1 << cpadd, cpadds, 1 << bufadd, ls);
+               draw_start = draw_startoffset;
+               buf1 = buf1p;
+               buf2 = buf2p;
+       }
+       int cnt = ltsf_init(draw_start, draw_startoffset, &draw_end, hbstrt_offset, hbstop_offset);
+       ltsf(cnt, draw_end, hbstrt_offset, hbstop_offset, hstrt_offset, hstop_offset, bpl1dat_trigger_offset,
+               planecnt, bgcol, &cp, &cp2, 1 << cpadd, cpadds, 1 << bufadd, ls);
 
 #if 0
        *buf1++ = 0;
index 3816b66267d9bb34989a3e38c4c334b368077cba..b43a65b3cb28cad18349388dfb2bb85e4b2d6cf6 100644 (file)
@@ -994,10 +994,13 @@ static bool gen_fasthead(void)
                }
        }
 
-       outf("static void %s(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,"
-               "int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)", funcname);
+       outf("static void %s(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,"
+               "int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)", funcname);
        outf("{");
 
+       outf("uae_u8 *cp = *cpp;");
+       outf("uae_u8 *cp2 = *cp2p;");
+
        // shres on lores is useless
        if (res == 2 && outres == 0) {
                return false;
@@ -1166,32 +1169,13 @@ static void gen_fastdraw(void)
        if (aga) {
                outf("uae_u8 bxor = ls->bplcon4 >> 8;");
        }
-       outf("int bufaddv = 1 << bufadd;");
-       outf("int cpaddv = 1 << cpadd;");
        if (genlock) {
                outf("uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);");
        }
 
-       outf("int end = draw_end;");
-       outf("if (end > hbstrt_offset) {");
-       outf("  end = hbstrt_offset;");
-       outf("}");
-
-       outf("int cnt = draw_end;");
-       outf("if (cnt > draw_startoffset) {");
-       outf("  cnt = draw_startoffset;");
-       outf("}");
-       outf("if (cnt > hbstop_offset) {");
-       outf("  cnt = hbstop_offset;");
-       outf("}");
-       outf("if (cnt > bpl1dat_trigger_offset) {");
-       outf("  cnt = bpl1dat_trigger_offset;");
-       outf("}");
-
-       outf("while (cnt < end) {");
+       outf("while (cnt < draw_end) {");
        outf("  bool bpl = false;");
        outf("  if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {");
-       outf("          if (cnt >= draw_startoffset) {");
        outf("          if (cnt < hbstop_offset) {");
        if (doubling <= 0) {
                outf("buf1++;");
@@ -1256,7 +1240,6 @@ static void gen_fastdraw(void)
                        outf("*gbuf++ = gpix;");
                }
        }
-       outf("}");
        outf("  }");
        outf("} else {");
        outf("bpl = true;");
@@ -1281,6 +1264,9 @@ static void gen_fastdraw(void)
        outf("}");
        outf("cnt += bufaddv;");
        outf("}");
+
+       outf("*cpp = cp;");
+       outf("*cp2p = cp2;");
 }
 
 static void gen_null(void)
index 990efe1b0b79da00788ca572e033151d11e9a9cb..899d06fcc675f9f5d39feaecdf719cf083c30334 100644 (file)
@@ -4,36 +4,20 @@
 * This file was generated by genlinetoscr. Don't edit.
 */
 
-static void lts_aga_n_ilores_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -51,41 +35,29 @@ static void lts_aga_n_ilores_dlores_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -109,41 +81,29 @@ static void lts_aga_dpf_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -166,41 +126,29 @@ static void lts_aga_ehb_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -217,41 +165,29 @@ static void lts_aga_ham_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -269,41 +205,29 @@ static void lts_aga_kehb_ilores_dlores_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -323,37 +247,23 @@ static void lts_aga_n_ihires_dlores_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -377,37 +287,23 @@ static void lts_aga_n_ihires_dlores_b1_filtered(int draw_start, int draw_end, in
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -433,37 +329,23 @@ static void lts_aga_dpf_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -499,37 +381,23 @@ static void lts_aga_dpf_ihires_dlores_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -554,37 +422,23 @@ static void lts_aga_ehb_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -618,37 +472,23 @@ static void lts_aga_ehb_ihires_dlores_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -668,37 +508,23 @@ static void lts_aga_ham_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -720,37 +546,23 @@ static void lts_aga_ham_ihires_dlores_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -770,37 +582,23 @@ static void lts_aga_kehb_ihires_dlores_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -824,78 +622,84 @@ static void lts_aga_kehb_ihires_dlores_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ilores_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -919,42 +723,30 @@ static void lts_aga_n_ilores_dhires_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -990,42 +782,30 @@ static void lts_aga_dpf_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1059,42 +839,30 @@ static void lts_aga_ehb_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1116,42 +884,30 @@ static void lts_aga_ham_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1175,41 +931,29 @@ static void lts_aga_kehb_ilores_dhires_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1227,41 +971,29 @@ static void lts_aga_n_ihires_dhires_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ihires_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1285,41 +1017,29 @@ static void lts_aga_dpf_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ihires_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1342,41 +1062,29 @@ static void lts_aga_ehb_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ihires_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1393,41 +1101,29 @@ static void lts_aga_ham_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ihires_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1445,41 +1141,29 @@ static void lts_aga_kehb_ihires_dhires_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1499,37 +1183,23 @@ static void lts_aga_n_ishres_dhires_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1553,37 +1223,23 @@ static void lts_aga_n_ishres_dhires_b1_filtered(int draw_start, int draw_end, in
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1609,37 +1265,23 @@ static void lts_aga_dpf_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1675,37 +1317,23 @@ static void lts_aga_dpf_ishres_dhires_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1730,37 +1358,23 @@ static void lts_aga_ehb_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1794,37 +1408,23 @@ static void lts_aga_ehb_ishres_dhires_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1844,37 +1444,23 @@ static void lts_aga_ham_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1896,37 +1482,23 @@ static void lts_aga_ham_ishres_dhires_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1946,37 +1518,23 @@ static void lts_aga_kehb_ishres_dhires_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2000,40 +1558,26 @@ static void lts_aga_kehb_ishres_dhires_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2069,44 +1613,32 @@ static void lts_aga_n_ilores_dshres_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2166,44 +1698,32 @@ static void lts_aga_dpf_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2259,44 +1779,32 @@ static void lts_aga_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2328,44 +1836,32 @@ static void lts_aga_ham_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2401,42 +1897,30 @@ static void lts_aga_kehb_ilores_dshres_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2460,42 +1944,30 @@ static void lts_aga_n_ihires_dshres_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ihires_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2531,42 +2003,30 @@ static void lts_aga_dpf_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ihires_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2600,42 +2060,30 @@ static void lts_aga_ehb_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ihires_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2657,42 +2105,30 @@ static void lts_aga_ham_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ihires_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2716,41 +2152,29 @@ static void lts_aga_kehb_ihires_dshres_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2768,41 +2192,29 @@ static void lts_aga_n_ishres_dshres_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2826,41 +2238,29 @@ static void lts_aga_dpf_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2883,41 +2283,29 @@ static void lts_aga_ehb_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2934,41 +2322,29 @@ static void lts_aga_ham_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2986,43 +2362,31 @@ static void lts_aga_kehb_ishres_dshres_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ilores_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3041,43 +2405,31 @@ static void lts_aga_n_ilores_dlores_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3102,43 +2454,31 @@ static void lts_aga_dpf_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3162,43 +2502,31 @@ static void lts_aga_ehb_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3216,43 +2544,31 @@ static void lts_aga_ham_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3271,43 +2587,31 @@ static void lts_aga_kehb_ilores_dlores_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3328,39 +2632,25 @@ static void lts_aga_n_ihires_dlores_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3385,39 +2675,25 @@ static void lts_aga_n_ihires_dlores_b2_filtered(int draw_start, int draw_end, in
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
-       uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
+       uae_u8 bxor = ls->bplcon4 >> 8;
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3444,39 +2720,25 @@ static void lts_aga_dpf_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3513,39 +2775,25 @@ static void lts_aga_dpf_ihires_dlores_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3571,39 +2819,25 @@ static void lts_aga_ehb_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3638,39 +2872,25 @@ static void lts_aga_ehb_ihires_dlores_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3691,39 +2911,25 @@ static void lts_aga_ham_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3746,39 +2952,25 @@ static void lts_aga_ham_ihires_dlores_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3799,39 +2991,25 @@ static void lts_aga_kehb_ihires_dlores_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3856,81 +3034,87 @@ static void lts_aga_kehb_ihires_dlores_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ilores_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3956,45 +3140,33 @@ static void lts_aga_n_ilores_dhires_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4032,45 +3204,33 @@ static void lts_aga_dpf_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4106,45 +3266,33 @@ static void lts_aga_ehb_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4168,45 +3316,33 @@ static void lts_aga_ham_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4232,43 +3368,31 @@ static void lts_aga_kehb_ilores_dhires_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4287,43 +3411,31 @@ static void lts_aga_n_ihires_dhires_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ihires_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4348,43 +3460,31 @@ static void lts_aga_dpf_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ihires_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4408,43 +3508,31 @@ static void lts_aga_ehb_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ihires_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4462,43 +3550,31 @@ static void lts_aga_ham_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ihires_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4517,43 +3593,31 @@ static void lts_aga_kehb_ihires_dhires_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4574,39 +3638,25 @@ static void lts_aga_n_ishres_dhires_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4631,39 +3681,25 @@ static void lts_aga_n_ishres_dhires_b2_filtered(int draw_start, int draw_end, in
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4690,39 +3726,25 @@ static void lts_aga_dpf_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4759,39 +3781,25 @@ static void lts_aga_dpf_ishres_dhires_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4817,39 +3825,25 @@ static void lts_aga_ehb_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4884,39 +3878,25 @@ static void lts_aga_ehb_ishres_dhires_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4937,39 +3917,25 @@ static void lts_aga_ham_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4992,39 +3958,25 @@ static void lts_aga_ham_ishres_dhires_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5045,39 +3997,25 @@ static void lts_aga_kehb_ishres_dhires_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5102,45 +4040,31 @@ static void lts_aga_kehb_ishres_dhires_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5180,49 +4104,37 @@ static void lts_aga_n_ilores_dshres_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5286,49 +4198,37 @@ static void lts_aga_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5388,49 +4288,37 @@ static void lts_aga_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5466,49 +4354,37 @@ static void lts_aga_ham_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5548,45 +4424,33 @@ static void lts_aga_kehb_ilores_dshres_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5612,45 +4476,33 @@ static void lts_aga_n_ihires_dshres_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ihires_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5688,45 +4540,33 @@ static void lts_aga_dpf_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ihires_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5762,45 +4602,33 @@ static void lts_aga_ehb_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ihires_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5824,45 +4652,33 @@ static void lts_aga_ham_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ihires_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5888,43 +4704,31 @@ static void lts_aga_kehb_ihires_dshres_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5943,43 +4747,31 @@ static void lts_aga_n_ishres_dshres_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -6004,43 +4796,31 @@ static void lts_aga_dpf_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -6064,43 +4844,31 @@ static void lts_aga_ehb_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -6118,43 +4886,31 @@ static void lts_aga_ham_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -6173,9 +4929,13 @@ static void lts_aga_kehb_ishres_dshres_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
 static LINETOSRC_FUNCF linetoscr_aga_fast_funcs[] = {
index d2598cd21671df5984e2cf6e5236828a71cadfc2..09713c95d7b44cdbdfa64ffa56ce6751c8aa0992 100644 (file)
@@ -4,39 +4,23 @@
 * This file was generated by genlinetoscr. Don't edit.
 */
 
-static void lts_aga_n_ilores_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -56,44 +40,32 @@ static void lts_aga_n_ilores_dlores_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -119,44 +91,32 @@ static void lts_aga_dpf_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -181,44 +141,32 @@ static void lts_aga_ehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -237,44 +185,32 @@ static void lts_aga_ham_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -294,44 +230,32 @@ static void lts_aga_kehb_ilores_dlores_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -353,40 +277,26 @@ static void lts_aga_n_ihires_dlores_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -412,40 +322,26 @@ static void lts_aga_n_ihires_dlores_b1_filtered_genlock(int draw_start, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -473,40 +369,26 @@ static void lts_aga_dpf_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -544,40 +426,26 @@ static void lts_aga_dpf_ihires_dlores_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -604,40 +472,26 @@ static void lts_aga_ehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -673,40 +527,26 @@ static void lts_aga_ehb_ihires_dlores_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -728,40 +568,26 @@ static void lts_aga_ham_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -785,40 +611,26 @@ static void lts_aga_ham_ihires_dlores_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -840,40 +652,26 @@ static void lts_aga_kehb_ihires_dlores_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -899,82 +697,88 @@ static void lts_aga_kehb_ihires_dlores_b1_filtered_genlock(int draw_start, int d
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ilores_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1002,46 +806,34 @@ static void lts_aga_n_ilores_dhires_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1081,46 +873,34 @@ static void lts_aga_dpf_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1158,46 +938,34 @@ static void lts_aga_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1223,46 +991,34 @@ static void lts_aga_ham_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1290,44 +1046,32 @@ static void lts_aga_kehb_ilores_dhires_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1347,44 +1091,32 @@ static void lts_aga_n_ihires_dhires_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ihires_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1410,44 +1142,32 @@ static void lts_aga_dpf_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1472,44 +1192,32 @@ static void lts_aga_ehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ihires_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1528,44 +1236,32 @@ static void lts_aga_ham_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1585,44 +1281,32 @@ static void lts_aga_kehb_ihires_dhires_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1644,40 +1328,26 @@ static void lts_aga_n_ishres_dhires_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1703,40 +1373,26 @@ static void lts_aga_n_ishres_dhires_b1_filtered_genlock(int draw_start, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1764,40 +1420,26 @@ static void lts_aga_dpf_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1835,40 +1477,26 @@ static void lts_aga_dpf_ishres_dhires_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1895,40 +1523,26 @@ static void lts_aga_ehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1964,40 +1578,26 @@ static void lts_aga_ehb_ishres_dhires_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2019,40 +1619,26 @@ static void lts_aga_ham_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2076,40 +1662,26 @@ static void lts_aga_ham_ishres_dhires_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2131,40 +1703,26 @@ static void lts_aga_kehb_ishres_dhires_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2190,46 +1748,32 @@ static void lts_aga_kehb_ishres_dhires_b1_filtered_genlock(int draw_start, int d
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2273,50 +1817,38 @@ static void lts_aga_n_ilores_dshres_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2384,50 +1916,38 @@ static void lts_aga_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2491,50 +2011,38 @@ static void lts_aga_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2574,50 +2082,38 @@ static void lts_aga_ham_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2661,46 +2157,34 @@ static void lts_aga_kehb_ilores_dshres_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2728,46 +2212,34 @@ static void lts_aga_n_ihires_dshres_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ihires_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2807,46 +2279,34 @@ static void lts_aga_dpf_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2884,46 +2344,34 @@ static void lts_aga_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ihires_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2949,46 +2397,34 @@ static void lts_aga_ham_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3016,44 +2452,32 @@ static void lts_aga_kehb_ihires_dshres_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3073,44 +2497,32 @@ static void lts_aga_n_ishres_dshres_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3136,44 +2548,32 @@ static void lts_aga_dpf_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3198,44 +2598,32 @@ static void lts_aga_ehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3254,44 +2642,32 @@ static void lts_aga_ham_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3311,46 +2687,34 @@ static void lts_aga_kehb_ishres_dshres_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ilores_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3371,46 +2735,34 @@ static void lts_aga_n_ilores_dlores_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3437,46 +2789,34 @@ static void lts_aga_dpf_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3502,46 +2842,34 @@ static void lts_aga_ehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3561,46 +2889,34 @@ static void lts_aga_ham_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3621,46 +2937,34 @@ static void lts_aga_kehb_ilores_dlores_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3683,42 +2987,28 @@ static void lts_aga_n_ihires_dlores_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3745,42 +3035,28 @@ static void lts_aga_n_ihires_dlores_b2_filtered_genlock(int draw_start, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       uae_u8 bxor = ls->bplcon4 >> 8;
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3809,42 +3085,28 @@ static void lts_aga_dpf_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3883,42 +3145,28 @@ static void lts_aga_dpf_ihires_dlores_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3946,42 +3194,28 @@ static void lts_aga_ehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4018,42 +3252,28 @@ static void lts_aga_ehb_ihires_dlores_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4076,42 +3296,28 @@ static void lts_aga_ham_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4136,42 +3342,28 @@ static void lts_aga_ham_ihires_dlores_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4194,42 +3386,28 @@ static void lts_aga_kehb_ihires_dlores_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4256,85 +3434,91 @@ static void lts_aga_kehb_ihires_dlores_b2_filtered_genlock(int draw_start, int d
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ilores_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4364,49 +3548,37 @@ static void lts_aga_n_ilores_dhires_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4448,49 +3620,37 @@ static void lts_aga_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4530,49 +3690,37 @@ static void lts_aga_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4600,49 +3748,37 @@ static void lts_aga_ham_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4672,46 +3808,34 @@ static void lts_aga_kehb_ilores_dhires_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4732,46 +3856,34 @@ static void lts_aga_n_ihires_dhires_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ihires_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4798,46 +3910,34 @@ static void lts_aga_dpf_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4863,46 +3963,34 @@ static void lts_aga_ehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ihires_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4922,46 +4010,34 @@ static void lts_aga_ham_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4982,46 +4058,34 @@ static void lts_aga_kehb_ihires_dhires_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5044,42 +4108,28 @@ static void lts_aga_n_ishres_dhires_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5106,42 +4156,28 @@ static void lts_aga_n_ishres_dhires_b2_filtered_genlock(int draw_start, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5170,42 +4206,28 @@ static void lts_aga_dpf_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5244,42 +4266,28 @@ static void lts_aga_dpf_ishres_dhires_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5307,42 +4315,28 @@ static void lts_aga_ehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5379,42 +4373,28 @@ static void lts_aga_ehb_ishres_dhires_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5437,42 +4417,28 @@ static void lts_aga_ham_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5497,42 +4463,28 @@ static void lts_aga_ham_ishres_dhires_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5555,42 +4507,28 @@ static void lts_aga_kehb_ishres_dhires_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5617,51 +4555,37 @@ static void lts_aga_kehb_ishres_dhires_b2_filtered_genlock(int draw_start, int d
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5709,55 +4633,43 @@ static void lts_aga_n_ilores_dshres_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ilores_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ilores_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5829,55 +4741,43 @@ static void lts_aga_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ilores_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ilores_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5945,55 +4845,43 @@ static void lts_aga_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ilores_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ilores_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ilores_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6037,55 +4925,43 @@ static void lts_aga_ham_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ilores_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ilores_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6133,49 +5009,37 @@ static void lts_aga_kehb_ilores_dshres_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ilores_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ilores_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ihires_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6205,49 +5069,37 @@ static void lts_aga_n_ihires_dshres_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ihires_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ihires_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6289,49 +5141,37 @@ static void lts_aga_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ihires_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ihires_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6371,49 +5211,37 @@ static void lts_aga_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ihires_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ihires_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ihires_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6441,49 +5269,37 @@ static void lts_aga_ham_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ihires_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ihires_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6513,46 +5329,34 @@ static void lts_aga_kehb_ihires_dshres_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ihires_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ihires_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_n_ishres_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6573,46 +5377,34 @@ static void lts_aga_n_ishres_dshres_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_n_ishres_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_n_ishres_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_dpf_ishres_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6639,46 +5431,34 @@ static void lts_aga_dpf_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_dpf_ishres_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_dpf_ishres_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6704,46 +5484,34 @@ static void lts_aga_ehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ehb_ishres_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ehb_ishres_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_ham_ishres_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6763,46 +5531,34 @@ static void lts_aga_ham_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_ham_ishres_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_ham_ishres_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_aga_kehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u32 *colors_aga = (uae_u32*)(ls->linecolorstate + 256 * sizeof(uae_u32));
        uae_u8 bxor = ls->bplcon4 >> 8;
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6823,9 +5579,13 @@ static void lts_aga_kehb_ishres_dshres_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_aga_kehb_ishres_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_aga_kehb_ishres_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
 static LINETOSRC_FUNCF linetoscr_aga_genlock_fast_funcs[] = {
index e0708c817f9503c4ede7233b2e0adb88f56faa76..077e5a76f36ada5711e05a6b96c0aead1706ceb2 100644 (file)
@@ -4,35 +4,19 @@
 * This file was generated by genlinetoscr. Don't edit.
 */
 
-static void lts_ecs_n_ilores_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -49,40 +33,28 @@ static void lts_ecs_n_ilores_dlores_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -102,40 +74,28 @@ static void lts_ecs_dpf_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -157,40 +117,28 @@ static void lts_ecs_ehb_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -207,40 +155,28 @@ static void lts_ecs_ham_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -257,40 +193,28 @@ static void lts_ecs_kehb_ilores_dlores_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -309,36 +233,22 @@ static void lts_ecs_n_ihires_dlores_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -360,36 +270,22 @@ static void lts_ecs_n_ihires_dlores_b1_filtered(int draw_start, int draw_end, in
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -411,36 +307,22 @@ static void lts_ecs_dpf_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -468,36 +350,22 @@ static void lts_ecs_dpf_ihires_dlores_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -521,36 +389,22 @@ static void lts_ecs_ehb_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -582,36 +436,22 @@ static void lts_ecs_ehb_ihires_dlores_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -630,36 +470,22 @@ static void lts_ecs_ham_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -681,36 +507,22 @@ static void lts_ecs_ham_ihires_dlores_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -729,36 +541,22 @@ static void lts_ecs_kehb_ihires_dlores_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -780,77 +578,83 @@ static void lts_ecs_kehb_ihires_dlores_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dlores_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dlores_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dlores_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dlores_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ilores_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -871,41 +675,29 @@ static void lts_ecs_n_ilores_dhires_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -932,41 +724,29 @@ static void lts_ecs_dpf_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -997,41 +777,29 @@ static void lts_ecs_ehb_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1052,41 +820,29 @@ static void lts_ecs_ham_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1107,40 +863,28 @@ static void lts_ecs_kehb_ilores_dhires_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1157,40 +901,28 @@ static void lts_ecs_n_ihires_dhires_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ihires_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1210,40 +942,28 @@ static void lts_ecs_dpf_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ihires_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1265,40 +985,28 @@ static void lts_ecs_ehb_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ihires_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1315,40 +1023,28 @@ static void lts_ecs_ham_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ihires_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1365,40 +1061,28 @@ static void lts_ecs_kehb_ihires_dhires_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1414,36 +1098,22 @@ static void lts_ecs_n_ishres_dhires_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1459,36 +1129,22 @@ static void lts_ecs_n_ishres_dhires_b1_filtered(int draw_start, int draw_end, in
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1504,36 +1160,22 @@ static void lts_ecs_dpf_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1549,36 +1191,22 @@ static void lts_ecs_dpf_ishres_dhires_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1594,36 +1222,22 @@ static void lts_ecs_ehb_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1639,36 +1253,22 @@ static void lts_ecs_ehb_ishres_dhires_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1684,36 +1284,22 @@ static void lts_ecs_ham_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1729,36 +1315,22 @@ static void lts_ecs_ham_ishres_dhires_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dhires_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dhires_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1774,36 +1346,22 @@ static void lts_ecs_kehb_ishres_dhires_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dhires_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dhires_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1819,39 +1377,25 @@ static void lts_ecs_kehb_ishres_dhires_b1_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1880,43 +1424,31 @@ static void lts_ecs_n_ilores_dshres_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -1957,43 +1489,31 @@ static void lts_ecs_dpf_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2042,43 +1562,31 @@ static void lts_ecs_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2107,43 +1615,31 @@ static void lts_ecs_ham_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2172,41 +1668,29 @@ static void lts_ecs_kehb_ilores_dshres_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2227,41 +1711,29 @@ static void lts_ecs_n_ihires_dshres_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ihires_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2288,41 +1760,29 @@ static void lts_ecs_dpf_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ihires_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2353,41 +1813,29 @@ static void lts_ecs_ehb_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ihires_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2408,41 +1856,29 @@ static void lts_ecs_ham_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ihires_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2463,40 +1899,28 @@ static void lts_ecs_kehb_ihires_dshres_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2513,40 +1937,28 @@ static void lts_ecs_n_ishres_dshres_b1(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2563,40 +1975,28 @@ static void lts_ecs_dpf_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2613,40 +2013,28 @@ static void lts_ecs_ehb_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2663,40 +2051,28 @@ static void lts_ecs_ham_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dshres_b1(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dshres_b1(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                       } else {
+                               *buf1++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2713,42 +2089,30 @@ static void lts_ecs_kehb_ishres_dshres_b1(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dshres_b1_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dshres_b1_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ilores_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2766,42 +2130,30 @@ static void lts_ecs_n_ilores_dlores_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2822,42 +2174,30 @@ static void lts_ecs_dpf_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2880,42 +2220,30 @@ static void lts_ecs_ehb_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2933,42 +2261,30 @@ static void lts_ecs_ham_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -2986,42 +2302,30 @@ static void lts_ecs_kehb_ilores_dlores_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3041,38 +2345,24 @@ static void lts_ecs_n_ihires_dlores_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3095,38 +2385,24 @@ static void lts_ecs_n_ihires_dlores_b2_filtered(int draw_start, int draw_end, in
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3149,38 +2425,24 @@ static void lts_ecs_dpf_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3209,38 +2471,24 @@ static void lts_ecs_dpf_ihires_dlores_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3265,38 +2513,24 @@ static void lts_ecs_ehb_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3329,38 +2563,24 @@ static void lts_ecs_ehb_ihires_dlores_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3380,38 +2600,24 @@ static void lts_ecs_ham_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3434,38 +2640,24 @@ static void lts_ecs_ham_ihires_dlores_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3485,38 +2677,24 @@ static void lts_ecs_kehb_ihires_dlores_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3539,80 +2717,86 @@ static void lts_ecs_kehb_ihires_dlores_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dlores_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dlores_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dlores_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dlores_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ilores_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3635,44 +2819,32 @@ static void lts_ecs_n_ilores_dhires_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3701,44 +2873,32 @@ static void lts_ecs_dpf_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3771,44 +2931,32 @@ static void lts_ecs_ehb_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3831,44 +2979,32 @@ static void lts_ecs_ham_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3891,42 +3027,30 @@ static void lts_ecs_kehb_ilores_dhires_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -3944,42 +3068,30 @@ static void lts_ecs_n_ihires_dhires_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ihires_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4000,42 +3112,30 @@ static void lts_ecs_dpf_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ihires_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4058,42 +3158,30 @@ static void lts_ecs_ehb_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ihires_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4111,42 +3199,30 @@ static void lts_ecs_ham_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ihires_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4164,42 +3240,30 @@ static void lts_ecs_kehb_ihires_dhires_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4216,38 +3280,24 @@ static void lts_ecs_n_ishres_dhires_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4264,38 +3314,24 @@ static void lts_ecs_n_ishres_dhires_b2_filtered(int draw_start, int draw_end, in
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4312,38 +3348,24 @@ static void lts_ecs_dpf_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4360,38 +3382,24 @@ static void lts_ecs_dpf_ishres_dhires_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4408,38 +3416,24 @@ static void lts_ecs_ehb_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4456,38 +3450,24 @@ static void lts_ecs_ehb_ishres_dhires_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4504,38 +3484,24 @@ static void lts_ecs_ham_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4552,38 +3518,24 @@ static void lts_ecs_ham_ishres_dhires_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dhires_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dhires_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4600,38 +3552,24 @@ static void lts_ecs_kehb_ishres_dhires_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dhires_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dhires_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4648,44 +3586,30 @@ static void lts_ecs_kehb_ishres_dhires_b2_filtered(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4718,48 +3642,36 @@ static void lts_ecs_n_ilores_dshres_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4804,48 +3716,36 @@ static void lts_ecs_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4898,48 +3798,36 @@ static void lts_ecs_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -4972,48 +3860,36 @@ static void lts_ecs_ham_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5046,44 +3922,32 @@ static void lts_ecs_kehb_ilores_dshres_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5106,44 +3970,32 @@ static void lts_ecs_n_ihires_dshres_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ihires_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5172,44 +4024,32 @@ static void lts_ecs_dpf_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ihires_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5242,44 +4082,32 @@ static void lts_ecs_ehb_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ihires_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5302,44 +4130,32 @@ static void lts_ecs_ham_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ihires_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5362,42 +4178,30 @@ static void lts_ecs_kehb_ihires_dshres_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5416,42 +4220,30 @@ static void lts_ecs_n_ishres_dshres_b2(int draw_start, int draw_end, int draw_st
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5470,42 +4262,30 @@ static void lts_ecs_dpf_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5524,42 +4304,30 @@ static void lts_ecs_ehb_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5578,42 +4346,30 @@ static void lts_ecs_ham_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dshres_b2(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dshres_b2(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
                        }
                } else {
                        bpl = true;
@@ -5632,9 +4388,13 @@ static void lts_ecs_kehb_ishres_dshres_b2(int draw_start, int draw_end, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dshres_b2_filtered(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dshres_b2_filtered(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
 static LINETOSRC_FUNCF linetoscr_ecs_fast_funcs[] = {
index f55e49f88cc25c8f850713bf3f291c12045d8ec8..c26c1599daf82a38131b9d767f502855c6d88174 100644 (file)
@@ -4,38 +4,22 @@
 * This file was generated by genlinetoscr. Don't edit.
 */
 
-static void lts_ecs_n_ilores_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -54,43 +38,31 @@ static void lts_ecs_n_ilores_dlores_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -112,43 +84,31 @@ static void lts_ecs_dpf_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -172,43 +132,31 @@ static void lts_ecs_ehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -227,43 +175,31 @@ static void lts_ecs_ham_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -282,43 +218,31 @@ static void lts_ecs_kehb_ilores_dlores_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -339,39 +263,25 @@ static void lts_ecs_n_ihires_dlores_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -395,39 +305,25 @@ static void lts_ecs_n_ihires_dlores_b1_filtered_genlock(int draw_start, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -451,39 +347,25 @@ static void lts_ecs_dpf_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -513,39 +395,25 @@ static void lts_ecs_dpf_ihires_dlores_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -571,39 +439,25 @@ static void lts_ecs_ehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -637,39 +491,25 @@ static void lts_ecs_ehb_ihires_dlores_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -690,39 +530,25 @@ static void lts_ecs_ham_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -746,39 +572,25 @@ static void lts_ecs_ham_ihires_dlores_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -799,39 +611,25 @@ static void lts_ecs_kehb_ihires_dlores_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -855,81 +653,87 @@ static void lts_ecs_kehb_ihires_dlores_b1_filtered_genlock(int draw_start, int d
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dlores_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dlores_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dlores_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dlores_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ilores_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -954,45 +758,33 @@ static void lts_ecs_n_ilores_dhires_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1023,45 +815,33 @@ static void lts_ecs_dpf_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1096,45 +876,33 @@ static void lts_ecs_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1159,45 +927,33 @@ static void lts_ecs_ham_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1222,43 +978,31 @@ static void lts_ecs_kehb_ilores_dhires_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1277,43 +1021,31 @@ static void lts_ecs_n_ihires_dhires_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ihires_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1335,43 +1067,31 @@ static void lts_ecs_dpf_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1395,43 +1115,31 @@ static void lts_ecs_ehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ihires_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1450,43 +1158,31 @@ static void lts_ecs_ham_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1505,43 +1201,31 @@ static void lts_ecs_kehb_ihires_dhires_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1560,39 +1244,25 @@ static void lts_ecs_n_ishres_dhires_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1611,39 +1281,25 @@ static void lts_ecs_n_ishres_dhires_b1_filtered_genlock(int draw_start, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1662,39 +1318,25 @@ static void lts_ecs_dpf_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1713,39 +1355,25 @@ static void lts_ecs_dpf_ishres_dhires_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1764,39 +1392,25 @@ static void lts_ecs_ehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1815,39 +1429,25 @@ static void lts_ecs_ehb_ishres_dhires_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1866,39 +1466,25 @@ static void lts_ecs_ham_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1917,39 +1503,25 @@ static void lts_ecs_ham_ishres_dhires_b1_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dhires_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -1968,39 +1540,25 @@ static void lts_ecs_kehb_ishres_dhires_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dhires_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dhires_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2019,45 +1577,31 @@ static void lts_ecs_kehb_ishres_dhires_b1_filtered_genlock(int draw_start, int d
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2094,49 +1638,37 @@ static void lts_ecs_n_ilores_dshres_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2185,49 +1717,37 @@ static void lts_ecs_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2284,49 +1804,37 @@ static void lts_ecs_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2363,49 +1871,37 @@ static void lts_ecs_ham_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2442,45 +1938,33 @@ static void lts_ecs_kehb_ilores_dshres_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2505,45 +1989,33 @@ static void lts_ecs_n_ihires_dshres_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ihires_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2574,45 +2046,33 @@ static void lts_ecs_dpf_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2647,45 +2107,33 @@ static void lts_ecs_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ihires_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2710,45 +2158,33 @@ static void lts_ecs_ham_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2773,43 +2209,31 @@ static void lts_ecs_kehb_ihires_dshres_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2829,43 +2253,31 @@ static void lts_ecs_n_ishres_dshres_b1_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2885,43 +2297,31 @@ static void lts_ecs_dpf_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2941,43 +2341,31 @@ static void lts_ecs_ehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -2997,43 +2385,31 @@ static void lts_ecs_ham_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dshres_b1_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3053,45 +2429,33 @@ static void lts_ecs_kehb_ishres_dshres_b1_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dshres_b1_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dshres_b1_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ilores_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3111,45 +2475,33 @@ static void lts_ecs_n_ilores_dlores_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3172,45 +2524,33 @@ static void lts_ecs_dpf_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3235,45 +2575,33 @@ static void lts_ecs_ehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3293,45 +2621,33 @@ static void lts_ecs_ham_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3351,45 +2667,33 @@ static void lts_ecs_kehb_ilores_dlores_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3411,41 +2715,27 @@ static void lts_ecs_n_ihires_dlores_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3470,41 +2760,27 @@ static void lts_ecs_n_ihires_dlores_b2_filtered_genlock(int draw_start, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3529,41 +2805,27 @@ static void lts_ecs_dpf_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3594,41 +2856,27 @@ static void lts_ecs_dpf_ihires_dlores_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3655,41 +2903,27 @@ static void lts_ecs_ehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3724,41 +2958,27 @@ static void lts_ecs_ehb_ihires_dlores_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3780,41 +3000,27 @@ static void lts_ecs_ham_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3839,41 +3045,27 @@ static void lts_ecs_ham_ihires_dlores_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3895,41 +3087,27 @@ static void lts_ecs_kehb_ihires_dlores_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -3954,84 +3132,90 @@ static void lts_ecs_kehb_ihires_dlores_b2_filtered_genlock(int draw_start, int d
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dlores_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dlores_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dlores_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dlores_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ilores_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4058,48 +3242,36 @@ static void lts_ecs_n_ilores_dhires_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4132,48 +3304,36 @@ static void lts_ecs_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4210,48 +3370,36 @@ static void lts_ecs_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4278,48 +3426,36 @@ static void lts_ecs_ham_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4346,45 +3482,33 @@ static void lts_ecs_kehb_ilores_dhires_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4404,45 +3528,33 @@ static void lts_ecs_n_ihires_dhires_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ihires_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4465,45 +3577,33 @@ static void lts_ecs_dpf_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4528,45 +3628,33 @@ static void lts_ecs_ehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ihires_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4586,45 +3674,33 @@ static void lts_ecs_ham_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4644,45 +3720,33 @@ static void lts_ecs_kehb_ihires_dhires_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4702,41 +3766,27 @@ static void lts_ecs_n_ishres_dhires_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4756,41 +3806,27 @@ static void lts_ecs_n_ishres_dhires_b2_filtered_genlock(int draw_start, int draw
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4810,41 +3846,27 @@ static void lts_ecs_dpf_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4864,41 +3886,27 @@ static void lts_ecs_dpf_ishres_dhires_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4918,41 +3926,27 @@ static void lts_ecs_ehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -4972,41 +3966,27 @@ static void lts_ecs_ehb_ishres_dhires_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5026,41 +4006,27 @@ static void lts_ecs_ham_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5080,41 +4046,27 @@ static void lts_ecs_ham_ishres_dhires_b2_filtered_genlock(int draw_start, int dr
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dhires_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5134,41 +4086,27 @@ static void lts_ecs_kehb_ishres_dhires_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dhires_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dhires_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5188,50 +4126,36 @@ static void lts_ecs_kehb_ishres_dhires_b2_filtered_genlock(int draw_start, int d
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5272,54 +4196,42 @@ static void lts_ecs_n_ilores_dshres_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ilores_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ilores_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5372,54 +4284,42 @@ static void lts_ecs_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ilores_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ilores_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5480,54 +4380,42 @@ static void lts_ecs_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ilores_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ilores_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ilores_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5568,54 +4456,42 @@ static void lts_ecs_ham_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ilores_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ilores_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 4;
-                                       buf2 += 4;
-                                       gbuf += 4;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 4;
+                               buf2 += 4;
+                               gbuf += 4;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5656,48 +4532,36 @@ static void lts_ecs_kehb_ilores_dshres_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ilores_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ilores_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ihires_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5724,48 +4588,36 @@ static void lts_ecs_n_ihires_dshres_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ihires_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ihires_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5798,48 +4650,36 @@ static void lts_ecs_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ihires_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ihires_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5876,48 +4716,36 @@ static void lts_ecs_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ihires_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ihires_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ihires_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -5944,48 +4772,36 @@ static void lts_ecs_ham_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ihires_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ihires_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1 += 2;
-                                       buf2 += 2;
-                                       gbuf += 2;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1 += 2;
+                               buf2 += 2;
+                               gbuf += 2;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6012,45 +4828,33 @@ static void lts_ecs_kehb_ihires_dshres_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ihires_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ihires_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_n_ishres_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6072,45 +4876,33 @@ static void lts_ecs_n_ishres_dshres_b2_genlock(int draw_start, int draw_end, int
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_n_ishres_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_n_ishres_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_dpf_ishres_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6132,45 +4924,33 @@ static void lts_ecs_dpf_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_dpf_ishres_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_dpf_ishres_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6192,45 +4972,33 @@ static void lts_ecs_ehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ehb_ishres_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ehb_ishres_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_ham_ishres_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6252,45 +5020,33 @@ static void lts_ecs_ham_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_ham_ishres_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_ham_ishres_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
-static void lts_ecs_kehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dshres_b2_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        uae_u32 *acolors = (uae_u32*)ls->linecolorstate;
        uae_u16 *colors_ocs = (uae_u16*)(ls->linecolorstate + 256 * sizeof(uae_u32));
-       int bufaddv = 1 << bufadd;
-       int cpaddv = 1 << cpadd;
        uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
-       int end = draw_end;
-       if (end > hbstrt_offset) {
-               end = hbstrt_offset;
-       }
-       int cnt = draw_end;
-       if (cnt > draw_startoffset) {
-               cnt = draw_startoffset;
-       }
-       if (cnt > hbstop_offset) {
-               cnt = hbstop_offset;
-       }
-       if (cnt > bpl1dat_trigger_offset) {
-               cnt = bpl1dat_trigger_offset;
-       }
-       while (cnt < end) {
+       while (cnt < draw_end) {
                bool bpl = false;
                if (cnt < bpl1dat_trigger_offset || cnt < hbstop_offset || cnt < hstrt_offset || cnt >= hstop_offset) {
-                       if (cnt >= draw_startoffset) {
-                               if (cnt < hbstop_offset) {
-                                       buf1++;
-                                       buf2++;
-                                       gbuf++;
-                               } else {
-                                       *buf1++ = bgcolor;
-                                       *buf2++ = bgcolor;
-                                       *gbuf++ = gpix;
-                               }
+                       if (cnt < hbstop_offset) {
+                               buf1++;
+                               buf2++;
+                               gbuf++;
+                       } else {
+                               *buf1++ = bgcolor;
+                               *buf2++ = bgcolor;
+                               *gbuf++ = gpix;
                        }
                } else {
                        bpl = true;
@@ -6312,9 +5068,13 @@ static void lts_ecs_kehb_ishres_dshres_b2_genlock(int draw_start, int draw_end,
                }
                cnt += bufaddv;
        }
+       *cpp = cp;
+       *cp2p = cp2;
 }
-static void lts_ecs_kehb_ishres_dshres_b2_filtered_genlock(int draw_start, int draw_end, int draw_startoffset, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 *cp, uae_u8 *cp2, int cpadd, int *cpadds, int bufadd, struct linestate *ls)
+static void lts_ecs_kehb_ishres_dshres_b2_filtered_genlock(int cnt, int draw_end, int hbstrt_offset, int hbstop_offset, int hstrt_offset, int hstop_offset,int bpl1dat_trigger_offset, int planes, uae_u32 bgcolor, uae_u8 **cpp, uae_u8 **cp2p, int cpaddv, int *cpadds, int bufaddv, struct linestate *ls)
 {
+       uae_u8 *cp = *cpp;
+       uae_u8 *cp2 = *cp2p;
        lts_null();
 }
 static LINETOSRC_FUNCF linetoscr_ecs_genlock_fast_funcs[] = {