int xbluecolor_s, xbluecolor_b, xbluecolor_m;
struct color_entry colors_for_drawing;
+static struct color_entry direct_colors_for_drawing;
+
+static xcolnr *p_acolors;
+static xcolnr *p_xcolors;
/* The size of these arrays is pretty arbitrary; it was chosen to be "more
than enough". The coordinates used for indexing into these arrays are
static uae_u8 row_tmp[MAX_PIXELS_PER_LINE * 32 / 8];
static int max_drawn_amiga_line;
uae_u8 **row_map_genlock;
+uae_u8 *row_map_color_burst_buffer;
/* line_draw_funcs: pfield_do_linetoscr, pfield_do_fill_line, decode_ham */
typedef void (*line_draw_func)(int, int, bool);
each line that needs to be drawn. These are basically extracted out of
bit fields in the hardware registers. */
static int bplehb, bplham, bpldualpf, bpldualpfpri, bpldualpf2of, bplplanecnt, ecsshres;
+static int bplbypass, bplcolorburst, bplcolorburst_field;
static bool issprites;
static int bplres;
-static int plf1pri, plf2pri, bplxor, bpldelay_sh;
+static int plf1pri, plf2pri, bplxor, bpland, bpldelay_sh;
static uae_u32 plf_sprite_mask;
static int sbasecol[2] = { 16, 16 };
static int hposblank;
static void pfield_set_linetoscr (void)
{
xlinecheck(start, stop);
+ p_acolors = colors_for_drawing.acolors;
+ p_xcolors = xcolors;
+ bpland = 0xff;
+ if (bplbypass) {
+ p_acolors = direct_colors_for_drawing.acolors;
+ }
spritepixels = spritepixels_buffer;
pfield_do_linetoscr_spriteonly = pfield_do_nothing;
#ifdef AGA
static void decode_ham (int pix, int stoppos, bool blank)
{
int todraw_amiga = res_shift_from_window (stoppos - pix);
+ int hdp = ham_decode_pixel;
if (!bplham) {
while (todraw_amiga-- > 0) {
if (init_genlock_data) {
row_map_genlock_buffer = xcalloc(uae_u8, gfxvidinfo.drawbuffer.width_allocated * (gfxvidinfo.drawbuffer.height_allocated + 2));
}
+ xfree(row_map_color_burst_buffer);
+ row_map_color_burst_buffer = NULL;
+ if (currprefs.cs_color_burst) {
+ row_map_color_burst_buffer = xcalloc(uae_u8, gfxvidinfo.drawbuffer.height_allocated + 2);
+ }
j = oldheight == 0 ? max_uae_height : oldheight;
for (i = gfxvidinfo.drawbuffer.height_allocated; i < max_uae_height + 1 && i < j + 1; i++) {
row_map[i] = row_tmp;
if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) && (dp_for_drawing->bplcon2 & 0x0200))
bplehb = 0;
issprites = dip_for_drawing->nr_sprites > 0;
+ bplcolorburst = (dp_for_drawing->bplcon0 & 0x200) != 0;
+ if (!bplcolorburst)
+ bplcolorburst_field = 0;
#ifdef ECS_DENISE
int oecsshres = ecsshres;
ecsshres = bplres == RES_SUPERHIRES && (currprefs.chipset_mask & CSMASK_ECS_DENISE) && !(currprefs.chipset_mask & CSMASK_AGA);
bpldualpfpri = (dp_for_drawing->bplcon2 & 0x40) == 0x40;
#ifdef AGA
+ // BYPASS: HAM and EHB select bits are ignored
+ if (bplbypass != (dp_for_drawing->bplcon0 & 0x20) != 0) {
+ bpland = 0xff;
+ bplbypass = (dp_for_drawing->bplcon0 & 0x20) != 0;
+ pfield_mode_changed = true;
+ }
+ if (bplbypass) {
+ if (bplham && bplplanecnt == 6)
+ bpland = 0x0f;
+ if (bplham && bplplanecnt == 8)
+ bpland = 0xfc;
+ bplham = 0;
+ if (bplehb)
+ bpland = 31;
+ bplehb = 0;
+ }
bpldualpf2of = (dp_for_drawing->bplcon3 >> 10) & 7;
sbasecol[0] = ((dp_for_drawing->bplcon4 >> 4) & 15) << 4;
sbasecol[1] = ((dp_for_drawing->bplcon4 >> 0) & 15) << 4;
xlinebuffer -= linetoscr_x_adjust_pixbytes;
xlinebuffer_genlock = row_map_genlock[gfx_ypos] - linetoscr_x_adjust_pixels;
+ if (row_map_color_burst_buffer)
+ row_map_color_burst_buffer[gfx_ypos] = bplcolorburst;
+
if (border == 0) {
pfield_expand_dp_bplcon ();
}
}
- if (currprefs.genlock_image && !currprefs.monitoremu && gfxvidinfo.tempbuffer.bufmem_allocated && currprefs.genlock) {
- pfield_set_linetoscr();
+ if (!currprefs.monitoremu && gfxvidinfo.tempbuffer.bufmem_allocated && ((!bplcolorburst_field && currprefs.cs_color_burst) || (currprefs.gfx_grayscale))) {
+ setspecialmonitorpos(&gfxvidinfo.tempbuffer);
+ emulate_grayscale(vb, &gfxvidinfo.tempbuffer);
+ vb = gfxvidinfo.outbuffer = &gfxvidinfo.tempbuffer;
+ if (vb->nativepositioning)
+ setnativeposition(vb);
+ gfxvidinfo.drawbuffer.tempbufferinuse = true;
+ do_flush_screen(vb, 0, vb->outheight);
+ didflush = true;
+ }
+
+ if (currprefs.genlock_image && !currprefs.monitoremu && !currprefs.cs_color_burst && gfxvidinfo.tempbuffer.bufmem_allocated && currprefs.genlock) {
setspecialmonitorpos(&gfxvidinfo.tempbuffer);
if (init_genlock_data != specialmonitor_need_genlock()) {
need_genlock_data = init_genlock_data = specialmonitor_need_genlock();
center_reset = true;
specialmonitoron = false;
+ bplcolorburst_field = 1;
+}
+
+static void gen_direct_drawing_table(void)
+{
+#ifdef AGA
+ // BYPASS color table
+ for (int i = 0; i < 256; i++) {
+ uae_u32 v = (i << 16) | (i << 8) | i;
+ direct_colors_for_drawing.acolors[i] = CONVERT_RGB(v);
+ }
+#endif
}
void drawing_init (void)
{
refresh_indicator_init();
- gen_pfield_tables ();
+ gen_pfield_tables();
+
+ gen_direct_drawing_table();
uae_sem_init (&gui_sem, 0, 1);
#ifdef PICASSO96
c |= currprefs.gfx_lores_mode != changed_prefs.gfx_lores_mode ? (2 | 8) : 0;
c |= currprefs.gfx_scandoubler != changed_prefs.gfx_scandoubler ? (2 | 8) : 0;
+ c |= currprefs.gfx_threebitcolors != changed_prefs.gfx_threebitcolors ? (256) : 0;
+ c |= currprefs.gfx_grayscale != changed_prefs.gfx_grayscale ? (512) : 0;
+
c |= currprefs.gfx_apmode[APMODE_NATIVE].gfx_display != changed_prefs.gfx_apmode[APMODE_NATIVE].gfx_display ? (2|4|8) : 0;
c |= currprefs.gfx_apmode[APMODE_RTG].gfx_display != changed_prefs.gfx_apmode[APMODE_RTG].gfx_display ? (2|4|8) : 0;
c |= currprefs.gfx_blackerthanblack != changed_prefs.gfx_blackerthanblack ? (2 | 8) : 0;
currprefs.gfx_lores_mode = changed_prefs.gfx_lores_mode;
currprefs.gfx_scandoubler = changed_prefs.gfx_scandoubler;
+ currprefs.gfx_threebitcolors = changed_prefs.gfx_threebitcolors;
+ currprefs.gfx_grayscale = changed_prefs.gfx_grayscale;
currprefs.gfx_apmode[APMODE_NATIVE].gfx_display = changed_prefs.gfx_apmode[APMODE_NATIVE].gfx_display;
currprefs.gfx_apmode[APMODE_RTG].gfx_display = changed_prefs.gfx_apmode[APMODE_RTG].gfx_display;
currprefs.gfx_blackerthanblack = changed_prefs.gfx_blackerthanblack;
allocsoftbuffer (_T("draw"), &gfxvidinfo.drawbuffer, currentmode->flags,
1600, 1280, currentmode->current_depth);
}
- if (currprefs.monitoremu || currprefs.cs_cd32fmv || (currprefs.genlock && currprefs.genlock_image)) {
+ if (currprefs.monitoremu || currprefs.cs_cd32fmv || (currprefs.genlock && currprefs.genlock_image) || currprefs.cs_color_burst || currprefs.gfx_grayscale) {
allocsoftbuffer (_T("monemu"), &gfxvidinfo.tempbuffer, currentmode->flags,
currentmode->amiga_width > 1024 ? currentmode->amiga_width : 1024,
currentmode->amiga_height > 1024 ? currentmode->amiga_height : 1024,