* Implemented more support for on-the-fly CDVD source changes (not well tested, probably need work).

* Fix Reelease mode compilation errors. 
 * More misc bugfixes to the UI.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2207 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-11-16 17:14:10 +00:00
parent 4ab6a9846e
commit c942e3aaca
11 changed files with 45 additions and 18 deletions

View File

@ -32,7 +32,7 @@ __forceinline void Threading::SpinWait()
__forceinline void Threading::EnableHiresScheduler()
{
// This improves accuracy of Sleep() by some amount, and only adds a negligable amount of
// This improves accuracy of Sleep() by some amount, and only adds a negligible amount of
// overhead on modern CPUs. Typically desktops are already set pretty low, but laptops in
// particular may have a scheduler Period of 15 or 20ms to extend battery life.

View File

@ -268,6 +268,11 @@ void CDVDsys_SetFile( CDVD_SourceType srctype, const wxString& newfile )
m_SourceFilename[srctype] = newfile;
}
CDVD_SourceType CDVDsys_GetSourceType()
{
return m_CurrentSourceType;
}
void CDVDsys_ChangeSource( CDVD_SourceType type )
{
GetPluginManager().Close( PluginId_CDVD );

View File

@ -69,6 +69,7 @@ extern const wxChar* CDVD_SourceLabels[];
extern void CDVDsys_ChangeSource( CDVD_SourceType type );
extern void CDVDsys_SetFile( CDVD_SourceType srctype, const wxString& newfile );
extern CDVD_SourceType CDVDsys_GetSourceType();
extern bool DoCDVDopen();
extern void DoCDVDclose();

View File

@ -35,13 +35,13 @@ static __threadlocal SysCoreThread* tls_coreThread = NULL;
// (Called from outside the context of this thread)
// --------------------------------------------------------------------------------------
SysCoreThread::SysCoreThread() :
m_resetRecompilers( true )
, m_resetProfilers( true )
, m_resetVirtualMachine( true )
, m_hasValidState( false )
SysCoreThread::SysCoreThread()
{
m_name = L"EE Core";
m_resetRecompilers = true;
m_resetProfilers = true;
m_resetVirtualMachine = true;
m_hasValidState = false;
}
SysCoreThread::~SysCoreThread() throw()
@ -119,8 +119,20 @@ void SysCoreThread::ApplySettings( const Pcsx2Config& src )
if( resumeWhenDone ) Resume();
}
void SysCoreThread::ChangeCdvdSource( CDVD_SourceType type )
{
if( type == CDVDsys_GetSourceType() ) return;
// Fast change of the CDVD source only -- a Pause will suffice.
bool resumeWhenDone = Pause();
GetPluginManager().Close( PluginId_CDVD );
CDVDsys_ChangeSource( type );
if( resumeWhenDone ) Resume();
}
// --------------------------------------------------------------------------------------
// EECoreThread *Worker* Implementations
// SysCoreThread *Worker* Implementations
// (Called from the context of this thread only)
// --------------------------------------------------------------------------------------
SysCoreThread& SysCoreThread::Get()

View File

@ -220,6 +220,7 @@ public:
virtual const wxString& GetElfOverride() const { return m_elf_override; }
virtual void SetElfOverride( const wxString& elf );
virtual void ChangeCdvdSource( CDVD_SourceType type );
protected:
void CpuInitializeMess();

View File

@ -534,6 +534,7 @@ public:
virtual void Reset();
virtual void StateCheckInThread();
virtual void ApplySettings( const Pcsx2Config& src );
virtual void ChangeCdvdSource( CDVD_SourceType type );
protected:
virtual void OnResumeReady();

View File

@ -100,6 +100,15 @@ void AppCoreThread::Resume()
resume_tries = 0;
}
void AppCoreThread::ChangeCdvdSource( CDVD_SourceType type )
{
g_Conf->CdvdSource = type;
_parent::ChangeCdvdSource( type );
sMainFrame.UpdateIsoSrcSelection();
// TODO: Add a listener for CDVDsource changes? Or should we bother?
}
void AppCoreThread::OnResumeReady()
{
ApplySettings( g_Conf->EmuOptions );

View File

@ -74,13 +74,13 @@ pxAppResources::pxAppResources()
wxMenu& Pcsx2App::GetRecentIsoMenu()
{
pxAssert( m_Resources->RecentIsoMenu );
pxAssert( !!m_Resources->RecentIsoMenu );
return *m_Resources->RecentIsoMenu;
}
RecentIsoManager& Pcsx2App::GetRecentIsoList()
{
pxAssert( m_Resources->RecentIsoList );
pxAssert( !!m_Resources->RecentIsoList );
return *m_Resources->RecentIsoList;
}

View File

@ -121,7 +121,9 @@ bool IsoDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen
{
SysUpdateIsoSrcFile( filenames[0] );
if( result != wxID_RESET )
CDVDsys_ChangeSource( CDVDsrc_Iso );
{
CoreThread.ChangeCdvdSource( CDVDsrc_Iso );
}
else
{
sApp.SysExecute( CDVDsrc_Iso );

View File

@ -61,12 +61,7 @@ void MainEmuFrame::Menu_CdvdSource_Click( wxCommandEvent &event )
jNO_DEFAULT
}
if( g_Conf->CdvdSource == newSource ) return;
bool resume = CoreThread.Suspend();
CDVDsys_ChangeSource( g_Conf->CdvdSource = newSource );
if( resume ) CoreThread.Resume();
CoreThread.ChangeCdvdSource( newSource );
}
// Returns FALSE if the user cancelled the action.

View File

@ -140,7 +140,8 @@ EXPORT_C_(s32) SPU2test()
return -1;
}
if( !SndBuffer::Test() )
ReadSettings();
if( SndBuffer::Test() == 0 )
{
// TODO : Implement a proper dialog that allows the user to test different audio out drivers.
SysMessage( L"The '%s' driver test failed. Please configure\ndifferent SoundOut module and try again.", mods[OutputModule]->GetIdent() );