mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
ECS Denise KILLEHB update.
This commit is contained in:
parent
05bc0d562a
commit
0246749726
@ -5597,8 +5597,11 @@ static void BPLCON1 (int hpos, uae_u16 v)
|
||||
static void BPLCON2(int hpos, uae_u16 v)
|
||||
{
|
||||
if (!(currprefs.chipset_mask & CSMASK_AGA))
|
||||
v &= ~(0x100 | 0x80); // RDRAM and SOGEN
|
||||
if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE))
|
||||
v &= 0x7f;
|
||||
if ((bplcon2 & 0x3fff) == (v & 0x3fff))
|
||||
v &= ~0x8000; // unused
|
||||
if (bplcon2 == v)
|
||||
return;
|
||||
decide_line (hpos);
|
||||
bplcon2 = v;
|
||||
|
||||
34
drawing.cpp
34
drawing.cpp
@ -55,6 +55,15 @@ happening, all ports should restrict window widths to be multiples of 16 pixels.
|
||||
#define BG_COLOR_DEBUG 0
|
||||
//#define XLINECHECK
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CMODE_NORMAL,
|
||||
CMODE_DUALPF,
|
||||
CMODE_EXTRAHB,
|
||||
CMODE_EXTRAHB_ECS_KILLEHB,
|
||||
CMODE_HAM
|
||||
} CMODE_T;
|
||||
|
||||
extern int sprite_buffer_res;
|
||||
static int lores_factor;
|
||||
int lores_shift;
|
||||
@ -250,7 +259,8 @@ static int first_block_line, last_block_line;
|
||||
/* These are generated by the drawing code from the line_decisions array for
|
||||
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 bplmode, bplehb, bplham, bpldualpf, bpldualpfpri;
|
||||
static int bpldualpf2of, bplplanecnt, ecsshres;
|
||||
static int bplbypass, bplcolorburst, bplcolorburst_field;
|
||||
static bool issprites;
|
||||
static int bplres;
|
||||
@ -2607,6 +2617,20 @@ static void do_flush_screen (struct vidbuffer *vb, int start, int stop)
|
||||
flush_screen (vb, 0, 0); /* vsync mode */
|
||||
}
|
||||
|
||||
static void setbplmode(void)
|
||||
{
|
||||
if (bplham)
|
||||
bplmode = CMODE_HAM;
|
||||
else if (bpldualpf)
|
||||
bplmode = CMODE_DUALPF;
|
||||
else if (bplehb > 0)
|
||||
bplmode = CMODE_EXTRAHB;
|
||||
else if (bplehb < 0)
|
||||
bplmode = CMODE_EXTRAHB_ECS_KILLEHB;
|
||||
else
|
||||
bplmode = CMODE_NORMAL;
|
||||
}
|
||||
|
||||
/* We only save hardware registers during the hardware frame. Now, when
|
||||
* drawing the frame, we expand the data into a slightly more useful
|
||||
* form. */
|
||||
@ -2618,8 +2642,11 @@ static void pfield_expand_dp_bplcon (void)
|
||||
bplplanecnt = dp_for_drawing->nr_planes;
|
||||
bplham = dp_for_drawing->ham_seen;
|
||||
bplehb = dp_for_drawing->ehb_seen;
|
||||
if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) && (dp_for_drawing->bplcon2 & 0x0200))
|
||||
if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) && (dp_for_drawing->bplcon2 & 0x0200)) {
|
||||
bplehb = 0;
|
||||
if (!(currprefs.chipset_mask & CSMASK_AGA))
|
||||
bplehb = -1;
|
||||
}
|
||||
issprites = dip_for_drawing->nr_sprites > 0;
|
||||
bplcolorburst = (dp_for_drawing->bplcon0 & 0x200) != 0;
|
||||
if (!bplcolorburst)
|
||||
@ -2677,6 +2704,8 @@ static void pfield_expand_dp_bplcon (void)
|
||||
}
|
||||
if (pfield_mode_changed)
|
||||
pfield_set_linetoscr();
|
||||
|
||||
setbplmode();
|
||||
}
|
||||
|
||||
static bool isham (uae_u16 bplcon0)
|
||||
@ -2993,6 +3022,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
|
||||
hposblank = ohposblank;
|
||||
ham_decode_pixel = src_pixel;
|
||||
bplham = dp_for_drawing->ham_at_start;
|
||||
setbplmode();
|
||||
}
|
||||
|
||||
if (dip_for_drawing->nr_sprites) {
|
||||
|
||||
@ -78,6 +78,7 @@ typedef enum
|
||||
CMODE_NORMAL,
|
||||
CMODE_DUALPF,
|
||||
CMODE_EXTRAHB,
|
||||
CMODE_EXTRAHB_ECS_KILLEHB,
|
||||
CMODE_HAM
|
||||
} CMODE_T;
|
||||
#define CMODE_MAX CMODE_HAM
|
||||
@ -181,10 +182,12 @@ static void out_linetoscr_do_dstpix (DEPTH_T bpp, HMODE_T hmode, int aga, CMODE_
|
||||
outln ( " } else");
|
||||
outln ( " dpix_val = p_acolors[spix_val];");
|
||||
} else if (cmode == CMODE_EXTRAHB) {
|
||||
outln ( " if (spix_val <= 31)");
|
||||
outln ( " dpix_val = p_acolors[spix_val];");
|
||||
outln ( " else");
|
||||
outln ( " dpix_val = p_xcolors[(colors_for_drawing.color_regs_ecs[spix_val - 32] >> 1) & 0x777];");
|
||||
outln(" if (spix_val <= 31)");
|
||||
outln(" dpix_val = p_acolors[spix_val];");
|
||||
outln(" else");
|
||||
outln(" dpix_val = p_xcolors[(colors_for_drawing.color_regs_ecs[spix_val - 32] >> 1) & 0x777];");
|
||||
} else if (cmode == CMODE_EXTRAHB_ECS_KILLEHB) {
|
||||
outln(" dpix_val = p_acolors[spix_val & 31];");
|
||||
} else
|
||||
outln ( " dpix_val = p_acolors[spix_val];");
|
||||
}
|
||||
@ -540,14 +543,36 @@ static void out_linetoscr (DEPTH_T bpp, HMODE_T hmode, int aga, int spr, int gen
|
||||
outln ( "");
|
||||
|
||||
if (spr >= 0) {
|
||||
outln ( " if (bplham) {");
|
||||
out_linetoscr_mode(bpp, hmode, aga, spr, CMODE_HAM, genlock);
|
||||
outln ( " } else if (bpldualpf) {");
|
||||
out_linetoscr_mode(bpp, hmode, aga, spr, CMODE_DUALPF, genlock);
|
||||
outln ( " } else if (bplehb) {");
|
||||
out_linetoscr_mode(bpp, hmode, aga, spr, CMODE_EXTRAHB, genlock);
|
||||
outln ( " } else {");
|
||||
outln(" switch(bplmode)");
|
||||
outln(" {");
|
||||
outln(" case CMODE_NORMAL:");
|
||||
outln(" {");
|
||||
out_linetoscr_mode(bpp, hmode, aga, spr, CMODE_NORMAL, genlock);
|
||||
outln(" }");
|
||||
outln(" break;");
|
||||
outln(" case CMODE_HAM:");
|
||||
outln(" {");
|
||||
out_linetoscr_mode(bpp, hmode, aga, spr, CMODE_HAM, genlock);
|
||||
outln(" }");
|
||||
outln(" break;");
|
||||
outln(" case CMODE_DUALPF:");
|
||||
outln(" {");
|
||||
out_linetoscr_mode(bpp, hmode, aga, spr, CMODE_DUALPF, genlock);
|
||||
outln(" }");
|
||||
outln(" break;");
|
||||
outln(" case CMODE_EXTRAHB:");
|
||||
outln(" {");
|
||||
out_linetoscr_mode(bpp, hmode, aga, spr, CMODE_EXTRAHB, genlock);
|
||||
outln(" }");
|
||||
outln(" break;");
|
||||
if (!aga) {
|
||||
// ECS Denise with KILLEHB set
|
||||
outln(" case CMODE_EXTRAHB_ECS_KILLEHB:");
|
||||
outln(" {");
|
||||
out_linetoscr_mode(bpp, hmode, aga, spr, CMODE_EXTRAHB_ECS_KILLEHB, genlock);
|
||||
outln(" }");
|
||||
outln(" break;");
|
||||
}
|
||||
} else {
|
||||
outln ( " if (1) {");
|
||||
out_linetoscr_mode(bpp, hmode, aga, spr, CMODE_NORMAL, genlock);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user