From: Toni Wilen Date: Sat, 15 Sep 2007 12:49:36 +0000 (+0300) Subject: imported winuaesrc1440b7.zip X-Git-Tag: 2100~200 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=9a2e1b64ec5975ffe1a86b00ccf543dd1ce9dd17;p=francis%2Fwinuae.git imported winuaesrc1440b7.zip --- diff --git a/cfgfile.c b/cfgfile.c index 10db9193..fd63a89b 100755 --- a/cfgfile.c +++ b/cfgfile.c @@ -1128,7 +1128,7 @@ static struct uaedev_config_info *getuci(struct uae_prefs *p) return NULL; } -int add_filesys_config (struct uae_prefs *p, int index, +struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index, char *devname, char *volname, char *rootdir, int readonly, int secspertrack, int surfaces, int reserved, int blocksize, int bootpri, char *filesysdir, int hdc, int flags) { @@ -1136,10 +1136,12 @@ int add_filesys_config (struct uae_prefs *p, int index, int i; char *s; - if (index < 0) + if (index < 0) { uci = getuci(p); - else + uci->configoffset = -1; + } else { uci = &p->mountconfig[index]; + } if (!uci) return 0; uci->ishdf = volname == NULL ? 1 : 0; @@ -1152,7 +1154,6 @@ int add_filesys_config (struct uae_prefs *p, int index, uci->reserved = reserved; uci->blocksize = blocksize; uci->bootpri = bootpri; - uci->configoffset = -1; uci->controller = hdc; strcpy (uci->filesys, filesysdir ? filesysdir : ""); if (!uci->devname[0]) { @@ -1177,7 +1178,7 @@ int add_filesys_config (struct uae_prefs *p, int index, s = filesys_createvolname (volname, rootdir, "Harddrive"); strcpy (uci->volname, s); xfree (s); - return 1; + return uci; } static int cfgfile_parse_hardware (struct uae_prefs *p, char *option, char *value) diff --git a/filesys.c b/filesys.c index 0fcfa41b..46eda7cb 100755 --- a/filesys.c +++ b/filesys.c @@ -113,7 +113,8 @@ typedef struct { int bootpri; /* boot priority */ int devno; int controller; - int wasisempty; /* if true, this unit can be safely ejected and inserted */ + int wasisempty; /* if true, this unit was created empty */ + int canremove; /* if true, this unit can be safely ejected and remounted */ int configureddrive; /* if true, this is drive that was manually configured */ struct hardfiledata hf; @@ -352,7 +353,7 @@ static int set_filesys_volume(const char *rootdir, int *flags, int *readonly, in } static int set_filesys_unit_1 (int nr, - char *devname, char *volname, char *rootdir, int readonly, + char *devname, char *volname, const char *rootdir, int readonly, int secspertrack, int surfaces, int reserved, int blocksize, int bootpri, char *filesysdir, int hdc, int flags) { @@ -400,9 +401,7 @@ static int set_filesys_unit_1 (int nr, if (set_filesys_volume (rootdir, &flags, &readonly, &emptydrive, &ui->zarchive) < 0) return -1; } - //if (!emptydrive) { - ui->volname = filesys_createvolname (volname, rootdir, "harddrive"); - //} + ui->volname = filesys_createvolname (volname, rootdir, "harddrive"); ui->volflags = flags; } else { ui->hf.secspertrack = secspertrack; @@ -441,6 +440,7 @@ static int set_filesys_unit_1 (int nr, ui->self = 0; ui->reset_state = FS_STARTUP; ui->wasisempty = emptydrive; + ui->canremove = emptydrive; ui->rootdir = my_strdup (rootdir); ui->devname = my_strdup (devname); stripsemicolon(ui->devname); @@ -460,7 +460,7 @@ err: } static int set_filesys_unit (int nr, - char *devname, char *volname, char *rootdir, int readonly, + char *devname, char *volname, const char *rootdir, int readonly, int secspertrack, int surfaces, int reserved, int blocksize, int bootpri, char *filesysdir, int hdc, int flags) { @@ -471,7 +471,7 @@ static int set_filesys_unit (int nr, return ret; } -static int add_filesys_unit (char *devname, char *volname, char *rootdir, int readonly, +static int add_filesys_unit (char *devname, char *volname, const char *rootdir, int readonly, int secspertrack, int surfaces, int reserved, int blocksize, int bootpri, char *filesysdir, int hdc, int flags) { @@ -492,6 +492,8 @@ int kill_filesys_unitconfig (struct uae_prefs *p, int nr) if (nr < 0) return 0; uci = &p->mountconfig[nr]; + if (uci->configoffset >= 0) + filesys_media_change (uci->rootdir, 0, uci); while (nr < MOUNT_CONFIG_SIZE) { memmove (&p->mountconfig[nr], &p->mountconfig[nr + 1], sizeof (struct uaedev_config_info)); nr++; @@ -949,6 +951,8 @@ int filesys_eject (int nr) UnitInfo *ui = &mountinfo.ui[nr]; Unit *u = ui->self; + if (!mountertask) + return 0; if (!ui->open || u == NULL) return 0; if (is_hardfile(nr) != FILESYS_VIRTUAL) @@ -983,12 +987,13 @@ void filesys_vsync (void) } } -int filesys_media_change (char *rootdir, int inserted) +int filesys_media_change (const char *rootdir, int inserted, struct uaedev_config_info *uci) { Unit *u; UnitInfo *ui; int nr = -1; char volname[MAX_DPATH], *volptr; + char devname[MAX_DPATH]; if (!mountertask) return 0; @@ -1010,7 +1015,7 @@ int filesys_media_change (char *rootdir, int inserted) if (nr >= 0) ui = &mountinfo.ui[nr]; /* only configured drives have automount support if automount is disabled */ - if (!currprefs.win32_automount_removable && (!ui || !ui->configureddrive)) + if (!currprefs.win32_automount_removable && (!ui || !ui->configureddrive) && (inserted == 0 || inserted == 1)) return 0; if (nr < 0 && !inserted) return 0; @@ -1018,16 +1023,26 @@ int filesys_media_change (char *rootdir, int inserted) if (nr >= 0 && !inserted) return filesys_eject (nr); if (inserted) { - char devname[10]; - volname[0] = 0; - target_get_volume_name(&mountinfo, rootdir, volname, MAX_DPATH, 1, 0); - volptr = volname; - if (!volname[0]) - volptr = NULL; - if (ui && ui->configureddrive && ui->volname) { + if (uci) { + volptr = my_strdup (uci->volname); + } else { + volname[0] = 0; + target_get_volume_name (&mountinfo, rootdir, volname, MAX_DPATH, 1, 0); volptr = volname; - strcpy (volptr, ui->volname); + if (!volname[0]) + volptr = NULL; + if (ui && ui->configureddrive && ui->volname) { + volptr = volname; + strcpy (volptr, ui->volname); + } } + if (!volptr) { + volptr = filesys_createvolname (NULL, rootdir, "removable"); + strcpy (volname, volptr); + xfree (volptr); + volptr = volname; + } + /* new volume inserted and it was previously mounted? */ if (nr >= 0) { if (!filesys_isvolume (u)) /* not going to mount twice */ @@ -1036,17 +1051,28 @@ int filesys_media_change (char *rootdir, int inserted) } /* new volume inserted and it was not previously mounted? * perhaps we have some empty device slots? */ - if (filesys_insert (-1, volptr, rootdir, 0, 0) > 0) - return 1; + nr = filesys_insert (-1, volptr, rootdir, 0, 0); + if (nr >= 100) { + if (uci) + uci->configoffset = nr - 100; + return nr; + } /* nope, uh, need black magic now.. */ - sprintf (devname, "RDH%d", nr_units()); + if (uci) + strcpy (devname, uci->devname); + else + sprintf (devname, "RDH%d", nr_units()); nr = add_filesys_unit (devname, volptr, rootdir, 0, 0, 0, 0, 0, 0, NULL, 0, 0); if (nr < 0) return 0; + if (inserted > 1) + mountinfo.ui[nr].canremove = 1; automountunit = nr; uae_Signal (mountertask, 1 << 17); /* poof */ - return 1; + if (uci) + uci->configoffset = nr; + return 100 + nr; } return 0; } @@ -1063,13 +1089,15 @@ int hardfile_remount (int nr) return 1; } -int filesys_insert (int nr, char *volume, char *rootdir, int readonly, int flags) +int filesys_insert (int nr, char *volume, const char *rootdir, int readonly, int flags) { struct uaedev_config_info *uci; int emptydrive = 0; UnitInfo *ui; Unit *u; + if (!mountertask) + return 0; if (nr < 0) { for (u = units; u; u = u->next) { if (is_hardfile (u->unit) == FILESYS_VIRTUAL) { @@ -1080,7 +1108,7 @@ int filesys_insert (int nr, char *volume, char *rootdir, int readonly, int flags if (!u) { for (u = units; u; u = u->next) { if (is_hardfile (u->unit) == FILESYS_VIRTUAL) { - if (mountinfo.ui[u->unit].wasisempty) + if (mountinfo.ui[u->unit].canremove) break; } } @@ -1137,7 +1165,7 @@ int filesys_insert (int nr, char *volume, char *rootdir, int readonly, int flags put_byte (u->volume + 44, 0); put_byte (u->volume + 172 - 32, 1); uae_Signal (get_long(u->volume + 176 - 32), 1 << 17); - return 1; + return 100 + nr; } /* flags and comments supported? */ @@ -1845,6 +1873,7 @@ static void startup_update_unit (Unit *unit, UnitInfo *uinfo) unit->ui.unit_pipe = uinfo->unit_pipe; unit->ui.back_pipe = uinfo->back_pipe; unit->ui.wasisempty = uinfo->wasisempty; + unit->ui.canremove = uinfo->canremove; } static Unit *startup_create_unit (UnitInfo *uinfo, int num) @@ -5863,7 +5892,7 @@ uae_u8 *save_filesys_common (int *len) uae_u8 *dstbak, *dst; if (nr_units() == 0) return NULL; - dstbak = dst = (uae_u8*)malloc (10000); + dstbak = dst = (uae_u8*)xmalloc (1000); save_u32 (2); save_u64 (a_uniq); save_u64 (key_uniq); @@ -5889,7 +5918,7 @@ uae_u8 *save_filesys (int num, int *len) ui = &mountinfo.ui[num]; write_log ("FS_FILESYS: '%s' '%s'\n", ui->devname, ui->volname); - dstbak = dst = (uae_u8*)malloc (10000); + dstbak = dst = (uae_u8*)xmalloc (100000); save_u32 (2); /* version */ save_u32 (ui->devno); save_u16 (type); diff --git a/filesys_bootrom.c b/filesys_bootrom.c index 81b4a4ef..6aa67af2 100755 --- a/filesys_bootrom.c +++ b/filesys_bootrom.c @@ -1,54 +1,56 @@ db(0x00); db(0x00); db(0x00); db(0x10); db(0x00); db(0x00); db(0x00); db(0x00); - db(0x60); db(0x00); db(0x09); db(0x50); db(0x00); db(0x00); db(0x07); db(0x26); - db(0x00); db(0x00); db(0x00); db(0x34); db(0x00); db(0x00); db(0x01); db(0x68); - db(0x00); db(0x00); db(0x00); db(0x20); db(0x00); db(0x00); db(0x02); db(0x24); - db(0x00); db(0x00); db(0x0b); db(0x84); db(0x00); db(0x00); db(0x0d); db(0x1c); - db(0x43); db(0xfa); db(0x0e); db(0xf2); db(0x4e); db(0xae); db(0xff); db(0xa0); + db(0x60); db(0x00); db(0x09); db(0x70); db(0x00); db(0x00); db(0x07); db(0x36); + db(0x00); db(0x00); db(0x00); db(0x34); db(0x00); db(0x00); db(0x01); db(0x78); + db(0x00); db(0x00); db(0x00); db(0x20); db(0x00); db(0x00); db(0x02); db(0x34); + db(0x00); db(0x00); db(0x0b); db(0xa4); db(0x00); db(0x00); db(0x0d); db(0x3c); + db(0x43); db(0xfa); db(0x0f); db(0x12); db(0x4e); db(0xae); db(0xff); db(0xa0); db(0x20); db(0x40); db(0x20); db(0x28); db(0x00); db(0x16); db(0x20); db(0x40); db(0x4e); db(0x90); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0xff); db(0xfe); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x30); db(0x3c); db(0xff); db(0xfc); - db(0x61); db(0x00); db(0x0b); db(0x32); db(0x2a); db(0x50); db(0x43); db(0xfa); - db(0x0e); db(0xea); db(0x70); db(0x24); db(0x7a); db(0x01); db(0x4e); db(0xae); + db(0x61); db(0x00); db(0x0b); db(0x52); db(0x2a); db(0x50); db(0x43); db(0xfa); + db(0x0f); db(0x0a); db(0x70); db(0x24); db(0x7a); db(0x01); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x4a); db(0x80); db(0x66); db(0x0c); db(0x43); db(0xfa); - db(0x0e); db(0xda); db(0x70); db(0x00); db(0x7a); db(0x00); db(0x4e); db(0xae); + db(0x0e); db(0xfa); db(0x70); db(0x00); db(0x7a); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x28); db(0x40); db(0x4a); db(0xad); db(0x01); db(0x0c); - db(0x67); db(0x4a); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x2c); + db(0x67); db(0x5a); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x2c); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x26); db(0x40); db(0x27); db(0x4c); db(0x01); db(0x9c); db(0x7c); db(0x00); db(0xbc); db(0xad); db(0x01); db(0x0c); db(0x64); db(0x2c); db(0x2f); db(0x06); db(0x7e); db(0x01); db(0x4a); db(0x45); db(0x67); db(0x04); db(0x08); db(0xc7); db(0x00); db(0x02); db(0x2f); db(0x0b); db(0x20); db(0x4b); - db(0x61); db(0x00); db(0x06); db(0x8c); db(0x26); db(0x5f); db(0x0c); db(0x80); + db(0x61); db(0x00); db(0x06); db(0x9c); db(0x26); db(0x5f); db(0x0c); db(0x80); db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x08); db(0x48); db(0x46); db(0x52); db(0x46); db(0x48); db(0x46); db(0x60); db(0xdc); db(0x2c); db(0x1f); db(0x52); db(0x46); db(0x60); db(0xce); db(0x2c); db(0x78); db(0x00); db(0x04); + db(0x22); db(0x4b); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x2c); + db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x22); db(0x4c); db(0x4e); db(0xae); db(0xfe); db(0x62); db(0x30); db(0x3c); - db(0xff); db(0x80); db(0x61); db(0x00); db(0x0a); db(0xb0); db(0x4e); db(0x90); + db(0xff); db(0x80); db(0x61); db(0x00); db(0x0a); db(0xc0); db(0x4e); db(0x90); db(0x72); db(0x03); db(0x74); db(0xf6); db(0x20); db(0x7c); db(0x00); db(0x20); db(0x00); db(0x00); db(0x90); db(0x88); db(0x65); db(0x0a); db(0x67); db(0x08); db(0x78); db(0x00); db(0x22); db(0x44); db(0x4e); db(0xae); db(0xfd); db(0x96); - db(0x41); db(0xfa); db(0x0e); db(0x06); db(0x43); db(0xfa); db(0x00); db(0x1c); - db(0x70); db(0x0a); db(0x61); db(0x00); db(0x0b); db(0xd0); db(0x22); db(0x40); + db(0x41); db(0xfa); db(0x0e); db(0x16); db(0x43); db(0xfa); db(0x00); db(0x1c); + db(0x70); db(0x0a); db(0x61); db(0x00); db(0x0b); db(0xe0); db(0x22); db(0x40); db(0x72); db(0x01); db(0x30); db(0x3c); db(0xff); db(0x48); db(0x61); db(0x00); - db(0x0a); db(0x7c); db(0x4e); db(0x90); db(0x4c); db(0xdf); db(0x7f); db(0xff); + db(0x0a); db(0x8c); db(0x4e); db(0x90); db(0x4c); db(0xdf); db(0x7f); db(0xff); db(0x4e); db(0x75); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x70); db(0x00); db(0x08); db(0xc0); db(0x00); db(0x11); db(0x4e); db(0xae); db(0xfe); db(0xc2); - db(0x43); db(0xfa); db(0x0e); db(0x02); db(0x70); db(0x00); db(0x4e); db(0xae); + db(0x43); db(0xfa); db(0x0e); db(0x12); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x4a); db(0x80); db(0x67); db(0xe4); db(0x2c); db(0x40); - db(0x41); db(0xfa); db(0x0d); db(0xd9); db(0x22); db(0x08); db(0x74); db(0x0f); + db(0x41); db(0xfa); db(0x0d); db(0xe9); db(0x22); db(0x08); db(0x74); db(0x0f); db(0x41); db(0xfa); db(0x00); db(0x22); db(0x26); db(0x08); db(0xe4); db(0x8b); db(0x28); db(0x3c); db(0x00); db(0x00); db(0x1f); db(0x40); db(0x4e); db(0xae); db(0xff); db(0x76); db(0x22); db(0x4e); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); db(0xfe); db(0x62); db(0x60); db(0xbc); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00); db(0x10); db(0x00); db(0x00); db(0x00); db(0x00); db(0x72); db(0x02); db(0x30); db(0x3c); db(0xff); db(0x48); db(0x61); db(0x00); - db(0x0a); db(0x1c); db(0x4e); db(0x90); db(0x22); db(0x00); db(0x6b); db(0x04); + db(0x0a); db(0x2c); db(0x4e); db(0x90); db(0x22); db(0x00); db(0x6b); db(0x04); db(0x61); db(0x00); db(0x07); db(0x88); db(0x70); db(0x00); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x00); db(0x20); db(0x30); db(0x3c); db(0xff); db(0x50); - db(0x61); db(0x00); db(0x0a); db(0x02); db(0x70); db(0x00); db(0x4e); db(0x90); + db(0x61); db(0x00); db(0x0a); db(0x12); db(0x70); db(0x00); db(0x4e); db(0x90); db(0x4a); db(0x80); db(0x67); db(0x00); db(0x00); db(0xa2); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); - db(0x09); db(0xec); db(0x70); db(0x02); db(0x4e); db(0x90); db(0x0c); db(0x40); + db(0x09); db(0xfc); db(0x70); db(0x02); db(0x4e); db(0x90); db(0x0c); db(0x40); db(0x00); db(0x01); db(0x6d); db(0x00); db(0x00); db(0x7c); db(0x6e); db(0x06); db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0xe4); db(0x0c); db(0x40); db(0x00); db(0x02); db(0x6e); db(0x08); db(0x20); db(0x01); db(0x4e); db(0xae); @@ -65,12 +67,12 @@ db(0x35); db(0x7c); db(0x12); db(0x34); db(0x00); db(0x18); db(0x25); db(0x49); db(0x00); db(0x1a); db(0x20); db(0x69); db(0x00); db(0x10); db(0x22); db(0x4a); db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0x00); db(0xff); db(0x74); - db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); db(0x09); db(0x5e); + db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); db(0x09); db(0x6e); db(0x70); db(0x04); db(0x4e); db(0x90); db(0x70); db(0x01); db(0x4c); db(0xdf); db(0x04); db(0x00); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0xc0); db(0xc0); db(0x70); db(0x1a); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x22); db(0x40); db(0x41); db(0xfa); - db(0x0c); db(0xa1); db(0x23); db(0x48); db(0x00); db(0x0a); db(0x41); db(0xfa); + db(0x0c); db(0xb1); db(0x23); db(0x48); db(0x00); db(0x0a); db(0x41); db(0xfa); db(0xff); db(0x28); db(0x23); db(0x48); db(0x00); db(0x0e); db(0x41); db(0xfa); db(0xff); db(0x20); db(0x23); db(0x48); db(0x00); db(0x12); db(0x33); db(0x7c); db(0x02); db(0x14); db(0x00); db(0x08); db(0x70); db(0x03); db(0x4e); db(0xae); @@ -82,7 +84,7 @@ db(0x43); db(0xeb); db(0x01); db(0xa0); db(0x11); db(0xb1); db(0x00); db(0x00); db(0x00); db(0x0e); db(0x52); db(0x40); db(0x0c); db(0x40); db(0x00); db(0x8c); db(0x66); db(0xf2); db(0x20); db(0x0a); db(0xe4); db(0x88); db(0x21); db(0x40); - db(0x00); db(0x36); db(0x22); db(0x48); db(0x41); db(0xfa); db(0x0c); db(0x3b); + db(0x00); db(0x36); db(0x22); db(0x48); db(0x41); db(0xfa); db(0x0c); db(0x4b); db(0x23); db(0x48); db(0x00); db(0x0a); db(0x20); db(0x6b); db(0x01); db(0x98); db(0x41); db(0xe8); db(0x00); db(0x12); db(0x4e); db(0xae); db(0xff); db(0x10); db(0x4c); db(0xdf); db(0x4f); db(0x03); db(0x4e); db(0x75); db(0x48); db(0xe7); @@ -120,13 +122,13 @@ db(0x48); db(0xe7); db(0x40); db(0xe2); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x41); db(0xee); db(0x01); db(0x50); db(0x20); db(0x50); db(0x4a); db(0x90); db(0x67); db(0x1a); db(0x22); db(0x68); db(0x00); db(0x0a); db(0x45); db(0xfa); - db(0x0b); db(0x7c); db(0x10); db(0x19); db(0x12); db(0x1a); db(0xb0); db(0x01); + db(0x0b); db(0x8c); db(0x10); db(0x19); db(0x12); db(0x1a); db(0xb0); db(0x01); db(0x66); db(0x06); db(0x4a); db(0x00); db(0x67); db(0x42); db(0x60); db(0xf2); db(0x20); db(0x50); db(0x60); db(0xe2); db(0x70); db(0x20); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x24); db(0x40); db(0x15); db(0x7c); db(0x00); db(0x08); db(0x00); db(0x08); - db(0x41); db(0xfa); db(0x0b); db(0x52); db(0x25); db(0x48); db(0x00); db(0x0a); - db(0x41); db(0xfa); db(0x0a); db(0xdf); db(0x25); db(0x48); db(0x00); db(0x0e); + db(0x41); db(0xfa); db(0x0b); db(0x62); db(0x25); db(0x48); db(0x00); db(0x0a); + db(0x41); db(0xfa); db(0x0a); db(0xef); db(0x25); db(0x48); db(0x00); db(0x0e); db(0x41); db(0xea); db(0x00); db(0x12); db(0x20); db(0x88); db(0x58); db(0x90); db(0x21); db(0x48); db(0x00); db(0x08); db(0x41); db(0xee); db(0x01); db(0x50); db(0x22); db(0x4a); db(0x4e); db(0xae); db(0xff); db(0x0a); db(0x20); db(0x4a); @@ -229,9 +231,9 @@ db(0x2a); db(0x0a); db(0x24); db(0x52); db(0x53); db(0x87); db(0x60); db(0x8c); db(0x4c); db(0xdf); db(0x7c); db(0xfc); db(0x4e); db(0x75); db(0x61); db(0x00); db(0xfc); db(0x88); db(0x21); db(0x40); db(0x01); db(0x98); db(0x2f); db(0x08); - db(0x30); db(0x3c); db(0xff); db(0xfc); db(0x61); db(0x00); db(0x04); db(0x3e); + db(0x30); db(0x3c); db(0xff); db(0xfc); db(0x61); db(0x00); db(0x04); db(0x4e); db(0x2a); db(0x50); db(0x30); db(0x3c); db(0xff); db(0x28); db(0x61); db(0x00); - db(0x04); db(0x34); db(0x22); db(0x48); db(0x20); db(0x5f); db(0x42); db(0xa8); + db(0x04); db(0x44); db(0x22); db(0x48); db(0x20); db(0x5f); db(0x42); db(0xa8); db(0x01); db(0x90); db(0x42); db(0xa8); db(0x01); db(0x94); db(0x4e); db(0x91); db(0x26); db(0x00); db(0x0c); db(0x43); db(0xff); db(0xfe); db(0x67); db(0x00); db(0xf9); db(0xa8); db(0x0c); db(0x43); db(0x00); db(0x01); db(0x66); db(0x14); @@ -242,10 +244,10 @@ db(0x00); db(0x04); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x20); db(0x5f); db(0x21); db(0x40); db(0x01); db(0x94); db(0x4a); db(0x83); db(0x6a); db(0x0e); db(0x22); db(0x48); db(0x30); db(0x3c); db(0xff); db(0x20); db(0x61); db(0x00); - db(0x03); db(0xdc); db(0x4e); db(0x90); db(0x60); db(0x26); db(0x2c); db(0x4c); + db(0x03); db(0xec); db(0x4e); db(0x90); db(0x60); db(0x26); db(0x2c); db(0x4c); db(0x2f); db(0x08); db(0x4e); db(0xae); db(0xff); db(0x70); db(0x20); db(0x5f); db(0x22); db(0x48); db(0x26); db(0x40); db(0x30); db(0x3c); db(0xff); db(0x20); - db(0x61); db(0x00); db(0x03); db(0xc2); db(0x4e); db(0x90); db(0x70); db(0x00); + db(0x61); db(0x00); db(0x03); db(0xd2); db(0x4e); db(0x90); db(0x70); db(0x00); db(0x27); db(0x40); db(0x00); db(0x08); db(0x27); db(0x40); db(0x00); db(0x10); db(0x27); db(0x40); db(0x00); db(0x20); db(0x4a); db(0xa9); db(0x01); db(0x94); db(0x67); db(0x28); db(0x20); db(0x69); db(0x01); db(0x94); db(0x61); db(0x00); @@ -254,10 +256,10 @@ db(0x00); db(0x04); db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x4c); db(0xdf); db(0x03); db(0x01); db(0x4a); db(0x80); db(0x67); db(0x04); db(0x61); db(0x00); db(0xfa); db(0x70); db(0x4a); db(0x83); db(0x6b); db(0x00); db(0xf9); db(0x0a); - db(0x30); db(0x3c); db(0xff); db(0x18); db(0x61); db(0x00); db(0x03); db(0x76); + db(0x30); db(0x3c); db(0xff); db(0x18); db(0x61); db(0x00); db(0x03); db(0x86); db(0x4e); db(0x90); db(0x20); db(0x03); db(0x16); db(0x29); db(0x00); db(0x4f); db(0x4a); db(0x80); db(0x66); db(0x1a); db(0x27); db(0x7c); db(0x00); db(0x00); - db(0x17); db(0x70); db(0x00); db(0x14); db(0x41); db(0xfa); db(0xf7); db(0xe6); + db(0x17); db(0x70); db(0x00); db(0x14); db(0x41); db(0xfa); db(0xf7); db(0xd6); db(0x20); db(0x08); db(0xe4); db(0x88); db(0x27); db(0x40); db(0x00); db(0x20); db(0x70); db(0xff); db(0x27); db(0x40); db(0x00); db(0x24); db(0x08); db(0x07); db(0x00); db(0x00); db(0x67); db(0x3a); db(0x2c); db(0x78); db(0x00); db(0x04); @@ -279,23 +281,25 @@ db(0x4a); db(0x80); db(0x67); db(0x3a); db(0x20); db(0x52); db(0x24); db(0x40); db(0x22); db(0x4a); db(0x12); db(0xd8); db(0x66); db(0xfc); db(0x13); db(0x7c); db(0x00); db(0x3a); db(0xff); db(0xff); db(0x42); db(0x11); db(0x2c); db(0x78); - db(0x00); db(0x04); db(0x43); db(0xfa); db(0x06); db(0x50); db(0x70); db(0x00); + db(0x00); db(0x04); db(0x43); db(0xfa); db(0x06); db(0x60); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x2c); db(0x40); db(0x22); db(0x0a); db(0x4e); db(0xae); db(0xff); db(0x52); db(0x22); db(0x4e); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); db(0xfe); db(0x62); db(0x22); db(0x4a); db(0x20); db(0x02); db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x70); db(0x00); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x3f); db(0x3e); db(0x2c); db(0x01); db(0x7e); db(0x06); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x43); db(0xfa); - db(0x06); db(0x3a); db(0x70); db(0x24); db(0x4e); db(0xae); db(0xfd); db(0xd8); + db(0x06); db(0x4a); db(0x70); db(0x24); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x4a); db(0x80); db(0x66); db(0x0e); db(0x08); db(0x87); db(0x00); db(0x02); - db(0x43); db(0xfa); db(0x06); db(0x28); db(0x70); db(0x00); db(0x4e); db(0xae); + db(0x43); db(0xfa); db(0x06); db(0x38); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x28); db(0x40); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x2c); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); - db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x20); db(0x40); db(0x21); db(0x4c); - db(0x01); db(0x9c); db(0x48); db(0xe7); db(0x00); db(0x8a); db(0x61); db(0x00); - db(0xfd); db(0xf6); db(0x4c); db(0xdf); db(0x51); db(0x00); db(0x0c); db(0x80); - db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x08); db(0x48); db(0x46); - db(0x52); db(0x46); db(0x48); db(0x46); db(0x60); db(0xe4); db(0x22); db(0x4c); + db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x20); db(0x40); db(0x4a); db(0x80); + db(0x67); db(0x2c); db(0x21); db(0x4c); db(0x01); db(0x9c); db(0x48); db(0xe7); + db(0x00); db(0x8a); db(0x61); db(0x00); db(0xfd); db(0xf2); db(0x4c); db(0xdf); + db(0x51); db(0x00); db(0x0c); db(0x80); db(0xff); db(0xff); db(0xff); db(0xfe); + db(0x67); db(0x08); db(0x48); db(0x46); db(0x52); db(0x46); db(0x48); db(0x46); + db(0x60); db(0xe4); db(0x22); db(0x48); db(0x20); db(0x3c); db(0x00); db(0x00); + db(0x02); db(0x2c); db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x22); db(0x4c); db(0x4e); db(0xae); db(0xfe); db(0x62); db(0x4c); db(0xdf); db(0x7c); db(0xfc); db(0x4e); db(0x75); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x93); db(0xc9); db(0x4e); db(0xae); db(0xfe); db(0xda); db(0x20); db(0x40); db(0x4b); db(0xe8); @@ -313,15 +317,15 @@ db(0x4e); db(0xae); db(0xfe); db(0x8c); db(0x28); db(0x40); db(0x26); db(0x2c); db(0x00); db(0x0a); db(0x30); db(0x3c); db(0xff); db(0x40); db(0x61); db(0x00); db(0x01); db(0xac); db(0x70); db(0x00); db(0x4e); db(0x90); db(0x24); db(0x00); - db(0x70); db(0x01); db(0x61); db(0x00); db(0xfa); db(0x4c); db(0x08); db(0x02); + db(0x70); db(0x01); db(0x61); db(0x00); db(0xfa); db(0x3c); db(0x08); db(0x02); db(0x00); db(0x01); db(0x67); db(0x06); db(0x70); db(0x01); db(0x61); db(0x00); - db(0xfb); db(0xb4); db(0x61); db(0x00); db(0x03); db(0x3c); db(0x60); db(0x00); + db(0xfb); db(0xa4); db(0x61); db(0x00); db(0x03); db(0x3c); db(0x60); db(0x00); db(0x00); db(0xfc); db(0x61); db(0x00); db(0x03); db(0x34); db(0x20); db(0x4d); db(0x4e); db(0xae); db(0xfe); db(0x8c); db(0x28); db(0x40); db(0x4a); db(0x80); db(0x66); db(0x10); db(0x70); db(0x00); db(0x12); db(0x2d); db(0x00); db(0x0f); db(0x03); db(0xc0); db(0x08); db(0xc0); db(0x00); db(0x11); db(0x4e); db(0xae); db(0xfe); db(0xc2); db(0x4a); db(0x2b); db(0x00); db(0xac); db(0x67); db(0x08); - db(0x61); db(0x00); db(0xfc); db(0x58); db(0x42); db(0x2b); db(0x00); db(0xac); + db(0x61); db(0x00); db(0xfc); db(0x48); db(0x42); db(0x2b); db(0x00); db(0xac); db(0x20); db(0x0c); db(0x67); db(0xce); db(0x0c); db(0x6c); db(0x00); db(0x26); db(0x00); db(0x12); db(0x66); db(0x4c); db(0x0c); db(0xac); db(0x40); db(0x00); db(0x00); db(0x00); db(0x00); db(0x14); db(0x66); db(0x42); db(0x0c); db(0x6c); @@ -350,8 +354,8 @@ db(0x60); db(0x00); db(0xff); db(0x08); db(0x28); db(0x43); db(0x61); db(0x04); db(0x60); db(0x00); db(0xff); db(0x00); db(0x0c); db(0xac); db(0x00); db(0x00); db(0x00); db(0x1f); db(0x00); db(0x08); db(0x66); db(0x04); db(0x61); db(0x00); - db(0xfb); db(0x58); db(0x0c); db(0xac); db(0x00); db(0x00); db(0x04); db(0x09); - db(0x00); db(0x08); db(0x66); db(0x04); db(0x61); db(0x00); db(0xfb); db(0x86); + db(0xfb); db(0x48); db(0x0c); db(0xac); db(0x00); db(0x00); db(0x04); db(0x09); + db(0x00); db(0x08); db(0x66); db(0x04); db(0x61); db(0x00); db(0xfb); db(0x76); db(0x22); db(0x54); db(0x20); db(0x6c); db(0x00); db(0x04); db(0x29); db(0x4d); db(0x00); db(0x04); db(0x4e); db(0xee); db(0xfe); db(0x92); db(0x2f); db(0x05); db(0x7a); db(0xfc); db(0x24); db(0x53); db(0x2e); db(0x0a); db(0x22); db(0x0a); @@ -365,7 +369,7 @@ db(0x22); db(0x80); db(0x22); db(0x4a); db(0x24); db(0x51); db(0x70); db(0x18); db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x06); db(0x86); db(0x00); db(0x01); db(0x00); db(0x00); db(0x20); db(0x0a); db(0x66); db(0xec); db(0x26); db(0x87); - db(0x2a); db(0x1f); db(0x4e); db(0x75); db(0x41); db(0xfa); db(0xf4); db(0x7e); + db(0x2a); db(0x1f); db(0x4e); db(0x75); db(0x41); db(0xfa); db(0xf4); db(0x5e); db(0x02); db(0x80); db(0x00); db(0x00); db(0xff); db(0xff); db(0xd1); db(0xc0); db(0x4e); db(0x75); db(0x00); db(0x00); db(0x0c); db(0xaf); db(0x00); db(0x00); db(0x00); db(0x22); db(0x00); db(0x08); db(0x66); db(0x30); db(0x48); db(0xe7); diff --git a/hardfile.c b/hardfile.c index 3242654b..4b406c28 100755 --- a/hardfile.c +++ b/hardfile.c @@ -563,10 +563,11 @@ int scsi_emulate(struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u8 { int pmi = cmdbuf[8] & 1; uae_u32 lba = (cmdbuf[2] << 24) | (cmdbuf[3] << 16) | (cmdbuf[2] << 8) | cmdbuf[3]; - uae_u32 blocks = (uae_u32)(hfd->size / hfd->blocksize - 1); + uae_u32 blocks; int cyl, cylsec, head, tracksec; if (nodisk (hfd)) goto nodisk; + blocks = (uae_u32)(hfd->size / hfd->blocksize - 1); if (hdhfd) { cyl = hdhfd->cyls; head = hdhfd->heads; @@ -745,8 +746,6 @@ void hardfile_do_disk_change (int fsid, int insert) hfd = get_hardfile_data (fsid); if (!hfd) return; - if (hfd->drive_empty == newstate) - return; write_log("uaehf.device:%d media status=%d\n", fsid, insert); hfd->drive_empty = newstate; uae_sem_wait (&change_sem); diff --git a/include/autoconf.h b/include/autoconf.h index a8c487ec..8904df84 100755 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -53,12 +53,12 @@ extern int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mounte extern int kill_filesys_unitconfig (struct uae_prefs *p, int nr); extern int move_filesys_unitconfig (struct uae_prefs *p, int nr, int to); -int filesys_insert(int nr, char *volume, char *rootdir, int readonly, int flags); +int filesys_insert(int nr, char *volume, const char *rootdir, int readonly, int flags); int filesys_eject(int nr); -int filesys_media_change (char *rootdir, int inserted); +int filesys_media_change (const char *rootdir, int inserted, struct uaedev_config_info *uci); extern char *filesys_createvolname (const char *volname, const char *rootdir, const char *def); -extern int target_get_volume_name(struct uaedev_mount_info *mtinf, char *volumepath, char *volumename, int size, int inserted, int fullcheck); +extern int target_get_volume_name(struct uaedev_mount_info *mtinf, const char *volumepath, char *volumename, int size, int inserted, int fullcheck); extern int sprintf_filesys_unit (char *buffer, int num); diff --git a/include/options.h b/include/options.h index 7272aa25..720c28d8 100755 --- a/include/options.h +++ b/include/options.h @@ -327,7 +327,7 @@ extern void save_options (struct zfile *, struct uae_prefs *, int); extern void cfgfile_write (struct zfile *, char *format,...); extern void cfgfile_target_write (struct zfile *, char *format,...); extern void cfgfile_backup (const char *path); -extern int add_filesys_config (struct uae_prefs *p, int index, +extern struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index, char *devname, char *volname, char *rootdir, int readonly, int secspertrack, int surfaces, int reserved, int blocksize, int bootpri, char *filesysdir, int hdc, int flags); diff --git a/inputdevice.c b/inputdevice.c index 9b810629..30b18250 100755 --- a/inputdevice.c +++ b/inputdevice.c @@ -1080,6 +1080,8 @@ int getjoystate (int joy) bot = 1; v = (uae_u8)mouse_x[joy] | (mouse_y[joy] << 8); if (left || right || top || bot || !mouse_port[joy]) { + mouse_x[joy] &= ~3; + mouse_y[joy] &= ~3; if (left) top = !top; if (right) diff --git a/od-win32/dxwrap.h b/od-win32/dxwrap.h index 1a1e05d5..4141774c 100755 --- a/od-win32/dxwrap.h +++ b/od-win32/dxwrap.h @@ -187,11 +187,6 @@ struct DirectDrawSurfaceMapper DDSURFACEDESC2 desc; } temporary; struct - { - LPDIRECTDRAWSURFACE7 surface; - DDSURFACEDESC2 desc; - } temporary2; - struct { DDSURFACEDESC2 desc; } current; diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index d98e6202..cda59cd8 100755 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -1,6 +1,6 @@ // Microsoft Visual C++ generated resource script. // -#include "resource.h" +#include "resource." #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -79,32 +79,32 @@ IDD_DISPLAY DIALOGEX 0, 0, 300, 235 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - GROUPBOX "Screen",IDC_SCREENRESTEXT,12,0,199,67,BS_LEFT + GROUPBOX "Screen",IDC_SCREENRESTEXT,12,0,270,67,BS_LEFT RTEXT "Full screen:",IDC_SELECTRESTEXT,15,17,40,15,SS_CENTERIMAGE - COMBOBOX IDC_DISPLAYSELECT,59,10,147,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_RESOLUTION,59,27,52,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_REFRESHRATE,145,27,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_XSIZE,59,48,35,12,ES_NUMBER - EDITTEXT IDC_YSIZE,103,48,35,12,ES_NUMBER + COMBOBOX IDC_DISPLAYSELECT,59,10,215,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_RESOLUTION,59,27,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_REFRESHRATE,187,27,87,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_XSIZE,59,48,48,12,ES_NUMBER + EDITTEXT IDC_YSIZE,114,48,47,12,ES_NUMBER GROUPBOX "Settings",IDC_SETTINGSTEXT,12,73,199,125 CONTROL "Correct aspect ratio",IDC_ASPECT,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,19,126,92,10 CONTROL "Force low resolution",IDC_LORES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,126,89,10 LTEXT "Refresh:",IDC_REFRESHTEXT,18,162,28,8 CONTROL "Slider1",IDC_FRAMERATE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,47,157,75,20 EDITTEXT IDC_RATETEXT,127,161,77,12,ES_CENTER | ES_READONLY - GROUPBOX "Centering",IDC_STATIC,221,0,61,67 - CONTROL "Horizontal",IDC_XCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,16,49,10 - CONTROL "Vertical",IDC_YCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,32,49,10 - GROUPBOX "Line Mode",IDC_LINEMODE,222,73,61,73 - CONTROL "Normal",IDC_LM_NORMAL,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,231,89,44,10 - CONTROL "Double",IDC_LM_DOUBLED,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,231,105,45,10 - CONTROL "Scanlines",IDC_LM_SCANLINES,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,231,121,46,10 + GROUPBOX "Centering",IDC_STATIC,221,73,61,49 + CONTROL "Horizontal",IDC_XCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,87,49,10 + CONTROL "Vertical",IDC_YCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,103,49,10 + GROUPBOX "Line Mode",IDC_LINEMODE,222,126,61,73 + CONTROL "Normal",IDC_LM_NORMAL,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,231,142,44,10 + CONTROL "Double",IDC_LM_DOUBLED,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,231,158,45,10 + CONTROL "Scanlines",IDC_LM_SCANLINES,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,231,174,46,10 COMBOBOX IDC_DA_MODE,20,211,58,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_DA_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,84,207,101,20 LTEXT "FPS adj.:",IDC_REFRESH2TEXT,16,182,32,8 CONTROL "",IDC_FRAMERATE2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,47,177,127,20 EDITTEXT IDC_RATE2TEXT,178,181,26,12,ES_CENTER | ES_READONLY - COMBOBOX IDC_RESOLUTIONDEPTH,112,27,32,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_RESOLUTIONDEPTH,135,27,46,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Filtered low resolution",IDC_LORES_SMOOTHED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,140,89,10 COMBOBOX IDC_SCREENMODE_NATIVE,100,85,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_SCREENMODE_RTG,100,103,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP diff --git a/od-win32/win32.c b/od-win32/win32.c index ca63b0ce..8b80a688 100755 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -1007,7 +1007,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, write_log("Shell Notification %d '%s'\n", inserted, path); if (!win32_hardfile_media_change ()) { if ((inserted && CheckRM (path)) || !inserted) - filesys_media_change (path, inserted); + filesys_media_change (path, inserted, NULL); } } } @@ -1047,7 +1047,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, if (type == DRIVE_REMOVABLE || type == DRIVE_CDROM || !inserted) { if (!win32_hardfile_media_change ()) { if ((inserted && CheckRM (drvname)) || !inserted) - filesys_media_change (drvname, inserted); + filesys_media_change (drvname, inserted, NULL); } } } diff --git a/od-win32/win32.h b/od-win32/win32.h index 62d55b55..4ad5f98e 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,9 +15,9 @@ #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define WINUAEBETA 6 +#define WINUAEBETA 7 #define WINUAEPUBLICBETA 1 -#define WINUAEDATE MAKEBD(2007, 9, 12) +#define WINUAEDATE MAKEBD(2007, 9, 15) #define WINUAEEXTRA "" #define WINUAEREV "" diff --git a/od-win32/win32_filesys.c b/od-win32/win32_filesys.c index 4ce232ee..3e61affd 100755 --- a/od-win32/win32_filesys.c +++ b/od-win32/win32_filesys.c @@ -40,7 +40,7 @@ static int valid_volumename(struct uaedev_mount_info *mountinfo, char *volumenam } /* Returns 1 if an actual volume-name was found, 2 if no volume-name (so uses some defaults) */ -int target_get_volume_name(struct uaedev_mount_info *mtinf, char *volumepath, char *volumename, int size, int inserted, int fullcheck) +int target_get_volume_name(struct uaedev_mount_info *mtinf, const char *volumepath, char *volumename, int size, int inserted, int fullcheck) { int result = 2; int drivetype; diff --git a/od-win32/win32_scale2x.c b/od-win32/win32_scale2x.c index 3ba0eb24..9fc3fa24 100755 --- a/od-win32/win32_scale2x.c +++ b/od-win32/win32_scale2x.c @@ -56,6 +56,10 @@ void S2X_free (void) if (tempsurf) IDirectDrawSurface7_Release (DirectDrawState.temporary.surface); tempsurf = 0; + xfree (tempsurf2); + tempsurf2 = 0; + xfree (tempsurf3); + tempsurf3 = 0; } void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd) @@ -102,7 +106,7 @@ void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd) if (usedfilter->type == UAE_FILTER_HQ) { tempsurf2 = xmalloc (amiga_width * amiga_height * (amiga_depth / 8)); - tempsurf3 = xmalloc (amiga_width * amiga_height * (dst_depth / 8) * 4); + tempsurf3 = xmalloc (dst_width * dst_height * (dst_depth / 8) * 4); } } @@ -228,7 +232,7 @@ void S2X_render (void) } else if (usedfilter->type == UAE_FILTER_HQ) { /* 32/2X+3X+4X */ - if (tempsurf2) { + if (tempsurf2 && scale == 2) { /* Aaaaaaaarghhhghgh.. */ uae_u8 *sptr2 = tempsurf3; uae_u8 *dptr2 = tempsurf2; @@ -239,14 +243,12 @@ void S2X_render (void) dptr2 += w; sptr += gfxvidinfo.rowbytes; } - if (scale == 2) { - if (amiga_depth == 16 && dst_depth == 32) { - hq2x_32 (tempsurf2, tempsurf3, aw, ah, aw * scale * 4); - ok = 1; - } else if (amiga_depth == 16 && dst_depth == 16) { - hq2x_16 (tempsurf2, tempsurf3, aw, ah, aw * scale * 2); - ok = 1; - } + if (amiga_depth == 16 && dst_depth == 32) { + hq2x_32 (tempsurf2, tempsurf3, aw, ah, aw * scale * 4); + ok = 1; + } else if (amiga_depth == 16 && dst_depth == 16) { + hq2x_16 (tempsurf2, tempsurf3, aw, ah, aw * scale * 2); + ok = 1; } for (i = 0; i < ah * scale; i++) { int w = aw * scale * (dst_depth / 8); @@ -255,21 +257,6 @@ void S2X_render (void) dptr += pitch; } } -#if 0 - } else if (scale == 3) { - if (amiga_depth == 16 && dst_depth == 16) { - hq3x_16 (sptr, dptr, aw, ah, hqdstpitch, hqsrcpitch, hqdstpitch2); - ok = 1; - } else if (amiga_depth == 16 && dst_depth == 32) { - hq3x_32 (sptr, dptr, aw, ah, hqdstpitch, hqsrcpitch, hqdstpitch2); - ok = 1; - } - } else if (scale == 4) { - if (amiga_depth == 16 && dst_depth == 32) { - hq4x_32 (sptr, dptr, aw, ah, hqdstpitch, hqsrcpitch, hqdstpitch2); - ok = 1; - } -#endif } else if (usedfilter->type == UAE_FILTER_SUPEREAGLE) { /* 16/2X */ diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index c95a2581..9119204d 100755 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -559,25 +559,22 @@ BOOL CALLBACK displaysCallback (GUID *guid, LPSTR desc, LPSTR name, LPVOID ctx, return 0; md++; } - sprintf (tmp, "%d: %s", md - Displays, desc); - md->name = my_strdup (tmp); + lpmi.cbSize = sizeof (lpmi); if (guid == 0) { POINT pt = { 0, 0 }; md->primary = 1; - lpmi.cbSize = sizeof (lpmi); GetMonitorInfo(MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY), (LPMONITORINFO)&lpmi); - md->rect = lpmi.rcMonitor; } else { memcpy (&md->guid, guid, sizeof (GUID)); + GetMonitorInfo(hm, (LPMONITORINFO)&lpmi); } + md->rect = lpmi.rcMonitor; + if (md->rect.left == 0 && md->rect.top == 0) + sprintf (tmp, "%s (%d*%d)", desc, md->rect.right - md->rect.left, md->rect.bottom - md->rect.top); + else + sprintf (tmp, "%s (%d*%d) [%d*%d]", desc, md->rect.right - md->rect.left, md->rect.bottom - md->rect.top, md->rect.left, md->rect.top); + md->name = my_strdup (tmp); write_log ("'%s' '%s' %s\n", desc, name, outGUID(guid)); - if ((strstr(desc, "X1900") || strstr(desc, "X1800") || strstr(desc, "X1600")) && !b0rken_ati_overlay) { - b0rken_ati_overlay = 1; - if (!os_vista) { - write_log ("** Radeon X1x00 series display card detected, enabling overlay workaround.\n"); - write_log ("** (blank display with Catalyst 6.1 and newer). Use -disableowr to disable workaround.\n"); - } - } return 1; } @@ -609,17 +606,30 @@ void enumeratedisplays (int multi) } } +static int makesort (struct MultiDisplay *md) +{ + int v; + + v = md->rect.top * 65536 + md->rect.left; + if (md->primary) + v = 0x80000001; + if (md->rect.top == 0 && md->rect.left == 0) + v = 0x80000000; + return v; +} + void sortdisplays (void) { struct MultiDisplay *md1, *md2, tmp; int i; -#if 0 md1 = Displays; while (md1->name) { + int sort1 = makesort (md1); md2 = md1 + 1; while (md2->name) { - if (md1->primary < md2->primary || (md1->primary == md2->primary && strcmp (md1->name, md2->name) > 0)) { + int sort2 = makesort (md2); + if (sort1 > sort2) { memcpy (&tmp, md1, sizeof (tmp)); memcpy (md1, md2, sizeof (tmp)); memcpy (md2, &tmp, sizeof (tmp)); @@ -628,7 +638,7 @@ void sortdisplays (void) } md1++; } -#endif + md1 = Displays; while (md1->name) { DisplayModes = md1->DisplayModes = xmalloc (sizeof (struct PicassoResolution) * MAX_PICASSO_MODES); diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index 932dcadb..0ca2de7d 100755 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -6328,34 +6328,39 @@ static INT_PTR CALLBACK HarddriveSettingsProc (HWND hDlg, UINT msg, WPARAM wPara return FALSE; } -static void new_filesys (HWND hDlg) +static void new_filesys (HWND hDlg, int entry) { - int result; + struct uaedev_config_info *uci; - result = add_filesys_config (&workprefs, -1, current_fsvdlg.device, current_fsvdlg.volume, + uci = add_filesys_config (&workprefs, entry, current_fsvdlg.device, current_fsvdlg.volume, current_fsvdlg.rootdir, ! current_fsvdlg.rw, 0, 0, 0, 0, current_fsvdlg.bootpri, 0, 0, 0); - + if (uci) + filesys_media_change (uci->rootdir, 1, uci); } -static void new_hardfile (HWND hDlg) +static void new_hardfile (HWND hDlg, int entry) { - int result; + struct uaedev_config_info *uci; - result = add_filesys_config (&workprefs, -1, current_hfdlg.devicename, 0, + uci = add_filesys_config (&workprefs, entry, current_hfdlg.devicename, 0, current_hfdlg.filename, ! current_hfdlg.rw, current_hfdlg.sectors, current_hfdlg.surfaces, current_hfdlg.reserved, current_hfdlg.blocksize, current_hfdlg.bootpri, current_hfdlg.fsfilename, current_hfdlg.controller, 0); + if (uci) + hardfile_do_disk_change (uci->configoffset, 1); } -static void new_harddrive (HWND hDlg) +static void new_harddrive (HWND hDlg, int entry) { - int result; + struct uaedev_config_info *uci; - result = add_filesys_config (&workprefs, -1, 0, 0, + uci = add_filesys_config (&workprefs, entry, 0, 0, current_hfdlg.filename, ! current_hfdlg.rw, 0, 0, 0, current_hfdlg.blocksize, 0, 0, current_hfdlg.controller, 0); + if (uci) + hardfile_do_disk_change (uci->configoffset, 1); } static void harddisk_remove (HWND hDlg) @@ -6414,10 +6419,7 @@ static void harddisk_edit (HWND hDlg) current_hfdlg.bootpri = uci->bootpri; if (CustomDialogBox(IDD_HARDFILE, hDlg, HardfileSettingsProc)) { - int result = add_filesys_config (&workprefs, entry, current_hfdlg.devicename, 0, current_hfdlg.filename, - ! current_hfdlg.rw, current_hfdlg.sectors, current_hfdlg.surfaces, - current_hfdlg.reserved, current_hfdlg.blocksize, current_hfdlg.bootpri, - current_hfdlg.fsfilename, current_hfdlg.controller, 0); + new_hardfile (hDlg, entry); } } else if (type == FILESYS_HARDDRIVE) /* harddisk */ @@ -6427,10 +6429,7 @@ static void harddisk_edit (HWND hDlg) current_hfdlg.filename[(sizeof current_hfdlg.filename) - 1] = '\0'; if (CustomDialogBox(IDD_HARDDRIVE, hDlg, HarddriveSettingsProc)) { - int result = add_filesys_config (&workprefs, entry, 0, 0, current_hfdlg.filename, - ! current_hfdlg.rw, 0, 0, - 0, current_hfdlg.blocksize, current_hfdlg.bootpri, 0, - current_hfdlg.controller, 0); + new_harddrive (hDlg, entry); } } else /* Filesystem */ @@ -6448,9 +6447,7 @@ static void harddisk_edit (HWND hDlg) current_fsvdlg.bootpri = uci->bootpri; archivehd = -1; if (CustomDialogBox(IDD_FILESYS, hDlg, VolumeSettingsProc)) { - int result = add_filesys_config (&workprefs, entry, current_fsvdlg.device, current_fsvdlg.volume, - current_fsvdlg.rootdir, !current_fsvdlg.rw, 0, 0, 0, 0, current_fsvdlg.bootpri, 0, 0, 0); - filesys_insert (entry, current_fsvdlg.volume, current_fsvdlg.rootdir, !current_fsvdlg.rw, 0); + new_filesys (hDlg, entry); } } } @@ -6469,19 +6466,19 @@ static void harddiskdlg_button (HWND hDlg, int button) current_fsvdlg = empty_fsvdlg; archivehd = 0; if (CustomDialogBox(IDD_FILESYS, hDlg, VolumeSettingsProc)) - new_filesys (hDlg); + new_filesys (hDlg, -1); break; case IDC_NEW_FSARCH: archivehd = 1; current_fsvdlg = empty_fsvdlg; if (CustomDialogBox(IDD_FILESYS, hDlg, VolumeSettingsProc)) - new_filesys (hDlg); + new_filesys (hDlg, -1); break; case IDC_NEW_HF: current_hfdlg = empty_hfdlg; if (CustomDialogBox (IDD_HARDFILE, hDlg, HardfileSettingsProc)) - new_hardfile (hDlg); + new_hardfile (hDlg, -1); break; case IDC_NEW_HD: @@ -6492,7 +6489,7 @@ static void harddiskdlg_button (HWND hDlg, int button) gui_message (tmp); } else { if (CustomDialogBox (IDD_HARDDRIVE, hDlg, HarddriveSettingsProc)) - new_harddrive (hDlg); + new_harddrive (hDlg, -1); } break; @@ -9572,6 +9569,13 @@ static void centerWindow (HWND hDlg) SetWindowPos (hDlg, HWND_TOP, x, y, 0, 0, SWP_NOSIZE); } +static int do_filesys_insert (const char *root) +{ + if (filesys_insert (-1, NULL, root, 0, 0) == 0) + return filesys_media_change (root, 2, NULL); + return 1; +} + int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) { int cnt, i, drv, firstdrv, list; @@ -9633,7 +9637,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) } if (currentpage < 0 && i == 0) { - if (filesys_insert (-1, NULL, file, 0, 0)) + if (do_filesys_insert (file)) continue; } @@ -9687,7 +9691,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) case ZFILE_HDF: if (flags & FILE_ATTRIBUTE_DIRECTORY) { if (!full_property_sheet && currentpage < 0) - filesys_insert (-1, NULL, file, 0, 0); + do_filesys_insert (file); else add_filesys_config (&workprefs, -1, NULL, "", file, 0, 0, 0, 0, 0, 0, NULL, 0, 0); @@ -9718,7 +9722,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) break; default: if (currentpage < 0 && !full_property_sheet) { - filesys_insert (-1, NULL, file, 0, 0); + do_filesys_insert (file); } else if (currentpage == HARDDISK_ID) { add_filesys_config (&workprefs, -1, NULL, "", file, 0, 0, 0, 0, 0, 0, NULL, 0, 0); diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 5421d9b3..9ec0dedf 100755 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,17 @@ + +Beta 7: + +- hq2x crash fix (too small temp buffer) +- directory/archive dragndrop work now without empty spare drives +- uaehf.device media insertion detection fixed +- display size and position (if not 0*0) added to display name list +- joystick direction does not get stuck anymore if active mouse and + joystick is configured to same port using input panel +- allocate more temporary memory space for filesystem state saving +- GUI add/remove directory filesystem work on the fly (hardfiles not + supported) + Beta 6: (DO NOT USE OLDER BETAS, they are too broken) - real harddrive support improvements: diff --git a/savestate.c b/savestate.c index 76f1e7c9..7d80e851 100755 --- a/savestate.c +++ b/savestate.c @@ -285,8 +285,10 @@ static uae_u8 *restore_chunk (struct zfile *f, char *name, size_t *len, size_t * if (len2 < 0) len2 = 0; *len = len2; - if (len2 == 0) + if (len2 == 0) { + *filepos = zfile_ftell (f); return 0; + } /* chunk flags */ zfile_fread (tmp, 1, 4, f); @@ -354,6 +356,13 @@ void restore_ram (size_t filepos, uae_u8 *memory) } } +static uae_u8 *restore_log (uae_u8 *src) +{ + write_log (src); + src += strlen(src) + 1; + return src; +} + static void restore_header (uae_u8 *src) { char *emuname, *emuversion, *description; @@ -377,12 +386,15 @@ void restore_state (char *filename) uae_u8 *chunk,*end; char name[5]; size_t len, totallen; - size_t filepos; + size_t filepos, filesize; chunk = 0; f = zfile_fopen (filename, "rb"); if (!f) goto error; + zfile_fseek (f, 0, SEEK_END); + filesize = zfile_ftell (f); + zfile_fseek (f, 0, SEEK_SET); savestate_init (); chunk = restore_chunk (f, name, &len, &totallen, &filepos); @@ -404,8 +416,13 @@ void restore_state (char *filename) name[0] = 0; chunk = end = restore_chunk (f, name, &len, &totallen, &filepos); write_log ("Chunk '%s' size %d (%d)\n", name, len, totallen); - if (!strcmp (name, "END ")) + if (!strcmp (name, "END ")) { +#ifdef _DEBUG + if (filesize > filepos + 8) + continue; +#endif break; + } if (!strcmp (name, "CRAM")) { restore_cram (totallen, filepos); continue; @@ -519,7 +536,7 @@ void restore_state (char *filename) else if (!strcmp (name, "CONF")) end = restore_configuration (chunk); else if (!strcmp (name, "LOG ")) - end = chunk + len; + end = restore_log (chunk); else { end = chunk + len; write_log ("unknown chunk '%s' size %d bytes\n", name, len);