* Fixed some bugs in the SYSTEM.CNF loader (most notably it will not crash on files over 512 bytes -- some PS2 images pad their system.cnf to 32k)

* Botting NoDisc with "Skip BIOS" enabled should work now (untested).
 * Renamed StaticText / StaticHeading helpers to simply Text and Heading.
 * Made the iR5900 recompiler's stack alignment check a dynamic toggle instead of a dev/debug build preprocessor.
 * Fix annoying linux linker errors.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2229 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-11-21 07:44:11 +00:00
parent 799b89ab65
commit ae1dcb7ac6
12 changed files with 135 additions and 115 deletions

View File

@ -128,15 +128,8 @@ struct pxWindowAndFlags
};
__forceinline wxSizerFlags operator | ( const wxSizerFlags& _flgs, pxAlignmentType align )
{
return align.Apply( _flgs );
}
__forceinline wxSizerFlags operator | ( const wxSizerFlags& _flgs, pxStretchType stretch )
{
return stretch.Apply( _flgs );
}
extern wxSizerFlags operator | ( const wxSizerFlags& _flgs, pxAlignmentType align );
extern wxSizerFlags operator | ( const wxSizerFlags& _flgs, pxStretchType stretch );
template< typename WinType >
pxWindowAndFlags<WinType> operator | ( WinType* _win, const wxSizerFlags& _flgs )
@ -245,8 +238,8 @@ public:
virtual ~wxDialogWithHelpers() throw();
void AddOkCancel( wxSizer& sizer, bool hasApply=false );
pxStaticText* StaticText( const wxString& label );
pxStaticHeading* StaticHeading( const wxString& label );
pxStaticText* Text( const wxString& label );
pxStaticHeading* Heading( const wxString& label );
wxDialogWithHelpers& SetIdealWidth( int newWidth ) { m_idealWidth = newWidth; return *this; }
int GetIdealWidth() const { return m_idealWidth; }
@ -267,7 +260,7 @@ protected:
// to retrieve it, or use the "*this += window;" syntax to add windows directly to it.
//
// * Built-in support for StaticBoxes (aka groupboxes). Create one at construction with
// a wxString label, or add one "after the fact" using AddStaticBox.
// a wxString label, or add one "after the fact" using AddFrame.
//
// * Propagates IdealWidth settings from parenting wxPanelWithHelpers classes, and auto-
// matically adjusts the width based on the sizer type (groupsizers get truncated to
@ -286,10 +279,10 @@ public:
wxPanelWithHelpers( wxWindow* parent, const wxPoint& pos, const wxSize& size=wxDefaultSize );
explicit wxPanelWithHelpers( wxWindow* parent=NULL );
wxPanelWithHelpers* AddStaticBox( const wxString& label, wxOrientation orient=wxVERTICAL );
wxPanelWithHelpers* AddFrame( const wxString& label, wxOrientation orient=wxVERTICAL );
pxStaticText* StaticText( const wxString& label );
pxStaticHeading* StaticHeading( const wxString& label );
pxStaticText* Text( const wxString& label );
pxStaticHeading* Heading( const wxString& label );
// TODO : Propagate to children?
wxPanelWithHelpers& SetIdealWidth( int width ) { m_idealWidth = width; return *this; }

View File

@ -99,6 +99,16 @@ wxSizerFlags pxStretchType::Apply( wxSizerFlags flags ) const
return flags;
}
wxSizerFlags operator | ( const wxSizerFlags& _flgs, pxAlignmentType align )
{
return align.Apply( _flgs );
}
wxSizerFlags operator | ( const wxSizerFlags& _flgs, pxStretchType stretch )
{
return stretch.Apply( _flgs );
}
void operator+=( wxSizer& target, wxWindow* src )
{

View File

@ -78,12 +78,12 @@ wxDialogWithHelpers::~wxDialogWithHelpers() throw()
pxAssert( m_DialogIdents[GetId()] >= 0 );
}
pxStaticText* wxDialogWithHelpers::StaticText( const wxString& label )
pxStaticText* wxDialogWithHelpers::Text( const wxString& label )
{
return new pxStaticText( this, label );
}
pxStaticHeading* wxDialogWithHelpers::StaticHeading( const wxString& label )
pxStaticHeading* wxDialogWithHelpers::Heading( const wxString& label )
{
return new pxStaticHeading( this, label );
}
@ -169,7 +169,11 @@ void wxPanelWithHelpers::Init()
}
}
wxPanelWithHelpers* wxPanelWithHelpers::AddStaticBox( const wxString& label, wxOrientation orient )
// Creates a Static Box container for this panel. the static box sizer becomes the default
// sizer for this panel. If the panel already has a sizer set, then that sizer will be
// transfered to the new StaticBoxSizer (and will be the first item in it's list, retaining
// consistent and expected layout)
wxPanelWithHelpers* wxPanelWithHelpers::AddFrame( const wxString& label, wxOrientation orient )
{
wxSizer* oldSizer = GetSizer();
@ -182,12 +186,12 @@ wxPanelWithHelpers* wxPanelWithHelpers::AddStaticBox( const wxString& label, wxO
return this;
}
pxStaticText* wxPanelWithHelpers::StaticText( const wxString& label )
pxStaticText* wxPanelWithHelpers::Text( const wxString& label )
{
return new pxStaticText( this, label );
}
pxStaticHeading* wxPanelWithHelpers::StaticHeading( const wxString& label )
pxStaticHeading* wxPanelWithHelpers::Heading( const wxString& label )
{
return new pxStaticHeading( this, label );
}

View File

@ -297,25 +297,28 @@ struct Pcsx2Config
{
BITFIELD32()
bool
EnableEE:1,
EnableIOP:1,
EnableVU0:1,
EnableVU1:1;
EnableEE :1,
EnableIOP :1,
EnableVU0 :1,
EnableVU1 :1;
bool
UseMicroVU0:1,
UseMicroVU1:1;
UseMicroVU0 :1,
UseMicroVU1 :1;
bool
vuOverflow:1,
vuExtraOverflow:1,
vuSignOverflow:1,
vuUnderflow:1;
vuOverflow :1,
vuExtraOverflow :1,
vuSignOverflow :1,
vuUnderflow :1;
bool
fpuOverflow:1,
fpuOverflow :1,
fpuExtraOverflow:1,
fpuFullMode:1;
fpuFullMode :1;
bool
StackFrameChecks:1;
BITFIELD_END
RecompilerOptions();
@ -361,6 +364,10 @@ struct Pcsx2Config
// ------------------------------------------------------------------------
struct VideoOptions
{
// forces the MTGS to execute tags/tasks in fully blocking/synchronous
// style. Useful for debugging potential bugs in the MTGS pipeline.
bool SynchronousMTGS;
bool EnableFrameLimiting;
bool EnableFrameSkipping;

View File

@ -610,57 +610,54 @@ int GetPS2ElfName( wxString& name )
int size = file.getLength();
if( size == 0 ) return 0;
file.read( buffer, size );
buffer[size] = '\0';
int retype = 0;
while( !file.eof() )
{
wxString original( fromUTF8(file.readLine().c_str()) );
ParsedAssignmentString parts( original );
if( parts.lvalue.IsEmpty() && parts.rvalue.IsEmpty() ) continue;
if( parts.rvalue.IsEmpty() )
{
Console.Error( "(GetElfName) Unusual or malformed entry in SYSTEM.CNF ignored:" );
Console.Indent().WriteLn( original );
continue;
}
if( parts.lvalue == L"BOOT2" )
{
name = parts.rvalue;
Console.WriteLn( Color_StrongBlue, L"(GetElfName) Detected PS2 Disc = " + name );
retype = 2;
}
else if( parts.lvalue == L"BOOT" )
{
name = parts.rvalue;
Console.WriteLn( Color_StrongBlue, L"(GetElfName) Detected PSX/PSone Disc = " + name );
retype = 1;
}
else if( parts.lvalue == L"VMODE" )
{
Console.WriteLn( Color_StrongBlue, L"(GetElfName) Disc region type = " + parts.rvalue );
}
else if( parts.lvalue == L"VER" )
{
Console.WriteLn( Color_StrongBlue, L"(GetElfName) Software version = " + parts.rvalue );
}
}
if( retype == 0 )
{
Console.Error("(GetElfName) Disc image is *not* a Playstation or PS2 game!");
return 0;
}
}
catch( Exception::FileNotFound& )
{
return 0; // no SYSTEM.CNF, not a PS1/PS2 disc.
}
int retype = 0;
wxArrayString lines;
SplitString( lines, fromUTF8((char*)buffer), L"\n" );
for( uint i=0; i<lines.GetCount(); ++i )
{
ParsedAssignmentString parts( lines[i] );
if( parts.rvalue.IsEmpty() )
{
Console.Error( "(GetElfName) Unusual or malformed entry in SYSTEM.CNF ignored:" );
Console.WriteLn( L"\t" + lines[i] );
continue;
}
if( parts.lvalue == L"BOOT2" )
{
name = parts.rvalue;
Console.WriteLn( Color_StrongBlue, L"(GetElfName) Detected PS2 Disc = " + name );
retype = 2;
}
else if( parts.lvalue == L"BOOT" )
{
name = parts.rvalue;
Console.WriteLn( Color_StrongBlue, L"(GetElfName) Detected PSX/PSone Disc = " + name );
retype = 1;
}
else if( parts.lvalue == L"VMODE" )
{
Console.WriteLn( Color_StrongBlue, L"(GetElfName) Disc region type = " + parts.rvalue );
}
else if( parts.lvalue == L"VER" )
{
Console.WriteLn( Color_StrongBlue, L"(GetElfName) Software version = " + parts.rvalue );
}
}
if( retype == 0 )
{
Console.Error("(GetElfName) Disc image is *not* a Playstation or PS2 game!");
return 0;
}
#ifdef PCSX2_DEVBUILD
FILE *fp;
int i;

View File

@ -70,25 +70,29 @@ void Pcsx2Config::ProfilerOptions::LoadSave( IniInterface& ini )
IniBitBool( RecBlocks_VU1 );
}
Pcsx2Config::RecompilerOptions::RecompilerOptions() : bitset(0)
Pcsx2Config::RecompilerOptions::RecompilerOptions()
{
bitset = 0;
StackFrameChecks = false;
// All recs are enabled by default.
EnableEE = true;
EnableIOP = true;
EnableVU0 = true;
EnableVU1 = true;
EnableEE = true;
EnableIOP = true;
EnableVU0 = true;
EnableVU1 = true;
UseMicroVU0 = true;
UseMicroVU1 = true;
UseMicroVU0 = true;
UseMicroVU1 = true;
// vu and fpu clamping default to standard overflow.
vuOverflow = true;
vuOverflow = true;
//vuExtraOverflow = false;
//vuSignOverflow = false;
//vuUnderflow = false;
fpuOverflow = true;
fpuOverflow = true;
//fpuExtraOverflow = false;
//fpuFullMode = false;
}
@ -147,6 +151,8 @@ void Pcsx2Config::RecompilerOptions::LoadSave( IniInterface& ini )
IniBitBool( fpuOverflow );
IniBitBool( fpuExtraOverflow );
IniBitBool( fpuFullMode );
IniBitBool( StackFrameChecks );
}
Pcsx2Config::CpuOptions::CpuOptions()
@ -179,16 +185,19 @@ void Pcsx2Config::CpuOptions::LoadSave( IniInterface& ini )
Recompiler.LoadSave( ini );
}
Pcsx2Config::VideoOptions::VideoOptions() :
EnableFrameLimiting( false )
, EnableFrameSkipping( false )
, DefaultRegionMode( Region_NTSC )
, FpsTurbo( 60*4 )
, FpsLimit( 60 )
, FpsSkip( 55 )
, ConsecutiveFrames( 2 )
, ConsecutiveSkip( 1 )
Pcsx2Config::VideoOptions::VideoOptions()
{
EnableFrameLimiting = false;
EnableFrameSkipping = false;
SynchronousMTGS = false;
DefaultRegionMode = Region_NTSC;
FpsTurbo = 60*4;
FpsLimit = 60;
FpsSkip = 55;
ConsecutiveFrames = 2;
ConsecutiveSkip = 1;
}
void Pcsx2Config::VideoOptions::LoadSave( IniInterface& ini )

View File

@ -178,7 +178,7 @@ void SysCoreThread::CpuInitializeMess()
ScopedBool_ClearOnError sbcoe( m_hasValidState );
wxString elf_file( m_elf_override );
if( elf_file.IsEmpty() && EmuConfig.SkipBiosSplash )
if( elf_file.IsEmpty() && EmuConfig.SkipBiosSplash && (CDVDsys_GetSourceType() != CDVDsrc_NoDisc))
{
// Fetch the ELF filename and CD type from the CDVD provider.
wxString ename;

View File

@ -84,7 +84,7 @@ Dialogs::AboutBoxDialog::AboutBoxDialog( wxWindow* parent, int id ):
SetSizer( new wxBoxSizer( wxVERTICAL ) );
*this += StaticText(_("PCSX2 - Playstation 2 Emulator"));
*this += Text(_("PCSX2 - Playstation 2 Emulator"));
// This sizer holds text of the authors and a logo!
wxBoxSizer& AuthLogoSizer = *new wxBoxSizer( wxHORIZONTAL );

View File

@ -86,7 +86,7 @@ Panels::BiosSelectorPanel::BiosSelectorPanel( wxWindow* parent, int idealWidth )
m_FolderPicker.SetStaticDesc( _("Click the Browse button to select a different folder where PCSX2 will look for PS2 BIOS roms.") );
*this += StaticText(_("Select a BIOS rom:"));
*this += Text(_("Select a BIOS rom:"));
*this += m_ComboBox | pxSizerFlags::StdExpand();
*this += 6;
*this += m_FolderPicker | pxSizerFlags::StdExpand();

View File

@ -167,7 +167,7 @@ Panels::UsermodeSelectionPanel::UsermodeSelectionPanel( wxWindow* parent, bool i
m_radio_UserMode->SetPaddingHoriz( m_radio_UserMode->GetPaddingHoriz() + 4 );
m_radio_UserMode->Realize();
*this += StaticText( (isFirstTime ? usermodeExplained : usermodeWarning) );
*this += Text( (isFirstTime ? usermodeExplained : usermodeWarning) );
*this += m_radio_UserMode | pxSizerFlags::StdExpand();
*this += 4;
}
@ -201,7 +201,7 @@ Panels::LanguageSelectionPanel::LanguageSelectionPanel( wxWindow* parent )
size, compiled.GetPtr(), wxCB_READONLY | wxCB_SORT );
m_picker->SetSelection( cursel );
*this += StaticText(_("Select a language: ")) | pxMiddle;
*this += Text(_("Select a language: ")) | pxMiddle;
*this += 5;
*this += m_picker | pxSizerFlags::StdSpace();
}

View File

@ -93,22 +93,22 @@ Panels::FramelimiterPanel::FramelimiterPanel( wxWindow* parent )
wxFlexGridSizer& s_spins( *new wxFlexGridSizer( 5 ) );
s_spins.AddGrowableCol( 0 );
s_spins += StaticText(_("Base Framerate Adjust:"));
s_spins += Text(_("Base Framerate Adjust:"));
s_spins += 5;
s_spins += m_spin_NominalPct | wxSF.Border(wxTOP, 3);
s_spins += StaticText(L"%" );
s_spins += Text(L"%" );
s_spins += 5;
s_spins += StaticText(_("Slow Motion Adjust:"));
s_spins += Text(_("Slow Motion Adjust:"));
s_spins += 5;
s_spins += m_spin_SlomoPct | wxSF.Border(wxTOP, 3);
s_spins += StaticText(L"%" );
s_spins += Text(L"%" );
s_spins += 5;
s_spins += StaticText(_("Turbo Adjust:"));
s_spins += Text(_("Turbo Adjust:"));
s_spins += 5;
s_spins += m_spin_TurboPct | wxSF.Border(wxTOP, 3);
s_spins += StaticText(L"%" );
s_spins += Text(L"%" );
s_spins += 5;
s_spins += 15;
@ -120,16 +120,16 @@ Panels::FramelimiterPanel::FramelimiterPanel( wxWindow* parent )
wxFlexGridSizer& s_fps( *new wxFlexGridSizer( 5 ) );
s_fps.AddGrowableCol( 0 );
s_fps += StaticText(_("NTSC Framerate:"));
s_fps += Text(_("NTSC Framerate:"));
s_fps += 5;
s_fps += m_text_BaseNtsc | wxSF.Right().Border(wxTOP, 3);
s_fps += StaticText(_("FPS"));
s_fps += Text(_("FPS"));
s_fps += 5;
s_fps += StaticText(_("PAL Framerate:"));
s_fps += Text(_("PAL Framerate:"));
s_fps += 5;
s_fps += m_text_BasePal | wxSF.Right().Border(wxTOP, 3);
s_fps += StaticText(_("FPS"));
s_fps += Text(_("FPS"));
s_fps += 5;
*this += s_spins | pxExpand;
@ -202,7 +202,7 @@ Panels::GSWindowSettingsPanel::GSWindowSettingsPanel( wxWindow* parent )
wxBoxSizer& s_customsize( *new wxBoxSizer( wxHORIZONTAL ) );
s_customsize += m_text_WindowWidth;
s_customsize += StaticText(L"x" );
s_customsize += Text(L"x" );
s_customsize += m_text_WindowHeight;
//wxFlexGridSizer& s_winsize( *new wxFlexGridSizer( 2 ) );
@ -242,10 +242,10 @@ Panels::VideoPanel::VideoPanel( wxWindow* parent ) :
right->SetIdealWidth( (right->GetIdealWidth()-16) / 2 );
GSWindowSettingsPanel* winpan = new GSWindowSettingsPanel( left );
winpan->AddStaticBox(_("Display/Window"));
winpan->AddFrame(_("Display/Window"));
FramelimiterPanel* fpan = new FramelimiterPanel( right );
fpan->AddStaticBox(_("Framelimiter"));
fpan->AddFrame(_("Framelimiter"));
wxFlexGridSizer* s_table = new wxFlexGridSizer( 2 );
@ -255,7 +255,7 @@ Panels::VideoPanel::VideoPanel( wxWindow* parent ) :
*s_table += left | StdExpand();
*s_table += right | StdExpand();
*this += StaticHeading(L"This panel is not implemented yet.\nIT DOES NOT WORK. AT ALL.");
*this += Heading(L"This panel is not implemented yet.\nIT DOES NOT WORK. AT ALL.");
*this += s_table;
// TODO:

View File

@ -334,7 +334,7 @@ static void __fastcall StackFrameCheckFailed( int espORebp, int regval )
static void _DynGen_StackFrameCheck()
{
if( !IsDevBuild ) return;
if( !EmuConfig.Recompiler.StackFrameChecks ) return;
// --------- EBP Here -----------