From 59ec81642791c495ba3d2e7fd012792e7ffa3efc Mon Sep 17 00:00:00 2001 From: arcum42 Date: Tue, 19 Jan 2010 14:04:27 +0000 Subject: [PATCH] Document an Elfheader issue, so I don't forget about it. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2457 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Elfheader.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pcsx2/Elfheader.cpp b/pcsx2/Elfheader.cpp index 346bf58a05..e5f045a7a7 100644 --- a/pcsx2/Elfheader.cpp +++ b/pcsx2/Elfheader.cpp @@ -441,6 +441,7 @@ void ElfObject::applyPatches() void loadElfFile(const wxString& filename) { ElfObject *elfptr; + bool iscdvd; if (filename.IsEmpty()) return; @@ -449,7 +450,8 @@ void loadElfFile(const wxString& filename) if (filename.StartsWith(L"cdrom:") && !ENABLE_LOADING_PS1_GAMES) throw Exception::RuntimeError( wxLt("This is not a Ps2 disc. (And we don't currently emulate PS1 games)") ); - if (filename.StartsWith(L"cdrom:") || filename.StartsWith(L"cdrom0:") || filename.StartsWith(L"cdrom1:")) + iscdvd = (filename.StartsWith(L"cdrom:") || filename.StartsWith(L"cdrom0:") || filename.StartsWith(L"cdrom1:")); + if (iscdvd) { // It's a game disc. DevCon.WriteLn(L"Loading from a CD rom or CD image."); @@ -490,7 +492,18 @@ void loadElfFile(const wxString& filename) { if( memcmp( "rom0:OSDSYS", (char*)PSM( i ), 11 ) == 0 ) { - strcpy( (char*)PSM( i ), filename.ToUTF8() ); + // All right, this is not likely to be right. It's fine if it is a cd, but + // We really do not want to pass the elf file with full path and drive letter + // into pcsx2 memory, like this. + strcpy((char*)PSM(i), filename.ToUTF8()); + + // We could test and only do it if (iscdvd) is true, or we could do something + // like this if it isn't a cdvd: + // strcpy((char*)PSM(i), wxsFormat(L"rom0:"+Path::GetFilename(filename)).ToUTF8()); + + // Though the question is what device name to pass if we do that... + // Not sure, so I'm leaving it the known incorrect way for now. --arcum42 + DevCon.WriteLn( wxsFormat(L"loadElfFile: addr %x \"rom0:OSDSYS\" -> \"" + filename + L"\"", i)); } }