hsyncdebug = currprefs.gfx_overscanmode - OVERSCANMODE_ULTRA + 1;
}
struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo;
- lineoptimizations_allowed = vidinfo->inbuffer == vidinfo->outbuffer && !lightpen_active;
+ lineoptimizations_allowed = vidinfo->inbuffer == vidinfo->outbuffer && drawing_can_lineoptimizations();
color_table_changed = true;
}
void compute_framesync(void)
{
struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo;
- struct vidbuffer *vb = vidinfo->inbuffer;
struct amigadisplay *ad = &adisplays[0];
int islace = interlace_seen ? 1 : 0;
int isntsc = (beamcon0 & BEAMCON0_PAL) ? 0 : 1;
vblank_hz = vblank_hz_shf;
}
+ set_drawbuffer();
+ struct vidbuffer *vb = vidinfo->inbuffer;
+
vblank_hz = target_adjust_vblank_hz(0, vblank_hz);
struct chipset_refresh *cr = get_chipset_refresh(&currprefs);
struct amigadisplay *ad = &adisplays[monid];
struct vidbuf_description *vidinfo = &ad->gfxvidinfo;
struct vidbuffer *vb = &vidinfo->drawbuffer;
- struct vidbuffer *vbin = &vidinfo->tempbuffer;
if (!vb->locked) {
if (!lockscr(vb, false, display_reset > 0)) {
#define DENISE_RGA_SLOT_FAST_TOTAL 1024
static struct denise_rga rga_denise_fast[DENISE_RGA_SLOT_FAST_TOTAL];
-
-
-
typedef void (*LINETOSRC_FUNC)(void);
static LINETOSRC_FUNC lts;
static bool lts_changed, lts_request;
struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo;
struct vidbuffer *vb = vidinfo->inbuffer;
static uae_u8 *oldbufmem;
+ static struct vidbuffer *oldvb;
static int oldheight, oldpitch;
static bool oldgenlock, oldburst;
int i, j;
}
if (oldbufmem && oldbufmem == vb->bufmem &&
+ oldvb == vb &&
oldheight == vb->height_allocated &&
oldpitch == vb->rowbytes &&
oldgenlock == init_genlock_data &&
- oldburst == (row_map_color_burst_buffer ? 1 : 0))
- return;
+ oldburst == (row_map_color_burst_buffer ? 1 : 0)) {
+ return;
+ }
xfree(row_map_genlock_buffer);
row_map_genlock_buffer = NULL;
if (init_genlock_data) {
row_map_genlock[i] = row_tmp16;
i++;
}
+ oldvb = vb;
oldbufmem = vb->bufmem;
oldheight = vb->height_allocated;
oldpitch = vb->rowbytes;
}
}
+bool drawing_can_lineoptimizations(void)
+{
+ if (currprefs.monitoremu || currprefs.cs_cd32fmv || ((currprefs.genlock || currprefs.genlock_effects) && currprefs.genlock_image) ||
+ currprefs.cs_color_burst || currprefs.gfx_grayscale || currprefs.monitoremu) {
+ return false;
+ }
+ if (lightpen_active || debug_dma >= 2 || debug_heatmap >= 2 || refresh_indicator_buffer) {
+ return false;
+ }
+ return true;
+}
+
static void draw_frame_extras(struct vidbuffer *vb, int y_start, int y_end)
{
if (debug_dma > 1 || debug_heatmap > 1) {
static void finish_drawing_frame(bool drawlines)
{
int monid = 0;
+ bool vbcopied = false;
struct amigadisplay *ad = &adisplays[monid];
struct vidbuf_description *vidinfo = &ad->gfxvidinfo;
struct vidbuffer *vbout = vidinfo->outbuffer;
compute_framesync();
}
vbcopy(vbout, vbin);
+ vbcopied = true;
}
if (multimon && locked) {
unlockscr(m_out, -1, -1);
render_screen(m_out->monitor_id, 1, true);
show_screen(m_out->monitor_id, 0);
}
+ vbcopied = true;
}
// genlock
if (!vbout->hardwiredpositioning) {
setnativeposition(vbout);
}
+ vbcopied = true;
}
#ifdef CD32
} else {
vbcopy(vbout, vbin);
}
+ vbcopied = true;
}
#endif
}
setspecialmonitorpos(vbout);
emulate_grayscale(vbin, vbout);
- if (!vbout->hardwiredpositioning)
+ if (!vbout->hardwiredpositioning) {
setnativeposition(vbout);
+ }
+ vbcopied = true;
}
if (denise_locked) {
+ if (!vbcopied) {
+ vbcopy(vbout, vbin);
+ }
unlockscr(vbout, display_reset ? -2 : -1, -1);
denise_locked = false;
}
return thread_debug_lock;
}
+void set_drawbuffer(void)
+{
+ struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo;
+
+ if (vidinfo->tempbuffer.bufmem && !drawing_can_lineoptimizations()) {
+ vidinfo->inbuffer = &vidinfo->tempbuffer;
+ } else {
+ vidinfo->inbuffer = &vidinfo->drawbuffer;
+ }
+}
+
bool start_draw_denise(void)
{
struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo;
thread_debug_lock = true;
- if (vidinfo->tempbuffer.bufmem) {
- vidinfo->inbuffer = &vidinfo->tempbuffer;
- } else {
- vidinfo->inbuffer = &vidinfo->drawbuffer;
- }
-
+ set_drawbuffer();
if (vidinfo->outbuffer != vidinfo->inbuffer) {
vidinfo->inbuffer->locked = vidinfo->outbuffer->locked;
}
-
init_row_map();
denise_y_start = 0;
void draw_denise_line_queue_flush(void);
void quick_denise_rga_queue(int linecnt, int startpos, int endpos);
void denise_handle_quick_strobe_queue(uae_u16 strobe, int strobe_pos, int endpos);
+bool drawing_can_lineoptimizations(void);
+void set_drawbuffer(void);
#endif /* UAE_DRAWING_H */
regqueryint(NULL, wasfsname[1], &wasfs[1]);
gfxmode_reset(mon->monitor_id);
- //freevidbuffer(mon->monitor_id, &avidinfo->drawbuffer);
- //freevidbuffer(mon->monitor_id, &avidinfo->tempbuffer);
for (;;) {
updatemodes(mon);
if (currprefs.gfx_vresolution > avidinfo->gfx_vresolution_reserved)
avidinfo->gfx_vresolution_reserved = currprefs.gfx_vresolution;
-
-#if defined (GFXFILTER)
- if (mon->currentmode.flags & DM_D3D) {
- if (!currprefs.gfx_autoresolution) {
- mon->currentmode.amiga_width = AMIGA_WIDTH_MAX << currprefs.gfx_resolution;
- mon->currentmode.amiga_height = AMIGA_HEIGHT_MAX << currprefs.gfx_vresolution;
- } else {
- mon->currentmode.amiga_width = AMIGA_WIDTH_MAX << avidinfo->gfx_resolution_reserved;
- mon->currentmode.amiga_height = AMIGA_HEIGHT_MAX << avidinfo->gfx_vresolution_reserved;
- }
- if (avidinfo->gfx_resolution_reserved == RES_SUPERHIRES)
- mon->currentmode.amiga_height *= 2;
- if (mon->currentmode.amiga_height > 1280)
- mon->currentmode.amiga_height = 1280;
-
- avidinfo->drawbuffer.inwidth = avidinfo->drawbuffer.outwidth = mon->currentmode.amiga_width;
- avidinfo->drawbuffer.inheight = avidinfo->drawbuffer.outheight = mon->currentmode.amiga_height;
-
- mon->currentmode.current_depth = mon->currentmode.native_depth;
- mon->currentmode.pitch = mon->currentmode.amiga_width * mon->currentmode.current_depth >> 3;
- }
- else
-#endif
- {
- mon->currentmode.amiga_width = mon->currentmode.current_width;
- mon->currentmode.amiga_height = mon->currentmode.current_height;
- }
- avidinfo->drawbuffer.pixbytes = mon->currentmode.current_depth >> 3;
- avidinfo->drawbuffer.bufmem = NULL;
- avidinfo->drawbuffer.linemem = NULL;
- avidinfo->drawbuffer.rowbytes = mon->currentmode.pitch;
+ mon->currentmode.amiga_width = mon->currentmode.current_width;
+ mon->currentmode.amiga_height = mon->currentmode.current_height;
break;
#ifdef PICASSO96
}
updatepicasso96(mon);
- if (!scrlinebuf)
- scrlinebuf = xmalloc (uae_u8, max_uae_width * 4);
-
- avidinfo->drawbuffer.emergmem = scrlinebuf; // memcpy from system-memory to video-memory
-
- avidinfo->drawbuffer.realbufmem = NULL;
- avidinfo->drawbuffer.bufmem = NULL;
- avidinfo->drawbuffer.bufmem_allocated = NULL;
-
- avidinfo->outbuffer = &avidinfo->drawbuffer;
-
if (!mon->screen_is_picasso) {
allocsoftbuffer(mon->monitor_id, _T("draw"), &avidinfo->drawbuffer, mon->currentmode.flags,
- 1920, 1280, mon->currentmode.current_depth);
- avidinfo->inbuffer = &avidinfo->drawbuffer;
- if (currprefs.monitoremu || currprefs.cs_cd32fmv || ((currprefs.genlock || currprefs.genlock_effects) && currprefs.genlock_image) ||
- currprefs.cs_color_burst || currprefs.gfx_grayscale || currprefs.monitoremu) {
- allocsoftbuffer(mon->monitor_id, _T("monemu"), &avidinfo->tempbuffer, mon->currentmode.flags,
- mon->currentmode.amiga_width > 1024 ? mon->currentmode.amiga_width : 1024,
- mon->currentmode.amiga_height > 1024 ? mon->currentmode.amiga_height : 1024,
- mon->currentmode.current_depth);
- avidinfo->inbuffer = &avidinfo->tempbuffer;
- }
+ 1920, 1280);
+
+ allocsoftbuffer(mon->monitor_id, _T("monemu"), &avidinfo->tempbuffer, mon->currentmode.flags,
+ mon->currentmode.amiga_width > 2048 ? mon->currentmode.amiga_width : 2048,
+ mon->currentmode.amiga_height > 2048 ? mon->currentmode.amiga_height : 2048);
}
-#if 0
- S2X_free(mon->monitor_id);
-#endif
+ avidinfo->outbuffer = &avidinfo->drawbuffer;
+ avidinfo->inbuffer = &avidinfo->tempbuffer;
+
if (!D3D_isenabled(mon->monitor_id)) {
for (int i = 0; i < MAX_AMIGAMONITORS; i++) {
oldtex_w[i] = oldtex_h[i] = -1;