static int ddfstrt, ddfstop, plfstop_prev;
static int ddfstrt_hpos, ddfstop_hpos;
static int line_cyclebased, diw_change;
-static int bplcon1_fetch;
#define SET_LINE_CYCLEBASED line_cyclebased = 1;
point += (extrahpos >> 2) - 2;
}
- if (nodraw () || hpos < 0x14 || nr_armed == 0 || point == last_sprite_point)
+ if (nodraw() || hpos < 0x14 || nr_armed == 0 || point == last_sprite_point) {
return;
+ }
if (!quick) {
decide_diw(hpos);
int hw_xp = sprxp >> sprite_buffer_res;
int pointx = usepointx && (s->ctl & sprite_sprctlmask) ? 0 : 1;
- if (xpos < 0)
+ if (xpos < 0) {
continue;
+ }
- if (!((debug_sprite_mask & magic_sprite_mask) & (1 << i)))
+ if (!((debug_sprite_mask & magic_sprite_mask) & (1 << i))) {
continue;
+ }
- if (! spr[i].armed)
+ if (!spr[i].armed) {
continue;
+ }
int end = 0x1d4;
if (hw_xp > last_sprite_point && hw_xp <= point + pointx && hw_xp <= maxhpos * 2 + 1) {
for (j = 0, jj = 0; j < sprite_width; j+= 16, jj++) {
int nx = fromspritexdiw (posns[i] + j);
if (s->data[jj] || s->datb[jj]) {
- if (diwfirstword_total > nx && nx >= (48 << currprefs.gfx_resolution))
+ if (diwfirstword_total > nx && nx >= (48 << currprefs.gfx_resolution)) {
diwfirstword_total = nx;
- if (diwlastword_total < nx + 16 && nx <= (448 << currprefs.gfx_resolution))
+ }
+ if (diwlastword_total < nx + 16 && nx <= (448 << currprefs.gfx_resolution)) {
diwlastword_total = nx + 16;
+ }
}
}
gotdata = 1;
#if AUTOSCALE_SPRITES
/* get upper and lower sprite position if brdsprt enabled */
if (gotdata) {
- if (vpos < first_planes_vpos)
+ if (vpos < first_planes_vpos) {
first_planes_vpos = vpos;
- if (vpos < plffirstline_total)
+ }
+ if (vpos < plffirstline_total) {
plffirstline_total = vpos;
- if (vpos > last_planes_vpos)
+ }
+ if (vpos > last_planes_vpos) {
last_planes_vpos = vpos;
- if (vpos > plflastline_total)
+ }
+ if (vpos > plflastline_total) {
plflastline_total = vpos;
+ }
}
#endif
}
toscr_nr_planes = toscr_nr_planes2 = 0;
thisline_decision.bplres = output_res(bplcon0_res);
thisline_decision.nr_planes = 0;
- toscr_nr_planes_shifter_new = toscr_nr_planes_shifter = bplcon0_planes;
thisline_decision.plfleft = -1;
thisline_decision.plflinelen = -1;
static void dumpsync(void)
{
static int cnt = 100;
- if (cnt < 0)
+ if (cnt < 0) {
return;
+ }
cnt--;
write_log(_T("BEAMCON0=%04X VTOTAL=%04X HTOTAL=%04X\n"), new_beamcon0, vtotal, htotal);
write_log(_T(" HSSTOP=%04X HBSTRT=%04X HBSTOP=%04X\n"), hsstop, hbstrt, hbstop);
if (!oldstrobe) {
cop_state.state_prev = cop_state.state;
}
- if ((cop_state.state == COP_wait || cop_state.state == COP_waitforever) && !vblank && dmaen(DMA_COPPER)) {
+ if ((cop_state.state == COP_wait1 || cop_state.state == COP_waitforever) && !vblank && dmaen(DMA_COPPER)) {
if (blt_info.blit_main) {
static int warned = 100;
if (warned > 0) {
if (dmaen(DMA_COPPER)) {
compute_spcflag_copper();
- } else if (wasstopped || (oldstrobe > 0 && oldstrobe != num && cop_state.state_prev == COP_wait)) {
+ } else if (wasstopped || (oldstrobe > 0 && oldstrobe != num && cop_state.state_prev == COP_wait1)) {
/* dma disabled, copper idle and accessed both COPxJMPs -> copper stops! */
cop_state.state = COP_stop;
}
setup_fmodes(hpos);
}
+static void bplcon0_denise_change(int hpos, uae_u16 con0)
+{
+ int np = GET_PLANES(con0);
+ if (np == toscr_nr_planes_shifter_new) {
+ toscr_nr_planes_shifter = np;
+ return;
+ }
+ SET_LINE_CYCLEBASED;
+ decide_diw(hpos);
+ decide_line(hpos);
+ decide_fetch_safe(hpos);
+ toscr_nr_planes_shifter_new = np;
+ bplcon0_planes_changed = true;
+ if (isocs7planes()) {
+ if (toscr_nr_planes_shifter_new < 6) {
+ toscr_nr_planes_shifter_new = 6;
+ }
+ }
+}
+
static void BPLCON0(int hpos, uae_u16 v)
{
uae_u16 old = bplcon0;
}
bpldmainitdelay(hpos);
+
+ if (!copper_access) {
+ bplcon0_denise_change(hpos, bplcon0);
+ }
}
static void BPLCON1(int hpos, uae_u16 v)
last_decide_line_hpos = endhpos;
}
-static void bplcon0_denise_change(int hpos, uae_u16 con0)
-{
- int np = GET_PLANES(con0);
- if (np == toscr_nr_planes_shifter_new) {
- toscr_nr_planes_shifter = toscr_nr_planes_shifter_new;
- return;
- }
- SET_LINE_CYCLEBASED;
- decide_diw(hpos);
- decide_line(hpos);
- decide_fetch_safe(hpos);
- toscr_nr_planes_shifter_new = np;
- bplcon0_planes_changed = true;
- if (isocs7planes()) {
- if (toscr_nr_planes_shifter_new < 6) {
- toscr_nr_planes_shifter_new = 6;
- }
- }
-}
-
/*
CPU write COPJMP wakeup sequence when copper is waiting:
- Idle cycle (can be used by other DMA channel)
// Wait finished, request IR1.
case COP_wait:
{
- if (hpos == 2 - COPPER_CYCLE_POLARITY) {
- goto next;
- }
if (copper_cant_read(hpos, 0x84)) {
goto next;
}
// SKIP finished. Request IR1.
case COP_skip:
-
- if (hpos == 2 - COPPER_CYCLE_POLARITY) {
- goto next;
- }
if (copper_cant_read(hpos, 0x85)) {
goto next;
}
bpl2mod = RW; /* 10A BPL2MOD */
bplcon4 = RW; /* 10C BPLCON4 */
clxcon2 = RW; /* 10E CLXCON2* */
- for(i = 0; i < 8; i++)
+ for (i = 0; i < 8; i++) {
fetched[i] = RW; /* BPLXDAT */
- for(i = 0; i < 32; i++) {
+ }
+ for (i = 0; i < 32; i++) {
uae_u16 v = RW;
color_regs_genlock[i] = (v & 0x8000) != 0;
current_colors.color_regs_ecs[i] = v & 0xfff; /* 180 COLORxx */
RW; /* 1F6 ? */
RW; /* 1F8 ? */
i = RW; /* 1FA ? */
- if (i & 0x8000)
+ if (i & 0x8000) {
currprefs.ntscmode = changed_prefs.ntscmode = i & 1;
+ }
fmode = RW; /* 1FC FMODE */
last_custom_value1 = last_custom_value2 = RW;/* 1FE ? */
bplcon4_saved = bplcon4;
fmode_saved = fmode;
beamcon0_saved = new_beamcon0;
+ bplcon0d = bplcon0;
+ bplcon0d_old = 0;
DMACON_vars();
current_colors.extra = 0;
- if (isbrdblank(-1, bplcon0, bplcon3))
+ if (isbrdblank(-1, bplcon0, bplcon3)) {
current_colors.extra |= 1 << CE_BORDERBLANK;
- if (issprbrd(-1, bplcon0, bplcon3))
+ }
+ if (issprbrd(-1, bplcon0, bplcon3)) {
current_colors.extra |= 1 << CE_BORDERSPRITE;
- if (ecs_denise && (bplcon0 & 1) && (bplcon3 & 0x10))
+ }
+ if (ecs_denise && (bplcon0 & 1) && (bplcon3 & 0x10)) {
current_colors.extra |= 1 << CE_BORDERNTRANS;
+ }
DISK_restore_custom(dskpt, dsklen, dskbytr);
DISK_save_custom(&dskpt, &dsklen, &dsksync, &dskbytr);
- if (dstptr)
+ if (dstptr) {
dstbak = dst = dstptr;
- else
- dstbak = dst = xmalloc (uae_u8, 8 + 256 * 2);
+ } else {
+ dstbak = dst = xmalloc(uae_u8, 8 + 256 * 2);
+ }
SL(currprefs.chipset_mask);
SW(0); /* 000 BLTDDAT */