From e538ecd7d8df00ae651d6bcdeba5375e84014834 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Mon, 8 Jun 2009 16:17:08 +0000 Subject: [PATCH] * Fixed CDVD startup code sot hat the CRC for games is more reliably detected when booting through Run->Execute. * Minor bugfix to MTGS thread startup code; wasn't copying the register state properly (probably didn't matter either way) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1349 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/CDVD/CDVD.cpp | 18 +++++++++++++++--- pcsx2/MTGS.cpp | 2 +- pcsx2/Plugins.cpp | 8 ++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/pcsx2/CDVD/CDVD.cpp b/pcsx2/CDVD/CDVD.cpp index 675a070ec7..3bd4b07bc4 100644 --- a/pcsx2/CDVD/CDVD.cpp +++ b/pcsx2/CDVD/CDVD.cpp @@ -402,7 +402,7 @@ void cdvdReadKey(u8 arg0, u16 arg1, u32 arg2, u8* key) { s32 cdvdGetToc(void* toc) { s32 ret = CDVDgetTOC(toc); - if (ret == -1) ret = 0x80; + if (ret == -1) ret = 0x80; return ret; } @@ -569,13 +569,25 @@ void cdvdNewDiskCB() { cdvd.Type = CDVDgetDiskType(); + char str[g_MaxPath]; + int result = GetPS2ElfName(str); + if (cdvd.Type == CDVD_TYPE_PS2CD) { - char str[g_MaxPath]; // Does the SYSTEM.CNF file only say "BOOT="? PS1 CD then. - if(GetPS2ElfName(str) == 1) cdvd.Type = CDVD_TYPE_PSCD; + if(result == 1) cdvd.Type = CDVD_TYPE_PSCD; } + + // Now's a good time to reload the ELF info... + if( ElfCRC == 0 ) + { + ElfCRC = loadElfCRC( str ); + ElfApplyPatches(); + LoadGameSpecificSettings(); + GSsetGameCRC( ElfCRC, 0 ); + } + } void mechaDecryptBytes( u32 madr, int size ) diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 0cd782c5c0..55195caf5e 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -511,7 +511,7 @@ int mtgsThreadObject::Callback() { Console::WriteLn("MTGS > Thread Started, Opening GS Plugin..."); - memcpy_aligned( m_gsMem, PS2MEM_GS, sizeof(m_gsMem) ); + memcpy_aligned( m_gsMem, PS2MEM_GS, sizeof(PS2MEM_GS) ); GSsetBaseMem( m_gsMem ); GSirqCallback( NULL ); diff --git a/pcsx2/Plugins.cpp b/pcsx2/Plugins.cpp index dcd9709a4b..0c78f6cc41 100644 --- a/pcsx2/Plugins.cpp +++ b/pcsx2/Plugins.cpp @@ -737,14 +737,11 @@ int OpenPlugins(const char* pTitleFilename) if (ret != 0) { if (g_Startup.BootMode != BootMode_Elf) { Msgbox::Alert("Error Opening CDVD Plugin"); goto OpenError; } - else { Console::Notice("Running ELF File Without CDVD Plugin Support!"); cdvdElf = 1; goto skipOpenCDVD; } + else { Console::Notice("Running ELF File Without CDVD Plugin Support!"); cdvdElf = 1; } } OpenStatus.CDVD = true; - cdvdNewDiskCB(); } -skipOpenCDVD: - if( !OpenStatus.GS ) { ret = gsOpen(); if (ret != 0) { Msgbox::Alert("Error Opening GS Plugin"); goto OpenError; } @@ -816,6 +813,9 @@ skipOpenCDVD: OpenStatus.FW = true; } + if( !cdvdElf ) + cdvdNewDiskCB(); + #ifndef _WIN32 //chdir(MAIN_DIR); #endif