Commit 8717434e authored by GnoStiC's avatar GnoStiC

puae 2.3.1

parent 29e62985
......@@ -445,7 +445,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
if (!run_once) {
run_once++;
const char *floppy_path = currprefs.path_floppy;
const char *floppy_path = currprefs.path_floppy.path[driveNumber];
if (floppy_path != NULL) {
char homedir[MAX_PATH];
......
......@@ -943,7 +943,7 @@ static void did_romchange (GtkWidget *w, gpointer data)
gtk_widget_set_sensitive (rom_change_widget, 0);
rom_selector = make_file_selector ("Select a ROM file", did_rom_select, did_close_rom);
filesel_set_path (rom_selector, currprefs.path_rom);
filesel_set_path (rom_selector, currprefs.path_rom.path[0]);
}
static GtkWidget *key_selector;
......@@ -975,7 +975,7 @@ static void did_keychange (GtkWidget *w, gpointer data)
gtk_widget_set_sensitive (key_change_widget, 0);
key_selector = make_file_selector ("Select a Kickstart key file", did_key_select, did_close_key);
filesel_set_path (key_selector, currprefs.path_rom);
filesel_set_path (key_selector, currprefs.path_rom.path[0]);
}
static void add_empty_vbox (GtkWidget *tobox)
......@@ -1136,7 +1136,7 @@ static void make_floppy_disks (GtkWidget *vbox)
gtk_widget_set_sensitive(floppy_widget[i], 0);
floppyfileentry_set_drivename (FLOPPYFILEENTRY (floppy_widget[i]), buf);
floppyfileentry_set_label (FLOPPYFILEENTRY (floppy_widget[i]), buf);
floppyfileentry_set_currentdir (FLOPPYFILEENTRY (floppy_widget[i]), currprefs.path_floppy);
floppyfileentry_set_currentdir (FLOPPYFILEENTRY (floppy_widget[i]), currprefs.path_floppy.path[i]);
gtk_box_pack_start (GTK_BOX (vbox), floppy_widget[i], FALSE, TRUE, 0);
gtk_widget_show (floppy_widget[i]);
gtk_signal_connect (GTK_OBJECT (floppy_widget[i]), "disc-changed", (GtkSignalFunc) disc_changed, GINT_TO_POINTER (i));
......
......@@ -79,7 +79,7 @@ static const char *get_last_floppy_dir (void)
atexit (free_last_floppy_dir);
}
last_floppy_dir = my_strdup (currprefs.path_floppy);
last_floppy_dir = my_strdup (currprefs.path_floppy.path[0]);
}
return last_floppy_dir;
}
......
......@@ -241,6 +241,17 @@ static void removeext (TCHAR *s, TCHAR *ext)
s[_tcslen (s) - _tcslen (ext)] = 0;
}
static bool checkwrite (struct zfile *zf, int *retcode)
{
if (zfile_needwrite (zf)) {
if (retcode)
*retcode = -1;
return true;
}
return false;
}
static uae_u8 exeheader[]={ 0x00,0x00,0x03,0xf3,0x00,0x00,0x00,0x00 };
static TCHAR *diskimages[] = { "adf", "adz", "ipf", "fdi", "dms", "wrp", "dsq", 0 };
......@@ -1057,6 +1068,8 @@ static struct zfile *dms (struct zfile *z, int index, int *retcode)
int i;
struct zfile *zextra[DMS_EXTRA_SIZE] = { 0 };
if (checkwrite (z, retcode))
return NULL;
if (recursive)
return NULL;
if (ext) {
......@@ -1473,6 +1486,17 @@ static struct zfile *openzip (const TCHAR *pname)
return 0;
}
static bool writeneeded (const TCHAR *mode)
{
return _tcschr (mode, 'w') || _tcschr (mode, 'a') || _tcschr (mode, '+') || _tcschr (mode, 't');
}
bool zfile_needwrite (struct zfile *zf)
{
if (!zf->mode)
return false;
return writeneeded (zf->mode);
}
static struct zfile *zfile_fopen_2 (const TCHAR *name, const TCHAR *mode, int mask)
{
struct zfile *l;
......@@ -1486,7 +1510,7 @@ static struct zfile *zfile_fopen_2 (const TCHAR *name, const TCHAR *mode, int ma
#endif
l = openzip (name);
if (l) {
if (_tcsicmp (mode, "rb") && _tcsicmp (mode, "r")) {
if (writeneeded (mode)) {
zfile_fclose (l);
return 0;
}
......@@ -1584,8 +1608,6 @@ static struct zfile *zfile_fopen_x (const TCHAR *name, const TCHAR *mode, int ma
l = zfile_fopen_2 (path, mode, mask);
if (!l)
return 0;
if (_tcschr (mode, 'w') || _tcschr (mode, 'a'))
return l;
l2 = NULL;
while (cnt-- > 0) {
int rc;
......
......@@ -118,6 +118,11 @@ struct zfile *archive_access_select (struct znode *parent, struct zfile *zf, uns
*retcode = 0;
if (index > 0)
return NULL;
if (zfile_needwrite (zf)) {
if (retcode)
*retcode = -1;
return NULL;
}
zv = getzvolume (parent, zf, id);
if (!zv)
return NULL;
......@@ -220,6 +225,11 @@ struct zfile *archive_access_select (struct znode *parent, struct zfile *zf, uns
struct zfile *archive_access_arcacc_select (struct zfile *zf, unsigned int id, int *retcode)
{
if (zfile_needwrite (zf)) {
if (retcode)
*retcode = -1;
return NULL;
}
return zf;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment