From: Toni Wilen Date: Sat, 8 Sep 2012 14:07:25 +0000 (+0300) Subject: 2500b16 X-Git-Tag: 2500~15 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=90a1c22cb095634a192642560be4b3300b038ea2;p=francis%2Fwinuae.git 2500b16 --- diff --git a/blkdev.cpp b/blkdev.cpp index dd70b0ca..b3b433bd 100644 --- a/blkdev.cpp +++ b/blkdev.cpp @@ -42,7 +42,7 @@ static uae_u8 play_qcode[MAX_TOTAL_SCSI_DEVICES][SUBQ_SIZE]; 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) @@ -438,7 +438,7 @@ void blkdev_cd_change (int unitnum, const TCHAR *name) 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; @@ -498,6 +498,7 @@ static void check_changes (int unitnum) 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; @@ -508,14 +509,19 @@ static void check_changes (int unitnum) 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); @@ -545,6 +551,7 @@ static void check_changes (int unitnum) write_log (_T("-> device open failed\n")); wasopen[unitnum] = 0; } else { + wasopen[unitnum] = 1; write_log (_T("-> device reopened\n")); } } diff --git a/cfgfile.cpp b/cfgfile.cpp index 35824444..3e2dcbd4 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -3080,7 +3080,7 @@ static int getconfigstoreline (const TCHAR *option, TCHAR *value) 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) @@ -3089,7 +3089,7 @@ static bool createconfigstore (struct uae_prefs *p) 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; } @@ -4042,25 +4042,26 @@ uae_u8 *restore_configuration (uae_u8 *src) 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"); @@ -4124,6 +4125,11 @@ void default_prefs (struct uae_prefs *p, int type) 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)); @@ -4257,7 +4263,7 @@ void default_prefs (struct uae_prefs *p, int type) 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")); diff --git a/filesys.cpp b/filesys.cpp index 06854aa0..6924c2b7 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -265,6 +265,12 @@ static void close_filesys_unit (UnitInfo *uip) 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) @@ -277,7 +283,7 @@ static UnitInfo *getuip (struct uae_prefs *p, int index) 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; @@ -287,7 +293,7 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo * 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; @@ -625,7 +631,7 @@ int kill_filesys_unitconfig (struct uae_prefs *p, int nr) 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); @@ -642,8 +648,8 @@ int move_filesys_unitconfig (struct uae_prefs *p, int nr, int to) { 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)); @@ -655,6 +661,19 @@ int move_filesys_unitconfig (struct uae_prefs *p, int nr, int to) 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; @@ -669,67 +688,70 @@ static void initialize_mountinfo (void) 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 + } @@ -1424,10 +1446,9 @@ static uae_u32 filesys_media_change_reply (TrapContext *ctx, int mode) // 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); @@ -1464,6 +1485,7 @@ static uae_u32 filesys_media_change_reply (TrapContext *ctx, int mode) #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); @@ -1472,10 +1494,15 @@ static uae_u32 filesys_media_change_reply (TrapContext *ctx, int mode) 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); } diff --git a/include/inputdevice.h b/include/inputdevice.h index 25891f8a..69182972 100644 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -154,10 +154,10 @@ extern int inputdevice_get_device_total (int type); 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, @@ -214,7 +214,7 @@ extern bool inputdevice_get_eventname (const struct inputevent *ie, TCHAR *out); 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); diff --git a/include/savestate.h b/include/savestate.h index 2ea9e22f..cee78c86 100644 --- a/include/savestate.h +++ b/include/savestate.h @@ -151,7 +151,7 @@ extern uae_u8 *save_cd (int num, int *len); 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); diff --git a/include/sysdeps.h b/include/sysdeps.h index bc584c9d..39f9108f 100644 --- a/include/sysdeps.h +++ b/include/sysdeps.h @@ -486,7 +486,7 @@ extern void gui_message (const TCHAR *,...); 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); diff --git a/include/zfile.h b/include/zfile.h index a25a92d9..39070e3d 100644 --- a/include/zfile.h +++ b/include/zfile.h @@ -53,7 +53,7 @@ extern size_t zfile_fread (void *b, size_t l1, size_t l2, struct zfile *z); 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); diff --git a/inputdevice.cpp b/inputdevice.cpp index 47ea5e26..3d86e3e4 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -347,6 +347,10 @@ static bool write_config_head (struct zfile *f, int idnum, int devnum, TCHAR *na 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); @@ -398,7 +402,7 @@ static void write_config2 (struct zfile *f, int idnum, int i, int offset, const 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; @@ -408,16 +412,12 @@ static void write_config2 (struct zfile *f, int idnum, int i, int offset, const 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++ = ','; @@ -426,8 +426,9 @@ static void write_config2 (struct zfile *f, int idnum, int i, int offset, const 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++ = '.'; @@ -2408,7 +2409,7 @@ static int check_input_queue (int evt) 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; @@ -2417,8 +2418,11 @@ static int check_input_queue (int evt) 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; @@ -2445,7 +2449,7 @@ static void queue_input_event (int evt, const TCHAR *custom, int state, int max, 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; } } @@ -3570,8 +3574,10 @@ static void setbuttonstateall (struct uae_input_device *id, struct uae_input_dev 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; @@ -3590,7 +3596,6 @@ static void setbuttonstateall (struct uae_input_device *id, struct uae_input_dev 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 */ @@ -4111,25 +4116,42 @@ static void setautofireevent (struct uae_input_device *uid, int num, int sub, in } } -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) @@ -4143,7 +4165,7 @@ 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; @@ -4275,7 +4297,7 @@ static void cleardevgp (struct uae_input_device *uid, int num, bool nocustom, in 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); } } } @@ -4293,7 +4315,7 @@ static void cleardevkbrgp (struct uae_input_device *uid, int num, bool nocustom, 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); } @@ -4340,6 +4362,7 @@ void inputdevice_compa_clear (struct uae_prefs *prefs, int index) 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; @@ -4563,11 +4586,11 @@ static void compatibility_copy (struct uae_prefs *prefs, bool gameports) 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; } @@ -4594,7 +4617,7 @@ static void compatibility_copy (struct uae_prefs *prefs, bool gameports) 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) @@ -4604,20 +4627,20 @@ static void compatibility_copy (struct uae_prefs *prefs, bool gameports) 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; } @@ -4726,7 +4749,7 @@ static void compatibility_copy (struct uae_prefs *prefs, bool gameports) 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; diff --git a/isofs.cpp b/isofs.cpp index 73e97c1c..cb9ff4e1 100644 --- a/isofs.cpp +++ b/isofs.cpp @@ -2537,6 +2537,8 @@ void isofs_dispose_inode(void *sbp, uae_u64 uniq) struct inode *inode; struct inode *old = NULL, *prev = NULL; + if (!sb) + return; inode = sb->inodes; while (inode) { if (inode->i_ino == uniq) { diff --git a/memory.cpp b/memory.cpp index 722a4ebd..a018b7e0 100644 --- a/memory.cpp +++ b/memory.cpp @@ -1227,9 +1227,8 @@ uae_u8 *REGPARAM2 default_xlate (uaecptr a) 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); diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index 6ba4abca..4aedd87d 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -143,7 +143,7 @@ static bool rawinput_enabled_mouse, rawinput_enabled_keyboard; 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; @@ -2048,17 +2048,27 @@ static void handle_rawinput_2 (RAWINPUT *raw) //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); } } } @@ -3663,22 +3673,16 @@ int input_get_default_keyboard (int i) } } -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; @@ -3688,26 +3692,26 @@ static void setid (struct uae_input_device *uid, int i, int slot, int sub, int p 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); } } } @@ -3716,22 +3720,22 @@ int input_get_default_mouse (struct uae_input_device *uid, int i, int port, int 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; @@ -3750,51 +3754,49 @@ int input_get_default_joystick (struct uae_input_device *uid, int i, int port, i 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; @@ -3802,20 +3804,20 @@ int input_get_default_joystick_analog (struct uae_input_device *uid, int i, int 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++; } } diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index a9eda5fa..97b5ec96 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -73,6 +73,7 @@ static int cursor_offset_x, cursor_offset_y, cursor_offset2_x, cursor_offset2_y; static float maskmult_x, maskmult_y; RECT mask2rect; static bool wasstilldrawing_broken; +static bool renderdisabled; static HANDLE filenotificationhandle; static bool fakemode; @@ -232,7 +233,7 @@ static TCHAR *D3DX_ErrorString (HRESULT hr, LPD3DXBUFFER Errors) static int isd3d (void) { - if (fakemode || devicelost || !d3ddev || !d3d_enabled) + if (fakemode || devicelost || !d3ddev || !d3d_enabled || renderdisabled) return 0; return 1; } @@ -764,7 +765,7 @@ static LPD3DXEFFECT psEffect_LoadEffect (const TCHAR *shaderfile, int full) _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); @@ -787,7 +788,7 @@ static LPD3DXEFFECT psEffect_LoadEffect (const TCHAR *shaderfile, int full) 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); @@ -1664,15 +1665,14 @@ static void setupscenecoords (void) 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); @@ -1686,6 +1686,9 @@ static void setupscenecoords (void) 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; @@ -1799,6 +1802,16 @@ static void freetextures (void) } } +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) @@ -1851,6 +1864,10 @@ static void invalidatedeviceobjects (void) vertexBuffer->Release (); vertexBuffer = NULL; } + if (d3dswapchain) { + d3dswapchain->Release (); + d3dswapchain = NULL; + } m_MatWorldEffectHandle = NULL; m_MatViewEffectHandle = NULL; m_MatProjEffectHandle = NULL; @@ -1878,6 +1895,8 @@ static int restoredeviceobjects (void) HRESULT hr; invalidatedeviceobjects (); + getswapchain (); + while (shaderon > 0) { postEffect = psEffect_LoadEffect (psEnabled ? _T("_winuae.fx") : _T("_winuae_old.fx"), false); if (!postEffect) { @@ -1936,10 +1955,6 @@ static int restoredeviceobjects (void) static void D3D_free2 (void) { invalidatedeviceobjects (); - if (d3dswapchain) { - d3dswapchain->Release (); - d3dswapchain = NULL; - } if (d3ddev) { d3ddev->Release (); d3ddev = NULL; @@ -1953,6 +1968,7 @@ static void D3D_free2 (void) psActive = 0; resetcount = 0; devicelost = 0; + renderdisabled = false; changed_prefs.leds_on_screen = currprefs.leds_on_screen = currprefs.leds_on_screen & ~STATUSLINE_TARGET; } @@ -2245,7 +2261,7 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int depth, int mmult) 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) { @@ -2285,11 +2301,6 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int depth, int mmult) 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: @@ -2323,7 +2334,6 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int depth, int mmult) 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; @@ -2335,14 +2345,20 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int depth, int mmult) 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; @@ -2354,23 +2370,24 @@ bool D3D_alloctexture (int w, int h) 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; @@ -2381,12 +2398,21 @@ int D3D_needreset (void) 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)); @@ -2399,7 +2425,9 @@ int D3D_needreset (void) } 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); @@ -2447,7 +2475,7 @@ static void D3D_showframe2 (bool dowait) 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 @@ -2459,6 +2487,8 @@ static void D3D_showframe2 (bool dowait) 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; @@ -2467,6 +2497,11 @@ static void D3D_showframe2 (bool dowait) } } +void D3D_restore (void) +{ + renderdisabled = false; +} + void D3D_clear (void) { int i; @@ -2783,7 +2818,7 @@ void D3D_unlocktexture (void) void D3D_flushtexture (int miny, int maxy) { - if (fakemode || fulllocked || !texture) + if (fakemode || fulllocked || !texture || renderdisabled) return; if (miny >= 0 && maxy >= 0) { RECT r; @@ -2811,8 +2846,9 @@ uae_u8 *D3D_locktexture (int *pitch, bool fullupdate) return fakebitmap; } - if (D3D_needreset () > 0) + if (D3D_needreset () > 0) { return NULL; + } if (!isd3d () || !texture) return NULL; @@ -2970,6 +3006,7 @@ double D3D_getrefreshrate (void) { HRESULT hr; D3DDISPLAYMODE dmode; + if (!isd3d ()) return -1; hr = d3ddev->GetDisplayMode (0, &dmode); @@ -2981,6 +3018,7 @@ double D3D_getrefreshrate (void) void D3D_guimode (bool guion) { HRESULT hr; + if (!isd3d ()) return; hr = d3ddev->SetDialogBoxMode (guion ? TRUE : FALSE); diff --git a/od-win32/direct3d.h b/od-win32/direct3d.h index df04c8d5..6b0bf040 100644 --- a/od-win32/direct3d.h +++ b/od-win32/direct3d.h @@ -12,7 +12,6 @@ extern void D3D_flushtexture (int miny, int maxy); 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); @@ -20,6 +19,7 @@ extern void D3D_setcursor (int x, int y, int width, int height, bool visible); 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 diff --git a/od-win32/hardfile_win32.cpp b/od-win32/hardfile_win32.cpp index 25c68237..e6e9b2db 100644 --- a/od-win32/hardfile_win32.cpp +++ b/od-win32/hardfile_win32.cpp @@ -532,7 +532,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname) } 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: diff --git a/od-win32/registry.cpp b/od-win32/registry.cpp index 099b32a4..9a11f7ac 100644 --- a/od-win32/registry.cpp +++ b/od-win32/registry.cpp @@ -139,12 +139,12 @@ int regquerystr (UAEREG *root, const TCHAR *name, TCHAR *str, int *size) 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; } } diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index bbb7dad7..135edfce 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -916,11 +916,14 @@ #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 @@ -943,6 +946,7 @@ #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 @@ -1063,6 +1067,7 @@ #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 @@ -1097,6 +1102,7 @@ #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 @@ -1147,7 +1153,7 @@ #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 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 31e615ae..483e9035 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -135,7 +135,7 @@ BEGIN CONTROL "Remove interlace artifacts",IDC_FLICKERFIXER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,154,142,10 CONTROL "Filtered low resolution",IDC_LORES_SMOOTHED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,140,116,10 CONTROL "Resolution autoswitch",IDC_AUTORESOLUTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,154,116,10 - RTEXT "Resolution:",IDC_STATIC,27,170,110,10,SS_CENTERIMAGE + RTEXT "Resolution:",IDC_STATIC,27,170,110,8,SS_CENTERIMAGE COMBOBOX IDC_LORES,142,169,127,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP RTEXT "Refresh:",IDC_REFRESHTEXT,11,190,57,8 CONTROL "Slider1",IDC_FRAMERATE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,71,185,99,20 @@ -281,11 +281,11 @@ BEGIN EDITTEXT IDC_FLOPPYSPDTEXT,222,183,101,12,ES_CENTER | ES_READONLY GROUPBOX "New Floppy Disk Image",IDC_SETTINGSTEXT,1,211,393,49 COMBOBOX IDC_FLOPPYTYPE,58,225,64,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Create Standard Disk [] Creates a standard 880 or 1760 KB ADF disk image.",IDC_CREATE,131,224,97,15 + PUSHBUTTON "Create Standard Disk [] Creates a standard 880 or 1760 KB ADF disk image.",IDC_CREATE,130,224,97,15 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 RTEXT "Disk label:",IDC_STATIC,60,244,58,10,SS_CENTERIMAGE EDITTEXT IDC_CREATE_NAME,130,243,97,13,ES_AUTOHSCROLL - CONTROL "Bootblock",IDC_FLOPPY_BOOTABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,234,242,59,15 + CONTROL "Bootblock",IDC_FLOPPY_BOOTABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,235,242,59,15 CONTROL "FFS",IDC_FLOPPY_FFS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,300,242,34,15 END @@ -392,18 +392,18 @@ STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN GROUPBOX "Parallel Port",IDC_STATIC,1,1,393,131 - RTEXT "Printer:",IDC_STATIC,6,17,57,15,SS_CENTERIMAGE - COMBOBOX IDC_PRINTERLIST,67,18,317,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Type:",IDC_STATIC,7,39,57,15,SS_CENTERIMAGE - COMBOBOX IDC_PRINTERTYPELIST,67,40,317,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Flush print job",IDC_FLUSHPRINTER,147,57,58,12 - RTEXT "Autoflush [] Time in seconds after a pending print job is automatically flushed.",IDC_PRINTERAUTOFLUSHTXT,209,55,137,15,SS_NOTIFY | SS_CENTERIMAGE - EDITTEXT IDC_PRINTERAUTOFLUSH,351,57,33,12,ES_NUMBER - RTEXT "Ghostscript extra parameters:",IDC_STATIC,8,73,136,15,SS_CENTERIMAGE - EDITTEXT IDC_PS_PARAMS,148,74,236,12,ES_AUTOHSCROLL + RTEXT "Printer:",IDC_STATIC,6,16,57,15,SS_CENTERIMAGE + COMBOBOX IDC_PRINTERLIST,67,17,317,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "Type:",IDC_STATIC,7,38,57,15,SS_CENTERIMAGE + COMBOBOX IDC_PRINTERTYPELIST,67,39,317,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Flush print job",IDC_FLUSHPRINTER,147,58,75,12 + RTEXT "Autoflush [] Time in seconds after a pending print job is automatically flushed.",IDC_PRINTERAUTOFLUSHTXT,236,56,110,15,SS_NOTIFY | SS_CENTERIMAGE + EDITTEXT IDC_PRINTERAUTOFLUSH,351,58,33,12,ES_NUMBER + RTEXT "Ghostscript extra parameters:",IDC_STATIC,8,74,136,15,SS_CENTERIMAGE + EDITTEXT IDC_PS_PARAMS,148,75,236,12,ES_AUTOHSCROLL RTEXT "Sampler:",IDC_STATIC,6,94,57,15,SS_CENTERIMAGE COMBOBOX IDC_SAMPLERLIST,67,95,317,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Stereo sampler",IDC_SAMPLER_STEREO,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,68,113,149,12 + CONTROL "Stereo sampler",IDC_SAMPLER_STEREO,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,68,114,149,12 GROUPBOX "Serial Port",IDC_STATIC,1,137,393,51 COMBOBOX IDC_SERIAL,67,150,317,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "Shared",IDC_SER_SHARED,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,32,171,66,12 @@ -427,17 +427,17 @@ BEGIN GROUPBOX "Mouse and Joystick settings",IDC_STATIC,1,3,393,211 RTEXT "Port 1:",IDC_STATIC,4,18,37,15,SS_CENTERIMAGE COMBOBOX IDC_PORT0_JOYS,45,19,342,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_PORT0_AF,45,37,78,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_PORT0_JOYSMODE,128,38,106,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_PORT0_AF,45,37,86,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_PORT0_JOYSMODE,136,38,106,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Test [] Test Port 1 (mouse) configuration.",IDC_PORT0_TEST,313,37,36,14 PUSHBUTTON "Remap [] Remap Port 1 configurarion.",IDC_PORT0_REMAP,352,37,36,14 RTEXT "Port 2:",IDC_STATIC,6,56,35,15,SS_CENTERIMAGE COMBOBOX IDC_PORT1_JOYS,45,57,342,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_PORT1_AF,45,74,78,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_PORT1_JOYSMODE,128,74,106,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_PORT1_AF,45,74,86,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_PORT1_JOYSMODE,136,74,106,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Test [] Test Port 2 (joystick) configuration.",IDC_PORT1_TEST,313,74,36,14 PUSHBUTTON "Remap [] Remap Port 2 configuration.",IDC_PORT1_REMAP,352,74,36,14 - PUSHBUTTON "Swap ports [] Swap ports 1 and 2.",IDC_SWAP,45,100,78,12 + PUSHBUTTON "Swap ports [] Swap ports 1 and 2.",IDC_SWAP,45,100,78,14 LTEXT "Emulated parallel port joystick adapter",IDC_STATIC,10,124,179,15,SS_CENTERIMAGE RTEXT "X-Arcade layout information []#1",IDC_STATIC,217,124,170,15,SS_NOTIFY | SS_CENTERIMAGE COMBOBOX IDC_PORT2_JOYS,45,142,342,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -473,17 +473,17 @@ BEGIN CONTROL "",IDC_RICHEDIT1,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,65,10,210,21 CONTROL "",IDC_RICHEDIT2,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,43,41,260,20 PUSHBUTTON "Contributors",IDC_CONTRIBUTORS,132,100,80,15 - CONTROL "",IDC_UAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,7,196,106,24 - CONTROL "",IDC_PICASSOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | NOT WS_VISIBLE | WS_DISABLED,213,122,106,24 - CONTROL "",IDC_AMIGAHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,120,161,106,24 - CONTROL "",IDC_WINUAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,232,161,106,24 - CONTROL "",IDC_AIABHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | NOT WS_VISIBLE | WS_DISABLED,24,122,106,24 - CONTROL "",IDC_THEROOTS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,121,225,106,24 - CONTROL "",IDC_CAPS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,232,196,106,24 - CONTROL "",IDC_ABIME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,121,196,106,24 - CONTROL "",IDC_CLOANTOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,7,161,106,24 - CONTROL "",IDC_AMIGASYS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,7,225,106,24 - CONTROL "",IDC_AMIKIT,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,232,225,106,24 + CONTROL "",IDC_UAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,2,196,112,24 + CONTROL "",IDC_PICASSOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | NOT WS_VISIBLE | WS_DISABLED,211,131,112,24 + CONTROL "",IDC_AMIGAHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,116,168,112,24 + CONTROL "",IDC_WINUAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,231,168,112,24 + CONTROL "",IDC_AIABHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | NOT WS_VISIBLE | WS_DISABLED,22,131,112,24 + CONTROL "",IDC_THEROOTS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,117,225,112,24 + CONTROL "",IDC_CAPS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,231,196,112,24 + CONTROL "",IDC_ABIME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,117,196,112,24 + CONTROL "",IDC_CLOANTOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,2,168,112,24 + CONTROL "",IDC_AMIGASYS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,2,225,112,24 + CONTROL "",IDC_AMIKIT,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,231,225,112,24 END IDD_MISC1 DIALOGEX 0, 0, 396, 318 @@ -493,13 +493,13 @@ BEGIN CONTROL "",IDC_MISCLIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,3,5,258,232 GROUPBOX "Miscellaneous Options",IDC_STATIC,266,2,128,138 CTEXT "SCSI and CD/DVD access:",IDC_STATIC,272,14,117,10,SS_CENTERIMAGE - COMBOBOX IDC_SCSIMODE,291,28,79,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SCSIMODE,287,28,87,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CTEXT "Windowed style:",IDC_STATIC,272,45,117,10,SS_CENTERIMAGE - COMBOBOX IDC_WINDOWEDMODE,291,59,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_WINDOWEDMODE,287,59,87,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CTEXT "Graphics API:",IDC_STATIC,272,76,117,10,SS_CENTERIMAGE - COMBOBOX IDC_DXMODE,291,89,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DXMODE,287,89,87,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CTEXT "DirectDraw:",IDC_STATIC,272,106,117,10,SS_CENTERIMAGE - COMBOBOX IDC_DD_SURFACETYPE,291,119,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DD_SURFACETYPE,287,119,87,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP GROUPBOX "GUI",IDC_STATIC,266,144,128,93 CTEXT "Language:",IDC_STATIC,271,154,117,10,SS_CENTERIMAGE COMBOBOX IDC_LANGUAGE,273,168,114,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -749,8 +749,8 @@ BEGIN RTEXT "Analog joy-mouse speed:",-1,147,288,108,10,SS_CENTERIMAGE EDITTEXT IDC_INPUTSPEEDA,260,287,29,12,ES_NUMBER PUSHBUTTON "Copy from:",IDC_INPUTCOPY,324,268,70,14 - COMBOBOX IDC_INPUTCOPYFROM,324,285,70,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Swap 1<>2",IDC_INPUTSWAP,324,301,70,14 + COMBOBOX IDC_INPUTCOPYFROM,324,286,70,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Swap 1<>2",IDC_INPUTSWAP,324,303,70,14 END IDD_FILTER DIALOGEX 0, 0, 396, 288 @@ -865,7 +865,7 @@ BEGIN PUSHBUTTON "Help",IDHELP,479,328,47,14,WS_DISABLED END -IDD_PATHS DIALOGEX 0, 0, 396, 274 +IDD_PATHS DIALOGEX 0, 0, 396, 303 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN @@ -891,12 +891,18 @@ BEGIN LTEXT "Rips:",IDC_PATHS_RIPSL,3,179,260,8,SS_CENTERIMAGE EDITTEXT IDC_PATHS_RIP,3,190,377,15,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_PATHS_RIPS,383,189,11,15 - PUSHBUTTON "Reset to defaults",IDC_PATHS_DEFAULT,2,219,92,14 - PUSHBUTTON "Rescan ROMs",IDC_ROM_RESCAN,2,236,92,14 - PUSHBUTTON "Clear disk history",IDC_RESETDISKHISTORY,2,253,92,14 - COMBOBOX IDC_PATHS_DEFAULTTYPE,99,220,163,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Clear registry",IDC_RESETREGISTRY,99,236,92,14 - CONTROL "Use relative paths",IDC_PATHS_RELATIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,101,255,161,11 + PUSHBUTTON "Reset to defaults",IDC_PATHS_DEFAULT,2,212,92,14 + PUSHBUTTON "Rescan ROMs",IDC_ROM_RESCAN,2,229,92,14 + PUSHBUTTON "Clear disk history",IDC_RESETDISKHISTORY,2,246,92,14 + COMBOBOX IDC_PATHS_DEFAULTTYPE,99,213,163,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Clear registry",IDC_RESETREGISTRY,99,229,92,14 + CONTROL "Use relative paths",IDC_PATHS_RELATIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,101,248,161,11 + EDITTEXT IDC_LOGPATH,3,289,336,13,ES_READONLY + LTEXT "Log:",IDC_STATIC,5,273,67,10,SS_CENTERIMAGE + PUSHBUTTON "Open [] Open selected file.",IDC_LOGOPEN,343,288,51,14 + COMBOBOX IDC_LOGSELECT,54,271,119,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CONTROL "Enable full logging (temporary)",IDC_LOGENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,182,272,145,12 + PUSHBUTTON "Save All [] Save and open both logs and config file.",IDC_LOGSAVE,343,272,51,14 END IDD_QUICKSTART DIALOGEX 0, 0, 396, 262 @@ -1041,11 +1047,11 @@ BEGIN COMBOBOX IDC_RTG_BUFFERCNT,153,162,84,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CTEXT "Aspect ratio:",IDC_STATIC,282,149,83,10,SS_CENTERIMAGE COMBOBOX IDC_RTG_SCALE_ASPECTRATIO,282,162,84,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Miscellaneous Expansions",IDC_STATIC,1,198,172,80 + GROUPBOX "Miscellaneous Expansions",IDC_STATIC,1,197,172,80 CONTROL "Catweasel Z2 emulation [] Catweasel MK2 Zorro II card emulation. Physical Windows compatible Catweasel card and drivers required.",IDC_CATWEASEL, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,216,147,11 CONTROL "uaescsi.device",IDC_SCSIDEVICE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,229,147,11 - GROUPBOX "Network",IDC_STATIC,181,198,213,80 + GROUPBOX "Network",IDC_STATIC,181,197,213,80 CONTROL "bsdsocket.library [] bsdsocket network library emulation.",IDC_SOCKETS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,216,187,11 CONTROL "uaenet.device [] Sana 2 compatible network device emulation. WinPcap required.",IDC_SANA2, diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 8df7369a..f96a52a5 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -116,7 +116,8 @@ void *globalipc, *serialipc; 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; @@ -149,7 +150,6 @@ HKEY hWinUAEKey = NULL; COLORREF g_dwBackgroundColor; static int activatemouse = 1; -int ignore_messages_all; int pause_emulation; static int didmousepos; @@ -175,6 +175,9 @@ TCHAR start_path_plugins[MAX_DPATH]; 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; @@ -975,9 +978,6 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, return 0; } - if (ignore_messages_all) - return DefWindowProc (hWnd, message, wParam, lParam); - switch (message) { @@ -1002,6 +1002,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, ignorelbutton = true; break; case WM_ACTIVATEAPP: + D3D_restore (); if (!wParam && isfullscreen () <= 0 && currprefs.win32_minimize_inactive) minimizewindow (); @@ -2300,6 +2301,7 @@ void toggle_mousegrab (void) { } + #define LOG_BOOT _T("winuaebootlog.txt") #define LOG_NORMAL _T("winuaelog.txt") @@ -2307,20 +2309,24 @@ static bool createbootlog = true; 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 } @@ -2342,7 +2348,7 @@ void logging_init (void) 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); @@ -5936,7 +5942,7 @@ int PASCAL wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdL pChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD); #endif - log_open (NULL, 0, 0); + log_open (NULL, 0, 0, NULL); __try { WinMain2 (hInstance, hPrevInstance, lpCmdLine, nCmdShow); diff --git a/od-win32/win32.h b/od-win32/win32.h index ea430663..e538a6e8 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -19,8 +19,8 @@ #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("") @@ -38,7 +38,6 @@ extern int manual_palette_refresh_needed; 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]; @@ -92,6 +91,9 @@ extern int win_x_diff, win_y_diff; 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); diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 428b7113..09fc5f41 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -1496,8 +1496,8 @@ static int open_windows (int full) } 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); diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 0cb1be89..5344cd6e 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -3328,7 +3328,8 @@ static int disk_swap (int entry, int mode) 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; @@ -4756,6 +4757,68 @@ static void resetregistry (void) 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) { @@ -4812,6 +4875,14 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, 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; @@ -4820,141 +4891,180 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM 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--; } @@ -11817,8 +11927,15 @@ static void init_inputdlg_2 (HWND hDlg) 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++) { @@ -11847,24 +11964,37 @@ static void init_inputdlg (HWND hDlg) } 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); @@ -11967,6 +12097,7 @@ static void values_from_inputdlg (HWND hDlg, int inputchange) 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); diff --git a/od-win32/winuae_msvc10/winuae_msvc.vcxproj b/od-win32/winuae_msvc10/winuae_msvc.vcxproj index fba521ff..3e5ef64a 100644 --- a/od-win32/winuae_msvc10/winuae_msvc.vcxproj +++ b/od-win32/winuae_msvc10/winuae_msvc.vcxproj @@ -794,6 +794,9 @@ Document + + + diff --git a/od-win32/winuae_msvc10/winuae_msvc.vcxproj.filters b/od-win32/winuae_msvc10/winuae_msvc.vcxproj.filters index 30f08932..1f38e8d0 100644 --- a/od-win32/winuae_msvc10/winuae_msvc.vcxproj.filters +++ b/od-win32/winuae_msvc10/winuae_msvc.vcxproj.filters @@ -622,4 +622,7 @@ + + + \ No newline at end of file diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 9799507c..9ed441e8 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,6 +1,29 @@ +- 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 and then changed back to , 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) diff --git a/od-win32/writelog.cpp b/od-win32/writelog.cpp index b6c61969..941a30f3 100644 --- a/od-win32/writelog.cpp +++ b/od-win32/writelog.cpp @@ -550,7 +550,7 @@ TCHAR* buf_out (TCHAR *buffer, int *bufsize, const TCHAR *format, ...) 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; @@ -560,12 +560,14 @@ FILE *log_open (const TCHAR *name, int append, int bootlog) 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")); } } diff --git a/savestate.cpp b/savestate.cpp index 2bb97104..da3c8ad8 100644 --- a/savestate.cpp +++ b/savestate.cpp @@ -1012,7 +1012,7 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c /* 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); diff --git a/zfile.cpp b/zfile.cpp index 3dfa65ea..f7252e59 100644 --- a/zfile.cpp +++ b/zfile.cpp @@ -2229,7 +2229,7 @@ size_t zfile_fwrite (const void *b, size_t l1, size_t l2, struct zfile *z) 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;