Cleanups and Linux compilation fixes. :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2119 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-11-02 21:04:02 +00:00
parent a98284c3e8
commit 5b726f0b11
8 changed files with 59 additions and 63 deletions

View File

@ -39,7 +39,7 @@ namespace HostSys
void MemProtect( void* baseaddr, size_t size, PageProtectionMode mode, bool allowExecution )
{
pxAssertDev( ((size & ~__pagesize) == 0), wxsFormat(
pxAssertDev( (size & (__pagesize-1)) == 0, wxsFormat(
L"Memory block size must be a multiple of the target platform's page size.\n"
L"\tPage Size: 0x%04x (%d), Block Size: 0x%04x (%d)",
__pagesize, __pagesize, size, size )

View File

@ -783,32 +783,32 @@ static const wchar_t TwoBytes_ea [256] = {
static const wchar_t* TwoBytes[256] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, TwoBytes_81,TwoBytes_82,TwoBytes_83,TwoBytes_84,NULL, NULL, NULL, TwoBytes_88,TwoBytes_89,TwoBytes_8a,TwoBytes_8b,TwoBytes_8c,TwoBytes_8d,TwoBytes_8e,TwoBytes_8f,
TwoBytes_90,TwoBytes_91,TwoBytes_92,TwoBytes_93,TwoBytes_94,TwoBytes_95,TwoBytes_96,TwoBytes_97,TwoBytes_98,TwoBytes_99,TwoBytes_9a,TwoBytes_9b,TwoBytes_9c,TwoBytes_9d,TwoBytes_9e,TwoBytes_9f,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
TwoBytes_e0,TwoBytes_e1,TwoBytes_e2,TwoBytes_e3,TwoBytes_e4,TwoBytes_e5,TwoBytes_e6,TwoBytes_e7,TwoBytes_e8,TwoBytes_e9,TwoBytes_ea,NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
TwoBytes_e0,TwoBytes_e1,TwoBytes_e2,TwoBytes_e3,TwoBytes_e4,TwoBytes_e5,TwoBytes_e6,TwoBytes_e7,TwoBytes_e8,TwoBytes_e9,TwoBytes_ea,NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
};
// requires two bytes on input (second CAN be 0), returns unicode mapping, assigns used bytes (1/2)
wchar_t ShiftJIS_ConvertChar(const char* input, int& used)
{
int FirstByte = (unsigned char)input[0];
const uint FirstByte = input[0];
if(NumBytes[FirstByte] == 1)
{
used=1;
used = 1;
return OneByte[FirstByte];
}
else
@ -820,11 +820,11 @@ wchar_t ShiftJIS_ConvertChar(const char* input, int& used)
// print an 0xfc/0x0a combo, followed by a NULL. Other IOP prints seem to have valid
// Shift-JIS encodings. not sure what's going on yet, so this needs reviewed sometime
// --air
used = 1; return (wchar_t)input;
used = 1; return (wchar_t)FirstByte;
}
used = 2;
int SecondByte = (unsigned char)input[1];
const uint SecondByte = input[1];
return TwoBytes[FirstByte][SecondByte];
}
}
@ -842,7 +842,7 @@ wxString ShiftJIS_ConvertString( const char* src )
result += ShiftJIS_ConvertChar( src, skip );
src += skip;
}
return result;
}

View File

@ -44,6 +44,9 @@ bool AppCoreThread::Suspend( bool isBlocking )
ScopedBusyCursor::SetDefault( Cursor_KindaBusy );
bool retval = _parent::Suspend( isBlocking );
if( !retval || isBlocking )
ScopedBusyCursor::SetDefault( Cursor_NotBusy );
// Clear the sticky key statuses, because hell knows what'll change while the PAD
// plugin is suspended.
@ -70,7 +73,7 @@ void AppCoreThread::Resume()
Console.WriteLn( "SysResume: State is locked, ignoring Resume request!" );
return;
}
ScopedBusyCursor::SetDefault( Cursor_KindaBusy );
_parent::Resume();
@ -93,7 +96,7 @@ void AppCoreThread::Resume()
Console.WriteLn( Color_Orange, "SysResume: Multiple resume retries failed. Giving up..." );
}
}
resume_tries = 0;
}

View File

@ -40,7 +40,7 @@ using namespace Panels;
static const int s_orient = wxBK_LEFT;
#endif
static const int IdealWidth = 575;
static const int IdealWidth = 580;
template< typename T >
void Dialogs::ConfigurationDialog::AddPage( const char* label, int iconid )

View File

@ -231,8 +231,9 @@ void __evt_fastcall MainEmuFrame::OnSettingsApplied( void* obj, int& evt )
void __evt_fastcall MainEmuFrame::OnSettingsLoadSave( void* obj, IniInterface& evt )
{
if( obj == NULL ) return;
MainEmuFrame* mframe = (MainEmuFrame*)obj;
//MainEmuFrame* mframe = (MainEmuFrame*)obj;
// nothing to do here right now.
}
static int GetPluginMenuId_Settings( PluginsEnum_t pid )
@ -262,7 +263,7 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title):
m_menuConfig( *new wxMenu() ),
m_menuMisc ( *new wxMenu() ),
m_menuDebug ( *new wxMenu() ),
m_LoadStatesSubmenu( *MakeStatesSubMenu( MenuId_State_Load01 ) ),
m_SaveStatesSubmenu( *MakeStatesSubMenu( MenuId_State_Save01 ) ),
@ -481,14 +482,12 @@ void MainEmuFrame::ApplyCoreStatus()
susres.Enable( false );
susres.SetHelp( _("No emulation state is active; cannot suspend or resume.") );
}
menubar.Enable( MenuId_Sys_Reset, SysHasValidState() || (g_plugins!=NULL) );
}
void MainEmuFrame::ApplyPluginStatus()
{
wxMenuBar& menubar( *GetMenuBar() );
if( g_plugins == NULL )
{
for( int i=0; i<PluginId_Count; ++i )
@ -503,13 +502,6 @@ void MainEmuFrame::ApplyPluginStatus()
//m_menuCDVD.SetLabel( MenuId_Src_Plugin, wxsFormat( L"%s (%s)", _("Plugin"),
// g_plugins->GetName( PluginId_CDVD ).c_str() ) );
}
// Re-populate plugin menus.
// Delete any menu options added by plugins (typically a plugin will have already
// done its own proper cleanup when the plugin was shutdown or unloaded, but lets
// not trust them, shall we?)
}
void MainEmuFrame::ApplySettings()
@ -559,6 +551,10 @@ void PerPluginMenuInfo::Populate( PluginsEnum_t pid )
// by the PCSX2 core intact.
void PerPluginMenuInfo::OnUnloaded()
{
// Delete any menu options added by plugins (typically a plugin will have already
// done its own proper cleanup when the plugin was shutdown or unloaded, but lets
// not trust them, shall we?)
MenuItemAddonList& curlist( m_PluginMenuItems );
for( uint mx=0; mx<curlist.size(); ++mx )
MyMenu.Delete( curlist[mx].Item );
@ -571,8 +567,6 @@ void PerPluginMenuInfo::OnUnloaded()
void PerPluginMenuInfo::OnLoaded()
{
MenuItemAddonList& curlist( m_PluginMenuItems );
MyMenu.SetLabel( GetPluginMenuId_Name(PluginId),
g_plugins->GetName( PluginId ) + L" " + g_plugins->GetVersion( PluginId )
);

View File

@ -217,7 +217,7 @@ void MainEmuFrame::Menu_SuspendResume_Click(wxCommandEvent &event)
{
sApp.SysExecute();
}
// Disable the menu item. The state of the menu is indeterminate until the core thread
// has responded (it updates status after the plugins are loaded and emulation has
// engaged successfully).
@ -242,9 +242,8 @@ void MainEmuFrame::Menu_SysReset_Click(wxCommandEvent &event)
void MainEmuFrame::Menu_ConfigPlugin_Click(wxCommandEvent &event)
{
typedef void (CALLBACK* PluginConfigureFnptr)();
const int eventId = event.GetId() - MenuId_PluginBase_Settings;
PluginsEnum_t pid = (PluginsEnum_t)(eventId / PluginMenuId_Interval);
if( !pxAssertDev( (eventId >= 0) || (pid < PluginId_Count), "Invalid plugin identifier passed to ConfigPlugin event handler." ) ) return;

View File

@ -1,6 +1,6 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
@ -18,7 +18,7 @@
using namespace wxHelpers;
Panels::BaseAdvancedCpuOptions::BaseAdvancedCpuOptions( wxWindow& parent, int idealWidth ) :
Panels::BaseAdvancedCpuOptions::BaseAdvancedCpuOptions( wxWindow& parent, int idealWidth ) :
BaseApplicableConfigPanel( &parent, idealWidth )
, s_adv( *new wxStaticBoxSizer( wxVERTICAL, this ) )
, s_round( *new wxStaticBoxSizer( wxVERTICAL, this, _("Round Mode") ) )
@ -29,10 +29,10 @@ Panels::BaseAdvancedCpuOptions::BaseAdvancedCpuOptions( wxWindow& parent, int id
// Clever proportions selected for a fairly nice spacing, with the third
// column serving as a buffer between static box and a pair of checkboxes.
grid.AddGrowableCol( 0, 8 );
grid.AddGrowableCol( 1, 10 );
grid.AddGrowableCol( 0, 17 );
grid.AddGrowableCol( 1, 22 );
grid.AddGrowableCol( 2, 1 );
grid.AddGrowableCol( 3, 7 );
grid.AddGrowableCol( 3, 19 );
m_StartNewRadioGroup = true;
m_Option_Round[0] = &AddRadioButton( s_round, _("Nearest") );
@ -68,16 +68,16 @@ void Panels::BaseAdvancedCpuOptions::OnRestoreDefaults(wxCommandEvent &evt)
{
m_Option_Round[3]->SetValue(true);
m_Option_Normal->SetValue(true);
m_Option_DAZ->SetValue(true);
m_Option_FTZ->SetValue(true);
}
Panels::AdvancedOptionsFPU::AdvancedOptionsFPU( wxWindow& parent, int idealWidth ) :
Panels::AdvancedOptionsFPU::AdvancedOptionsFPU( wxWindow& parent, int idealWidth ) :
BaseAdvancedCpuOptions( parent, idealWidth )
{
s_adv.GetStaticBox()->SetLabel(_("EE/FPU Advanced Recompiler Options"));
m_Option_ExtraSign = &AddRadioButton( s_clamp, _("Extra + Preserve Sign") );
m_Option_Full = &AddRadioButton( s_clamp, _("Full") );
@ -96,7 +96,7 @@ Panels::AdvancedOptionsFPU::AdvancedOptionsFPU( wxWindow& parent, int idealWidth
}
Panels::AdvancedOptionsVU::AdvancedOptionsVU( wxWindow& parent, int idealWidth ) :
Panels::AdvancedOptionsVU::AdvancedOptionsVU( wxWindow& parent, int idealWidth ) :
BaseAdvancedCpuOptions( parent, idealWidth )
{
s_adv.GetStaticBox()->SetLabel(_("VU0 / VU1 Advanced Recompiler Options"));
@ -111,7 +111,7 @@ Panels::AdvancedOptionsVU::AdvancedOptionsVU( wxWindow& parent, int idealWidth )
m_Option_DAZ->SetValue( cpuOps.sseVUMXCSR.DenormalsAreZero );
m_Option_Round[cpuOps.sseVUMXCSR.RoundingControl]->SetValue( true );
m_Option_Normal->SetValue( recOps.vuOverflow );
m_Option_Extra->SetValue( recOps.vuExtraOverflow );
m_Option_ExtraSign->SetValue( recOps.vuSignOverflow );
@ -123,14 +123,14 @@ Panels::CpuPanelEE::CpuPanelEE( wxWindow& parent, int idealWidth ) :
{
wxBoxSizer& s_main = *new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer& s_recs = *new wxFlexGridSizer( 2 );
s_recs.AddGrowableCol( 0, 1 );
s_recs.AddGrowableCol( 1, 1 );
// i18n: No point in translating PS2 CPU names :)
wxStaticBoxSizer& s_ee = *new wxStaticBoxSizer( wxVERTICAL, this, L"EmotionEngine" );
wxStaticBoxSizer& s_iop = *new wxStaticBoxSizer( wxVERTICAL, this, L"IOP" );
m_StartNewRadioGroup = true;
AddRadioButton( s_ee, _("Interpreter"), wxEmptyString, _("Quite possibly the slowest thing in the universe.") );
m_Option_RecEE = &AddRadioButton( s_ee, _("Recompiler [Preferred]") );
@ -150,7 +150,7 @@ Panels::CpuPanelEE::CpuPanelEE( wxWindow& parent, int idealWidth ) :
// ----------------------------------------------------------------------------
// Apply current configuration options...
Pcsx2Config::RecompilerOptions& recOps( g_Conf->EmuOptions.Cpu.Recompiler );
m_Option_RecEE->SetValue( recOps.EnableEE );
@ -239,14 +239,14 @@ void Panels::AdvancedOptionsFPU::Apply()
{
Pcsx2Config::CpuOptions& cpuOps( g_Conf->EmuOptions.Cpu );
Pcsx2Config::RecompilerOptions& recOps( cpuOps.Recompiler );
cpuOps.sseMXCSR = Pcsx2Config::CpuOptions().sseMXCSR; // set default
ApplyRoundmode( cpuOps.sseMXCSR );
recOps.fpuExtraOverflow = m_Option_ExtraSign->GetValue();
recOps.fpuOverflow = m_Option_Normal->GetValue() || recOps.fpuExtraOverflow;
recOps.fpuFullMode = m_Option_Full->GetValue();
cpuOps.ApplySanityCheck();
}
@ -254,13 +254,13 @@ void Panels::AdvancedOptionsVU::Apply()
{
Pcsx2Config::CpuOptions& cpuOps( g_Conf->EmuOptions.Cpu );
Pcsx2Config::RecompilerOptions& recOps( cpuOps.Recompiler );
cpuOps.sseVUMXCSR = Pcsx2Config::CpuOptions().sseVUMXCSR; // set default
ApplyRoundmode( cpuOps.sseVUMXCSR );
recOps.vuSignOverflow = m_Option_ExtraSign->GetValue();
recOps.vuExtraOverflow = m_Option_Extra->GetValue() || recOps.vuSignOverflow;
recOps.vuOverflow = m_Option_Normal->GetValue() || recOps.vuExtraOverflow;
cpuOps.ApplySanityCheck();
}

View File

@ -1,6 +1,6 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
@ -49,8 +49,8 @@ Exception::BiosLoadFailed::BiosLoadFailed( const wxString& filename, const wxStr
wxString diag( msg_user.IsEmpty() ?
L"BIOS has not been configured, or the configuration has been corrupted." : msg_user
);
wxString user( msg_user.IsEmpty() ?
_("The PS2 BIOS has not been configured, or the configuration has been corrupted. Please re-configure.") : msg_user
wxString user( msg_user.IsEmpty() ?
_("The PS2 BIOS has not been configured, or the configuration has been corrupted. Please re-configure.") : msg_user.c_str()
);
BaseException::InitBaseEx( diag, user );
@ -216,7 +216,7 @@ bool IsBIOS(const wxString& filename, wxString& description)
fp.Seek( fileOffset );
if( fp.Read( &aROMVER, 14 ) == 0 ) break;
fp.Seek( filepos ); //go back
aROMVER[14] = 0;
const char zonefail[2] = { aROMVER[4], '\0' }; // the default "zone" (unknown code)