wx: Add a logging dialog box, and a debug menu.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@775 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-03-14 00:40:59 +00:00
parent d228e92e83
commit 3f6a5d358b
9 changed files with 519 additions and 66 deletions

View File

@ -5,7 +5,7 @@ bin_PROGRAMS = pcsx2
# the application source, library search path, and link libraries
pcsx2_SOURCES = \
frmGameFixes.cpp frmGameFixes.h frmMain.cpp frmMain.h main.cpp \
frmGameFixes.cpp frmGameFixes.h frmMain.cpp frmMain.h frmLogging.cpp frmLogging.h main.cpp \
memzero.h
pcsx2_LDFLAGS =

View File

@ -1,4 +1,21 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2009 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "PrecompiledHeader.h"
#include "Misc.h"
#include "frmGameFixes.h"
@ -6,27 +23,27 @@
frmGameFixes::frmGameFixes(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size, long style):
wxDialog( parent, id, _T("Game Special Fixes"), pos, size )
{
wxStaticBox* groupbox = new wxStaticBox( this, -1, _T("PCSX2 Gamefixes"));
wxStaticText* label_Title = new wxStaticText(
wxStaticBox* groupbox = new wxStaticBox( this, -1, _T("PCSX2 Gamefixes"));
wxStaticText* label_Title = new wxStaticText(
this, wxID_ANY, _T("Some games need special settings.\nConfigure them here."), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE
);
wxCheckBox* chk_FPUCompareHack = new wxCheckBox(
wxCheckBox* chk_FPUCompareHack = new wxCheckBox(
this, wxID_ANY, _T("FPU Compare Hack - Special fix for Digimon Rumble Arena 2.")
);
wxCheckBox* chk_TriAce = new wxCheckBox(
wxCheckBox* chk_TriAce = new wxCheckBox(
this, wxID_ANY, _T("VU Add / Sub Hack - Special fix for Tri-Ace games!")
);
wxCheckBox* chk_GodWar = new wxCheckBox(
wxCheckBox* chk_GodWar = new wxCheckBox(
this, wxID_ANY, _T("VU Clip Hack - Special fix for God of War")
);
wxBoxSizer& mainSizer = *new wxBoxSizer( wxVERTICAL );
wxBoxSizer& mainSizer = *new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer& groupSizer = *new wxStaticBoxSizer( groupbox, wxVERTICAL );
wxSizerFlags stdSpacing( wxSizerFlags().Border( wxALL, 6 ) );
groupSizer.Add( chk_FPUCompareHack, stdSpacing );
groupSizer.Add( chk_TriAce, stdSpacing );
groupSizer.Add( chk_GodWar, stdSpacing );
groupSizer.Add( chk_FPUCompareHack);
groupSizer.Add( chk_TriAce);
groupSizer.Add( chk_GodWar);
mainSizer.Add( label_Title, wxSizerFlags().Align(wxALIGN_CENTER).DoubleBorder() );
mainSizer.Add( &groupSizer, wxSizerFlags().Align(wxALIGN_CENTER).DoubleHorzBorder() );

View File

@ -1,4 +1,21 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2009 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/wx.h>
#include <wx/image.h>

View File

@ -0,0 +1,88 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2009 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "PrecompiledHeader.h"
#include "Misc.h"
#include "frmLogging.h"
frmLogging::frmLogging(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size, long style):
wxDialog( parent, id, _T("Logging"), pos, size )
{
int i;
wxStaticBox* mainbox = new wxStaticBox( this, -1, wxEmptyString);
wxBoxSizer *mainsizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBox* eebox = new wxStaticBox( this, -1, _T("EE Logs"));
wxStaticBoxSizer *eeSizer = new wxStaticBoxSizer( eebox, wxVERTICAL );
eeSizer->Add(new wxCheckBox(this, EE_CPU_LOG, _T("Cpu Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_MEM_LOG, _T("Mem Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_HW_LOG, _T("Hw Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_DMA_LOG, _T("Dma Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_BIOS_LOG, _T("Bios Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_ELF_LOG, _T("Elf Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_FPU_LOG, _T("Fpu Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_MMI_LOG, _T("MMI Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_VU0_LOG, _T("VU0 Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_COP0_LOG, _T("Cop0 Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_VIF_LOG, _T("Vif Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_SPR_LOG, _T("SPR Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_GIF_LOG, _T("GIF Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_SIF_LOG, _T("Sif Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_IPU_LOG, _T("IPU Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_VU_MACRO_LOG, _T("VU Macro Log")), 0, wxEXPAND);
eeSizer->Add(new wxCheckBox(this, EE_RPC_LOG, _T("RPC Log")), 0, wxEXPAND);
mainsizer->Add(eeSizer, 0, wxEXPAND);
wxStaticBox* iopbox = new wxStaticBox( this, -1, _T("IOP Logs"));
wxStaticBoxSizer *iopSizer = new wxStaticBoxSizer( iopbox, wxVERTICAL );
iopSizer->Add(new wxCheckBox(this, IOP_IOP_LOG, _T("IOP Log")), 0, wxEXPAND);
iopSizer->Add(new wxCheckBox(this, IOP_MEM_LOG, _T("Mem Log")), 0, wxEXPAND);
iopSizer->Add(new wxCheckBox(this, IOP_HW_LOG, _T("Hw Log")), 0, wxEXPAND);
iopSizer->Add(new wxCheckBox(this, IOP_BIOS_LOG, _T("Bios Log")), 0, wxEXPAND);
iopSizer->Add(new wxCheckBox(this, IOP_DMA_LOG, _T("Dma Log")), 0, wxEXPAND);
iopSizer->Add(new wxCheckBox(this, IOP_PAD_LOG, _T("Pad Log")), 0, wxEXPAND);
iopSizer->Add(new wxCheckBox(this, IOP_GTE_LOG, _T("Gte Log")), 0, wxEXPAND);
iopSizer->Add(new wxCheckBox(this, IOP_CDR_LOG, _T("Cdr Log")), 0, wxEXPAND);
iopSizer->Add(new wxCheckBox(this, IOP_GPU_LOG, _T("GPU Log")), 0, wxEXPAND);
mainsizer->Add(iopSizer, 0, wxEXPAND);
wxStaticBox* miscbox = new wxStaticBox( this, -1, _T("Misc"));
wxStaticBoxSizer *miscSizer = new wxStaticBoxSizer( miscbox, wxVERTICAL );
miscSizer->Add(new wxCheckBox(this, STDOUT_LOG, _T("Log to STDOUT")), 0, wxEXPAND);
miscSizer->Add(new wxCheckBox(this, SYMS_LOG, _T("SYMs Log")), 0, wxEXPAND);
mainsizer->Add(miscSizer, 0, wxEXPAND);
SetSizerAndFit( mainsizer, true );
// Connect all the checkboxes to one function, and pass the checkbox id as user data.
for (i = EE_CPU_LOG; i >= SYMS_LOG; i++)
Connect(i, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(frmLogging::LogChecked), i);
}
void frmLogging::LogChecked(wxCommandEvent &event)
{
// The checkbox checked should be in event.m_callbackUserData.
event.Skip();
}

68
pcsx2/NewGUI/frmLogging.h Normal file
View File

@ -0,0 +1,68 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2009 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/wx.h>
#include <wx/image.h>
#pragma once
class frmLogging: public wxDialog
{
public:
frmLogging(wxWindow* parent, int id, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE);
protected:
// DECLARE_EVENT_TABLE();
enum {
EE_CPU_LOG = 100,
EE_MEM_LOG,
EE_HW_LOG,
EE_DMA_LOG,
EE_BIOS_LOG,
EE_ELF_LOG,
EE_FPU_LOG,
EE_MMI_LOG,
EE_VU0_LOG,
EE_COP0_LOG,
EE_VIF_LOG,
EE_SPR_LOG,
EE_GIF_LOG,
EE_SIF_LOG,
EE_IPU_LOG,
EE_VU_MACRO_LOG,
EE_RPC_LOG,
IOP_IOP_LOG,
IOP_MEM_LOG,
IOP_HW_LOG,
IOP_BIOS_LOG,
IOP_DMA_LOG,
IOP_PAD_LOG,
IOP_GTE_LOG,
IOP_CDR_LOG,
IOP_GPU_LOG,
STDOUT_LOG,
SYMS_LOG
} LogChecks;
public:
void LogChecked(wxCommandEvent &event);
};

View File

@ -1,9 +1,26 @@
// -*- C++ -*- generated by wxGlade 0.6.3 on Wed Mar 04 16:53:31 2009
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2009 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "PrecompiledHeader.h"
#include "Misc.h"
#include "frmMain.h"
#include "frmGameFixes.h"
#include "frmLogging.h"
wxMenu* frmMain::MakeLanguagesMenu() const
{
@ -33,11 +50,11 @@ wxMenu* frmMain::MakeStatesSubMenu( int baseid ) const
wxMenu* mnuSubstates = new wxMenu();
wxString slot( _T("Slot") );
mnuSubstates->Append( baseid, _T("Slot"), wxEmptyString, wxITEM_NORMAL );
mnuSubstates->Append( baseid+1, _T("Slot"), wxEmptyString, wxITEM_NORMAL );
mnuSubstates->Append( baseid+2, _T("Slot"), wxEmptyString, wxITEM_NORMAL );
mnuSubstates->Append( baseid+3, _T("Slot"), wxEmptyString, wxITEM_NORMAL );
mnuSubstates->Append( baseid+4, _T("Slot"), wxEmptyString, wxITEM_NORMAL );
mnuSubstates->Append( baseid, _T("Slot 0"), wxEmptyString, wxITEM_NORMAL );
mnuSubstates->Append( baseid+1, _T("Slot 1"), wxEmptyString, wxITEM_NORMAL );
mnuSubstates->Append( baseid+2, _T("Slot 2"), wxEmptyString, wxITEM_NORMAL );
mnuSubstates->Append( baseid+3, _T("Slot 3"), wxEmptyString, wxITEM_NORMAL );
mnuSubstates->Append( baseid+4, _T("Slot 4"), wxEmptyString, wxITEM_NORMAL );
return mnuSubstates;
}
@ -65,6 +82,31 @@ void frmMain::PopulatePadMenu()
m_menuPad.Append( Menu_Pad_Advanced, _T("Advanced..."), wxEmptyString, wxITEM_NORMAL );
}
void frmMain::ConnectMenus()
{
// This just seems a bit more flexable & intuitive to me, if overly verbose.
Connect( Menu_QuickBootCD, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_QuickBootCD_Click));
Connect( Menu_FullBootCD, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_BootCD_Click));
Connect( Menu_BootNoCD, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_BootNoCD_Click));
Connect( Menu_RunELF, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_OpenELF_Click));
Connect( Menu_Run_Exit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_Exit_Click));
Connect( Menu_SuspendExec, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_Suspend_Click));
Connect( Menu_ResumeExec, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_Resume_Click));
Connect( Menu_Reset, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_Reset_Click));
Connect( Menu_State_LoadOther, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_LoadStateOther_Click));
Connect( Menu_State_SaveOther, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_SaveStateOther_Click));
Connect( Menu_Config_Gamefixes, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_Gamefixes_Click));
Connect( Menu_Debug_Open, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_Debug_Open_Click));
Connect( Menu_Debug_MemoryDump, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_Debug_MemoryDump_Click));
Connect( Menu_Debug_Logging, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(frmMain::Menu_Debug_Logging_Click));
}
frmMain::frmMain(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
wxFrame(parent, id, title, pos, size, wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxBORDER_THEME),
@ -76,9 +118,10 @@ frmMain::frmMain(wxWindow* parent, int id, const wxString& title, const wxPoint&
m_menuConfig( *new wxMenu() ),
m_menuMisc( *new wxMenu() ),
m_menuVideo( *new wxMenu() ),
m_menuAudio( *new wxMenu() ),
m_menuPad( *new wxMenu() ),
m_menuVideo( *new wxMenu() ),
m_menuAudio( *new wxMenu() ),
m_menuPad( *new wxMenu() ),
m_menuDebug( *new wxMenu() ),
m_LoadStatesSubmenu( *MakeStatesSubMenu( Menu_State_Load01 ) ),
m_SaveStatesSubmenu( *MakeStatesSubMenu( Menu_State_Save01 ) )
@ -86,16 +129,16 @@ frmMain::frmMain(wxWindow* parent, int id, const wxString& title, const wxPoint&
// ------------------------------------------------------------------------
m_menuRun.Append(Menu_QuickBootCD, _T("Boot CDVD (Quick)"), wxEmptyString, wxITEM_NORMAL);
m_menuRun.Append(Menu_QuickBootCD, _T("Boot CDVD (Quick)"), wxEmptyString, wxITEM_NORMAL);
m_menuRun.Append(Menu_FullBootCD, _T("Boot CDVD (Full)"), wxEmptyString, wxITEM_NORMAL);
m_menuRun.Append(Menu_BootNoCD, _T("Boot without CDVD"), wxEmptyString, wxITEM_NORMAL);
m_menuRun.Append(Menu_RunELF, _T("Run ELF File..."), wxEmptyString, wxITEM_NORMAL);
m_menuRun.AppendSeparator();
m_menuRun.AppendSeparator();
m_menuRun.Append(Menu_SuspendExec, _T("Suspend"), _T("Suspends emulation progress."), wxITEM_NORMAL);
m_menuRun.Append(Menu_ResumeExec, _T("Resume"), _T("Resumes emulation progress."), wxITEM_NORMAL);
m_menuRun.Append(Menu_ResumeExec, _T("Resume"), _T("Resumes emulation progress."), wxITEM_NORMAL);
m_menuRun.Append(Menu_States, _T("States"), MakeStatesMenu(), wxEmptyString);
m_menuRun.Append(Menu_Reset, _T("Reset"), _T("Resets emulation state and reloads plugins."), wxITEM_NORMAL);
m_menuRun.Append(Menu_Reset, _T("Reset"), _T("Resets emulation state and reloads plugins."), wxITEM_NORMAL);
m_menuRun.AppendSeparator();
m_menuRun.Append(Menu_Run_Exit, _T("Exit"), _T("Closing Pcsx2 may be hazardous to your health"), wxITEM_NORMAL);
@ -141,41 +184,26 @@ frmMain::frmMain(wxWindow* parent, int id, const wxString& title, const wxPoint&
m_menuMisc.Append(Menu_About, _T("About..."), wxEmptyString, wxITEM_NORMAL);
m_menuMisc.Append(Menu_Website, _T("Pcsx2 Website..."), _T("Opens your web-browser!"), wxITEM_NORMAL);
m_menuDebug.Append(Menu_Debug_Open, _T("Open Debug Window..."), wxEmptyString, wxITEM_NORMAL);
m_menuDebug.Append(Menu_Debug_MemoryDump, _T("Memory Dump..."), wxEmptyString, wxITEM_NORMAL);
m_menuDebug.Append(Menu_Debug_Logging, _T("Logging..."), wxEmptyString, wxITEM_NORMAL);
m_menubar.Append( &m_menuRun, _T("Run" ));
m_menubar.Append( &m_menuConfig, _T("Config" ));
m_menubar.Append( &m_menuVideo, _T("Video" ));
m_menubar.Append( &m_menuAudio, _T("Audio" ));
m_menubar.Append( &m_menuPad, _T("Pad" ));
m_menubar.Append( &m_menuMisc, _T("Misc" ));
m_menubar.Append( &m_menuDebug, _T("Debug" ));
SetMenuBar( &m_menubar );
ConnectMenus();
// The many other fancy portions of our main window!
set_properties();
}
BEGIN_EVENT_TABLE(frmMain, wxFrame)
EVT_MENU( Menu_QuickBootCD, Menu_QuickBootCD_Click )
EVT_MENU( Menu_FullBootCD, Menu_BootCD_Click )
EVT_MENU( Menu_BootNoCD, Menu_BootNoCD_Click )
EVT_MENU( Menu_RunELF, Menu_OpenELF_Click )
EVT_MENU( Menu_Run_Exit, Menu_Exit_Click )
EVT_MENU( Menu_SuspendExec, Menu_Suspend_Click )
EVT_MENU( Menu_ResumeExec, Menu_Resume_Click )
EVT_MENU( Menu_Reset, Menu_Reset_Click )
EVT_MENU( Menu_State_LoadOther, Menu_LoadStateOther_Click )
EVT_MENU( Menu_State_SaveOther, Menu_SaveStateOther_Click )
EVT_MENU( Menu_Config_Gamefixes, Menu_Gamefixes_Click )
END_EVENT_TABLE();
void frmMain::Menu_QuickBootCD_Click(wxCommandEvent &event)
{
}
@ -203,6 +231,7 @@ void frmMain::Menu_SaveStateOther_Click(wxCommandEvent &event)
void frmMain::Menu_Exit_Click(wxCommandEvent &event)
{
Close();
}
void frmMain::Menu_Suspend_Click(wxCommandEvent &event)
@ -223,20 +252,30 @@ void frmMain::Menu_Gamefixes_Click( wxCommandEvent& event )
joe.ShowModal();
}
void frmMain::Menu_Debug_Open_Click(wxCommandEvent &event)
{
}
// wxGlade: add frmMain event handlers
void frmMain::Menu_Debug_MemoryDump_Click(wxCommandEvent &event)
{
}
void frmMain::Menu_Debug_Logging_Click(wxCommandEvent &event)
{
frmLogging joe( NULL, wxID_ANY );
joe.ShowModal();
}
void frmMain::set_properties()
{
wxSize backsize( m_background.GetSize() );
SetTitle(_("Pcsx2"));
wxIcon _icon( _T("./Cdrom02.png"), wxBITMAP_TYPE_PNG );
SetIcon(_icon);
SetClientSize( backsize );
int m_statusbar_widths[] = { (int)(backsize.GetWidth()*0.73), (int)(backsize.GetWidth()*0.25) };
m_statusbar.SetStatusWidths(2, m_statusbar_widths);
SetTitle(_("Pcsx2"));
wxIcon _icon( _T("./cdrom02.png"), wxBITMAP_TYPE_PNG );
SetIcon(_icon);
SetClientSize( backsize );
int m_statusbar_widths[] = { (int)(backsize.GetWidth()*0.73), (int)(backsize.GetWidth()*0.25) };
m_statusbar.SetStatusWidths(2, m_statusbar_widths);
m_statusbar.SetStatusText( _T("The Status is Good!"), 0);
m_statusbar.SetStatusText( _T("Good Status"), 1);

View File

@ -1,4 +1,22 @@
#pragma once
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2009 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma once
#include <wx/wx.h>
#include <wx/image.h>
@ -96,7 +114,7 @@ protected:
void PopulateVideoMenu();
void PopulateAudioMenu();
void PopulatePadMenu();
void ConnectMenus();
private:
void set_properties();
@ -109,6 +127,7 @@ protected:
wxMenu& m_menuRun;
wxMenu& m_menuConfig;
wxMenu& m_menuMisc;
wxMenu& m_menuDebug;
wxMenu& m_menuVideo;
wxMenu& m_menuAudio;
@ -117,25 +136,28 @@ protected:
wxMenu& m_LoadStatesSubmenu;
wxMenu& m_SaveStatesSubmenu;
DECLARE_EVENT_TABLE();
//////////////////////////////////////////////////////////////////////////////////////////
// Menu Options for the Main Window! :D
public:
void Menu_QuickBootCD_Click(wxCommandEvent &event);
void Menu_BootCD_Click(wxCommandEvent &event);
void Menu_BootCD_Click(wxCommandEvent &event);
void Menu_BootNoCD_Click(wxCommandEvent &event);
void Menu_OpenELF_Click(wxCommandEvent &event);
void Menu_LoadStateOther_Click(wxCommandEvent &event);
void Menu_SaveStateOther_Click(wxCommandEvent &event);
void Menu_Exit_Click(wxCommandEvent &event);
void Menu_OpenELF_Click(wxCommandEvent &event);
void Menu_LoadStateOther_Click(wxCommandEvent &event);
void Menu_SaveStateOther_Click(wxCommandEvent &event);
void Menu_Exit_Click(wxCommandEvent &event);
void Menu_Suspend_Click(wxCommandEvent &event);
void Menu_Suspend_Click(wxCommandEvent &event);
void Menu_Resume_Click(wxCommandEvent &event);
void Menu_Reset_Click(wxCommandEvent &event);
void Menu_Reset_Click(wxCommandEvent &event);
void Menu_Gamefixes_Click( wxCommandEvent& event );
void Menu_Debug_Open_Click(wxCommandEvent &event);
void Menu_Debug_MemoryDump_Click(wxCommandEvent &event);
void Menu_Debug_Logging_Click(wxCommandEvent &event);
};

View File

@ -1,4 +1,21 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2009 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "PrecompiledHeader.h"
#include <wx/wx.h>
#include <wx/image.h>

185
pcsx2/NewGUI/memzero.h Normal file
View File

@ -0,0 +1,185 @@
/* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2009 Pcsx2 Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _LNX_MEMZERO_H_
#define _LNX_MEMZERO_H_
// To-do: either create a combined Linux/Windows version of this file, or create somewhere to put Linux/Windows
// Specific versions of files.
// This header contains non-optimized implementation of memzero_ptr and memset8_obj,
// memset16_obj, etc.
template< u32 data, typename T >
static __forceinline void memset32_obj( T& obj )
{
// this function works on 32-bit aligned lengths of data only.
// If the data length is not a factor of 32 bits, the C++ optimizing compiler will
// probably just generate mysteriously broken code in Release builds. ;)
jASSUME( (sizeof(T) & 0x3) == 0 );
u32* dest = (u32*)&obj;
for( int i=sizeof(T)>>2; i; --i, ++dest )
*dest = data;
}
template< uint size >
static __forceinline void memzero_ptr( void* dest )
{
memset( dest, 0, size );
}
template< typename T >
static __forceinline void memzero_obj( T& obj )
{
memset( &obj, 0, sizeof( T ) );
}
template< u8 data, typename T >
static __forceinline void memset8_obj( T& obj )
{
// Aligned sizes use the optimized 32 bit inline memset. Unaligned sizes use memset.
if( (sizeof(T) & 0x3) != 0 )
memset( &obj, data, sizeof( T ) );
else
memset32_obj<data + (data<<8) + (data<<16) + (data<<24)>( obj );
}
template< u16 data, typename T >
static __forceinline void memset16_obj( T& obj )
{
if( (sizeof(T) & 0x3) != 0 )
_memset_16_unaligned( &obj, data, sizeof( T ) );
else
memset32_obj<data + (data<<16)>( obj );
}
// An optimized memset for 8 bit destination data.
template< u8 data, size_t bytes >
static __forceinline void memset_8( void *dest )
{
if( bytes == 0 ) return;
if( (bytes & 0x3) != 0 )
{
// unaligned data length. No point in doing an optimized inline version (too complicated!)
// So fall back on the compiler implementation:
memset( dest, data, bytes );
return;
}
// This function only works on 32-bit alignments of data copied.
jASSUME( (bytes & 0x3) == 0 );
enum
{
remdat = bytes>>2,
data32 = data + (data<<8) + (data<<16) + (data<<24)
};
// macro to execute the x86/32 "stosd" copies.
switch( remdat )
{
case 1:
*(u32*)dest = data32;
return;
case 2:
((u32*)dest)[0] = data32;
((u32*)dest)[1] = data32;
return;
case 3:
__asm__
(
".intel_syntax noprefix\n"
"cld\n"
// "mov edi, %0\n"
// "mov eax, %1\n"
"stosd\n"
"stosd\n"
"stosd\n"
".att_syntax\n"
:
: "D"(dest), "a"(data32)
// D - edi, a -- eax, c ecx
:
);
return;
case 4:
__asm__
(
".intel_syntax noprefix\n"
"cld\n"
// "mov edi, %0\n"
// "mov eax, %1\n"
"stosd\n"
"stosd\n"
"stosd\n"
"stosd\n"
".att_syntax\n"
:
: "D"(dest), "a"(data32)
:
);
return;
case 5:
__asm__
(
".intel_syntax noprefix\n"
"cld\n"
// "mov edi, %0\n"
// "mov eax, %1\n"
"stosd\n"
"stosd\n"
"stosd\n"
"stosd\n"
"stosd\n"
".att_syntax\n"
:
: "D"(dest), "a"(data32)
:
);
return;
default:
__asm__
(
".intel_syntax noprefix\n"
"cld\n"
// "mov ecx, %0\n"
// "mov edi, %1\n"
// "mov eax, %2\n"
"rep stosd\n"
".att_syntax\n"
:
: "c"(remdat), "D"(dest), "a"(data32)
:
);
return;
}
}
#endif