Skip to content

Commit

Permalink
Synced draw_frame2 with WinUAE
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Dec 29, 2020
1 parent 54ec542 commit 3b3d8e0
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions src/drawing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3861,35 +3861,29 @@ static void refresh_indicator_update(struct vidbuffer *vb)
}
}

static void draw_frame2()
static void draw_frame2(struct vidbuffer *vbin, struct vidbuffer *vbout)
{
struct amigadisplay *ad = &adisplays;
if (ad->framecnt == 0) {
struct vidbuf_description *vidinfo = &ad->gfxvidinfo;
struct vidbuffer *vb = &vidinfo->drawbuffer;

#ifdef AMIBERRY
for (int i = next_line_to_render; i < max_ypos_thisframe; i++) {
for (int i = next_line_to_render; i < max_ypos_thisframe; i++) {
#else
for (int i = 0; i < max_ypos_thisframe; i++) {
for (int i = 0; i < max_ypos_thisframe; i++) {
#endif
int i1 = i + min_ypos_for_screen;
int line = i + thisframe_y_adjust_real;
int whereline = amiga2aspect_line_map[i1];
int wherenext = amiga2aspect_line_map[i1 + 1];
int i1 = i + min_ypos_for_screen;
int line = i + thisframe_y_adjust_real;
int whereline = amiga2aspect_line_map[i1];
int wherenext = amiga2aspect_line_map[i1 + 1];

#ifdef AMIBERRY
if (whereline >= vb->inheight || line >= linestate_first_undecided)
if (whereline >= vbin->inheight || line >= linestate_first_undecided)
#else
if (whereline >= vb->inheight)
if (whereline >= vbin->inheight)
#endif
break;
if (whereline < 0)
continue;
break;
if (whereline < 0)
continue;

hposblank = 0;
pfield_draw_line(vb, line, whereline, wherenext);
}
hposblank = 0;
pfield_draw_line(vbout, line, whereline, wherenext);
}
}

Expand Down Expand Up @@ -4005,7 +3999,7 @@ bool draw_frame(struct vidbuffer *vb)
last_drawn_line = 0;
first_drawn_line = 32767;
drawing_color_matches = -1;
draw_frame2 ();
draw_frame2 (vb, NULL);
last_drawn_line = 0;
first_drawn_line = 32767;
drawing_color_matches = -1;
Expand Down Expand Up @@ -4054,7 +4048,7 @@ static void finish_drawing_frame(bool drawlines)
return;
}

draw_frame2();
draw_frame2(vb, vb);

draw_frame_extras(vb, -1, -1);

Expand Down Expand Up @@ -4231,7 +4225,7 @@ void vsync_handle_redraw(int long_field, int lof_changed, uae_u16 bplcon0p, uae_
render_sem = nullptr;
}
#endif

quit_program = -quit_program;
set_inhibit_frame(IHF_QUIT_PROGRAM);
set_special(SPCFLAG_BRK | SPCFLAG_MODE_CHANGE);
Expand Down Expand Up @@ -4331,7 +4325,6 @@ void hsync_record_line_state (int lineno, enum nln_how how, int changed)
}
break;
}

#ifdef AMIBERRY
linestate_first_undecided = lineno + 1;
if (render_tid && linestate_first_undecided > 3 && !render_thread_busy) {
Expand Down Expand Up @@ -4380,7 +4373,7 @@ static void gfxbuffer_reset(int monid)
vidinfo->drawbuffer.lockscr = dummy_lock;
vidinfo->drawbuffer.unlockscr = dummy_unlock;
}

void notice_resolution_seen (int res, bool lace)
{
if (res > frame_res)
Expand Down

0 comments on commit 3b3d8e0

Please # to comment.