From 262dc135fae89270174a91ea8dc38fe1b5a5edd0 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 15 Dec 2010 04:45:43 +0000 Subject: [PATCH] wxSavestates: BIOs boot/running status is now correctly displayed in the console titlebar. git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxSavestates@4098 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/AppCoreThread.cpp | 9 ++++++--- pcsx2/ps2/BiosTools.cpp | 16 +++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pcsx2/gui/AppCoreThread.cpp b/pcsx2/gui/AppCoreThread.cpp index aa91171eb4..56f9b16c39 100644 --- a/pcsx2/gui/AppCoreThread.cpp +++ b/pcsx2/gui/AppCoreThread.cpp @@ -332,10 +332,13 @@ void AppCoreThread::ApplySettings( const Pcsx2Config& src ) } } - if (gameName.IsEmpty() && gameSerial.IsEmpty() && BiosChecksum) + if (gameName.IsEmpty() && gameSerial.IsEmpty() && gameCRC.IsEmpty()) { - gameName = L"BIOS"; - gameCRC.Printf( L"%8.8x", BiosChecksum ); + // if all these conditions are met, it should mean that we're currently running BIOS code. + // Chances are the BiosChecksum value is still zero or out of date, however -- because + // the BIos isn't loaded until after initial calls to ApplySettings. + + gameName = L"Booting PS2 BIOS... "; } if (EmuConfig.EnableCheats) { diff --git a/pcsx2/ps2/BiosTools.cpp b/pcsx2/ps2/BiosTools.cpp index cbd9663c8c..21f0fc6501 100644 --- a/pcsx2/ps2/BiosTools.cpp +++ b/pcsx2/ps2/BiosTools.cpp @@ -64,7 +64,7 @@ Exception::BiosLoadFailed::BiosLoadFailed( const wxString& filename ) // This method throws a BadStream exception if the bios information could not be obtained. // (indicating that the file is invalid, incomplete, corrupted, or plain naughty). -static void LoadBiosVersion( pxInputStream& fp, u32& version, wxString& description ) +static void LoadBiosVersion( pxInputStream& fp, u32& version, wxString& description, wxString& zoneStr=wxString() ) { uint i; romdir rd; @@ -132,6 +132,7 @@ static void LoadBiosVersion( pxInputStream& fp, u32& version, wxString& descript Console.WriteLn(L"Bios Found: %s", result.c_str()); description = result.c_str(); + zoneStr = fromUTF8(zone); } if ((rd.fileSize % 0x10) == 0) @@ -196,11 +197,11 @@ static void LoadExtraRom( const wxChar* ext, u8 (&dest)[_size] ) } } - // if we made it this far, we have a successful file found: - wxFile fp( Bios1 ); fp.Read( dest, std::min( _size, filesize ) ); - ChecksumIt( BiosChecksum, dest ); + + // Checksum for ROM1, ROM2, EROM? Rama says no, Gigaherz says yes. I'm not sure either way. --air + //ChecksumIt( BiosChecksum, dest ); } catch (Exception::BadStream& ex) { @@ -212,10 +213,8 @@ static void LoadExtraRom( const wxChar* ext, u8 (&dest)[_size] ) Console.Indent().WriteLn(L"Details: %s", ex.FormatDiagnosticMessage()); Console.Indent().WriteLn(L"File size: %llu", filesize); } - } - // Loads the configured bios rom file into PS2 memory. PS2 memory must be allocated prior to // this method being called. // @@ -248,13 +247,16 @@ void LoadBIOS() BiosChecksum = 0; + wxString biosZone; wxFFile fp( Bios ); fp.Read( eeMem->ROM, std::min( Ps2MemSize::Rom, filesize ) ); ChecksumIt( BiosChecksum, eeMem->ROM ); pxInputStream memfp( Bios, new wxMemoryInputStream( eeMem->ROM, sizeof(eeMem->ROM) ) ); - LoadBiosVersion( memfp, BiosVersion, BiosDescription ); + LoadBiosVersion( memfp, BiosVersion, BiosDescription, biosZone ); + + Console.SetTitle( pxsFmt( "Running BIOS (%s v%u.%u)", biosZone.c_str(), BiosChecksum, BiosVersion >> 8, BiosVersion & 0xff ) ); //injectIRX("host.irx"); //not fully tested; still buggy