} sinc_queue_t;
struct audio_channel_data {
- unsigned long adk_mask;
- unsigned long evtime;
+ unsigned int adk_mask;
+ unsigned int evtime;
bool dmaenstore;
bool intreq2;
bool dr;
underline[0] = 0;
namesplit (name);
_tcscpy (extension, _T("wav"));
- _stprintf (filename, _T("%s%s%s%03.3d.%s"), path, name, underline, cnt, extension);
+ _stprintf (filename, _T("%s%s%s%03d.%s"), path, name, underline, cnt, extension);
wavfile = zfile_fopen (filename, _T("wb"), 0);
if (wavfile) {
int freq = rs->per > 0 ? (currprefs.ntscmode ? 3579545 : 3546895 / rs->per) : 8000;
input = (uae_s16)input;
switch (sound_use_filter) {
- case FILTER_NONE:
- return input;
-
case FILTER_MODEL_A500:
fs->rc1 = a500e_filter1_a0 * input + (1 - a500e_filter1_a0) * fs->rc1 + DENORMAL_OFFSET;
fs->rc2 = a500e_filter2_a0 * fs->rc1 + (1-a500e_filter2_a0) * fs->rc2;
led_output = fs->rc4;
break;
+ case FILTER_NONE:
+ default:
+ return input;
+
}
if (led_filter_on)
static void setirq (int nr, int which)
{
- struct audio_channel_data *cdp = audio_channel + nr;
#if DEBUG_AUDIO > 0
+ struct audio_channel_data *cdp = audio_channel + nr;
if (debugchannel (nr) && cdp->wlen > 1)
write_log (_T("SETIRQ%d (%d,%d) PC=%08X\n"), nr, which, isirq (nr) ? 1 : 0, M68K_GETPC);
#endif
void set_audio (void)
{
- int old_mixed_on = mixed_on;
int old_mixed_size = mixed_stereo_size;
int sep, delay;
int ch;
if (audio_channel[i].evtime == 0) {
audio_state_channel (i, true);
if (audio_channel[i].evtime == 0) {
- write_log (_T("evtime==0 sound bug channel %d\n"));
+ write_log (_T("evtime==0 sound bug channel %d\n"), i);
audio_channel[i].evtime = MAX_EV;
}
}
struct ev2 eventtab2[ev2_max];
int vpos;
-static int vpos_count, vpos_count_prev;
+static int vpos_count, vpos_count_diff;
int lof_store; // real bit in custom registers
static int lof_current; // what display device thinks
static int lol;
int res = GET_RES_AGNUS (bplcon0);
int vres = islace ? 1 : 0;
int res2, vres2;
-
+
res2 = currprefs.gfx_resolution;
if (doublescan)
res2++;
if (vres2 > VRES_QUAD)
vres2 = VRES_QUAD;
- gfxvidinfo.drawbuffer.inwidth = (((hbstrt > hbstop ? 0 : (maxhpos - (hbstop - hbstrt))) * 2) << res2);
+ gfxvidinfo.drawbuffer.inwidth = (((hbstrt > hbstop ? 0 : (maxhpos - (hbstop - hbstrt))) * 2) << res2);
gfxvidinfo.drawbuffer.extrawidth = 0;
gfxvidinfo.drawbuffer.inwidth2 = gfxvidinfo.drawbuffer.inwidth;
gfxvidinfo.drawbuffer.inwidth = AMIGA_WIDTH_MAX << currprefs.gfx_resolution;
gfxvidinfo.drawbuffer.extrawidth = 1;
gfxvidinfo.drawbuffer.inwidth2 = gfxvidinfo.drawbuffer.inwidth;
- gfxvidinfo.drawbuffer.inheight = (maxvpos - minfirstline) << currprefs.gfx_vresolution;
+ gfxvidinfo.drawbuffer.inheight = (maxvpos_nom - minfirstline + 1) << currprefs.gfx_vresolution;
gfxvidinfo.drawbuffer.inheight2 = gfxvidinfo.drawbuffer.inheight;
}
double ovblank = vblank_hz;
int hzc = 0;
- if (fullinit || (vpos_count_prev && abs (vpos_count - vpos_count_prev) <= 1))
- vpos_count = vpos_count_prev = 0;
+ if (fullinit)
+ vpos_count = 0;
+
+ vpos_count_diff = vpos_count;
doublescan = 0;
programmedmode = false;
hzc = 1;
if (beamcon0 != new_beamcon0) {
write_log (_T("BEAMCON0 %04x -> %04x PC%=%08x\n"), beamcon0, new_beamcon0, M68K_GETPC);
- vpos_count = vpos_count_prev = 0;
+ vpos_count_diff = vpos_count = 0;
}
beamcon0 = new_beamcon0;
isntsc = (beamcon0 & 0x20) ? 0 : 1;
}
maxvpos_nom = maxvpos;
if (vpos_count > 0) {
- // we come here if vpos_count != maxvpos (someone poked VPOSW)
+ // we come here if vpos_count != maxvpos and beamcon0 didn't change
+ // (someone poked VPOSW)
if (vpos_count < 10)
vpos_count = 10;
vblank_hz = (isntsc ? 15734 : 15625.0) / vpos_count;
vpos_count = p96refresh_active;
vtotal = vpos_count;
}
- if ((beamcon0 & (0x20 | 0x80)) != (new_beamcon0 & (0x20 | 0x80)) || (vpos_count_prev && (abs (vpos_count - vpos_count_prev) > 1)) || lof_changed) {
+ if ((beamcon0 & (0x20 | 0x80)) != (new_beamcon0 & (0x20 | 0x80)) || abs (vpos_count - vpos_count_diff) > 1 || lof_changed) {
init_hz ();
} else if (interlace_changed || changed_chipset_refresh ()) {
compute_framesync ();
}
- vpos_count_prev = vpos_count;
-
lof_changed = 0;
COPJMP (1, 1);
unset_special (~(SPCFLAG_BRK | SPCFLAG_MODE_CHANGE));
vpos = 0;
- vpos_count = vpos_count_prev = 0;
+ vpos_count = vpos_count_diff = 0;
inputdevice_reset ();
timehack_alive = 0;
return cnt;
}
+static int is_virtual (int unit_no)
+{
+ int t = is_hardfile (unit_no);
+ return t == FILESYS_VIRTUAL || t == FILESYS_CD;
+}
+
int is_hardfile (int unit_no)
{
- if (mountinfo.ui[unit_no].volname || mountinfo.ui[unit_no].wasisempty || mountinfo.ui[unit_no].unknown_media)
+ if (mountinfo.ui[unit_no].volname || mountinfo.ui[unit_no].wasisempty || mountinfo.ui[unit_no].unknown_media) {
+ if (unit_no >= cd_unit_offset && unit_no < cd_unit_offset + cd_unit_number)
+ return FILESYS_CD;
return FILESYS_VIRTUAL;
+ }
if (mountinfo.ui[unit_no].hf.secspertrack == 0) {
if (mountinfo.ui[unit_no].hf.flags & 1)
return FILESYS_HARDDRIVE;
if (uip->cd_open) {
sys_command_close (uip->cddevno);
isofs_unmount (uip->cdfs_superblock);
- }
+ }
uip->unit_pipe = 0;
uip->back_pipe = 0;
iscd = USE_CDFS == 2 && nr >= cd_unit_offset && nr < cd_unit_offset + cd_unit_number;
for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
- if (nr == i || !mountinfo.ui[i].open || mountinfo.ui[i].rootdir == NULL || iscd)
+ if (nr == i || !mountinfo.ui[i].open || mountinfo.ui[i].rootdir == NULL || is_hardfile (i) == FILESYS_CD)
continue;
if (rootdir && _tcslen (rootdir) > 0 && !_tcsicmp (mountinfo.ui[i].rootdir, rootdir)) {
write_log (_T("directory/hardfile '%s' already added\n"), rootdir);
struct hardfiledata *get_hardfile_data (int nr)
{
UnitInfo *uip = mountinfo.ui;
- if (nr < 0 || nr >= MAX_FILESYSTEM_UNITS || uip[nr].open == 0 || is_hardfile (nr) == FILESYS_VIRTUAL)
+ if (nr < 0 || nr >= MAX_FILESYSTEM_UNITS || uip[nr].open == 0 || is_virtual (nr))
return 0;
return &uip[nr].hf;
}
return 0;
if (!ui->open || u == NULL)
return 0;
- if (is_hardfile (nr) != FILESYS_VIRTUAL)
+ if (!is_virtual (nr))
return 0;
if (!filesys_isvolume (u))
return 0;
return 0;
if (nr < 0) {
for (u = units; u; u = u->next) {
- if (is_hardfile (u->unit) == FILESYS_VIRTUAL) {
+ if (is_virtual (u->unit)) {
if (!filesys_isvolume (u) && mountinfo.ui[u->unit].canremove)
break;
}
}
if (!u) {
for (u = units; u; u = u->next) {
- if (is_hardfile (u->unit) == FILESYS_VIRTUAL) {
+ if (is_virtual (u->unit)) {
if (mountinfo.ui[u->unit].canremove)
break;
}
return 0;
if (u->reinsertdelay)
return -1;
- if (is_hardfile (nr) != FILESYS_VIRTUAL)
+ if (!is_virtual (nr))
return 0;
if (filesys_isvolume (u)) {
filesys_delayed_change (u, 50, rootdir, volume, readonly, flags);
return -1;
nr = -1;
for (u = units; u; u = u->next) {
- if (is_hardfile (u->unit) == FILESYS_VIRTUAL) {
+ if (is_virtual (u->unit)) {
ui = &mountinfo.ui[u->unit];
if (ui->rootdir && !memcmp (ui->rootdir, rootdir, _tcslen (rootdir)) && _tcslen (rootdir) + 3 >= _tcslen (ui->rootdir)) {
if (filesys_isvolume (u) && inserted) {
return unit;
}
+
+static bool mount_cd (UnitInfo *uinfo, int nr, uae_u32 *ctime, uae_u64 *uniq)
+{
+ uinfo->cddevno = nr - cd_unit_offset;
+ if (!sys_command_open (uinfo->cddevno)) {
+ write_log (_T("Failed attempt to open CD unit %d\n"), uinfo->cddevno);
+ return false;
+ }
+ uinfo->cdfs_superblock = isofs_mount(uinfo->cddevno, uniq);
+ uinfo->wasisempty = true;
+ struct isofs_info ii;
+ if (isofs_mediainfo (uinfo->cdfs_superblock, &ii)) {
+ xfree (uinfo->volname);
+ if (ii.media) {
+ uinfo->wasisempty = false;
+ if (!ii.unknown_media) {
+ uinfo->volname = my_strdup (ii.volumename);
+ if (ctime)
+ *ctime = ii.creation;
+ set_highcyl (uinfo, ii.totalblocks);
+ }
+ }
+ uinfo->unknown_media = ii.unknown_media;
+ }
+ uinfo->cd_open = true;
+ return true;
+}
+
#ifdef UAE_FILESYS_THREADS
static void *filesys_thread (void *unit_v);
#endif
ui->self = 0;
}
#ifdef UAE_FILESYS_THREADS
- if (is_hardfile (nr) == FILESYS_VIRTUAL) {
+ if (is_virtual (nr)) {
ui->unit_pipe = xmalloc (smp_comm_pipe, 1);
ui->back_pipe = xmalloc (smp_comm_pipe, 1);
init_comm_pipe (ui->unit_pipe, 100, 3);
uae_start_thread (_T("filesys"), filesys_thread, (void *)ui, &ui->tid);
}
#endif
- if (isrestore ())
+ if (isrestore ()) {
+ if (ui->unit_type == UNIT_CDFS) {
+ mount_cd (ui, nr, NULL, &ui->self->rootnode.uniq_external);
+ }
startup_update_unit (ui->self, ui);
+ }
}
+
static uae_u32 REGPARAM2 startup_handler (TrapContext *context)
{
/* Just got the startup packet. It's in A4. DosBase is in A2,
uaecptr pkt = m68k_dreg (regs, 3);
uaecptr arg2 = get_long (pkt + dp_Arg2);
uaecptr devnode;
- int i;
+ int nr;
TCHAR *devname = bstr1 (get_long (pkt + dp_Arg1) << 2);
TCHAR *s;
Unit *unit;
if (s)
*s = '\0';
- for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
+ for (nr = 0; nr < MAX_FILESYSTEM_UNITS; nr++) {
/* Hardfile volume name? */
- if (!mountinfo.ui[i].open)
+ if (!mountinfo.ui[nr].open)
continue;
- if (is_hardfile(i) != FILESYS_VIRTUAL)
+ if (!is_virtual (nr))
continue;
- if (mountinfo.ui[i].startup == arg2)
+ if (mountinfo.ui[nr].startup == arg2)
break;
}
- if (i == MAX_FILESYSTEM_UNITS) {
+ if (nr == MAX_FILESYSTEM_UNITS) {
write_log (_T("Failed attempt to mount device '%s'\n"), devname);
put_long (pkt + dp_Res1, DOS_FALSE);
put_long (pkt + dp_Res2, ERROR_DEVICE_NOT_MOUNTED);
return 0;
}
- uinfo = mountinfo.ui + i;
- cdays = 3800 + i;
+ uinfo = mountinfo.ui + nr;
+ cdays = 3800 + nr;
if (uinfo->unit_type == UNIT_CDFS) {
ed = ef = 0;
- uinfo->cddevno = i - cd_unit_offset;
- if (!sys_command_open (uinfo->cddevno)) {
- write_log (_T("Failed attempt to open CD unit %d\n"), uinfo->cddevno);
+ if (!mount_cd (uinfo, nr, &ctime, &uniq)) {
put_long (pkt + dp_Res1, DOS_FALSE);
put_long (pkt + dp_Res2, ERROR_DEVICE_NOT_MOUNTED);
return 0;
}
- uinfo->cdfs_superblock = isofs_mount(uinfo->cddevno, &uniq);
- uinfo->wasisempty = true;
- struct isofs_info ii;
- if (isofs_mediainfo (uinfo->cdfs_superblock, &ii)) {
- xfree (uinfo->volname);
- if (ii.media) {
- uinfo->wasisempty = false;
- if (!ii.unknown_media) {
- uinfo->volname = my_strdup (ii.volumename);
- ctime = ii.creation;
- set_highcyl (uinfo, ii.totalblocks);
- }
- }
- uinfo->unknown_media = ii.unknown_media;
- }
- uinfo->cd_open = true;
} else {
ed = my_existsdir (uinfo->rootdir);
ef = my_existsfile (uinfo->rootdir);
if (!uinfo->unit_pipe) {
late = 1;
- filesys_start_thread (uinfo, i);
+ filesys_start_thread (uinfo, nr);
}
- unit = startup_create_unit (uinfo, i);
+ unit = startup_create_unit (uinfo, nr);
unit->volflags = uinfo->volflags;
unit->rootnode.uniq_external = uniq;
flags = restore_u32 ();
if (flags & 1)
a->elock = 1;
+ if (flags & 4)
+ a->uniq_external = restore_u64 ();
/* full Amiga-side path without drive, eg. "C/SetPatch" */
p = restore_string ();
/* root (p = volume label) */
static uae_u8 *restore_key (UnitInfo *ui, Unit *u, uae_u8 *src)
{
- int savedsize, uniq;
+ int uniq;
TCHAR *p, *pn;
mode_t openmode;
int err;
int missing;
a_inode *a;
Key *k;
+ uae_u64 savedsize, size, pos;
missing = 0;
k = xcalloc (Key, 1);
savedsize = restore_u32 ();
uniq = restore_u64 ();
p = restore_string ();
- restore_u64 ();
- restore_u64 ();
+ pos = restore_u64 ();
+ size = restore_u64 ();
+ if (size) {
+ savedsize = size;
+ k->file_pos = pos;
+ }
pn = makenativepath (ui, p);
openmode = ((k->dosmode & A_FIBF_READ) == 0 ? O_WRONLY
: (k->dosmode & A_FIBF_WRITE) == 0 ? O_RDONLY
write_log (_T("*** FS: Open file '%s' aino id %d != %d\n"), p, uniq, a->uniq);
if (!my_existsfile (pn)) {
write_log (_T("*** FS: Open file '%s' is missing, creating dummy file!\n"), p);
- k->fd = fs_openfile (u, a, openmode | O_CREAT |O_BINARY);
- if (k->fd) {
- uae_u8 *buf = xcalloc (uae_u8, 10000);
- int sp = savedsize;
- while (sp) {
- int s = sp >= 10000 ? 10000 : sp;
- fs_write (k->fd, buf, s);
- sp -= s;
+ if (savedsize < 10 * 1024 * 1024) {
+ k->fd = fs_openfile (u, a, openmode | O_CREAT |O_BINARY);
+ if (k->fd) {
+ uae_u8 *buf = xcalloc (uae_u8, 10000);
+ uae_u64 sp = savedsize;
+ while (sp) {
+ uae_u32 s = sp >= 10000 ? 10000 : sp;
+ fs_write (k->fd, buf, s);
+ sp -= s;
+ }
+ xfree(buf);
+ write_log (_T("*** FS: dummy file created\n"));
+ } else {
+ write_log (_T("*** FS: Open file '%s', couldn't create dummy file!\n"), p);
}
- xfree(buf);
- write_log (_T("*** FS: dummy file created\n"));
} else {
- write_log (_T("*** FS: Open file '%s', couldn't create dummy file!\n"), p);
+ write_log (L"*** FS: Too big, ignored\n");
}
} else {
k->fd = fs_openfile (u, a, openmode | O_BINARY);
uae_s64 s;
s = fs_fsize64 (k->fd);
if (s != savedsize)
- write_log (_T("FS: restored file '%s' size changed! orig=%d, now=%d!!\n"), p, savedsize, s);
+ write_log (_T("FS: restored file '%s' size changed! orig=%I64d, now=%I64d!!\n"), p, savedsize, s);
if (k->file_pos > s) {
- write_log (_T("FS: restored filepos larger than size of file '%s'!! %d > %d\n"), p, k->file_pos, s);
+ write_log (_T("FS: restored filepos larger than size of file '%s'!! %I64d > %d\n"), p, k->file_pos, s);
k->file_pos = s;
}
fs_lseek64 (k->fd, k->file_pos, SEEK_SET);
cnt = restore_u32 ();
write_log (_T("FS: restoring %d locks\n"), cnt);
while (cnt-- > 0)
- src = restore_aino(ui, u, src);
+ src = restore_aino (ui, u, src);
cnt = restore_u32 ();
write_log (_T("FS: restoring %d open files\n"), cnt);
while (cnt-- > 0)
- src = restore_key(ui, u, src);
+ src = restore_key (ui, u, src);
cnt = restore_u32 ();
write_log (_T("FS: restoring %d notifications\n"), cnt);
return src;
}
-static TCHAR *getfullaname(a_inode *a)
+static TCHAR *getfullaname (a_inode *a)
{
TCHAR *p;
int first = 1;
//write_log("recurse '%s' '%s' %d %08x\n", a->aname, a->nname, a->uniq, a->parent);
if (a->elock || a->shlock || a->uniq == 0) {
if (dst) {
- TCHAR *fn;
- write_log (_T("uniq=%d s=%d e=%d d=%d '%s' '%s'\n"), a->uniq, a->shlock, a->elock, a->dir, a->aname, a->nname);
- fn = getfullaname(a);
- write_log (_T("->'%s'\n"), fn);
+ TCHAR *fn = NULL;
+ write_log (_T("uniq=%d %I64d s=%d e=%d d=%d '%s' '%s'\n"), a->uniq, a->uniq_external, a->shlock, a->elock, a->dir, a->aname, a->nname);
+ if (a->aname) {
+ fn = getfullaname (a);
+ write_log (_T("->'%s'\n"), fn);
+ }
save_u64 (a->uniq);
save_u32 (a->locked_children);
save_u32 (a->exnext_count);
save_u32 (a->shlock);
- save_u32 ((a->elock ? 1 : 0) | (a->dir ? 2 : 0));
+ save_u32 ((a->elock ? 1 : 0) | (a->dir ? 2 : 0) | 4);
+ save_u64 (a->uniq_external);
save_string (fn);
xfree(fn);
}
{
if (restore_u32 () != 2)
return src;
+ cd_unit_offset = MAX_FILESYSTEM_UNITS;
+ cd_unit_number = 0;
filesys_prepare_reset2 ();
filesys_reset2 ();
a_uniq = restore_u64 ();
if (!ui->open)
return NULL;
/* not initialized yet, do not save */
- if (type == FILESYS_VIRTUAL && (ui->self == NULL || ui->volname == NULL))
+ if ((type == FILESYS_VIRTUAL || type == FILESYS_CD) && ui->self == NULL)
return NULL;
- write_log (_T("FS_FILESYS: '%s' '%s'\n"), ui->devname, ui->volname);
+ write_log (_T("FS_FILESYS: '%s' '%s'\n"), ui->devname, ui->volname ? ui->volname : _T("<no name>"));
dstbak = dst = xmalloc (uae_u8, 100000);
save_u32 (2); /* version */
save_u32 (ui->devno);
save_u16 (type);
- if (type == FILESYS_VIRTUAL)
+ if (type == FILESYS_VIRTUAL || type == FILESYS_CD)
save_path (ui->rootdir, SAVESTATE_PATH_VDIR);
else if (type == FILESYS_HARDFILE || type == FILESYS_HARDFILE_RDB)
save_path (ui->rootdir, SAVESTATE_PATH_HDF);
save_u8 (ui->readonly);
save_u32 (ui->startup);
save_u32 (filesys_configdev);
- if (type == FILESYS_VIRTUAL)
+ if (type == FILESYS_VIRTUAL || type == FILESYS_CD)
dst = save_filesys_virtual (ui, dst);
if (type == FILESYS_HARDFILE || type == FILESYS_HARDFILE_RDB)
dst = save_filesys_hardfile (ui, dst);
return src;
devno = restore_u32 ();
type = restore_u16 ();
- if (type == FILESYS_VIRTUAL)
+ if (type == FILESYS_VIRTUAL) {
rootdir = restore_path (SAVESTATE_PATH_VDIR);
- else if (type == FILESYS_HARDFILE || type == FILESYS_HARDFILE_RDB)
+ } else if (type == FILESYS_CD) {
+ rootdir = restore_path (SAVESTATE_PATH_VDIR);
+ if (cd_unit_offset == MAX_FILESYSTEM_UNITS)
+ cd_unit_offset = devno;
+ cd_unit_number++;
+ } else if (type == FILESYS_HARDFILE || type == FILESYS_HARDFILE_RDB) {
rootdir = restore_path (SAVESTATE_PATH_HDF);
- else if (type == FILESYS_HARDDRIVE)
+ } else if (type == FILESYS_HARDDRIVE) {
rootdir = restore_path (SAVESTATE_PATH_HD);
- else
+ } else {
rootdir = restore_path (SAVESTATE_PATH);
+ }
devname = restore_string ();
volname = restore_string ();
filesysdir = restore_path (SAVESTATE_PATH);
}
ui->devno = devno;
ui->startup = startup;
- if (type == FILESYS_VIRTUAL)
+ if (type == FILESYS_VIRTUAL || type == FILESYS_CD)
src = restore_filesys_virtual (ui, src, devno);
write_log (_T("'%s' restored\n"), rootdir);
end:
return 0;
}
}
- if (unit < 1000 || is_hardfile (unit) == FILESYS_VIRTUAL)
+ if (unit < 1000 || is_hardfile (unit) == FILESYS_VIRTUAL || is_hardfile (unit) == FILESYS_CD)
err = 50; /* HFERR_NoBoard */
} else {
err = IOERR_BADLENGTH;
extern void (*sample_handler) (void);
/* sample_evtime is in normal Amiga cycles; scaled_sample_evtime is in our
event cycles. */
-extern float sample_evtime, scaled_sample_evtime;
+extern float scaled_sample_evtime;
/* Determine if we can produce any sound at all. This can be only a guess;
* if unsure, say yes. Any call to init_sound may change the value. */
extern void close_sound (void);
extern void sample16_handler (void);
-extern void sample16i_rh_handler (void);
-extern void sample16i_crux_handler (void);
extern void sample8_handler (void);
extern void sample16s_handler (void);
-extern void sample16si_anti_handler (void);
extern void sample16ss_handler (void);
-extern void sample16si_rh_handler (void);
-extern void sample16si_crux_handler (void);
extern void sample8s_handler (void);
extern TCHAR *my_strdup (const TCHAR*s);
#endif
extern TCHAR *my_strdup_ansi (const char*);
+extern void my_trim (TCHAR*);
+extern TCHAR *my_strdup_trim (const TCHAR*);
extern TCHAR *au (const char*);
extern char *ua (const TCHAR*);
extern TCHAR *aucp (const char *s, unsigned int cp);
return randseed;
}
+void my_trim (TCHAR *s)
+{
+ int len;
+ while (_tcscspn (s, _T("\t \r\n")) == 0)
+ memmove (s, s + 1, (_tcslen (s + 1) + 1) * sizeof TCHAR);
+ len = _tcslen (s);
+ while (len > 0 && _tcscspn (s + len - 1, _T("\t \r\n")) == 0)
+ s[--len] = '\0';
+}
+
+TCHAR *my_strdup_trim (const TCHAR *s)
+{
+ TCHAR *out;
+ int len;
+
+ while (_tcscspn (s, _T("\t \r\n")) == 0)
+ s++;
+ len = _tcslen (s);
+ while (len > 0 && _tcscspn (s + len - 1, _T("\t \r\n")) == 0)
+ len--;
+ out = xmalloc (TCHAR, len + 1);
+ memcpy (out, s, len * sizeof TCHAR);
+ out[len] = 0;
+ return out;
+}
+
void discard_prefs (struct uae_prefs *p, int type)
{
struct strlist **ps = &p->all_lines;
first = last = bcaps[i].NotRange.Usage;
}
for (j = first; j <= last && buttoncnt < MAX_MAPPINGS; j++) {
- did->buttonsort[buttoncnt] = j * 2;
- did->buttonmappings[buttoncnt] = j;
- _stprintf (tmp, _T("Button %d"), j);
- did->buttonname[buttoncnt] = my_strdup (tmp);
- buttoncnt++;
+ int k;
+ for (k = 0; k < buttoncnt; k++) {
+ if (did->buttonmappings[k] == j)
+ break;
+ }
+ if (k == buttoncnt) {
+ did->buttonsort[buttoncnt] = j * 2;
+ did->buttonmappings[buttoncnt] = j;
+ _stprintf (tmp, _T("Button %d"), j);
+ did->buttonname[buttoncnt] = my_strdup (tmp);
+ buttoncnt++;
+ }
}
}
if (buttoncnt > 0) {
//write_log (_T("%.1fx%.1f %.1fx%.1f %.1fx%.1f\n"), dw, dh, w, h, sw, sh);
// ratio between Amiga texture and overlay mask texture
- float sw2 = dw * tin_w / window_w;
- float sh2 = dh * tin_h / window_h;
+ float sw2 = dw * tin_w / window_w - 0.5f;
+ float sh2 = dh * tin_h / window_h + 0.5f;
maskmult.x = sw2 * maskmult_x / w;
maskmult.y = sh2 * maskmult_y / h;
tout_w = tin_w * multx;
tout_h = tin_h * multx;
+ changed_prefs.leds_on_screen = currprefs.leds_on_screen = currprefs.leds_on_screen | STATUSLINE_TARGET;
+
if (!createamigatexture (tin_w, tin_h))
return false;
return true;
p->win32_inactive_pause = p->win32_inactive_nosound = true;
nosound = true;
}
+
+ /* switch from 32 to 16 or vice versa if mode does not exist */
+ struct MultiDisplay *md = getdisplay (p);
+ int depth = p->color_mode == 5 ? 4 : 2;
+ for (int i = 0; md->DisplayModes[i].depth >= 0; i++) {
+ if (md->DisplayModes[i].depth == depth) {
+ depth = 0;
+ break;
+ }
+ }
+ if (depth) {
+ p->color_mode = p->color_mode == 5 ? 2 : 5;
+ }
}
void target_default_options (struct uae_prefs *p, int type)
WIN32GUI_LoadUIString (IDS_INPUT_CUSTOM, buf, sizeof buf / sizeof (TCHAR));
for (int i = 0; i < GAMEPORT_INPUT_SETTINGS; i++)
_stprintf (p->input_config_name[i], buf, i + 1);
-
- /* switch from 32 to 16 or vice versa if mode does not exist */
- struct MultiDisplay *md = getdisplay (p);
- int depth = currprefs.color_mode == 5 ? 4 : 2;
- for (int i = 0; md->DisplayModes[i].depth >= 0; i++) {
- if (md->DisplayModes[i].depth == depth) {
- depth = 0;
- break;
- }
- }
- if (depth) {
- currprefs.color_mode = currprefs.color_mode == 5 ? 2 : 5;
- }
-
}
if (type == 1 || type == 0) {
p->win32_uaescsimode = UAESCSI_CDEMU;
#define LANG_DLL 1
//#define WINUAEBETA _T("")
-#define WINUAEBETA _T("Beta 2")
-#define WINUAEDATE MAKEBD(2012, 4, 1)
+#define WINUAEBETA _T("Beta 3")
+#define WINUAEDATE MAKEBD(2012, 4, 3)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
}
}
-static int vblscale (int v)
-{
- static int o;
- int n, v2, vo;
-
- if (!isnativevidbuf ())
- return v;
- n = (beamcon0 & 0x80) + maxvpos_nom;
- if (n != o)
- cleartemp = 1;
- o = n;
- if (beamcon0 & 0x80)
- return v;
- if (currprefs.ntscmode)
- v2 = MAXVPOS_NTSC;
- else
- v2 = MAXVPOS_PAL;
- if (abs (v2 - maxvpos_nom) <= 3)
- return v;
- vo = v * maxvpos_nom / v2;
- if (vo > v + 60)
- vo = v + 60;
- else if (vo < v - 60)
- vo = v - 60;
- return vo;
-}
-static int vblscale2 (int v)
-{
- static int o;
- int n, vo;
-
- if (!isnativevidbuf ())
- return v;
- n = (beamcon0 & 0x80) + maxvpos_nom;
- if (n != o)
- cleartemp = 1;
- o = n;
- if (beamcon0 & 0x80)
- return v;
- vo = v * maxvpos_nom / MAXVPOS_PAL;
- if (vo > v + 60)
- vo = v + 60;
- else if (vo < v - 60)
- vo = v - 60;
- return v;
-}
-
-static void fixh (int *ah, int minh)
-{
- if (!isnativevidbuf ())
- return;
- if (!(beamcon0 & 0x80)) {
- int max = (AMIGA_HEIGHT_MAX * scale) << currprefs.gfx_vresolution;
- if (*ah > AMIGA_HEIGHT_MAX * 2)
- return;
- if (minh && max < minh)
- max = minh;
- if (*ah > max)
- *ah = max;
-
- }
-}
-
static uae_u8 *getfilterrect1 (RECT *sr, RECT *dr, int dst_width, int dst_height, int dst_depth, int aw, int ah, int scale, int temp_width, int temp_height, uae_u8 *dptr, int pitch)
{
int aws, ahs;
- fixh (&ah, dst_height);
-
aws = aw * scale;
ahs = ah * scale;
*chp = ch;
}
-#if 0
-
-void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height, int aw, int ah, int scale, int temp_width, int temp_height)
-{
- float srcratio, dstratio;
- int aws, ahs, ahs2;
- int xs, ys;
- int v;
- int extraw, extrah;
- int fpuv;
-
- int filter_horiz_zoom = currprefs.gfx_filter_horiz_zoom;
- int filter_vert_zoom = currprefs.gfx_filter_vert_zoom;
- int filter_horiz_zoom_mult = currprefs.gfx_filter_horiz_zoom_mult;
- int filter_vert_zoom_mult = currprefs.gfx_filter_vert_zoom_mult;
- int filter_horiz_offset = currprefs.gfx_filter_horiz_offset;
- int filter_vert_offset = currprefs.gfx_filter_vert_offset;
-
- if (!usedfilter && !currprefs.gfx_api) {
- filter_horiz_zoom = filter_vert_zoom = 0;
- filter_horiz_zoom_mult = filter_vert_zoom_mult = 1000;
- filter_horiz_offset = filter_vert_offset = 0;
- }
-
- if (screen_is_picasso) {
- getrtgfilterrect2 (sr, dr, zr, dst_width, dst_height);
- return;
- }
-
- fpux_save (&fpuv);
-
- fixh (&ah, dst_height);
-
- getinit ();
- ahs2 = vblscale (ah) * scale;
- aws = aw * scale;
- ahs = ah * scale;
- //write_log (_T("%d %d %d\n"), dst_width, temp_width, aws);
- extraw = -aws * (filter_horiz_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2000;
- extrah = -ahs * (filter_vert_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2000;
-
- SetRect (sr, 0, 0, dst_width, dst_height);
- SetRect (zr, 0, 0, 0, 0);
- dr->left = (temp_width - aws) / 2;
- dr->top = (temp_height - ahs) / 2;
-
- filteroffsetx = 0;
- filteroffsety = 0;
- float xmult = filter_horiz_zoom_mult;
- float ymult = filter_vert_zoom_mult;
-
- dr->left -= (dst_width - aws) / 2;
- dr->top -= (dst_height - ahs) / 2;
- dr->right = dr->left + dst_width;
- dr->bottom = dr->top + dst_height;
-
- srcratio = 4.0 / 3.0;
- if (currprefs.gfx_filter_aspect > 0) {
- dstratio = (currprefs.gfx_filter_aspect >> 8) * 1.0 / (currprefs.gfx_filter_aspect & 0xff);
- } else if (currprefs.gfx_filter_aspect < 0) {
- if (isfullscreen () && deskw > 0 && deskh > 0)
- dstratio = 1.0 * deskw / deskh;
- else
- dstratio = 1.0 * dst_width / dst_height;
- } else {
- dstratio = srcratio;
- }
-
- int scalemode = currprefs.gfx_filter_autoscale;
-
- if (scalemode == AUTOSCALE_STATIC_AUTO) {
- if (0) {
- scalemode = AUTOSCALE_STATIC_NOMINAL;
- } else {
- int w1 = (800 / 2) << currprefs.gfx_resolution;
- int w2 = (640 / 2) << currprefs.gfx_resolution;
- int h1 = (600 / 2) << currprefs.gfx_vresolution;
- int h2 = (400 / 2) << currprefs.gfx_vresolution;
- int w = currprefs.gfx_size_win.width;
- int h = currprefs.gfx_size_win.height;
- if (w <= w1 && h <= h1 && w >= w2 && h >= h2)
- scalemode = AUTOSCALE_NONE;
- else
- scalemode = AUTOSCALE_STATIC_NOMINAL;
- }
- }
-
- if (scalemode) {
- int cw, ch, cx, cy, cv;
- static int oxmult, oymult;
-
- filterxmult = 1000 / scale;
- filterymult = 1000 / scale;
-
- if (scalemode == AUTOSCALE_STATIC_MAX || scalemode == AUTOSCALE_STATIC_NOMINAL || scalemode == AUTOSCALE_INTEGER) {
- cw = AMIGA_WIDTH_MAX << currprefs.gfx_resolution;
- ch = AMIGA_HEIGHT_MAX << currprefs.gfx_vresolution;
- cx = 0;
- cy = 0;
- cv = 1;
- if (scalemode == AUTOSCALE_STATIC_NOMINAL || scalemode == AUTOSCALE_INTEGER) {
- cw -= 40 << currprefs.gfx_resolution;
- ch -= 25 << currprefs.gfx_vresolution;
- cx = 28 << currprefs.gfx_resolution;
- cy = 10 << currprefs.gfx_vresolution;
- }
-
- if (scalemode == AUTOSCALE_INTEGER) {
- int maxw = currprefs.gfx_size.width;
- int maxh = currprefs.gfx_size.height;
- int mult = 1;
-
- if (currprefs.gfx_xcenter_pos > 0 || currprefs.gfx_xcenter_size > 0)
- getmanualpos (&cx, &cy, &cw, &ch);
-
- if (cw > maxw || ch > maxh) {
- while (cw / mult > maxw || ch / mult > maxh)
- mult *= 2;
- maxw = maxw * mult;
- maxh = maxh * mult;
- } else {
- while (cw * (mult * 2) <= maxw && ch * (mult * 2) <= maxh)
- mult *= 2;
- maxw = (maxw + mult - 1) / mult;
- maxh = (maxh + mult - 1) / mult;
- }
- //write_log(_T("(%dx%d) (%dx%d) ww=%d hh=%d w=%d h=%d m=%d\n"), cx, cy, cw, ch, currprefs.gfx_size.width, currprefs.gfx_size.height, maxw, maxh, mult);
- cx -= (maxw - cw) / 2;
- cw = maxw;
- cy -= (maxh - ch) / 2;
- ch = maxh;
- }
-
- } else if (scalemode == AUTOSCALE_MANUAL) {
-
- changed_prefs.gfx_filter_horiz_offset = currprefs.gfx_filter_horiz_offset = 0;
- changed_prefs.gfx_filter_vert_offset = currprefs.gfx_filter_vert_offset = 0;
- filter_horiz_offset = 0;
- filter_vert_offset = 0;
-
- get_custom_topedge (&cx, &cy);
- //write_log (_T("%dx%d %dx%d\n"), cx, cy, currprefs.gfx_resolution, currprefs.gfx_vresolution);
-
- getmanualpos (&cx, &cy, &cw, &ch);
-
- //write_log (_T("%dx%d %dx%d %dx%d\n"), currprefs.gfx_xcenter_pos, currprefs.gfx_ycenter_pos, cx, cy, cw, ch);
-
- cv = 1;
-
- } else {
-
- cv = get_custom_limits (&cw, &ch, &cx, &cy);
-
- }
-
- if (currprefs.gfx_api == 0) {
- if (cx < 0)
- cx = 0;
- if (cy < 0)
- cy = 0;
- }
-
- if (cv) {
- int diff;
-
- if (scalemode == AUTOSCALE_CENTER) {
-
- int ww = cw * scale;
- int hh = ch * scale;
- SetRect (sr, 0, 0, dst_width, dst_height);
- SetRect (zr, 0, 0, 0, 0);
- dr->left = dr->top = 0;
- dr->right = dr->left + dst_width;
- dr->bottom = dr->top + dst_height;
- OffsetRect (zr, cx * scale - (dst_width - ww) / 2, cy * scale - (dst_height - hh) / 2);
- goto cont;
-
- } else if (scalemode == AUTOSCALE_RESIZE && isfullscreen () == 0 && !currprefs.gfx_filteroverlay[0]) {
-
- static int lastresize = 0;
- static int lastdelay = 1;
- static int ocw, och, ocx, ocy, lcw, lch, lcx, lcy;
- int useold = 0;
-
- lastresize--;
- if (lastresize > 0) {
- if (cw != lcw || ch != lch || cx != lcx || cy != lcy)
- lastresize = 10;
- useold = 1;
- } else if (lastdelay == 0) {
- lastdelay = 2;
- useold = 1;
- } else if (lastdelay > 0) {
- lastdelay--;
- useold = 1;
- if (lastdelay == 0) {
- lastdelay = -1;
- useold = 0;
- }
- }
-
- lcw = cw;
- lch = ch;
- lcx = cx;
- lcy = cy;
- if (useold && !config_changed) {
- cw = ocw;
- ch = och;
- cx = ocx;
- cy = ocy;
- } else {
- ocw = cw;
- och = ch;
- ocx = cx;
- ocy = cy;
- lastresize = 10;
- lastdelay = 0;
- }
- double scalex = currprefs.gfx_filter_horiz_zoom_mult > 0 ? 1000.0 / currprefs.gfx_filter_horiz_zoom_mult : 1.0;
- double scaley = currprefs.gfx_filter_vert_zoom_mult > 0 ? 1000.0 / currprefs.gfx_filter_vert_zoom_mult : 1.0;
- SetRect (sr, 0, 0, cw * scale * scalex, ch * scale * scaley);
- dr->left = (temp_width - aws) /2;
- dr->top = (temp_height - ahs) / 2;
- dr->right = dr->left + cw * scale;
- dr->bottom = dr->top + ch * scale;
- OffsetRect (zr, cx * scale, cy * scale);
- int ww = (dr->right - dr->left) * scalex;
- int hh = (dr->bottom - dr->top) * scaley;
- if (currprefs.gfx_xcenter_size >= 0)
- ww = currprefs.gfx_xcenter_size;
- if (currprefs.gfx_ycenter_size >= 0)
- hh = currprefs.gfx_ycenter_size;
- int oldwinw = currprefs.gfx_size_win.width;
- int oldwinh = currprefs.gfx_size_win.width;
- changed_prefs.gfx_size_win.width = ww;
- changed_prefs.gfx_size_win.height = hh;
- fixup_prefs_dimensions (&changed_prefs);
- if (oldwinw != changed_prefs.gfx_size_win.width || oldwinh != changed_prefs.gfx_size_win.height)
- config_changed = 1;
- OffsetRect (zr, -(changed_prefs.gfx_size_win.width - ww + 1) / 2, -(changed_prefs.gfx_size_win.height - hh + 1) / 2);
- filteroffsetx = -zr->left / scale;
- filteroffsety = -zr->top / scale;
- goto end;
- }
-
- dr->left = (temp_width - aws) /2;
- dr->top = (temp_height - ahs) / 2;
- dr->right = dr->left + dst_width * scale;
- dr->bottom = dr->top + dst_height * scale;
-
- OffsetRect (zr, cx * scale, cy * scale);
-
- sizeoffset (dr, zr, extraw, extrah);
-
- dr->right -= (dst_width - cw) * scale;
- dr->bottom -= (dst_height - ch) * scale;
-
- filteroffsetx = -zr->left / scale;
- filteroffsety = -zr->top / scale;
-
- if (currprefs.gfx_filter_keep_aspect || currprefs.gfx_filter_aspect != 0) {
- int diffx = dr->right - dr->left;
- int diffy = dr->bottom - dr->top;
- float xmult = 1.0;
- float ymult = 1.0;
-
- if (currprefs.gfx_filter_keep_aspect) {
- if (currprefs.ntscmode) {
- dstratio = dstratio * 1.21;
- if (currprefs.gfx_filter_keep_aspect == 2 && ispal ())
- dstratio = dstratio * 0.93;
- else if (currprefs.gfx_filter_keep_aspect == 1 && !ispal ())
- dstratio = dstratio * 0.98;
- } else {
- if (currprefs.gfx_filter_keep_aspect == 2 && ispal ())
- dstratio = dstratio * 0.95;
- else if (currprefs.gfx_filter_keep_aspect == 1 && !ispal ())
- dstratio = dstratio * 0.95;
- }
- }
-
- if (srcratio > dstratio) {
- ymult = ymult * srcratio / dstratio;
- } else {
- xmult = xmult * dstratio / srcratio;
- }
-
- diff = diffx - diffx * xmult;
- sizeoffset (dr, zr, diff, 0);
- filteroffsetx += diff / 2;
-
- diff = diffy - diffy * ymult;
- sizeoffset (dr, zr, 0, diff);
- filteroffsety += diff / 2;
- }
-
- v = filter_horiz_offset;
- OffsetRect (zr, (int)(-v * aws / 1000.0), 0);
- v = filter_vert_offset;
- OffsetRect (zr, 0, (int)(-v * ahs / 1000.0));
-
- diff = dr->right - dr->left;
- filterxmult = diff * 1000 / (dst_width * scale);
- diff = dr->bottom - dr->top;
- filterymult = diff * 1000 / (dst_height * scale);
- goto end;
- }
-
- }
-cont:
- if (!filter_horiz_zoom_mult && !filter_vert_zoom_mult) {
-
- sizeoffset (dr, zr, extraw, extrah);
-
- if (currprefs.gfx_filter_keep_aspect) {
- float xm, ym, m;
-
- xm = 1.0 * aws / dst_width;
- ym = 1.0 * ahs / dst_height;
- if (xm < ym)
- xm = ym;
- else
- ym = xm;
- xmult = ymult = xm * 1000.0;
-
- m = (aws * 1.0 / dst_width) / (ahs * 1.0 / dst_height);
- dstratio = dstratio * m;
- }
-
- }
-
- if (currprefs.ntscmode) {
- if (currprefs.gfx_filter_keep_aspect == 2 && ispal ())
- dstratio = dstratio * 0.93;
- else if (currprefs.gfx_filter_keep_aspect == 1 && !ispal ())
- dstratio = dstratio * 0.98;
- } else {
- if (currprefs.gfx_filter_keep_aspect == 2 && ispal ())
- dstratio = dstratio * 0.95;
- else if (currprefs.gfx_filter_keep_aspect == 1 && !ispal ())
- dstratio = dstratio * 0.95;
- }
-
- if (srcratio > dstratio) {
- ymult = ymult * srcratio / dstratio;
- } else {
- xmult = xmult * dstratio / srcratio;
- }
-
- if (xmult <= 0.01)
- xmult = aws * 1000 / dst_width;
- else
- xmult = xmult + xmult * filter_horiz_zoom / 2000;
- if (ymult <= 0.01)
- ymult = ahs * 1000 / dst_height;
- else
- ymult = ymult + ymult * filter_vert_zoom / 2000;
-
- if (!filter_horiz_zoom_mult && !filter_vert_zoom_mult) {
- if (currprefs.ntscmode) {
- int v = vblscale2 (ahs);
- ymult /= 1.21;
- OffsetRect (dr, 0, (v - ahs2) / 2);
- }
- }
-
- ymult = vblscale (ymult);
- OffsetRect (dr, 0, (ahs2 - ahs) / 2);
-
- v = filter_horiz_offset;
- OffsetRect (zr, (int)(-v * aws / 1000.0), 0);
- v = filter_vert_offset;
- OffsetRect (zr, 0, (int)(-v * ahs / 1000.0));
-
- xs = dst_width - dst_width * xmult / 1000;
- ys = dst_height - dst_height * ymult / 1000;
- sizeoffset (dr, zr, xs, ys);
-
- filterxmult = xmult;
- filterymult = ymult;
- filteroffsetx += (dst_width - aw * 1000 / filterxmult) / 2;
- filteroffsety += (dst_height - ah * 1000 / filterymult) / 2;
-
-end:
- fpux_restore (&fpuv);
-
-}
-
-#else
-
extern bool getscalerect (float *mx, float *my, float *sx, float *sy);
void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height, int aw, int ah, int scale, int temp_width, int temp_height)
{
float srcratio, dstratio;
- int aws, ahs, ahs2;
+ int aws, ahs;
int xs, ys;
int v;
int extraw, extrah;
fpux_save (&fpuv);
- fixh (&ah, dst_height);
-
getinit ();
- ahs2 = vblscale (ah) * scale;
aws = aw * scale;
ahs = ah * scale;
//write_log (_T("%d %d %d\n"), dst_width, temp_width, aws);
cw = gfxvidinfo.outbuffer->outwidth;
ch = gfxvidinfo.outbuffer->outheight;
} else {
- cw = AMIGA_WIDTH_MAX << currprefs.gfx_resolution;
- ch = AMIGA_HEIGHT_MAX << currprefs.gfx_vresolution;
+ cw = gfxvidinfo.drawbuffer.inwidth;
+ ch = gfxvidinfo.drawbuffer.inheight;
cx = 0;
cy = 0;
cv = 1;
- if (scalemode == AUTOSCALE_STATIC_NOMINAL || scalemode == AUTOSCALE_INTEGER) {
- cw -= 50 << currprefs.gfx_resolution;
+ if (!(beamcon0 & 0x80) && (scalemode == AUTOSCALE_STATIC_NOMINAL || scalemode == AUTOSCALE_INTEGER)) {
+ cw -= 40 << currprefs.gfx_resolution;
ch -= 25 << currprefs.gfx_vresolution;
- cx = 18 << currprefs.gfx_resolution;
+ cx = 28 << currprefs.gfx_resolution;
cy = 10 << currprefs.gfx_vresolution;
}
}
if (!filter_horiz_zoom_mult && !filter_vert_zoom_mult) {
if (currprefs.ntscmode) {
- int v = vblscale2 (ahs);
ymult /= 1.21;
- OffsetRect (dr, 0, (v - ahs2) / 2);
}
}
- ymult = vblscale (ymult);
- OffsetRect (dr, 0, (ahs2 - ahs) / 2);
-
v = filter_horiz_offset;
OffsetRect (zr, (int)(-v * aws / 1000.0), 0);
v = filter_vert_offset;
fpux_restore (&fpuv);
}
-#endif
uae_u8 *getfilterbuffer (int *widthp, int *heightp, int *pitch, int *depth)
{
_stprintf (tmp, _T("%s (%d*%d)"), md->monitorname, md->rect.right - md->rect.left, md->rect.bottom - md->rect.top);
else
_stprintf (tmp, _T("%s (%d*%d) [%d*%d]"), md->monitorname, md->rect.right - md->rect.left, md->rect.bottom - md->rect.top, md->rect.left, md->rect.top);
+ if (md->primary)
+ _tcscat (tmp, _T(" *"));
xfree (md->fullname);
md->fullname = my_strdup (tmp);
return TRUE;
DISPLAY_DEVICE add;
add.cb = sizeof add;
while (EnumDisplayDevices (NULL, adapterindex, &add, 0)) {
- int monitorindex = 0;
+
adapterindex++;
if (!(add.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP))
continue;
if (add.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER)
continue;
if (md - Displays >= MAX_DISPLAYS)
- return;
+ break;
+
+ int monitorindex = 0;
DISPLAY_DEVICE mdd;
mdd.cb = sizeof mdd;
while (EnumDisplayDevices (add.DeviceName, monitorindex, &mdd, 0)) {
monitorindex++;
if (md - Displays >= MAX_DISPLAYS)
- return;
+ break;
if (!(mdd.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP))
continue;
if (mdd.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER)
continue;
- md->adaptername = my_strdup (add.DeviceString);
+ md->adaptername = my_strdup_trim (add.DeviceString);
md->adapterid = my_strdup (add.DeviceName);
md->adapterkey = my_strdup (add.DeviceID);
- md->monitorname = my_strdup (mdd.DeviceString);
+ md->monitorname = my_strdup_trim (mdd.DeviceString);
md->monitorid = my_strdup (mdd.DeviceKey);
if (add.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
md->primary = true;
if (md - Displays >= MAX_DISPLAYS)
return;
if (monitorindex == 0) {
- md->adaptername = my_strdup (add.DeviceString);
+ md->adaptername = my_strdup_trim (add.DeviceString);
md->adapterid = my_strdup (add.DeviceName);
md->adapterkey = my_strdup (add.DeviceID);
- md->monitorname = my_strdup (add.DeviceString);
+ md->monitorname = my_strdup_trim (add.DeviceString);
md->monitorid = my_strdup (add.DeviceKey);
md->primary = true;
}
void sortdisplays (void)
{
- struct MultiDisplay *md1;
+ struct MultiDisplay *md;
int i, idx;
int w = GetSystemMetrics (SM_CXSCREEN);
write_log (_T("Desktop: W=%d H=%d B=%d. CXVS=%d CYVS=%d\n"), w, h, b,
GetSystemMetrics (SM_CXVIRTUALSCREEN), GetSystemMetrics (SM_CYVIRTUALSCREEN));
- md1 = Displays;
- while (md1->monitorname) {
- md1->DisplayModes = xmalloc (struct PicassoResolution, MAX_PICASSO_MODES);
- md1->DisplayModes[0].depth = -1;
+ md = Displays;
+ while (md->monitorname) {
+ md->DisplayModes = xmalloc (struct PicassoResolution, MAX_PICASSO_MODES);
+ md->DisplayModes[0].depth = -1;
- write_log (_T("%s [%s]\n"), md1->adaptername, md1->monitorname);
- write_log (_T("-: %d*%d [%d*%d]\n"), md1->rect.right - md1->rect.left, md1->rect.bottom - md1->rect.top, md1->rect.left, md1->rect.top);
+ write_log (_T("%s [%s]\n"), md->adaptername, md->adapterid);
+ write_log (_T("-: %s\n"), md->fullname);
for (int mode = 0; mode < 2; mode++) {
DEVMODE dm;
dm.dmSize = sizeof dm;
dm.dmDriverExtra = 0;
idx = 0;
- while (EnumDisplaySettingsEx (md1->adapterid, idx, &dm, mode ? EDS_RAWMODE : 0)) {
+ while (EnumDisplaySettingsEx (md->adapterid, idx, &dm, mode ? EDS_RAWMODE : 0)) {
int found = 0;
int idx2 = 0;
- while (md1->DisplayModes[idx2].depth >= 0 && !found) {
- struct PicassoResolution *pr = &md1->DisplayModes[idx2];
+ while (md->DisplayModes[idx2].depth >= 0 && !found) {
+ struct PicassoResolution *pr = &md->DisplayModes[idx2];
if (pr->res.width == dm.dmPelsWidth && pr->res.height == dm.dmPelsHeight && pr->depth == dm.dmBitsPerPel / 8) {
for (i = 0; pr->refresh[i]; i++) {
if (pr->refresh[i] == dm.dmDisplayFrequency) {
dm.dmPelsWidth, dm.dmPelsHeight, dm.dmBitsPerPel, dm.dmDisplayFrequency, dm.dmFields);
#endif
if ((dm.dmFields & DM_PELSWIDTH) && (dm.dmFields & DM_PELSHEIGHT) && (dm.dmFields & DM_BITSPERPEL)) {
- addmode (md1, &dm, mode);
+ addmode (md, &dm, mode);
}
}
idx++;
}
}
//dhack();
- sortmodes (md1);
- modesList (md1);
+ sortmodes (md);
+ modesList (md);
i = 0;
- while (md1->DisplayModes[i].depth > 0)
+ while (md->DisplayModes[i].depth > 0)
i++;
write_log (_T("%d display modes.\n"), i);
- md1++;
+ md++;
}
}
EnterCriticalSection (&screen_cs);
if (currentmode->flags & DM_D3D) {
v = D3D_renderframe ();
-#ifdef GFXFILTER
} else if (currentmode->flags & DM_SWSCALE) {
S2X_render ();
v = true;
-#endif
} else if (currentmode->flags & DM_DDRAW) {
v = true;
}
buf->bufmem_allocated = NULL;
buf->bufmem_lockable = true;
+ write_log (_T("Reserved %s temp buffer (%d*%d*%d)\n"), name, width, height, depth);
+
} else if (flags & DM_SWSCALE) {
int w = buf->width_allocated * 2;
return set_ddraw ();
}
+static int oldtex_w, oldtex_h, oldtex_rtg;
+
static BOOL doInit (void)
{
int fs_warning = -1;
if (!screen_is_picasso) {
- allocsoftbuffer (_T("draw"), &gfxvidinfo.drawbuffer, currentmode->flags,
- 1600, 1280, currentmode->current_depth);
+ if (currprefs.gfx_api == 0 && currprefs.gfx_filter == 0) {
+ allocsoftbuffer (_T("draw"), &gfxvidinfo.drawbuffer, currentmode->flags,
+ currentmode->native_width, currentmode->native_height, currentmode->current_depth);
+ } else {
+ allocsoftbuffer (_T("draw"), &gfxvidinfo.drawbuffer, currentmode->flags,
+ 1600, 1280, currentmode->current_depth);
+ }
if (currprefs.monitoremu) {
allocsoftbuffer (_T("monemu"), &gfxvidinfo.tempbuffer, currentmode->flags,
currentmode->amiga_width > 1024 ? currentmode->amiga_width : 1024,
ret = -1;
goto oops;
}
+ oldtex_w = oldtex_h = -1;
+ target_graphics_buffer_update ();
}
screen_is_initialized = 1;
w = vb->outwidth;
h = vb->outheight;
}
-
- write_log (_T("Buffer size (%d*%d)\n"), w, h);
+
+ if (oldtex_w == w && oldtex_h == h && oldtex_rtg == screen_is_picasso)
+ return true;
+ oldtex_w = w;
+ oldtex_h = h;
+ oldtex_rtg = screen_is_picasso;
+
+ write_log (_T("Buffer size (%d*%d) %s\n"), w, h, screen_is_picasso ? _T("RTG") : _T("Native"));
+ S2X_free ();
if (currentmode->flags & DM_D3D) {
D3D_alloctexture (w, h);
}
- S2X_free ();
if (currentmode->flags & DM_SWSCALE) {
S2X_init (currentmode->native_width, currentmode->native_height, currentmode->native_depth);
}
<ClCompile Include="..\..\moduleripper.cpp" />
</ItemGroup>
<ItemGroup>
+ <None Include="..\..\..\..\..\Users\Toni\Desktop\winuaebootlog.txt" />
<None Include="..\resources\35floppy.ico" />
<None Include="..\resources\amigainfo.ico" />
<None Include="..\resources\avioutput.ico" />
<None Include="..\resources\drive_spinnd.wav" />
<None Include="..\resources\drive_startup.wav" />
<None Include="..\resources\resource" />
+ <None Include="..\..\..\..\..\Users\Toni\Desktop\winuaebootlog.txt">
+ <Filter>common</Filter>
+ </None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\resources\winuae.rc">
- restore only single input target to default.
- hdd from command line
+- On screen led status line was drawn using both D3D sprite and directly to bitmap methods in D3D no-filter mode (b2).
+- Removed PAL/NTSC vertical scaling hack which is not needed anymore.
+- PAL/NTSC vertical scaling added to Fullscreen (TV)/(Max) filter modes.
+- Fullscreen (TV)/(Max) also handles programmed modes like real monitor would, positioning and scaling using sync parameters.
+- Fake 60Hz (VPOSW poking) did nothing. (2.4)
+- DirectDraw + null filter crash fixed when display height was smaller than emulated display height. (b2)
+- D3D overlay mask scaling artifact in some resolutions (2.4)
+- CDFS CD drive statefile support.
+- Ignore duplicate HID button IDs.
+- Reduced flicker when refresh rate changes (PAL<>NTSC or other mode changes)
+
Beta 2:
- Filter system partial rewrite again. Do not use static display buffer. Always dynamically reallocate internal buffer if