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
This commit is contained in:
Jake.Stine 2010-12-15 04:45:43 +00:00
parent bbb1c8a94a
commit 262dc135fa
2 changed files with 15 additions and 10 deletions

View File

@ -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"; // if all these conditions are met, it should mean that we're currently running BIOS code.
gameCRC.Printf( L"%8.8x", BiosChecksum ); // 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) { if (EmuConfig.EnableCheats) {

View File

@ -64,7 +64,7 @@ Exception::BiosLoadFailed::BiosLoadFailed( const wxString& filename )
// This method throws a BadStream exception if the bios information could not be obtained. // 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). // (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; uint i;
romdir rd; romdir rd;
@ -132,6 +132,7 @@ static void LoadBiosVersion( pxInputStream& fp, u32& version, wxString& descript
Console.WriteLn(L"Bios Found: %s", result.c_str()); Console.WriteLn(L"Bios Found: %s", result.c_str());
description = result.c_str(); description = result.c_str();
zoneStr = fromUTF8(zone);
} }
if ((rd.fileSize % 0x10) == 0) 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 ); wxFile fp( Bios1 );
fp.Read( dest, std::min<s64>( _size, filesize ) ); fp.Read( dest, std::min<s64>( _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) 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"Details: %s", ex.FormatDiagnosticMessage());
Console.Indent().WriteLn(L"File size: %llu", filesize); Console.Indent().WriteLn(L"File size: %llu", filesize);
} }
} }
// Loads the configured bios rom file into PS2 memory. PS2 memory must be allocated prior to // Loads the configured bios rom file into PS2 memory. PS2 memory must be allocated prior to
// this method being called. // this method being called.
// //
@ -248,13 +247,16 @@ void LoadBIOS()
BiosChecksum = 0; BiosChecksum = 0;
wxString biosZone;
wxFFile fp( Bios ); wxFFile fp( Bios );
fp.Read( eeMem->ROM, std::min<s64>( Ps2MemSize::Rom, filesize ) ); fp.Read( eeMem->ROM, std::min<s64>( Ps2MemSize::Rom, filesize ) );
ChecksumIt( BiosChecksum, eeMem->ROM ); ChecksumIt( BiosChecksum, eeMem->ROM );
pxInputStream memfp( Bios, new wxMemoryInputStream( eeMem->ROM, sizeof(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 //injectIRX("host.irx"); //not fully tested; still buggy