int pos = hpos < 0 ? -hpos : hpos_to_diwx(hpos);
// AGA has extra hires pixel delay in color changes
- if ((regno < RECORDED_REGISTER_CHANGE_OFFSET || regno == RECORDED_REGISTER_CHANGE_OFFSET + 0x10c) && aga_mode) {
+ if ((regno < RECORDED_REGISTER_CHANGE_OFFSET || regno == RECORDED_REGISTER_CHANGE_OFFSET + 0x10c || regno == RECORDED_REGISTER_CHANGE_OFFSET + 0x201) && aga_mode) {
if (currprefs.chipset_hr) {
pos += 2;
}
+ if (regno == RECORDED_REGISTER_CHANGE_OFFSET + 0x201) {
+ // EHB delay
+ pos += 2;
+ }
if (regno == RECORDED_REGISTER_CHANGE_OFFSET + 0x10c) {
// BPLCON4:
// Bitplane XOR change: 2 hires pixel delay
if (regno == 0x0100 || regno == 0x0101) { // BPLCON0
if (value & 0x800)
thisline_decision.ham_seen = 1;
- thisline_decision.ehb_seen = isehb(value, bplcon2);
+ thisline_decision.ehb_seen |= isehb(value, bplcon2);
isbrdblank(hpos, value, bplcon3);
issprbrd(hpos, value, bplcon3);
} else if (regno == 0x104) { // BPLCON2
- thisline_decision.ehb_seen = isehb(bplcon0, value);
+ thisline_decision.ehb_seen |= isehb(bplcon0, value);
} else if (regno == 0x106) { // BPLCON3
isbrdblank(hpos, bplcon0, value);
issprbrd(hpos, bplcon0, value);
thisline_decision.plfleft = -1;
thisline_decision.plflinelen = -1;
thisline_decision.plfright = -1;
- thisline_decision.ham_seen = !!(bplcon0 & 0x800);
- thisline_decision.ehb_seen = !!isehb(bplcon0, bplcon2);
- thisline_decision.ham_at_start = !!(bplcon0 & 0x800);
+ thisline_decision.ham_seen = (bplcon0 & 0x800) != 0;
+ thisline_decision.ehb_seen = isehb(bplcon0, bplcon2);
+ thisline_decision.ham_at_start = (bplcon0 & 0x800) != 0;
thisline_decision.bordersprite_seen = issprbrd(-1, bplcon0, bplcon3);
thisline_decision.xor_seen = (bplcon4 & 0xff00) != 0;
thisline_decision.nr_planes = toscr_nr_planes_agnus;
decide_line(hpos);
decide_fetch_safe(hpos);
+ if (aga_mode) {
+ int e1 = isehb(dcon0, bplcon2);
+ int e2 = isehb(dcon0o, bplcon2);
+ if (e1 ^ e2) {
+ record_register_change(hpos, 0x201, dcon0);
+ }
+ }
+
toscr_nr_planes_shifter_new = np;
if (ecs_denise || aga_mode) {
toscr_nr_changed = np != toscr_nr_planes3 && res == toscr_res;
static int hblank_left_start, hblank_right_stop;
static int hblank_left_start_hard, hblank_right_stop_hard;
static bool exthblank, extborder, exthblanken, exthblankon;
+static bool ehb_enable;
static int linetoscr_x_adjust_pixbytes, linetoscr_x_adjust_pixels;
static int thisframe_y_adjust;
bplres = dp_for_drawing->bplres;
bplplanecnt = dp_for_drawing->nr_planes;
bplham = dp_for_drawing->ham_seen;
- bplehb = dp_for_drawing->ehb_seen;
+ bplehb = dp_for_drawing->ehb_seen && ehb_enable;
if (ecs_denise) {
// Check for KillEHB bit in ECS/AGA
if (dp_for_drawing->bplcon2 & 0x0200) {
dp_for_drawing->ham_seen = isham(v);
extblankcheck();
break;
+ case 0x201: // AGA EHB immediate change
+ ehb_enable = (v & 0x7010) == 0x6000;
+ break;
case 0x104: // BPLCON2
dp_for_drawing->bplcon2 = v;
break;
exthblankon = false;
extborder = false;
display_reset = 1;
+ ehb_enable = true;
lores_reset ();