Beginning of the process to remove vid_blit_memtoscreen_8() to get rid of the flickering on QT.

This commit is contained in:
OBattler
2022-10-30 16:49:38 +01:00
parent fb6a59c50f
commit 934f6dd500
3 changed files with 22 additions and 12 deletions

View File

@@ -227,6 +227,7 @@ extern void video_setblit(void (*blit)(int, int, int, int, int));
extern void video_blend(int x, int y);
extern void video_blit_memtoscreen_8(int x, int y, int w, int h);
extern void video_blend_monitor(int x, int y, int monitor_index);
extern void video_process_8_monitor(int x, int y, int monitor_index);
extern void video_blit_memtoscreen_8_monitor(int x, int y, int w, int h, int monitor_index);
extern void video_blit_memtoscreen_monitor(int x, int y, int w, int h, int monitor_index);
extern void video_blit_complete_monitor(int monitor_index);
@@ -262,6 +263,7 @@ extern uint32_t video_color_transform(uint32_t color);
#define video_get_type() video_get_type_monitor(0)
#define video_blend(x, y) video_blend_monitor(x, y, monitor_index_global)
#define video_blit_memtoscreen(x, y, w, h) video_blit_memtoscreen_monitor(x, y, w, h, monitor_index_global)
#define video_process_8(x, y) video_process_8_monitor(x, y, monitor_index_global)
#define video_blit_memtoscreen_8(x, y, w, h) video_blit_memtoscreen_8_monitor(x, y, w, h, monitor_index_global)
#define video_blit_complete() video_blit_complete_monitor(monitor_index_global)
#define video_wait_for_blit() video_wait_for_blit_monitor(monitor_index_global)

View File

@@ -354,6 +354,9 @@ cga_poll(void *p)
Composite_Process(cga->cgamode, border, x >> 2, buffer32->line[(cga->displine << 1)]);
Composite_Process(cga->cgamode, border, x >> 2, buffer32->line[(cga->displine << 1) + 1]);
} else {
video_process_8(x, cga->displine << 1);
video_process_8(x, (cga->displine << 1) + 1);
}
cga->sc = oldsc;
@@ -448,19 +451,11 @@ cga_poll(void *p)
}
if (enable_overscan) {
if (cga->composite)
video_blit_memtoscreen(0, (cga->firstline - 4) << 1,
xsize, ((cga->lastline - cga->firstline) + 8) << 1);
else
video_blit_memtoscreen_8(0, (cga->firstline - 4) << 1,
xsize, ((cga->lastline - cga->firstline) + 8) << 1);
video_blit_memtoscreen(0, (cga->firstline - 4) << 1,
xsize, ((cga->lastline - cga->firstline) + 8) << 1);
} else {
if (cga->composite)
video_blit_memtoscreen(8, cga->firstline << 1,
xsize, (cga->lastline - cga->firstline) << 1);
else
video_blit_memtoscreen_8(8, cga->firstline << 1,
xsize, (cga->lastline - cga->firstline) << 1);
video_blit_memtoscreen(8, cga->firstline << 1,
xsize, (cga->lastline - cga->firstline) << 1);
}
}

View File

@@ -535,6 +535,19 @@ video_blend_monitor(int x, int y, int monitor_index)
}
}
void
video_process_8_monitor(int x, int y, int monitor_index)
{
int xx;
for (xx = 0; xx < x; xx++) {
if (monitors[monitor_index].target_buffer->line[y][xx] <= 0xff)
monitors[monitor_index].target_buffer->line[y][xx] = monitors[monitor_index].mon_pal_lookup[monitors[monitor_index].target_buffer->line[y][xx]];
else
monitors[monitor_index].target_buffer->line[y][xx] = 0x00000000;
}
}
void
video_blit_memtoscreen_8_monitor(int x, int y, int w, int h, int monitor_index)
{