#define SPRBORDER 0
-#define EXTRAHEIGHT_BROADCAST_TOP 0
-#define EXTRAHEIGHT_BROADCAST_BOTTOM 0
#define EXTRAHEIGHT_EXTREME 28
#define LORES_TO_SHRES_SHIFT 2
static bool lol;
static bool linetoggle;
static int next_lineno;
-int linear_vpos, linear_hpos, linear_vpos_prev[3], linear_hpos_prev[3];
+int linear_vpos, linear_vpos_vb_start, linear_vpos_vb_end, linear_hpos, linear_vpos_prev[3], linear_hpos_prev[3];
+static int linear_vb_offset;
static int linear_vpos_vsync;
-static int linear_display_vpos;
+int linear_display_vpos;
int current_linear_vpos, current_linear_hpos;
static int current_linear_hblen, current_linear_hblen_temp;
int current_linear_vpos_nom, current_linear_hpos_short;
-static int linear_vpos_visible, current_linear_vpos_visible;
+static int linear_vpos_visible;
+static int linear_vpos_vblank_end, linear_vpos_vblank_start, linear_vpos_vblank_vsync;
+static int linear_vpos_vblank_lines_cnt, linear_vpos_vblank_lines;
+static int current_linear_vblank_lines;
+static int current_linear_vpos_vb_start, current_linear_vpos_vb_end, current_linear_vpos_vb_vsync;
static int current_linear_vpos_temp, current_linear_hpos_temp;
static int current_linear_temp_change;
static bool display_redraw;
static int display_hstart_cyclewait, display_hstart_cyclewait_cnt, display_hstart_cyclewait_end;
static int display_hstart_cyclewait_skip, display_hstart_cyclewait_skip2;
+static int display_vblankstart_skip, display_vblankend_skip;
static bool display_hstart_cyclewait_start;
static int agnus_trigger_cck;
static int linear_vpos_changes;
static bool beamcon0_dual, beamcon0_pal;
uae_u16 bemcon0_hsync_mask, bemcon0_vsync_mask;
bool beamcon0_has_hsync, beamcon0_has_vsync, beamcon0_has_csync;
+static bool beamcon0_has_vblank;
static uae_u16 beamcon0_saved;
static uae_u16 bplcon0_saved, bplcon1_saved, bplcon2_saved;
static uae_u16 bplcon3_saved, bplcon4_saved;
if (currprefs.gfx_overscanmode >= OVERSCANMODE_EXTREME) {
vb->extrawidth = -1;
}
- int mfl = minfirstline_linear;
- if (currprefs.gfx_overscanmode < OVERSCANMODE_ULTRA) {
- mfl += 2;
+ int maxv = current_linear_vpos - (current_linear_vblank_lines - display_vblankstart_skip) + display_vblankend_skip + 1;
+ linear_vpos_vb_end = current_linear_vpos_vb_end - display_vblankstart_skip - 1;
+ if (currprefs.gfx_overscanmode >= OVERSCANMODE_ULTRA) {
+ maxv = current_linear_vpos;
+ linear_vpos_vb_end = 0;
}
- int maxv = current_linear_vpos - mfl;
vb->inheight = maxv << vres2;
vb->inheight2 = vb->inheight;
vb->inxoffset = 0;
+ if (currprefs.gfx_overscanmode >= OVERSCANMODE_ULTRA) {
+ linear_vpos_vb_end = 0;
+ linear_vpos_vb_start = 0;
+ } else {
+ if (linear_vpos_vb_end < LINES_AFTER_VSYNC) {
+ linear_vpos_vb_end = LINES_AFTER_VSYNC;
+ }
+ linear_vpos_vb_start = current_linear_vpos_vb_start + display_vblankend_skip + 1;
+ if (linear_vpos_vb_start >= current_linear_vpos) {
+ linear_vpos_vb_start -= current_linear_vpos;
+ }
+ }
+
//write_log(_T("Width %d Height %d\n"), vb->inwidth, vb->inheight);
if (vb->inwidth < 16)
beamcon0_has_hsync = (beamcon0 & bemcon0_hsync_mask) != 0;
beamcon0_has_vsync = (beamcon0 & bemcon0_vsync_mask) != 0;
beamcon0_has_csync = (beamcon0 & BEAMCON0_VARCSYEN) != 0;
+ beamcon0_has_vblank = (beamcon0 & BEAMCON0_VARVBEN) != 0;
beamcon0_dual = (new_beamcon0 & BEAMCON0_DUAL) != 0;
agnus_equdis = ecs_agnus && ((beamcon0 & BEAMCON0_VARCSYEN) || (beamcon0 & BEAMCON0_BLANKEN));
}
// after vsync, it seems earlier possible visible line is vsync+3.
- vsync_startline = 3;
+ vsync_startline = LINES_AFTER_VSYNC;
if ((beamcon0 & BEAMCON0_VARVBEN) && (beamcon0 & bemcon0_vsync_mask)) {
vsync_startline += vsstrt;
if (vsync_startline >= vsync_lines / 2) {
- vsync_startline = 3;
+ vsync_startline = LINES_AFTER_VSYNC;
}
}
if (display_hstart_cyclewait < 0) {
display_hstart_cyclewait = 0;
}
- display_hstart_cyclewait_end = 7;// hblen / 2 - display_hstart_cyclewait + 1;
+ display_hstart_cyclewait_end = 10;// hblen / 2 - display_hstart_cyclewait + 1;
if (currprefs.gfx_overscanmode >= OVERSCANMODE_ULTRA) {
display_hstart_cyclewait = 0;
minfirstline = 0;
}
- int minfirstline_hw = minfirstline;
+ minfirstline_linear = linear_vpos_vblank_end;
maxvpos_display_vsync = 0;
+ display_vblankstart_skip = 0;
+ display_vblankend_skip = 0;
if (currprefs.gfx_overscanmode >= OVERSCANMODE_ULTRA) {
+ vsync_startline = 0;
minfirstline = 0;
- minfirstline_hw = 0;
+ minfirstline_linear = 0;
maxvpos_display_vsync = vsync_startline;
+ display_vblankstart_skip = -3000;
} else if (currprefs.gfx_overscanmode == OVERSCANMODE_EXTREME) {
- minfirstline_hw -= EXTRAHEIGHT_EXTREME / 2;
+ minfirstline_linear -= EXTRAHEIGHT_EXTREME / 2;
minfirstline -= EXTRAHEIGHT_EXTREME / 2;
+ display_vblankstart_skip = linear_vpos_vblank_end;
+ display_vblankend_skip = 3;
maxvpos_display_vsync += 2;
+ display_hstart_cyclewait += 6;
+ display_hstart_cyclewait_end -= 6;
} else if (currprefs.gfx_overscanmode == OVERSCANMODE_BROADCAST) {
- minfirstline_hw -= EXTRAHEIGHT_BROADCAST_TOP;
+ minfirstline_linear -= 0;
+ maxvpos_display_vsync++;
+ display_vblankstart_skip = -1;
+ display_vblankend_skip = 2;
+ display_hstart_cyclewait_end--;
+ } else {
maxvpos_display_vsync++;
+ display_vblankstart_skip = -1;
+ display_vblankend_skip = 2;
}
- if (beamcon0 & BEAMCON0_VARBEAMEN) {
- minfirstline_hw = 0;
+ if (minfirstline_linear < 0) {
+ minfirstline_linear += current_linear_vpos_nom;
}
if ((beamcon0 & BEAMCON0_VARVBEN) && (beamcon0 & bemcon0_vsync_mask)) {
minfirstline = vsync_lines - 1;
}
- if (minfirstline < minfirstline_hw) {
- minfirstline = minfirstline_hw;
- }
-
if (beamcon0 & bemcon0_vsync_mask) {
if (minfirstline < vsync_startline) {
minfirstline = vsync_startline;
maxvpos_total = MAXVPOS;
}
- minfirstline_linear = minfirstline - (vsync_startline > 0 ? vsync_startline : 0);
-
int size = currprefs.gfx_overscanmode >= OVERSCANMODE_ULTRA ? 0 : 4;
display_hstart_cyclewait_skip2 = display_hstart_cyclewait_end;
display_hstart_cyclewait_skip = display_hstart_cyclewait - size;
current_linear_hpos_short = linear_hpos;
current_linear_hpos_temp = current_linear_hpos;
current_linear_vpos_temp = current_linear_vpos;
+ current_linear_vblank_lines = minfirstline;
+ current_linear_vpos_vb_end = minfirstline - vsync_startline;
+ current_linear_vpos_vb_start = current_linear_vpos + 1;
current_linear_temp_change = 0;
- current_linear_vpos_visible = 0;
hsync_cck = linear_hpos;
vsync_lines = linear_vpos;
vsync_linecnt = 0;
agnus_vb_active_end_line = agnus_pvb_end_line;
agnus_vb_active_start_line = agnus_pvb_start_line;
if (agnus_pvb_start_line) {
- current_linear_vpos_visible = linear_vpos_visible;
+ if (linear_vpos_vblank_lines_cnt) {
+ linear_vpos_vblank_start = linear_vpos;
+ }
+ linear_vpos_vblank_lines_cnt = 0;
}
if (agnus_pvb_end_line) {
linear_vpos_visible = 1;
+ linear_vpos_vblank_end = linear_vpos;
+ linear_vpos_vblank_lines = linear_vpos_vblank_lines_cnt;
}
} else {
agnus_vb_active = agnus_vb == 1;
agnus_vb_active_end_line = agnus_vb_end_line;
agnus_vb_active_start_line = agnus_vb_start_line;
if (agnus_vb_start_line) {
- current_linear_vpos_visible = linear_vpos_visible;
+ if (linear_vpos_vblank_lines_cnt) {
+ linear_vpos_vblank_start = linear_vpos;
+ }
+ linear_vpos_vblank_lines_cnt = 0;
}
if (agnus_vb_end_line) {
linear_vpos_visible = 1;
+ linear_vpos_vblank_end = linear_vpos;
+ linear_vpos_vblank_lines = linear_vpos_vblank_lines_cnt;
}
}
}
// draw line up to current horizontal position to get accurate collision state
if (currprefs.cpu_memory_cycle_exact && currprefs.m68k_speed >= 0 && !doflickerfix_active()) {
int ldvpos = linear_display_vpos + draw_line_next_line;
+ ldvpos -= linear_vb_offset;
draw_line(ldvpos, false);
}
draw_denise_line_queue_flush();
nextline_how = currprefs.gfx_vresolution > VRES_NONDOUBLE && currprefs.gfx_pscanlines == 1 ? nln_nblack : nln_doubled;
}
}
+
return lineno;
}
current_linear_hpos_temp = hp;
current_linear_vpos_temp = vp;
current_linear_temp_change = 2;
- if (vp == 0)
- write_log("x");
}
}
}
current_linear_vpos != current_linear_vpos_temp) {
current_linear_hpos = current_linear_hpos_temp;
current_linear_vpos = current_linear_vpos_temp;
+ current_linear_vblank_lines = linear_vpos_vblank_lines;
+ current_linear_vpos_vb_end = linear_vpos_vblank_end;
+ current_linear_vpos_vb_start = linear_vpos_vblank_start;
+ current_linear_vpos_vb_vsync = linear_vpos_vblank_vsync;
current_linear_hpos_short = current_linear_hpos - maxhpos_lol;
current_linear_vpos_nom = current_linear_vpos - lof_store;
init_beamcon0();
{
if (vsync_linecnt) {
vsync_lines = vsync_linecnt;
+ linear_vpos_vblank_vsync = linear_vpos_vblank_lines_cnt;
vsync_linecnt = 0;
+ linear_vpos_prev[2] = linear_vpos_prev[1];
+ linear_vpos_prev[1] = linear_vpos_prev[0];
+ linear_vpos_prev[0] = vsync_lines;
+ linear_vpos = 0;
}
}
if (!beamcon0_has_vsync) {
vsync_mark();
}
- lof_detect = 1;
+ lof_detect = 0;
update_lof_detect();
}
if (vpos == 5 && !lof_store) {
if (!beamcon0_has_vsync) {
vsync_mark();
}
- lof_detect = 0;
+ lof_detect = 1;
update_lof_detect();
}
if (vpos == 5 && lof_store) {
if (beamcon0_has_vsync) {
vsync_mark();
}
- lof_pdetect = 0;
+ lof_pdetect = 1;
}
if (!lof_store && vpos == vsstop) {
agnus_pvsync = false;
if (beamcon0_has_vsync) {
vsync_mark();
}
- lof_pdetect = 1;
+ lof_pdetect = 0;
}
if (lof_store && vpos == vsstop) {
agnus_pvsync = false;
if (beamcon0_has_vsync) {
vsync_mark();
}
- lof_pdetect = 1;
+ lof_pdetect = 0;
}
if (lof_store && vpos == vsstop) {
agnus_pvsync = false;
}
start_draw_denise();
int dvp = calculate_linetype(ldv);
+ dvp -= linear_vb_offset;
draw_denise_border_line_fast_queue(dvp, true, nextline_how, l);
return true;
}
l->color0 = aga_mode ? agnus_colors.color_regs_aga[0] : agnus_colors.color_regs_ecs[0];
l->brdblank = brdblank;
int dvp = calculate_linetype(ldv);
+ dvp -= linear_vb_offset;
draw_denise_border_line_fast_queue(dvp, false, nextline_how, l);
return true;
}
l->bplcon1 = bplcon1 & bc1mask;
l->fetchmode_size = fetchmode_size;
l->fetchstart_mask = fetchstart_mask;
+ dvp -= linear_vb_offset;
draw_denise_bitplane_line_fast_queue(dvp, nextline_how, l);
if (addbpl) {
// advance bpl pointers
int cs = 0;// (beamcon0 & BEAMCON0_VARHSYEN) ? agnus_phsync_end - agnus_phsync_start : agnus_hsync_end - agnus_hsync_start;
int cslen = 10;
+ dvp -= linear_vb_offset;
draw_denise_line_queue(dvp, nextline_how, rga_denise_cycle_line, rga_denise_cycle_start, rga_denise_cycle, rga_denise_cycle_count_start, rga_denise_cycle_count_end,
display_hstart_cyclewait_skip, display_hstart_cyclewait_skip2,
wclks, cs, cslen, lof_store, lol, display_hstart_fastmode - display_hstart_cyclewait, nosignal_status != 0, finalseg, l);
if (!ecs_agnus) {
vpos &= 511;
}
- linear_display_vpos = linear_vpos;
+ linear_display_vpos = linear_vpos;
linear_vpos++;
+ linear_vpos_vblank_lines_cnt++;
linear_vpos_visible++;
draw_line_next_line = 0;
linear_vpos_vsync++;
+
+ if (linear_display_vpos == linear_vpos_vb_end) {
+ int dvp = calculate_linetype(linear_display_vpos);
+ linear_vb_offset = dvp;
+ }
+
#if 1
if (beamcon0_has_vsync) {
if (vpos == vsstrt) {
- //vsync_lines = vsync_linecnt;
- //vsync_linecnt = 0;
linear_vpos_vsync = 0;
}
} else {
if (beamcon0_pal && (vpos == 3 && lof_store) || (vpos == 2 && !lof_store)) {
- //vsync_lines = vsync_linecnt;
- //vsync_linecnt = 0;
linear_vpos_vsync = 0;
}
if (!beamcon0_pal && vpos == 3) {
- //vsync_lines = vsync_linecnt;
- //vsync_linecnt = 0;
linear_vpos_vsync = 0;
}
}
if (vpos == vsync_startline) {
- linear_vpos_prev[2] = linear_vpos_prev[1];
- linear_vpos_prev[1] = linear_vpos_prev[0];
- if (vsync_lines == 0 || vsync_lines > 800)
- write_log("x");
- linear_vpos_prev[0] = vsync_lines;
- linear_vpos = 0;
-
virtual_vsync_check();
last_vsync_evt = get_cycles() + (maxvpos * maxhpos * 3) * CYCLE_UNIT;
if (!beamcon0_has_vsync) {
vsync_mark();
}
- lof_detect = 1;
+ lof_detect = 0;
update_lof_detect();
#ifdef DEBUGGER
if (debug_dma) {
if (!beamcon0_has_vsync) {
vsync_mark();
}
- lof_detect = 0;
+ lof_detect = 1;
update_lof_detect();
#ifdef DEBUGGER
if (debug_dma) {
if (!beamcon0_has_vsync) {
vsync_mark();
}
- lof_detect = 1;
+ lof_detect = 0;
update_lof_detect();
#ifdef DEBUGGER
if (debug_dma) {
if (!beamcon0_has_vsync) {
vsync_mark();
}
- lof_detect = 0;
+ lof_detect = 1;
update_lof_detect();
#ifdef DEBUGGER
if (debug_dma) {
if (beamcon0_has_vsync) {
vsync_mark();
}
- lof_pdetect = 0;
+ lof_pdetect = 1;
#ifdef DEBUGGER
if (debug_dma) {
record_dma_event_agnus(AGNUS_EVENT_PRG_VS, true);
if (beamcon0_has_vsync) {
vsync_mark();
}
- lof_pdetect = 1;
+ lof_pdetect = 0;
#ifdef DEBUGGER
if (debug_dma) {
record_dma_event_agnus(AGNUS_EVENT_PRG_VS, true);
bool ispal(int *lines)
{
if (lines) {
- if (current_linear_vpos_visible) {
- *lines = current_linear_vpos_visible;
+ if (maxvpos_display) {
+ *lines = maxvpos_display - linear_vpos_vblank_lines;
} else {
*lines = currprefs.ntscmode ? (MAXVPOS_NTSC + 1) - (VBLANK_ENDLINE_NTSC - 1) : (MAXVPOS_PAL + 1) - (VBLANK_ENDLINE_PAL - 1);
}
struct denise_rga_queue
{
int type;
- int vpos, linear_vpos;
+ int vpos;
+ int linear_vpos;
+ int linear_vpos_vb_start;
+ int linear_vpos_vb_end;
int gfx_ypos;
nln_how how;
uae_u32 linecnt;
static void denise_handle_quick_strobe(uae_u16 strobe, int offset, int vpos);
static void draw_denise_vsync(int);
static void denise_update_reg(uae_u16 reg, uae_u16 v, uae_u32 linecnt);
-static void draw_denise_line(int gfx_ypos, nln_how how, uae_u32 linecnt, int startpos, int startcycle, int endcycle, int skip, int skip2, int dtotal, int calib_start, int calib_len, bool lol, int hdelay, bool blanked, bool finalseg, struct linestate *ls);
+static void draw_denise_line(int gfx_ypos, nln_how how, uae_u32 linecnt, int startpos, int startcycle, int endcycle, int skip, int skip2, int dtotal,
+ int calib_start, int calib_len, bool lol, int hdelay, bool blanked, bool finalseg, struct linestate *ls);
static void sprwrite(int reg, uae_u32 v);
static void sprwrite_64(int reg, uae_u64 v);
if (q->type == 0) {
- draw_denise_line(q->gfx_ypos, q->how, q->linecnt, q->startpos, q->startcycle, q->endcycle, q->skip, q->skip2, q->dtotal, q->calib_start, q->calib_len, q->lol, q->hdelay, q->blanked, q->finalseg, q->ls);
+ draw_denise_line(q->gfx_ypos, q->how, q->linecnt, q->startpos, q->startcycle, q->endcycle, q->skip, q->skip2, q->dtotal,
+ q->calib_start, q->calib_len, q->lol, q->hdelay, q->blanked, q->finalseg, q->ls);
next = q->finalseg;
} else if (q->type == 1) {
draw_denise_bitplane_line_fast(q->gfx_ypos, q->how, q->ls);
#define STRLONG_SEEN_DELAY 2
static int denise_strlong_seen_delay;
static bool denise_vsync_bpl_detect;
+static int linear_vb_offset;
void set_inhibit_frame(int monid, int bit)
{
if (doublescan == 1 && vshift > 0) {
vshift--;
}
- int ydiff = minfirstline - minfirstline_linear;
- denise_vblank_extra_top = (visible_top_start - ydiff) >> vshift;
- denise_vblank_extra_bottom = (visible_bottom_stop - ydiff) >> vshift;
+
+ denise_vblank_extra_top = visible_top_start >> vshift;
+ denise_vblank_extra_bottom = visible_bottom_stop >> vshift;
denise_hblank_extra_left = visible_left_start;
denise_hblank_extra_right = visible_right_stop;
visible_top_start = 0;
visible_bottom_stop = MAX_STOP;
} else {
- int startypos = min_ypos_for_screen;
+ int startypos = linear_vpos_vb_end << vshift;
visible_top_start = startypos + dy;
visible_bottom_stop = startypos + dy + h;
- if (currprefs.gfx_overscanmode >= OVERSCANMODE_BROADCAST) {
- visible_top_start -= 1 << currprefs.gfx_resolution;
- visible_bottom_stop += 1 << currprefs.gfx_resolution;
- }
- if (visible_top_start < hhadd + startypos) {
- visible_top_start = hhadd + startypos;
- }
- if ((current_linear_vpos << currprefs.gfx_vresolution) - hhadd2 < visible_bottom_stop) {
- visible_bottom_stop = (current_linear_vpos << currprefs.gfx_vresolution) - hhadd2;
+ if (currprefs.gfx_overscanmode < OVERSCANMODE_BROADCAST) {
+ visible_top_start += 1 << vshift;
+ visible_bottom_stop -= 1 << vshift;
}
+ visible_top_start += hhadd;
+ visible_bottom_stop -= hhadd;
}
check_custom_limits();
struct vidbuf_description *vidinfo = &adisplays[monid].gfxvidinfo;
struct vidbuffer *vb = vidinfo->inbuffer;
int eraselines = 0;
- int yadjust = currprefs.gfx_overscanmode < OVERSCANMODE_ULTRA ? minfirstline_linear << currprefs.gfx_vresolution : 0;
int xshift = 0;
xlinebuffer = NULL;
erase_next_draw = false;
}
- gfx_ypos -= yadjust;
-
if (how == nln_none) {
return;
}
}
}
int right = strlong_seen ? denise_hblank_extra_right - (1 << currprefs.gfx_resolution) : denise_hblank_extra_right;
- if (!programmedmode && (denise_hblank_extra_left > visible_left_border || visible_right_border > right) && currprefs.gfx_overscanmode < OVERSCANMODE_EXTREME) {
+ if ((denise_hblank_extra_left > visible_left_border || visible_right_border > right) && currprefs.gfx_overscanmode < OVERSCANMODE_EXTREME) {
int ww1 = denise_hblank_extra_left > visible_left_border ? (denise_hblank_extra_left - visible_left_border) << 0 : 0;
int ww2 = visible_right_border > right ? (visible_right_border - right) << 0 : 0;
for (int i = 0; i < 4; i++) {
}
}
-static void draw_denise_line(int gfx_ypos, enum nln_how how, uae_u32 linecnt, int startpos, int startcycle, int endcycle, int skip, int skip2, int dtotal, int calib_start, int calib_len, bool lol, int hdelay, bool blanked, bool finalseg, struct linestate *ls)
+static void draw_denise_line(int gfx_ypos, enum nln_how how, uae_u32 linecnt, int startpos, int startcycle, int endcycle, int skip, int skip2, int dtotal,
+ int calib_start, int calib_len, bool lol, int hdelay, bool blanked, bool finalseg, struct linestate *ls)
{
bool fullline = false;
bufg = gbuf;
}
- bool blankedline = (this_line->linear_vpos >= denise_vblank_extra_bottom || this_line->linear_vpos < denise_vblank_extra_top) && currprefs.gfx_overscanmode < OVERSCANMODE_EXTREME && !programmedmode;
bool line_is_blanked = false;
+ bool hidden = this_line->linear_vpos >= denise_vblank_extra_bottom || this_line->linear_vpos < denise_vblank_extra_top;
- if ((denise_pixtotal_max == -0x7fffffff && denise_vsync_bpl_detect) || blankedline || blanked) {
+ if ((denise_pixtotal_max == -0x7fffffff && denise_vsync_bpl_detect) || blanked) {
// don't draw vertical blanking if not ultra extreme overscan
internal_pixel_cnt = -1;
return;
}
+ if (hidden) {
+ if (xlinebuffer) {
+ memset(xlinebuffer_start, DEBUG_TVOVERSCAN_V_GRAYSCALE, xlinebuffer_end - xlinebuffer_start);
+ if (xlinebuffer2 && xlinebuffer != xlinebuffer2) {
+ memset(xlinebuffer2_start, DEBUG_TVOVERSCAN_V_GRAYSCALE, xlinebuffer2_end - xlinebuffer2_start);
+ }
+ if (xlinebuffer_genlock) {
+ memset(xlinebuffer_genlock_start, 0, xlinebuffer_genlock_end - xlinebuffer_genlock_start);
+ }
+ }
+ }
+
#if 0
static int testtoggle[1000];
testtoggle[gfx_ypos]++;
ls->bpl1dat_trigger_offset = bpl1dat_trigger_offset;
ls->internal_pixel_cnt = internal_pixel_cnt;
ls->internal_pixel_start_cnt = internal_pixel_start_cnt;
- ls->blankedline = blankedline;
+ ls->blankedline = 0;
ls->strlong_seen = denise_strlong_seen;
ls->lol_shift_prev = denise_lol_shift_prev;
ls->vb = denise_vblank_active;
static void tvadjust(int *hbstrt_offset, int *hbstop_offset, struct linestate *ls)
{
- if (!programmedmode && currprefs.gfx_overscanmode < OVERSCANMODE_EXTREME) {
+ if (currprefs.gfx_overscanmode < OVERSCANMODE_EXTREME) {
int right = denise_strlong_seen ? denise_hblank_extra_right - (1 << currprefs.gfx_resolution) : denise_hblank_extra_right;
int ww1 = denise_hblank_extra_left > visible_left_border ? (denise_hblank_extra_left - visible_left_border) << 0 : 0;
int ww2 = visible_right_border > right ? (visible_right_border - right) << 0 : 0;
}
lines_count++;
-
if (!buf1) {
return;
}
- if (ls->blankedline) {
+ bool hidden = this_line->linear_vpos >= denise_vblank_extra_bottom || this_line->linear_vpos < denise_vblank_extra_top;
+
+ if (ls->blankedline || hidden) {
return;
}
edgeblanking(ls->hbstrt_offset, ls->hbstop_offset, ls->internal_pixel_start_cnt, ls->strlong_seen, ls->lol, ls->lol_shift_prev);
- if (!programmedmode && ham) {
+ if (ham) {
int ww1 = visible_left_start > visible_left_border ? (visible_left_start - visible_left_border) << 0 : 0;
if (ww1 > 0) {
hbstop_offset += ww1;
this_line = &temp_line;
this_line->vpos = vpos;
this_line->lof = lof_store;
- this_line->linear_vpos = linear_vpos;
+ this_line->linear_vpos = linear_display_vpos;
+ this_line->linear_vpos_vb_start = linear_vpos_vb_start;
+ this_line->linear_vpos_vb_end = linear_vpos_vb_end;
}
static bool waitqueue_nolock(void)
q->ls = ls;
q->type = 2;
q->vpos = vpos;
- q->linear_vpos = linear_vpos;
+ q->linear_vpos = linear_display_vpos;
+ q->linear_vpos_vb_start = linear_vpos_vb_start;
+ q->linear_vpos_vb_end = linear_vpos_vb_end;
addtowritequeue();
q->ls = ls;
q->type = 1;
q->vpos = vpos;
- q->linear_vpos = linear_vpos;
+ q->linear_vpos = linear_display_vpos;
+ q->linear_vpos_vb_start = linear_vpos_vb_start;
+ q->linear_vpos_vb_end = linear_vpos_vb_end;
addtowritequeue();
q->endpos = endpos;
q->type = 3;
q->vpos = vpos;
- q->linear_vpos = linear_vpos;
+ q->linear_vpos = linear_display_vpos;
+ q->linear_vpos_vb_start = linear_vpos_vb_start;
+ q->linear_vpos_vb_end = linear_vpos_vb_end;
addtowritequeue();
q->endpos = endpos;
q->type = 4;
q->vpos = vpos;
- q->linear_vpos = linear_vpos;
+ q->linear_vpos = linear_display_vpos;
+ q->linear_vpos_vb_start = linear_vpos_vb_start;
+ q->linear_vpos_vb_end = linear_vpos_vb_end;
addtowritequeue();
}
}
-void draw_denise_line_queue(int gfx_ypos, nln_how how, uae_u32 linecnt, int startpos, int endpos, int startcycle, int endcycle, int skip, int skip2, int dtotal, int calib_start, int calib_len, bool lof, bool lol, int hdelay, bool blanked, bool finalseg, struct linestate *ls)
+void draw_denise_line_queue(int gfx_ypos, nln_how how, uae_u32 linecnt, int startpos, int endpos, int startcycle, int endcycle, int skip, int skip2, int dtotal,
+ int calib_start, int calib_len, bool lof, bool lol, int hdelay, bool blanked, bool finalseg, struct linestate *ls)
{
if (multithread_denise_active()) {
q->hdelay = hdelay;
q->blanked = blanked;
q->finalseg = finalseg;
- q->linear_vpos = linear_vpos;
+ q->linear_vpos = linear_display_vpos;
+ q->linear_vpos_vb_start = linear_vpos_vb_start;
+ q->linear_vpos_vb_end = linear_vpos_vb_end;
addtowritequeue();
q->type = 5;
q->erase = erase;
q->vpos = vpos;
- q->linear_vpos = linear_vpos;
+ q->linear_vpos = linear_display_vpos;
+ q->linear_vpos_vb_start = linear_vpos_vb_start;
+ q->linear_vpos_vb_end = linear_vpos_vb_end;
addtowritequeue();
struct denise_rga_queue *q = &rga_queue[rga_queue_write & DENISE_RGA_SLOT_CHUNKS_MASK];
q->type = 6;
q->vpos = vpos;
- q->linear_vpos = linear_vpos;
+ q->linear_vpos = linear_display_vpos;
+ q->linear_vpos_vb_start = linear_vpos_vb_start;
+ q->linear_vpos_vb_end = linear_vpos_vb_end;
q->reg = reg;
q->val = v;
q->linecnt = linecnt;
struct denise_rga_queue *q = &rga_queue[rga_queue_write & DENISE_RGA_SLOT_CHUNKS_MASK];
q->type = 7;
q->vpos = vpos;
- q->linear_vpos = linear_vpos;
+ q->linear_vpos = linear_display_vpos;
+ q->linear_vpos_vb_start = linear_vpos_vb_start;
+ q->linear_vpos_vb_end = linear_vpos_vb_end;
q->val = store ? 1 : 0;
q->linecnt = linecnt;
extern uae_u16 dmacon;
extern uae_u16 intena, intreq, intreqr;
-extern int vpos, linear_vpos;
+extern int vpos, linear_display_vpos;
+extern int linear_vpos_vb_start, linear_vpos_vb_end;
extern uae_u8 agnus_hpos;
extern bool lof_store, lof_display;
extern int scandoubled_line;
#define EQU_ENDLINE_PAL 8
#define EQU_ENDLINE_NTSC 9
+#define LINES_AFTER_VSYNC 3
+
#define OCS_DENISE_HBLANK_DISABLE_HPOS 0x2e
extern int maxhpos, maxhposm0, maxhpos_short;
};
extern struct color_entry denise_colors;
-void draw_denise_line_queue(int gfx_ypos, nln_how how, uae_u32 linecnt, int startpos, int endpos, int startcycle, int endcycle, int skip, int skip2, int dtotal, int calib_start, int calib_len, bool lof, bool lol, int hdelay, bool blanked, bool finalseg, struct linestate *ls);
+void draw_denise_line_queue(int gfx_ypos, nln_how how, uae_u32 linecnt, int startpos, int endpos, int startcycle, int endcycle, int skip, int skip2, int dtotal,
+ int calib_start, int calib_len, bool lof, bool lol, int hdelay, bool blanked, bool finalseg, struct linestate *ls);
void draw_denise_bitplane_line_fast(int gfx_ypos, enum nln_how how, struct linestate *ls);
void draw_denise_bitplane_line_fast_queue(int gfx_ypos, enum nln_how how, struct linestate *ls);
void draw_denise_border_line_fast(int gfx_ypos, bool blank, enum nln_how how, struct linestate *ls);
v = currprefs.gfx_xcenter_size;
if (v <= 0) {
+#if 0
if (programmedmode && native) {
cw = maxhpos_display << (RES_MAX + (doublescan == 1));
} else {
cw = native ? maxhpos_display << RES_MAX : avidinfo->outbuffer->outwidth << 1;
}
}
- } else {
+#endif
+ cw = avidinfo->outbuffer->outwidth << 1;
+ } else {
cw = v;
}
cw >>= (RES_MAX - currprefs.gfx_resolution);
v = currprefs.gfx_ycenter_size;
if (v <= 0) {
+#if 0
if (programmedmode && native) {
ch = (current_linear_vpos - minfirstline) << (VRES_MAX - (doublescan == 1 && !interlace_seen));
} else if (currprefs.gfx_overscanmode <= OVERSCANMODE_OVERSCAN) {
} else {
ch = native ? (current_linear_vpos - minfirstline) << VRES_MAX : avidinfo->outbuffer->outheight;
}
+#endif
+ ch = avidinfo->outbuffer->outheight;
} else {
ch = v;
}
if (!specialmode && scalemode == AUTOSCALE_STATIC_AUTO) {
filter_aspect = 0;
keep_aspect = 0;
- if (ds->dstwidth >= 640 && ds->dstwidth <= 800 && ds->dstheight >= 480 && ds->dstheight <= 600 && !programmedmode) {
+ if (ds->dstwidth >= 640 && ds->dstwidth <= 800 && ds->dstheight >= 480 && ds->dstheight <= 600) {
autoselect = 1;
scalemode = AUTOSCALE_NONE;
int m = 1;
if (scalemode == AUTOSCALE_STATIC_MAX || scalemode == AUTOSCALE_STATIC_NOMINAL ||
scalemode == AUTOSCALE_INTEGER || scalemode == AUTOSCALE_INTEGER_AUTOSCALE) {
- if (scalemode == AUTOSCALE_STATIC_NOMINAL || scalemode == AUTOSCALE_STATIC_MAX) {
- // do not default/TV scale programmed modes
- if (programmedmode) {
- goto skipcont;
- }
- }
-
if (specialmode) {
cx = 0;
cy = 0;
_stprintf (p, _T("%03d"), tb.millitm);
p += _tcslen (p);
if (vsync_counter != 0xffffffff)
- _stprintf (p, _T(" [%d %03d%s%03d/%03d]"), vsync_counter, current_hpos_safe(), lof_store ? _T("-") : _T("="), vpos, linear_vpos);
+ _stprintf (p, _T(" [%d %03d%s%03d/%03d]"), vsync_counter, current_hpos_safe(), lof_store ? _T("-") : _T("="), vpos, linear_display_vpos);
_tcscat (p, _T(": "));
return out;
}