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;
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);