Skip to content

Commit 3cebcdb

Browse files
committed
Allow overriding device names for hard drive directories
1 parent 6d4e8e7 commit 3cebcdb

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

ChangeLog

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Version 4.0.x:
22

3+
* Allow overriding device names for hard drive directories.
34
* New options midi_in_device, midi_out_device, midi_mt32_device.
45
* Read Data/Devs/Controllers/gamecontrollerdb.txt.
56
* Updated libslirp to version 4.6.1.

docs/options/hard_drive_0_device

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Example: HD0
2+
3+
By default, for mounted folders, the device name is DH0 for hard_drive_0,
4+
DH1 for hard_drive_1, etc. You can override this on a per-drive-basis.

src/fsuae/fsuae-media.c

+9
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ static void configure_hard_drive_directory(int index,
246246
char *mount_name;
247247
char *label_option_name = g_strdup_printf("hard_drive_%d_label", index);
248248
char *label_option = fs_config_get_string(label_option_name);
249+
g_free(label_option_name);
249250
if (label_option) {
250251
mount_name = label_option;
251252
} else {
@@ -265,6 +266,14 @@ static void configure_hard_drive_directory(int index,
265266
}
266267
}
267268

269+
char *device_option_name = g_strdup_printf(
270+
"hard_drive_%d_device", index);
271+
const char *device_option = fs_config_get_const_string(device_option_name);
272+
if (device_option) {
273+
device = device_option;
274+
}
275+
g_free(device_option_name);
276+
268277
fsuae_log("[MEDIA] hard drive mount: %s\n", path);
269278
fsuae_log("[MEDIA] device: %s\n", device);
270279
fsuae_log("[MEDIA] mount name: %s\n", mount_name);

0 commit comments

Comments
 (0)