]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Chipset updates
authorToni Wilen <twilen@winuae.net>
Sat, 29 Mar 2025 16:54:50 +0000 (18:54 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 29 Mar 2025 16:54:50 +0000 (18:54 +0200)
21 files changed:
custom.cpp
debug.cpp
drawing.cpp
genlinetoscr.cpp
include/debug.h
include/drawing.h
linetoscr_aga_fast.cpp
linetoscr_aga_fm0_genlock.cpp
linetoscr_aga_fm1_genlock.cpp
linetoscr_aga_fm2_genlock.cpp
linetoscr_aga_genlock_fast.cpp
linetoscr_ecs_fast.cpp
linetoscr_ecs_genlock_fast.cpp
linetoscr_ecs_shres.cpp
linetoscr_ocs_ecs.cpp
linetoscr_ocs_ecs_genlock.cpp
linetoscr_ocs_ecs_ntsc.cpp
linetoscr_ocs_ecs_ntsc_genlock.cpp
od-win32/avioutput.cpp
od-win32/screenshot.cpp
specialmonitors.cpp

index 490f650b3a4d712b3cd46b2b205b86a4c36e175a..2279b5b9a59656165ecb88c07f0db589a14ebfb9 100644 (file)
@@ -120,7 +120,7 @@ static uae_u32 custom_state_flags;
 static int not_safe_mode;
 static bool dmal_next;
 static int fast_lines_cnt;
-static bool lineoptimizations_allowed;
+static bool lineoptimizations_draw_always;
 
 static uae_u32 scandoubled_bpl_ptr[MAX_SCANDOUBLED_LINES][2][MAX_PLANES];
 static bool scandoubled_bpl_ena[MAX_SCANDOUBLED_LINES + 1];
@@ -167,47 +167,23 @@ static void handle_pipelined_custom_write(bool now)
                if (p->func) {
                        p->cck--;
                        if (!p->cck || now) {
-                               p->func(p->v);
+                               auto f = p->func;
                                p->func = NULL;
+                               f(p->v);
                        }
                }
        }
 }
 
-#define CE_MODE_RGA_OPTIMIZATIONS 0
-
 static uae_u32 rga_slot_in_offset, rga_slot_first_offset, rga_slot_out_offset;
 static evt_t last_rga_cycle;
 
-#if CE_MODE_RGA_OPTIMIZATIONS
-static bool drga_written;
-static bool fast_mode_ce_not;
-static int fast_mode_strobe_cnt;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-static bool drga_bpl, drga_spr;
-static uae_u8 bpl_line_store[256 * 8];
-#endif
-#endif
-
 static void write_drga_strobe(uae_u16 rga)
 {
        struct denise_rga *r = &rga_denise[rga_denise_cycle];
        r->rga = rga;
        r->flags = 0;
        r->line = rga_denise_cycle_line;
-#if CE_MODE_RGA_OPTIMIZATIONS
-       if (rga == 0x38 || rga == 0x3a || rga == 0x3c) {
-               if (agnus_hpos != 3 || fast_mode_strobe_cnt != 0) {
-                       fast_mode_ce_not = true;
-               }
-       }
-       if (rga == 0x3e) {
-               if (agnus_hpos != 5 || fast_mode_strobe_cnt != 1) {
-                       fast_mode_ce_not = true;
-               }
-       }
-       fast_mode_strobe_cnt++;
-#endif
 };
 static void write_drga(uae_u16 rga, uaecptr pt, uae_u32 v)
 {
@@ -217,9 +193,6 @@ static void write_drga(uae_u16 rga, uaecptr pt, uae_u32 v)
        r->pt = pt;
        r->flags = 0;
        r->line = rga_denise_cycle_line;
-#if CE_MODE_RGA_OPTIMIZATIONS
-       fast_mode_ce_not = true;
-#endif
 };
 static void write_drga_dat_spr(uae_u16 rga, uaecptr pt, uae_u32 v)
 {
@@ -229,9 +202,6 @@ static void write_drga_dat_spr(uae_u16 rga, uaecptr pt, uae_u32 v)
        r->pt = pt;
        r->flags = 0;
        r->line = rga_denise_cycle_line;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       drga_spr = true;
-#endif
 };
 static void write_drga_dat_spr_wide(uae_u16 rga, uaecptr pt, uae_u64 v)
 {
@@ -241,17 +211,8 @@ static void write_drga_dat_spr_wide(uae_u16 rga, uaecptr pt, uae_u64 v)
        r->pt = pt;
        r->flags = 0;
        r->line = rga_denise_cycle_line;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       drga_spr = true;
-#endif
 };
 
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-static uae_u16 *fast_plane_store16[MAX_PLANES];
-static uae_u32 *fast_plane_store32[MAX_PLANES];
-static uae_u64 *fast_plane_store64[MAX_PLANES];
-#endif
-
 static void write_drga_dat_bpl16(uae_u16 rga, uaecptr pt, uae_u16 v, int plane)
 {
        struct denise_rga *r = &rga_denise[rga_denise_cycle];
@@ -260,13 +221,6 @@ static void write_drga_dat_bpl16(uae_u16 rga, uaecptr pt, uae_u16 v, int plane)
        r->pt = pt;
        r->flags = 0;
        r->line = rga_denise_cycle_line;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       if (currprefs.cpu_memory_cycle_exact) {
-               *fast_plane_store16[plane] = v;
-               fast_plane_store16[plane]++;
-       }
-       drga_bpl = true;
-#endif
 };
 static void write_drga_dat_bpl32(uae_u16 rga, uaecptr pt, uae_u32 v, int plane)
 {
@@ -276,13 +230,6 @@ static void write_drga_dat_bpl32(uae_u16 rga, uaecptr pt, uae_u32 v, int plane)
        r->pt = pt;
        r->flags = 0;
        r->line = rga_denise_cycle_line;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       if (currprefs.cpu_memory_cycle_exact) {
-               *fast_plane_store32[plane] = v;
-               fast_plane_store32[plane]++;
-       }
-       drga_bpl = true;
-#endif
 };
 static void write_drga_dat_bpl64(uae_u16 rga, uaecptr pt, uae_u64 v, int plane)
 {
@@ -292,13 +239,6 @@ static void write_drga_dat_bpl64(uae_u16 rga, uaecptr pt, uae_u64 v, int plane)
        r->pt = pt;
        r->flags = 0;
        r->line = rga_denise_cycle_line;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       if (currprefs.cpu_memory_cycle_exact) {
-               *fast_plane_store64[plane] = v;
-               fast_plane_store64[plane]++;
-       }
-       drga_bpl = true;
-#endif
 };
 
 static void write_drga_flag(uae_u32 flags, uae_u32 mask)
@@ -1256,14 +1196,13 @@ static void update_mirrors(void)
                hsyncdebug = currprefs.gfx_overscanmode - OVERSCANMODE_ULTRA + 1;
        }
        struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo;
-       lineoptimizations_allowed = vidinfo->inbuffer == vidinfo->outbuffer && drawing_can_lineoptimizations();
+       lineoptimizations_draw_always = drawing_can_lineoptimizations() == false;
        color_table_changed = true;
 }
 
 void notice_new_xcolors(void)
 {
        update_mirrors();
-       docols(&denise_colors);
        docols(&agnus_colors);
 }
 
@@ -1698,7 +1637,7 @@ void compute_framesync(void)
        if (currprefs.gfx_extraheight > 0) {
                vb->extraheight = currprefs.gfx_extraheight << vres2;
        }
-       if (vb->extrawidth == -2 && ((new_beamcon0 & (BEAMCON0_VARVBEN | bemcon0_vsync_mask)) || currprefs.gfx_overscanmode >= OVERSCANMODE_EXTREME)) {
+       if (currprefs.gfx_overscanmode >= OVERSCANMODE_EXTREME) {
                vb->extrawidth = -1;
        }
        int mfl = minfirstline + 1;
@@ -3201,11 +3140,6 @@ static void DMACON(int hpos, uae_u16 v)
        if (changed & (DMA_MASTER | DMA_AUD3 | DMA_AUD2 | DMA_AUD1 | DMA_AUD0)) {
                audio_state_machine();
        }
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       if (changed & (DMA_MASTER | DMA_BITPLANE | DMA_COPPER)) {
-               fast_mode_ce_not = true;
-       }
-#endif
 }
 
 static int irq_forced;
@@ -3303,9 +3237,7 @@ static void rethink_intreq(void)
 
 static void intreq_checks(uae_u16 oldreq, uae_u16 newreq)
 {
-       if ((oldreq & 0x0800) != (newreq & 0x0800)) {
-               serial_rbf_change((newreq & 0x0800) ? 1 : 0);
-       }
+       serial_rbf_change((newreq & 0x0800) ? 1 : 0);
 }
 
 static void event_doint_delay_do_ext(uae_u32 v)
@@ -3584,16 +3516,10 @@ void set_picasso_hack_rate(int hz)
 static void BPLxPTH(uae_u16 v, int num)
 {
        bplpt[num] = (bplpt[num] & 0x0000ffff) | ((uae_u32)v << 16);
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       fast_mode_ce_not = true;
-#endif
 }
 static void BPLxPTL(uae_u16 v, int num)
 {
        bplpt[num] = (bplpt[num] & 0xffff0000) | (v & 0x0000fffe);
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       fast_mode_ce_not = true;
-#endif
 }
 
 static uae_u16 BPLCON0_Agnus_mask(uae_u16 v)
@@ -3629,10 +3555,6 @@ static void BPLCON0_delayed(uae_u32 va)
        checksyncstopped(va);
 
        color_table_changed = true;
-
-#if CE_MODE_RGA_OPTIMIZATIONS
-       fast_mode_ce_not = true;
-#endif
 }
 
 static void BPLCON0(uae_u16 v)
@@ -3648,10 +3570,6 @@ static void BPLCON0(uae_u16 v)
                return;
        }
 
-#if CE_MODE_RGA_OPTIMIZATIONS
-       fast_mode_ce_not = true;
-#endif
-
        // UHRES, BYPASS
        if (va & (0x0080 | 0x0020)) {
                not_safe_mode |= 1;
@@ -3673,17 +3591,11 @@ static void BPLCON1(uae_u16 v)
 #endif
        bplcon1_saved = v;
        bplcon1 = v;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       fast_mode_ce_not = true;
-#endif
 }
 static void BPLCON2(uae_u16 v)
 {
        bplcon2_saved = v;
        bplcon2 = v;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       fast_mode_ce_not = true;
-#endif
 }
 static void BPLCON3(uae_u16 v)
 {
@@ -3692,34 +3604,22 @@ static void BPLCON3(uae_u16 v)
        if (aga_mode) {
                color_table_changed = true;
        }
-#if CE_MODE_RGA_OPTIMIZATIONS
-       fast_mode_ce_not = true;
-#endif
 }
 static void BPLCON4(uae_u16 v)
 {
        bplcon4_saved = v;
        bplcon4 = v;
-#if CE_MODE_RGA_OPTIMIZATIONS
-       fast_mode_ce_not = true;
-#endif
 }
 
 static void BPL1MOD(uae_u16 v)
 {
        v &= ~1;
        bpl1mod = v;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       fast_mode_ce_not = true;
-#endif
 }
 static void BPL2MOD(uae_u16 v)
 {
        v &= ~1;
        bpl2mod = v;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       fast_mode_ce_not = true;
-#endif
 }
 
 static void BPLxDAT(int num, uae_u16 data)
@@ -3787,9 +3687,6 @@ static void DDFSTRT(uae_u16 v)
        v &= ddf_mask;
        ddfstrt = 0xffff;
        push_pipeline(&ddfstrt, v);
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       fast_mode_ce_not = true;
-#endif
 }
 
 static void DDFSTOP(uae_u16 v)
@@ -3798,9 +3695,6 @@ static void DDFSTOP(uae_u16 v)
        ddfstop_saved = v;
        v &= ddf_mask;
        push_pipeline(&ddfstop, v);
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       fast_mode_ce_not = true;
-#endif
 }
 
 static void FMODE(uae_u16 v)
@@ -3820,9 +3714,6 @@ static void FMODE(uae_u16 v)
        }
        set_chipset_mode(false);
        setup_fmodes(bplcon0);
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       fast_mode_ce_not = true;
-#endif
 }
 
 static void FNULL(uae_u16 v)
@@ -6621,13 +6512,6 @@ void custom_reset(bool hardreset, bool keyboardreset)
        rga_denise_cycle_start = 0;
        rga_denise_cycle_count = 0;
        rga_denise_cycle_line = 1;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       for (int i = 0; i < MAX_PLANES; i++) {
-               fast_plane_store16[i] = (uae_u16*)bpl_line_store;
-               fast_plane_store32[i] = (uae_u32*)bpl_line_store;
-               fast_plane_store64[i] = (uae_u64*)bpl_line_store;
-       }
-#endif
 
        vsync_startline = 3;
        copper_dma_change_cycle = 0;
@@ -8695,10 +8579,12 @@ void check_prefs_changed_custom(void)
                        warpmode(changed_prefs.turbo_emulation);
                }
        }
-       if (currprefs.turbo_emulation != changed_prefs.turbo_emulation)
+       if (currprefs.turbo_emulation != changed_prefs.turbo_emulation) {
                warpmode(changed_prefs.turbo_emulation);
-       if (inputdevice_config_change_test()) 
+       }
+       if (inputdevice_config_change_test()) {
                inputdevice_copyconfig (&changed_prefs, &currprefs);
+       }
        currprefs.immediate_blits = changed_prefs.immediate_blits;
        currprefs.waiting_blits = changed_prefs.waiting_blits;
        currprefs.blitter_speed_throttle = changed_prefs.blitter_speed_throttle;
@@ -10517,38 +10403,18 @@ static int getlinetype(void)
 {
        int type = 0;
        
-#if CE_MODE_RGA_OPTIMIZATIONS
-       if (currprefs.cpu_memory_cycle_exact) {
-               if (get_strobe_reg(0) != 0x3c) {
-                       type = LINETYPE_BLANK;
-               } else if (vdiwstate == diw_states::DIW_waiting_start || GET_PLANES(bplcon0) == 0 || !dmaen(DMA_BITPLANE)) {
+       if (get_strobe_reg(0) != 0x3c) {
+               type = LINETYPE_BLANK;
+       } else {
+               if (vdiwstate == diw_states::DIW_waiting_start || GET_PLANES(bplcon0) == 0 || !dmaen(DMA_BITPLANE)) {
                        if ((bplcon0 & 1) && (bplcon3 & 0x20)) {
                                type = LINETYPE_BLANK;
                        } else {
                                type = LINETYPE_BORDER;
                        }
-               }
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-               else if (drga_bpl && ddfstop > ddfstrt && ddfstrt >= 0x14 && GET_RES_AGNUS(bplcon0) == GET_RES_DENISE(bplcon0) && dmaen(DMA_BITPLANE)) {
+               } else if (ddfstop > ddfstrt && ddfstrt >= 0x14 && GET_RES_AGNUS(bplcon0) == GET_RES_DENISE(bplcon0) && dmaen(DMA_BITPLANE)) {
                        type = LINETYPE_BPL;
                }
-#endif
-       } else 
-#endif
-       {
-               if (get_strobe_reg(0) != 0x3c) {
-                       type = LINETYPE_BLANK;
-               } else if (lineoptimizations_allowed) {
-                       if (vdiwstate == diw_states::DIW_waiting_start || GET_PLANES(bplcon0) == 0 || !dmaen(DMA_BITPLANE)) {
-                               if ((bplcon0 & 1) && (bplcon3 & 0x20)) {
-                                       type = LINETYPE_BLANK;
-                               } else {
-                                       type = LINETYPE_BORDER;
-                               }
-                       } else if (ddfstop > ddfstrt && ddfstrt >= 0x14 && GET_RES_AGNUS(bplcon0) == GET_RES_DENISE(bplcon0) && dmaen(DMA_BITPLANE)) {
-                               type = LINETYPE_BPL;
-                       }
-               }
        }
        return type;
 }
@@ -10557,21 +10423,31 @@ static int getcolorcount(int planes)
 {
        bool ham = (bplcon0 & 0x800) != 0;
        bool dpf = (bplcon0 & 0x400) != 0;
+       bool shres = (bplcon0 & 0x40) != 0;
        if (aga_mode) {
+               int num = 1 << planes;
                if (ham) {
                        if (planes < 8) {
-                               return 16;
+                               num = 16;
+                       } else {
+                               num = 64;
                        }
-                       return 64;
-               }
-               if (dpf) {
+               } else if (dpf) {
                        int pf2of2 = (bplcon3 >> 10) & 7;
                        if (!pf2of2) {
-                               return 16;
+                               num = 16;
+                       } else {
+                               num = (1 << pf2of2) + 16;
                        }
-                       return (1 << pf2of2) + 16;
                }
-               return 1 << planes;
+               num += bplcon4 >> 8;
+               if (num > 256) {
+                       num = 256;
+               }
+               return num;
+       }
+       if (shres) {
+               return 32;
        }
        if (ham) {
                return 16;
@@ -10600,7 +10476,7 @@ static int getbplmod(int plane)
        return mod;
 }
 
-static int checkprevfieldlinestateequalbpl(struct linestate *l, bool dontaddbpl)
+static int checkprevfieldlinestateequalbpl(struct linestate *l)
 {
        if (l->bplcon0 == bplcon0 &&
                l->bplcon2 == bplcon2 &&
@@ -10614,53 +10490,7 @@ static int checkprevfieldlinestateequalbpl(struct linestate *l, bool dontaddbpl)
                l->fmode == fmode &&
                l->bpllen > 0)
        {
-               int bc1mask = aga_mode ? 0xffff : 0x00ff;
-               if (l->bplcon1 != (bplcon1 & bc1mask)) {
-                       return -1;
-               }
                return -1;
-#if 0
-               // compare bpl data
-               uae_u8 *dpt = l->linedatastate;
-               int planes = GET_PLANES(bplcon0);
-               int len = l->bpllen;
-               for (int i = 0; i < planes; i++) {
-                       uaecptr apt = bplpt[i];
-#if 0
-                       if (custom_fastmode_bplextendmask & (1 << i)) {
-                               int mod = getbplmod(i);
-                               apt += fetchmode_bytes + mod;
-                       }
-#endif
-                       if (!valid_address(apt, len)) {
-                               return 0;
-                       }
-                       uae_u8 *pt = get_real_address(apt);
-                       if (memcmp(dpt, pt, len)) {
-                               return -1;
-                       }
-                       dpt += len;
-               }
-               // compare colors
-               int colors = l->colors;
-               if (aga_mode) {
-                       if (memcmp(dpt, agnus_colors.color_regs_aga, colors * sizeof(uae_u32))) {
-                               return -1;
-                       }
-               } else {
-                       if (memcmp(dpt, agnus_colors.color_regs_ecs, colors * sizeof(uae_u16))) {
-                               return -1;
-                       }
-               }
-               if (!dontaddbpl) {
-                       // advance bpl pointers
-                       for (int i = 0; i < planes; i++) {
-                               int mod = getbplmod(i);
-                               bplpt[i] += mod + len;
-                       }
-               }
-               return 1;
-#endif
        }
        return 0;
 }
@@ -10698,19 +10528,9 @@ static bool draw_line_fast(struct linestate *l, int ldv, uaecptr bplptp[8], bool
        }
        int colors = getcolorcount(planes);
        int len = l->bpllen;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       if (currprefs.cpu_memory_cycle_exact) {
-               for (int i = 0; i < planes; i++) {
-                       uae_u8 *pt = bpl_line_store + i * 256;
-                       l->bplpt[i] = pt;
-               }
-       } else
-#endif
-       {
-               for (int i = 0; i < planes; i++) {
-                       uaecptr pt = bplptp[i];
-                       l->bplpt[i] = get_real_address(pt);
-               }
+       for (int i = 0; i < planes; i++) {
+               uaecptr pt = bplptp[i];
+               l->bplpt[i] = get_real_address(pt);
        }
        if (color_table_changed) {
                draw_denise_line_queue_flush();
@@ -10718,7 +10538,7 @@ static bool draw_line_fast(struct linestate *l, int ldv, uaecptr bplptp[8], bool
                if (color_table_index >= COLOR_TABLE_ENTRIES) {
                        color_table_index = 0;
                }
-               l->linecolorstate = color_tables + color_table_index * sizeof(uae_u32);
+               l->linecolorstate = color_tables + color_table_index * 256 * sizeof(uae_u32);
                uae_u8 *dpt = l->linecolorstate;
                if (aga_mode) {
                        memcpy(dpt, agnus_colors.color_regs_aga, colors * sizeof(uae_u32));
@@ -10727,13 +10547,13 @@ static bool draw_line_fast(struct linestate *l, int ldv, uaecptr bplptp[8], bool
                }
                color_table_changed = false;
        } else {
-               l->linecolorstate = color_tables + color_table_index * sizeof(uae_u32);
+               l->linecolorstate = color_tables + color_table_index * 256 * sizeof(uae_u32);
        }
+
        l->color0 = aga_mode ? agnus_colors.color_regs_aga[0] : agnus_colors.color_regs_ecs[0];
        l->bplcon1 = bplcon1 & bc1mask;
        l->fetchmode_size = fetchmode_size;
        l->fetchstart_mask = fetchstart_mask;
-       // draw quickly, store new state
        int dvp = calculate_linetype(ldv);
        draw_denise_bitplane_line_fast_queue(dvp, nextline_how, l);
        if (addbpl) {
@@ -10751,58 +10571,12 @@ static bool draw_always(void)
        if (nextline_how == nln_lower_black_always || nextline_how == nln_upper_black_always) {
                return true;
        }
+       if (lineoptimizations_draw_always) {
+               return true;
+       }
        return false;
 }
 
-static bool checkprevfieldlinestateequal(void)
-{
-       if (linear_vpos >= MAX_SCANDOUBLED_LINES) {
-               return false;
-       }
-       bool ret = false;
-       bool always = draw_always();
-       struct linestate *l = &lines[linear_vpos][lof_display];
-
-       int type = getlinetype();
-       if (type && type == l->type && displayresetcnt == l->cnt) {
-               if (type == LINETYPE_BLANK && l->vb) {
-                       if (1) {
-                               ret = true;
-                       }
-               } else if (type == LINETYPE_BORDER && !l->vb) {
-                       if (1) {
-                               uae_u32 c = aga_mode ? agnus_colors.color_regs_aga[0] : agnus_colors.color_regs_ecs[0];
-                               if (!always && c == l->color0) {
-                                       ret = true;
-                               } else if (1 && (always || currprefs.cs_optimizations == DISPLAY_OPTIMIZATIONS_FULL)) {
-                                       ret = draw_border_fast(l, linear_display_vpos + 1);
-                               }
-                       }
-               } else if (type == LINETYPE_BPL && !l->vb) {
-                       if (1) {
-                               int r = checkprevfieldlinestateequalbpl(l, always);
-                               if (1 && (always || (r < 0 && currprefs.cs_optimizations == DISPLAY_OPTIMIZATIONS_FULL))) {
-                                       // no match but same parameters: do quick BPL emulation
-                                       r = draw_line_fast(l, linear_display_vpos + 1, bplpt, true);
-                                       if (doflickerfix_active() && scandoubled_bpl_ena[linear_vpos + 1]) {
-                                               lof_display ^= 1;
-                                               struct linestate *l2 = &lines[linear_vpos][lof_display];
-                                               scandoubled_line = 1;
-                                               uaecptr bplptx[MAX_PLANES];
-                                               for (int i = 0; i < MAX_PLANES; i++) {
-                                                       bplptx[i] = scandoubled_bpl_ptr[linear_vpos][lof_display][i];
-                                               }
-                                               draw_line_fast(l2, linear_display_vpos + 1, bplptx, false);
-                                               scandoubled_line = 0;
-                                               lof_display ^= 1;
-                                       }
-                               }
-                               ret = r > 0;
-                       }
-               }
-       }
-       return ret;
-}
 
 static void resetlinestate(void)
 {
@@ -10889,8 +10663,7 @@ static void storelinestate(void)
        }
 }
 
-#if CE_MODE_RGA_OPTIMIZATIONS
-static bool draw_line_ce_fast(void)
+static bool checkprevfieldlinestateequal(void)
 {
        if (linear_vpos >= MAX_SCANDOUBLED_LINES) {
                return false;
@@ -10908,59 +10681,44 @@ static bool draw_line_ce_fast(void)
                } else if (type == LINETYPE_BORDER && !l->vb) {
                        if (1) {
                                uae_u32 c = aga_mode ? agnus_colors.color_regs_aga[0] : agnus_colors.color_regs_ecs[0];
-                               if (c == l->color0) {
+                               if (!always && c == l->color0) {
                                        ret = true;
-                               } else if (always|| currprefs.cs_optimizations == DISPLAY_OPTIMIZATIONS_FULL) {
-                                       ret = draw_border_fast(l, linear_display_vpos);
+                               } else if (always || currprefs.cs_optimizations == DISPLAY_OPTIMIZATIONS_FULL) {
+                                       storelinestate();
+                                       ret = draw_border_fast(l, linear_display_vpos + 1);
                                }
                        }
-               }
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-               else if (type == LINETYPE_BPL && !l->vb) {
+               } else if (type == LINETYPE_BPL && !l->vb) {
                        if (1) {
-                               int r = checkprevfieldlinestateequalbpl(l, always);
-                               if (always || (r < 0 && currprefs.cs_optimizations == DISPLAY_OPTIMIZATIONS_FULL)) {
+                               int r = checkprevfieldlinestateequalbpl(l);
+                               if ((r && always) || (r && currprefs.cs_optimizations == DISPLAY_OPTIMIZATIONS_FULL)) {
                                        // no match but same parameters: do quick BPL emulation
-                                       r = draw_line_fast(l, linear_display_vpos);
+                                       storelinestate();
+                                       r = draw_line_fast(l, linear_display_vpos + 1, bplpt, true);
+                                       if (doflickerfix_active() && scandoubled_bpl_ena[linear_vpos + 1]) {
+                                               lof_display ^= 1;
+                                               struct linestate *l2 = &lines[linear_vpos][lof_display];
+                                               scandoubled_line = 1;
+                                               uaecptr bplptx[MAX_PLANES];
+                                               for (int i = 0; i < MAX_PLANES; i++) {
+                                                       bplptx[i] = scandoubled_bpl_ptr[linear_vpos][lof_display][i];
+                                               }
+                                               draw_line_fast(l2, linear_display_vpos + 1, bplptx, false);
+                                               scandoubled_line = 0;
+                                               lof_display ^= 1;
+                                       }
                                }
                                ret = r > 0;
                        }
                }
-#endif
-       }
-       if (!ret) {
-               l->type = 0;
        }
        return ret;
 }
 
-static void clear_fast_mode_ce(void)
-{
-       fast_mode_strobe_cnt = 0;
-       drga_written = false;
-       fast_mode_ce_not = false;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       drga_bpl = false;
-       drga_spr = false;
-#endif
-}
-#endif
-
 static void draw_line(void)
 {
        int dvp = calculate_linetype(linear_display_vpos);
 
-#if CE_MODE_RGA_OPTIMIZATIONS
-       bool can_fast_ce = currprefs.cpu_memory_cycle_exact && currprefs.cs_optimizations < DISPLAY_OPTIMIZATIONS_NONE;
-       if (can_fast_ce && !fast_mode_ce_not) {
-               if (draw_line_ce_fast()) {
-                       clear_fast_mode_ce();
-                       fast_lines_cnt++;
-                       return;
-               }
-       }
-#endif
-
        int wclks = linear_hpos - (display_hstart_cyclewait_skip - display_hstart_cyclewait_skip2);
        if (wclks > linear_hpos) {
                wclks = linear_hpos;
@@ -10975,15 +10733,6 @@ static void draw_line(void)
        struct linestate *l = NULL;
        if (linear_vpos < MAX_SCANDOUBLED_LINES) {
                l = &lines[linear_vpos][lof_display];
-#if CE_MODE_RGA_OPTIMIZATIONS
-               if (can_fast_ce) {
-                       if (!fast_mode_ce_not) {
-                               storelinestate();
-                       } else {
-                               resetlinestate();
-                       }
-               }
-#endif
        }
 
        int cs = 0;// (beamcon0 & BEAMCON0_VARHSYEN) ? agnus_phsync_end - agnus_phsync_start : agnus_hsync_end - agnus_hsync_start;
@@ -10991,10 +10740,6 @@ static void draw_line(void)
        draw_denise_line_queue(dvp, nextline_how, rga_denise_cycle_line, rga_denise_cycle_start, rga_denise_cycle, rga_denise_cycle_count,
                display_hstart_cyclewait_skip, display_hstart_cyclewait_skip2,
                wclks, cs, cslen, lol, l);
-       
-#if CE_MODE_RGA_OPTIMIZATIONS
-       clear_fast_mode_ce();
-#endif
 }
 
 static void dmal_fast(void)
@@ -11174,7 +10919,7 @@ static void do_draw_line(void)
                quick_denise_rga_queue(rga_denise_cycle_line, rga_denise_cycle_start, rga_denise_cycle);
                next_denise_rga();
                decide_line_end();
-               goto end;
+               return;
        }
        if (!custom_disabled) {
                if (custom_fastmode >= 0) {
@@ -11200,17 +10945,6 @@ static void do_draw_line(void)
        }
 
        decide_line_end();
-
-end:;
-#if CE_MODE_RGA_OPTIMIZATIONS > 1
-       if (currprefs.cpu_memory_cycle_exact) {
-               for (int i = 0; i < MAX_PLANES; i++) {
-                       fast_plane_store16[i] = (uae_u16*)(bpl_line_store + i * 256);
-                       fast_plane_store32[i] = (uae_u32*)(bpl_line_store + i * 256);
-                       fast_plane_store64[i] = (uae_u64*)(bpl_line_store + i * 256);
-               }
-       }
-#endif
 }
 
 static void decide_hsync(void)
index 4319b7d8bf9ffa8f09cd0fba899423f4e4884406..0353155aacda459166f2253e1fdcfd57a02f9e5a 100644 (file)
--- a/debug.cpp
+++ b/debug.cpp
@@ -1465,7 +1465,7 @@ static uae_u32 ledcolor (uae_u32 c, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u
        return v;
 }
 
-static void putpixel(uae_u8 *buf, uae_u16 *genlockbuf, int x, xcolnr c8)
+static void putpixel(uae_u8 *buf, uae_u8 *genlockbuf, int x, xcolnr c8)
 {
        if (x <= 0) {
                return;
@@ -1549,7 +1549,7 @@ static void set_debug_colors(void)
 
 static int cycles_toggle;
 
-static void debug_draw_cycles(uae_u8 *buf, uae_u16 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
+static void debug_draw_cycles(uae_u8 *buf, uae_u8 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
 {
        int y, x, xx, dx, xplus, yplus;
        struct dma_rec *dr;
@@ -1644,7 +1644,7 @@ struct memory_heatmap
        uae_u16 type, extra;
 };
 
-static void debug_draw_heatmap(uae_u8 *buf, uae_u16 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
+static void debug_draw_heatmap(uae_u8 *buf, uae_u8 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
 {
        struct memory_heatmap *mht = heatmap;
        int dx = 16;
@@ -1666,7 +1666,7 @@ static void debug_draw_heatmap(uae_u8 *buf, uae_u16 *genlock, int line, int widt
        }
 }
 
-void debug_draw(uae_u8 *buf, uae_u16 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
+void debug_draw(uae_u8 *buf, uae_u8 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
 {
        if (!heatmap_debug_colors) {
                heatmap_debug_colors = xcalloc(uae_u32, DMARECORD_MAX * HEATMAP_COUNT);
index 48825656b41c04ed21de5cf56a7f17067d321d6d..ddfb53528040cc3b5ab041884ca4a9c413d44f0e 100644 (file)
@@ -51,16 +51,16 @@ extern int multithread_enabled;
 #define MAX_RGA_OVERLAPPING_CYCLES 5
 
 uae_u8 *xlinebuffer, *xlinebuffer2;
-uae_u16 *xlinebuffer_genlock;
+uae_u8 *xlinebuffer_genlock;
 
 static int *amiga2aspect_line_map, *native2amiga_line_map;
 static int native2amiga_line_map_height;
 static uae_u8 **row_map;
-static uae_u16 *row_map_genlock_buffer;
+static uae_u8 *row_map_genlock_buffer;
 static uae_u8 row_tmp8[MAX_PIXELS_PER_LINE * 32 / 8];
-static uae_u16 row_tmp16[MAX_PIXELS_PER_LINE * 32 / 8];
+static uae_u8 row_tmp8g[MAX_PIXELS_PER_LINE * 32 / 8];
 static int max_drawn_amiga_line;
-uae_u16 **row_map_genlock;
+uae_u8 **row_map_genlock;
 uae_u8 *row_map_color_burst_buffer;
 
 static uae_sem_t write_sem, read_sem;
@@ -230,7 +230,6 @@ typedef enum
 
 static void select_lts(void);
 
-static int lores_shift;
 static uae_u32 ham_lastcolor;
 
 int debug_bpl_mask = 0xff, debug_bpl_mask_one;
@@ -435,7 +434,7 @@ static struct dma_rec *debug_dma_ptr;
 static int denise_cycle_half;
 static int denise_vblank_extra, denise_vblank_extra_vbstrt, denise_vblank_extra_vbstop;
 static uae_u32 dtbuf[2][4];
-static uae_u16 dtgbuf[2][4];
+static uae_u8 dtgbuf[2][4];
 
 struct denise_spr
 {
@@ -468,7 +467,7 @@ static int denise_pixtotal, denise_pixtotalv, denise_linecnt, denise_startpos, d
 static int denise_pixtotalskip, denise_pixtotalskip2;
 static int denise_pixtotal_max;
 static uae_u32 *buf1, *buf2, *buf_d;
-static uae_u16 *gbuf;
+static uae_u8 *gbuf, *gbuf_end;
 static uae_u8 pixx0, pixx1, pixx2, pixx3;
 static uae_u32 debug_buf[256 * 2 * 4], debug_bufx[256 * 2 * 4];
 static int hbstrt_offset, hbstop_offset;
@@ -524,12 +523,8 @@ STATIC_INLINE int xshift (int x, int shift)
 
 int coord_native_to_amiga_x (int x)
 {
-       return 0;
-       /*
        x += visible_left_border;
-       x = xshift (x, 1 - lores_shift);
-       return x + 2 * DISPLAY_LEFT_SHIFT - 2 * DIW_DDF_OFFSET;
-       */
+       return x;
 }
 
 int coord_native_to_amiga_y (int y)
@@ -1175,7 +1170,7 @@ void init_row_map(void)
        }
        if (!row_map) {
                row_map = xmalloc(uae_u8 *, max_uae_height + 1);
-               row_map_genlock = xmalloc(uae_u16 *, max_uae_height + 1);
+               row_map_genlock = xmalloc(uae_u8 *, max_uae_height + 1);
        }
 
        if (oldbufmem && oldbufmem == vb->bufmem &&
@@ -1189,7 +1184,7 @@ void init_row_map(void)
        xfree(row_map_genlock_buffer);
        row_map_genlock_buffer = NULL;
        if (init_genlock_data) {
-               row_map_genlock_buffer = xcalloc(uae_u16, vb->width_allocated * (vb->height_allocated + 2));
+               row_map_genlock_buffer = xcalloc(uae_u8, vb->width_allocated * (vb->height_allocated + 2));
        }
        xfree(row_map_color_burst_buffer);
        row_map_color_burst_buffer = NULL;
@@ -1210,7 +1205,7 @@ void init_row_map(void)
        }
        while (i < max_uae_height + 1) {
                row_map[i] = row_tmp8;
-               row_map_genlock[i] = row_tmp16;
+               row_map_genlock[i] = row_tmp8g;
                i++;
        }
        oldvb = vb;
@@ -1237,7 +1232,7 @@ static void center_image (void)
 
        int w = vidinfo->inbuffer->inwidth;
        int ew = vidinfo->inbuffer->extrawidth;
-       int maxdiw = denisehtotal;
+       int maxdiw = denisehtotal >> (RES_MAX - currprefs.gfx_resolution);
 
        if (currprefs.gfx_overscanmode <= OVERSCANMODE_OVERSCAN && currprefs.gfx_xcenter && !fd->gfx_filter_autoscale && max_diwstop > 0) {
 
@@ -1246,7 +1241,7 @@ static void center_image (void)
                        visible_left_border = (max_diwstop - min_diwstart - w) / 2 + min_diwstart;
                else
                        visible_left_border = max_diwstop - w - (max_diwstop - min_diwstart - w) / 2;
-               visible_left_border &= ~((xshift(1, lores_shift)) - 1);
+               visible_left_border &= ~((xshift(1, 0)) - 1);
 
                if (!center_reset && !vertical_changed) {
                        /* Would the old value be good enough? If so, leave it as it is if we want to be clever. */
@@ -1277,24 +1272,28 @@ static void center_image (void)
                }
        }
 
-       if (visible_left_border > denisehtotal - 32)
-               visible_left_border = denisehtotal - 32;
-       //if (visible_left_border < 0)
+       if (visible_left_border > maxdiw - 32) {
+               visible_left_border = maxdiw - 32;
+       }
+       if (visible_left_border < 0) {
                visible_left_border = 0;
-       visible_left_border &= ~((xshift (1, lores_shift)) - 1);
+       }
+       visible_left_border &= ~((xshift (1, 0)) - 1);
 
-       //write_log (_T("%d %d %d %d %d\n"), max_diwlastword, vidinfo->inbuffer->width, lores_shift, currprefs.gfx_resolution, visible_left_border);
+       //write_log (_T("%d %d %d %d\n"), max_diwlastword, vidinfo->inbuffer->width, currprefs.gfx_resolution, visible_left_border);
 
-       linetoscr_x_adjust_pixels = visible_left_border;
+       linetoscr_x_adjust_pixels = 0;// visible_left_border;
        linetoscr_x_adjust_pixbytes = linetoscr_x_adjust_pixels * vidinfo->inbuffer->pixbytes;
 
        visible_right_border = maxdiw + w + ((ew > 0 ? ew : 0) << currprefs.gfx_resolution);
-       if (visible_right_border > maxdiw + ((ew > 0 ? ew : 0) << currprefs.gfx_resolution))
+       if (visible_right_border > maxdiw + ((ew > 0 ? ew : 0) << currprefs.gfx_resolution)) {
                visible_right_border = maxdiw + ((ew > 0 ? ew : 0) << currprefs.gfx_resolution);
+       }
 
        int max_drawn_amiga_line_tmp = max_drawn_amiga_line;
-       if (max_drawn_amiga_line_tmp > vidinfo->inbuffer->inheight)
+       if (max_drawn_amiga_line_tmp > vidinfo->inbuffer->inheight) {
                max_drawn_amiga_line_tmp = vidinfo->inbuffer->inheight;
+       }
        max_drawn_amiga_line_tmp >>= linedbl;
        
        thisframe_y_adjust = minfirstline - 1;
@@ -1523,7 +1522,7 @@ static void init_drawing_frame(void)
 
 static int lightpen_y1[2], lightpen_y2[2];
 
-void putpixel(uae_u8 *buf, uae_u16 *genlockbuf, int x, xcolnr c8)
+void putpixel(uae_u8 *buf, uae_u8 *genlockbuf, int x, xcolnr c8)
 {
        if (x <= 0)
                return;
@@ -1635,7 +1634,7 @@ static void lightpen_update(struct vidbuffer *vb, int lpnum)
                out = true;
        }
 
-       int cx = (((lightpen_x[lpnum] + visible_left_border) >> lores_shift) >> 1) + 29;
+       int cx = ((lightpen_x[lpnum] + visible_left_border) >> 1) + 29;
 
        int cy = lightpen_y[lpnum];
        cy >>= linedbl;
@@ -2743,9 +2742,9 @@ STATIC_INLINE void get_shres_pix(uae_u8 p0, uae_u8 p1, uae_u32 *dpix0, uae_u32 *
        v |= v >> 2;
        *dpix1 = xcolors[v];
 }
-STATIC_INLINE void get_shres_pix_genlock(uae_u8 p0, uae_u8 p1, uae_u32 *dpix0, uae_u32 *dpix1, uae_u16 *gpix0, uae_u16 *gpix1)
+STATIC_INLINE void get_shres_pix_genlock(uae_u8 p0, uae_u8 p1, uae_u32 *dpix0, uae_u32 *dpix1, uae_u8 *gpix0, uae_u8 *gpix1)
 {
-       uae_u16 v;
+       uae_u8 v;
        uae_u8 off = ((p1 & 3) * 4) + (p0 & 3) + ((p0 | p1) & 16);
        v = (denise_colors.color_regs_ecs[off] & 0xccc) << 0;
        v |= v >> 2;
@@ -3651,33 +3650,33 @@ static void expand_drga(struct denise_rga *rd)
                        denise_vsync = (rd->flags & DENISE_RGA_FLAG_VSYNC) != 0;
                        denise_hsync = (rd->flags & DENISE_RGA_FLAG_HSYNC) != 0;
                }
-               if ((rd->flags & DENISE_RGA_FLAG_LOL)) {
+               if (rd->flags & DENISE_RGA_FLAG_LOL) {
                        agnus_lol = (rd->flags & DENISE_RGA_FLAG_LOL_ON) != 0;
                        if (no_denise_lol) {
                                agnus_lol = false;
                                denise_lol_shift_enable = false;
                                denise_lol_shift_prev = 0;
-                               return;
-                       }
-                       if (!agnus_lol && (!denise_lol_shift_prev || denise_lol_shift_enable)) {
-                               int add = 1 << hresolution;
-                               buf1 += add;
-                               buf2 += add;
-                               buf_d += add;
-                               if (gbuf) {
-                                       gbuf += add;
-                               }
-                               denise_lol_shift_prev = add;
-                               denise_lol_shift_enable = true;
-                       } else if (agnus_lol && denise_lol_shift_prev > 0) {
-                               buf1 -= denise_lol_shift_prev;
-                               buf2 -= denise_lol_shift_prev;
-                               buf_d -= denise_lol_shift_prev;
-                               if (gbuf) {
-                                       gbuf -= denise_lol_shift_prev;
+                       } else {
+                               if (!agnus_lol && (!denise_lol_shift_prev || denise_lol_shift_enable)) {
+                                       int add = 1 << hresolution;
+                                       buf1 += add;
+                                       buf2 += add;
+                                       buf_d += add;
+                                       if (gbuf) {
+                                               gbuf += add;
+                                       }
+                                       denise_lol_shift_prev = add;
+                                       denise_lol_shift_enable = true;
+                               } else if (agnus_lol && denise_lol_shift_prev > 0) {
+                                       buf1 -= denise_lol_shift_prev;
+                                       buf2 -= denise_lol_shift_prev;
+                                       buf_d -= denise_lol_shift_prev;
+                                       if (gbuf) {
+                                               gbuf -= denise_lol_shift_prev;
+                                       }
+                                       denise_lol_shift_prev = 0;
+                                       denise_lol_shift_enable = true;
                                }
-                               denise_lol_shift_prev = 0;
-                               denise_lol_shift_enable = true;
                        }
                }
        }
@@ -4881,7 +4880,7 @@ void set_drawbuffer(void)
 {
        struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo;
 
-       if (vidinfo->tempbuffer.bufmem && !drawing_can_lineoptimizations()) {
+       if (!drawing_can_lineoptimizations()) {
                vidinfo->inbuffer = &vidinfo->tempbuffer;
                struct vidbuffer *vb = &vidinfo->tempbuffer;
                if (!vb->outwidth || !vb->outheight) {
@@ -5229,6 +5228,7 @@ static void get_line(int gfx_ypos, enum nln_how how)
        buf2 = (uae_u32*)xlinebuffer2;
        buf_d = debug_bufx;
        gbuf = xlinebuffer_genlock;
+       gbuf_end = gbuf + vb->inwidth;
 
        if (buf1) {
                for (int i = 0; i < denise_lol_shift_prev; i++) {
@@ -5236,7 +5236,7 @@ static void get_line(int gfx_ypos, enum nln_how how)
                        *buf2++ = 0;
                        *buf_d++ = 0;
                        if (gbuf) {
-                               *gbuf++ = 0xffff;
+                               *gbuf++ = 0xff;
                        }
                }
        }
@@ -5356,7 +5356,7 @@ void draw_denise_line(int gfx_ypos, enum nln_how how, uae_u32 linecnt, int start
                uae_u32 *buf1t = buf1;
                uae_u32 *buf2t = buf2;
                uae_u32 *bufdt = buf_d;
-               uae_u16 *bufg = gbuf;
+               uae_u8 *bufg = gbuf;
 
                while (denise_cck < denise_total) {
                        lts();
@@ -5454,7 +5454,7 @@ void draw_denise_line(int gfx_ypos, enum nln_how how, uae_u32 linecnt, int start
                                                        }
                                                        memset(p1, 0, ww * sizeof(uae_u32));
                                                        if (bufg) {
-                                                               uae_u16 *gp1 = (p1 - ptrs) + bufg;
+                                                               uae_u8 *gp1 = (p1 - ptrs) + bufg;
                                                                memset(gp1, 0, ww * sizeof(uae_u16));
                                                        }
                                                }
@@ -5462,7 +5462,7 @@ void draw_denise_line(int gfx_ypos, enum nln_how how, uae_u32 linecnt, int start
                                                if (p1 < ptre && p1 - w >= ptrs) {
                                                        memset(p1 - ww, 0, w * sizeof(uae_u32));
                                                        if (bufg) {
-                                                               uae_u16 *gp1 = (p1 - ptrs) + bufg;
+                                                               uae_u8 *gp1 = (p1 - ptrs) + bufg;
                                                                memset(gp1 - ww, 0, w * sizeof(uae_u16));
                                                        }
                                                }
@@ -5719,7 +5719,7 @@ static void lts_unaligned_aga(int cnt, int cnt_next, int h)
                // bitplanes
                uae_u8 pix = 0;
                uae_u32 dpix_val = BLANK_COLOR;
-               uae_u16 gpix = 0xffff;
+               uae_u8 gpix = 0xff;
                if (!denise_blank_active) {
                        // borderblank ends 1 shres pixel early
                        dpix_val = cnt == denise_brdstop ? denise_colors.acolors[0] : bordercolor;
@@ -5939,7 +5939,7 @@ static void lts_unaligned_ecs(int cnt, int cnt_next, int h)
                // bitplanes
                uae_u32 dpix_val = BLANK_COLOR;
                uae_u8 pix = 0;
-               uae_u16 gpix = 0xffff;
+               uae_u8 gpix = 0xff;
                if (!denise_blank_active) {
                        gpix = 0;
                        // borderblank ends 1 shres pixel early
@@ -6632,6 +6632,7 @@ void draw_denise_border_line_fast(int gfx_ypos, enum nln_how how, struct linesta
 
        uae_u32 *buf1p = buf1;
        uae_u32 *buf2p = buf2 != buf1 ? buf2 : NULL;
+       uae_u8 *gbufp = gbuf;
 
        int rshift = RES_MAX - hresolution;
 
@@ -6658,11 +6659,13 @@ void draw_denise_border_line_fast(int gfx_ypos, enum nln_how how, struct linesta
        buf1 = buf1p;
        buf2 = buf2p;
 
+
        int start = draw_startoffset;
        if (start < hbstop_offset) {
                int diff = hbstop_offset - start;
                buf1 += diff;
                buf2 += diff;
+               gbufp += diff;
                start = hbstop_offset;
        }
        int end = draw_end > hbstrt_offset ? hbstrt_offset : draw_end;
@@ -6713,6 +6716,16 @@ void draw_denise_border_line_fast(int gfx_ypos, enum nln_how how, struct linesta
                }
        }
 
+       total = end - start;
+       if (need_genlock_data && gbuf && total) {
+               int max = gbuf_end - gbufp;
+               total += 8;
+               if (total > max) {
+                       total = max;
+               }
+               memset(gbufp, 0, total);
+       }
+
 }
 
 void draw_denise_bitplane_line_fast(int gfx_ypos, enum nln_how how, struct linestate *ls)
@@ -6788,6 +6801,8 @@ void draw_denise_bitplane_line_fast(int gfx_ypos, enum nln_how how, struct lines
        uae_u32 bgcol;
        if (aga_mode) {
                bgcol = brdblank ? 0x000000 : ls->color0;
+       } else if (res == 2) {
+               bgcol = brdblank ? 0x000000 : bordercolor_ecs_shres;
        } else {
                bgcol = brdblank ? 0x000000 : xcolors[ls->color0];
        }
@@ -6915,6 +6930,16 @@ void draw_denise_bitplane_line_fast(int gfx_ypos, enum nln_how how, struct lines
        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);
 
+       // clear some more bytes to clear possible lightpen cursor graphics
+       if (need_genlock_data && gbuf) {
+               int max = gbuf_end - gbuf;
+               int total = 8;
+               if (total > max) {
+                       total = max;
+               }
+               memset(gbuf, 0, total);
+       }
+
 #else
 
        int cnt = draw_start;
index 35703f716d3001c7498cb5371f003e5a2e6da33f..a487a536a12e226a064ca5affa7efb9a0f4b7461 100644 (file)
@@ -357,7 +357,6 @@ static void gen_sprpix(int i)
        outf("  if (!denise_sprite_blank_active && !sprites_hidden) {");
        outf("  sv%d = svt;", i);
        outf("  }");
-       //gen_shiftspr(i, j);
        outf("}");
 }
 
@@ -381,7 +380,7 @@ static void gen_prepix(int i)
 {
        outf("uae_u8 pix%d = 0;", i);
        if (genlock) {
-               outf("uae_u16 gpix%d = 0xffff;", i);
+               outf("uae_u8 gpix%d = 0xff;", i);
        }
        outf("uae_u32 dpix_val%d = BLANK_COLOR;", i);
 }
@@ -723,7 +722,7 @@ static void gen_pix(void)
                        outf("uae_u32 dpix_val%d = dpix_val%d;", i, i - 1);
                        outf("uae_u8 pix%d = pix%d;", i, i - 1);
                        if (genlock) {
-                               outf("uae_u16 gpix%d = gpix%d;", i, i - 1);
+                               outf("uae_u8 gpix%d = gpix%d;", i, i - 1);
                        }
                        pixcnt++;
                }
@@ -738,7 +737,16 @@ static void gen_pix(void)
                        off <<= (res - outres);
                }
                if (sprt[i]) {
-                       gen_sprmerge(off, 0, outres == 0 ? 0 : (outres == 1 ? 2 : 4));
+                       if (res == 0) {
+                               gen_sprmerge(off, 0, outres == 0 ? 0 : (outres == 1 ? 2 : 4));
+                       } else {
+                               for (int j = 0; j < (1 << outres); j++) {
+                                       if (j > 0) {
+                                               outf("uae_u32 sv%d = sv0;", j);
+                                       }
+                                       gen_sprmerge(off + j, j, 0);
+                               }
+                       }
                }
                if (ntsc) {
                        outf("dtbuf[h][%d] = dpix_val%d;", off, off);
@@ -876,8 +884,11 @@ static bool gen_fasthead(void)
 
 static void gen_fastdraw_mode(int off, int total)
 {
+       int doubling = outres - res;
+
        if (aga) {
                outf("c = *cp;");
+               outf("clxdat |= bplcoltable[c];");
                outf("cp += cpadds[%d];", off);
                if (modes == CMODE_DUALPF) {
                        outf("{");
@@ -905,8 +916,42 @@ static void gen_fastdraw_mode(int off, int total)
                        outf("c ^= bxor;");
                        outf("col = colors_aga[c];");
                }
+       } else if (res == 2) { // ECS shres
+               outf("uae_u8 c0 = *cp++;");
+               outf("uae_u8 c1 = *cp++;");
+               if (doubling == -2) {
+                       outf("cp += 2;");
+               }
+               outf("uae_u32 dpix_val0, dpix_val1;");
+               if (genlock) {
+                       outf("uae_u8 gpix0, gpix1;");
+                       outf("get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);");
+               } else {
+                       outf("get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);");
+               }
+               outf("*buf1++ = dpix_val0;");
+               if (doubling == 0) {
+                       outf("*buf1++ = dpix_val1;");
+               }
+               if (isbuf2) {
+                       outf("*buf2++ = dpix_val0;");
+                       if (doubling == 0) {
+                               outf("*buf2++ = dpix_val1;");
+                       }
+               }
+               if (genlock) {
+                       outf("*gbuf++ = gpix0;");
+                       if (doubling == 0) {
+                               outf("*gbuf++ = gpix1;");
+                       }
+               }
+               if (doubling == 0) {
+                       outf("cnt += bufaddv;");
+               }
+               return;
        } else {
                outf("c = *cp;");
+               outf("clxdat |= bplcoltable[c];");
                if (off == total - 1) {
                        outf("cp += cpaddv;");
                }
@@ -935,7 +980,7 @@ static void gen_fastdraw_mode(int off, int total)
                outf("*buf2++ = col;");
        }
        if (genlock) {
-               outf("gpix = get_genlock_transparency_fast(col);");
+               outf("gpix = get_genlock_transparency_fast(c);");
                outf("*gbuf++ = gpix;");
        }
 }
@@ -955,7 +1000,7 @@ static void gen_fastdraw(void)
        outf("int bufaddv = 1 << bufadd;");
        outf("int cpaddv = 1 << cpadd;");
        if (genlock) {
-               outf("uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);");
+               outf("uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);");
        }
 
        outf("int end = draw_end;");
@@ -1046,9 +1091,11 @@ static void gen_fastdraw(void)
        outf("  }");
        outf("} else {");
        outf("bpl = true;");
-       outf("uae_u8 c;");
-       outf("uae_u32 col;");
-       if (doubling <= 0) {
+       if (res < 2 || aga) {
+               outf("uae_u8 c;");
+               outf("uae_u32 col;");
+       }
+       if (doubling <= 0 || (res == 2 && !aga)) {
                gen_fastdraw_mode(0, 1);
        } else if (doubling == 1) {
                gen_fastdraw_mode(0, 2);
@@ -1503,6 +1550,7 @@ int main (int argc, char *argv[])
                        outf("shiftbpl2();");
                        outf("}");
                        gen_copybpl();
+                       outf("internal_pixel_cnt += 4;");
                        gen_end();
                        gen_tail();
                }
index c10f1f7f12a2ee3be154bc5f9c110cd692c63430..89767646043ffd384acb5c77ed9a0ea21f09c5d9 100644 (file)
@@ -337,7 +337,7 @@ extern void record_rom_access(uaecptr, uae_u32 value, int size, bool rw);
 extern void record_dma_ipl(void);
 extern void record_dma_ipl_sample(void);
 extern void debug_mark_refreshed(uaecptr);
-extern void debug_draw(uae_u8 *buf, uae_u16 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors);
+extern void debug_draw(uae_u8 *buf, uae_u8 *genlock, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors);
 extern struct dma_rec *record_dma_next_cycle(int hpos, int vpos, int vvpos);
 
 #define TRACE_SKIP_INS 1
index 618400fcd7739b4068d55c7e33d7ac4d87612f63..eec0fb5fbaf4cf2e199eea06db190aea5ecc21c8 100644 (file)
@@ -127,7 +127,7 @@ extern void check_custom_limits (void);
 extern void get_custom_topedge (int *x, int *y, bool max);
 extern void get_custom_raw_limits (int *pw, int *ph, int *pdx, int *pdy);
 void get_custom_mouse_limits (int *pw, int *ph, int *pdx, int *pdy, int dbl);
-extern void putpixel (uae_u8 *buf, uae_u16 *genlockbuf, int x, xcolnr c8);
+extern void putpixel(uae_u8 *buf, uae_u8 *genlockbuf, int x, xcolnr c8);
 extern void allocvidbuffer(int monid, struct vidbuffer *buf, int width, int height, int depth);
 extern void freevidbuffer(int monid, struct vidbuffer *buf);
 extern void check_prefs_picasso(void);
index 35e8ed15a3e3d73a64cb5bb7bbc24b19bf458ce9..6cce91c01139ddbd39fbe1003b66588bd25f729b 100644 (file)
@@ -39,6 +39,7 @@ static void lts_aga_n_ilores_dlores_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -85,6 +86,7 @@ static void lts_aga_dpf_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -137,6 +139,7 @@ static void lts_aga_ehb_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -188,6 +191,7 @@ static void lts_aga_ham_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -233,6 +237,7 @@ static void lts_aga_kehb_ilores_dlores_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -279,6 +284,7 @@ static void lts_aga_n_ihires_dlores_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -325,6 +331,7 @@ static void lts_aga_dpf_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -377,6 +384,7 @@ static void lts_aga_ehb_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -428,6 +436,7 @@ static void lts_aga_ham_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -473,6 +482,7 @@ static void lts_aga_kehb_ihires_dlores_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -519,6 +529,7 @@ static void lts_aga_n_ishres_dlores_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -565,6 +576,7 @@ static void lts_aga_dpf_ishres_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -617,6 +629,7 @@ static void lts_aga_ehb_ishres_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -668,6 +681,7 @@ static void lts_aga_ham_ishres_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -713,6 +727,7 @@ static void lts_aga_kehb_ishres_dlores_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -760,11 +775,13 @@ static void lts_aga_n_ilores_dhires_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -812,6 +829,7 @@ static void lts_aga_dpf_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -823,6 +841,7 @@ static void lts_aga_dpf_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -876,6 +895,7 @@ static void lts_aga_ehb_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -886,6 +906,7 @@ static void lts_aga_ehb_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -938,10 +959,12 @@ static void lts_aga_ham_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -988,11 +1011,13 @@ static void lts_aga_kehb_ilores_dhires_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -1039,6 +1064,7 @@ static void lts_aga_n_ihires_dhires_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -1085,6 +1111,7 @@ static void lts_aga_dpf_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1137,6 +1164,7 @@ static void lts_aga_ehb_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1188,6 +1216,7 @@ static void lts_aga_ham_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -1233,6 +1262,7 @@ static void lts_aga_kehb_ihires_dhires_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -1279,6 +1309,7 @@ static void lts_aga_n_ishres_dhires_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -1325,6 +1356,7 @@ static void lts_aga_dpf_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1377,6 +1409,7 @@ static void lts_aga_ehb_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1428,6 +1461,7 @@ static void lts_aga_ham_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -1473,6 +1507,7 @@ static void lts_aga_kehb_ishres_dhires_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -1522,21 +1557,25 @@ static void lts_aga_n_ilores_dshres_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -1586,6 +1625,7 @@ static void lts_aga_dpf_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1597,6 +1637,7 @@ static void lts_aga_dpf_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1608,6 +1649,7 @@ static void lts_aga_dpf_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1619,6 +1661,7 @@ static void lts_aga_dpf_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1674,6 +1717,7 @@ static void lts_aga_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1684,6 +1728,7 @@ static void lts_aga_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1694,6 +1739,7 @@ static void lts_aga_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1704,6 +1750,7 @@ static void lts_aga_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1758,18 +1805,22 @@ static void lts_aga_ham_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -1818,21 +1869,25 @@ static void lts_aga_kehb_ilores_dshres_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -1880,11 +1935,13 @@ static void lts_aga_n_ihires_dshres_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -1932,6 +1989,7 @@ static void lts_aga_dpf_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1943,6 +2001,7 @@ static void lts_aga_dpf_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1996,6 +2055,7 @@ static void lts_aga_ehb_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -2006,6 +2066,7 @@ static void lts_aga_ehb_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -2058,10 +2119,12 @@ static void lts_aga_ham_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -2108,11 +2171,13 @@ static void lts_aga_kehb_ihires_dshres_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -2159,6 +2224,7 @@ static void lts_aga_n_ishres_dshres_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -2205,6 +2271,7 @@ static void lts_aga_dpf_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2257,6 +2324,7 @@ static void lts_aga_ehb_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -2308,6 +2376,7 @@ static void lts_aga_ham_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -2353,6 +2422,7 @@ static void lts_aga_kehb_ishres_dshres_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -2401,6 +2471,7 @@ static void lts_aga_n_ilores_dlores_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -2450,6 +2521,7 @@ static void lts_aga_dpf_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2505,6 +2577,7 @@ static void lts_aga_ehb_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -2559,6 +2632,7 @@ static void lts_aga_ham_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -2607,6 +2681,7 @@ static void lts_aga_kehb_ilores_dlores_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -2656,6 +2731,7 @@ static void lts_aga_n_ihires_dlores_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -2705,6 +2781,7 @@ static void lts_aga_dpf_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2760,6 +2837,7 @@ static void lts_aga_ehb_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -2814,6 +2892,7 @@ static void lts_aga_ham_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -2862,6 +2941,7 @@ static void lts_aga_kehb_ihires_dlores_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -2911,6 +2991,7 @@ static void lts_aga_n_ishres_dlores_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -2960,6 +3041,7 @@ static void lts_aga_dpf_ishres_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3015,6 +3097,7 @@ static void lts_aga_ehb_ishres_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -3069,6 +3152,7 @@ static void lts_aga_ham_ishres_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -3117,6 +3201,7 @@ static void lts_aga_kehb_ishres_dlores_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -3168,12 +3253,14 @@ static void lts_aga_n_ilores_dhires_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -3225,6 +3312,7 @@ static void lts_aga_dpf_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3237,6 +3325,7 @@ static void lts_aga_dpf_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3294,6 +3383,7 @@ static void lts_aga_ehb_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -3305,6 +3395,7 @@ static void lts_aga_ehb_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -3361,11 +3452,13 @@ static void lts_aga_ham_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -3416,12 +3509,14 @@ static void lts_aga_kehb_ilores_dhires_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -3471,6 +3566,7 @@ static void lts_aga_n_ihires_dhires_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -3520,6 +3616,7 @@ static void lts_aga_dpf_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3575,6 +3672,7 @@ static void lts_aga_ehb_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -3629,6 +3727,7 @@ static void lts_aga_ham_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -3677,6 +3776,7 @@ static void lts_aga_kehb_ihires_dhires_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -3726,6 +3826,7 @@ static void lts_aga_n_ishres_dhires_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -3775,6 +3876,7 @@ static void lts_aga_dpf_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3830,6 +3932,7 @@ static void lts_aga_ehb_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -3884,6 +3987,7 @@ static void lts_aga_ham_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -3932,6 +4036,7 @@ static void lts_aga_kehb_ishres_dhires_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -3987,24 +4092,28 @@ static void lts_aga_n_ilores_dshres_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -4060,6 +4169,7 @@ static void lts_aga_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4072,6 +4182,7 @@ static void lts_aga_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4084,6 +4195,7 @@ static void lts_aga_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4096,6 +4208,7 @@ static void lts_aga_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4157,6 +4270,7 @@ static void lts_aga_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4168,6 +4282,7 @@ static void lts_aga_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4179,6 +4294,7 @@ static void lts_aga_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4190,6 +4306,7 @@ static void lts_aga_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4250,21 +4367,25 @@ static void lts_aga_ham_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -4319,24 +4440,28 @@ static void lts_aga_kehb_ilores_dshres_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -4388,12 +4513,14 @@ static void lts_aga_n_ihires_dshres_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -4445,6 +4572,7 @@ static void lts_aga_dpf_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4457,6 +4585,7 @@ static void lts_aga_dpf_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4514,6 +4643,7 @@ static void lts_aga_ehb_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4525,6 +4655,7 @@ static void lts_aga_ehb_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4581,11 +4712,13 @@ static void lts_aga_ham_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -4636,12 +4769,14 @@ static void lts_aga_kehb_ihires_dshres_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
@@ -4691,6 +4826,7 @@ static void lts_aga_n_ishres_dshres_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
@@ -4740,6 +4876,7 @@ static void lts_aga_dpf_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4795,6 +4932,7 @@ static void lts_aga_ehb_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4849,6 +4987,7 @@ static void lts_aga_ham_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
@@ -4897,6 +5036,7 @@ static void lts_aga_kehb_ishres_dshres_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
index 88b0fa365860d099d36c3f29f1bae3dccd28fe44..09aa784b19c0301aedc844834cbebaf60b5863a0 100644 (file)
@@ -17,7 +17,7 @@ static void lts_aga_fm0_n0_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -80,7 +80,7 @@ static void lts_aga_fm0_n1_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -146,7 +146,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -214,7 +214,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -309,7 +309,7 @@ static void lts_aga_fm0_n0_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -372,7 +372,7 @@ static void lts_aga_fm0_n1_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -438,7 +438,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -506,7 +506,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -585,7 +585,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -648,7 +648,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -723,7 +723,7 @@ static void lts_aga_fm0_n0_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -803,7 +803,7 @@ static void lts_aga_fm0_n1_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -886,7 +886,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -971,7 +971,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1083,7 +1083,7 @@ static void lts_aga_fm0_n0_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1163,7 +1163,7 @@ static void lts_aga_fm0_n1_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1246,7 +1246,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1331,7 +1331,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1427,7 +1427,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1507,7 +1507,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1597,7 +1597,7 @@ static void lts_aga_fm0_n0_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1661,7 +1661,7 @@ static void lts_aga_fm0_n1_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1728,7 +1728,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1797,7 +1797,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1934,7 +1934,7 @@ static void lts_aga_fm0_n0_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2015,7 +2015,7 @@ static void lts_aga_fm0_n1_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2099,7 +2099,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2185,7 +2185,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2497,7 +2497,7 @@ static void lts_aga_fm0_n0_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2524,7 +2524,7 @@ static void lts_aga_fm0_n0_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -2604,7 +2604,7 @@ static void lts_aga_fm0_n1_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2642,7 +2642,7 @@ static void lts_aga_fm0_n1_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -2733,7 +2733,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2765,7 +2765,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -2850,7 +2850,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2893,7 +2893,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -3013,7 +3013,7 @@ static void lts_aga_fm0_n0_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3040,7 +3040,7 @@ static void lts_aga_fm0_n0_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -3120,7 +3120,7 @@ static void lts_aga_fm0_n1_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3158,7 +3158,7 @@ static void lts_aga_fm0_n1_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -3249,7 +3249,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3281,7 +3281,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -3366,7 +3366,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3409,7 +3409,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -3513,7 +3513,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3540,7 +3540,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -3620,7 +3620,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3658,7 +3658,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -3758,7 +3758,7 @@ static void lts_aga_fm0_n0_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3794,7 +3794,7 @@ static void lts_aga_fm0_n0_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -3899,7 +3899,7 @@ static void lts_aga_fm0_n1_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3946,7 +3946,7 @@ static void lts_aga_fm0_n1_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4062,7 +4062,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4103,7 +4103,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4213,7 +4213,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4265,7 +4265,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4410,7 +4410,7 @@ static void lts_aga_fm0_n0_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4446,7 +4446,7 @@ static void lts_aga_fm0_n0_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4551,7 +4551,7 @@ static void lts_aga_fm0_n1_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4598,7 +4598,7 @@ static void lts_aga_fm0_n1_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4714,7 +4714,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4755,7 +4755,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4865,7 +4865,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4917,7 +4917,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5046,7 +5046,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5082,7 +5082,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5187,7 +5187,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5234,7 +5234,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5357,7 +5357,7 @@ static void lts_aga_fm0_n0_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5378,7 +5378,7 @@ static void lts_aga_fm0_n0_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5452,7 +5452,7 @@ static void lts_aga_fm0_n1_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5476,7 +5476,7 @@ static void lts_aga_fm0_n1_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5553,7 +5553,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5579,7 +5579,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5658,7 +5658,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5687,7 +5687,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5834,7 +5834,7 @@ static void lts_aga_fm0_n0_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5864,7 +5864,7 @@ static void lts_aga_fm0_n0_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5963,7 +5963,7 @@ static void lts_aga_fm0_n1_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5996,7 +5996,7 @@ static void lts_aga_fm0_n1_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6098,7 +6098,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6133,7 +6133,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6237,7 +6237,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6275,7 +6275,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6605,7 +6605,7 @@ static void lts_aga_fm0_n0_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6632,7 +6632,7 @@ static void lts_aga_fm0_n0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -6659,7 +6659,7 @@ static void lts_aga_fm0_n0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6686,7 +6686,7 @@ static void lts_aga_fm0_n0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -6788,7 +6788,7 @@ static void lts_aga_fm0_n1_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6826,7 +6826,7 @@ static void lts_aga_fm0_n1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -6864,7 +6864,7 @@ static void lts_aga_fm0_n1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6902,7 +6902,7 @@ static void lts_aga_fm0_n1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -7015,7 +7015,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7047,7 +7047,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -7079,7 +7079,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7111,7 +7111,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -7218,7 +7218,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7261,7 +7261,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -7304,7 +7304,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7347,7 +7347,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -7489,7 +7489,7 @@ static void lts_aga_fm0_n0_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7516,7 +7516,7 @@ static void lts_aga_fm0_n0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -7543,7 +7543,7 @@ static void lts_aga_fm0_n0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7570,7 +7570,7 @@ static void lts_aga_fm0_n0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -7672,7 +7672,7 @@ static void lts_aga_fm0_n1_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7710,7 +7710,7 @@ static void lts_aga_fm0_n1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -7748,7 +7748,7 @@ static void lts_aga_fm0_n1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7786,7 +7786,7 @@ static void lts_aga_fm0_n1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -7899,7 +7899,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7931,7 +7931,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -7963,7 +7963,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7995,7 +7995,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -8102,7 +8102,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8145,7 +8145,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -8188,7 +8188,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8231,7 +8231,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -8357,7 +8357,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8384,7 +8384,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -8411,7 +8411,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8438,7 +8438,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -8540,7 +8540,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8578,7 +8578,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -8616,7 +8616,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8654,7 +8654,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -8776,7 +8776,7 @@ static void lts_aga_fm0_n0_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8812,7 +8812,7 @@ static void lts_aga_fm0_n0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -8848,7 +8848,7 @@ static void lts_aga_fm0_n0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8884,7 +8884,7 @@ static void lts_aga_fm0_n0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -9027,7 +9027,7 @@ static void lts_aga_fm0_n1_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9074,7 +9074,7 @@ static void lts_aga_fm0_n1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -9121,7 +9121,7 @@ static void lts_aga_fm0_n1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9168,7 +9168,7 @@ static void lts_aga_fm0_n1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -9322,7 +9322,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9363,7 +9363,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -9404,7 +9404,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9445,7 +9445,7 @@ static void lts_aga_fm0_dpf0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -9593,7 +9593,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9645,7 +9645,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -9697,7 +9697,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9749,7 +9749,7 @@ static void lts_aga_fm0_dpf1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -9932,7 +9932,7 @@ static void lts_aga_fm0_n0_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9968,7 +9968,7 @@ static void lts_aga_fm0_n0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -10004,7 +10004,7 @@ static void lts_aga_fm0_n0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10040,7 +10040,7 @@ static void lts_aga_fm0_n0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -10183,7 +10183,7 @@ static void lts_aga_fm0_n1_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10230,7 +10230,7 @@ static void lts_aga_fm0_n1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -10277,7 +10277,7 @@ static void lts_aga_fm0_n1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10324,7 +10324,7 @@ static void lts_aga_fm0_n1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -10478,7 +10478,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10519,7 +10519,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -10560,7 +10560,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10601,7 +10601,7 @@ static void lts_aga_fm0_dpf0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -10749,7 +10749,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10801,7 +10801,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -10853,7 +10853,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10905,7 +10905,7 @@ static void lts_aga_fm0_dpf1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -11072,7 +11072,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11108,7 +11108,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -11144,7 +11144,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11180,7 +11180,7 @@ static void lts_aga_fm0_ham0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -11323,7 +11323,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11370,7 +11370,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -11417,7 +11417,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11464,7 +11464,7 @@ static void lts_aga_fm0_ham1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -11625,7 +11625,7 @@ static void lts_aga_fm0_n0_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11652,7 +11652,7 @@ static void lts_aga_fm0_n0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -11679,7 +11679,7 @@ static void lts_aga_fm0_n0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11706,7 +11706,7 @@ static void lts_aga_fm0_n0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -11808,7 +11808,7 @@ static void lts_aga_fm0_n1_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11846,7 +11846,7 @@ static void lts_aga_fm0_n1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -11884,7 +11884,7 @@ static void lts_aga_fm0_n1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11922,7 +11922,7 @@ static void lts_aga_fm0_n1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -12035,7 +12035,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12067,7 +12067,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -12099,7 +12099,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12131,7 +12131,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -12238,7 +12238,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12281,7 +12281,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -12324,7 +12324,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12367,7 +12367,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -12550,7 +12550,7 @@ static void lts_aga_fm0_n0_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12586,7 +12586,7 @@ static void lts_aga_fm0_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -12622,7 +12622,7 @@ static void lts_aga_fm0_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12658,7 +12658,7 @@ static void lts_aga_fm0_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -12801,7 +12801,7 @@ static void lts_aga_fm0_n1_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12848,7 +12848,7 @@ static void lts_aga_fm0_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -12895,7 +12895,7 @@ static void lts_aga_fm0_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12942,7 +12942,7 @@ static void lts_aga_fm0_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -13096,7 +13096,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -13137,7 +13137,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -13178,7 +13178,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -13219,7 +13219,7 @@ static void lts_aga_fm0_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -13367,7 +13367,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -13419,7 +13419,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -13471,7 +13471,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -13523,7 +13523,7 @@ static void lts_aga_fm0_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
index bf3037b5638d353a2881a593e549de4b37e5b40d..daca8c5f5c9ba843735963a54c86c2c693edb605 100644 (file)
@@ -17,7 +17,7 @@ static void lts_aga_fm1_n0_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -80,7 +80,7 @@ static void lts_aga_fm1_n1_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -146,7 +146,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -214,7 +214,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -309,7 +309,7 @@ static void lts_aga_fm1_n0_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -372,7 +372,7 @@ static void lts_aga_fm1_n1_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -438,7 +438,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -506,7 +506,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -585,7 +585,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -648,7 +648,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -723,7 +723,7 @@ static void lts_aga_fm1_n0_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -803,7 +803,7 @@ static void lts_aga_fm1_n1_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -886,7 +886,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -971,7 +971,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1083,7 +1083,7 @@ static void lts_aga_fm1_n0_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1163,7 +1163,7 @@ static void lts_aga_fm1_n1_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1246,7 +1246,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1331,7 +1331,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1427,7 +1427,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1507,7 +1507,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1597,7 +1597,7 @@ static void lts_aga_fm1_n0_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1661,7 +1661,7 @@ static void lts_aga_fm1_n1_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1728,7 +1728,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1797,7 +1797,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1893,7 +1893,7 @@ static void lts_aga_fm1_n0_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1957,7 +1957,7 @@ static void lts_aga_fm1_n1_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2024,7 +2024,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2093,7 +2093,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2173,7 +2173,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2193,7 +2193,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dlores_genlock(void)
                        loaded_pix = getbpl8_32(); 
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -2253,7 +2253,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2276,7 +2276,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dlores_genlock(void)
                        loaded_pix = getbpl8_32(); 
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -2348,7 +2348,7 @@ static void lts_aga_fm1_n0_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2429,7 +2429,7 @@ static void lts_aga_fm1_n1_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2513,7 +2513,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2599,7 +2599,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2712,7 +2712,7 @@ static void lts_aga_fm1_n0_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2793,7 +2793,7 @@ static void lts_aga_fm1_n1_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2877,7 +2877,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2963,7 +2963,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3060,7 +3060,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3088,7 +3088,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dlores_spr_genlock(void)
                        }
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -3157,7 +3157,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3188,7 +3188,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dlores_spr_genlock(void)
                        }
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -3267,7 +3267,7 @@ static void lts_aga_fm1_n0_p4_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3333,7 +3333,7 @@ static void lts_aga_fm1_n1_p4_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3402,7 +3402,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3473,7 +3473,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3612,7 +3612,7 @@ static void lts_aga_fm1_n0_p4_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3695,7 +3695,7 @@ static void lts_aga_fm1_n1_p4_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3781,7 +3781,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3869,7 +3869,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4023,7 +4023,7 @@ static void lts_aga_fm1_n0_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4050,7 +4050,7 @@ static void lts_aga_fm1_n0_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4130,7 +4130,7 @@ static void lts_aga_fm1_n1_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4168,7 +4168,7 @@ static void lts_aga_fm1_n1_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4259,7 +4259,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4291,7 +4291,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4376,7 +4376,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4419,7 +4419,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4539,7 +4539,7 @@ static void lts_aga_fm1_n0_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4566,7 +4566,7 @@ static void lts_aga_fm1_n0_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4646,7 +4646,7 @@ static void lts_aga_fm1_n1_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4684,7 +4684,7 @@ static void lts_aga_fm1_n1_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4775,7 +4775,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4807,7 +4807,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -4892,7 +4892,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4935,7 +4935,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5039,7 +5039,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5066,7 +5066,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5146,7 +5146,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5184,7 +5184,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5284,7 +5284,7 @@ static void lts_aga_fm1_n0_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5320,7 +5320,7 @@ static void lts_aga_fm1_n0_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5425,7 +5425,7 @@ static void lts_aga_fm1_n1_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5472,7 +5472,7 @@ static void lts_aga_fm1_n1_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5588,7 +5588,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5629,7 +5629,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5739,7 +5739,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5791,7 +5791,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5936,7 +5936,7 @@ static void lts_aga_fm1_n0_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5972,7 +5972,7 @@ static void lts_aga_fm1_n0_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6077,7 +6077,7 @@ static void lts_aga_fm1_n1_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6124,7 +6124,7 @@ static void lts_aga_fm1_n1_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6240,7 +6240,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6281,7 +6281,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6391,7 +6391,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6443,7 +6443,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6572,7 +6572,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6608,7 +6608,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6713,7 +6713,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6760,7 +6760,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6883,7 +6883,7 @@ static void lts_aga_fm1_n0_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6904,7 +6904,7 @@ static void lts_aga_fm1_n0_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6978,7 +6978,7 @@ static void lts_aga_fm1_n1_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7002,7 +7002,7 @@ static void lts_aga_fm1_n1_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7079,7 +7079,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7105,7 +7105,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7184,7 +7184,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7213,7 +7213,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7319,7 +7319,7 @@ static void lts_aga_fm1_n0_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7340,7 +7340,7 @@ static void lts_aga_fm1_n0_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7414,7 +7414,7 @@ static void lts_aga_fm1_n1_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7438,7 +7438,7 @@ static void lts_aga_fm1_n1_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7515,7 +7515,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7541,7 +7541,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7620,7 +7620,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7649,7 +7649,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7739,7 +7739,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7760,7 +7760,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7834,7 +7834,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7858,7 +7858,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7944,7 +7944,7 @@ static void lts_aga_fm1_n0_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7974,7 +7974,7 @@ static void lts_aga_fm1_n0_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8073,7 +8073,7 @@ static void lts_aga_fm1_n1_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8106,7 +8106,7 @@ static void lts_aga_fm1_n1_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8208,7 +8208,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8243,7 +8243,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8347,7 +8347,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8385,7 +8385,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8516,7 +8516,7 @@ static void lts_aga_fm1_n0_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8546,7 +8546,7 @@ static void lts_aga_fm1_n0_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8645,7 +8645,7 @@ static void lts_aga_fm1_n1_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8678,7 +8678,7 @@ static void lts_aga_fm1_n1_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8780,7 +8780,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8815,7 +8815,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8919,7 +8919,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8957,7 +8957,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9072,7 +9072,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9102,7 +9102,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9201,7 +9201,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9234,7 +9234,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9343,7 +9343,7 @@ static void lts_aga_fm1_n0_p4_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9365,7 +9365,7 @@ static void lts_aga_fm1_n0_p4_ishres_dhires_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9440,7 +9440,7 @@ static void lts_aga_fm1_n1_p4_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9465,7 +9465,7 @@ static void lts_aga_fm1_n1_p4_ishres_dhires_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9543,7 +9543,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9570,7 +9570,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dhires_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9650,7 +9650,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9680,7 +9680,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dhires_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9828,7 +9828,7 @@ static void lts_aga_fm1_n0_p4_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9859,7 +9859,7 @@ static void lts_aga_fm1_n0_p4_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9959,7 +9959,7 @@ static void lts_aga_fm1_n1_p4_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9993,7 +9993,7 @@ static void lts_aga_fm1_n1_p4_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10096,7 +10096,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10132,7 +10132,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10237,7 +10237,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10276,7 +10276,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10447,7 +10447,7 @@ static void lts_aga_fm1_n0_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10474,7 +10474,7 @@ static void lts_aga_fm1_n0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -10501,7 +10501,7 @@ static void lts_aga_fm1_n0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10528,7 +10528,7 @@ static void lts_aga_fm1_n0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -10630,7 +10630,7 @@ static void lts_aga_fm1_n1_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10668,7 +10668,7 @@ static void lts_aga_fm1_n1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -10706,7 +10706,7 @@ static void lts_aga_fm1_n1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10744,7 +10744,7 @@ static void lts_aga_fm1_n1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -10857,7 +10857,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10889,7 +10889,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -10921,7 +10921,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10953,7 +10953,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -11060,7 +11060,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11103,7 +11103,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -11146,7 +11146,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11189,7 +11189,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -11331,7 +11331,7 @@ static void lts_aga_fm1_n0_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11358,7 +11358,7 @@ static void lts_aga_fm1_n0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -11385,7 +11385,7 @@ static void lts_aga_fm1_n0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11412,7 +11412,7 @@ static void lts_aga_fm1_n0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -11514,7 +11514,7 @@ static void lts_aga_fm1_n1_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11552,7 +11552,7 @@ static void lts_aga_fm1_n1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -11590,7 +11590,7 @@ static void lts_aga_fm1_n1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11628,7 +11628,7 @@ static void lts_aga_fm1_n1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -11741,7 +11741,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11773,7 +11773,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -11805,7 +11805,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11837,7 +11837,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -11944,7 +11944,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11987,7 +11987,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -12030,7 +12030,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12073,7 +12073,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -12199,7 +12199,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12226,7 +12226,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -12253,7 +12253,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12280,7 +12280,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -12382,7 +12382,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12420,7 +12420,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -12458,7 +12458,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12496,7 +12496,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -12618,7 +12618,7 @@ static void lts_aga_fm1_n0_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12654,7 +12654,7 @@ static void lts_aga_fm1_n0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -12690,7 +12690,7 @@ static void lts_aga_fm1_n0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12726,7 +12726,7 @@ static void lts_aga_fm1_n0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -12869,7 +12869,7 @@ static void lts_aga_fm1_n1_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12916,7 +12916,7 @@ static void lts_aga_fm1_n1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -12963,7 +12963,7 @@ static void lts_aga_fm1_n1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -13010,7 +13010,7 @@ static void lts_aga_fm1_n1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -13164,7 +13164,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -13205,7 +13205,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -13246,7 +13246,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -13287,7 +13287,7 @@ static void lts_aga_fm1_dpf0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -13435,7 +13435,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -13487,7 +13487,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -13539,7 +13539,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -13591,7 +13591,7 @@ static void lts_aga_fm1_dpf1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -13774,7 +13774,7 @@ static void lts_aga_fm1_n0_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -13810,7 +13810,7 @@ static void lts_aga_fm1_n0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -13846,7 +13846,7 @@ static void lts_aga_fm1_n0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -13882,7 +13882,7 @@ static void lts_aga_fm1_n0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -14025,7 +14025,7 @@ static void lts_aga_fm1_n1_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -14072,7 +14072,7 @@ static void lts_aga_fm1_n1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -14119,7 +14119,7 @@ static void lts_aga_fm1_n1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -14166,7 +14166,7 @@ static void lts_aga_fm1_n1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -14320,7 +14320,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -14361,7 +14361,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -14402,7 +14402,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -14443,7 +14443,7 @@ static void lts_aga_fm1_dpf0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -14591,7 +14591,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -14643,7 +14643,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -14695,7 +14695,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -14747,7 +14747,7 @@ static void lts_aga_fm1_dpf1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -14914,7 +14914,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -14950,7 +14950,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -14986,7 +14986,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -15022,7 +15022,7 @@ static void lts_aga_fm1_ham0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -15165,7 +15165,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -15212,7 +15212,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -15259,7 +15259,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -15306,7 +15306,7 @@ static void lts_aga_fm1_ham1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -15467,7 +15467,7 @@ static void lts_aga_fm1_n0_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -15494,7 +15494,7 @@ static void lts_aga_fm1_n0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -15521,7 +15521,7 @@ static void lts_aga_fm1_n0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -15548,7 +15548,7 @@ static void lts_aga_fm1_n0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -15650,7 +15650,7 @@ static void lts_aga_fm1_n1_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -15688,7 +15688,7 @@ static void lts_aga_fm1_n1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -15726,7 +15726,7 @@ static void lts_aga_fm1_n1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -15764,7 +15764,7 @@ static void lts_aga_fm1_n1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -15877,7 +15877,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -15909,7 +15909,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -15941,7 +15941,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -15973,7 +15973,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -16080,7 +16080,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -16123,7 +16123,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -16166,7 +16166,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -16209,7 +16209,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -16351,7 +16351,7 @@ static void lts_aga_fm1_n0_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -16378,7 +16378,7 @@ static void lts_aga_fm1_n0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -16405,7 +16405,7 @@ static void lts_aga_fm1_n0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -16432,7 +16432,7 @@ static void lts_aga_fm1_n0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -16534,7 +16534,7 @@ static void lts_aga_fm1_n1_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -16572,7 +16572,7 @@ static void lts_aga_fm1_n1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -16610,7 +16610,7 @@ static void lts_aga_fm1_n1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -16648,7 +16648,7 @@ static void lts_aga_fm1_n1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -16761,7 +16761,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -16793,7 +16793,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -16825,7 +16825,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -16857,7 +16857,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -16964,7 +16964,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -17007,7 +17007,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -17050,7 +17050,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -17093,7 +17093,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -17219,7 +17219,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -17246,7 +17246,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -17273,7 +17273,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -17300,7 +17300,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -17402,7 +17402,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -17440,7 +17440,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -17478,7 +17478,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -17516,7 +17516,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -17638,7 +17638,7 @@ static void lts_aga_fm1_n0_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -17674,7 +17674,7 @@ static void lts_aga_fm1_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -17710,7 +17710,7 @@ static void lts_aga_fm1_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -17746,7 +17746,7 @@ static void lts_aga_fm1_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -17889,7 +17889,7 @@ static void lts_aga_fm1_n1_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -17936,7 +17936,7 @@ static void lts_aga_fm1_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -17983,7 +17983,7 @@ static void lts_aga_fm1_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -18030,7 +18030,7 @@ static void lts_aga_fm1_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -18184,7 +18184,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -18225,7 +18225,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -18266,7 +18266,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -18307,7 +18307,7 @@ static void lts_aga_fm1_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -18455,7 +18455,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -18507,7 +18507,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -18559,7 +18559,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -18611,7 +18611,7 @@ static void lts_aga_fm1_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -18794,7 +18794,7 @@ static void lts_aga_fm1_n0_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -18830,7 +18830,7 @@ static void lts_aga_fm1_n0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -18866,7 +18866,7 @@ static void lts_aga_fm1_n0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -18902,7 +18902,7 @@ static void lts_aga_fm1_n0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -19045,7 +19045,7 @@ static void lts_aga_fm1_n1_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -19092,7 +19092,7 @@ static void lts_aga_fm1_n1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -19139,7 +19139,7 @@ static void lts_aga_fm1_n1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -19186,7 +19186,7 @@ static void lts_aga_fm1_n1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -19340,7 +19340,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -19381,7 +19381,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -19422,7 +19422,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -19463,7 +19463,7 @@ static void lts_aga_fm1_dpf0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -19611,7 +19611,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -19663,7 +19663,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -19715,7 +19715,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -19767,7 +19767,7 @@ static void lts_aga_fm1_dpf1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -19934,7 +19934,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -19970,7 +19970,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -20006,7 +20006,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -20042,7 +20042,7 @@ static void lts_aga_fm1_ham0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -20185,7 +20185,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -20232,7 +20232,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -20279,7 +20279,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -20326,7 +20326,7 @@ static void lts_aga_fm1_ham1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -20487,7 +20487,7 @@ static void lts_aga_fm1_n0_p4_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -20508,7 +20508,7 @@ static void lts_aga_fm1_n0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -20529,7 +20529,7 @@ static void lts_aga_fm1_n0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -20550,7 +20550,7 @@ static void lts_aga_fm1_n0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -20646,7 +20646,7 @@ static void lts_aga_fm1_n1_p4_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -20670,7 +20670,7 @@ static void lts_aga_fm1_n1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -20694,7 +20694,7 @@ static void lts_aga_fm1_n1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -20718,7 +20718,7 @@ static void lts_aga_fm1_n1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -20817,7 +20817,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -20843,7 +20843,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -20869,7 +20869,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -20895,7 +20895,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -20996,7 +20996,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -21025,7 +21025,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -21054,7 +21054,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -21083,7 +21083,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -21252,7 +21252,7 @@ static void lts_aga_fm1_n0_p4_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -21282,7 +21282,7 @@ static void lts_aga_fm1_n0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -21312,7 +21312,7 @@ static void lts_aga_fm1_n0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -21342,7 +21342,7 @@ static void lts_aga_fm1_n0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -21479,7 +21479,7 @@ static void lts_aga_fm1_n1_p4_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -21512,7 +21512,7 @@ static void lts_aga_fm1_n1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -21545,7 +21545,7 @@ static void lts_aga_fm1_n1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -21578,7 +21578,7 @@ static void lts_aga_fm1_n1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -21718,7 +21718,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -21753,7 +21753,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -21788,7 +21788,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -21823,7 +21823,7 @@ static void lts_aga_fm1_dpf0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -21965,7 +21965,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -22003,7 +22003,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -22041,7 +22041,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -22079,7 +22079,7 @@ static void lts_aga_fm1_dpf1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
index 9faca872a4e34da92d3707a81b4df7feeeba7a03..dc14d6d95cebb816a50ea118e839b099affe37a5 100644 (file)
@@ -17,7 +17,7 @@ static void lts_aga_fm2_n0_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -80,7 +80,7 @@ static void lts_aga_fm2_n1_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -146,7 +146,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -214,7 +214,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -309,7 +309,7 @@ static void lts_aga_fm2_n0_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -372,7 +372,7 @@ static void lts_aga_fm2_n1_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -438,7 +438,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -506,7 +506,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -585,7 +585,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -648,7 +648,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -723,7 +723,7 @@ static void lts_aga_fm2_n0_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -803,7 +803,7 @@ static void lts_aga_fm2_n1_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -886,7 +886,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -971,7 +971,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1083,7 +1083,7 @@ static void lts_aga_fm2_n0_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1163,7 +1163,7 @@ static void lts_aga_fm2_n1_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1246,7 +1246,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1331,7 +1331,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1427,7 +1427,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1507,7 +1507,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1597,7 +1597,7 @@ static void lts_aga_fm2_n0_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1661,7 +1661,7 @@ static void lts_aga_fm2_n1_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1728,7 +1728,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1797,7 +1797,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1893,7 +1893,7 @@ static void lts_aga_fm2_n0_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1957,7 +1957,7 @@ static void lts_aga_fm2_n1_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2024,7 +2024,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2093,7 +2093,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2173,7 +2173,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2193,7 +2193,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dlores_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -2253,7 +2253,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2276,7 +2276,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dlores_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -2348,7 +2348,7 @@ static void lts_aga_fm2_n0_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2429,7 +2429,7 @@ static void lts_aga_fm2_n1_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2513,7 +2513,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2599,7 +2599,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2712,7 +2712,7 @@ static void lts_aga_fm2_n0_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2793,7 +2793,7 @@ static void lts_aga_fm2_n1_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2877,7 +2877,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2963,7 +2963,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3060,7 +3060,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3088,7 +3088,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dlores_spr_genlock(void)
                        }
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -3157,7 +3157,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3188,7 +3188,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dlores_spr_genlock(void)
                        }
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -3267,7 +3267,7 @@ static void lts_aga_fm2_n0_p4_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3333,7 +3333,7 @@ static void lts_aga_fm2_n1_p4_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3402,7 +3402,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3473,7 +3473,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3571,7 +3571,7 @@ static void lts_aga_fm2_n0_p8_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3637,7 +3637,7 @@ static void lts_aga_fm2_n1_p8_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3706,7 +3706,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3777,7 +3777,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3859,7 +3859,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3879,7 +3879,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dlores_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -3896,7 +3896,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dlores_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[1] = loaded_pix;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val2 = bordercolor;
@@ -3913,7 +3913,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dlores_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[2] = loaded_pix;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val3 = bordercolor;
@@ -3973,7 +3973,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dlores_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3996,7 +3996,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dlores_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -4016,7 +4016,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dlores_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[1] = loaded_pix;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val2 = bordercolor;
@@ -4036,7 +4036,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dlores_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[2] = loaded_pix;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val3 = bordercolor;
@@ -4108,7 +4108,7 @@ static void lts_aga_fm2_n0_p4_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4191,7 +4191,7 @@ static void lts_aga_fm2_n1_p4_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4277,7 +4277,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4365,7 +4365,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4480,7 +4480,7 @@ static void lts_aga_fm2_n0_p8_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4563,7 +4563,7 @@ static void lts_aga_fm2_n1_p8_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4649,7 +4649,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4737,7 +4737,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4836,7 +4836,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4864,7 +4864,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dlores_spr_genlock(void)
                        }
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -4881,7 +4881,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dlores_spr_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[1] = loaded_pix;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val2 = bordercolor;
@@ -4898,7 +4898,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dlores_spr_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[2] = loaded_pix;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val3 = bordercolor;
@@ -4967,7 +4967,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dlores_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4998,7 +4998,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dlores_spr_genlock(void)
                        }
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -5018,7 +5018,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dlores_spr_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[1] = loaded_pix;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val2 = bordercolor;
@@ -5038,7 +5038,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dlores_spr_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[2] = loaded_pix;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val3 = bordercolor;
@@ -5117,7 +5117,7 @@ static void lts_aga_fm2_n0_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5144,7 +5144,7 @@ static void lts_aga_fm2_n0_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5224,7 +5224,7 @@ static void lts_aga_fm2_n1_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5262,7 +5262,7 @@ static void lts_aga_fm2_n1_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5353,7 +5353,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5385,7 +5385,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5470,7 +5470,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5513,7 +5513,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5633,7 +5633,7 @@ static void lts_aga_fm2_n0_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5660,7 +5660,7 @@ static void lts_aga_fm2_n0_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5740,7 +5740,7 @@ static void lts_aga_fm2_n1_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5778,7 +5778,7 @@ static void lts_aga_fm2_n1_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5869,7 +5869,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5901,7 +5901,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -5986,7 +5986,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6029,7 +6029,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6133,7 +6133,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6160,7 +6160,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6240,7 +6240,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6278,7 +6278,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6378,7 +6378,7 @@ static void lts_aga_fm2_n0_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6414,7 +6414,7 @@ static void lts_aga_fm2_n0_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6519,7 +6519,7 @@ static void lts_aga_fm2_n1_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6566,7 +6566,7 @@ static void lts_aga_fm2_n1_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6682,7 +6682,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6723,7 +6723,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6833,7 +6833,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6885,7 +6885,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7030,7 +7030,7 @@ static void lts_aga_fm2_n0_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7066,7 +7066,7 @@ static void lts_aga_fm2_n0_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7171,7 +7171,7 @@ static void lts_aga_fm2_n1_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7218,7 +7218,7 @@ static void lts_aga_fm2_n1_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7334,7 +7334,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7375,7 +7375,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7485,7 +7485,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7537,7 +7537,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7666,7 +7666,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7702,7 +7702,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7807,7 +7807,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7854,7 +7854,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7977,7 +7977,7 @@ static void lts_aga_fm2_n0_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7998,7 +7998,7 @@ static void lts_aga_fm2_n0_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8072,7 +8072,7 @@ static void lts_aga_fm2_n1_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8096,7 +8096,7 @@ static void lts_aga_fm2_n1_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8173,7 +8173,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8199,7 +8199,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8278,7 +8278,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8307,7 +8307,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8413,7 +8413,7 @@ static void lts_aga_fm2_n0_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8434,7 +8434,7 @@ static void lts_aga_fm2_n0_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8508,7 +8508,7 @@ static void lts_aga_fm2_n1_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8532,7 +8532,7 @@ static void lts_aga_fm2_n1_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8609,7 +8609,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8635,7 +8635,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8714,7 +8714,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8743,7 +8743,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8833,7 +8833,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8854,7 +8854,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -8928,7 +8928,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -8952,7 +8952,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dhires_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9038,7 +9038,7 @@ static void lts_aga_fm2_n0_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9068,7 +9068,7 @@ static void lts_aga_fm2_n0_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9167,7 +9167,7 @@ static void lts_aga_fm2_n1_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9200,7 +9200,7 @@ static void lts_aga_fm2_n1_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9302,7 +9302,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9337,7 +9337,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9441,7 +9441,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9479,7 +9479,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9610,7 +9610,7 @@ static void lts_aga_fm2_n0_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9640,7 +9640,7 @@ static void lts_aga_fm2_n0_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9739,7 +9739,7 @@ static void lts_aga_fm2_n1_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9772,7 +9772,7 @@ static void lts_aga_fm2_n1_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -9874,7 +9874,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -9909,7 +9909,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10013,7 +10013,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10051,7 +10051,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10166,7 +10166,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10196,7 +10196,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10295,7 +10295,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10328,7 +10328,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10437,7 +10437,7 @@ static void lts_aga_fm2_n0_p4_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10459,7 +10459,7 @@ static void lts_aga_fm2_n0_p4_ishres_dhires_genlock(void)
                        shiftbpl4_64();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10534,7 +10534,7 @@ static void lts_aga_fm2_n1_p4_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10559,7 +10559,7 @@ static void lts_aga_fm2_n1_p4_ishres_dhires_genlock(void)
                        shiftbpl4_64();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10637,7 +10637,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10664,7 +10664,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dhires_genlock(void)
                        shiftbpl4_64();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10744,7 +10744,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10774,7 +10774,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dhires_genlock(void)
                        shiftbpl4_64();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10881,7 +10881,7 @@ static void lts_aga_fm2_n0_p8_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -10903,7 +10903,7 @@ static void lts_aga_fm2_n0_p8_ishres_dhires_genlock(void)
                        shiftbpl8_64();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -10978,7 +10978,7 @@ static void lts_aga_fm2_n1_p8_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11003,7 +11003,7 @@ static void lts_aga_fm2_n1_p8_ishres_dhires_genlock(void)
                        shiftbpl8_64();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11081,7 +11081,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11108,7 +11108,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dhires_genlock(void)
                        shiftbpl8_64();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11188,7 +11188,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11218,7 +11218,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dhires_genlock(void)
                        shiftbpl8_64();
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11309,7 +11309,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11329,7 +11329,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dhires_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -11347,7 +11347,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dhires_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11367,7 +11367,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dhires_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[2] = loaded_pix;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val3 = bordercolor;
@@ -11438,7 +11438,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dhires_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11461,7 +11461,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dhires_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -11482,7 +11482,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dhires_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 2;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11505,7 +11505,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dhires_genlock(void)
                        loaded_pix = getbpl8_64();
                        loaded_pixs[2] = loaded_pix;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val3 = bordercolor;
@@ -11588,7 +11588,7 @@ static void lts_aga_fm2_n0_p4_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11619,7 +11619,7 @@ static void lts_aga_fm2_n0_p4_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11719,7 +11719,7 @@ static void lts_aga_fm2_n1_p4_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11753,7 +11753,7 @@ static void lts_aga_fm2_n1_p4_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11856,7 +11856,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -11892,7 +11892,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -11997,7 +11997,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12036,7 +12036,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12168,7 +12168,7 @@ static void lts_aga_fm2_n0_p8_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12199,7 +12199,7 @@ static void lts_aga_fm2_n0_p8_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12299,7 +12299,7 @@ static void lts_aga_fm2_n1_p8_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12333,7 +12333,7 @@ static void lts_aga_fm2_n1_p8_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12436,7 +12436,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12472,7 +12472,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12577,7 +12577,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12616,7 +12616,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12732,7 +12732,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12760,7 +12760,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dhires_spr_genlock(void)
                        }
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -12779,7 +12779,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12807,7 +12807,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dhires_spr_genlock(void)
                        }
                        loaded_pixs[2] = loaded_pix;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val3 = bordercolor;
@@ -12895,7 +12895,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dhires_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -12926,7 +12926,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dhires_spr_genlock(void)
                        }
                        loaded_pixs[0] = loaded_pix;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val1 = bordercolor;
@@ -12948,7 +12948,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -12979,7 +12979,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dhires_spr_genlock(void)
                        }
                        loaded_pixs[2] = loaded_pix;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                dpix_val3 = bordercolor;
@@ -13077,7 +13077,7 @@ static void lts_aga_fm2_n0_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -13104,7 +13104,7 @@ static void lts_aga_fm2_n0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -13131,7 +13131,7 @@ static void lts_aga_fm2_n0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -13158,7 +13158,7 @@ static void lts_aga_fm2_n0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -13260,7 +13260,7 @@ static void lts_aga_fm2_n1_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -13298,7 +13298,7 @@ static void lts_aga_fm2_n1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -13336,7 +13336,7 @@ static void lts_aga_fm2_n1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -13374,7 +13374,7 @@ static void lts_aga_fm2_n1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -13487,7 +13487,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -13519,7 +13519,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -13551,7 +13551,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -13583,7 +13583,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -13690,7 +13690,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -13733,7 +13733,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -13776,7 +13776,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -13819,7 +13819,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -13961,7 +13961,7 @@ static void lts_aga_fm2_n0_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -13988,7 +13988,7 @@ static void lts_aga_fm2_n0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -14015,7 +14015,7 @@ static void lts_aga_fm2_n0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -14042,7 +14042,7 @@ static void lts_aga_fm2_n0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -14144,7 +14144,7 @@ static void lts_aga_fm2_n1_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -14182,7 +14182,7 @@ static void lts_aga_fm2_n1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -14220,7 +14220,7 @@ static void lts_aga_fm2_n1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -14258,7 +14258,7 @@ static void lts_aga_fm2_n1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -14371,7 +14371,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -14403,7 +14403,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -14435,7 +14435,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -14467,7 +14467,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -14574,7 +14574,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -14617,7 +14617,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -14660,7 +14660,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -14703,7 +14703,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -14829,7 +14829,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -14856,7 +14856,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -14883,7 +14883,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -14910,7 +14910,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -15012,7 +15012,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -15050,7 +15050,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -15088,7 +15088,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -15126,7 +15126,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -15248,7 +15248,7 @@ static void lts_aga_fm2_n0_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -15284,7 +15284,7 @@ static void lts_aga_fm2_n0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -15320,7 +15320,7 @@ static void lts_aga_fm2_n0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -15356,7 +15356,7 @@ static void lts_aga_fm2_n0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -15499,7 +15499,7 @@ static void lts_aga_fm2_n1_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -15546,7 +15546,7 @@ static void lts_aga_fm2_n1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -15593,7 +15593,7 @@ static void lts_aga_fm2_n1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -15640,7 +15640,7 @@ static void lts_aga_fm2_n1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -15794,7 +15794,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -15835,7 +15835,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -15876,7 +15876,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -15917,7 +15917,7 @@ static void lts_aga_fm2_dpf0_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -16065,7 +16065,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -16117,7 +16117,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -16169,7 +16169,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -16221,7 +16221,7 @@ static void lts_aga_fm2_dpf1_p4_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -16404,7 +16404,7 @@ static void lts_aga_fm2_n0_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -16440,7 +16440,7 @@ static void lts_aga_fm2_n0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -16476,7 +16476,7 @@ static void lts_aga_fm2_n0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -16512,7 +16512,7 @@ static void lts_aga_fm2_n0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -16655,7 +16655,7 @@ static void lts_aga_fm2_n1_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -16702,7 +16702,7 @@ static void lts_aga_fm2_n1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -16749,7 +16749,7 @@ static void lts_aga_fm2_n1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -16796,7 +16796,7 @@ static void lts_aga_fm2_n1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -16950,7 +16950,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -16991,7 +16991,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -17032,7 +17032,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -17073,7 +17073,7 @@ static void lts_aga_fm2_dpf0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -17221,7 +17221,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -17273,7 +17273,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -17325,7 +17325,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -17377,7 +17377,7 @@ static void lts_aga_fm2_dpf1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -17544,7 +17544,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -17580,7 +17580,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -17616,7 +17616,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -17652,7 +17652,7 @@ static void lts_aga_fm2_ham0_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -17795,7 +17795,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -17842,7 +17842,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -17889,7 +17889,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -17936,7 +17936,7 @@ static void lts_aga_fm2_ham1_p8_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -18097,7 +18097,7 @@ static void lts_aga_fm2_n0_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -18124,7 +18124,7 @@ static void lts_aga_fm2_n0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -18151,7 +18151,7 @@ static void lts_aga_fm2_n0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -18178,7 +18178,7 @@ static void lts_aga_fm2_n0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -18280,7 +18280,7 @@ static void lts_aga_fm2_n1_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -18318,7 +18318,7 @@ static void lts_aga_fm2_n1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -18356,7 +18356,7 @@ static void lts_aga_fm2_n1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -18394,7 +18394,7 @@ static void lts_aga_fm2_n1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -18507,7 +18507,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -18539,7 +18539,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -18571,7 +18571,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -18603,7 +18603,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -18710,7 +18710,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -18753,7 +18753,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -18796,7 +18796,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -18839,7 +18839,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -18981,7 +18981,7 @@ static void lts_aga_fm2_n0_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -19008,7 +19008,7 @@ static void lts_aga_fm2_n0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -19035,7 +19035,7 @@ static void lts_aga_fm2_n0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -19062,7 +19062,7 @@ static void lts_aga_fm2_n0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -19164,7 +19164,7 @@ static void lts_aga_fm2_n1_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -19202,7 +19202,7 @@ static void lts_aga_fm2_n1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -19240,7 +19240,7 @@ static void lts_aga_fm2_n1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -19278,7 +19278,7 @@ static void lts_aga_fm2_n1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -19391,7 +19391,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -19423,7 +19423,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -19455,7 +19455,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -19487,7 +19487,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -19594,7 +19594,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -19637,7 +19637,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -19680,7 +19680,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -19723,7 +19723,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -19849,7 +19849,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -19876,7 +19876,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -19903,7 +19903,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -19930,7 +19930,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -20032,7 +20032,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -20070,7 +20070,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -20108,7 +20108,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -20146,7 +20146,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -20268,7 +20268,7 @@ static void lts_aga_fm2_n0_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -20304,7 +20304,7 @@ static void lts_aga_fm2_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -20340,7 +20340,7 @@ static void lts_aga_fm2_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -20376,7 +20376,7 @@ static void lts_aga_fm2_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -20519,7 +20519,7 @@ static void lts_aga_fm2_n1_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -20566,7 +20566,7 @@ static void lts_aga_fm2_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -20613,7 +20613,7 @@ static void lts_aga_fm2_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -20660,7 +20660,7 @@ static void lts_aga_fm2_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -20814,7 +20814,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -20855,7 +20855,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -20896,7 +20896,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -20937,7 +20937,7 @@ static void lts_aga_fm2_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -21085,7 +21085,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -21137,7 +21137,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -21189,7 +21189,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -21241,7 +21241,7 @@ static void lts_aga_fm2_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -21424,7 +21424,7 @@ static void lts_aga_fm2_n0_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -21460,7 +21460,7 @@ static void lts_aga_fm2_n0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -21496,7 +21496,7 @@ static void lts_aga_fm2_n0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -21532,7 +21532,7 @@ static void lts_aga_fm2_n0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -21675,7 +21675,7 @@ static void lts_aga_fm2_n1_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -21722,7 +21722,7 @@ static void lts_aga_fm2_n1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -21769,7 +21769,7 @@ static void lts_aga_fm2_n1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -21816,7 +21816,7 @@ static void lts_aga_fm2_n1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -21970,7 +21970,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -22011,7 +22011,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -22052,7 +22052,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -22093,7 +22093,7 @@ static void lts_aga_fm2_dpf0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -22241,7 +22241,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -22293,7 +22293,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -22345,7 +22345,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -22397,7 +22397,7 @@ static void lts_aga_fm2_dpf1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -22564,7 +22564,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -22600,7 +22600,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -22636,7 +22636,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -22672,7 +22672,7 @@ static void lts_aga_fm2_ham0_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -22815,7 +22815,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -22862,7 +22862,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -22909,7 +22909,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -22956,7 +22956,7 @@ static void lts_aga_fm2_ham1_p8_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -23117,7 +23117,7 @@ static void lts_aga_fm2_n0_p4_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -23138,7 +23138,7 @@ static void lts_aga_fm2_n0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -23159,7 +23159,7 @@ static void lts_aga_fm2_n0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -23180,7 +23180,7 @@ static void lts_aga_fm2_n0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -23276,7 +23276,7 @@ static void lts_aga_fm2_n1_p4_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -23300,7 +23300,7 @@ static void lts_aga_fm2_n1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -23324,7 +23324,7 @@ static void lts_aga_fm2_n1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -23348,7 +23348,7 @@ static void lts_aga_fm2_n1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -23447,7 +23447,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -23473,7 +23473,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -23499,7 +23499,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -23525,7 +23525,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -23626,7 +23626,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -23655,7 +23655,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -23684,7 +23684,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -23713,7 +23713,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -23841,7 +23841,7 @@ static void lts_aga_fm2_n0_p8_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -23862,7 +23862,7 @@ static void lts_aga_fm2_n0_p8_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -23883,7 +23883,7 @@ static void lts_aga_fm2_n0_p8_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -23904,7 +23904,7 @@ static void lts_aga_fm2_n0_p8_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -24000,7 +24000,7 @@ static void lts_aga_fm2_n1_p8_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -24024,7 +24024,7 @@ static void lts_aga_fm2_n1_p8_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -24048,7 +24048,7 @@ static void lts_aga_fm2_n1_p8_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -24072,7 +24072,7 @@ static void lts_aga_fm2_n1_p8_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -24171,7 +24171,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -24197,7 +24197,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -24223,7 +24223,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -24249,7 +24249,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -24350,7 +24350,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -24379,7 +24379,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -24408,7 +24408,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -24437,7 +24437,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -24549,7 +24549,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -24570,7 +24570,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -24591,7 +24591,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -24612,7 +24612,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -24708,7 +24708,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dshres_genlock(void)
                        int cnt_next = denise_hcounter_next << 2;
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -24732,7 +24732,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dshres_genlock(void)
                        loaded_pixs[0] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -24756,7 +24756,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dshres_genlock(void)
                        loaded_pixs[1] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -24780,7 +24780,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dshres_genlock(void)
                        loaded_pixs[2] = loaded_pix;
                        internal_pixel_cnt += 1;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -24888,7 +24888,7 @@ static void lts_aga_fm2_n0_p4_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -24918,7 +24918,7 @@ static void lts_aga_fm2_n0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -24948,7 +24948,7 @@ static void lts_aga_fm2_n0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -24978,7 +24978,7 @@ static void lts_aga_fm2_n0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -25115,7 +25115,7 @@ static void lts_aga_fm2_n1_p4_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -25148,7 +25148,7 @@ static void lts_aga_fm2_n1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -25181,7 +25181,7 @@ static void lts_aga_fm2_n1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -25214,7 +25214,7 @@ static void lts_aga_fm2_n1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -25354,7 +25354,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -25389,7 +25389,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -25424,7 +25424,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -25459,7 +25459,7 @@ static void lts_aga_fm2_dpf0_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -25601,7 +25601,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -25639,7 +25639,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -25677,7 +25677,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -25715,7 +25715,7 @@ static void lts_aga_fm2_dpf1_p4_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -25884,7 +25884,7 @@ static void lts_aga_fm2_n0_p8_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -25914,7 +25914,7 @@ static void lts_aga_fm2_n0_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -25944,7 +25944,7 @@ static void lts_aga_fm2_n0_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -25974,7 +25974,7 @@ static void lts_aga_fm2_n0_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -26111,7 +26111,7 @@ static void lts_aga_fm2_n1_p8_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -26144,7 +26144,7 @@ static void lts_aga_fm2_n1_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -26177,7 +26177,7 @@ static void lts_aga_fm2_n1_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -26210,7 +26210,7 @@ static void lts_aga_fm2_n1_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -26350,7 +26350,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -26385,7 +26385,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -26420,7 +26420,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -26455,7 +26455,7 @@ static void lts_aga_fm2_dpf0_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -26597,7 +26597,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -26635,7 +26635,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -26673,7 +26673,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -26711,7 +26711,7 @@ static void lts_aga_fm2_dpf1_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -26864,7 +26864,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -26894,7 +26894,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -26924,7 +26924,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -26954,7 +26954,7 @@ static void lts_aga_fm2_ham0_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
@@ -27091,7 +27091,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dshres_spr_genlock(void)
                        if (checkhorizontal1_aga(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites_aga(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -27124,7 +27124,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 1);
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -27157,7 +27157,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 2);
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -27190,7 +27190,7 @@ static void lts_aga_fm2_ham1_p8_ishres_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        matchsprites_aga(cnt + 3);
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix3 = get_genlock_transparency_border();
index 8a80b8bc77b21fe79c511201d53e2e8b59a4e26a..14b89ac20814830ba03596c1c0ce546e31001223 100644 (file)
@@ -10,7 +10,7 @@ static void lts_aga_n_ilores_dlores_b1_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -42,11 +42,12 @@ static void lts_aga_n_ilores_dlores_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -61,7 +62,7 @@ static void lts_aga_dpf_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -93,6 +94,7 @@ static void lts_aga_dpf_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -103,7 +105,7 @@ static void lts_aga_dpf_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -118,7 +120,7 @@ static void lts_aga_ehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -150,6 +152,7 @@ static void lts_aga_ehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -159,7 +162,7 @@ static void lts_aga_ehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -174,7 +177,7 @@ static void lts_aga_ham_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -206,10 +209,11 @@ static void lts_aga_ham_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -224,7 +228,7 @@ static void lts_aga_kehb_ilores_dlores_b1_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -256,11 +260,12 @@ static void lts_aga_kehb_ilores_dlores_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -275,7 +280,7 @@ static void lts_aga_n_ihires_dlores_b1_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -307,11 +312,12 @@ static void lts_aga_n_ihires_dlores_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -326,7 +332,7 @@ static void lts_aga_dpf_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -358,6 +364,7 @@ static void lts_aga_dpf_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -368,7 +375,7 @@ static void lts_aga_dpf_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -383,7 +390,7 @@ static void lts_aga_ehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -415,6 +422,7 @@ static void lts_aga_ehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -424,7 +432,7 @@ static void lts_aga_ehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -439,7 +447,7 @@ static void lts_aga_ham_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -471,10 +479,11 @@ static void lts_aga_ham_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -489,7 +498,7 @@ static void lts_aga_kehb_ihires_dlores_b1_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -521,11 +530,12 @@ static void lts_aga_kehb_ihires_dlores_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -540,7 +550,7 @@ static void lts_aga_n_ishres_dlores_b1_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -572,11 +582,12 @@ static void lts_aga_n_ishres_dlores_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -591,7 +602,7 @@ static void lts_aga_dpf_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -623,6 +634,7 @@ static void lts_aga_dpf_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -633,7 +645,7 @@ static void lts_aga_dpf_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -648,7 +660,7 @@ static void lts_aga_ehb_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -680,6 +692,7 @@ static void lts_aga_ehb_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -689,7 +702,7 @@ static void lts_aga_ehb_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -704,7 +717,7 @@ static void lts_aga_ham_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -736,10 +749,11 @@ static void lts_aga_ham_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -754,7 +768,7 @@ static void lts_aga_kehb_ishres_dlores_b1_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -786,11 +800,12 @@ static void lts_aga_kehb_ishres_dlores_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -805,7 +820,7 @@ static void lts_aga_n_ilores_dhires_b1_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -839,18 +854,20 @@ static void lts_aga_n_ilores_dhires_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -865,7 +882,7 @@ static void lts_aga_dpf_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -899,6 +916,7 @@ static void lts_aga_dpf_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -909,9 +927,10 @@ static void lts_aga_dpf_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -922,7 +941,7 @@ static void lts_aga_dpf_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -937,7 +956,7 @@ static void lts_aga_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -971,6 +990,7 @@ static void lts_aga_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -980,9 +1000,10 @@ static void lts_aga_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -992,7 +1013,7 @@ static void lts_aga_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1007,7 +1028,7 @@ static void lts_aga_ham_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1041,16 +1062,18 @@ static void lts_aga_ham_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1065,7 +1088,7 @@ static void lts_aga_kehb_ilores_dhires_b1_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1099,18 +1122,20 @@ static void lts_aga_kehb_ilores_dhires_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1125,7 +1150,7 @@ static void lts_aga_n_ihires_dhires_b1_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1157,11 +1182,12 @@ static void lts_aga_n_ihires_dhires_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1176,7 +1202,7 @@ static void lts_aga_dpf_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1208,6 +1234,7 @@ static void lts_aga_dpf_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1218,7 +1245,7 @@ static void lts_aga_dpf_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1233,7 +1260,7 @@ static void lts_aga_ehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1265,6 +1292,7 @@ static void lts_aga_ehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1274,7 +1302,7 @@ static void lts_aga_ehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1289,7 +1317,7 @@ static void lts_aga_ham_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1321,10 +1349,11 @@ static void lts_aga_ham_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1339,7 +1368,7 @@ static void lts_aga_kehb_ihires_dhires_b1_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1371,11 +1400,12 @@ static void lts_aga_kehb_ihires_dhires_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1390,7 +1420,7 @@ static void lts_aga_n_ishres_dhires_b1_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1422,11 +1452,12 @@ static void lts_aga_n_ishres_dhires_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1441,7 +1472,7 @@ static void lts_aga_dpf_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1473,6 +1504,7 @@ static void lts_aga_dpf_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1483,7 +1515,7 @@ static void lts_aga_dpf_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1498,7 +1530,7 @@ static void lts_aga_ehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1530,6 +1562,7 @@ static void lts_aga_ehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1539,7 +1572,7 @@ static void lts_aga_ehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1554,7 +1587,7 @@ static void lts_aga_ham_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1586,10 +1619,11 @@ static void lts_aga_ham_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1604,7 +1638,7 @@ static void lts_aga_kehb_ishres_dhires_b1_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1636,11 +1670,12 @@ static void lts_aga_kehb_ishres_dhires_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1655,7 +1690,7 @@ static void lts_aga_n_ilores_dshres_b1_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1693,32 +1728,36 @@ static void lts_aga_n_ilores_dshres_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1733,7 +1772,7 @@ static void lts_aga_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1771,6 +1810,7 @@ static void lts_aga_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1781,9 +1821,10 @@ static void lts_aga_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1794,9 +1835,10 @@ static void lts_aga_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1807,9 +1849,10 @@ static void lts_aga_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1820,7 +1863,7 @@ static void lts_aga_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1835,7 +1878,7 @@ static void lts_aga_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1873,6 +1916,7 @@ static void lts_aga_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1882,9 +1926,10 @@ static void lts_aga_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1894,9 +1939,10 @@ static void lts_aga_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1906,9 +1952,10 @@ static void lts_aga_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -1918,7 +1965,7 @@ static void lts_aga_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1933,7 +1980,7 @@ static void lts_aga_ham_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1971,28 +2018,32 @@ static void lts_aga_ham_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2007,7 +2058,7 @@ static void lts_aga_kehb_ilores_dshres_b1_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2045,32 +2096,36 @@ static void lts_aga_kehb_ilores_dshres_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2085,7 +2140,7 @@ static void lts_aga_n_ihires_dshres_b1_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2119,18 +2174,20 @@ static void lts_aga_n_ihires_dshres_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2145,7 +2202,7 @@ static void lts_aga_dpf_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2179,6 +2236,7 @@ static void lts_aga_dpf_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2189,9 +2247,10 @@ static void lts_aga_dpf_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2202,7 +2261,7 @@ static void lts_aga_dpf_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2217,7 +2276,7 @@ static void lts_aga_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2251,6 +2310,7 @@ static void lts_aga_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -2260,9 +2320,10 @@ static void lts_aga_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -2272,7 +2333,7 @@ static void lts_aga_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2287,7 +2348,7 @@ static void lts_aga_ham_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2321,16 +2382,18 @@ static void lts_aga_ham_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2345,7 +2408,7 @@ static void lts_aga_kehb_ihires_dshres_b1_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2379,18 +2442,20 @@ static void lts_aga_kehb_ihires_dshres_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2405,7 +2470,7 @@ static void lts_aga_n_ishres_dshres_b1_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2437,11 +2502,12 @@ static void lts_aga_n_ishres_dshres_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2456,7 +2522,7 @@ static void lts_aga_dpf_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2488,6 +2554,7 @@ static void lts_aga_dpf_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2498,7 +2565,7 @@ static void lts_aga_dpf_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[dpval];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2513,7 +2580,7 @@ static void lts_aga_ehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2545,6 +2612,7 @@ static void lts_aga_ehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -2554,7 +2622,7 @@ static void lts_aga_ehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = colors_aga[c];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2569,7 +2637,7 @@ static void lts_aga_ham_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2601,10 +2669,11 @@ static void lts_aga_ham_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2619,7 +2688,7 @@ static void lts_aga_kehb_ishres_dshres_b1_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2651,11 +2720,12 @@ static void lts_aga_kehb_ishres_dshres_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2670,7 +2740,7 @@ static void lts_aga_n_ilores_dlores_b2_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2704,12 +2774,13 @@ static void lts_aga_n_ilores_dlores_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2724,7 +2795,7 @@ static void lts_aga_dpf_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2758,6 +2829,7 @@ static void lts_aga_dpf_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2769,7 +2841,7 @@ static void lts_aga_dpf_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2784,7 +2856,7 @@ static void lts_aga_ehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2818,6 +2890,7 @@ static void lts_aga_ehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -2828,7 +2901,7 @@ static void lts_aga_ehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2843,7 +2916,7 @@ static void lts_aga_ham_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2877,11 +2950,12 @@ static void lts_aga_ham_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2896,7 +2970,7 @@ static void lts_aga_kehb_ilores_dlores_b2_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2930,12 +3004,13 @@ static void lts_aga_kehb_ilores_dlores_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2950,7 +3025,7 @@ static void lts_aga_n_ihires_dlores_b2_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2984,12 +3059,13 @@ static void lts_aga_n_ihires_dlores_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3004,7 +3080,7 @@ static void lts_aga_dpf_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3038,6 +3114,7 @@ static void lts_aga_dpf_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3049,7 +3126,7 @@ static void lts_aga_dpf_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3064,7 +3141,7 @@ static void lts_aga_ehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3098,6 +3175,7 @@ static void lts_aga_ehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -3108,7 +3186,7 @@ static void lts_aga_ehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3123,7 +3201,7 @@ static void lts_aga_ham_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3157,11 +3235,12 @@ static void lts_aga_ham_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3176,7 +3255,7 @@ static void lts_aga_kehb_ihires_dlores_b2_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3210,12 +3289,13 @@ static void lts_aga_kehb_ihires_dlores_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3230,7 +3310,7 @@ static void lts_aga_n_ishres_dlores_b2_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3264,12 +3344,13 @@ static void lts_aga_n_ishres_dlores_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3284,7 +3365,7 @@ static void lts_aga_dpf_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3318,6 +3399,7 @@ static void lts_aga_dpf_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3329,7 +3411,7 @@ static void lts_aga_dpf_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3344,7 +3426,7 @@ static void lts_aga_ehb_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3378,6 +3460,7 @@ static void lts_aga_ehb_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -3388,7 +3471,7 @@ static void lts_aga_ehb_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3403,7 +3486,7 @@ static void lts_aga_ham_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3437,11 +3520,12 @@ static void lts_aga_ham_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3456,7 +3540,7 @@ static void lts_aga_kehb_ishres_dlores_b2_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3490,12 +3574,13 @@ static void lts_aga_kehb_ishres_dlores_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3510,7 +3595,7 @@ static void lts_aga_n_ilores_dhires_b2_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3547,20 +3632,22 @@ static void lts_aga_n_ilores_dhires_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3575,7 +3662,7 @@ static void lts_aga_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3612,6 +3699,7 @@ static void lts_aga_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3623,9 +3711,10 @@ static void lts_aga_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3637,7 +3726,7 @@ static void lts_aga_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3652,7 +3741,7 @@ static void lts_aga_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3689,6 +3778,7 @@ static void lts_aga_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -3699,9 +3789,10 @@ static void lts_aga_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -3712,7 +3803,7 @@ static void lts_aga_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3727,7 +3818,7 @@ static void lts_aga_ham_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3764,18 +3855,20 @@ static void lts_aga_ham_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3790,7 +3883,7 @@ static void lts_aga_kehb_ilores_dhires_b2_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3827,20 +3920,22 @@ static void lts_aga_kehb_ilores_dhires_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3855,7 +3950,7 @@ static void lts_aga_n_ihires_dhires_b2_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3889,12 +3984,13 @@ static void lts_aga_n_ihires_dhires_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3909,7 +4005,7 @@ static void lts_aga_dpf_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3943,6 +4039,7 @@ static void lts_aga_dpf_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3954,7 +4051,7 @@ static void lts_aga_dpf_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3969,7 +4066,7 @@ static void lts_aga_ehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4003,6 +4100,7 @@ static void lts_aga_ehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4013,7 +4111,7 @@ static void lts_aga_ehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4028,7 +4126,7 @@ static void lts_aga_ham_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4062,11 +4160,12 @@ static void lts_aga_ham_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4081,7 +4180,7 @@ static void lts_aga_kehb_ihires_dhires_b2_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4115,12 +4214,13 @@ static void lts_aga_kehb_ihires_dhires_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4135,7 +4235,7 @@ static void lts_aga_n_ishres_dhires_b2_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4169,12 +4269,13 @@ static void lts_aga_n_ishres_dhires_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4189,7 +4290,7 @@ static void lts_aga_dpf_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4223,6 +4324,7 @@ static void lts_aga_dpf_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4234,7 +4336,7 @@ static void lts_aga_dpf_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4249,7 +4351,7 @@ static void lts_aga_ehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4283,6 +4385,7 @@ static void lts_aga_ehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4293,7 +4396,7 @@ static void lts_aga_ehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4308,7 +4411,7 @@ static void lts_aga_ham_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4342,11 +4445,12 @@ static void lts_aga_ham_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4361,7 +4465,7 @@ static void lts_aga_kehb_ishres_dhires_b2_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4395,12 +4499,13 @@ static void lts_aga_kehb_ishres_dhires_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4415,7 +4520,7 @@ static void lts_aga_n_ilores_dshres_b2_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4458,36 +4563,40 @@ static void lts_aga_n_ilores_dshres_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4502,7 +4611,7 @@ static void lts_aga_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4545,6 +4654,7 @@ static void lts_aga_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4556,9 +4666,10 @@ static void lts_aga_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4570,9 +4681,10 @@ static void lts_aga_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4584,9 +4696,10 @@ static void lts_aga_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4598,7 +4711,7 @@ static void lts_aga_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4613,7 +4726,7 @@ static void lts_aga_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4656,6 +4769,7 @@ static void lts_aga_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4666,9 +4780,10 @@ static void lts_aga_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4679,9 +4794,10 @@ static void lts_aga_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4692,9 +4808,10 @@ static void lts_aga_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -4705,7 +4822,7 @@ static void lts_aga_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4720,7 +4837,7 @@ static void lts_aga_ham_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4763,32 +4880,36 @@ static void lts_aga_ham_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4803,7 +4924,7 @@ static void lts_aga_kehb_ilores_dshres_b2_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4846,36 +4967,40 @@ static void lts_aga_kehb_ilores_dshres_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[2];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[3];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4890,7 +5015,7 @@ static void lts_aga_n_ihires_dshres_b2_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4927,20 +5052,22 @@ static void lts_aga_n_ihires_dshres_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4955,7 +5082,7 @@ static void lts_aga_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4992,6 +5119,7 @@ static void lts_aga_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -5003,9 +5131,10 @@ static void lts_aga_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -5017,7 +5146,7 @@ static void lts_aga_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -5032,7 +5161,7 @@ static void lts_aga_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5069,6 +5198,7 @@ static void lts_aga_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -5079,9 +5209,10 @@ static void lts_aga_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -5092,7 +5223,7 @@ static void lts_aga_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -5107,7 +5238,7 @@ static void lts_aga_ham_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5144,18 +5275,20 @@ static void lts_aga_ham_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -5170,7 +5303,7 @@ static void lts_aga_kehb_ihires_dshres_b2_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5207,20 +5340,22 @@ static void lts_aga_kehb_ihires_dshres_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[1];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -5235,7 +5370,7 @@ static void lts_aga_n_ishres_dshres_b2_genlock(int draw_start, int draw_end, int
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5269,12 +5404,13 @@ static void lts_aga_n_ishres_dshres_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -5289,7 +5425,7 @@ static void lts_aga_dpf_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5323,6 +5459,7 @@ static void lts_aga_dpf_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -5334,7 +5471,7 @@ static void lts_aga_dpf_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -5349,7 +5486,7 @@ static void lts_aga_ehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5383,6 +5520,7 @@ static void lts_aga_ehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        if (c & 0x20) {
@@ -5393,7 +5531,7 @@ static void lts_aga_ehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -5408,7 +5546,7 @@ static void lts_aga_ham_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5442,11 +5580,12 @@ static void lts_aga_ham_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        col = decode_ham_pixel_aga_fast(c, planes, bxor, colors_aga);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -5461,7 +5600,7 @@ static void lts_aga_kehb_ishres_dshres_b2_genlock(int draw_start, int draw_end,
        uae_u8 bxor = ls->bplcon4 >> 8;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5495,12 +5634,13 @@ static void lts_aga_kehb_ishres_dshres_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpadds[0];
                        c ^= bxor;
                        col = colors_aga[c & 31];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
index 60350644dda18271cd21ac9b3418844ff1ddf0ec..c46a7fbcc020288237bbe1172e409c1e6f9e2e7f 100644 (file)
@@ -38,6 +38,7 @@ static void lts_ecs_n_ilores_dlores_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -82,6 +83,7 @@ static void lts_ecs_dpf_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -129,6 +131,7 @@ static void lts_ecs_ehb_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -178,6 +181,7 @@ static void lts_ecs_ham_ilores_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -222,6 +226,7 @@ static void lts_ecs_kehb_ilores_dlores_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -266,6 +271,7 @@ static void lts_ecs_n_ihires_dlores_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -310,6 +316,7 @@ static void lts_ecs_dpf_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -357,6 +364,7 @@ static void lts_ecs_ehb_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -406,6 +414,7 @@ static void lts_ecs_ham_ihires_dlores_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -450,6 +459,7 @@ static void lts_ecs_kehb_ihires_dlores_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -491,12 +501,12 @@ static void lts_ecs_n_ishres_dlores_b1(int draw_start, int draw_end, int draw_st
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -535,15 +545,12 @@ static void lts_ecs_dpf_ishres_dlores_b1(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -582,17 +589,12 @@ static void lts_ecs_ehb_ishres_dlores_b1(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -631,12 +633,12 @@ static void lts_ecs_ham_ishres_dlores_b1(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -675,12 +677,12 @@ static void lts_ecs_kehb_ishres_dlores_b1(int draw_start, int draw_end, int draw
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -723,9 +725,11 @@ static void lts_ecs_n_ilores_dhires_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -771,12 +775,14 @@ static void lts_ecs_dpf_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -825,6 +831,7 @@ static void lts_ecs_ehb_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -833,6 +840,7 @@ static void lts_ecs_ehb_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -883,9 +891,11 @@ static void lts_ecs_ham_ilores_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -931,9 +941,11 @@ static void lts_ecs_kehb_ilores_dhires_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -978,6 +990,7 @@ static void lts_ecs_n_ihires_dhires_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -1022,6 +1035,7 @@ static void lts_ecs_dpf_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1069,6 +1083,7 @@ static void lts_ecs_ehb_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -1118,6 +1133,7 @@ static void lts_ecs_ham_ihires_dhires_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -1162,6 +1178,7 @@ static void lts_ecs_kehb_ihires_dhires_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -1203,12 +1220,11 @@ static void lts_ecs_n_ishres_dhires_b1(int draw_start, int draw_end, int draw_st
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -1247,15 +1263,11 @@ static void lts_ecs_dpf_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -1294,17 +1306,11 @@ static void lts_ecs_ehb_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -1343,12 +1349,11 @@ static void lts_ecs_ham_ishres_dhires_b1(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -1387,12 +1392,11 @@ static void lts_ecs_kehb_ishres_dhires_b1(int draw_start, int draw_end, int draw
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -1437,15 +1441,19 @@ static void lts_ecs_n_ilores_dshres_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -1493,24 +1501,28 @@ static void lts_ecs_dpf_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1561,6 +1573,7 @@ static void lts_ecs_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -1569,6 +1582,7 @@ static void lts_ecs_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -1577,6 +1591,7 @@ static void lts_ecs_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -1585,6 +1600,7 @@ static void lts_ecs_ehb_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -1637,15 +1653,19 @@ static void lts_ecs_ham_ilores_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -1693,15 +1713,19 @@ static void lts_ecs_kehb_ilores_dshres_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -1747,9 +1771,11 @@ static void lts_ecs_n_ihires_dshres_b1(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -1795,12 +1821,14 @@ static void lts_ecs_dpf_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -1849,6 +1877,7 @@ static void lts_ecs_ehb_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -1857,6 +1886,7 @@ static void lts_ecs_ehb_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -1907,9 +1937,11 @@ static void lts_ecs_ham_ihires_dshres_b1(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -1955,9 +1987,11 @@ static void lts_ecs_kehb_ihires_dshres_b1(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -1999,12 +2033,13 @@ static void lts_ecs_n_ishres_dshres_b1(int draw_start, int draw_end, int draw_st
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2043,15 +2078,13 @@ static void lts_ecs_dpf_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2090,17 +2123,13 @@ static void lts_ecs_ehb_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2139,12 +2168,13 @@ static void lts_ecs_ham_ishres_dshres_b1(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2183,12 +2213,13 @@ static void lts_ecs_kehb_ishres_dshres_b1(int draw_start, int draw_end, int draw
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2232,6 +2263,7 @@ static void lts_ecs_n_ilores_dlores_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -2279,6 +2311,7 @@ static void lts_ecs_dpf_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2329,6 +2362,7 @@ static void lts_ecs_ehb_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -2381,6 +2415,7 @@ static void lts_ecs_ham_ilores_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -2428,6 +2463,7 @@ static void lts_ecs_kehb_ilores_dlores_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -2475,6 +2511,7 @@ static void lts_ecs_n_ihires_dlores_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -2522,6 +2559,7 @@ static void lts_ecs_dpf_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2572,6 +2610,7 @@ static void lts_ecs_ehb_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -2624,6 +2663,7 @@ static void lts_ecs_ham_ihires_dlores_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -2671,6 +2711,7 @@ static void lts_ecs_kehb_ihires_dlores_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -2715,13 +2756,13 @@ static void lts_ecs_n_ishres_dlores_b2(int draw_start, int draw_end, int draw_st
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2762,16 +2803,13 @@ static void lts_ecs_dpf_ishres_dlores_b2(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2812,18 +2850,13 @@ static void lts_ecs_ehb_ishres_dlores_b2(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2864,13 +2897,13 @@ static void lts_ecs_ham_ishres_dlores_b2(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2911,13 +2944,13 @@ static void lts_ecs_kehb_ishres_dlores_b2(int draw_start, int draw_end, int draw
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2963,10 +2996,12 @@ static void lts_ecs_n_ilores_dhires_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -3016,6 +3051,7 @@ static void lts_ecs_dpf_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
@@ -3023,6 +3059,7 @@ static void lts_ecs_dpf_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3075,6 +3112,7 @@ static void lts_ecs_ehb_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -3084,6 +3122,7 @@ static void lts_ecs_ehb_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -3138,10 +3177,12 @@ static void lts_ecs_ham_ilores_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -3191,10 +3232,12 @@ static void lts_ecs_kehb_ilores_dhires_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -3242,6 +3285,7 @@ static void lts_ecs_n_ihires_dhires_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -3289,6 +3333,7 @@ static void lts_ecs_dpf_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3339,6 +3384,7 @@ static void lts_ecs_ehb_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -3391,6 +3437,7 @@ static void lts_ecs_ham_ihires_dhires_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -3438,6 +3485,7 @@ static void lts_ecs_kehb_ihires_dhires_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -3482,13 +3530,12 @@ static void lts_ecs_n_ishres_dhires_b2(int draw_start, int draw_end, int draw_st
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3529,16 +3576,12 @@ static void lts_ecs_dpf_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3579,18 +3622,12 @@ static void lts_ecs_ehb_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3631,13 +3668,12 @@ static void lts_ecs_ham_ishres_dhires_b2(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3678,13 +3714,12 @@ static void lts_ecs_kehb_ishres_dhires_b2(int draw_start, int draw_end, int draw
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3734,18 +3769,22 @@ static void lts_ecs_n_ilores_dshres_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -3799,6 +3838,7 @@ static void lts_ecs_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
@@ -3806,6 +3846,7 @@ static void lts_ecs_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
@@ -3813,6 +3854,7 @@ static void lts_ecs_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
@@ -3820,6 +3862,7 @@ static void lts_ecs_dpf_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3876,6 +3919,7 @@ static void lts_ecs_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -3885,6 +3929,7 @@ static void lts_ecs_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -3894,6 +3939,7 @@ static void lts_ecs_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -3903,6 +3949,7 @@ static void lts_ecs_ehb_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -3961,18 +4008,22 @@ static void lts_ecs_ham_ilores_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -4026,18 +4077,22 @@ static void lts_ecs_kehb_ilores_dshres_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -4087,10 +4142,12 @@ static void lts_ecs_n_ihires_dshres_b2(int draw_start, int draw_end, int draw_st
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
@@ -4140,6 +4197,7 @@ static void lts_ecs_dpf_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
@@ -4147,6 +4205,7 @@ static void lts_ecs_dpf_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4199,6 +4258,7 @@ static void lts_ecs_ehb_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -4208,6 +4268,7 @@ static void lts_ecs_ehb_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -4262,10 +4323,12 @@ static void lts_ecs_ham_ihires_dshres_b2(int draw_start, int draw_end, int draw_
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
@@ -4315,10 +4378,12 @@ static void lts_ecs_kehb_ihires_dshres_b2(int draw_start, int draw_end, int draw
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
@@ -4363,13 +4428,15 @@ static void lts_ecs_n_ishres_dshres_b2(int draw_start, int draw_end, int draw_st
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *buf2++ = dpix_val0;
+                       *buf2++ = dpix_val1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -4410,16 +4477,15 @@ static void lts_ecs_dpf_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *buf2++ = dpix_val0;
+                       *buf2++ = dpix_val1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -4460,18 +4526,15 @@ static void lts_ecs_ehb_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *buf2++ = dpix_val0;
+                       *buf2++ = dpix_val1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -4512,13 +4575,15 @@ static void lts_ecs_ham_ishres_dshres_b2(int draw_start, int draw_end, int draw_
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *buf2++ = dpix_val0;
+                       *buf2++ = dpix_val1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -4559,13 +4624,15 @@ static void lts_ecs_kehb_ishres_dshres_b2(int draw_start, int draw_end, int draw
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
-                       *buf2++ = col;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       get_shres_pix(c0, c1, &dpix_val0, &dpix_val1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *buf2++ = dpix_val0;
+                       *buf2++ = dpix_val1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
index 2a2393c9f50c0954c3447f66e5760547437a202b..b51728767975357bf62748dda72eaa326bf7b8ca 100644 (file)
@@ -9,7 +9,7 @@ static void lts_ecs_n_ilores_dlores_b1_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -41,10 +41,11 @@ static void lts_ecs_n_ilores_dlores_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -58,7 +59,7 @@ static void lts_ecs_dpf_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -90,13 +91,14 @@ static void lts_ecs_dpf_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -110,7 +112,7 @@ static void lts_ecs_ehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -142,6 +144,7 @@ static void lts_ecs_ehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -150,7 +153,7 @@ static void lts_ecs_ehb_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -164,7 +167,7 @@ static void lts_ecs_ham_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -196,10 +199,11 @@ static void lts_ecs_ham_ilores_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -213,7 +217,7 @@ static void lts_ecs_kehb_ilores_dlores_b1_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -245,10 +249,11 @@ static void lts_ecs_kehb_ilores_dlores_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -262,7 +267,7 @@ static void lts_ecs_n_ihires_dlores_b1_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -294,10 +299,11 @@ static void lts_ecs_n_ihires_dlores_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -311,7 +317,7 @@ static void lts_ecs_dpf_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -343,13 +349,14 @@ static void lts_ecs_dpf_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -363,7 +370,7 @@ static void lts_ecs_ehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -395,6 +402,7 @@ static void lts_ecs_ehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -403,7 +411,7 @@ static void lts_ecs_ehb_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -417,7 +425,7 @@ static void lts_ecs_ham_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -449,10 +457,11 @@ static void lts_ecs_ham_ihires_dlores_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -466,7 +475,7 @@ static void lts_ecs_kehb_ihires_dlores_b1_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -498,10 +507,11 @@ static void lts_ecs_kehb_ihires_dlores_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -515,7 +525,7 @@ static void lts_ecs_n_ishres_dlores_b1_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -544,14 +554,14 @@ static void lts_ecs_n_ishres_dlores_b1_genlock(int draw_start, int draw_end, int
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -564,7 +574,7 @@ static void lts_ecs_dpf_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -593,17 +603,14 @@ static void lts_ecs_dpf_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -616,7 +623,7 @@ static void lts_ecs_ehb_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -645,19 +652,14 @@ static void lts_ecs_ehb_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -670,7 +672,7 @@ static void lts_ecs_ham_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -699,14 +701,14 @@ static void lts_ecs_ham_ishres_dlores_b1_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -719,7 +721,7 @@ static void lts_ecs_kehb_ishres_dlores_b1_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -748,14 +750,14 @@ static void lts_ecs_kehb_ishres_dlores_b1_genlock(int draw_start, int draw_end,
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -768,7 +770,7 @@ static void lts_ecs_n_ilores_dhires_b1_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -802,15 +804,17 @@ static void lts_ecs_n_ilores_dhires_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -824,7 +828,7 @@ static void lts_ecs_dpf_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -858,21 +862,23 @@ static void lts_ecs_dpf_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -886,7 +892,7 @@ static void lts_ecs_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -920,6 +926,7 @@ static void lts_ecs_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -927,9 +934,10 @@ static void lts_ecs_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -938,7 +946,7 @@ static void lts_ecs_ehb_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -952,7 +960,7 @@ static void lts_ecs_ham_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -986,15 +994,17 @@ static void lts_ecs_ham_ilores_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1008,7 +1018,7 @@ static void lts_ecs_kehb_ilores_dhires_b1_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1042,15 +1052,17 @@ static void lts_ecs_kehb_ilores_dhires_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1064,7 +1076,7 @@ static void lts_ecs_n_ihires_dhires_b1_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1096,10 +1108,11 @@ static void lts_ecs_n_ihires_dhires_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1113,7 +1126,7 @@ static void lts_ecs_dpf_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1145,13 +1158,14 @@ static void lts_ecs_dpf_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1165,7 +1179,7 @@ static void lts_ecs_ehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1197,6 +1211,7 @@ static void lts_ecs_ehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -1205,7 +1220,7 @@ static void lts_ecs_ehb_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1219,7 +1234,7 @@ static void lts_ecs_ham_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1251,10 +1266,11 @@ static void lts_ecs_ham_ihires_dhires_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1268,7 +1284,7 @@ static void lts_ecs_kehb_ihires_dhires_b1_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1300,10 +1316,11 @@ static void lts_ecs_kehb_ihires_dhires_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1317,7 +1334,7 @@ static void lts_ecs_n_ishres_dhires_b1_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1346,14 +1363,13 @@ static void lts_ecs_n_ishres_dhires_b1_genlock(int draw_start, int draw_end, int
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -1366,7 +1382,7 @@ static void lts_ecs_dpf_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1395,17 +1411,13 @@ static void lts_ecs_dpf_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -1418,7 +1430,7 @@ static void lts_ecs_ehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1447,19 +1459,13 @@ static void lts_ecs_ehb_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -1472,7 +1478,7 @@ static void lts_ecs_ham_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1501,14 +1507,13 @@ static void lts_ecs_ham_ishres_dhires_b1_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -1521,7 +1526,7 @@ static void lts_ecs_kehb_ishres_dhires_b1_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1550,14 +1555,13 @@ static void lts_ecs_kehb_ishres_dhires_b1_genlock(int draw_start, int draw_end,
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -1570,7 +1574,7 @@ static void lts_ecs_n_ilores_dshres_b1_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1608,25 +1612,29 @@ static void lts_ecs_n_ilores_dshres_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1640,7 +1648,7 @@ static void lts_ecs_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1678,37 +1686,41 @@ static void lts_ecs_dpf_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1722,7 +1734,7 @@ static void lts_ecs_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1760,6 +1772,7 @@ static void lts_ecs_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -1767,9 +1780,10 @@ static void lts_ecs_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -1777,9 +1791,10 @@ static void lts_ecs_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -1787,9 +1802,10 @@ static void lts_ecs_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -1798,7 +1814,7 @@ static void lts_ecs_ehb_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1812,7 +1828,7 @@ static void lts_ecs_ham_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1850,25 +1866,29 @@ static void lts_ecs_ham_ilores_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1882,7 +1902,7 @@ static void lts_ecs_kehb_ilores_dshres_b1_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1920,25 +1940,29 @@ static void lts_ecs_kehb_ilores_dshres_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -1952,7 +1976,7 @@ static void lts_ecs_n_ihires_dshres_b1_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -1986,15 +2010,17 @@ static void lts_ecs_n_ihires_dshres_b1_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2008,7 +2034,7 @@ static void lts_ecs_dpf_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2042,21 +2068,23 @@ static void lts_ecs_dpf_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2070,7 +2098,7 @@ static void lts_ecs_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2104,6 +2132,7 @@ static void lts_ecs_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -2111,9 +2140,10 @@ static void lts_ecs_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -2122,7 +2152,7 @@ static void lts_ecs_ehb_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                                col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
                        }
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2136,7 +2166,7 @@ static void lts_ecs_ham_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2170,15 +2200,17 @@ static void lts_ecs_ham_ihires_dshres_b1_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2192,7 +2224,7 @@ static void lts_ecs_kehb_ihires_dshres_b1_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2226,15 +2258,17 @@ static void lts_ecs_kehb_ihires_dshres_b1_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2248,7 +2282,7 @@ static void lts_ecs_n_ishres_dshres_b1_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2277,14 +2311,16 @@ static void lts_ecs_n_ishres_dshres_b1_genlock(int draw_start, int draw_end, int
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *gbuf++ = gpix0;
+                       *gbuf++ = gpix1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2297,7 +2333,7 @@ static void lts_ecs_dpf_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2326,17 +2362,16 @@ static void lts_ecs_dpf_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *gbuf++ = gpix0;
+                       *gbuf++ = gpix1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2349,7 +2384,7 @@ static void lts_ecs_ehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2378,19 +2413,16 @@ static void lts_ecs_ehb_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *gbuf++ = gpix0;
+                       *gbuf++ = gpix1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2403,7 +2435,7 @@ static void lts_ecs_ham_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2432,14 +2464,16 @@ static void lts_ecs_ham_ishres_dshres_b1_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *gbuf++ = gpix0;
+                       *gbuf++ = gpix1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2452,7 +2486,7 @@ static void lts_ecs_kehb_ishres_dshres_b1_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2481,14 +2515,16 @@ static void lts_ecs_kehb_ishres_dshres_b1_genlock(int draw_start, int draw_end,
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *gbuf++ = gpix0;
+                       *gbuf++ = gpix1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -2501,7 +2537,7 @@ static void lts_ecs_n_ilores_dlores_b2_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2535,11 +2571,12 @@ static void lts_ecs_n_ilores_dlores_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2553,7 +2590,7 @@ static void lts_ecs_dpf_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2587,6 +2624,7 @@ static void lts_ecs_dpf_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2594,7 +2632,7 @@ static void lts_ecs_dpf_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2608,7 +2646,7 @@ static void lts_ecs_ehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2642,6 +2680,7 @@ static void lts_ecs_ehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -2651,7 +2690,7 @@ static void lts_ecs_ehb_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2665,7 +2704,7 @@ static void lts_ecs_ham_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2699,11 +2738,12 @@ static void lts_ecs_ham_ilores_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2717,7 +2757,7 @@ static void lts_ecs_kehb_ilores_dlores_b2_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2751,11 +2791,12 @@ static void lts_ecs_kehb_ilores_dlores_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2769,7 +2810,7 @@ static void lts_ecs_n_ihires_dlores_b2_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2803,11 +2844,12 @@ static void lts_ecs_n_ihires_dlores_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2821,7 +2863,7 @@ static void lts_ecs_dpf_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2855,6 +2897,7 @@ static void lts_ecs_dpf_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -2862,7 +2905,7 @@ static void lts_ecs_dpf_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2876,7 +2919,7 @@ static void lts_ecs_ehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2910,6 +2953,7 @@ static void lts_ecs_ehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -2919,7 +2963,7 @@ static void lts_ecs_ehb_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2933,7 +2977,7 @@ static void lts_ecs_ham_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -2967,11 +3011,12 @@ static void lts_ecs_ham_ihires_dlores_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -2985,7 +3030,7 @@ static void lts_ecs_kehb_ihires_dlores_b2_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3019,11 +3064,12 @@ static void lts_ecs_kehb_ihires_dlores_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3037,7 +3083,7 @@ static void lts_ecs_n_ishres_dlores_b2_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3068,15 +3114,15 @@ static void lts_ecs_n_ishres_dlores_b2_genlock(int draw_start, int draw_end, int
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3089,7 +3135,7 @@ static void lts_ecs_dpf_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3120,18 +3166,15 @@ static void lts_ecs_dpf_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3144,7 +3187,7 @@ static void lts_ecs_ehb_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3175,20 +3218,15 @@ static void lts_ecs_ehb_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3201,7 +3239,7 @@ static void lts_ecs_ham_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3232,15 +3270,15 @@ static void lts_ecs_ham_ishres_dlores_b2_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3253,7 +3291,7 @@ static void lts_ecs_kehb_ishres_dlores_b2_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3284,15 +3322,15 @@ static void lts_ecs_kehb_ishres_dlores_b2_genlock(int draw_start, int draw_end,
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       cp += 2;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3305,7 +3343,7 @@ static void lts_ecs_n_ilores_dhires_b2_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3342,17 +3380,19 @@ static void lts_ecs_n_ilores_dhires_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3366,7 +3406,7 @@ static void lts_ecs_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3403,15 +3443,17 @@ static void lts_ecs_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3419,7 +3461,7 @@ static void lts_ecs_dpf_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3433,7 +3475,7 @@ static void lts_ecs_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3470,6 +3512,7 @@ static void lts_ecs_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -3478,9 +3521,10 @@ static void lts_ecs_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -3490,7 +3534,7 @@ static void lts_ecs_ehb_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3504,7 +3548,7 @@ static void lts_ecs_ham_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3541,17 +3585,19 @@ static void lts_ecs_ham_ilores_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3565,7 +3611,7 @@ static void lts_ecs_kehb_ilores_dhires_b2_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3602,17 +3648,19 @@ static void lts_ecs_kehb_ilores_dhires_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3626,7 +3674,7 @@ static void lts_ecs_n_ihires_dhires_b2_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3660,11 +3708,12 @@ static void lts_ecs_n_ihires_dhires_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3678,7 +3727,7 @@ static void lts_ecs_dpf_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3712,6 +3761,7 @@ static void lts_ecs_dpf_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -3719,7 +3769,7 @@ static void lts_ecs_dpf_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3733,7 +3783,7 @@ static void lts_ecs_ehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3767,6 +3817,7 @@ static void lts_ecs_ehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -3776,7 +3827,7 @@ static void lts_ecs_ehb_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3790,7 +3841,7 @@ static void lts_ecs_ham_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3824,11 +3875,12 @@ static void lts_ecs_ham_ihires_dhires_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3842,7 +3894,7 @@ static void lts_ecs_kehb_ihires_dhires_b2_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3876,11 +3928,12 @@ static void lts_ecs_kehb_ihires_dhires_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -3894,7 +3947,7 @@ static void lts_ecs_n_ishres_dhires_b2_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3925,15 +3978,14 @@ static void lts_ecs_n_ishres_dhires_b2_genlock(int draw_start, int draw_end, int
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -3946,7 +3998,7 @@ static void lts_ecs_dpf_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -3977,18 +4029,14 @@ static void lts_ecs_dpf_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -4001,7 +4049,7 @@ static void lts_ecs_ehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4032,20 +4080,14 @@ static void lts_ecs_ehb_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -4058,7 +4100,7 @@ static void lts_ecs_ham_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4089,15 +4131,14 @@ static void lts_ecs_ham_ishres_dhires_b2_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -4110,7 +4151,7 @@ static void lts_ecs_kehb_ishres_dhires_b2_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4141,15 +4182,14 @@ static void lts_ecs_kehb_ishres_dhires_b2_genlock(int draw_start, int draw_end,
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf2++ = dpix_val0;
+                       *gbuf++ = gpix0;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -4162,7 +4202,7 @@ static void lts_ecs_n_ilores_dshres_b2_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4205,29 +4245,33 @@ static void lts_ecs_n_ilores_dshres_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4241,7 +4285,7 @@ static void lts_ecs_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4284,33 +4328,37 @@ static void lts_ecs_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4318,7 +4366,7 @@ static void lts_ecs_dpf_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4332,7 +4380,7 @@ static void lts_ecs_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4375,6 +4423,7 @@ static void lts_ecs_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -4383,9 +4432,10 @@ static void lts_ecs_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -4394,9 +4444,10 @@ static void lts_ecs_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -4405,9 +4456,10 @@ static void lts_ecs_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -4417,7 +4469,7 @@ static void lts_ecs_ehb_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4431,7 +4483,7 @@ static void lts_ecs_ham_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4474,29 +4526,33 @@ static void lts_ecs_ham_ilores_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4510,7 +4566,7 @@ static void lts_ecs_kehb_ilores_dshres_b2_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4553,29 +4609,33 @@ static void lts_ecs_kehb_ilores_dshres_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4589,7 +4649,7 @@ static void lts_ecs_n_ihires_dshres_b2_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4626,17 +4686,19 @@ static void lts_ecs_n_ihires_dshres_b2_genlock(int draw_start, int draw_end, int
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4650,7 +4712,7 @@ static void lts_ecs_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4687,15 +4749,17 @@ static void lts_ecs_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        {
                                uae_u8 dpval = dpf_lookup[c];
                                col = xcolors[colors_ocs[dpval]];
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        {
                                uae_u8 dpval = dpf_lookup[c];
@@ -4703,7 +4767,7 @@ static void lts_ecs_dpf_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4717,7 +4781,7 @@ static void lts_ecs_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4754,6 +4818,7 @@ static void lts_ecs_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        c &= bplehb_mask;
                        if (c <= 31) {
                                col = xcolors[colors_ocs[c]];
@@ -4762,9 +4827,10 @@ static void lts_ecs_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        c &= bplehb_mask;
                        if (c <= 31) {
@@ -4774,7 +4840,7 @@ static void lts_ecs_ehb_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4788,7 +4854,7 @@ static void lts_ecs_ham_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4825,17 +4891,19 @@ static void lts_ecs_ham_ihires_dshres_b2_genlock(int draw_start, int draw_end, i
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = decode_ham_pixel_fast(c, colors_ocs);
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4849,7 +4917,7 @@ static void lts_ecs_kehb_ihires_dshres_b2_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4886,17 +4954,19 @@ static void lts_ecs_kehb_ihires_dshres_b2_genlock(int draw_start, int draw_end,
                        uae_u8 c;
                        uae_u32 col;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                        c = *cp;
+                       clxdat |= bplcoltable[c];
                        cp += cpaddv;
                        col = xcolors[colors_ocs[c & 31]];
                        *buf1++ = col;
                        *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
+                       gpix = get_genlock_transparency_fast(c);
                        *gbuf++ = gpix;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
@@ -4910,7 +4980,7 @@ static void lts_ecs_n_ishres_dshres_b2_genlock(int draw_start, int draw_end, int
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4941,15 +5011,18 @@ static void lts_ecs_n_ishres_dshres_b2_genlock(int draw_start, int draw_end, int
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c]];
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *buf2++ = dpix_val0;
+                       *buf2++ = dpix_val1;
+                       *gbuf++ = gpix0;
+                       *gbuf++ = gpix1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -4962,7 +5035,7 @@ static void lts_ecs_dpf_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -4993,18 +5066,18 @@ static void lts_ecs_dpf_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       {
-                               uae_u8 dpval = dpf_lookup[c];
-                               col = xcolors[colors_ocs[dpval]];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *buf2++ = dpix_val0;
+                       *buf2++ = dpix_val1;
+                       *gbuf++ = gpix0;
+                       *gbuf++ = gpix1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -5017,7 +5090,7 @@ static void lts_ecs_ehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5048,20 +5121,18 @@ static void lts_ecs_ehb_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       c &= bplehb_mask;
-                       if (c <= 31) {
-                               col = xcolors[colors_ocs[c]];
-                       } else {
-                               col = xcolors[(colors_ocs[c - 32] >> 1) & 0x777];
-                       }
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *buf2++ = dpix_val0;
+                       *buf2++ = dpix_val1;
+                       *gbuf++ = gpix0;
+                       *gbuf++ = gpix1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -5074,7 +5145,7 @@ static void lts_ecs_ham_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5105,15 +5176,18 @@ static void lts_ecs_ham_ishres_dshres_b2_genlock(int draw_start, int draw_end, i
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = decode_ham_pixel_fast(c, colors_ocs);
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *buf2++ = dpix_val0;
+                       *buf2++ = dpix_val1;
+                       *gbuf++ = gpix0;
+                       *gbuf++ = gpix1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
@@ -5126,7 +5200,7 @@ static void lts_ecs_kehb_ishres_dshres_b2_genlock(int draw_start, int draw_end,
        uae_u16 *colors_ocs = (uae_u16*)ls->linecolorstate;
        int bufaddv = 1 << bufadd;
        int cpaddv = 1 << cpadd;
-       uae_u16 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
+       uae_u8 gpix = get_genlock_transparency_border_fast(ls->bplcon3);
        int end = draw_end;
        if (end > hbstrt_offset) {
                end = hbstrt_offset;
@@ -5157,15 +5231,18 @@ static void lts_ecs_kehb_ishres_dshres_b2_genlock(int draw_start, int draw_end,
                        }
                } else {
                        bpl = true;
-                       uae_u8 c;
-                       uae_u32 col;
-                       c = *cp;
-                       cp += cpaddv;
-                       col = xcolors[colors_ocs[c & 31]];
-                       *buf1++ = col;
-                       *buf2++ = col;
-                       gpix = get_genlock_transparency_fast(col);
-                       *gbuf++ = gpix;
+                       uae_u8 c0 = *cp++;
+                       uae_u8 c1 = *cp++;
+                       uae_u32 dpix_val0, dpix_val1;
+                       uae_u8 gpix0, gpix1;
+                       get_shres_pix_genlock(c0, c1, &dpix_val0, &dpix_val1, &gpix0, &gpix1);
+                       *buf1++ = dpix_val0;
+                       *buf1++ = dpix_val1;
+                       *buf2++ = dpix_val0;
+                       *buf2++ = dpix_val1;
+                       *gbuf++ = gpix0;
+                       *gbuf++ = gpix1;
+                       cnt += bufaddv;
                }
                if (cnt >= bpl1dat_trigger_offset && !bpl) {
                        cp += cpaddv;
index e003c3087fa0c45a3c3ad861d9003441ff7d035b..3a9b978883b5280fa38da6990a72135a3b86393b 100644 (file)
@@ -52,6 +52,7 @@ static void lts_ecs_shres_dlores(void)
                        if (bpldat_copy[0] && (denise_hcounter & 3) == bplcon1_shift[0]) { 
                                copybpl2();
                        }
+                       internal_pixel_cnt += 4;
                        sprites_hidden = sprites_hidden2;
                        #ifdef DEBUGGER
                        *debug_dma_dhpos_odd = denise_hcounter;
@@ -160,6 +161,7 @@ static void lts_ecs_shres_dhires(void)
                        if (bpldat_copy[0] && (denise_hcounter & 3) == bplcon1_shift[0]) { 
                                copybpl2();
                        }
+                       internal_pixel_cnt += 4;
                        sprites_hidden = sprites_hidden2;
                        #ifdef DEBUGGER
                        *debug_dma_dhpos_odd = denise_hcounter;
@@ -282,6 +284,7 @@ static void lts_ecs_shres_dshres(void)
                        if (bpldat_copy[0] && (denise_hcounter & 3) == bplcon1_shift[0]) { 
                                copybpl2();
                        }
+                       internal_pixel_cnt += 4;
                        sprites_hidden = sprites_hidden2;
                        #ifdef DEBUGGER
                        *debug_dma_dhpos_odd = denise_hcounter;
@@ -316,16 +319,16 @@ static void lts_ecs_shres_dlores_genlock(void)
                        }
                        int cnt = denise_hcounter << 2;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        bool shifted = false;
                        checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h);
@@ -357,6 +360,7 @@ static void lts_ecs_shres_dlores_genlock(void)
                        if (bpldat_copy[0] && (denise_hcounter & 3) == bplcon1_shift[0]) { 
                                copybpl2();
                        }
+                       internal_pixel_cnt += 4;
                        sprites_hidden = sprites_hidden2;
                        #ifdef DEBUGGER
                        *debug_dma_dhpos_odd = denise_hcounter;
@@ -385,16 +389,16 @@ static void lts_ecs_shres_dhires_genlock(void)
                        }
                        int cnt = denise_hcounter << 2;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        bool shifted = false;
                        checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h);
@@ -471,6 +475,7 @@ static void lts_ecs_shres_dhires_genlock(void)
                        if (bpldat_copy[0] && (denise_hcounter & 3) == bplcon1_shift[0]) { 
                                copybpl2();
                        }
+                       internal_pixel_cnt += 4;
                        sprites_hidden = sprites_hidden2;
                        #ifdef DEBUGGER
                        *debug_dma_dhpos_odd = denise_hcounter;
@@ -499,16 +504,16 @@ static void lts_ecs_shres_dshres_genlock(void)
                        }
                        int cnt = denise_hcounter << 2;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        uae_u8 pix3 = 0;
-                       uae_u16 gpix3 = 0xffff;
+                       uae_u8 gpix3 = 0xff;
                        uae_u32 dpix_val3 = BLANK_COLOR;
                        bool shifted = false;
                        checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h);
@@ -601,6 +606,7 @@ static void lts_ecs_shres_dshres_genlock(void)
                        if (bpldat_copy[0] && (denise_hcounter & 3) == bplcon1_shift[0]) { 
                                copybpl2();
                        }
+                       internal_pixel_cnt += 4;
                        sprites_hidden = sprites_hidden2;
                        #ifdef DEBUGGER
                        *debug_dma_dhpos_odd = denise_hcounter;
index ace2efe30d00de04e280393192abd005cad1e51e..efbd15c8641e127f75fbbfe8a09e2f9f57ed9fc0 100644 (file)
@@ -9137,7 +9137,13 @@ static void lts_ecs_fm0_n0_p2_ihires_dhires_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -9234,7 +9240,13 @@ static void lts_ecs_fm0_n1_p2_ihires_dhires_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -9336,7 +9348,13 @@ static void lts_ecs_fm0_dpf0_p2_ihires_dhires_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -9435,7 +9453,13 @@ static void lts_ecs_fm0_dpf1_p2_ihires_dhires_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -9551,7 +9575,13 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -9648,7 +9678,13 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -9750,7 +9786,13 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -9849,7 +9891,13 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -16041,9 +16089,27 @@ static void lts_ecs_fm0_n0_p2_ihires_dshres_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -16168,9 +16234,27 @@ static void lts_ecs_fm0_n1_p2_ihires_dshres_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -16300,9 +16384,27 @@ static void lts_ecs_fm0_dpf0_p2_ihires_dshres_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -16429,9 +16531,27 @@ static void lts_ecs_fm0_dpf1_p2_ihires_dshres_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -16575,9 +16695,27 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -16702,9 +16840,27 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -16834,9 +16990,27 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -16963,9 +17137,27 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_spr(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                uae_u32 t0 = 0;
index 0092fbe4680a1faf54cf73a9dde31c7310c36e10..c9a4a684e8c845224b40c5666a863283900947e5 100644 (file)
@@ -16,7 +16,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -80,7 +80,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -147,7 +147,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -212,7 +212,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -280,7 +280,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -349,7 +349,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -421,7 +421,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -485,7 +485,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -553,7 +553,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -634,7 +634,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -718,7 +718,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -800,7 +800,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -885,7 +885,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -971,7 +971,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1060,7 +1060,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1141,7 +1141,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1224,7 +1224,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1240,7 +1240,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dlores_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1301,7 +1301,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1317,7 +1317,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dlores_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1381,7 +1381,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1398,7 +1398,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dlores_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1460,7 +1460,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dlores_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1477,7 +1477,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dlores_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1559,7 +1559,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1583,7 +1583,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dlores_spr_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1653,7 +1653,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1677,7 +1677,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dlores_spr_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1750,7 +1750,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1775,7 +1775,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dlores_spr_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1846,7 +1846,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dlores_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1871,7 +1871,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dlores_spr_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1960,7 +1960,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1981,7 +1981,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dhires_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -2040,7 +2040,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2061,7 +2061,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dhires_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -2123,7 +2123,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2145,7 +2145,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dhires_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -2204,7 +2204,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2226,7 +2226,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dhires_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -2288,7 +2288,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2314,7 +2314,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dhires_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -2373,7 +2373,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2399,7 +2399,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dhires_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -2461,7 +2461,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2482,7 +2482,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dhires_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -2541,7 +2541,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2562,7 +2562,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dhires_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -2625,7 +2625,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2654,7 +2654,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -2723,7 +2723,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2752,7 +2752,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -2824,7 +2824,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2854,7 +2854,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -2923,7 +2923,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2953,7 +2953,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3025,7 +3025,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3059,7 +3059,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3128,7 +3128,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3162,7 +3162,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3234,7 +3234,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3263,7 +3263,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3332,7 +3332,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3361,7 +3361,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dhires_spr_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3432,7 +3432,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3448,7 +3448,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3521,7 +3521,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3537,7 +3537,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3613,7 +3613,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3630,7 +3630,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3704,7 +3704,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3721,7 +3721,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3815,7 +3815,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3839,7 +3839,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_spr_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3861,7 +3861,15 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_spr_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -3922,7 +3930,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3946,7 +3954,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_spr_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3968,7 +3976,15 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_spr_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -4032,7 +4048,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4057,7 +4073,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_spr_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -4080,7 +4096,15 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_spr_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -4141,7 +4165,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4166,7 +4190,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_spr_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -4189,7 +4213,15 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_spr_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -4268,7 +4300,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4291,13 +4323,13 @@ static void lts_ecs_fm0_n0_p6_ilores_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -4380,7 +4412,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4403,13 +4435,13 @@ static void lts_ecs_fm0_n1_p6_ilores_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -4495,7 +4527,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4519,13 +4551,13 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -4608,7 +4640,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4632,13 +4664,13 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -4724,7 +4756,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4752,13 +4784,13 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -4841,7 +4873,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4869,13 +4901,13 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -4961,7 +4993,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4984,13 +5016,13 @@ static void lts_ecs_fm0_ham0_p6_ilores_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -5073,7 +5105,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5096,13 +5128,13 @@ static void lts_ecs_fm0_ham1_p6_ilores_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -5189,7 +5221,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5220,13 +5252,13 @@ static void lts_ecs_fm0_n0_p6_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -5321,7 +5353,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5352,13 +5384,13 @@ static void lts_ecs_fm0_n1_p6_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -5456,7 +5488,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5488,13 +5520,13 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -5589,7 +5621,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5621,13 +5653,13 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -5725,7 +5757,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5761,13 +5793,13 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -5862,7 +5894,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5898,13 +5930,13 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -6002,7 +6034,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6033,13 +6065,13 @@ static void lts_ecs_fm0_ham0_p6_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -6134,7 +6166,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6165,13 +6197,13 @@ static void lts_ecs_fm0_ham1_p6_ilores_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -6268,7 +6300,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6285,7 +6317,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6303,10 +6335,10 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -6389,7 +6421,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6406,7 +6438,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6424,10 +6456,10 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -6513,7 +6545,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6531,7 +6563,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6550,10 +6582,10 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -6636,7 +6668,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6654,7 +6686,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6673,10 +6705,10 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                uae_u32 t0 = 0;
                                if (!extblank) {
@@ -6779,7 +6811,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6804,7 +6836,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6822,10 +6854,10 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -6833,9 +6865,33 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_spr_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                               gpix2 = get_genlock_transparency(spix2);
+
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
+                                               gpix3 = get_genlock_transparency(spix3);
+
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -6920,7 +6976,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6945,7 +7001,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6963,10 +7019,10 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -6974,9 +7030,33 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_spr_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                               gpix2 = get_genlock_transparency(spix2);
+
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
+                                               gpix3 = get_genlock_transparency(spix3);
+
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -7064,7 +7144,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7090,7 +7170,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7109,10 +7189,10 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -7120,9 +7200,33 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_spr_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                               gpix2 = get_genlock_transparency(spix2);
+
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
+                                               gpix3 = get_genlock_transparency(spix3);
+
                                        }
                                }
                                uae_u32 t0 = 0;
@@ -7207,7 +7311,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_spr_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7233,7 +7337,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7252,10 +7356,10 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_spr_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -7263,9 +7367,33 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_spr_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                               gpix2 = get_genlock_transparency(spix2);
+
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
+                                               gpix3 = get_genlock_transparency(spix3);
+
                                        }
                                }
                                uae_u32 t0 = 0;
index 453b93e7034cfbdb7d3522ac0353439d3f6329c8..886ddd68503ab72f98cd22d9a400cfb07085b881 100644 (file)
@@ -9301,7 +9301,13 @@ static void lts_ecs_fm0_n0_p2_ihires_dhires_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -9400,7 +9406,13 @@ static void lts_ecs_fm0_n1_p2_ihires_dhires_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -9504,7 +9516,13 @@ static void lts_ecs_fm0_dpf0_p2_ihires_dhires_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -9605,7 +9623,13 @@ static void lts_ecs_fm0_dpf1_p2_ihires_dhires_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -9723,7 +9747,13 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -9822,7 +9852,13 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -9926,7 +9962,13 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -10027,7 +10069,13 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -16429,9 +16477,27 @@ static void lts_ecs_fm0_n0_p2_ihires_dshres_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -16560,9 +16626,27 @@ static void lts_ecs_fm0_n1_p2_ihires_dshres_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -16696,9 +16780,27 @@ static void lts_ecs_fm0_dpf0_p2_ihires_dshres_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -16829,9 +16931,27 @@ static void lts_ecs_fm0_dpf1_p2_ihires_dshres_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -16979,9 +17099,27 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -17110,9 +17248,27 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -17246,9 +17402,27 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -17379,9 +17553,27 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_spr_ntsc(void)
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
                                        if (spix0) {
                                                dpix_val0 = denise_colors.acolors[spix0];
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
index 779d8891ae33734fa23b3c4f3f12d16c219f50d9..de17472231e406c941370ceab0596f32b592f692 100644 (file)
@@ -16,7 +16,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -82,7 +82,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -151,7 +151,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -218,7 +218,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -288,7 +288,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -359,7 +359,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -433,7 +433,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -499,7 +499,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -569,7 +569,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -652,7 +652,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -738,7 +738,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -822,7 +822,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -909,7 +909,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -997,7 +997,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1088,7 +1088,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1171,7 +1171,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1256,7 +1256,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1272,7 +1272,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dlores_ntsc_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1335,7 +1335,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1351,7 +1351,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dlores_ntsc_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1417,7 +1417,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1434,7 +1434,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dlores_ntsc_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1498,7 +1498,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dlores_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1515,7 +1515,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dlores_ntsc_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1599,7 +1599,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1623,7 +1623,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dlores_spr_ntsc_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1695,7 +1695,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1719,7 +1719,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dlores_spr_ntsc_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1794,7 +1794,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1819,7 +1819,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dlores_spr_ntsc_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -1892,7 +1892,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dlores_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -1917,7 +1917,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dlores_spr_ntsc_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -2008,7 +2008,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2029,7 +2029,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dhires_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -2092,7 +2092,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2113,7 +2113,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dhires_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -2179,7 +2179,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2201,7 +2201,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dhires_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -2264,7 +2264,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2286,7 +2286,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dhires_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -2352,7 +2352,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2378,7 +2378,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dhires_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -2441,7 +2441,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2467,7 +2467,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dhires_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -2533,7 +2533,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2554,7 +2554,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dhires_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -2617,7 +2617,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2638,7 +2638,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dhires_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -2705,7 +2705,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2734,7 +2734,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dhires_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -2807,7 +2807,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2836,7 +2836,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dhires_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -2912,7 +2912,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -2942,7 +2942,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dhires_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3015,7 +3015,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3045,7 +3045,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dhires_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3121,7 +3121,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3155,7 +3155,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dhires_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3228,7 +3228,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3262,7 +3262,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dhires_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3338,7 +3338,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3367,7 +3367,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dhires_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3440,7 +3440,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3469,7 +3469,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dhires_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 2;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -3544,7 +3544,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3560,7 +3560,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_ntsc_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3637,7 +3637,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3653,7 +3653,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_ntsc_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3733,7 +3733,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3750,7 +3750,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_ntsc_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3828,7 +3828,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3845,7 +3845,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_ntsc_genlock(void)
                        shiftbpl4();
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3943,7 +3943,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -3967,7 +3967,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_spr_ntsc_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -3989,7 +3989,15 @@ static void lts_ecs_fm0_n0_p4_ihires_dhires_spr_ntsc_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -4054,7 +4062,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4078,7 +4086,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_spr_ntsc_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -4100,7 +4108,15 @@ static void lts_ecs_fm0_n1_p4_ihires_dhires_spr_ntsc_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -4168,7 +4184,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4193,7 +4209,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_spr_ntsc_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -4216,7 +4232,15 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dhires_spr_ntsc_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -4281,7 +4305,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4306,7 +4330,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_spr_ntsc_genlock(void)
                        }
                        internal_pixel_cnt += 2;
                        uae_u8 pix1 = 0;
-                       uae_u16 gpix1 = 0xffff;
+                       uae_u8 gpix1 = 0xff;
                        uae_u32 dpix_val1 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix1 = get_genlock_transparency_border();
@@ -4329,7 +4353,15 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dhires_spr_ntsc_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -4412,7 +4444,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4435,13 +4467,13 @@ static void lts_ecs_fm0_n0_p6_ilores_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -4532,7 +4564,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4555,13 +4587,13 @@ static void lts_ecs_fm0_n1_p6_ilores_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -4655,7 +4687,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4679,13 +4711,13 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -4776,7 +4808,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4800,13 +4832,13 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -4900,7 +4932,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -4928,13 +4960,13 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -5025,7 +5057,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5053,13 +5085,13 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -5153,7 +5185,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5176,13 +5208,13 @@ static void lts_ecs_fm0_ham0_p6_ilores_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -5273,7 +5305,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5296,13 +5328,13 @@ static void lts_ecs_fm0_ham1_p6_ilores_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -5397,7 +5429,7 @@ static void lts_ecs_fm0_n0_p6_ilores_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5428,13 +5460,13 @@ static void lts_ecs_fm0_n0_p6_ilores_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -5537,7 +5569,7 @@ static void lts_ecs_fm0_n1_p6_ilores_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5568,13 +5600,13 @@ static void lts_ecs_fm0_n1_p6_ilores_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -5680,7 +5712,7 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5712,13 +5744,13 @@ static void lts_ecs_fm0_dpf0_p6_ilores_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -5821,7 +5853,7 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -5853,13 +5885,13 @@ static void lts_ecs_fm0_dpf1_p6_ilores_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -5965,7 +5997,7 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6001,13 +6033,13 @@ static void lts_ecs_fm0_ehb0_p6_ilores_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -6110,7 +6142,7 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6146,13 +6178,13 @@ static void lts_ecs_fm0_ehb1_p6_ilores_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -6258,7 +6290,7 @@ static void lts_ecs_fm0_ham0_p6_ilores_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6289,13 +6321,13 @@ static void lts_ecs_fm0_ham0_p6_ilores_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -6398,7 +6430,7 @@ static void lts_ecs_fm0_ham1_p6_ilores_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6429,13 +6461,13 @@ static void lts_ecs_fm0_ham1_p6_ilores_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val2 = dpix_val1;
                        uae_u8 pix2 = pix1;
-                       uae_u16 gpix2 = gpix1;
+                       uae_u8 gpix2 = gpix1;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -6540,7 +6572,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6557,7 +6589,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6575,10 +6607,10 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -6669,7 +6701,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6686,7 +6718,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6704,10 +6736,10 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -6801,7 +6833,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6819,7 +6851,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6838,10 +6870,10 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -6932,7 +6964,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_ntsc_genlock(void)
                        int cnt = denise_hcounter << 2;
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -6950,7 +6982,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -6969,10 +7001,10 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                dtbuf[h][0] = dpix_val0;
                                dtgbuf[h][0] = gpix0;
@@ -7083,7 +7115,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7108,7 +7140,7 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7126,10 +7158,10 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -7137,9 +7169,33 @@ static void lts_ecs_fm0_n0_p4_ihires_dshres_spr_ntsc_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                               gpix2 = get_genlock_transparency(spix2);
+
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
+                                               gpix3 = get_genlock_transparency(spix3);
+
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -7232,7 +7288,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7257,7 +7313,7 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7275,10 +7331,10 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -7286,9 +7342,33 @@ static void lts_ecs_fm0_n1_p4_ihires_dshres_spr_ntsc_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                               gpix2 = get_genlock_transparency(spix2);
+
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
+                                               gpix3 = get_genlock_transparency(spix3);
+
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -7384,7 +7464,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7410,7 +7490,7 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7429,10 +7509,10 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -7440,9 +7520,33 @@ static void lts_ecs_fm0_dpf0_p4_ihires_dshres_spr_ntsc_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                               gpix2 = get_genlock_transparency(spix2);
+
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
+                                               gpix3 = get_genlock_transparency(spix3);
+
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
@@ -7535,7 +7639,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_spr_ntsc_genlock(void)
                        if (checkhorizontal1_ecs(denise_hcounter, denise_hcounter_next, h)) continue;
                        matchsprites(cnt + 0);
                        uae_u8 pix0 = 0;
-                       uae_u16 gpix0 = 0xffff;
+                       uae_u8 gpix0 = 0xff;
                        uae_u32 dpix_val0 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix0 = get_genlock_transparency_border();
@@ -7561,7 +7665,7 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        internal_pixel_cnt += 1;
                        uae_u8 pix2 = 0;
-                       uae_u16 gpix2 = 0xffff;
+                       uae_u8 gpix2 = 0xff;
                        uae_u32 dpix_val2 = BLANK_COLOR;
                        if (!denise_blank_active) {
                                gpix2 = get_genlock_transparency_border();
@@ -7580,10 +7684,10 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_spr_ntsc_genlock(void)
                        internal_pixel_cnt += 1;
                        uae_u32 dpix_val1 = dpix_val0;
                        uae_u8 pix1 = pix0;
-                       uae_u16 gpix1 = gpix0;
+                       uae_u8 gpix1 = gpix0;
                        uae_u32 dpix_val3 = dpix_val2;
                        uae_u8 pix3 = pix2;
-                       uae_u16 gpix3 = gpix2;
+                       uae_u8 gpix3 = gpix2;
                        if (denise_pixtotal >= 0 && denise_pixtotal < denise_pixtotal_max) {
                                if (sv0) {
                                        uae_u32 spix0 = denise_render_sprites2(pix0, sv0);
@@ -7591,9 +7695,33 @@ static void lts_ecs_fm0_dpf1_p4_ihires_dshres_spr_ntsc_genlock(void)
                                                dpix_val0 = denise_colors.acolors[spix0];
                                                gpix0 = get_genlock_transparency(spix0);
 
-                                               dpix_val1 = dpix_val0;
-                                               dpix_val2 = dpix_val0;
-                                               dpix_val3 = dpix_val0;
+                                       }
+                               }
+                               uae_u32 sv1 = sv0;
+                               if (sv1) {
+                                       uae_u32 spix1 = denise_render_sprites2(pix1, sv1);
+                                       if (spix1) {
+                                               dpix_val1 = denise_colors.acolors[spix1];
+                                               gpix1 = get_genlock_transparency(spix1);
+
+                                       }
+                               }
+                               uae_u32 sv2 = sv0;
+                               if (sv2) {
+                                       uae_u32 spix2 = denise_render_sprites2(pix2, sv2);
+                                       if (spix2) {
+                                               dpix_val2 = denise_colors.acolors[spix2];
+                                               gpix2 = get_genlock_transparency(spix2);
+
+                                       }
+                               }
+                               uae_u32 sv3 = sv0;
+                               if (sv3) {
+                                       uae_u32 spix3 = denise_render_sprites2(pix3, sv3);
+                                       if (spix3) {
+                                               dpix_val3 = denise_colors.acolors[spix3];
+                                               gpix3 = get_genlock_transparency(spix3);
+
                                        }
                                }
                                dtbuf[h][0] = dpix_val0;
index 4150fd00e6902edeafbabab5adb902d7a3880705..abedcaed6c7d5a54f44c004bb021dc8f44d68da9 100644 (file)
@@ -134,7 +134,7 @@ static LPBITMAPINFOHEADER lpbi;
 static PCOMPVARS pcompvars;
 
 extern bool need_genlock_data;
-extern uae_u16 **row_map_genlock;
+extern uae_u8 **row_map_genlock;
 
 static bool usealpha(void)
 {
index 706c260804d5235cf53bf54d6291b4d1c2c799d9..c70b74c0bebf41931ee6a0bd4e2d1fd51c6e7b24 100644 (file)
@@ -31,7 +31,7 @@ int screenshot_clipmode = 0;
 int screenshot_multi = 0;
 
 extern bool need_genlock_data;
-extern uae_u16 **row_map_genlock;
+extern uae_u8 **row_map_genlock;
 
 static bool usealpha(void)
 {
index 2b66323cf99cf797f0e6ae935cb7ec7334a87dca..25eac603062de3fcf7e389615611b0ddcebb5b5f 100755 (executable)
@@ -73,7 +73,7 @@ static bool automatic;
 static int monitor;
 
 extern uae_u16 bplcon0;
-extern uae_u16 **row_map_genlock;
+extern uae_u8 **row_map_genlock;
 static int spm_left_border;
 
 static uae_u8 graffiti_palette[256 * 4];
@@ -811,14 +811,14 @@ static bool firecracker24(struct vidbuffer *src, struct vidbuffer *dst, bool dou
                if (yoff >= src->inheight)
                        continue;
                uae_u8 *line = src->bufmem + yoff * src->rowbytes;
-               uae_u16 *line_genlock = row_map_genlock[yoff];
+               uae_u8 *line_genlock = row_map_genlock[yoff];
                uae_u8 *dstline = dst->bufmem + (((y * 2 + oddlines) - dst->yoffset) / vdbl) * dst->rowbytes;
                uae_u8 *vramline = sm_frame_buffer + (fc24_y + oddlines) * SM_VRAM_WIDTH * SM_VRAM_BYTES + bufferoffset;
                fc24_x = 0;
                for (x = 0; x < src->inwidth; x++) {
                        uae_u8 r = 0, g = 0, b = 0;
                        uae_u8 *s = line + ((x << 1) / hdbl) * src->pixbytes;
-                       uae_u16 *s_genlock = line_genlock + ((x << 1) / hdbl);
+                       uae_u8 *s_genlock = line_genlock + ((x << 1) / hdbl);
                        uae_u8 *d = dstline + ((x << 1) / hdbl) * dst->pixbytes;
                        int fc24_xx = (fc24_x >> fc24_dx) - fc24_xoffset;
                        uae_u8 *vramptr = NULL;
@@ -1682,7 +1682,7 @@ static bool ham_e(struct vidbuffer *src, struct vidbuffer *dst, bool doublelines
                if (yoff >= src->inheight)
                        continue;
                uae_u8 *line = src->bufmem + yoff * src->rowbytes;
-               uae_u16 *line_genlock = row_map_genlock[yoff];
+               uae_u8 *line_genlock = row_map_genlock[yoff];
                uae_u8 *dstline = dst->bufmem + (((y * 2 + oddlines) - dst->yoffset) / vdbl) * dst->rowbytes;
 
                bool getpalette = false;
@@ -1691,7 +1691,7 @@ static bool ham_e(struct vidbuffer *src, struct vidbuffer *dst, bool doublelines
                int oddeven = 0;
                for (x = 0; x < src->inwidth; x++) {
                        uae_u8 *s = line + ((x << 1) / hdbl) * src->pixbytes;
-                       uae_u16 *s_genlock = line_genlock + ((x << 1) / hdbl);
+                       uae_u8 *s_genlock = line_genlock + ((x << 1) / hdbl);
                        uae_u8 *d = dstline + ((x << 1) / hdbl) * dst->pixbytes;
                        uae_u8 *s2 = s + src->rowbytes;
                        uae_u8 *d2 = d + dst->rowbytes;
@@ -2595,7 +2595,7 @@ skip:
                bool ztoggle = false;
                uae_u8 *line = src->bufmem + yoff * src->rowbytes;
                uae_u8 *dstline = dst->bufmem + (((y * 2 + oddlines) - dst->yoffset) >> vdbl) * dst->rowbytes;
-               uae_u16 *line_genlock = row_map_genlock[yoff];
+               uae_u8 *line_genlock = row_map_genlock[yoff];
                int gy = (((y * 2 + oddlines) - src->yoffset + offsety - gen_yoffset) >> vdbl) * deltay / 65536;
                if (genlock_image_upsidedown)
                        gy = (genlock_image_height - 1) - gy;
@@ -2605,7 +2605,7 @@ skip:
                noise_add = (quickrand() & 15) | 1;
                uae_u8 *s = line;
                uae_u8 *d = dstline;
-               uae_u16 *s_genlock = line_genlock;
+               uae_u8 *s_genlock = line_genlock;
                if (first) {
                        firstdstline = dstline;
                        first = false;
@@ -2880,7 +2880,7 @@ struct opals {
 static struct opals *opal;
 
 
-static void opal_pixel(struct opals *opal, uae_u8 *d, uae_u8 *d2, uae_u8 *s, uae_u8 *s2, uae_u16 *s_genlock, struct vidbuffer *src, struct vidbuffer *dst, uae_u8 r, uae_u8 g, uae_u8 b, uae_u8 pr, bool doublelines, bool hires, bool nextpix)
+static void opal_pixel(struct opals *opal, uae_u8 *d, uae_u8 *d2, uae_u8 *s, uae_u8 *s2, uae_u8 *s_genlock, struct vidbuffer *src, struct vidbuffer *dst, uae_u8 r, uae_u8 g, uae_u8 b, uae_u8 pr, bool doublelines, bool hires, bool nextpix)
 {
        bool oa;
        switch (opal->priority_stencil_mode | pr)
@@ -3005,7 +3005,7 @@ static bool opalvision(struct vidbuffer *src, struct vidbuffer *dst, bool double
        for (; y < yend; y++) {
 
                uae_u8 *line = NULL;
-               uae_u16 *line_genlock = NULL;
+               uae_u8 *line_genlock = NULL;
                uae_u8 *dstline = NULL;
                int ydisp = -1;
 
@@ -3095,7 +3095,7 @@ static bool opalvision(struct vidbuffer *src, struct vidbuffer *dst, bool double
 
                        uae_u8 *s = line + ((ax << 1) >> hdbl_shift) * src->pixbytes;
                        uae_u8 *s2 = s + src->rowbytes;
-                       uae_u16 *s_genlock = line_genlock ? line_genlock + ((ax << 1) >> hdbl_shift) : NULL;
+                       uae_u8 *s_genlock = line_genlock ? line_genlock + ((ax << 1) >> hdbl_shift) : NULL;
 
                        if (!oddeven) {