Write-protected indicator (part 1)

This commit is contained in:
Cacodemon345
2025-07-21 01:20:54 +06:00
parent 174e92dad9
commit 6b2e58d3b4
12 changed files with 98 additions and 8 deletions

View File

@@ -1517,6 +1517,9 @@ load_other_removable_devices(void)
sprintf(temp, "zip_%02i_image_path", c + 1);
p = ini_section_get_string(cat, temp, "");
sprintf(temp, "zip_%02i_writeprot", c + 1);
zip_drives[c].read_only = ini_section_get_int(cat, temp, 0);
if (!strcmp(p, usr_path))
p[0] = 0x00;
@@ -1630,6 +1633,9 @@ load_other_removable_devices(void)
sprintf(temp, "mo_%02i_image_path", c + 1);
p = ini_section_get_string(cat, temp, "");
sprintf(temp, "mo_%02i_writeprot", c + 1);
mo_drives[c].read_only = ini_section_get_int(cat, temp, 0);
if (!strcmp(p, usr_path))
p[0] = 0x00;
@@ -3090,6 +3096,12 @@ save_other_removable_devices(void)
sprintf(temp, "zip_%02i_scsi_id", c + 1);
ini_section_delete_var(cat, temp);
sprintf(temp, "zip_%02i_writeprot", c + 1);
if (zip_drives[c].read_only)
ini_section_set_int(cat, temp, zip_drives[c].read_only);
else
ini_section_delete_var(cat, temp);
sprintf(temp, "zip_%02i_scsi_location", c + 1);
if (zip_drives[c].bus_type != ZIP_BUS_SCSI)
ini_section_delete_var(cat, temp);
@@ -3146,6 +3158,12 @@ save_other_removable_devices(void)
sprintf(temp, "mo_%02i_scsi_id", c + 1);
ini_section_delete_var(cat, temp);
sprintf(temp, "mo_%02i_writeprot", c + 1);
if (mo_drives[c].read_only)
ini_section_set_int(cat, temp, mo_drives[c].read_only);
else
ini_section_delete_var(cat, temp);
sprintf(temp, "mo_%02i_scsi_location", c + 1);
if (mo_drives[c].bus_type != MO_BUS_SCSI)
ini_section_delete_var(cat, temp);