static int linear_display_vpos;
int current_linear_vpos, current_linear_hpos;
int current_linear_vpos_nom, current_linear_hpos_short;
+static int linear_vpos_visible, current_linear_vpos_visible;
static int current_linear_vpos_temp, current_linear_hpos_temp;
static int current_linear_temp_change;
static bool display_redraw;
static bool initial_frame;
static int custom_fastmode_exit;
static evt_t last_vsync_evt, last_hsync_evt;
+static bool aexthblanken;
#if 0
static int custom_fastmode_bplextendmask;
#endif
static uae_u32 saved_color_regs_aga[32];
static struct color_entry agnus_colors;
static int varsync_changed, varsync_maybe_changed[2];
+static int lines_after_beamcon_change;
static bool programmed_register_accessed_v, programmed_register_accessed_h;
static bool need_vdiw_check;
static int varhblank_lines, varhblank_val[2];
doublescan = 0;
programmedmode = 0;
+ lines_after_beamcon_change = 5;
isntsc = (beamcon0 & BEAMCON0_PAL) ? 0 : 1;
islace = (interlace_seen) ? 1 : 0;
if (currprefs.gfx_overscanmode >= OVERSCANMODE_ULTRA) {
display_hstart_cyclewait_end = 0;
} else {
- if (exthblanken && !(beamcon0 & BEAMCON0_VARBEAMEN)) {
+ if (aexthblanken && !(beamcon0 & BEAMCON0_VARBEAMEN)) {
int hp2 = maxhpos * 2;
int hbstrtx, hbstopx;
int hb = 1;
} else {
int hp2 = maxhpos * 2;
int hbstrtx, hbstopx;
- if (exthblanken) {
+
+ if (aexthblanken) {
hb = 1;
hbstrtx = (hbstrt & 0xff) * 2;
current_linear_hpos_temp = current_linear_hpos;
current_linear_vpos_temp = current_linear_vpos;
current_linear_temp_change = 0;
+ current_linear_vpos_visible = 0;
init_hz();
}
agnus_vb_active = agnus_pvb;
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 (agnus_pvb_end_line) {
+ linear_vpos_visible = 1;
+ }
} 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 (agnus_vb_end_line) {
+ linear_vpos_visible = 1;
+ }
}
}
static void check_exthblank(void)
{
+ aexthblanken = (bplcon0 & 1) && (bplcon3 & 1) && ecs_denise;
resetfulllinestate();
+ // Recalculate beamcon0 settings if exthblank was set after BEAMCON0 modification (hblank is used for programmed mode centering)
+ if (lines_after_beamcon_change > 0) {
+ init_beamcon0();
+ lines_after_beamcon_change = 0;
+ }
}
static void varsync(int reg, bool resync, int oldval)
vsyncmintimepre = read_processor_time();
if (!custom_disabled) {
- start_draw_denise();
draw_denise_vsync_queue(display_redraw);
display_redraw = false;
}
}
displayreset_delayed >>= 1;
}
+ if (lines_after_beamcon_change > 0) {
+ lines_after_beamcon_change--;
+ }
}
static bool uae_quit_check(void)
maxvpos_display_vsync_next = false;
programmed_register_accessed_h = false;
programmed_register_accessed_v = false;
+ aexthblanken = false;
denise_reset(false);
agnus_hpos_next = -1;
{
linear_display_vpos = linear_vpos;
linear_vpos++;
+ linear_vpos_visible++;
if (linear_vpos >= maxvpos + lof_store) {
vsync_nosync();
}
}
linear_display_vpos = linear_vpos;
linear_vpos++;
+ linear_vpos_visible++;
draw_line_next_line = 0;
linear_vpos_vsync++;
bool ispal(int *lines)
{
if (lines) {
- *lines = current_linear_vpos_nom;
+ *lines = current_linear_vpos_visible;
}
if (programmedmode == 1) {
return currprefs.ntscmode == 0;
/* Pixels outside of visible_start and visible_stop are always black */
static int visible_left_start, visible_right_stop;
static int visible_top_start, visible_bottom_stop;
-bool exthblanken;
+static bool exthblanken;
static int exthblank;
static bool syncdebug;
struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo;
struct vidbuffer *vb = &vidinfo->drawbuffer;
- draw_denise_line_queue_flush();
+ if (thread_debug_lock) {
+ draw_denise_line_queue_flush();
- thread_debug_lock = false;
+ thread_debug_lock = false;
- unlockscr(vb, denise_y_start, denise_y_end);
+ unlockscr(vb, denise_y_start, denise_y_end);
- if (vidinfo->outbuffer != vidinfo->inbuffer) {
- vidinfo->inbuffer->locked = vidinfo->outbuffer->locked;
+ if (vidinfo->outbuffer != vidinfo->inbuffer) {
+ vidinfo->inbuffer->locked = vidinfo->outbuffer->locked;
+ }
}
}
struct vidbuffer *vb = vidinfo->inbuffer;
int eraselines = 0;
int yadjust = currprefs.gfx_overscanmode < OVERSCANMODE_ULTRA ? minfirstline_linear << currprefs.gfx_vresolution : 0;
+ uae_u8 *xstart, *xend;
int xshift = 0;
xlinebuffer = NULL;
{
if (MULTITHREADED_DENISE) {
- if (!waitqueue()) {
+ if (!waitqueue_nolock()) {
return;
}
struct denise_rga_queue *q = &rga_queue[rga_queue_write & DENISE_RGA_SLOT_CHUNKS_MASK];