]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix directory harddrive/HDF uaehf.device conflict.
authorToni Wilen <twilen@winuae.net>
Wed, 18 Apr 2018 14:42:57 +0000 (17:42 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 18 Apr 2018 14:42:57 +0000 (17:42 +0300)
filesys.cpp
hardfile.cpp

index 3e93624e85f248eb8473b21793e1f45c045f3fd0..7165ae924b44ac9240eaad542068f5775c7d5a55 100644 (file)
@@ -1139,7 +1139,13 @@ struct hardfiledata *get_hardfile_data_controller(int nr)
        for (int i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
                if (uip[i].open == 0)
                        continue;
-               if (uip[i].hf.ci.controller_unit == nr)
+               if (uip[i].hf.ci.controller_unit == nr && uip[i].hf.ci.type != UAEDEV_DIR)
+                       return &uip[i].hf;
+       }
+       for (int i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
+               if (uip[i].open == 0)
+                       continue;
+               if (uip[i].hf.ci.controller_unit == nr && uip[i].hf.ci.type == UAEDEV_DIR)
                        return &uip[i].hf;
        }
        return NULL;
index e89852677b433f3d7b71c564af79fe69b154be3c..42791ca25fd7659a18d2899096c24e2555d0aeb3 100644 (file)
@@ -2451,7 +2451,7 @@ static uae_u32 REGPARAM2 hardfile_open (TrapContext *ctx)
                struct hardfileprivdata *hfpd = &hardfpd[unit];
                struct hardfiledata *hfd = get_hardfile_data_controller(unit);
                if (hfd) {
-                       if (is_hardfile(unit) == FILESYS_VIRTUAL) {
+                       if (hfd->ci.type == UAEDEV_DIR) {
                                if (start_thread(ctx, unit)) {
                                        hfpd->directorydrive = true;
                                        trap_put_word(ctx, hfpd->base + 32, trap_get_word(ctx, hfpd->base + 32) + 1);