minfirstline = vsstop;
if (minfirstline < 2)
minfirstline = 2;
+ if (minfirstline >= maxvpos)
+ minfirstline = maxvpos - 1;
sprite_vblank_endline = minfirstline - 2;
dumpsync();
ciavsyncmode = 1;
static void DIWHIGH (int hpos, uae_u16 v)
{
- if (! (currprefs.chipset_mask & CSMASK_ECS_AGNUS))
+ if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
return;
+ v &= ~(0x8000 | 0x4000 | 0x0080 | 0x0040);
if (diwhigh_written && diwhigh == v)
return;
decide_line (hpos);
bplcon4 = 0x11; /* Get AGA chipset into ECS compatibility mode */
bplcon3 = 0xC00;
+ diwhigh = 0;
+ diwhigh_written = 0;
+
FMODE (0);
CLXCON (0);
}
vsstrt = RW; /* 1E0 VSSTT */
hcenter = RW; /* 1E2 HCENTER */
diwhigh = RW; /* 1E4 DIWHIGH */
- if (diwhigh & 0x8000)
- diwhigh_written = 1;
+ diwhigh_written = (diwhigh & 0x8000) ? 1 : 0;
diwhigh &= 0x7fff;
RW; /* 1E6 ? */
RW; /* 1E8 ? */
int interlace_seen = 0;
#define AUTO_LORES_FRAMES 10
-static int can_use_lores = 0, frame_res, frame_res_lace;
+static int can_use_lores = 0, frame_res, frame_res_lace, last_max_ypos;
/* Lookup tables for dual playfields. The dblpf_*1 versions are for the case
that playfield 1 has the priority, dbplpf_*2 are used if playfield 2 has
j = 0;
for (i = 0; i < MAX_VIDHEIGHT + 1; i++)
row_map[i] = row_tmp;
- for (i = 0; i < gfxvidinfo.height + 1; i++, j += gfxvidinfo.rowbytes)
+ for (i = 0; i < gfxvidinfo.height; i++, j += gfxvidinfo.rowbytes)
row_map[i] = gfxvidinfo.bufmem + j;
}
free (amiga2aspect_line_map);
/* At least for this array the +1 is necessary. */
- amiga2aspect_line_map = (int *)malloc (sizeof (int) * (MAXVPOS + 1) * 2 + 1);
- native2amiga_line_map = (int *)malloc (sizeof (int) * gfxvidinfo.height);
+ amiga2aspect_line_map = malloc (sizeof (int) * (MAXVPOS + 1) * 2 + 1);
+ native2amiga_line_map = malloc (sizeof (int) * gfxvidinfo.height);
if (currprefs.gfx_correct_aspect)
native_lines_per_amiga_line = ((double)gfxvidinfo.height
dh_emerg
};
-STATIC_INLINE void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos)
+static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos)
{
static int warned = 0;
int border = 0;
}
do_color_changes (pfield_do_fill_line, pfield_do_linetoscr);
+
if (dh == dh_emerg)
memcpy (row_map[gfx_ypos], xlinebuffer + linetoscr_x_adjust_bytes, gfxvidinfo.pixbytes * gfxvidinfo.width);
currprefs.gfx_lores = 0;
} else if (border == 1) {
+ int dosprites = 0;
adjust_drawing_colors (dp_for_drawing->ctable, 0);
- if (dip_for_drawing->nr_color_changes == 0) {
+#ifdef AGA /* this makes things complex.. */
+ if (brdsprt && (currprefs.chipset_mask & CSMASK_AGA) && dip_for_drawing->nr_sprites > 0) {
+ dosprites = 1;
+ pfield_expand_dp_bplcon ();
+ pfield_init_linetoscr ();
+ memset (pixdata.apixels + MAX_PIXELS_PER_LINE, brdblank ? 0 : colors_for_drawing.acolors[0], MAX_PIXELS_PER_LINE);
+ }
+#endif
+
+ if (!dosprites && dip_for_drawing->nr_color_changes == 0) {
fill_line ();
do_flush_line (gfx_ypos);
return;
}
- playfield_start = visible_right_border;
- playfield_end = visible_right_border;
- do_color_changes (pfield_do_fill_line, pfield_do_fill_line);
+ if (dosprites) {
+
+ int i;
+ for (i = 0; i < dip_for_drawing->nr_sprites; i++) {
+ draw_sprites_aga (curr_sprite_entries + dip_for_drawing->first_sprite_entry + i);
+ }
+ do_color_changes (pfield_do_fill_line, pfield_do_linetoscr);
+
+ } else {
+
+ playfield_start = visible_right_border;
+ playfield_end = visible_right_border;
+ do_color_changes (pfield_do_fill_line, pfield_do_fill_line);
+
+ }
if (dh == dh_emerg)
memcpy (row_map[gfx_ypos], xlinebuffer + linetoscr_x_adjust_bytes, gfxvidinfo.pixbytes * gfxvidinfo.width);
memcpy (row_map[follow_ypos], xlinebuffer + linetoscr_x_adjust_bytes, gfxvidinfo.pixbytes * gfxvidinfo.width);
else if (dh == dh_buf)
memcpy (row_map[follow_ypos], row_map[gfx_ypos], gfxvidinfo.pixbytes * gfxvidinfo.width);
- /* If dh == dh_line, do_flush_line will re-use the rendered line
- * from linemem. */
do_flush_line (follow_ypos);
}
{
int prev_x_adjust = visible_left_border;
int prev_y_adjust = thisframe_y_adjust;
+ int tmp;
if (currprefs.gfx_xcenter) {
int w = gfxvidinfo.width;
thisframe_y_adjust = minfirstline;
}
thisframe_y_adjust_real = thisframe_y_adjust << (currprefs.gfx_linedbl ? 1 : 0);
- max_ypos_thisframe = (maxvpos - thisframe_y_adjust) << (currprefs.gfx_linedbl ? 1 : 0);
+ tmp = (maxvpos - thisframe_y_adjust) << (currprefs.gfx_linedbl ? 1 : 0);
+ if (tmp != max_ypos_thisframe) {
+ last_max_ypos = tmp;
+ if (last_max_ypos < 0)
+ last_max_ypos = 0;
+ }
+ max_ypos_thisframe = tmp;
/* @@@ interlace_seen used to be (bplcon0 & 4), but this is probably
* better. */
if (lightpen_cy >= maxvpos)
lightpen_cy = maxvpos - 1;
- //write_log("%d x %d %d x %d\n", lightpen_x, lightpen_y, lightpen_cx, lightpen_cy);
-
for (i = 0; i < LIGHTPEN_HEIGHT; i++) {
int line = lightpen_y + i - LIGHTPEN_HEIGHT / 2;
if (line >= 0 || line < max_ypos_thisframe) {
pfield_draw_line (line, where, amiga2aspect_line_map[i1 + 1]);
}
+
+ /* clear possible old garbage at the bottom if emulated area become smaller */
+ while (last_max_ypos < gfxvidinfo.height) {
+ xlinebuffer = gfxvidinfo.linemem;
+ if (xlinebuffer == 0)
+ xlinebuffer = row_map[last_max_ypos];
+ memset (xlinebuffer, brdblank ? 0 : colors_for_drawing.acolors[0], gfxvidinfo.width * gfxvidinfo.pixbytes);
+ do_flush_line (last_max_ypos);
+ last_max_ypos++;
+ }
+
if (currprefs.leds_on_screen) {
for (i = 0; i < TD_TOTAL_HEIGHT; i++) {
int line = gfxvidinfo.height - TD_TOTAL_HEIGHT + i;
do_flush_line (line);
}
}
+
if (lightpen_x > 0 || lightpen_y > 0)
lightpen_update ();
+
do_flush_screen (first_drawn_line, last_drawn_line);
}
DWORD ver;
if (argc < 2) {
- printf("adfread.exe <name of new disk image>\n");
+ printf("adfread 1.1\nUsage: adfread.exe <name of new disk image>\n");
return 0;
}
ver = checkversion();
if (!ver)
return 0;
- printf ("fdrawcmd.sys %x detected\n", ver);
+ printf ("adfread 1.1: fdrawcmd.sys %x detected\n", ver);
trackbuffer = VirtualAlloc(NULL, TRACK_SIZE * 2, MEM_COMMIT, PAGE_READWRITE);
if (opendevice()) {
readloop(argv[1]);
void sernametodev(char *sername)
{
int i;
+
for (i = 0; i < MAX_SERIAL_PORTS && comports[i].name; i++) {
if (!strcmp(sername, comports[i].cfgname)) {
strcpy (sername, comports[i].dev);
return;
}
}
+ sername[0] = 0;
}
+
void serdevtoname(char *sername)
{
int i;
return;
}
}
+ sername[0] = 0;
}
#include <windows.h>
#include <mmsystem.h>
+#include <mmreg.h>
#include <dsound.h>
+#include <ks.h>
+#include <ksmedia.h>
#include <math.h>
static LPDIRECTSOUNDBUFFER lpDSBprimary;
+#define USE_DS8
#ifdef USE_DS8
static LPDIRECTSOUND8 lpDS;
static LPDIRECTSOUNDBUFFER8 lpDSBsecondary;
setvolume_ahi (vol);
}
+const static GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001,0x0000,0x0010,
+{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}};
+
static int open_audio_ds (int size)
{
HRESULT hr;
DSBUFFERDESC sound_buffer;
DSCAPS DSCaps;
DSBCAPS DSBCaps;
- WAVEFORMATEX wavfmt;
+ WAVEFORMATEXTENSIBLE wavfmt;
int freq = currprefs.sound_freq;
LPDIRECTSOUNDBUFFER pdsb;
if (sndbufsize > SND_MAX_BUFFER)
sndbufsize = SND_MAX_BUFFER;
+ max_sndbufsize = size * 4;
+ if (max_sndbufsize > SND_MAX_BUFFER2)
+ max_sndbufsize = SND_MAX_BUFFER2;
+ dsoundbuf = max_sndbufsize * 2;
+
+ if (dsoundbuf < DSBSIZE_MIN)
+ dsoundbuf = DSBSIZE_MIN;
+ if (dsoundbuf > DSBSIZE_MAX)
+ dsoundbuf = DSBSIZE_MAX;
+
+ if (max_sndbufsize * 2 > dsoundbuf)
+ max_sndbufsize = dsoundbuf / 2;
+
+ snd_writeoffset = max_sndbufsize * 5 / 8;
+ snd_maxoffset = max_sndbufsize;
+ snd_totalmaxoffset_of = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 1 / 3;
+ snd_totalmaxoffset_uf = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 2 / 3;
+
+ memset (&wavfmt, 0, sizeof (WAVEFORMATEXTENSIBLE));
+ wavfmt.Format.nChannels = (currprefs.sound_stereo == 3 || currprefs.sound_stereo == 2) ? 4 : (currprefs.sound_stereo ? 2 : 1);
+ wavfmt.Format.wFormatTag = wavfmt.Format.nChannels > 2 ? WAVE_FORMAT_EXTENSIBLE : WAVE_FORMAT_PCM;
+ wavfmt.Format.nSamplesPerSec = freq;
+ wavfmt.Format.wBitsPerSample = 16;
+ wavfmt.Format.nBlockAlign = wavfmt.Format.wBitsPerSample / 8 * wavfmt.Format.nChannels;
+ wavfmt.Format.nAvgBytesPerSec = wavfmt.Format.nBlockAlign * wavfmt.Format.nSamplesPerSec;
+ if (wavfmt.Format.nChannels > 2) {
+ wavfmt.Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX);
+ wavfmt.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
+ wavfmt.Samples.wValidBitsPerSample = 16;
+ wavfmt.dwChannelMask = KSAUDIO_SPEAKER_QUAD;
+ }
+
+ write_log ("SOUND: '%s'/%d/%d bits/%d Hz/buffer %d/dist %d\n",
+ sound_devices[currprefs.win32_soundcard],
+ wavfmt.Format.nChannels, 16, freq, max_sndbufsize, snd_configsize);
+
#ifdef USE_DS8
hr = DirectSoundCreate8 (&sound_device_guid[currprefs.win32_soundcard], &lpDS, NULL);
#else
goto error;
}
- memset (&wavfmt, 0, sizeof (WAVEFORMATEX));
- wavfmt.wFormatTag = WAVE_FORMAT_PCM;
- wavfmt.nChannels = (currprefs.sound_stereo == 3 || currprefs.sound_stereo == 2) ? 4 : (currprefs.sound_stereo ? 2 : 1);
- wavfmt.nSamplesPerSec = freq;
- wavfmt.wBitsPerSample = 16;
- wavfmt.nBlockAlign = wavfmt.wBitsPerSample / 8 * wavfmt.nChannels;
- wavfmt.nAvgBytesPerSec = wavfmt.nBlockAlign * wavfmt.nSamplesPerSec;
-
- hr = IDirectSoundBuffer_SetFormat (lpDSBprimary, &wavfmt);
+ hr = IDirectSoundBuffer_SetFormat (lpDSBprimary, &wavfmt.Format);
if (FAILED(hr)) {
write_log ("SOUND: Primary SetFormat() failure: %s\n", DXError (hr));
goto error;
}
- max_sndbufsize = size * 4;
- if (max_sndbufsize > SND_MAX_BUFFER2)
- max_sndbufsize = SND_MAX_BUFFER2;
- dsoundbuf = max_sndbufsize * 2;
-
- if (dsoundbuf < DSBSIZE_MIN)
- dsoundbuf = DSBSIZE_MIN;
- if (dsoundbuf > DSBSIZE_MAX)
- dsoundbuf = DSBSIZE_MAX;
-
- if (max_sndbufsize * 2 > dsoundbuf)
- max_sndbufsize = dsoundbuf / 2;
-
- snd_writeoffset = max_sndbufsize * 5 / 8;
- snd_maxoffset = max_sndbufsize;
- snd_totalmaxoffset_of = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 1 / 3;
- snd_totalmaxoffset_uf = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 2 / 3;
-
memset (&sound_buffer, 0, sizeof (sound_buffer));
sound_buffer.dwSize = sizeof (sound_buffer);
sound_buffer.dwBufferBytes = dsoundbuf;
- sound_buffer.lpwfxFormat = &wavfmt;
+ sound_buffer.lpwfxFormat = &wavfmt.Format;
sound_buffer.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GLOBALFOCUS;
sound_buffer.dwFlags |= DSBCAPS_CTRLVOLUME | DSBCAPS_LOCSOFTWARE;
sound_buffer.guid3DAlgorithm = GUID_NULL;
else
sample_handler = currprefs.sound_stereo ? sample16s_handler : sample16_handler;
- write_log ("DS driver '%s'/%d/%d bits/%d Hz/buffer %d/dist %d\n",
- sound_devices[currprefs.win32_soundcard],
- wavfmt.nChannels,
- 16, freq, max_sndbufsize, snd_configsize);
obtainedfreq = currprefs.sound_freq;
return 1;
if (vsFileInfo &&
HIWORD(vsFileInfo->dwProductVersionMS) == UAEMAJOR
&& LOWORD(vsFileInfo->dwProductVersionMS) == UAEMINOR
- /* && HIWORD(vsFileInfo->dwProductVersionLS) <= UAESUBREV */ ) {
+ && HIWORD(vsFileInfo->dwProductVersionLS) == UAESUBREV) {
success = TRUE;
write_log ("Translation DLL '%s' loaded and enabled\n", dllbuf);
} else {
#define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
#define GETBDD(x) ((x) % 100)
-#define WINUAEBETA 6
+#define WINUAEBETA 7
#define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2006, 12, 24)
+#define WINUAEDATE MAKEBD(2006, 12, 25)
#define IHF_WINDOWHIDDEN 6
#define NORMAL_WINDOW_STYLE (WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU)
+Beta 7: (RC2)
+
+- AGA sprites outside display window emulated when sprite is above or
+ below the display window. Previously they were only visible when
+ it was on left or right side of display window.
+ (fixes Spheris Legacy missing status graphics)
+- clear garbage at the bottom of screen for example when switching from
+ doubled to non-doubled
+- serial port set to none in config file didn't work properly
+- cloned stereo and 4 channel sound mode uses proper initialization
+ (according to MSDN WAVEFORMATEXTENSIBLE is required if >2 channels but
+ for some reason "incorrect" way also worked previously..)
+- mask unused DIWHIGH bits, could have caused narrow image appearing on
+ screen when loading statefile with diwhigh having highest bit set and
+ ECS Agnus or AGA enabled.
+
Beta 6: (RC)
- serial port "friendly" names listed in serial port selection,