static int ham_decode_pixel;
static unsigned int ham_lastcolor;
+static bool ham_decode_start;
/* Decode HAM in the invisible portion of the display (left of VISIBLE_LEFT_BORDER),
* but don't draw anything in. This is done to prepare HAM_LASTCOLOR for later,
int unpainted_amiga = unpainted + hamleftborderhidden;
ham_decode_pixel = src_pixel - hamleftborderhidden;
- ham_lastcolor = color_reg_get (&colors_for_drawing, 0);
+ ham_lastcolor = color_reg_get(&colors_for_drawing, 0);
if (!bplham) {
if (unpainted_amiga > 0) {
}
}
}
+
+ ham_decode_start = true;
}
static void decode_ham(int pix, int stoppos, int blank)
{
int todraw_amiga = res_shift_from_window(stoppos - pix);
+ if (ham_decode_start) {
+ // first HAM decoding in scanline: start from previous pixel
+ todraw_amiga++;
+ ham_decode_pixel--;
+ ham_decode_start = false;
+ }
+
if (!bplham) {
while (todraw_amiga-- > 0) {
int pv = pixdata.apixels[ham_decode_pixel];
uae_u16 b4sp = dp_for_drawing->bplcon4sp;
uae_u16 fm = dp_for_drawing->fmode;
init_ham_decoding();
+ int oham_decode_pixel = ham_decode_pixel;
do_color_changes(dummy_worker, decode_ham, lineno);
if (have_color_changes) {
// do_color_changes() did color changes and register changes, restore them.
set_res_shift();
}
hposblank = ohposblank;
- ham_decode_pixel = src_pixel;
+ ham_decode_pixel = oham_decode_pixel;
bplham = dp_for_drawing->ham_at_start;
setbplmode();
}