/[pcsx2_0.9.7]/trunk/pcsx2/Elfheader.cpp
ViewVC logotype

Diff of /trunk/pcsx2/Elfheader.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/pcsx2/Elfheader.cpp	2010/12/23 12:02:12	280
+++ trunk/pcsx2/Elfheader.cpp	2010/12/23 12:39:52	283
@@ -260,16 +260,26 @@
 	if (rsize < data.GetSizeInBytes()) throw Exception::EndOfStream(filename);
 }
 
-void ElfObject::checkElfSize(s64 elfsize)
+static wxString GetMsg_InvalidELF()
 {
-	if (elfsize > 0xfffffff)
-		throw Exception::BadStream(filename).SetBothMsgs(wxLt("Illegal ELF file size over 2GB!"));
+	return
+		_("Cannot load ELF binary image.  The file may be corrupt or incomplete.") + 
+		wxString(L"\n\n") +
+		_("If loading from an ISO image, this error may be caused by an unsupported ISO image type or bug in PCSX2 ISO image support.");
+}
+
 
-	if (elfsize == -1)
-		throw Exception::BadStream(filename).SetBothMsgs(wxLt("ELF file does not exist!"));
+void ElfObject::checkElfSize(s64 elfsize)
+{
+	const wxChar* diagMsg = NULL;
+	if		(elfsize > 0xfffffff)	diagMsg = L"Illegal ELF file size over 2GB!";
+	else if	(elfsize == -1)			diagMsg = L"ELF file does not exist!";
+	else if	(elfsize == 0)			diagMsg = L"Unexpected end of ELF file.";
 
-	if (elfsize == 0)
-		throw Exception::BadStream(filename).SetBothMsgs(wxLt("Unexpected end of ELF file."));
+	if (diagMsg)
+		throw Exception::BadStream(filename)
+			.SetDiagMsg(diagMsg)
+			.SetUserMsg(GetMsg_InvalidELF());
 }
 
 u32 ElfObject::getCRC()

 

  ViewVC Help
Powered by ViewVC 1.1.22