static TCHAR newimagefiles[MAX_TOTAL_SCSI_DEVICES][256];
static int imagechangetime[MAX_TOTAL_SCSI_DEVICES];
static bool cdimagefileinuse[MAX_TOTAL_SCSI_DEVICES];
-static bool wasopen[MAX_TOTAL_SCSI_DEVICES];
+static int wasopen[MAX_TOTAL_SCSI_DEVICES];
/* convert minutes, seconds and frames -> logical sector number */
int msf2lsn (int msf)
void device_func_reset (void)
{
for (int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) {
- wasopen[i] = false;
+ wasopen[i] = 0;
waspaused[i] = false;
imagechangetime[i] = 0;
cdimagefileinuse[i] = false;
changed = true;
if (changed) {
+ bool wasimage = currprefs.cdslots[unitnum].name[0] != 0;
if (unitsem[unitnum])
gotsem = getsem (unitnum, true);
cdimagefileinuse[unitnum] = changed_prefs.cdslots[unitnum].inuse;
imagechangetime[unitnum] = 3 * 50;
struct device_info di;
device_func[unitnum]->info (unitnum, &di, 0);
- wasopen[unitnum] = di.open;
+ if (wasopen[unitnum] >= 0)
+ wasopen[unitnum] = di.open ? 1 : 0;
if (wasopen[unitnum]) {
device_func[unitnum]->closedev (unitnum);
+ wasopen[unitnum] = -1;
if (currprefs.scsi) {
scsi_do_disk_change (unitnum, 0, &pollmode);
if (pollmode)
imagechangetime[unitnum] = 8 * 50;
- filesys_do_disk_change (unitnum, 0);
+ if (filesys_do_disk_change (unitnum, 0)) {
+ imagechangetime[unitnum] = newimagefiles[unitnum][0] ? 3 * 50 : 0;
+ pollmode = 0;
+ }
}
}
write_log (_T("CD: eject (%s) open=%d\n"), pollmode ? _T("slow") : _T("fast"), wasopen[unitnum] ? 1 : 0);
write_log (_T("-> device open failed\n"));
wasopen[unitnum] = 0;
} else {
+ wasopen[unitnum] = 1;
write_log (_T("-> device reopened\n"));
}
}
static bool createconfigstore (struct uae_prefs *p)
{
- uae_u8 zero = 0;
+ uae_u8 zeros[4] = { 0 };
zfile_fclose (configstore);
configstore = zfile_fopen_empty (NULL, _T("configstore"), 50000);
if (!configstore)
uaeconfig++;
cfgfile_save_options (configstore, p, 0);
uaeconfig--;
- cfg_write (&zero, configstore);
+ zfile_fwrite (zeros, 1, sizeof zeros, configstore);
zfile_fseek (configstore, 0, SEEK_SET);
return true;
}
return src;
}
-uae_u8 *save_configuration (int *len)
+uae_u8 *save_configuration (int *len, bool fullconfig)
{
- int tmpsize = 30000;
+ int tmpsize = 100000;
uae_u8 *dstbak, *dst, *p;
int index = -1;
- dstbak = dst = xmalloc (uae_u8, tmpsize);
+ dstbak = dst = xcalloc (uae_u8, tmpsize);
p = dst;
for (;;) {
- TCHAR tmpout[256];
+ TCHAR tmpout[1000];
int ret;
tmpout[0] = 0;
ret = cfgfile_modify (index, _T("*"), 1, tmpout, sizeof (tmpout) / sizeof (TCHAR));
index++;
if (_tcslen (tmpout) > 0) {
char *out;
- if (!_tcsncmp (tmpout, _T("input."), 6))
+ if (!fullconfig && !_tcsncmp (tmpout, _T("input."), 6))
continue;
- out = ua (tmpout);
+ write_log (_T("'%s'\n"), tmpout);
+ out = uutf8 (tmpout);
strcpy ((char*)p, out);
xfree (out);
strcat ((char*)p, "\n");
p->ghostscript_parameters[0] = 0;
p->uae_hide = 0;
+ p->mountitems = 0;
+ for (i = 0; i < MOUNT_CONFIG_SIZE; i++) {
+ p->mountconfig[i].configoffset = -1;
+ }
+
memset (&p->jports[0], 0, sizeof (struct jport));
memset (&p->jports[1], 0, sizeof (struct jport));
memset (&p->jports[2], 0, sizeof (struct jport));
p->gfx_filter_scanlineratio = (1 << 4) | 1;
p->gfx_filter_keep_aspect = 0;
p->gfx_filter_autoscale = AUTOSCALE_STATIC_AUTO;
- p->gfx_filter_keep_autoscale_aspect = true;
+ p->gfx_filter_keep_autoscale_aspect = false;
p->gfx_filteroverlay_overscan = 0;
_tcscpy (p->floppyslots[0].df, _T("df0.adf"));
uip->cd_open = 0;
}
+static uaedev_config_info *getuci (struct uaedev_config_info *uci, int nr)
+{
+ return &uci[nr];
+}
+
+
static UnitInfo *getuip (struct uae_prefs *p, int index)
{
if (index < 0)
int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo *mi)
{
- UnitInfo *ui = getuip(p, index);
+ UnitInfo *ui = getuip (p, index);
struct uaedev_config_info *uci = &p->mountconfig[index];
UnitInfo uitmp;
ui = &uitmp;
if (!uci->ishdf) {
mi->ismounted = 1;
- if (uci->rootdir && _tcslen(uci->rootdir) == 0)
+ if (uci->rootdir && _tcslen (uci->rootdir) == 0)
return FILESYS_VIRTUAL;
if (my_existsfile (uci->rootdir)) {
mi->ismedia = 1;
if (nr < 0)
return 0;
- uci = &p->mountconfig[nr];
+ uci = getuci (p->mountconfig, nr);
hardfile_do_disk_change (uci, 0);
if (uci->configoffset >= 0 && uci->controller == 0)
filesys_media_change (uci->rootdir, 0, uci);
{
struct uaedev_config_info *uci1, *uci2, tmpuci;
- uci1 = &p->mountconfig[nr];
- uci2 = &p->mountconfig[to];
+ uci1 = getuci (p->mountconfig, nr);
+ uci2 = getuci (p->mountconfig, to);
if (nr == to)
return 0;
memcpy (&tmpuci, uci1, sizeof (struct uaedev_config_info));
void filesys_addexternals (void);
+static void allocuci (struct uae_prefs *p, int nr, int idx)
+{
+ struct uaedev_config_info *uci = &p->mountconfig[nr];
+ if (idx >= 0) {
+ UnitInfo *ui;
+ uci->configoffset = idx;
+ ui = &mountinfo.ui[idx];
+ ui->configureddrive = 1;
+ } else {
+ uci->configoffset = -1;
+ }
+}
+
static void initialize_mountinfo (void)
{
int nr;
int idx = set_filesys_unit_1 (-1, uci->devname, uci->ishdf ? NULL : uci->volname, uci->rootdir,
uci->readonly, uci->sectors, uci->surfaces, uci->reserved,
uci->blocksize, uci->bootpri, uci->donotmount, uci->autoboot, uci->filesys, 0, MYVOLUMEINFO_REUSABLE);
- if (idx >= 0) {
- UnitInfo *ui;
- uci->configoffset = idx;
- ui = &mountinfo.ui[idx];
- ui->configureddrive = 1;
+ allocuci (&currprefs, nr, idx);
+ }
+ }
+ filesys_addexternals ();
+ nr = nr_units ();
+ cd_unit_offset = nr;
+ cd_unit_number = 0;
+#if USE_CDFS == 2
+ if (currprefs.scsi && currprefs.win32_automount_cddrives && USE_CDFS) {
+ uae_u32 mask = scsi_get_cd_drive_mask ();
+ for (int i = 0; i < 32; i++) {
+ if (mask & (1 << i)) {
+ TCHAR cdname[30];
+ _stprintf (cdname, _T("CD%d"), i);
+ cd_unit_number++;
+ int idx = set_filesys_unit_1 (i + cd_unit_offset, cdname, NULL, _T("/"), true, 1, 1, 0, 2048, 0, false, false, NULL, 0, 0);
+ allocuci (&currprefs, nr, idx);
+ nr++;
}
- } else if (uci->controller <= HD_CONTROLLER_IDE3) {
+ }
+ }
+#endif
+
+ for (nr = 0; nr < currprefs.mountitems; nr++) {
+ if (uci->controller == HD_CONTROLLER_UAE)
+ continue;
+ if (uci->controller <= HD_CONTROLLER_IDE3) {
gayle_add_ide_unit (uci->controller - HD_CONTROLLER_IDE0, uci->rootdir, uci->blocksize, uci->readonly,
uci->devname, uci->sectors, uci->surfaces, uci->reserved,
uci->bootpri, uci->filesys);
+ allocuci (&currprefs, nr, -1);
} else if (uci->controller <= HD_CONTROLLER_SCSI6) {
if (currprefs.cs_mbdmac) {
#ifdef A2091
a3000_add_scsi_unit (uci->controller - HD_CONTROLLER_SCSI0, uci->rootdir, uci->blocksize, uci->readonly,
uci->devname, uci->sectors, uci->surfaces, uci->reserved,
uci->bootpri, uci->filesys);
+ allocuci (&currprefs, nr, -1);
#endif
} else if (currprefs.cs_a2091) {
#ifdef A2091
a2091_add_scsi_unit (uci->controller - HD_CONTROLLER_SCSI0, uci->rootdir, uci->blocksize, uci->readonly,
uci->devname, uci->sectors, uci->surfaces, uci->reserved,
uci->bootpri, uci->filesys);
+ allocuci (&currprefs, nr, -1);
#endif
} else if (currprefs.cs_cdtvscsi) {
#ifdef CDTV
cdtv_add_scsi_unit (uci->controller - HD_CONTROLLER_SCSI0, uci->rootdir, uci->blocksize, uci->readonly,
uci->devname, uci->sectors, uci->surfaces, uci->reserved,
uci->bootpri, uci->filesys);
+ allocuci (&currprefs, nr, -1);
#endif
}
} else if (uci->controller == HD_CONTROLLER_PCMCIA_SRAM) {
gayle_add_pcmcia_sram_unit (uci->rootdir, uci->readonly);
+ allocuci (&currprefs, nr, -1);
} else if (uci->controller == HD_CONTROLLER_PCMCIA_IDE) {
gayle_add_pcmcia_ide_unit (uci->rootdir, uci->readonly);
+ allocuci (&currprefs, nr, -1);
}
}
- filesys_addexternals ();
- cd_unit_offset = nr_units ();
- cd_unit_number = 0;
-#if USE_CDFS == 2
- if (currprefs.scsi && currprefs.win32_automount_cddrives && USE_CDFS) {
- uae_u32 mask = scsi_get_cd_drive_mask ();
- for (int i = 0; i < 32; i++) {
- if (mask & (1 << i)) {
- TCHAR cdname[30];
- _stprintf (cdname, _T("CD%d"), i);
- cd_unit_number++;
- int idx = set_filesys_unit_1 (i + cd_unit_offset, cdname, NULL, _T("/"), true, 1, 1, 0, 2048, 0, false, false, NULL, 0, 0);
- if (idx >= 0) {
- UnitInfo *ui;
- uci = &currprefs.mountconfig[nr];
- uci->configoffset = idx;
- ui = &mountinfo.ui[idx];
- ui->configureddrive = 1;
- nr++;
- }
- }
- }
- }
-#endif
+
}
// insert
uae_u32 ctime = 0;
bool emptydrive = false;
- struct uaedev_config_info *uci;
+ struct uaedev_config_info *uci = NULL;
clear_exkeys (u);
- uci = &currprefs.mountconfig[nr];
xfree (u->ui.rootdir);
ui->rootdir = u->ui.rootdir = my_strdup (u->mount_rootdir);
flush_cache (u, -1);
#ifdef RETROPLATFORM
rp_harddrive_image_change (nr, u->mount_readonly, u->mount_rootdir);
#endif
+ uci = getuci (currprefs.mountconfig, nr);
}
if (u->ui.unknown_media) {
write_log (_T("FILESYS: inserted unreadable volume NR=%d RO=%d\n"), nr, u->mount_readonly);
set_volume_name (u, ctime);
if (u->mount_flags >= 0)
ui->volflags = u->volflags = u->ui.volflags = u->mount_flags;
- _tcscpy (uci->volname, ui->volname);
- _tcscpy (uci->rootdir, u->mount_rootdir);
- if (u->mount_flags >= 0)
- uci->readonly = ui->readonly = u->ui.readonly = u->mount_readonly;
+ if (uci != NULL) {
+ _tcscpy (uci->volname, ui->volname);
+ _tcscpy (uci->rootdir, u->mount_rootdir);
+ }
+ if (u->mount_flags >= 0) {
+ ui->readonly = u->ui.readonly = u->mount_readonly;
+ if (uci != NULL)
+ uci->readonly = u->mount_readonly;
+ }
put_byte (u->volume + 44, 0);
put_byte (u->volume + 172 - 32, 1);
}
extern int inputdevice_get_widget_num (int devnum);
extern int inputdevice_get_widget_type (int devnum, int num, TCHAR *name);
-extern int input_get_default_mouse (struct uae_input_device *uid, int num, int port, int af);
-extern int input_get_default_lightpen (struct uae_input_device *uid, int num, int port, int af);
-extern int input_get_default_joystick (struct uae_input_device *uid, int num, int port, int af, int mode);
-extern int input_get_default_joystick_analog (struct uae_input_device *uid, int num, int port, int af);
+extern int input_get_default_mouse (struct uae_input_device *uid, int num, int port, int af, bool gp);
+extern int input_get_default_lightpen (struct uae_input_device *uid, int num, int port, int af, bool gp);
+extern int input_get_default_joystick (struct uae_input_device *uid, int num, int port, int af, int mode, bool gp);
+extern int input_get_default_joystick_analog (struct uae_input_device *uid, int num, int port, int af, bool gp);
extern int input_get_default_keyboard (int num);
#define DEFEVENT(A, B, C, D, E, F) INPUTEVENT_ ## A,
extern void inputdevice_compa_prepare_custom (struct uae_prefs *prefs, int index, int mode);
extern void inputdevice_compa_clear (struct uae_prefs *prefs, int index);
extern int intputdevice_compa_get_eventtype (int evt, int **axistable);
-
+extern void inputdevice_sparecopy (struct uae_input_device *uid, int num, int sub);
extern uae_u16 potgo_value;
extern uae_u16 POTGOR (void);
extern uae_u8 *restore_cd (int, uae_u8 *src);
extern void restore_cd_finish (void);
-extern uae_u8 *save_configuration (int *len);
+extern uae_u8 *save_configuration (int *len, bool fullconfig);
extern uae_u8 *restore_configuration (uae_u8 *src);
extern uae_u8 *save_log (int, int *len);
//extern uae_u8 *restore_log (uae_u8 *src);
extern int gui_message_multibutton (int flags, const TCHAR *format,...);
#define write_log_err write_log
extern void logging_init (void);
-extern FILE *log_open (const TCHAR *name, int append, int bootlog);
+extern FILE *log_open (const TCHAR *name, int append, int bootlog, TCHAR*);
extern void log_close (FILE *f);
extern size_t zfile_fwrite (const void *b, size_t l1, size_t l2, struct zfile *z);
extern TCHAR *zfile_fgets (TCHAR *s, int size, struct zfile *z);
extern char *zfile_fgetsa (char *s, int size, struct zfile *z);
-extern size_t zfile_fputs (struct zfile *z, TCHAR *s);
+extern size_t zfile_fputs (struct zfile *z, const TCHAR *s);
extern int zfile_getc (struct zfile *z);
extern int zfile_putc (int c, struct zfile *z);
extern int zfile_ferror (struct zfile *z);
static bool write_slot (TCHAR *p, struct uae_input_device *uid, int i, int j)
{
bool ok = false;
+ if (i < 0 || j < 0) {
+ _tcscpy (p, _T("NULL"));
+ return false;
+ }
uae_u64 flags = uid->flags[i][j];
if (uid->custom[i][j] && _tcslen (uid->custom[i][j]) > 0) {
_stprintf (p, _T("'%s'.%d"), uid->custom[i][j], flags & ID_FLAG_SAVE_MASK_CONFIG);
got = 0;
slotorder = slotorder1;
- // if gameports non-custom mapping in slot0 -> save slot4 as slot0
+ // if gameports non-custom mapping in slot0 -> save slot8 as slot0
if (id->port[io][0] && !(id->flags[io][0] & ID_FLAG_GAMEPORTSCUSTOM_MASK))
slotorder = slotorder2;
custom = id->custom[io][slotorder[j]];
if (custom == NULL && evt <= 0) {
for (k = j + 1; k < MAX_INPUT_SUB_EVENT; k++) {
- if (id->eventid[io][slotorder[k]] > 0 || id->custom[io][slotorder[k]] != NULL)
+ if ((id->port[io][k] == 0 || id->port[io][k] == MAX_JPORTS + 1) && (id->eventid[io][slotorder[k]] > 0 || id->custom[io][slotorder[k]] != NULL))
break;
}
if (k == MAX_INPUT_SUB_EVENT)
break;
}
- if (id->port[io][0] > 0) {
- if (!(id->flags[io][0] & ID_FLAG_GAMEPORTSCUSTOM_MASK) && id->port[io][SPARE_SUB_EVENT] == 0)
- break;
- }
if (p > tmp2) {
*p++ = ',';
bool ok = write_slot (p, id, io, slotorder[j]);
p += _tcslen (p);
if (ok) {
- if (id->port[io][slotorder[j]] > 0) {
- _stprintf (p, _T(".%d"), id->port[io][slotorder[j]] - 1);
+ if (id->port[io][slotorder[j]] > 0 && id->port[io][slotorder[j]] < MAX_JPORTS + 1) {
+ int pnum = id->port[io][slotorder[j]] - 1;
+ _stprintf (p, _T(".%d"), pnum);
p += _tcslen (p);
if (idnum != GAMEPORT_INPUT_SETTINGS && j == 0 && id->port[io][SPARE_SUB_EVENT] && slotorder == slotorder1) {
*p++ = '.';
int i;
for (i = 0; i < INPUT_QUEUE_SIZE; i++) {
iq = &input_queue[i];
- if (iq->evt == evt)
+ if (iq->evt == evt && iq->linecnt >= 0)
return i;
}
return -1;
static void queue_input_event (int evt, const TCHAR *custom, int state, int max, int linecnt, int autofire)
{
struct input_queue_struct *iq;
- int idx = check_input_queue (evt);
+ int idx;
+ if (!evt)
+ return;
+ idx = check_input_queue (evt);
if (state < 0 && idx >= 0) {
iq = &input_queue[idx];
iq->nextlinecnt = -1;
iq->evt = evt;
iq->state = iq->storedstate = state;
iq->max = max;
- iq->linecnt = linecnt;
+ iq->linecnt = linecnt < 0 ? maxvpos + maxvpos / 2 : linecnt;
iq->nextlinecnt = autofire > 0 ? linecnt : -1;
}
}
bool didcustom = false;
for (i = 0; i < MAX_INPUT_SUB_EVENT; i++) {
- uae_u64 *flagsp = &id->flags[ID_BUTTON_OFFSET + button][sublevdir[state <= 0 ? 1 : 0][i]];
- int evt = id->eventid[ID_BUTTON_OFFSET + button][sublevdir[state <= 0 ? 1 : 0][i]];
+ int sub = sublevdir[state == 0 ? 1 : 0][i];
+ uae_u64 *flagsp = &id->flags[ID_BUTTON_OFFSET + button][sub];
+ int evt = id->eventid[ID_BUTTON_OFFSET + button][sub];
+ TCHAR *custom = id->custom[ID_BUTTON_OFFSET + button][sub];
uae_u64 flags = flagsp[0];
int autofire = (flags & ID_FLAG_AUTOFIRE) ? 1 : 0;
int toggle = (flags & ID_FLAG_TOGGLE) ? 1 : 0;
if (!checkqualifiers (evt, flags, qualmask, NULL))
continue;
handle_input_event (evt, 1, 1, 0, true, false);
- queue_input_event (evt, NULL, 0, 1, 1, 0); /* send release event next frame */
didcustom |= process_custom_event (id, ID_BUTTON_OFFSET + button, state, qualmask, 0, i);
} else if (inverttoggle) {
/* pressed = firebutton, not pressed = autofire */
}
}
-static void sparerestore (struct uae_input_device *uid, int num, int sub)
+static void inputdevice_sparerestore (struct uae_input_device *uid, int num, int sub)
{
- uid->eventid[num][sub] = uid->eventid[num][SPARE_SUB_EVENT];
- uid->flags[num][sub] = uid->flags[num][SPARE_SUB_EVENT];
- uid->custom[num][sub] = uid->custom[num][SPARE_SUB_EVENT];
+ if (uid->port[num][SPARE_SUB_EVENT]) {
+ uid->eventid[num][sub] = uid->eventid[num][SPARE_SUB_EVENT];
+ uid->flags[num][sub] = uid->flags[num][SPARE_SUB_EVENT];
+ uid->custom[num][sub] = uid->custom[num][SPARE_SUB_EVENT];
+ } else {
+ uid->eventid[num][sub] = 0;
+ uid->flags[num][sub] = 0;
+ xfree (uid->custom[num][sub]);
+ uid->custom[num][sub] = 0;
+ }
uid->eventid[num][SPARE_SUB_EVENT] = 0;
uid->flags[num][SPARE_SUB_EVENT] = 0;
uid->port[num][SPARE_SUB_EVENT] = 0;
uid->custom[num][SPARE_SUB_EVENT] = 0;
}
-static void sparecopy (struct uae_input_device *uid, int num, int sub)
+void inputdevice_sparecopy (struct uae_input_device *uid, int num, int sub)
{
- uid->eventid[num][SPARE_SUB_EVENT] = uid->eventid[num][sub];
- uid->flags[num][SPARE_SUB_EVENT] = uid->flags[num][sub];
- uid->port[num][SPARE_SUB_EVENT] = MAX_JPORTS + 1;
- xfree (uid->custom[num][SPARE_SUB_EVENT]);
- uid->custom[num][SPARE_SUB_EVENT] = uid->custom[num][sub];
- uid->custom[num][sub] = NULL;
+ if (uid->port[num][SPARE_SUB_EVENT] != 0)
+ return;
+ if (uid->eventid[num][sub] <= 0 && uid->custom[num][sub] == NULL) {
+ uid->eventid[num][SPARE_SUB_EVENT] = 0;
+ uid->flags[num][SPARE_SUB_EVENT] = 0;
+ uid->port[num][SPARE_SUB_EVENT] = 0;
+ xfree (uid->custom[num][SPARE_SUB_EVENT]);
+ uid->custom[num][SPARE_SUB_EVENT] = NULL;
+ } else {
+ uid->eventid[num][SPARE_SUB_EVENT] = uid->eventid[num][sub];
+ uid->flags[num][SPARE_SUB_EVENT] = uid->flags[num][sub];
+ uid->port[num][SPARE_SUB_EVENT] = MAX_JPORTS + 1;
+ xfree (uid->custom[num][SPARE_SUB_EVENT]);
+ uid->custom[num][SPARE_SUB_EVENT] = uid->custom[num][sub];
+ uid->custom[num][sub] = NULL;
+ }
}
static void setcompakb (int *kb, int *srcmap, int index, int af)
struct uae_input_device *uid = &keyboards[m];
for (int l = 0; l < MAX_INPUT_DEVICE_EVENTS; l++) {
if (uid->extra[l] == id) {
- sparecopy (uid, l, 0);
+ inputdevice_sparecopy (uid, l, 0);
uid->eventid[l][0] = srcmap[k];
uid->flags[l][0] = 0;
uid->port[l][0] = index + 1;
uid[num].custom[i][j] = NULL;
uid[num].port[i][j] = 0;
if (uid[num].port[i][SPARE_SUB_EVENT])
- sparerestore (&uid[num], i, j);
+ inputdevice_sparerestore (&uid[num], i, j);
}
}
}
uid[num].custom[i][j] = NULL;
uid[num].port[i][j] = 0;
if (uid[num].port[i][SPARE_SUB_EVENT]) {
- sparerestore (&uid[num], i, j);
+ inputdevice_sparerestore (&uid[num], i, j);
} else if (j == 0) {
set_kbr_default_event (&uid[num], keyboard_default, i);
}
static void cleardev (struct uae_input_device *uid, int num)
{
for (int i = 0; i < MAX_INPUT_DEVICE_EVENTS; i++) {
+ inputdevice_sparecopy (&uid[num], i, 0);
for (int j = 0; j < MAX_INPUT_SUB_EVENT; j++) {
uid[num].eventid[i][j] = 0;
uid[num].flags[i][j] = 0;
case JSEM_MODE_DEFAULT:
case JSEM_MODE_MOUSE:
default:
- input_get_default_mouse (mice, joy, i, af);
+ input_get_default_mouse (mice, joy, i, af, !gameports);
joymodes[i] = JSEM_MODE_MOUSE;
break;
case JSEM_MODE_LIGHTPEN:
- input_get_default_lightpen (mice, joy, i, af);
+ input_get_default_lightpen (mice, joy, i, af, !gameports);
joymodes[i] = JSEM_MODE_LIGHTPEN;
break;
}
default:
{
bool iscd32 = mode == JSEM_MODE_JOYSTICK_CD32 || (mode == JSEM_MODE_DEFAULT && prefs->cs_cd32cd);
- input_get_default_joystick (joysticks, joy, i, af, mode);
+ input_get_default_joystick (joysticks, joy, i, af, mode, !gameports);
if (iscd32)
joymodes[i] = JSEM_MODE_JOYSTICK_CD32;
else if (mode == JSEM_MODE_GAMEPAD)
break;
}
case JSEM_MODE_JOYSTICK_ANALOG:
- input_get_default_joystick_analog (joysticks, joy, i, af);
+ input_get_default_joystick_analog (joysticks, joy, i, af, !gameports);
joymodes[i] = JSEM_MODE_JOYSTICK_ANALOG;
break;
case JSEM_MODE_MOUSE:
- input_get_default_mouse (joysticks, joy, i, af);
+ input_get_default_mouse (joysticks, joy, i, af, !gameports);
joymodes[i] = JSEM_MODE_MOUSE;
break;
case JSEM_MODE_LIGHTPEN:
- input_get_default_lightpen (joysticks, joy, i, af);
+ input_get_default_lightpen (joysticks, joy, i, af, !gameports);
joymodes[i] = JSEM_MODE_LIGHTPEN;
break;
case JSEM_MODE_MOUSE_CDTV:
joymodes[i] = JSEM_MODE_MOUSE_CDTV;
- input_get_default_joystick (joysticks, joy, i, af, mode);
+ input_get_default_joystick (joysticks, joy, i, af, mode, !gameports);
break;
}
if (joy >= 0) {
if (gameports)
cleardev (joysticks, joy);
- input_get_default_joystick (joysticks, joy, i, af, 0);
+ input_get_default_joystick (joysticks, joy, i, af, 0, !gameports);
_tcsncpy (prefs->jports[i].name, idev[IDTYPE_JOYSTICK].get_friendlyname (joy), MAX_JPORTNAME - 1);
_tcsncpy (prefs->jports[i].configname, idev[IDTYPE_JOYSTICK].get_uniquename (joy), MAX_JPORTNAME - 1);
used[joy] = 1;
struct inode *inode;
struct inode *old = NULL, *prev = NULL;
+ if (!sb)
+ return;
inode = sb->inodes;
while (inode) {
if (inode->i_ino == uniq) {
uaecptr a2 = a - 32;
uaecptr a3 = m68k_getpc () - 32;
write_log (_T("Your Amiga program just did something terribly stupid %08X PC=%08X\n"), a, M68K_GETPC);
-#if DEBUG_STUPID
- activate_debugger();
-#endif
+ if (debugging || DEBUG_STUPID)
+ activate_debugger ();
m68k_dumpstate (0, 0);
for (i = 0; i < 10; i++) {
write_log (_T("%08X "), i >= 5 ? a3 : a2);
static bool rawinput_decided;
static bool rawhid_found;
-static uae_s16 axisold[MAX_INPUT_DEVICES][256];
+static uae_s16 axisold[MAX_INPUT_DEVICES][256], buttonold[MAX_INPUT_DEVICES][256];
int no_rawinput = 0;
int no_directinput = 0;
//write_log (_T("%d %d: %d->%d\n"), num, axisnum, axisold[num][axisnum], data);
axisold[num][axisnum] = data;
int bstate = -1;
+ int bstate2 = 0;
for (j = 0; j < did->buttons; j++) {
if (did->buttonaxisparent[j] >= 0 && did->buttonmappings[j] == usage) {
- if (did->buttonaxisparentdir[j] == 0 && data < -digitalrange)
+ if (did->buttonaxisparentdir[j] == 0 && data < -digitalrange) {
bstate = j;
- else if (did->buttonaxisparentdir[j] && data > digitalrange)
+ bstate2 = 1;
+ } else if (did->buttonaxisparentdir[j] && data > digitalrange) {
bstate = j;
+ bstate2 = 1;
+ } else if (data > - digitalrange && data < digitalrange) {
+ bstate = j;
+ bstate2 = 0;
+ }
+ //write_log (_T("%d %d %d\n"), num, bstate, bstate2);
+ if (bstate >= 0 && buttonold[num][bstate] != bstate2) {
+ buttonold[num][bstate] = bstate2;
+ setjoybuttonstate (num, bstate, bstate2);
+ }
}
}
setjoystickstate (num, axisnum, data, logicalrange);
- if (bstate >= 0)
- setjoybuttonstate (num, bstate, -1);
}
}
}
}
}
-static void setid (struct uae_input_device *uid, int i, int slot, int sub, int port, int evt)
+static void setid (struct uae_input_device *uid, int i, int slot, int sub, int port, int evt, bool gp)
{
- // wrong place!
- uid->eventid[slot][SPARE_SUB_EVENT] = uid->eventid[slot][sub];
- uid->flags[slot][SPARE_SUB_EVENT] = uid->flags[slot][sub];
- uid->port[slot][SPARE_SUB_EVENT] = MAX_JPORTS + 1;
- xfree (uid->custom[slot][SPARE_SUB_EVENT]);
- uid->custom[slot][SPARE_SUB_EVENT] = uid->custom[slot][sub];
- uid->custom[slot][sub] = NULL;
-
+ if (gp)
+ inputdevice_sparecopy (&uid[i], slot, 0);
uid[i].eventid[slot][sub] = evt;
uid[i].port[slot][sub] = port + 1;
}
-static void setid (struct uae_input_device *uid, int i, int slot, int sub, int port, int evt, int af)
+static void setid (struct uae_input_device *uid, int i, int slot, int sub, int port, int evt, int af, bool gp)
{
- setid (uid, i, slot, sub, port, evt);
+ setid (uid, i, slot, sub, port, evt, gp);
uid[i].flags[slot][sub] &= ~ID_FLAG_AUTOFIRE_MASK;
if (af >= JPORT_AF_NORMAL)
uid[i].flags[slot][sub] |= ID_FLAG_AUTOFIRE;
uid[i].flags[slot][sub] |= ID_FLAG_INVERTTOGGLE;
}
-int input_get_default_mouse (struct uae_input_device *uid, int i, int port, int af)
+int input_get_default_mouse (struct uae_input_device *uid, int i, int port, int af, bool gp)
{
struct didata *did;
if (i >= num_mouse)
return 0;
did = &di_mouse[i];
- setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, port ? INPUTEVENT_MOUSE2_HORIZ : INPUTEVENT_MOUSE1_HORIZ);
- setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, port ? INPUTEVENT_MOUSE2_VERT : INPUTEVENT_MOUSE1_VERT);
- setid (uid, i, ID_AXIS_OFFSET + 2, 0, port, port ? 0 : INPUTEVENT_MOUSE1_WHEEL);
- setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af);
- setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON);
- setid (uid, i, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON);
+ setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, port ? INPUTEVENT_MOUSE2_HORIZ : INPUTEVENT_MOUSE1_HORIZ, gp);
+ setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, port ? INPUTEVENT_MOUSE2_VERT : INPUTEVENT_MOUSE1_VERT, gp);
+ setid (uid, i, ID_AXIS_OFFSET + 2, 0, port, port ? 0 : INPUTEVENT_MOUSE1_WHEEL, gp);
+ setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af, gp);
+ setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON, gp);
+ setid (uid, i, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON, gp);
if (port == 0) { /* map back and forward to ALT+LCUR and ALT+RCUR */
if (isrealbutton (did, 3)) {
- setid (uid, i, ID_BUTTON_OFFSET + 3, 0, port, INPUTEVENT_KEY_ALT_LEFT);
- setid (uid, i, ID_BUTTON_OFFSET + 3, 1, port, INPUTEVENT_KEY_CURSOR_LEFT);
+ setid (uid, i, ID_BUTTON_OFFSET + 3, 0, port, INPUTEVENT_KEY_ALT_LEFT, gp);
+ setid (uid, i, ID_BUTTON_OFFSET + 3, 1, port, INPUTEVENT_KEY_CURSOR_LEFT, gp);
if (isrealbutton (did, 4)) {
- setid (uid, i, ID_BUTTON_OFFSET + 4, 0, port, INPUTEVENT_KEY_ALT_LEFT);
- setid (uid, i, ID_BUTTON_OFFSET + 4, 1, port, INPUTEVENT_KEY_CURSOR_RIGHT);
+ setid (uid, i, ID_BUTTON_OFFSET + 4, 0, port, INPUTEVENT_KEY_ALT_LEFT, gp);
+ setid (uid, i, ID_BUTTON_OFFSET + 4, 1, port, INPUTEVENT_KEY_CURSOR_RIGHT, gp);
}
}
}
return 0;
}
-int input_get_default_lightpen (struct uae_input_device *uid, int i, int port, int af)
+int input_get_default_lightpen (struct uae_input_device *uid, int i, int port, int af, bool gp)
{
struct didata *did;
if (i >= num_mouse)
return 0;
did = &di_mouse[i];
- setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, INPUTEVENT_LIGHTPEN_HORIZ);
- setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, INPUTEVENT_LIGHTPEN_VERT);
- setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON);
+ setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, INPUTEVENT_LIGHTPEN_HORIZ, gp);
+ setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, INPUTEVENT_LIGHTPEN_VERT, gp);
+ setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON, gp);
if (i == 0)
return 1;
return 0;
}
-int input_get_default_joystick (struct uae_input_device *uid, int i, int port, int af, int mode)
+int input_get_default_joystick (struct uae_input_device *uid, int i, int port, int af, int mode, bool gp)
{
int j;
struct didata *did;
h = port ? INPUTEVENT_JOY2_HORIZ : INPUTEVENT_JOY1_HORIZ;;
v = port ? INPUTEVENT_JOY2_VERT : INPUTEVENT_JOY1_VERT;
}
- setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, h);
- setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, v);
+ setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, h, gp);
+ setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, v, gp);
if (port >= 2) {
- setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port == 3 ? INPUTEVENT_PAR_JOY2_FIRE_BUTTON : INPUTEVENT_PAR_JOY1_FIRE_BUTTON, af);
+ setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port == 3 ? INPUTEVENT_PAR_JOY2_FIRE_BUTTON : INPUTEVENT_PAR_JOY1_FIRE_BUTTON, af, gp);
} else {
- setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af);
+ setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af, gp);
if (isrealbutton (did, 1))
- setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON);
+ setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON, gp);
if (isrealbutton (did, 2))
- setid (uid, i, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON);
+ setid (uid, i, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON, gp);
}
for (j = 2; j < MAX_MAPPINGS - 1; j++) {
int type = did->axistype[j];
if (type == AXISTYPE_POV_X) {
- setid (uid, i, ID_AXIS_OFFSET + j + 0, 0, port, h);
- setid (uid, i, ID_AXIS_OFFSET + j + 1, 0, port, v);
+ setid (uid, i, ID_AXIS_OFFSET + j + 0, 0, port, h, gp);
+ setid (uid, i, ID_AXIS_OFFSET + j + 1, 0, port, v, gp);
j++;
}
}
if (mode == JSEM_MODE_JOYSTICK_CD32) {
- setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_CD32_RED : INPUTEVENT_JOY1_CD32_RED, af);
- setid (uid, i, ID_BUTTON_OFFSET + 0, 1, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af);
+ setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_CD32_RED : INPUTEVENT_JOY1_CD32_RED, af, gp);
if (isrealbutton (did, 1)) {
- setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_CD32_BLUE : INPUTEVENT_JOY1_CD32_BLUE);
- setid (uid, i, ID_BUTTON_OFFSET + 1, 1, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON);
+ setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_CD32_BLUE : INPUTEVENT_JOY1_CD32_BLUE, gp);
}
if (isrealbutton (did, 2))
- setid (uid, i, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_CD32_GREEN : INPUTEVENT_JOY1_CD32_GREEN);
+ setid (uid, i, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_CD32_GREEN : INPUTEVENT_JOY1_CD32_GREEN, gp);
if (isrealbutton (did, 3))
- setid (uid, i, ID_BUTTON_OFFSET + 3, 0, port, port ? INPUTEVENT_JOY2_CD32_YELLOW : INPUTEVENT_JOY1_CD32_YELLOW);
+ setid (uid, i, ID_BUTTON_OFFSET + 3, 0, port, port ? INPUTEVENT_JOY2_CD32_YELLOW : INPUTEVENT_JOY1_CD32_YELLOW, gp);
if (isrealbutton (did, 4))
- setid (uid, i, ID_BUTTON_OFFSET + 4, 0, port, port ? INPUTEVENT_JOY2_CD32_RWD : INPUTEVENT_JOY1_CD32_RWD);
+ setid (uid, i, ID_BUTTON_OFFSET + 4, 0, port, port ? INPUTEVENT_JOY2_CD32_RWD : INPUTEVENT_JOY1_CD32_RWD, gp);
if (isrealbutton (did, 5))
- setid (uid, i, ID_BUTTON_OFFSET + 5, 0, port, port ? INPUTEVENT_JOY2_CD32_FFW : INPUTEVENT_JOY1_CD32_FFW);
+ setid (uid, i, ID_BUTTON_OFFSET + 5, 0, port, port ? INPUTEVENT_JOY2_CD32_FFW : INPUTEVENT_JOY1_CD32_FFW, gp);
if (isrealbutton (did, 6))
- setid (uid, i, ID_BUTTON_OFFSET + 6, 0, port, port ? INPUTEVENT_JOY2_CD32_PLAY : INPUTEVENT_JOY1_CD32_PLAY);
+ setid (uid, i, ID_BUTTON_OFFSET + 6, 0, port, port ? INPUTEVENT_JOY2_CD32_PLAY : INPUTEVENT_JOY1_CD32_PLAY, gp);
}
if (i == 0)
return 1;
return 0;
}
-int input_get_default_joystick_analog (struct uae_input_device *uid, int i, int port, int af)
+int input_get_default_joystick_analog (struct uae_input_device *uid, int i, int port, int af, bool gp)
{
int j;
struct didata *did;
if (i >= num_joystick)
return 0;
did = &di_joystick[i];
- setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_HORIZ_POT : INPUTEVENT_JOY1_HORIZ_POT);
- setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_VERT_POT : INPUTEVENT_JOY1_VERT_POT);
- setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_LEFT : INPUTEVENT_JOY1_LEFT, af);
+ setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_HORIZ_POT : INPUTEVENT_JOY1_HORIZ_POT, gp);
+ setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_VERT_POT : INPUTEVENT_JOY1_VERT_POT, gp);
+ setid (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_LEFT : INPUTEVENT_JOY1_LEFT, af, gp);
if (isrealbutton (did, 1))
- setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_RIGHT : INPUTEVENT_JOY1_RIGHT);
+ setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_RIGHT : INPUTEVENT_JOY1_RIGHT, gp);
if (isrealbutton (did, 2))
- setid (uid, i, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_UP : INPUTEVENT_JOY1_UP);
+ setid (uid, i, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_UP : INPUTEVENT_JOY1_UP, gp);
if (isrealbutton (did, 3))
- setid (uid, i, ID_BUTTON_OFFSET + 3, 0, port, port ? INPUTEVENT_JOY2_DOWN : INPUTEVENT_JOY1_DOWN);
+ setid (uid, i, ID_BUTTON_OFFSET + 3, 0, port, port ? INPUTEVENT_JOY2_DOWN : INPUTEVENT_JOY1_DOWN, gp);
for (j = 2; j < MAX_MAPPINGS - 1; j++) {
int type = did->axistype[j];
if (type == AXISTYPE_POV_X) {
- setid (uid, i, ID_AXIS_OFFSET + j + 0, 0, port, port ? INPUTEVENT_JOY2_HORIZ_POT : INPUTEVENT_JOY1_HORIZ_POT);
- setid (uid, i, ID_AXIS_OFFSET + j + 1, 0, port, port ? INPUTEVENT_JOY2_VERT_POT : INPUTEVENT_JOY1_VERT_POT);
+ setid (uid, i, ID_AXIS_OFFSET + j + 0, 0, port, port ? INPUTEVENT_JOY2_HORIZ_POT : INPUTEVENT_JOY1_HORIZ_POT, gp);
+ setid (uid, i, ID_AXIS_OFFSET + j + 1, 0, port, port ? INPUTEVENT_JOY2_VERT_POT : INPUTEVENT_JOY1_VERT_POT, gp);
j++;
}
}
static float maskmult_x, maskmult_y;
RECT mask2rect;
static bool wasstilldrawing_broken;
+static bool renderdisabled;
static HANDLE filenotificationhandle;
static bool fakemode;
static int isd3d (void)
{
- if (fakemode || devicelost || !d3ddev || !d3d_enabled)
+ if (fakemode || devicelost || !d3ddev || !d3d_enabled || renderdisabled)
return 0;
return 1;
}
_tcscpy (tmp3, tmp);
_tcscat (tmp, shaderfile);
if (!full) {
- struct zfile *z = zfile_fopen (tmp, _T("r"), 0);
+ struct zfile *z = zfile_fopen (tmp, _T("r"));
if (z) {
existsfile = 1;
zfile_fgets (tmp2, sizeof tmp2 / sizeof (TCHAR), z);
const char *str = psEnabled ? fx20 : fx10;
int len = strlen (str);
if (!existsfile && plugin_path) {
- struct zfile *z = zfile_fopen (tmp, _T("w"), 0);
+ struct zfile *z = zfile_fopen (tmp, _T("w"));
if (z) {
zfile_fwrite ((void*)str, len, 1, z);
zfile_fclose (z);
sw = dw * tin_w / window_w;
sh = dh * tin_h / window_h;
- //sw -= 0.5f;
- //sh += 0.5f;
+ sw -= 0.5f;
+ sh += 0.5f;
tx += xshift;
ty += yshift;
}
-
MatrixTranslation (&m_matView, tx, ty, 1.0f);
MatrixScaling (&m_matWorld, sw, sh, 1.0f);
float sw2 = dw * tin_w / window_w;
float sh2 = dh * tin_h / window_h;
+ sw2 -= 0.5f;
+ sh2 += 0.5f;
+
maskmult.x = sw2 * maskmult_x / w;
maskmult.y = sh2 * maskmult_y / h;
}
}
+static void getswapchain (void)
+{
+ if (!d3dswapchain) {
+ HRESULT hr = d3ddev->GetSwapChain (0, &d3dswapchain);
+ if (FAILED (hr)) {
+ write_log (_T("%s: GetSwapChain() failed, %s\n"), D3DHEAD, D3D_ErrorString (hr));
+ }
+ }
+}
+
static void invalidatedeviceobjects (void)
{
if (filenotificationhandle != NULL)
vertexBuffer->Release ();
vertexBuffer = NULL;
}
+ if (d3dswapchain) {
+ d3dswapchain->Release ();
+ d3dswapchain = NULL;
+ }
m_MatWorldEffectHandle = NULL;
m_MatViewEffectHandle = NULL;
m_MatProjEffectHandle = NULL;
HRESULT hr;
invalidatedeviceobjects ();
+ getswapchain ();
+
while (shaderon > 0) {
postEffect = psEffect_LoadEffect (psEnabled ? _T("_winuae.fx") : _T("_winuae_old.fx"), false);
if (!postEffect) {
static void D3D_free2 (void)
{
invalidatedeviceobjects ();
- if (d3dswapchain) {
- d3dswapchain->Release ();
- d3dswapchain = NULL;
- }
if (d3ddev) {
d3ddev->Release ();
d3ddev = NULL;
psActive = 0;
resetcount = 0;
devicelost = 0;
+ renderdisabled = false;
changed_prefs.leds_on_screen = currprefs.leds_on_screen = currprefs.leds_on_screen & ~STATUSLINE_TARGET;
}
t_depth, adapter
);
- if ((d3dCaps.PixelShaderVersion < D3DPS_VERSION(2,0) || !psEnabled || max_texture_w < 2048 || max_texture_h < 2048 || !shaderon) && d3d_ex) {
+ if ((d3dCaps.PixelShaderVersion < D3DPS_VERSION(2,0) || !psEnabled || max_texture_w < 2048 || max_texture_h < 2048 || (!shaderon && SHADER > 0)) && d3d_ex) {
D3DEX = 0;
write_log (_T("Disabling D3D9Ex\n"));
if (d3ddev) {
changed_prefs.gfx_filter_scanlines = currprefs.gfx_filter_scanlines = 0;
}
- hr = d3ddev->GetSwapChain (0, &d3dswapchain);
- if (FAILED (hr)) {
- write_log (_T("%s: GetSwapChain() failed, %s\n"), D3DHEAD, D3D_ErrorString (hr));
- }
-
switch (depth)
{
case 32:
if (d3ddevex) {
UINT v = 12345;
hr = d3ddevex->GetMaximumFrameLatency (&v);
- //write_log (L"GetMaximumFrameLatency=%d\n", v);
if (FAILED (hr)) {
write_log (_T("%s: GetMaximumFrameLatency() failed: %s\n"), D3DHEAD, D3D_ErrorString (hr));
v = 1;
hr = d3ddevex->SetMaximumFrameLatency (vsync ? 1 : 0);
if (FAILED (hr))
write_log (_T("%s: SetMaximumFrameLatency() failed: %s\n"), D3DHEAD, D3D_ErrorString (hr));
- //v = 12345;
- //hr = d3ddevex->GetMaximumFrameLatency (&v);
- //write_log (L"GetMaximumFrameLatency=%d\n", v);
}
return 0;
}
+static bool alloctextures (void)
+{
+ if (!createtexture (tout_w, tout_h, window_w, window_h))
+ return false;
+ if (!createamigatexture (tin_w, tin_h))
+ return false;
+ return true;
+}
+
bool D3D_alloctexture (int w, int h)
{
tin_w = w * mult;
changed_prefs.leds_on_screen = currprefs.leds_on_screen = currprefs.leds_on_screen | STATUSLINE_TARGET;
freetextures ();
-
- if (!createtexture (tout_w, tout_h, window_w, window_h))
- return false;
- if (!createamigatexture (tin_w, tin_h))
- return false;
- return true;
+ return alloctextures ();
}
+
static HRESULT reset (void)
{
+ HRESULT hr;
+ bool oldrender = renderdisabled;
+ renderdisabled = true;
if (d3dex)
- return d3ddevex->ResetEx (&dpp, dpp.Windowed ? NULL : &modeex);
+ hr = d3ddevex->ResetEx (&dpp, dpp.Windowed ? NULL : &modeex);
else
- return d3ddev->Reset (&dpp);
+ hr = d3ddev->Reset (&dpp);
+ renderdisabled = oldrender;
+ return hr;
}
-int D3D_needreset (void)
+static int D3D_needreset (void)
{
HRESULT hr;
bool do_dd = false;
hr = d3ddevex->CheckDeviceState (d3dhwnd);
else
hr = d3ddev->TestCooperativeLevel ();
- if (hr == S_PRESENT_OCCLUDED)
- return 0;
- if (hr == D3DERR_DEVICENOTRESET || hr == D3DERR_DEVICELOST) {
- write_log (_T("%s: %s\n"), D3DHEAD, hr == D3DERR_DEVICENOTRESET ? _T("DEVICENOTRESET"): _T("DEVICELOST"));
+ if (hr == S_PRESENT_OCCLUDED) {
+ // no need to draw anything
+ return 1;
+ }
+ if (hr == D3DERR_DEVICELOST) {
+ renderdisabled = true;
+ // lost but can't be reset yet
+ return 1;
+ }
+ if (hr == D3DERR_DEVICENOTRESET) {
+ // lost and can be reset
+ write_log (_T("%s: DEVICENOTRESET\n"), D3DHEAD);
devicelost = 2;
invalidatedeviceobjects ();
+ freetextures ();
hr = reset ();
if (FAILED (hr)) {
write_log (_T("%s: Reset failed %s\n"), D3DHEAD, D3D_ErrorString (hr));
}
devicelost = 0;
write_log (_T("%s: Reset succeeded\n"), D3DHEAD);
+ renderdisabled = false;
restoredeviceobjects ();
+ alloctextures ();
return -1;
} else if (hr == S_PRESENT_MODE_CHANGED) {
write_log (_T("%s: S_PRESENT_MODE_CHANGED (%d,%d)\n"), D3DHEAD, ddraw_fs, ddraw_fs_attempt);
sleep_millis (1);
continue;
} else if (hr == S_PRESENT_OCCLUDED) {
- ; //write_log (_T("S_PRESENT_OCCLUDED\n"));
+ renderdisabled = true;
} else if (hr == S_PRESENT_MODE_CHANGED) {
// In most cases mode actually didn't change but
// D3D is just being stupid and not accepting
write_log (_T("%s: Present() %s\n"), D3DHEAD, D3D_ErrorString (hr));
if (hr == D3DERR_DEVICELOST || hr == S_PRESENT_MODE_CHANGED) {
devicelost = 1;
+ renderdisabled = true;
+ write_log (_T("%s: mode changed or fullscreen focus lost\n"), D3DHEAD);
}
} else {
ddraw_fs_attempt = 0;
}
}
+void D3D_restore (void)
+{
+ renderdisabled = false;
+}
+
void D3D_clear (void)
{
int i;
void D3D_flushtexture (int miny, int maxy)
{
- if (fakemode || fulllocked || !texture)
+ if (fakemode || fulllocked || !texture || renderdisabled)
return;
if (miny >= 0 && maxy >= 0) {
RECT r;
return fakebitmap;
}
- if (D3D_needreset () > 0)
+ if (D3D_needreset () > 0) {
return NULL;
+ }
if (!isd3d () || !texture)
return NULL;
{
HRESULT hr;
D3DDISPLAYMODE dmode;
+
if (!isd3d ())
return -1;
hr = d3ddev->GetDisplayMode (0, &dmode);
void D3D_guimode (bool guion)
{
HRESULT hr;
+
if (!isd3d ())
return;
hr = d3ddev->SetDialogBoxMode (guion ? TRUE : FALSE);
extern void D3D_guimode (bool);
extern HDC D3D_getDC(HDC hdc);
extern int D3D_isenabled (void);
-extern int D3D_needreset (void);
extern void D3D_clear (void);
extern int D3D_canshaders (void);
extern int D3D_goodenough (void);
extern bool D3D_getvblankpos (int *vpos);
extern double D3D_getrefreshrate (void);
extern void D3D_vblank_reset (double freq);
+extern void D3D_restore (void);
extern LPDIRECT3DTEXTURE9 cursorsurfaced3d;
#define CURSORMAXWIDTH 64
}
if (hfd->handle_valid || hfd->drive_empty) {
hfd_log (_T("HDF '%s' %p opened, size=%dK mode=%d empty=%d\n"),
- name, hfd, hfd->physsize / 1024, hfd->handle_valid, hfd->drive_empty);
+ name, hfd, (int)(hfd->physsize / 1024), hfd->handle_valid, hfd->drive_empty);
return 1;
}
end:
xfree (tmp);
return ret;
} else {
- DWORD size2 = *size;
+ DWORD size2 = *size * sizeof (TCHAR);
HKEY rk = gr (root);
if (!rk)
return 0;
int v = RegQueryValueEx (rk, name, 0, NULL, (LPBYTE)str, &size2) == ERROR_SUCCESS;
- *size = size2;
+ *size = size2 / sizeof (TCHAR);
return v;
}
}
#define IDC_DF1QQ 1680
#define IDC_PATHS_RIPS 1680
#define IDC_QUICKSTART_SETCONFIG 1681
+#define IDC_LOGOPEN 1681
#define IDC_CONFIGAUTO 1682
#define IDC_CD0Q_TYPE 1682
#define IDC_DF0TEXTQ 1683
#define IDC_CONFIGNOLINK 1683
#define IDC_DF0WPQ 1684
+#define IDC_LOGOPEN2 1684
+#define IDC_LOGSAVE 1684
#define IDC_EJECT0Q 1685
#define IDC_DF1WPQ 1686
#define IDC_EJECT1Q 1687
#define IDC_PATHS_DEFAULTTYPE 1704
#define IDC_SCSIMODE 1705
#define IDC_PROGRESSBAR 1705
+#define IDC_LOGSELECT 1705
#define IDC_PROGRESSBAR_TEXT 1706
#define IDC_LANGUAGE 1706
#define IDC_CREATE_NAME 1707
#define IDC_PORT_TABLET_FULL 1790
#define IDC_CPU_MULTIPLIER 1790
#define IDC_CPU_FREQUENCY2 1790
+#define IDC_LOGENABLE 1790
#define IDC_DD_SURFACETYPE 1791
#define IDC_RTG_SCALE_ALLOW 1791
#define IDC_CPU_FREQUENCY 1791
#define IDC_STATENAME 1811
#define IDC_SAMPLER_STEREO 1812
#define IDC_LISTDIALOG_LIST 1813
+#define IDC_LOGPATH 1814
#define ID__FLOPPYDRIVES 40004
#define ID_FLOPPYDRIVES_DF0 40005
#define ID_ST_CONFIGURATION 40010
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 387
#define _APS_NEXT_COMMAND_VALUE 40050
-#define _APS_NEXT_CONTROL_VALUE 1814
+#define _APS_NEXT_CONTROL_VALUE 1815
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
CONTROL "Remove interlace artifacts",IDC_FLICKERFIXER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,154,142,10\r
CONTROL "Filtered low resolution",IDC_LORES_SMOOTHED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,140,116,10\r
CONTROL "Resolution autoswitch",IDC_AUTORESOLUTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,154,116,10\r
- RTEXT "Resolution:",IDC_STATIC,27,170,110,10,SS_CENTERIMAGE\r
+ RTEXT "Resolution:",IDC_STATIC,27,170,110,8,SS_CENTERIMAGE\r
COMBOBOX IDC_LORES,142,169,127,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
RTEXT "Refresh:",IDC_REFRESHTEXT,11,190,57,8\r
CONTROL "Slider1",IDC_FRAMERATE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,71,185,99,20\r
EDITTEXT IDC_FLOPPYSPDTEXT,222,183,101,12,ES_CENTER | ES_READONLY\r
GROUPBOX "New Floppy Disk Image",IDC_SETTINGSTEXT,1,211,393,49\r
COMBOBOX IDC_FLOPPYTYPE,58,225,64,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- PUSHBUTTON "Create Standard Disk [] Creates a standard 880 or 1760 KB ADF disk image.",IDC_CREATE,131,224,97,15\r
+ PUSHBUTTON "Create Standard Disk [] Creates a standard 880 or 1760 KB ADF disk image.",IDC_CREATE,130,224,97,15\r
PUSHBUTTON "Create Custom Disk [] Creates a low level (MFM) ADF disk image (about 2MB). Useful for programs that use non-standard disk formats (for example some save disks or DOS-formatted floppies)",IDC_CREATE_RAW,235,224,101,15\r
RTEXT "Disk label:",IDC_STATIC,60,244,58,10,SS_CENTERIMAGE\r
EDITTEXT IDC_CREATE_NAME,130,243,97,13,ES_AUTOHSCROLL\r
- CONTROL "Bootblock",IDC_FLOPPY_BOOTABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,234,242,59,15\r
+ CONTROL "Bootblock",IDC_FLOPPY_BOOTABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,235,242,59,15\r
CONTROL "FFS",IDC_FLOPPY_FFS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,300,242,34,15\r
END\r
\r
FONT 8, "MS Sans Serif", 0, 0, 0x1\r
BEGIN\r
GROUPBOX "Parallel Port",IDC_STATIC,1,1,393,131\r
- RTEXT "Printer:",IDC_STATIC,6,17,57,15,SS_CENTERIMAGE\r
- COMBOBOX IDC_PRINTERLIST,67,18,317,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- RTEXT "Type:",IDC_STATIC,7,39,57,15,SS_CENTERIMAGE\r
- COMBOBOX IDC_PRINTERTYPELIST,67,40,317,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- PUSHBUTTON "Flush print job",IDC_FLUSHPRINTER,147,57,58,12\r
- RTEXT "Autoflush [] Time in seconds after a pending print job is automatically flushed.",IDC_PRINTERAUTOFLUSHTXT,209,55,137,15,SS_NOTIFY | SS_CENTERIMAGE\r
- EDITTEXT IDC_PRINTERAUTOFLUSH,351,57,33,12,ES_NUMBER\r
- RTEXT "Ghostscript extra parameters:",IDC_STATIC,8,73,136,15,SS_CENTERIMAGE\r
- EDITTEXT IDC_PS_PARAMS,148,74,236,12,ES_AUTOHSCROLL\r
+ RTEXT "Printer:",IDC_STATIC,6,16,57,15,SS_CENTERIMAGE\r
+ COMBOBOX IDC_PRINTERLIST,67,17,317,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ RTEXT "Type:",IDC_STATIC,7,38,57,15,SS_CENTERIMAGE\r
+ COMBOBOX IDC_PRINTERTYPELIST,67,39,317,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ PUSHBUTTON "Flush print job",IDC_FLUSHPRINTER,147,58,75,12\r
+ RTEXT "Autoflush [] Time in seconds after a pending print job is automatically flushed.",IDC_PRINTERAUTOFLUSHTXT,236,56,110,15,SS_NOTIFY | SS_CENTERIMAGE\r
+ EDITTEXT IDC_PRINTERAUTOFLUSH,351,58,33,12,ES_NUMBER\r
+ RTEXT "Ghostscript extra parameters:",IDC_STATIC,8,74,136,15,SS_CENTERIMAGE\r
+ EDITTEXT IDC_PS_PARAMS,148,75,236,12,ES_AUTOHSCROLL\r
RTEXT "Sampler:",IDC_STATIC,6,94,57,15,SS_CENTERIMAGE\r
COMBOBOX IDC_SAMPLERLIST,67,95,317,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- CONTROL "Stereo sampler",IDC_SAMPLER_STEREO,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,68,113,149,12\r
+ CONTROL "Stereo sampler",IDC_SAMPLER_STEREO,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,68,114,149,12\r
GROUPBOX "Serial Port",IDC_STATIC,1,137,393,51\r
COMBOBOX IDC_SERIAL,67,150,317,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
CONTROL "Shared",IDC_SER_SHARED,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,32,171,66,12\r
GROUPBOX "Mouse and Joystick settings",IDC_STATIC,1,3,393,211\r
RTEXT "Port 1:",IDC_STATIC,4,18,37,15,SS_CENTERIMAGE\r
COMBOBOX IDC_PORT0_JOYS,45,19,342,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- COMBOBOX IDC_PORT0_AF,45,37,78,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- COMBOBOX IDC_PORT0_JOYSMODE,128,38,106,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_PORT0_AF,45,37,86,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_PORT0_JOYSMODE,136,38,106,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
PUSHBUTTON "Test [] Test Port 1 (mouse) configuration.",IDC_PORT0_TEST,313,37,36,14\r
PUSHBUTTON "Remap [] Remap Port 1 configurarion.",IDC_PORT0_REMAP,352,37,36,14\r
RTEXT "Port 2:",IDC_STATIC,6,56,35,15,SS_CENTERIMAGE\r
COMBOBOX IDC_PORT1_JOYS,45,57,342,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- COMBOBOX IDC_PORT1_AF,45,74,78,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- COMBOBOX IDC_PORT1_JOYSMODE,128,74,106,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_PORT1_AF,45,74,86,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_PORT1_JOYSMODE,136,74,106,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
PUSHBUTTON "Test [] Test Port 2 (joystick) configuration.",IDC_PORT1_TEST,313,74,36,14\r
PUSHBUTTON "Remap [] Remap Port 2 configuration.",IDC_PORT1_REMAP,352,74,36,14\r
- PUSHBUTTON "Swap ports [] Swap ports 1 and 2.",IDC_SWAP,45,100,78,12\r
+ PUSHBUTTON "Swap ports [] Swap ports 1 and 2.",IDC_SWAP,45,100,78,14\r
LTEXT "Emulated parallel port joystick adapter",IDC_STATIC,10,124,179,15,SS_CENTERIMAGE\r
RTEXT "X-Arcade layout information []#1",IDC_STATIC,217,124,170,15,SS_NOTIFY | SS_CENTERIMAGE\r
COMBOBOX IDC_PORT2_JOYS,45,142,342,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
CONTROL "",IDC_RICHEDIT1,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,65,10,210,21\r
CONTROL "",IDC_RICHEDIT2,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,43,41,260,20\r
PUSHBUTTON "Contributors",IDC_CONTRIBUTORS,132,100,80,15\r
- CONTROL "",IDC_UAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,7,196,106,24\r
- CONTROL "",IDC_PICASSOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | NOT WS_VISIBLE | WS_DISABLED,213,122,106,24\r
- CONTROL "",IDC_AMIGAHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,120,161,106,24\r
- CONTROL "",IDC_WINUAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,232,161,106,24\r
- CONTROL "",IDC_AIABHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | NOT WS_VISIBLE | WS_DISABLED,24,122,106,24\r
- CONTROL "",IDC_THEROOTS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,121,225,106,24\r
- CONTROL "",IDC_CAPS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,232,196,106,24\r
- CONTROL "",IDC_ABIME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,121,196,106,24\r
- CONTROL "",IDC_CLOANTOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,7,161,106,24\r
- CONTROL "",IDC_AMIGASYS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,7,225,106,24\r
- CONTROL "",IDC_AMIKIT,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,232,225,106,24\r
+ CONTROL "",IDC_UAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,2,196,112,24\r
+ CONTROL "",IDC_PICASSOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | NOT WS_VISIBLE | WS_DISABLED,211,131,112,24\r
+ CONTROL "",IDC_AMIGAHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,116,168,112,24\r
+ CONTROL "",IDC_WINUAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,231,168,112,24\r
+ CONTROL "",IDC_AIABHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | NOT WS_VISIBLE | WS_DISABLED,22,131,112,24\r
+ CONTROL "",IDC_THEROOTS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,117,225,112,24\r
+ CONTROL "",IDC_CAPS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,231,196,112,24\r
+ CONTROL "",IDC_ABIME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,117,196,112,24\r
+ CONTROL "",IDC_CLOANTOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,2,168,112,24\r
+ CONTROL "",IDC_AMIGASYS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,2,225,112,24\r
+ CONTROL "",IDC_AMIKIT,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,231,225,112,24\r
END\r
\r
IDD_MISC1 DIALOGEX 0, 0, 396, 318\r
CONTROL "",IDC_MISCLIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,3,5,258,232\r
GROUPBOX "Miscellaneous Options",IDC_STATIC,266,2,128,138\r
CTEXT "SCSI and CD/DVD access:",IDC_STATIC,272,14,117,10,SS_CENTERIMAGE\r
- COMBOBOX IDC_SCSIMODE,291,28,79,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_SCSIMODE,287,28,87,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
CTEXT "Windowed style:",IDC_STATIC,272,45,117,10,SS_CENTERIMAGE\r
- COMBOBOX IDC_WINDOWEDMODE,291,59,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_WINDOWEDMODE,287,59,87,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
CTEXT "Graphics API:",IDC_STATIC,272,76,117,10,SS_CENTERIMAGE\r
- COMBOBOX IDC_DXMODE,291,89,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_DXMODE,287,89,87,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
CTEXT "DirectDraw:",IDC_STATIC,272,106,117,10,SS_CENTERIMAGE\r
- COMBOBOX IDC_DD_SURFACETYPE,291,119,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_DD_SURFACETYPE,287,119,87,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
GROUPBOX "GUI",IDC_STATIC,266,144,128,93\r
CTEXT "Language:",IDC_STATIC,271,154,117,10,SS_CENTERIMAGE\r
COMBOBOX IDC_LANGUAGE,273,168,114,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
RTEXT "Analog joy-mouse speed:",-1,147,288,108,10,SS_CENTERIMAGE\r
EDITTEXT IDC_INPUTSPEEDA,260,287,29,12,ES_NUMBER\r
PUSHBUTTON "Copy from:",IDC_INPUTCOPY,324,268,70,14\r
- COMBOBOX IDC_INPUTCOPYFROM,324,285,70,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
- PUSHBUTTON "Swap 1<>2",IDC_INPUTSWAP,324,301,70,14\r
+ COMBOBOX IDC_INPUTCOPYFROM,324,286,70,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ PUSHBUTTON "Swap 1<>2",IDC_INPUTSWAP,324,303,70,14\r
END\r
\r
IDD_FILTER DIALOGEX 0, 0, 396, 288\r
PUSHBUTTON "Help",IDHELP,479,328,47,14,WS_DISABLED\r
END\r
\r
-IDD_PATHS DIALOGEX 0, 0, 396, 274\r
+IDD_PATHS DIALOGEX 0, 0, 396, 303\r
STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
FONT 8, "MS Sans Serif", 0, 0, 0x1\r
BEGIN\r
LTEXT "Rips:",IDC_PATHS_RIPSL,3,179,260,8,SS_CENTERIMAGE\r
EDITTEXT IDC_PATHS_RIP,3,190,377,15,ES_AUTOHSCROLL\r
PUSHBUTTON "...",IDC_PATHS_RIPS,383,189,11,15\r
- PUSHBUTTON "Reset to defaults",IDC_PATHS_DEFAULT,2,219,92,14\r
- PUSHBUTTON "Rescan ROMs",IDC_ROM_RESCAN,2,236,92,14\r
- PUSHBUTTON "Clear disk history",IDC_RESETDISKHISTORY,2,253,92,14\r
- COMBOBOX IDC_PATHS_DEFAULTTYPE,99,220,163,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
- PUSHBUTTON "Clear registry",IDC_RESETREGISTRY,99,236,92,14\r
- CONTROL "Use relative paths",IDC_PATHS_RELATIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,101,255,161,11\r
+ PUSHBUTTON "Reset to defaults",IDC_PATHS_DEFAULT,2,212,92,14\r
+ PUSHBUTTON "Rescan ROMs",IDC_ROM_RESCAN,2,229,92,14\r
+ PUSHBUTTON "Clear disk history",IDC_RESETDISKHISTORY,2,246,92,14\r
+ COMBOBOX IDC_PATHS_DEFAULTTYPE,99,213,163,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ PUSHBUTTON "Clear registry",IDC_RESETREGISTRY,99,229,92,14\r
+ CONTROL "Use relative paths",IDC_PATHS_RELATIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,101,248,161,11\r
+ EDITTEXT IDC_LOGPATH,3,289,336,13,ES_READONLY\r
+ LTEXT "Log:",IDC_STATIC,5,273,67,10,SS_CENTERIMAGE\r
+ PUSHBUTTON "Open [] Open selected file.",IDC_LOGOPEN,343,288,51,14\r
+ COMBOBOX IDC_LOGSELECT,54,271,119,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ CONTROL "Enable full logging (temporary)",IDC_LOGENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,182,272,145,12\r
+ PUSHBUTTON "Save All [] Save and open both logs and config file.",IDC_LOGSAVE,343,272,51,14\r
END\r
\r
IDD_QUICKSTART DIALOGEX 0, 0, 396, 262\r
COMBOBOX IDC_RTG_BUFFERCNT,153,162,84,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
CTEXT "Aspect ratio:",IDC_STATIC,282,149,83,10,SS_CENTERIMAGE\r
COMBOBOX IDC_RTG_SCALE_ASPECTRATIO,282,162,84,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
- GROUPBOX "Miscellaneous Expansions",IDC_STATIC,1,198,172,80\r
+ GROUPBOX "Miscellaneous Expansions",IDC_STATIC,1,197,172,80\r
CONTROL "Catweasel Z2 emulation [] Catweasel MK2 Zorro II card emulation. Physical Windows compatible Catweasel card and drivers required.",IDC_CATWEASEL,\r
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,216,147,11\r
CONTROL "uaescsi.device",IDC_SCSIDEVICE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,229,147,11\r
- GROUPBOX "Network",IDC_STATIC,181,198,213,80\r
+ GROUPBOX "Network",IDC_STATIC,181,197,213,80\r
CONTROL "bsdsocket.library [] bsdsocket network library emulation.",IDC_SOCKETS,\r
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,216,187,11\r
CONTROL "uaenet.device [] Sana 2 compatible network device emulation. WinPcap required.",IDC_SANA2,\r
int qpcdivisor = 0;
int cpu_mmx = 1;
static int userdtsc = 0;
-int D3DEX = 1, d3ddebug = 0;
+int D3DEX = 1;
+int d3ddebug = 0;
HINSTANCE hInst = NULL;
HMODULE hUIDLL = NULL;
COLORREF g_dwBackgroundColor;
static int activatemouse = 1;
-int ignore_messages_all;
int pause_emulation;
static int didmousepos;
TCHAR start_path_new1[MAX_DPATH]; /* AF2005 */
TCHAR start_path_new2[MAX_DPATH]; /* AMIGAFOREVERDATA */
TCHAR help_file[MAX_DPATH];
+TCHAR bootlogpath[MAX_DPATH];
+TCHAR logpath[MAX_DPATH];
+bool winuaelog_temporary_enable;
int af_path_2005;
int quickstart = 1, configurationcache = 1, relativepaths = 0;
return 0;
}
- if (ignore_messages_all)
- return DefWindowProc (hWnd, message, wParam, lParam);
-
switch (message)
{
ignorelbutton = true;
break;
case WM_ACTIVATEAPP:
+ D3D_restore ();
if (!wParam && isfullscreen () <= 0 && currprefs.win32_minimize_inactive)
minimizewindow ();
{
}
+
#define LOG_BOOT _T("winuaebootlog.txt")
#define LOG_NORMAL _T("winuaelog.txt")
void logging_open (int bootlog, int append)
{
+ TCHAR *outpath;
TCHAR debugfilename[MAX_DPATH];
+ outpath = logpath;
debugfilename[0] = 0;
#ifndef SINGLEFILE
- if (currprefs.win32_logfile)
+ if (currprefs.win32_logfile || winuaelog_temporary_enable) {
_stprintf (debugfilename, _T("%s%s"), start_path_data, LOG_NORMAL);
+ }
if (bootlog) {
_stprintf (debugfilename, _T("%s%s"), start_path_data, LOG_BOOT);
+ outpath = bootlogpath;
if (!createbootlog)
bootlog = -1;
}
if (debugfilename[0]) {
if (!debugfile)
- debugfile = log_open (debugfilename, append, bootlog);
+ debugfile = log_open (debugfilename, append, bootlog, outpath);
}
#endif
}
return;
}
if (first == 1) {
- write_log (_T("Log (%s): '%s%s'\n"), currprefs.win32_logfile ? _T("enabled") : _T("disabled"),
+ write_log (_T("Log (%s): '%s%s'\n"), currprefs.win32_logfile || winuaelog_temporary_enable ? _T("enabled") : _T("disabled"),
start_path_data, LOG_NORMAL);
if (debugfile)
log_close (debugfile);
pChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD);
#endif
- log_open (NULL, 0, 0);
+ log_open (NULL, 0, 0, NULL);
__try {
WinMain2 (hInstance, hPrevInstance, lpCmdLine, nCmdShow);
#define LANG_DLL 1
//#define WINUAEBETA _T("")
-#define WINUAEBETA _T("15")
-#define WINUAEDATE MAKEBD(2012, 9, 2)
+#define WINUAEBETA _T("16")
+#define WINUAEDATE MAKEBD(2012, 9, 8)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
extern int mouseactive;
extern int minimized;
extern int monitor_off;
-extern int ignore_messages_all;
extern void *globalipc, *serialipc;
extern TCHAR start_path_exe[MAX_DPATH];
extern int window_extra_width, window_extra_height;
extern int af_path_2005;
extern TCHAR start_path_new1[MAX_DPATH], start_path_new2[MAX_DPATH];
+extern TCHAR bootlogpath[MAX_DPATH];
+extern TCHAR logpath[MAX_DPATH];
+extern bool winuaelog_temporary_enable;
enum pathtype { PATH_TYPE_DEFAULT, PATH_TYPE_WINUAE, PATH_TYPE_NEWWINUAE, PATH_TYPE_NEWAF, PATH_TYPE_AMIGAFOREVERDATA, PATH_TYPE_END };
void setpathmode (pathtype pt);
}
bool startactive = started || (!started && !currprefs.win32_start_uncaptured && !currprefs.win32_start_minimized);
- bool startpaused = !started && ((currprefs.win32_start_minimized && currprefs.win32_iconified_pause) || (currprefs.win32_start_uncaptured && currprefs.win32_inactive_pause));
- bool startminimized = !started && currprefs.win32_start_minimized;
+ bool startpaused = !started && ((currprefs.win32_start_minimized && currprefs.win32_iconified_pause) || (currprefs.win32_start_uncaptured && currprefs.win32_inactive_pause && isfullscreen () <= 0));
+ bool startminimized = !started && currprefs.win32_start_minimized && isfullscreen () <= 0;
if (!rp_isactive () && full && startactive)
setmouseactive (-1);
return 1;
}
-static int input_selected_device, input_selected_widget, input_total_devices;
+static int input_selected_device = -1;
+static int input_selected_widget, input_total_devices;
static int input_selected_event, input_selected_sub_num;
static int input_copy_from;
regdelete (NULL, _T("ShownsupportedModes"));
}
+static void copylog (const TCHAR *name, const TCHAR *path, FILE *f)
+{
+ FILE *s;
+
+ s = my_opentext (path);
+ if (s) {
+ fputws (_T("\n"), f);
+ fputws (name, f);
+ fputws (_T(":\n"), f);
+ fputws (_T("\n"), f);
+ for (;;) {
+ TCHAR buf[MAX_DPATH];
+ if (!fgetws (buf, sizeof buf / sizeof (TCHAR), s))
+ break;
+ fputws (buf, f);
+ }
+ fclose (s);
+ }
+}
+static void saveconfig (FILE *f)
+{
+ int len;
+ uae_u8 *s;
+
+ s = save_configuration (&len, true);
+ if (!s)
+ return;
+ TCHAR *c = utf8u ((char*)s);
+ fputws (c, f);
+ xfree (c);
+ xfree (s);
+}
+
+static void savelog (int all)
+{
+ FILE *f;
+
+ TCHAR tmp[MAX_DPATH];
+ tmp[0] = 0;
+ if (GetTempPath (MAX_DPATH, tmp) <= 0)
+ return;
+ if (all) {
+ flush_log ();
+ _tcscat (tmp, _T("winuae_debug.txt"));
+ f = _tfopen (tmp, _T("wt, ccs=UTF-8"));
+ copylog (_T("winuaebootlog"), bootlogpath, f);
+ copylog (_T("winuaelog"), logpath, f);
+ fputws (_T("\n"), f);
+ fputws (_T("configuration:"), f);
+ fputws (_T(":\n"), f);
+ fputws (_T("\n"), f);
+ saveconfig (f);
+ fclose (f);
+ } else {
+ _tcscat (tmp, _T("winuae_config.txt"));
+ f = _tfopen (tmp, _T("wt, ccs=UTF-8"));
+ saveconfig (f);
+ fclose (f);
+ }
+ ShellExecute (NULL, _T("open"), tmp, NULL, NULL, SW_SHOWNORMAL);
+}
+
pathtype path_type;
static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
ptypes[numtypes++] = PATH_TYPE_WINUAE;
SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_SETCURSEL, selpath, 0);
EnableWindow (GetDlgItem (hDlg, IDC_PATHS_DEFAULTTYPE), numtypes > 0 ? TRUE : FALSE);
+ SetWindowText (GetDlgItem (hDlg, IDC_LOGPATH), bootlogpath);
+ SendDlgItemMessage (hDlg, IDC_LOGSELECT, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage (hDlg, IDC_LOGSELECT, CB_ADDSTRING, 0, (LPARAM)_T("winuaebootlog.txt"));
+ SendDlgItemMessage (hDlg, IDC_LOGSELECT, CB_ADDSTRING, 0, (LPARAM)_T("winuaelog.txt"));
+ SendDlgItemMessage (hDlg, IDC_LOGSELECT, CB_ADDSTRING, 0, (LPARAM)_T("Current configuration"));
+ SendDlgItemMessage (hDlg, IDC_LOGSELECT, CB_SETCURSEL, 0, 0);
+ CheckDlgButton (hDlg, IDC_LOGENABLE, winuaelog_temporary_enable || (full_property_sheet == 0 && currprefs.win32_logfile));
+ ew (hDlg, IDC_LOGENABLE, winuaelog_temporary_enable == false && full_property_sheet);
values_to_pathsdialog (hDlg);
recursive--;
return TRUE;
if (recursive > 0)
break;
recursive++;
- switch (LOWORD (wParam))
- {
- case IDC_PATHS_ROMS:
- fetch_path (_T("KickstartPath"), tmp, sizeof (tmp) / sizeof (TCHAR));
- if (DirectorySelection (hDlg, &pathsguid, tmp)) {
- load_keyring (&workprefs, NULL);
- set_path (_T("KickstartPath"), tmp);
- if (!scan_roms (hDlg, 1))
- gui_message_id (IDS_ROMSCANNOROMS);
- values_to_pathsdialog (hDlg);
+ if (HIWORD (wParam) == CBN_SELCHANGE || HIWORD (wParam) == CBN_KILLFOCUS) {
+ switch (LOWORD (wParam))
+ {
+ case IDC_LOGSELECT:
+ val = SendDlgItemMessage (hDlg, IDC_LOGSELECT, CB_GETCURSEL, 0, 0L);
+ if (val == 0) {
+ SetWindowText (GetDlgItem (hDlg, IDC_LOGPATH), bootlogpath);
+ ew (hDlg, IDC_LOGOPEN, bootlogpath[0]);
+ } else if (val == 1) {
+ SetWindowText (GetDlgItem (hDlg, IDC_LOGPATH), logpath);
+ ew (hDlg, IDC_LOGOPEN, logpath[0]);
+ } else if (val == 2) {
+ SetWindowText (GetDlgItem (hDlg, IDC_LOGPATH), _T("Configuration"));
+ ew (hDlg, IDC_LOGOPEN, TRUE);
+ }
+ break;
}
- break;
- case IDC_PATHS_ROM:
- GetWindowText (GetDlgItem (hDlg, IDC_PATHS_ROM), tmp, sizeof (tmp) / sizeof (TCHAR));
- set_path (_T("KickstartPath"), tmp);
- break;
- case IDC_PATHS_CONFIGS:
- fetch_path (_T("ConfigurationPath"), tmp, sizeof (tmp) / sizeof (TCHAR));
- if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ } else {
+
+ switch (LOWORD (wParam))
+ {
+ case IDC_LOGSAVE:
+ savelog (1);
+ break;
+ case IDC_LOGENABLE:
+ winuaelog_temporary_enable = ischecked (hDlg, IDC_LOGENABLE);
+ break;
+ case IDC_LOGOPEN:
+ flush_log ();
+ val = SendDlgItemMessage (hDlg, IDC_LOGSELECT, CB_GETCURSEL, 0, 0L);
+ if (val == 0) {
+ if (bootlogpath[0])
+ ShellExecute (NULL, _T("open"), bootlogpath, NULL, NULL, SW_SHOWNORMAL);
+ } else if (val == 1) {
+ if (logpath[0])
+ ShellExecute (NULL, _T("open"), logpath, NULL, NULL, SW_SHOWNORMAL);
+ } else if (val == 2) {
+ savelog (0);
+ }
+ break;
+ case IDC_PATHS_ROMS:
+ fetch_path (_T("KickstartPath"), tmp, sizeof (tmp) / sizeof (TCHAR));
+ if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ load_keyring (&workprefs, NULL);
+ set_path (_T("KickstartPath"), tmp);
+ if (!scan_roms (hDlg, 1))
+ gui_message_id (IDS_ROMSCANNOROMS);
+ values_to_pathsdialog (hDlg);
+ }
+ break;
+ case IDC_PATHS_ROM:
+ GetWindowText (GetDlgItem (hDlg, IDC_PATHS_ROM), tmp, sizeof (tmp) / sizeof (TCHAR));
+ set_path (_T("KickstartPath"), tmp);
+ break;
+ case IDC_PATHS_CONFIGS:
+ fetch_path (_T("ConfigurationPath"), tmp, sizeof (tmp) / sizeof (TCHAR));
+ if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ set_path (_T("ConfigurationPath"), tmp);
+ values_to_pathsdialog (hDlg);
+ FreeConfigStore ();
+ }
+ break;
+ case IDC_PATHS_CONFIG:
+ GetWindowText (GetDlgItem (hDlg, IDC_PATHS_CONFIG), tmp, sizeof (tmp) / sizeof (TCHAR));
set_path (_T("ConfigurationPath"), tmp);
- values_to_pathsdialog (hDlg);
FreeConfigStore ();
- }
- break;
- case IDC_PATHS_CONFIG:
- GetWindowText (GetDlgItem (hDlg, IDC_PATHS_CONFIG), tmp, sizeof (tmp) / sizeof (TCHAR));
- set_path (_T("ConfigurationPath"), tmp);
- FreeConfigStore ();
- break;
- case IDC_PATHS_SCREENSHOTS:
- fetch_path (_T("ScreenshotPath"), tmp, sizeof (tmp) / sizeof (TCHAR));
- if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ break;
+ case IDC_PATHS_SCREENSHOTS:
+ fetch_path (_T("ScreenshotPath"), tmp, sizeof (tmp) / sizeof (TCHAR));
+ if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ set_path (_T("ScreenshotPath"), tmp);
+ values_to_pathsdialog (hDlg);
+ }
+ break;
+ case IDC_PATHS_SCREENSHOT:
+ GetWindowText (GetDlgItem (hDlg, IDC_PATHS_SCREENSHOT), tmp, sizeof (tmp) / sizeof (TCHAR));
set_path (_T("ScreenshotPath"), tmp);
- values_to_pathsdialog (hDlg);
- }
- break;
- case IDC_PATHS_SCREENSHOT:
- GetWindowText (GetDlgItem (hDlg, IDC_PATHS_SCREENSHOT), tmp, sizeof (tmp) / sizeof (TCHAR));
- set_path (_T("ScreenshotPath"), tmp);
- break;
- case IDC_PATHS_SAVESTATES:
- fetch_path (_T("StatefilePath"), tmp, sizeof (tmp) / sizeof (TCHAR));
- if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ break;
+ case IDC_PATHS_SAVESTATES:
+ fetch_path (_T("StatefilePath"), tmp, sizeof (tmp) / sizeof (TCHAR));
+ if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ set_path (_T("StatefilePath"), tmp);
+ values_to_pathsdialog (hDlg);
+ }
+ break;
+ case IDC_PATHS_SAVESTATE:
+ GetWindowText (GetDlgItem (hDlg, IDC_PATHS_SAVESTATE), tmp, sizeof (tmp) / sizeof (TCHAR));
set_path (_T("StatefilePath"), tmp);
- values_to_pathsdialog (hDlg);
- }
- break;
- case IDC_PATHS_SAVESTATE:
- GetWindowText (GetDlgItem (hDlg, IDC_PATHS_SAVESTATE), tmp, sizeof (tmp) / sizeof (TCHAR));
- set_path (_T("StatefilePath"), tmp);
- break;
- case IDC_PATHS_SAVEIMAGES:
- fetch_path (_T("SaveimagePath"), tmp, sizeof (tmp) / sizeof (TCHAR));
- if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ break;
+ case IDC_PATHS_SAVEIMAGES:
+ fetch_path (_T("SaveimagePath"), tmp, sizeof (tmp) / sizeof (TCHAR));
+ if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ set_path (_T("SaveimagePath"), tmp);
+ values_to_pathsdialog (hDlg);
+ }
+ break;
+ case IDC_PATHS_SAVEIMAGE:
+ GetWindowText (GetDlgItem (hDlg, IDC_PATHS_SAVEIMAGE), tmp, sizeof (tmp) / sizeof (TCHAR));
set_path (_T("SaveimagePath"), tmp);
- values_to_pathsdialog (hDlg);
- }
- break;
- case IDC_PATHS_SAVEIMAGE:
- GetWindowText (GetDlgItem (hDlg, IDC_PATHS_SAVEIMAGE), tmp, sizeof (tmp) / sizeof (TCHAR));
- set_path (_T("SaveimagePath"), tmp);
- break;
- case IDC_PATHS_AVIOUTPUTS:
- fetch_path (_T("VideoPath"), tmp, sizeof (tmp) / sizeof (TCHAR));
- if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ break;
+ case IDC_PATHS_AVIOUTPUTS:
+ fetch_path (_T("VideoPath"), tmp, sizeof (tmp) / sizeof (TCHAR));
+ if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ set_path (_T("VideoPath"), tmp);
+ values_to_pathsdialog (hDlg);
+ }
+ break;
+ case IDC_PATHS_RIPS:
+ fetch_path (_T("RipperPath"), tmp, sizeof (tmp) / sizeof (TCHAR));
+ if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ set_path (_T("RipperPath"), tmp);
+ values_to_pathsdialog (hDlg);
+ }
+ break;
+ case IDC_PATHS_AVIOUTPUT:
+ GetWindowText (GetDlgItem (hDlg, IDC_PATHS_AVIOUTPUT), tmp, sizeof (tmp) / sizeof (TCHAR));
set_path (_T("VideoPath"), tmp);
- values_to_pathsdialog (hDlg);
- }
- break;
- case IDC_PATHS_RIPS:
- fetch_path (_T("RipperPath"), tmp, sizeof (tmp) / sizeof (TCHAR));
- if (DirectorySelection (hDlg, &pathsguid, tmp)) {
+ break;
+ case IDC_PATHS_RIP:
+ GetWindowText (GetDlgItem (hDlg, IDC_PATHS_RIP), tmp, sizeof (tmp) / sizeof (TCHAR));
set_path (_T("RipperPath"), tmp);
- values_to_pathsdialog (hDlg);
- }
- break;
- case IDC_PATHS_AVIOUTPUT:
- GetWindowText (GetDlgItem (hDlg, IDC_PATHS_AVIOUTPUT), tmp, sizeof (tmp) / sizeof (TCHAR));
- set_path (_T("VideoPath"), tmp);
- break;
- case IDC_PATHS_RIP:
- GetWindowText (GetDlgItem (hDlg, IDC_PATHS_RIP), tmp, sizeof (tmp) / sizeof (TCHAR));
- set_path (_T("RipperPath"), tmp);
- break;
- case IDC_PATHS_DEFAULT:
- val = SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_GETCURSEL, 0, 0L);
- if (val != CB_ERR && val >= 0 && val < numtypes) {
- val = ptypes[val];
- if (val == PATH_TYPE_WINUAE) {
- _tcscpy (start_path_data, start_path_exe);
- path_type = PATH_TYPE_WINUAE;
- } else if (val == PATH_TYPE_NEWWINUAE && start_path_new1[0]) {
- _tcscpy (start_path_data, start_path_new1);
- path_type = PATH_TYPE_NEWWINUAE;
- create_afnewdir(0);
- } else if (val == PATH_TYPE_NEWAF && start_path_new1[0]) {
- path_type = PATH_TYPE_NEWAF;
- create_afnewdir(0);
- _tcscpy (start_path_data, start_path_new1);
- } else if (val == PATH_TYPE_AMIGAFOREVERDATA && start_path_new2[0]) {
- path_type = PATH_TYPE_AMIGAFOREVERDATA;
- _tcscpy (start_path_data, start_path_new1);
+ break;
+ case IDC_PATHS_DEFAULT:
+ val = SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_GETCURSEL, 0, 0L);
+ if (val != CB_ERR && val >= 0 && val < numtypes) {
+ val = ptypes[val];
+ if (val == PATH_TYPE_WINUAE) {
+ _tcscpy (start_path_data, start_path_exe);
+ path_type = PATH_TYPE_WINUAE;
+ } else if (val == PATH_TYPE_NEWWINUAE && start_path_new1[0]) {
+ _tcscpy (start_path_data, start_path_new1);
+ path_type = PATH_TYPE_NEWWINUAE;
+ create_afnewdir(0);
+ } else if (val == PATH_TYPE_NEWAF && start_path_new1[0]) {
+ path_type = PATH_TYPE_NEWAF;
+ create_afnewdir(0);
+ _tcscpy (start_path_data, start_path_new1);
+ } else if (val == PATH_TYPE_AMIGAFOREVERDATA && start_path_new2[0]) {
+ path_type = PATH_TYPE_AMIGAFOREVERDATA;
+ _tcscpy (start_path_data, start_path_new1);
+ }
+ SetCurrentDirectory (start_path_data);
+ setpathmode (path_type);
+ set_path (_T("KickstartPath"), NULL, path_type);
+ set_path (_T("ConfigurationPath"), NULL, path_type);
+ set_path (_T("ScreenshotPath"), NULL, path_type);
+ set_path (_T("StatefilePath"), NULL, path_type);
+ set_path (_T("SaveimagePath"), NULL, path_type);
+ set_path (_T("VideoPath"), NULL, path_type);
+ set_path (_T("RipperPath"), NULL, path_type);
+ set_path (_T("InputPath"), NULL, path_type);
+ values_to_pathsdialog (hDlg);
+ FreeConfigStore ();
}
- SetCurrentDirectory (start_path_data);
- setpathmode (path_type);
- set_path (_T("KickstartPath"), NULL, path_type);
- set_path (_T("ConfigurationPath"), NULL, path_type);
- set_path (_T("ScreenshotPath"), NULL, path_type);
- set_path (_T("StatefilePath"), NULL, path_type);
- set_path (_T("SaveimagePath"), NULL, path_type);
- set_path (_T("VideoPath"), NULL, path_type);
- set_path (_T("RipperPath"), NULL, path_type);
- set_path (_T("InputPath"), NULL, path_type);
- values_to_pathsdialog (hDlg);
- FreeConfigStore ();
- }
- break;
- case IDC_ROM_RESCAN:
- scan_roms (hDlg, 1);
- break;
- case IDC_RESETREGISTRY:
- resetregistry ();
- break;
- case IDC_RESETDISKHISTORY:
- reset_disk_history ();
- break;
- case IDC_PATHS_CONFIGCACHE:
- configurationcache = ischecked (hDlg, IDC_PATHS_CONFIGCACHE) ? 1 : 0;
- regsetint (NULL, _T("ConfigurationCache"), configurationcache);
- break;
- case IDC_PATHS_RELATIVE:
- relativepaths = ischecked (hDlg, IDC_PATHS_RELATIVE) ? 1 : 0;
- regsetint (NULL, _T("RelativePaths"), relativepaths);
- break;
+ break;
+ case IDC_ROM_RESCAN:
+ scan_roms (hDlg, 1);
+ break;
+ case IDC_RESETREGISTRY:
+ resetregistry ();
+ break;
+ case IDC_RESETDISKHISTORY:
+ reset_disk_history ();
+ break;
+ case IDC_PATHS_CONFIGCACHE:
+ configurationcache = ischecked (hDlg, IDC_PATHS_CONFIGCACHE) ? 1 : 0;
+ regsetint (NULL, _T("ConfigurationCache"), configurationcache);
+ break;
+ case IDC_PATHS_RELATIVE:
+ relativepaths = ischecked (hDlg, IDC_PATHS_RELATIVE) ? 1 : 0;
+ regsetint (NULL, _T("RelativePaths"), relativepaths);
+ break;
+ }
}
recursive--;
}
static void init_inputdlg (HWND hDlg)
{
- int i;
+ int i, num;
TCHAR buf[100], txt[100];
+ TCHAR input_selected_device_name[100];
+
+ input_selected_device_name[0] = 0;
+ if (input_selected_device < 0) {
+ int size = sizeof input_selected_device_name / sizeof (TCHAR);
+ regquerystr (NULL, _T("InputDeviceSelected"), input_selected_device_name, &size);
+ }
SendDlgItemMessage (hDlg, IDC_INPUTTYPE, CB_RESETCONTENT, 0, 0L);
for (i = 0; i < GAMEPORT_INPUT_SETTINGS; i++) {
}
SendDlgItemMessage (hDlg, IDC_INPUTAMIGACNT, CB_SETCURSEL, input_selected_sub_num, 0);
+ num = 0;
SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_RESETCONTENT, 0, 0L);
- for (i = 0; i < inputdevice_get_device_total (IDTYPE_JOYSTICK); i++) {
- SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name (IDTYPE_JOYSTICK, i));
- }
- for (i = 0; i < inputdevice_get_device_total (IDTYPE_MOUSE); i++) {
- SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name (IDTYPE_MOUSE, i));
- }
- for (i = 0; i < inputdevice_get_device_total (IDTYPE_KEYBOARD); i++) {
- SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name (IDTYPE_KEYBOARD, i));
- }
- for (i = 0; i < inputdevice_get_device_total (IDTYPE_INTERNALEVENT); i++) {
- SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name (IDTYPE_INTERNALEVENT, i));
+ for (i = 0; i < inputdevice_get_device_total (IDTYPE_JOYSTICK); i++, num++) {
+ TCHAR *name = inputdevice_get_device_name (IDTYPE_JOYSTICK, i);
+ if (!_tcsicmp (name, input_selected_device_name))
+ input_selected_device = num;
+ SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_ADDSTRING, 0, (LPARAM)name);
+ }
+ for (i = 0; i < inputdevice_get_device_total (IDTYPE_MOUSE); i++, num++) {
+ TCHAR *name = inputdevice_get_device_name (IDTYPE_MOUSE, i);
+ if (!_tcsicmp (name, input_selected_device_name))
+ input_selected_device = num;
+ SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_ADDSTRING, 0, (LPARAM)name);
+ }
+ for (i = 0; i < inputdevice_get_device_total (IDTYPE_KEYBOARD); i++, num++) {
+ TCHAR *name = inputdevice_get_device_name (IDTYPE_KEYBOARD, i);
+ if (!_tcsicmp (name, input_selected_device_name))
+ input_selected_device = num;
+ SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_ADDSTRING, 0, (LPARAM)name);
+ }
+ for (i = 0; i < inputdevice_get_device_total (IDTYPE_INTERNALEVENT); i++, num++) {
+ TCHAR *name = inputdevice_get_device_name (IDTYPE_INTERNALEVENT, i);
+ if (!_tcsicmp (name, input_selected_device_name))
+ input_selected_device = num;
+ SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_ADDSTRING, 0, (LPARAM)name);
}
input_total_devices = inputdevice_get_device_total (IDTYPE_JOYSTICK) +
inputdevice_get_device_total (IDTYPE_MOUSE) +
inputdevice_get_device_total (IDTYPE_KEYBOARD) +
inputdevice_get_device_total (IDTYPE_INTERNALEVENT);
- if (input_selected_device >= input_total_devices)
+ if (input_selected_device >= input_total_devices || input_selected_device < 0)
input_selected_device = 0;
InitializeListView (hDlg);
init_inputdlg_2 (hDlg);
init_inputdlg_2 (hDlg);
values_to_inputdlg (hDlg);
doselect = 1;
+ regsetstr (NULL, _T("InputDeviceSelected"), inputdevice_get_device_name2 (input_selected_device));
}
}
item = SendDlgItemMessage (hDlg, IDC_INPUTAMIGA, CB_GETCURSEL, 0, 0L);
<FileType>Document</FileType>
</Library>
</ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\resources\resource.h" />
+ </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Library Include="..\hq4x16.obj" />
<Library Include="..\hq4x32.obj" />
</ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\resources\resource.h" />
+ </ItemGroup>
</Project>
\ No newline at end of file
+- Use dos.library to detect between 1.x and 2.x (CDTV KS 1.3 + 2.x extended = exec is v37!)
+- Removable disk support was disabled.
- restore only single input target to default.
+Beta 16:
+
+- Added easy to use log options to Paths panel. Open = open selected log or current config to text editor.
+ Save All = create file that includes both logs and current configuration. Makes requesting logs easier for debugging purposes.
+ Log checkbox overrides misc panel logging option. Checkbox state not saved, resets back to non ticked after restarting.
+ (Included config is exact current configuration, not necessary same as last loaded config file)
+- Fixed uae-configuration config listing garbage ????? line at the end.
+- USB HID game controller [-] and [+] input axis movement used wrong event (one-shot instead of normal press/release).
+- Possible fix for D3D display alignment errors in some modes (AMD only apparently)
+- Fixed D3D blank screen after alt-tabbing back to fullscreen mode. Non-D3DEx (Windows XP mainly) only.
+- Non UAE HD controller harddrives and CDFS config data conflict, inserting CD corrupted HDF path.
+- Some CD (both images and physical drives) on the fly media switching problems fixed.
+- Ignore start uncaptured and start minimized if starting in fullscreen mode.
+- Input panel slots #2-#8 not saved to config file if slot #1 had GamePorts [PORTx] event.
+- Configuration #1-#3 selected and GamePorts not set to <none> and then changed back to <none>, original slot #1 event was not restored.
+- CD32 gameport type also enabled normal joystick firebutton/2nd button event. Only CD32 red and blue are needed.
+- Break to debugger if program jumps to non-existing memory ("Did something stupid") and any break point is already active.
+- Remember last selected Input panel device.
+- 64-bit build now support up to 2.5G memory space and max 2G of Z3 fast RAM, emulated as 2x1G Z3 boards (1G is max Z3 board size)
+ Note that AmigaOS may have signed integer problems if 2G border is crossed.
+
Beta 15:
- Fixed too large GUI size if non-100% Windows DPI setting and full optimized build. (b13)
return buffer + _tcslen (buffer);
}
-FILE *log_open (const TCHAR *name, int append, int bootlog)
+FILE *log_open (const TCHAR *name, int append, int bootlog, TCHAR *outpath)
{
FILE *f = NULL;
if (name != NULL) {
if (bootlog >= 0) {
+ _tcscpy (outpath, name);
f = _tfopen (name, append ? _T("a, ccs=UTF-8") : _T("wt, ccs=UTF-8"));
if (!f && bootlog) {
TCHAR tmp[MAX_DPATH];
tmp[0] = 0;
if (GetTempPath (MAX_DPATH, tmp) > 0) {
- _tcscat (tmp, _T("glog.txt"));
+ _tcscat (tmp, _T("winuaetemplog.txt"));
+ _tcscpy (outpath, tmp);
f = _tfopen (tmp, append ? _T("a, ccs=UTF-8") : _T("wt, ccs=UTF-8"));
}
}
/* move this if you want to use CONF or LOG hunks when restoring state */
zfile_fwrite (endhunk, 1, 8, f);
- dst = save_configuration (&len);
+ dst = save_configuration (&len, false);
if (dst) {
save_chunk (f, dst, len, _T("CONF"), comp);
xfree(dst);
return fwrite (b, l1, l2, z->f);
}
-size_t zfile_fputs (struct zfile *z, TCHAR *s)
+size_t zfile_fputs (struct zfile *z, const TCHAR *s)
{
char *s2 = ua (s);
size_t t;