diff --git a/src/WIN/win.c b/src/WIN/win.c index df1fe3e0f..4da18a9cc 100644 --- a/src/WIN/win.c +++ b/src/WIN/win.c @@ -1794,6 +1794,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM { HMENU hmenu; RECT rect; + int i = 0; switch (message) { @@ -2022,7 +2023,53 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM if (msgbox_reset_yn(ghwnd) == IDYES) { config_save(config_file_default); + for (i = 0; i < FDD_NUM; i++) + { + disc_close(i); + } + for (i = 0; i < CDROM_NUM; i++) + { + cdrom_drives[i].handler->exit(i); + if (cdrom_drives[i].host_drive == 200) + { + image_close(i); + } + else if ((cdrom_drives[i].host_drive >= 'A') && (cdrom_drives[i].host_drive <= 'Z')) + { + ioctl_close(i); + } + else + { + null_close(i); + } + } loadconfig(wopenfilestring); + for (i = 0; i < CDROM_NUM; i++) + { + if (cdrom_drives[i].bus_type) + { + SCSIReset(cdrom_drives[i].scsi_device_id, cdrom_drives[i].scsi_device_lun); + } + + if (cdrom_drives[i].host_drive == 200) + { + image_open(i, cdrom_image[i].image_path); + } + else if ((cdrom_drives[i].host_drive >= 'A') && (cdrom_drives[i].host_drive <= 'Z')) + { + ioctl_open(i, cdrom_drives[i].host_drive); + } + else + { + cdrom_null_open(i, cdrom_drives[i].host_drive); + } + } + + disc_load(0, discfns[0]); + disc_load(1, discfns[1]); + disc_load(2, discfns[2]); + disc_load(3, discfns[3]); + /* pclog_w(L"NVR path: %s\n", nvr_path); */ mem_resize(); loadbios();