From 434bb37d6319a40fdc77259378d2089ecde29411 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Fri, 27 Nov 2009 06:47:32 +0000 Subject: [PATCH] Expand the system.map symbol table string length from 32 to 64 chars (fixes debug assertion in Silent Scope 3); and other minor code comments added. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2259 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/src/Utilities/Linux/LnxMisc.cpp | 5 --- common/src/Utilities/wxHelpers.cpp | 4 +-- pcsx2/DebugTools/DisR5900.cpp | 8 +++-- pcsx2/gui/MainMenuClicks.cpp | 42 ++++++++++++++++++-------- pcsx2/gui/RecentIsoList.cpp | 8 +++++ 5 files changed, 45 insertions(+), 22 deletions(-) diff --git a/common/src/Utilities/Linux/LnxMisc.cpp b/common/src/Utilities/Linux/LnxMisc.cpp index e8d7bd3ad0..9025080c86 100644 --- a/common/src/Utilities/Linux/LnxMisc.cpp +++ b/common/src/Utilities/Linux/LnxMisc.cpp @@ -44,11 +44,6 @@ u64 GetCPUTicks() wxString GetOSVersionString() { - // TODO : Implement me!! - - // This shoul return a single comprehensive string description for the linux operating system: - // Kernel version, distribution, etc. - return wxGetOsDescription(); } diff --git a/common/src/Utilities/wxHelpers.cpp b/common/src/Utilities/wxHelpers.cpp index a72dce86e6..32d6c711ef 100644 --- a/common/src/Utilities/wxHelpers.cpp +++ b/common/src/Utilities/wxHelpers.cpp @@ -107,9 +107,9 @@ void wxDialogWithHelpers::AddOkCancel( wxSizer &sizer, bool hasApply ) if( m_hasContextHelp ) { SetExtraStyle( wxDIALOG_EX_CONTEXTHELP ); -//#ifndef __WXMSW__ +#ifndef __WXMSW__ *m_extraButtonSizer += new wxContextHelpButton(this) | StdButton(); -//#endif +#endif } // create a sizer to hold the help and ok/cancel buttons, for platforms diff --git a/pcsx2/DebugTools/DisR5900.cpp b/pcsx2/DebugTools/DisR5900.cpp index abb8413835..7be7c0d094 100644 --- a/pcsx2/DebugTools/DisR5900.cpp +++ b/pcsx2/DebugTools/DisR5900.cpp @@ -164,7 +164,7 @@ typedef void (*TdisR5900F)DisFInterface; struct sSymbol { u32 addr; - char name[32]; + char name[64]; }; static sSymbol *dSyms = NULL; @@ -173,7 +173,9 @@ static int nSyms = 0; void disR5900AddSym(u32 addr, const char *name) { - pxAssertDev(strlen(name) < 32, wxsFormat(L"Char length of symbol is more then 31 chars.", strlen(name))); + if( !pxAssertDev(strlen(name) < sizeof(dSyms->name), + wxsFormat(L"String length out of bounds on debug symbol. Allowed=%d, Symbol=%d", sizeof(dSyms->name)-1, strlen(name))) + ) return; if( nSyms+1 >= nSymAlloc ) { @@ -184,7 +186,7 @@ void disR5900AddSym(u32 addr, const char *name) { if (dSyms == NULL) return; dSyms[nSyms].addr = addr; - strncpy(dSyms[nSyms].name, name, 32); + strncpy(dSyms[nSyms].name, name, 64); nSyms++; } diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 964938791c..231f692340 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -107,18 +107,36 @@ bool MainEmuFrame::_DoSelectELFBrowser() void MainEmuFrame::Menu_BootCdvd_Click( wxCommandEvent &event ) { - CoreThread.Suspend(); + ScopedCoreThreadSuspend core; - if( (g_Conf->CdvdSource == CDVDsrc_Iso) && !wxFileExists(g_Conf->CurrentIso) ) + if( g_Conf->CdvdSource == CDVDsrc_Iso ) { - wxString result; - if( !_DoSelectIsoBrowser( result ) ) - { - CoreThread.Resume(); - return; - } + bool selector = g_Conf->CurrentIso.IsEmpty(); - SysUpdateIsoSrcFile( result ); + if( !selector && !wxFileExists(g_Conf->CurrentIso) ) + { + // User has an iso selected from a previous run, but it doesn't exist anymore. + // Issue a courtesy popup and then an Iso Selector to choose a new one. + + Dialogs::ExtensibleConfirmation( this, ConfButtons().OK(), _("ISO file not found!"), + _("An error occurred while trying to open the file:\n\n") + g_Conf->CurrentIso + L"\n\n" + + _("Error: The configured ISO file does not exist. Click OK to select a new ISO source for CDVD.") + ).ShowModal(); + + selector = true; + } + + if( selector ) + { + wxString result; + if( !_DoSelectIsoBrowser( result ) ) + { + core.Resume(); + return; + } + + SysUpdateIsoSrcFile( result ); + } } if( SysHasValidState() ) @@ -131,7 +149,7 @@ void MainEmuFrame::Menu_BootCdvd_Click( wxCommandEvent &event ) if( !confirmed ) { - CoreThread.Resume(); + core.Resume(); return; } } @@ -141,7 +159,7 @@ void MainEmuFrame::Menu_BootCdvd_Click( wxCommandEvent &event ) void MainEmuFrame::Menu_IsoBrowse_Click( wxCommandEvent &event ) { - bool resume = CoreThread.Suspend(); + ScopedCoreThreadSuspend core; wxString result; if( _DoSelectIsoBrowser( result ) ) @@ -152,7 +170,7 @@ void MainEmuFrame::Menu_IsoBrowse_Click( wxCommandEvent &event ) SysUpdateIsoSrcFile( result ); } - if( resume ) CoreThread.Resume(); + core.Resume(); } void MainEmuFrame::Menu_MultitapToggle_Click( wxCommandEvent &event ) diff --git a/pcsx2/gui/RecentIsoList.cpp b/pcsx2/gui/RecentIsoList.cpp index 971b98f7a3..d621dd23e7 100644 --- a/pcsx2/gui/RecentIsoList.cpp +++ b/pcsx2/gui/RecentIsoList.cpp @@ -16,6 +16,14 @@ #include "PrecompiledHeader.h" #include "MainFrame.h" + +// FIXME : This needs to handle removed/missing ISOs somehow, although I'm not sure the +// best approach. I think I'd prefer for missing entries to only be removed when they +// are selected. This also means we'll need to add some sort of "no current selection" +// menu option that's defaulted to when a selection is deemed missing (since just randomly +// selecting another iso would be undesirable). + + RecentIsoManager::RecentIsoManager( wxMenu* menu ) : m_Menu( menu ) , m_MaxLength( g_Conf->RecentFileCount )