From c4fa3e3304eb9a7ca54b0cafd33c148d5d1ad570 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Fri, 4 Sep 2020 08:36:09 +0200 Subject: [PATCH] CDVD: polishing rebase and fixing nullptr bug --- cmake/SelectPcsx2Plugins.cmake | 1 - pcsx2/CDVD/CDVDdiscThread.cpp | 3 +++ pcsx2/gui/AppMain.cpp | 1 + pcsx2/gui/MainFrame.cpp | 1 - 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/SelectPcsx2Plugins.cmake b/cmake/SelectPcsx2Plugins.cmake index bea8505601..26344f75e6 100644 --- a/cmake/SelectPcsx2Plugins.cmake +++ b/cmake/SelectPcsx2Plugins.cmake @@ -3,7 +3,6 @@ #------------------------------------------------------------------------------- set(msg_dep_common_libs "check these libraries -> wxWidgets (>=3.0), aio") set(msg_dep_pcsx2 "check these libraries -> wxWidgets (>=3.0), gtk2, zlib (>=1.2.4), pcsx2 common libs") -set(msg_dep_cdvdgiga "check these libraries -> gtk2, libudev") set(msg_dep_gsdx "check these libraries -> opengl, png (>=1.2), zlib (>=1.2.4), X11, liblzma") set(msg_dep_onepad "check these libraries -> sdl2, X11, gtk2") set(msg_dep_spu2x "check these libraries -> soundtouch (>=1.5), alsa, portaudio (optional, >=1.9), sdl (>=1.2), pcsx2 common libs") diff --git a/pcsx2/CDVD/CDVDdiscThread.cpp b/pcsx2/CDVD/CDVDdiscThread.cpp index 3c542a2444..625861bd44 100644 --- a/pcsx2/CDVD/CDVDdiscThread.cpp +++ b/pcsx2/CDVD/CDVDdiscThread.cpp @@ -321,6 +321,9 @@ s32 cdvdDirectReadSector(u32 sector, s32 mode, u8* buffer) { static u8 data[2352 * sectors_per_read]; + if(src == nullptr) + return -1; + try { if (sector >= src->GetSectorCount()) return -1; diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 5ee5a85ba6..f2e3222edb 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -1180,6 +1180,7 @@ void SysStatus( const wxString& text ) void SysUpdateIsoSrcFile( const wxString& newIsoFile ) { g_Conf->CurrentIso = newIsoFile; + sMainFrame.UpdateStatusBar(); sMainFrame.UpdateCdvdSrcSelection(); } diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index e8de16d41e..b76ae29735 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -229,7 +229,6 @@ void MainEmuFrame::ConnectMenus() Bind(wxEVT_MENU, &MainEmuFrame::Menu_IsoClear_Click, this, MenuId_IsoClear); Bind(wxEVT_MENU, &MainEmuFrame::Menu_CdvdSource_Click, this, MenuId_Src_Iso); Bind(wxEVT_MENU, &MainEmuFrame::Menu_DiscBrowse_Click, this, MenuId_DriveSelector); - Bind(wxEVT_MENU, &MainEmuFrame::Menu_DriveSelector_Click, this, MenuId_DriveSelector); Bind(wxEVT_MENU, &MainEmuFrame::Menu_CdvdSource_Click, this, MenuId_Src_Disc); Bind(wxEVT_MENU, &MainEmuFrame::Menu_CdvdSource_Click, this, MenuId_Src_NoDisc); Bind(wxEVT_MENU, &MainEmuFrame::Menu_Ask_On_Boot_Click, this, MenuId_Ask_On_Booting);