uae_u16 vtotal = MAXVPOS_PAL, htotal = MAXHPOS_PAL;
static uae_u16 hsstop, hbstrt, hbstop, vsstop, vbstrt, vbstop, hsstrt, vsstrt, hcenter;
static int ciavsyncmode;
-static int hstrt_nodetect;
+static int diw_hstrt;
#define HSYNCTIME (maxhpos * CYCLE_UNIT);
enum diw_states
{
- DIW_waiting_start, DIW_waiting_stop
+ DIW_waiting_start, DIW_waiting_stop, DIW_waiting_frozen
};
static int plffirstline, plflastline;
{
/* Last hpos = hpos + 0.5, eg. normal PAL end hpos is 227.5 * 2 = 455 */
int pix_hpos = coord_diw_to_window_x (hpos == maxhpos ? hpos * 2 + 1 : hpos * 2);
- if (hdiwstate == DIW_waiting_start && thisline_decision.diwfirstword == -1
- && pix_hpos >= diwfirstword && !hstrt_nodetect && last_diw_pix_hpos < diwfirstword)
+ if (pix_hpos >= diwfirstword && last_diw_pix_hpos < diwfirstword && hdiwstate == DIW_waiting_start)
{
- thisline_decision.diwfirstword = diwfirstword < 0 ? 0 : diwfirstword;
- hdiwstate = DIW_waiting_stop;
+ if (thisline_decision.diwfirstword == -1)
+ thisline_decision.diwfirstword = diwfirstword < 0 ? 0 : diwfirstword;
+ // hstrt < 2 and ECS Denise: horizontal diw start detector not active
+ if (diw_hstrt >= 2 || !(currprefs.chipset_mask & CSMASK_ECS_DENISE))
+ hdiwstate = DIW_waiting_stop;
}
- if (hdiwstate == DIW_waiting_stop && thisline_decision.diwlastword == -1
- && pix_hpos >= diwlastword && last_diw_pix_hpos < diwlastword)
+ if (pix_hpos >= diwlastword && last_diw_pix_hpos < diwlastword && hdiwstate == DIW_waiting_stop)
{
- thisline_decision.diwlastword = diwlastword < 0 ? 0 : diwlastword;
+ if (thisline_decision.diwlastword == -1)
+ thisline_decision.diwlastword = diwlastword < 0 ? 0 : diwlastword;
hdiwstate = DIW_waiting_start;
}
last_diw_pix_hpos = pix_hpos;
{
/* Take care of the vertical DIW. */
if (vpos == plffirstline) {
- diwstate = DIW_waiting_stop;
+ if (diwstate == DIW_waiting_stop && last_decide_line_hpos < 2 && hpos > last_decide_line_hpos && diw_hstrt <= 2 && !(currprefs.chipset_mask & CSMASK_ECS_DENISE))
+ diwstate = DIW_waiting_frozen; // OCS Denise bug
+ else if (hpos >= 2 && diwstate != DIW_waiting_frozen)
+ diwstate = DIW_waiting_stop;
ddf_change = vpos;
}
if (vpos == plflastline) {
/* Large DIWSTOP values can cause the stop position never to be
* reached, so the state machine always stays in the same state and
* there's a more-or-less full-screen DIW. */
- if (hdiwstate == DIW_waiting_stop || thisline_decision.diwlastword > max_diwlastword)
+ if (hdiwstate == DIW_waiting_stop /* || thisline_decision.diwlastword > max_diwlastword */)
thisline_decision.diwlastword = max_diwlastword;
if (thisline_decision.diwfirstword != line_decisions[next_lineno].diwfirstword)
vstop |= 0x100;
}
- // hstrt <= 1: diw start detector not active
- hstrt_nodetect = hstrt <= 1;
+ diw_hstrt = hstrt;
diwfirstword = coord_diw_to_window_x (hstrt);
diwlastword = coord_diw_to_window_x (hstop);
return currprefs.cs_deniserev;
#ifdef AGA
if (currprefs.chipset_mask & CSMASK_AGA)
- return 0xF8;
+ return 0x00F8;
#endif
if (currprefs.chipset_mask & CSMASK_ECS_DENISE)
- return 0xFC;
+ return 0xFFFC;
return 0xffff;
}
STATIC_INLINE uae_u16 DMACONR (int hpos)
static void DIWHIGH (int hpos, uae_u16 v)
{
- if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
+ if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE))
return;
+ if (!(currprefs.chipset_mask & CSMASK_AGA))
+ v &= ~(0x0008 | 0x0010 | 0x1000 | 0x0800);
v &= ~(0x8000 | 0x4000 | 0x0080 | 0x0040);
if (diwhigh_written && diwhigh == v)
return;
sprstartstop (s);
}
}
- if (s->dmastate && !posctl) {
+ if (s->dmastate && !posctl && dma) {
uae_u16 data;
data = sprite_fetch (s, dma, hpos, cycle, 1);
prev_lineno = -1;
nextline_how = nln_normal;
diwstate = DIW_waiting_start;
- hdiwstate = DIW_waiting_start;
ddfstate = DIW_waiting_start;
first_planes_vpos = 0;
last_planes_vpos = 0;
diwhigh = 0;
diwhigh_written = 0;
+ hdiwstate = DIW_waiting_start; // this does not reset at vblank
FMODE (0, 0);
CLXCON (0);
bltstate = BLT_done;
cop_state.state = COP_stop;
diwstate = DIW_waiting_start;
- hdiwstate = DIW_waiting_start;
set_cycles (0);
hack_vpos = 0;
hcenter = RW; /* 1E2 HCENTER */
diwhigh = RW; /* 1E4 DIWHIGH */
diwhigh_written = (diwhigh & 0x8000) ? 1 : 0;
- diwhigh &= 0x7fff;
+ hdiwstate = (diwhigh & 0x4000) ? DIW_waiting_stop : DIW_waiting_start;
+ diwhigh &= 0x3fff;
RW; /* 1E6 ? */
RW; /* 1E8 ? */
RW; /* 1EA ? */
SW (hsstrt); /* 1DE HSSTRT */
SW (vsstrt); /* 1E0 VSSTRT */
SW (hcenter); /* 1E2 HCENTER */
- SW (diwhigh | (diwhigh_written ? 0x8000 : 0)); /* 1E4 DIWHIGH */
+ SW (diwhigh | (diwhigh_written ? 0x8000 : 0) | (hdiwstate == DIW_waiting_stop ? 0x4000 : 0)); /* 1E4 DIWHIGH */
SW (0); /* 1E6 */
SW (0); /* 1E8 */
SW (0); /* 1EA */
uae_u8 *restore_custom_sprite (int num, uae_u8 *src)
{
+ memset (&spr[num], 0, sizeof (struct sprite));
spr[num].pt = RL; /* 120-13E SPRxPT */
sprpos[num] = RW; /* 1x0 SPRxPOS */
sprctl[num] = RW; /* 1x2 SPRxPOS */
+Beta 3: (RC1)
+
+- emulate OCS Denise "bug", vertical DIW already active, matches again
+ with horizontal start DIW=0 or 1 -> vertical DIW stops until next
+ frame. (Kefrens Megademo 8, Snake Bite part)
+- emulate ECS Denise (and AGA) "bug fix", horizontal start DIW=0 or 1
+ gets ignored. (=b2 fix -> ECS Denise/AGA only)
+- ECS Denise DENISEID register returned 0x00FC, correct is 0xFFFC
+- sometimes sprite was visible even if bitplane DMA should have
+ disabled it (older bug)
+
+Beta 2:
+
- if rom load fails, try to find matching rom file using rom scanner
data by comparing file names without paths
-- improved file/directory name Amiga<>unicode conversion
+- improved file/directory name Amiga<>Windows conversion
- hide directory filesystem file/directory names if they have characters
that do not exist in Amiga charset (again, was accidentally changed in
1.6.0), they would have been inaccessible anyway
zai.name = zfile_getfilename (z);
zai.flags = -1;
zfile_fseek(z, 0, SEEK_END);
- zai.size = zfile_ftell(z);
+ zai.size = zfile_ftell (z);
+ zai.t =
zfile_fseek(z, 0, SEEK_SET);
zfile_fread(id, sizeof id, 1, z);
zfile_fseek(z, 0, SEEK_SET);
zn = zvolume_addfile_abs (zv, &zai);
if (!memcmp (id, exeheader, sizeof id)) {
- uae_u8 *data = xmalloc (1 + _tcslen (zai.name) + 1 + 2);
- sprintf (data, "\"%s\"\n", zai.name);
+ uae_u8 *an = ua (zai.name);
+ uae_u8 *data = xmalloc (1 + strlen (an) + 1 + 1 + 1);
+ sprintf (data, "\"%s\"\n", an);
zn = addfile (zv, z, L"s/startup-sequence", data, strlen (data));
xfree (data);
+ xfree (an);
}
index = 0;
for (;;) {