Went through the whole code and disabled one part after another. Mostly whole functions, later parts of functions. If the bug stayed I enabled the part again and disabled the next and so on.Cool, out of interest, what was causing the screen flashing bug?
Of course the bug only disappeared after I reached almost the end of the file...
Can't exactly explain why because it was mostly trial and error, but after disabling certain parts in this function the bug was gone (see the commented lines):
Code:
static __inline__ void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos)
{
int border = 0;
dp_for_drawing = line_decisions + lineno;
dip_for_drawing = curr_drawinfo + lineno;
if (dp_for_drawing->plfleft == -1)
border = 1;
linestate[lineno] = LINE_DONE;
xlinebuffer = row_map[gfx_ypos];
xlinebuffer -= LINETOSCR_X_ADJUST_BYTES + moveX;
if (border == 0)
{
// uae_u8 change = line_changes[lineno];
// if (change | dip_for_drawing->nr_sprites) {
pfield_expand_dp_bplcon ();
pfield_init_linetoscr ();
// }
// if (change)
pfield_draw_line_1 ();
/* Lines in which sprites are drawn (transparent color is ignored),
* have to be redrawn as well.
*/
// line_changes_sprites = 0;
if (dip_for_drawing->nr_sprites)
{
int i;
decide_draw_sprites();
for (i = 0; i < dip_for_drawing->nr_sprites; i++) {
if (currprefs.chipset_mask & CSMASK_AGA)
draw_sprites_aga (curr_sprite_entries + dip_for_drawing->first_sprite_entry + i);
else
draw_sprites_ecs (curr_sprite_entries + dip_for_drawing->first_sprite_entry + i);
}
}
/* Line was changed or sprites have been drawn in it? */
// if (line_changes[lineno] | line_changes_sprites) {
do_color_changes (pfield_do_fill_line, (void (*)(int, int))pfield_do_linetoscr);
do_flush_line (gfx_ypos);
// }
/* Lines in which sprites were drawn will have to be redrawn in the
* next frame to clear old data as sprite moves up or down.
*/
// SET_LINE_CHANGE(lineno, line_changes_sprites)
}
else if (border == 1)
{
adjust_drawing_colors (dp_for_drawing->ctable, 0);
if (dip_for_drawing->nr_color_changes == 0)
{
fill_line ();
do_flush_line (gfx_ypos);
return;
}
playfield_start = VISIBLE_RIGHT_BORDER;
playfield_end = VISIBLE_RIGHT_BORDER;
do_color_changes(pfield_do_fill_line, pfield_do_fill_line);
do_flush_line (gfx_ypos);
}
else
{
xcolnr tmp = colors_for_drawing.acolors[0];
colors_for_drawing.acolors[0] = getxcolor (0);
fill_line ();
do_flush_line (gfx_ypos);
colors_for_drawing.acolors[0] = tmp;
}
}
Thanks again for helping me with the linking errors!
Last edited by a moderator: