示例#1
0
void GSFrame::OnUpdateTitle( wxTimerEvent& evt )
{
#ifdef __linux__
    // Important Linux note: When the title is set in fullscreen the window is redrawn. Unfortunately
    // an intermediate white screen appears too which leads to a very annoying flickering.
    if (IsFullScreen()) return;
#endif

    double fps = wxGetApp().FpsManager.GetFramerate();

    char gsDest[128];
    GSgetTitleInfo2( gsDest, sizeof(gsDest) );

    const wxChar* limiterStr = L"None";

    if( g_Conf->EmuOptions.GS.FrameLimitEnable )
    {
        switch( g_LimiterMode )
        {
        case Limit_Nominal:
            limiterStr = L"Normal";
            break;
        case Limit_Turbo:
            limiterStr = L"Turbo";
            break;
        case Limit_Slomo:
            limiterStr = L"Slomo";
            break;
        }
    }

    FastFormatUnicode cpuUsage;
    if (m_CpuUsage.IsImplemented()) {
        m_CpuUsage.UpdateStats();
        if (THREAD_VU1) { // Display VU thread's usage
            cpuUsage.Write(L" | EE: %3d%% | GS: %3d%% | VU: %3d%% | UI: %3d%%",
                           m_CpuUsage.GetEEcorePct(),	m_CpuUsage.GetGsPct(),
                           m_CpuUsage.GetVUPct(),		m_CpuUsage.GetGuiPct());
        }
        else {
            cpuUsage.Write(L" | EE: %3d%% | GS: %3d%% | UI: %3d%%",
                           m_CpuUsage.GetEEcorePct(),	m_CpuUsage.GetGsPct(),
                           m_CpuUsage.GetGuiPct());
        }
    }

    const u64& smode2 = *(u64*)PS2GS_BASE(GS_SMODE2);

    SetTitle( pxsFmt( L"%s | %ls (%ls) | Limiter: %ls | fps: %6.02f%ls | State %d",
                      WX_STR(fromUTF8(gsDest)),
                      (smode2 & 1) ? L"Interlaced" : L"Progressive",
                      (smode2 & 2) ? L"frame" : L"field",
                      limiterStr, fps, cpuUsage.c_str(), States_GetCurrentSlot() )
            );

    //States_GetCurrentSlot()
}
示例#2
0
int InputIsoFile::ReadSync(u8* dst, uint lsn)
{
	if (lsn > m_blocks)
	{
		FastFormatUnicode msg;
		msg.Write("isoFile error: Block index is past the end of file! (%u > %u).", lsn, m_blocks);

		pxAssertDev(false, msg);
		Console.Error(msg.c_str());
		return -1;
	}

	return m_reader->ReadSync(dst+m_blockofs, lsn, 1);
}
示例#3
0
// Notes:
//  * This method should be called if the object is already in an released (unreserved) state.
//    Subsequent calls will be ignored, and the existing reserve will be returned.
//
// Parameters:
//   size - size of the reserve, in bytes. (optional)
//     If not specified (or zero), then the default size specified in the constructor for the
//     object instance is used.
//
//   upper_bounds - criteria that must be met for the allocation to be valid.
//     If the OS refuses to allocate the memory below the specified address, the
//     object will fail to initialize and an exception will be thrown.
void* VirtualMemoryReserve::Reserve( size_t size, uptr base, uptr upper_bounds )
{
	if (!pxAssertDev( m_baseptr == NULL, "(VirtualMemoryReserve) Invalid object state; object has already been reserved." ))
		return m_baseptr;

	if (!size) size = m_defsize;
	if (!size) return NULL;

	m_pages_reserved = (size + __pagesize-4) / __pagesize;
	uptr reserved_bytes = m_pages_reserved * __pagesize;

	m_baseptr = (void*)HostSys::MmapReserve(base, reserved_bytes);

	if (!m_baseptr || (upper_bounds != 0 && (((uptr)m_baseptr + reserved_bytes) > upper_bounds)))
	{
		DevCon.Warning( L"%s: host memory @ %s -> %s is unavailable; attempting to map elsewhere...",
			m_name.c_str(), pxsPtr(base), pxsPtr(base + size) );

		SafeSysMunmap(m_baseptr, reserved_bytes);

		if (base)
		{
			// Let's try again at an OS-picked memory area, and then hope it meets needed
			// boundschecking criteria below.
			m_baseptr = HostSys::MmapReserve( 0, reserved_bytes );
		}
	}

	if ((upper_bounds != 0) && (((uptr)m_baseptr + reserved_bytes) > upper_bounds))
	{
		SafeSysMunmap(m_baseptr, reserved_bytes);
		// returns null, caller should throw an exception or handle appropriately.
	}

	if (!m_baseptr) return NULL;

	FastFormatUnicode mbkb;
	uint mbytes = reserved_bytes / _1mb;
	if (mbytes)
		mbkb.Write( "[%umb]", mbytes );
	else
		mbkb.Write( "[%ukb]", reserved_bytes / 1024 );

	DevCon.WriteLn( Color_Gray, L"%-32s @ %s -> %s %s", m_name.c_str(),
		pxsPtr(m_baseptr), pxsPtr((uptr)m_baseptr+reserved_bytes), mbkb.c_str());

	return m_baseptr;
}
示例#4
0
Panels::FirstTimeIntroPanel::FirstTimeIntroPanel( wxWindow* parent )
	: wxPanelWithHelpers( parent, wxVERTICAL )
{
	SetMinWidth( 600 );

	FastFormatUnicode faqFile;
#ifndef DOC_DIR_COMPILATION
	faqFile.Write( L"file:///%s/Docs/PCSX2_FAQ.pdf", WX_STR(InstallFolder.ToString()) );
#else
	// Each linux distributions have his rules for path so we give them the possibility to
	// change it with compilation flags. -- Gregory
#define xDOC_str(s) DOC_str(s)
#define DOC_str(s) #s
	faqFile.Write( L"file://%s/PCSX2_FAQ.pdf", WX_STR(wxDirName(xDOC_str(DOC_DIR_COMPILATION)).ToString()) );
#endif

	wxStaticBoxSizer& langSel	= *new wxStaticBoxSizer( wxVERTICAL, this, _("Language selector") );

	langSel += new Panels::LanguageSelectionPanel( this ) | StdCenter();
	langSel += Heading(_("Change the language only if you need to.\nThe system default should be fine for most operating systems."));
	langSel += 8;

	*this += langSel | StdExpand();
	*this += GetCharHeight() * 2;

	*this += Heading(_("Welcome to PCSX2!")).Bold() | StdExpand();
	*this += GetCharHeight();

	*this += Heading(AddAppName(
		pxE( L"This wizard will help guide you through configuring plugins, memory cards, and BIOS.  It is recommended if this is your first time installing %s that you view the readme and configuration guide."
		) )
	);

	*this += GetCharHeight() * 2;

	*this	+= new wxHyperlinkCtrl( this, wxID_ANY,
		_("Configuration Guides (online)"), L"http://www.pcsx2.net/guide.php"
	) | pxCenter.Border( wxALL, 5 );
		
	*this	+= new wxHyperlinkCtrl( this, wxID_ANY,
		_("Readme / FAQ (Offline/PDF)"), faqFile.c_str()
	) | pxCenter.Border( wxALL, 5 );

}
示例#5
0
void InputIsoFile::BeginRead2(uint lsn)
{
	if (lsn > m_blocks)
	{
		FastFormatUnicode msg;
		msg.Write("isoFile error: Block index is past the end of file! (%u > %u).", lsn, m_blocks);

		pxAssertDev(false, msg);
		Console.Error(msg.c_str());

		// [TODO] : Throw exception?
		//  Typically an error like this is bad; indicating an invalid dump or corrupted
		//  iso file.

		m_current_lsn = -1;
		return;
	}
	
	m_current_lsn = lsn;

	if(lsn >= m_read_lsn && lsn < (m_read_lsn+m_read_count))
	{
		// Already buffered
		return;
	}

	m_read_lsn = lsn;
	m_read_count = 1;

	if(ReadUnit > 1)
	{
		//m_read_lsn   = lsn - (lsn % ReadUnit);

		m_read_count = std::min(ReadUnit, m_blocks - m_read_lsn);
	}

	m_reader->BeginRead(m_readbuffer, m_read_lsn, m_read_count);
	m_read_inprogress = true;
}
示例#6
0
Panels::FirstTimeIntroPanel::FirstTimeIntroPanel( wxWindow* parent )
	: wxPanelWithHelpers( parent, wxVERTICAL )
{
	SetMinWidth( 600 );

	FastFormatUnicode faqFile;
	faqFile.Write( L"file:///%s/Docs/PCSX2_FAQ.pdf",
		InstallFolder.ToString().c_str() );

	wxStaticBoxSizer& langSel	= *new wxStaticBoxSizer( wxVERTICAL, this, _("Language selector") );

	langSel += new Panels::LanguageSelectionPanel( this ) | StdCenter();
	langSel += Heading(_("Change the language only if you need to.\nThe system default should be fine for most operating systems."));
	langSel += 8;

	*this += langSel | StdExpand();
	*this += GetCharHeight() * 2;

	*this += Heading(_("Welcome to PCSX2!")).Bold() | StdExpand();
	*this += GetCharHeight();

	*this += Heading(AddAppName(
		pxE( L"This wizard will help guide you through configuring plugins, memory cards, and BIOS.  It is recommended if this is your first time installing %s that you view the readme and configuration guide."
		) )
	);

	*this += GetCharHeight() * 2;

	*this	+= new wxHyperlinkCtrl( this, wxID_ANY,
		_("Configuration Guides (online)"), L"http://www.pcsx2.net/guide.php"
	) | pxCenter.Border( wxALL, 5 );
		
	*this	+= new wxHyperlinkCtrl( this, wxID_ANY,
		_("Readme / FAQ (Offline/PDF)"), faqFile.c_str()
	) | pxCenter.Border( wxALL, 5 );

}
示例#7
0
__fi void pxOnAssert( const DiagnosticOrigin& origin, const FastFormatUnicode& msg)
{
	pxOnAssert( origin, msg.c_str());
}