static bool crender_screen(int monid, int mode, bool immediate)
{
if (currprefs.gfx_vresolution && interlace_seen > 0 && currprefs.gfx_iscanlines == 0) {
- // if non-fields interlace mode: render only every other frame
- if (vsync_counter & 1) {
+ // if non-fields interlace mode: render only complete frames
+ if (!lof_display) {
return true;
}
}
}
}
+ if (GET_PLANES(bplcon0)) {
+ notice_resolution_seen(GET_RES_AGNUS(bplcon0), interlace_seen != 0);
+ }
}
devices_hsync();
int get_custom_limits(int *pw, int *ph, int *pdx, int *pdy, int *prealh, int *hres, int *vres)
{
+ static int interlace_count;
+ static int interlace_lof[2];
struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo;
int w, h, dx, dy, y1, y2, dbl1, dbl2;
int ret = 0;
ret = -1;
if (interlace_seen) {
- static int interlace_count;
- // interlace = only use long frames
- if (lof_display && (interlace_count & 1) == 0)
- interlace_count++;
- if (!lof_display && (interlace_count & 1) != 0)
+ for (;;) {
+ // if more than 1 long or short frames only: accept it, we may have double (non field) mode.
+ if (interlace_lof[0] >= 2 || interlace_lof[1] >= 2) {
+ break;
+ }
+ // wait for long frame
+ if (interlace_lof[0] && interlace_lof[1]) {
+ if (!lof_display) {
+ return ret;
+ }
+ }
interlace_count++;
- if (interlace_count < 3)
- return ret;
- if (!lof_display)
- return ret;
+ interlace_lof[lof_display]++;
+ if (interlace_count < 3) {
+ return ret;
+ }
+ }
+ } else {
interlace_count = 0;
+ interlace_lof[0] = 0;
+ interlace_lof[1] = 0;
}
int skip = denise_hdelay << (RES_MAX + 1);
static int frame_res_cnt;
static int autoswitch_old_resolution;
+
+void notice_resolution_seen(int res, bool lace)
+{
+ if (res > frame_res) {
+ frame_res = res;
+ }
+ if (res > 0) {
+ can_use_lores = 0;
+ }
+ if (!frame_res_lace && lace) {
+ frame_res_lace = lace;
+ }
+}
+
static void init_drawing_frame(void)
{
struct amigadisplay *ad = &adisplays[0];
int largest_count = 0;
int largest_count_res = 0;
for (int i = 0; i <= RES_MAX; i++) {
- if (resolution_count[i])
+ if (resolution_count[i]) {
largest_res = i;
+ }
if (resolution_count[i] >= largest_count) {
largest_count = resolution_count[i];
largest_count_res = i;
ls->lol = lol;
}
- resolution_count[denise_res]++;
+ if (!line_is_blanked && denise_planes > 0) {
+ resolution_count[denise_res]++;
+ }
lines_count++;
}
get_line(gfx_ypos, how);
+ if (!buf1 && !ls->blankedline && denise_planes > 0) {
+ resolution_count[denise_res]++;
+ }
+ lines_count++;
+
if (!buf1) {
return;
}
get_line(gfx_ypos, how);
+ if (!buf1 && !ls->blankedline && denise_planes > 0) {
+ resolution_count[denise_res]++;
+ }
+ lines_count++;
+
+
if (!buf1) {
return;
}
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 get_custom_mouse_limits(int *pw, int *ph, int *pdx, int *pdy, int dbl);
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);
extern int get_vertical_visible_height(bool);
extern void get_mode_blanking_limits(int *phbstop, int *phbstrt, int *pvbstop, int *pvbstrt);
+extern void notice_resolution_seen(int res, bool lace);
/* Finally, stuff that shouldn't really be shared. */