From 852ed21e88b4cd86d2b99228e757f2d27e5e9809 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Fri, 21 Oct 2016 00:57:50 +0100 Subject: [PATCH] cdvdgigaherz: Remove no drive support It's the same as "No disc" or having no disc in the drive. --- plugins/cdvdGigaherz/src/CDVD.cpp | 7 ++--- plugins/cdvdGigaherz/src/Windows/config.cpp | 29 +++++++++------------ 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/plugins/cdvdGigaherz/src/CDVD.cpp b/plugins/cdvdGigaherz/src/CDVD.cpp index 57c3cce01c..2d89d88a75 100644 --- a/plugins/cdvdGigaherz/src/CDVD.cpp +++ b/plugins/cdvdGigaherz/src/CDVD.cpp @@ -216,11 +216,8 @@ s32 CALLBACK CDVDopen(const char *pTitleFilename) break; } } - } - - if (source_drive == '@') { - curDiskType = CDVD_TYPE_NODISC; - return 0; + if (source_drive == '-') + return -1; } sprintf(csrc, "\\\\.\\%c:", source_drive); diff --git a/plugins/cdvdGigaherz/src/Windows/config.cpp b/plugins/cdvdGigaherz/src/Windows/config.cpp index 1c8b835855..9d82a819e0 100644 --- a/plugins/cdvdGigaherz/src/Windows/config.cpp +++ b/plugins/cdvdGigaherz/src/Windows/config.cpp @@ -152,24 +152,17 @@ char *path[] = { "N:", "O:", "P:", "Q:", "R:", "S:", "T:", "U:", "V:", "W:", "X:", "Y:", "Z:", }; -int n, s; - static INT_PTR CALLBACK ConfigProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; char temp[20] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; switch (uMsg) { - - case WM_PAINT: - return FALSE; - case WM_INITDIALOG: - - n = 0; - s = 0; + case WM_INITDIALOG: { + int n = -1; + int s = 0; SendMessage(GetDlgItem(hWnd, IDC_DRIVE), CB_RESETCONTENT, 0, 0); - SendMessage(GetDlgItem(hWnd, IDC_DRIVE), CB_ADDSTRING, 0, (LPARAM) "@ (No disc)"); for (char d = 'A'; d <= 'Z'; d++) { if (GetDriveType(path[d - 'A']) == DRIVE_CDROM) { n++; @@ -182,20 +175,22 @@ static INT_PTR CALLBACK ConfigProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l } } - SendMessage(GetDlgItem(hWnd, IDC_DRIVE), CB_SETCURSEL, s, 0); + if (n != -1) + SendMessage(GetDlgItem(hWnd, IDC_DRIVE), CB_SETCURSEL, s, 0); - break; + } break; case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { case IDOK: - GetDlgItemText(hWnd, IDC_DRIVE, temp, 20); - temp[19] = 0; - source_drive = temp[0]; - - WriteSettings(); + if (SendMessage(GetDlgItem(hWnd, IDC_DRIVE), CB_GETCOUNT, 0, 0) > 0) { + GetDlgItemText(hWnd, IDC_DRIVE, temp, 20); + temp[19] = 0; + source_drive = temp[0]; + WriteSettings(); + } EndDialog(hWnd, 0); break; case IDCANCEL: