Interface and general: Fixed the hangings and crashes that would occur from repeated Start and Stop, added optional toolbar themes, made the fullscreen mode in the OpenGL plugin more user friendly for Windows users
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1770 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
1ed27a4fc1
commit
eb2ce16a6c
|
@ -26,7 +26,7 @@
|
|||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
//#include <tchar.h>
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -36,30 +36,14 @@
|
|||
// Enable or disable logging to screen and file
|
||||
#define MM_DEBUG
|
||||
//#define MM_DEBUG_FILEONLY
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
// _T
|
||||
/*
|
||||
#ifdef _UNICODE
|
||||
#define _T(x) L ## x
|
||||
#else // _UNICODE
|
||||
#define _T(x) x
|
||||
#endif // _UNICODE
|
||||
|
||||
To be used with
|
||||
//wprintf(_T("Please enter a number:"));
|
||||
//wprintf("Please enter a number");
|
||||
//wprintf(L"Please enter a number");
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
#ifdef MM_DEBUG
|
||||
FILE* __fStdOut = NULL;
|
||||
#endif
|
||||
#ifndef MM_DEBUG_FILEONLY
|
||||
HANDLE __hStdOut = NULL;
|
||||
#endif
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
|
||||
|
@ -70,7 +54,6 @@ To be used with
|
|||
// Width and height is the size of console window, if you specify fname,
|
||||
// the output will also be writton to this file. The file pointer is automatically closed
|
||||
// when you close the app
|
||||
//void startConsoleWin(int width=80, int height=2225, char* fname = NULL);
|
||||
void StartConsoleWin(int width, int height, char* fname)
|
||||
{
|
||||
#ifdef MM_DEBUG
|
||||
|
@ -103,10 +86,12 @@ void StartConsoleWin(int width, int height, char* fname)
|
|||
|
||||
#endif
|
||||
}
|
||||
/////////////////////////////
|
||||
|
||||
|
||||
// Use wprintf like TRACE0, TRACE1, ... (The arguments are the same as printf)
|
||||
//int wprintf(char *fmt, ...)
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Printf function
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
int wprintf(char *fmt, ...)
|
||||
{
|
||||
#ifdef MM_DEBUG
|
||||
|
@ -120,14 +105,12 @@ int wprintf(char *fmt, ...)
|
|||
|
||||
DWORD cCharsWritten;
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------------
|
||||
#ifndef MM_DEBUG_FILEONLY
|
||||
if(__hStdOut)
|
||||
{
|
||||
WriteConsole(__hStdOut, s, strlen(s), &cCharsWritten, NULL);
|
||||
}
|
||||
#endif
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
if(__fStdOut)
|
||||
{
|
||||
|
@ -139,4 +122,5 @@ int wprintf(char *fmt, ...)
|
|||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/////////////////////////////
|
|
@ -28,6 +28,12 @@
|
|||
#include "../../../../Source/Core/DolphinWX/Src/Globals.h" // DolphinWX
|
||||
#include "../../../../Source/Core/DolphinWX/Src/Frame.h"
|
||||
|
||||
#include "../../../../Source/Core/DolphinWX/resources/toolbar_plugin_dsp.c" // Icons
|
||||
#include "../../../../Source/Core/DolphinWX/resources/Boomy.h"
|
||||
#include "../../../../Source/Core/DolphinWX/resources/Vista.h"
|
||||
#include "../../../../Source/Core/DolphinWX/resources/KDE.h"
|
||||
#include "../../../../Source/Core/DolphinWX/resources/X-Plastik.h"
|
||||
|
||||
#include "../../Common/Src/Console.h" // Local
|
||||
#include "../../Player/Src/PlayerExport.h" // Player
|
||||
//////////////////////////////////
|
||||
|
@ -127,15 +133,33 @@ void ShowConsole()
|
|||
|
||||
#ifdef MUSICMOD
|
||||
void
|
||||
CFrame::MM_InitBitmaps()
|
||||
CFrame::MM_InitBitmaps(int Theme)
|
||||
{
|
||||
// Gray version
|
||||
// Define the log bitmaps
|
||||
switch (Theme)
|
||||
{
|
||||
case BOOMY:
|
||||
m_Bitmaps[Toolbar_Log] = wxGetBitmapFromMemory(Toolbar_Log_png);
|
||||
break;
|
||||
case VISTA:
|
||||
m_Bitmaps[Toolbar_Log] = wxGetBitmapFromMemory(Toolbar_Log1_png);
|
||||
break;
|
||||
case XPLASTIK:
|
||||
m_Bitmaps[Toolbar_Log] = wxGetBitmapFromMemory(Toolbar_Log2_png);
|
||||
break;
|
||||
case KDE:
|
||||
m_Bitmaps[Toolbar_Log] = wxGetBitmapFromMemory(Toolbar_Log3_png);
|
||||
break;
|
||||
default: PanicAlert("Theme selection went wrong");
|
||||
}
|
||||
|
||||
//m_Bitmaps[Toolbar_PluginDSP_Dis] = wxBitmap(SetBrightness(m_Bitmaps[Toolbar_PluginDSP], 165, true));
|
||||
// Create a gray version
|
||||
m_Bitmaps[Toolbar_PluginDSP_Dis] = wxBitmap(SetBrightness(m_Bitmaps[Toolbar_PluginDSP], 165, true));
|
||||
m_Bitmaps[Toolbar_Log_Dis] = wxBitmap(SetBrightness(m_Bitmaps[Toolbar_Log], 165, true));
|
||||
}
|
||||
|
||||
// Update in case the bitmap has been updated
|
||||
//if (GetToolBar() != NULL) TheToolBar->FindById(Toolbar_Log)->SetNormalBitmap(m_Bitmaps[Toolbar_Log]);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
|
@ -164,7 +188,7 @@ CFrame::MM_PopulateGUI()
|
|||
// -----------
|
||||
|
||||
|
||||
wxToolBar* toolBar = theToolBar; // Shortcut
|
||||
wxToolBar* toolBar = TheToolBar; // Shortcut
|
||||
|
||||
toolBar->AddSeparator();
|
||||
|
||||
|
@ -195,7 +219,7 @@ CFrame::MM_PopulateGUI()
|
|||
|
||||
|
||||
|
||||
mm_ToolMute = toolBar->AddTool(IDM_MUTE, _T("Mute"), m_Bitmaps[Toolbar_Play], _T("Mute music"));
|
||||
mm_ToolMute = toolBar->AddTool(IDM_MUTE, _T("Mute"), m_Bitmaps[Toolbar_PluginDSP], _T("Mute music"));
|
||||
mm_ToolPlay = toolBar->AddTool(IDM_MUSIC_PLAY, _T("Play"), m_Bitmaps[Toolbar_Play], _T("Play or pause music without pausing the game"));
|
||||
|
||||
// This cause the disabled tool bitmap to become some kind of monochrome version
|
||||
|
@ -232,34 +256,30 @@ CFrame::MM_PopulateGUI()
|
|||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Update GUI
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
void
|
||||
CFrame::MM_UpdateGUI()
|
||||
{
|
||||
// ---------------------------------------------------------------------------------------
|
||||
if(MusicMod::GlobalMute)
|
||||
{
|
||||
//m_pMenuItemMute->SetText(_T("Play"));
|
||||
//GetToolBar()->SetToolNormalBitmap(IDM_MUTE, m_Bitmaps[Toolbar_Pause]);
|
||||
mm_ToolMute->SetLabel("Unmute");
|
||||
mm_ToolMute->SetNormalBitmap(m_Bitmaps[Toolbar_PluginDSP_Dis]);
|
||||
//m_ToolMute->SetToggle(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//GetToolBar()->SetToolNormalBitmap(IDM_MUTE, m_Bitmaps[Toolbar_PluginDSP]);
|
||||
mm_ToolMute->SetLabel("Mute");
|
||||
mm_ToolMute->SetNormalBitmap(m_Bitmaps[Toolbar_PluginDSP]);
|
||||
}
|
||||
|
||||
if(MusicMod::GlobalPause)
|
||||
{
|
||||
//GetToolBar()->SetToolNormalBitmap(IDM_PAUSE, m_Bitmaps[Toolbar_Pause]);
|
||||
mm_ToolPlay->SetLabel("Play");
|
||||
mm_ToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Play]);
|
||||
}
|
||||
else
|
||||
{
|
||||
//GetToolBar()->SetToolNormalBitmap(IDM_PAUSE, m_Bitmaps[Toolbar_PluginDSP]);
|
||||
mm_ToolPlay->SetLabel("Pause");
|
||||
mm_ToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Pause]);
|
||||
}
|
||||
|
@ -272,9 +292,8 @@ CFrame::MM_UpdateGUI()
|
|||
{
|
||||
mm_ToolLog->SetNormalBitmap(m_Bitmaps[Toolbar_Log_Dis]);
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
//////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
@ -435,7 +454,7 @@ void CFrame::MM_OnLog(wxCommandEvent& event)
|
|||
MusicMod::bShowConsole = !MusicMod::bShowConsole;
|
||||
|
||||
if(MusicMod::bShowConsole)
|
||||
{ ShowConsole(); Player_Console(true); }
|
||||
{ ShowConsole(); /*Player_Console(true);*/ }
|
||||
else
|
||||
{
|
||||
#if defined (_WIN32)
|
||||
|
|
|
@ -109,11 +109,9 @@ ConfBool cbLoop( &bLoop, TEXT( "Loop" ), CONF_MODE_PUBLIC, false );
|
|||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The first function that is called by the exe
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nCmdShow )
|
||||
void Player_Main(bool Console)
|
||||
{
|
||||
// =======================================================================================
|
||||
|
|
|
@ -146,8 +146,7 @@ void Player_Volume(int a)
|
|||
|
||||
void ShowConsole()
|
||||
{
|
||||
//startConsoleWin(130, 10000, "Console Window"); // give room for 2000 rows
|
||||
StartConsoleWin(100, 2000, "ConsoleDLL"); // give room for 2000 rows
|
||||
StartConsoleWin(100, 2000, "MusicMod"); // give room for 2000 rows
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Include
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
|
@ -63,6 +67,8 @@
|
|||
#ifndef _WIN32
|
||||
#define WINAPI
|
||||
#endif
|
||||
////////////////////////////////////////
|
||||
|
||||
|
||||
// The idea behind the recent restructure is to fix various stupid problems.
|
||||
// glXMakeCurrent/ wglMakeCurrent takes a context and makes it current on the current thread.
|
||||
|
@ -71,7 +77,12 @@
|
|||
|
||||
namespace Core
|
||||
{
|
||||
// forwarding
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Declarations and definitions
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
|
||||
// Function forwarding
|
||||
//void Callback_VideoRequestWindowSize(int _iWidth, int _iHeight, BOOL _bFullscreen);
|
||||
void Callback_VideoLog(const TCHAR* _szMessage, int _bDoBreak);
|
||||
void Callback_VideoCopiedToXFB();
|
||||
|
@ -89,9 +100,9 @@ TPeekMessages Callback_PeekMessages = NULL;
|
|||
TUpdateFPSDisplay g_pUpdateFPSDisplay = NULL;
|
||||
|
||||
#ifdef _WIN32
|
||||
DWORD WINAPI EmuThread(void *pArg);
|
||||
DWORD WINAPI EmuThread(void *pArg);
|
||||
#else
|
||||
void *EmuThread(void *pArg);
|
||||
void *EmuThread(void *pArg);
|
||||
#endif
|
||||
void Stop();
|
||||
|
||||
|
@ -102,6 +113,7 @@ Common::Thread* g_pThread = NULL;
|
|||
SCoreStartupParameter g_CoreStartupParameter; //uck
|
||||
|
||||
Common::Event emuThreadGoing;
|
||||
//////////////////////////////////////
|
||||
|
||||
|
||||
bool PanicAlertToVideo(const char* text, bool yes_no)
|
||||
|
@ -184,19 +196,45 @@ void Stop() // - Hammertime!
|
|||
|
||||
// The quit is to get it out of its message loop
|
||||
// Should be moved inside the plugin.
|
||||
#ifdef _WIN32
|
||||
PostMessage((HWND)g_pWindowHandle, WM_QUIT, 0, 0);
|
||||
#else
|
||||
PluginVideo::Video_Stop();
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
PostMessage((HWND)g_pWindowHandle, WM_QUIT, 0, 0);
|
||||
#else
|
||||
PluginVideo::Video_Stop();
|
||||
#endif
|
||||
|
||||
delete g_pThread; //Wait for emuthread to close
|
||||
#ifdef _WIN32
|
||||
/* I have to use this to avoid the hangings, it seems harmless and it works so I'm
|
||||
okay with it */
|
||||
if (GetParent((HWND)g_pWindowHandle) == NULL)
|
||||
delete g_pThread; // Wait for emuthread to close
|
||||
#else
|
||||
delete g_pThread;
|
||||
#endif
|
||||
g_pThread = 0;
|
||||
Core::StopTrace();
|
||||
LogManager::Shutdown();
|
||||
Host_SetWaitCursor(false);
|
||||
}
|
||||
|
||||
void Callback_DebuggerBreak()
|
||||
{
|
||||
CCPU::EnableStepping(true);
|
||||
}
|
||||
|
||||
const SCoreStartupParameter& GetStartupParameter()
|
||||
{
|
||||
return g_CoreStartupParameter;
|
||||
}
|
||||
|
||||
void* GetWindowHandle()
|
||||
{
|
||||
return g_pWindowHandle;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Create the CPU thread
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
THREAD_RETURN CpuThread(void *pArg)
|
||||
{
|
||||
Common::SetCurrentThreadName("CPU thread");
|
||||
|
@ -239,19 +277,21 @@ THREAD_RETURN CpuThread(void *pArg)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
//////////////////////////////////////////
|
||||
|
||||
void Callback_DebuggerBreak()
|
||||
{
|
||||
CCPU::EnableStepping(true);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Initalize plugins and create emulation thread
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
/* Call browser: Init():g_pThread(). See the BootManager.cpp file description for a completel
|
||||
call schedule. */
|
||||
THREAD_RETURN EmuThread(void *pArg)
|
||||
{
|
||||
Common::SetCurrentThreadName("Emuthread - starting");
|
||||
const SCoreStartupParameter& _CoreParameter = *(SCoreStartupParameter*)pArg;
|
||||
|
||||
if (_CoreParameter.bLockThreads)
|
||||
Common::Thread::SetCurrentThreadAffinity(2); //Force to second core
|
||||
Common::Thread::SetCurrentThreadAffinity(2); // Force to second core
|
||||
|
||||
LOG(OSREPORT, "Starting core = %s mode", _CoreParameter.bWii ? "Wii" : "Gamecube");
|
||||
LOG(OSREPORT, "Dualcore = %s", _CoreParameter.bUseDualCore ? "Yes" : "No");
|
||||
|
@ -265,7 +305,8 @@ THREAD_RETURN EmuThread(void *pArg)
|
|||
VideoInitialize.pGetMemoryPointer = Memory::GetPointer;
|
||||
VideoInitialize.pSetPEToken = PixelEngine::SetToken;
|
||||
VideoInitialize.pSetPEFinish = PixelEngine::SetFinish;
|
||||
VideoInitialize.pWindowHandle = _CoreParameter.hMainWindow; // NULL; // filled by video_initialize
|
||||
// This is first the m_Panel handle, then it is updated to have the new window handle
|
||||
VideoInitialize.pWindowHandle = _CoreParameter.hMainWindow;
|
||||
VideoInitialize.pLog = Callback_VideoLog;
|
||||
VideoInitialize.pSysMessage = Host_SysMessage;
|
||||
VideoInitialize.pRequestWindowSize = NULL; //Callback_VideoRequestWindowSize;
|
||||
|
@ -278,7 +319,7 @@ THREAD_RETURN EmuThread(void *pArg)
|
|||
VideoInitialize.pMemoryBase = Memory::base;
|
||||
VideoInitialize.pKeyPress = Callback_KeyPress;
|
||||
VideoInitialize.bWii = _CoreParameter.bWii;
|
||||
PluginVideo::Video_Initialize(&VideoInitialize);
|
||||
PluginVideo::Video_Initialize(&VideoInitialize); // Call the dll
|
||||
|
||||
// Under linux, this is an X11 Display, not an HWND!
|
||||
g_pWindowHandle = (HWND)VideoInitialize.pWindowHandle;
|
||||
|
@ -339,30 +380,31 @@ THREAD_RETURN EmuThread(void *pArg)
|
|||
//In single core mode, the CPU thread does the graphics. In fact, the
|
||||
//CPU thread should in this case also create the emuwindow...
|
||||
|
||||
//Spawn the CPU thread
|
||||
// Spawn the CPU thread
|
||||
Common::Thread *cpuThread = NULL;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ENTER THE VIDEO THREAD LOOP
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (!Core::GetStartupParameter().bUseDualCore)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
cpuThread = new Common::Thread(CpuThread, pArg);
|
||||
//Common::SetCurrentThreadName("Idle thread");
|
||||
//TODO(ector) : investigate using GetMessage instead .. although
|
||||
//then we lose the powerdown check. ... unless powerdown sends a message :P
|
||||
while (PowerPC::state != PowerPC::CPU_POWERDOWN)
|
||||
{
|
||||
if (Callback_PeekMessages) {
|
||||
Callback_PeekMessages();
|
||||
#ifdef _WIN32
|
||||
cpuThread = new Common::Thread(CpuThread, pArg);
|
||||
//Common::SetCurrentThreadName("Idle thread");
|
||||
//TODO(ector) : investigate using GetMessage instead .. although
|
||||
//then we lose the powerdown check. ... unless powerdown sends a message :P
|
||||
while (PowerPC::state != PowerPC::CPU_POWERDOWN)
|
||||
{
|
||||
if (Callback_PeekMessages) {
|
||||
Callback_PeekMessages();
|
||||
}
|
||||
Common::SleepCurrentThread(20);
|
||||
}
|
||||
Common::SleepCurrentThread(20);
|
||||
}
|
||||
#else
|
||||
// In single-core mode, the Emulation main thread is also the CPU thread
|
||||
CpuThread(pArg);
|
||||
#endif
|
||||
#else
|
||||
// In single-core mode, the Emulation main thread is also the CPU thread
|
||||
CpuThread(pArg);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -378,7 +420,8 @@ THREAD_RETURN EmuThread(void *pArg)
|
|||
if (g_pUpdateFPSDisplay != NULL)
|
||||
g_pUpdateFPSDisplay("Stopping...");
|
||||
|
||||
if (cpuThread) {
|
||||
if (cpuThread)
|
||||
{
|
||||
delete cpuThread; // This joins the cpu thread.
|
||||
// Returns after game exited
|
||||
cpuThread = NULL;
|
||||
|
@ -408,6 +451,10 @@ THREAD_RETURN EmuThread(void *pArg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Set or get the running state
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
bool SetState(EState _State)
|
||||
{
|
||||
switch(_State)
|
||||
|
@ -442,7 +489,12 @@ EState GetState()
|
|||
}
|
||||
return CORE_UNINITIALIZED;
|
||||
}
|
||||
///////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Save or recreate the emulation state
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
void SaveState() {
|
||||
State_Save(0);
|
||||
}
|
||||
|
@ -450,11 +502,8 @@ void SaveState() {
|
|||
void LoadState() {
|
||||
State_Load(0);
|
||||
}
|
||||
///////////////////////////////////////
|
||||
|
||||
const SCoreStartupParameter& GetStartupParameter()
|
||||
{
|
||||
return g_CoreStartupParameter;
|
||||
}
|
||||
|
||||
bool MakeScreenshot(const std::string &filename)
|
||||
{
|
||||
|
@ -468,10 +517,6 @@ bool MakeScreenshot(const std::string &filename)
|
|||
return bResult;
|
||||
}
|
||||
|
||||
void* GetWindowHandle()
|
||||
{
|
||||
return g_pWindowHandle;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// --- Callbacks for plugins / engine ---
|
||||
|
|
|
@ -67,7 +67,8 @@ struct SCoreStartupParameter
|
|||
|
||||
bool bWii; bool bWiiLeds; bool bWiiSpeakers; // Wii settings
|
||||
|
||||
bool bConfirmStop; // Interface settings
|
||||
bool bConfirmStop, bHideCursor, bAutoHideCursor; // Interface settings
|
||||
int iTheme;
|
||||
|
||||
enum EBootBios
|
||||
{
|
||||
|
|
|
@ -76,8 +76,11 @@ CEXIIPL::CEXIIPL() :
|
|||
{
|
||||
/* This is a poor way to handle failure. We should either not display this message unless fonts
|
||||
are actually accessed, or better yet, emulate them using a system font. -bushing */
|
||||
|
||||
// PanicAlert("Error: failed to load font_ansi.bin.\nFonts in a few games may not work, or crash the game.");
|
||||
// JP: But I want to see this error
|
||||
#ifndef __APPLE__
|
||||
PanicAlert("Error: failed to load '" FONT_ANSI_FILE "'. Fonts in a few games may not work, or"
|
||||
" crash the game.");
|
||||
#endif
|
||||
}
|
||||
|
||||
pStream = fopen(FONT_SJIS_FILE, "rb");
|
||||
|
@ -93,7 +96,11 @@ CEXIIPL::CEXIIPL() :
|
|||
else
|
||||
{
|
||||
// Heh, BIOS fonts don't really work in JAP games anyway ... we get bogus characters.
|
||||
// PanicAlert("Error: failed to load font_sjis.bin.\nFonts in a few Japanese games may not work or crash the game.");
|
||||
// JP: But I want to see this error
|
||||
#ifndef __APPLE__
|
||||
PanicAlert("Error: failed to load '" FONT_SJIS_FILE "'. Fonts in a few Japanese games may"
|
||||
" not work or crash the game.");
|
||||
#endif
|
||||
}
|
||||
|
||||
memcpy(m_pIPL, iplver, sizeof(iplver));
|
||||
|
|
|
@ -102,10 +102,15 @@ CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rF
|
|||
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Create new memory card
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
void CEXIMemoryCard::Flush(bool exiting)
|
||||
{
|
||||
FILE* pFile = NULL;
|
||||
pFile = fopen(m_strFilename.c_str(), "wb");
|
||||
|
||||
if (!pFile)
|
||||
{
|
||||
std::string dir;
|
||||
|
@ -114,18 +119,23 @@ void CEXIMemoryCard::Flush(bool exiting)
|
|||
File::CreateDir(dir.c_str());
|
||||
pFile = fopen(m_strFilename.c_str(), "wb");
|
||||
}
|
||||
if (!pFile) //Note - pFile changed inside above if
|
||||
|
||||
if (!pFile) // Note - pFile changed inside above if
|
||||
{
|
||||
PanicAlert("Could not write memory card file %s.\n\n"
|
||||
"Are you running Dolphin from a CD/DVD, or is the save file maybe write protected?", m_strFilename.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
fwrite(memory_card_content, memory_card_size, 1, pFile);
|
||||
fclose(pFile);
|
||||
if (!exiting) {
|
||||
|
||||
if (!exiting)
|
||||
{
|
||||
Core::DisplayMessage(StringFromFormat("Wrote memory card %i contents to %s.", card_index, m_strFilename.c_str()).c_str(), 4000);
|
||||
}
|
||||
}
|
||||
//////////////////////////////////////
|
||||
|
||||
|
||||
CEXIMemoryCard::~CEXIMemoryCard()
|
||||
|
|
|
@ -41,8 +41,11 @@ CWII_IPC_HLE_Device_di::CWII_IPC_HLE_Device_di(u32 _DeviceID, const std::string&
|
|||
|
||||
CWII_IPC_HLE_Device_di::~CWII_IPC_HLE_Device_di()
|
||||
{
|
||||
delete m_pFileSystem;
|
||||
delete m_pVolume;
|
||||
if(m_pFileSystem) { delete m_pFileSystem; m_pFileSystem = NULL; }
|
||||
/* This caused the crash in VolumeHandler.cpp, setting m_pVolume = NULL; didn't help
|
||||
it still makes VolumeHandler.cpp have a non-NULL pointer with no content so that
|
||||
delete crashes */
|
||||
//if(m_pVolume) { delete m_pVolume; m_pVolume = NULL; }
|
||||
}
|
||||
|
||||
bool CWII_IPC_HLE_Device_di::Open(u32 _CommandAddress, u32 _Mode)
|
||||
|
|
|
@ -191,14 +191,18 @@ void LogManager::Shutdown()
|
|||
{
|
||||
m_bInitialized = false;
|
||||
|
||||
// delete all loggers
|
||||
// Delete all loggers
|
||||
for (int i=0; i<LogTypes::NUMBER_OF_LOGS; i++)
|
||||
{
|
||||
if (m_Log[i] != NULL)
|
||||
for (int j = 0; j < VERBOSITY_LEVELS; j++)
|
||||
{
|
||||
m_Log[i]->Shutdown();
|
||||
delete m_Log[i];
|
||||
m_Log[i] = NULL;
|
||||
int id = i + j*100;
|
||||
if (m_Log[id] != NULL)
|
||||
{
|
||||
m_Log[id]->Shutdown();
|
||||
delete m_Log[id];
|
||||
m_Log[id] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ CVolumeGC::CVolumeGC(IBlobReader* _pReader)
|
|||
CVolumeGC::~CVolumeGC()
|
||||
{
|
||||
delete m_pReader;
|
||||
m_pReader = NULL; // I don't think this makes any difference, but anyway
|
||||
}
|
||||
|
||||
bool CVolumeGC::Read(u64 _Offset, u64 _Length, u8* _pBuffer) const
|
||||
|
|
|
@ -66,6 +66,12 @@ void SConfig::SaveSettings()
|
|||
|
||||
|
||||
{
|
||||
// General
|
||||
ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
|
||||
ini.Set("Interface", "HideCursor", m_LocalCoreStartupParameter.bHideCursor);
|
||||
ini.Set("Interface", "AutoHideCursor", m_LocalCoreStartupParameter.bAutoHideCursor);
|
||||
ini.Set("Interface", "Theme", m_LocalCoreStartupParameter.iTheme);
|
||||
|
||||
// Core
|
||||
ini.Set("Core", "HLEBios", m_LocalCoreStartupParameter.bHLEBios);
|
||||
ini.Set("Core", "UseDynarec", m_LocalCoreStartupParameter.bUseJIT);
|
||||
|
@ -77,7 +83,6 @@ void SConfig::SaveSettings()
|
|||
ini.Set("Core", "OptimizeQuantizers", m_LocalCoreStartupParameter.bOptimizeQuantizers);
|
||||
ini.Set("Core", "EnableCheats", m_LocalCoreStartupParameter.bEnableCheats);
|
||||
ini.Set("Core", "SelectedLanguage", m_LocalCoreStartupParameter.SelectedLanguage);
|
||||
ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
|
||||
|
||||
ini.Set("Core", "RunCompareServer", m_LocalCoreStartupParameter.bRunCompareServer);
|
||||
ini.Set("Core", "RunCompareClient", m_LocalCoreStartupParameter.bRunCompareClient);
|
||||
|
@ -157,6 +162,12 @@ void SConfig::LoadSettings()
|
|||
}
|
||||
|
||||
{
|
||||
// General interfance
|
||||
ini.Get("Interface", "ConfirmStop", &m_LocalCoreStartupParameter.bConfirmStop, false);
|
||||
ini.Get("Interface", "HideCursor", &m_LocalCoreStartupParameter.bHideCursor, false);
|
||||
ini.Get("Interface", "AutoHideCursor", &m_LocalCoreStartupParameter.bAutoHideCursor, false);
|
||||
ini.Get("Interface", "Theme", &m_LocalCoreStartupParameter.iTheme, 0);
|
||||
|
||||
// Core
|
||||
ini.Get("Core", "HLEBios", &m_LocalCoreStartupParameter.bHLEBios, true);
|
||||
ini.Get("Core", "UseDynarec", &m_LocalCoreStartupParameter.bUseJIT, true);
|
||||
|
@ -168,7 +179,6 @@ void SConfig::LoadSettings()
|
|||
ini.Get("Core", "OptimizeQuantizers", &m_LocalCoreStartupParameter.bOptimizeQuantizers, true);
|
||||
ini.Get("Core", "EnableCheats", &m_LocalCoreStartupParameter.bEnableCheats, false);
|
||||
ini.Get("Core", "SelectedLanguage", &m_LocalCoreStartupParameter.SelectedLanguage, 0);
|
||||
ini.Get("Interface", "ConfirmStop", &m_LocalCoreStartupParameter.bConfirmStop, false);
|
||||
|
||||
ini.Get("Core", "RunCompareServer", &m_LocalCoreStartupParameter.bRunCompareServer, false);
|
||||
ini.Get("Core", "RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false);
|
||||
|
|
|
@ -15,22 +15,41 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include <string>
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Include
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <string> // System
|
||||
#include <vector>
|
||||
|
||||
#include "Globals.h"
|
||||
#include "Core.h" // Core
|
||||
|
||||
#include "Globals.h" // Local
|
||||
#include "ConfigMain.h"
|
||||
#include "PluginManager.h"
|
||||
#include "Frame.h"
|
||||
//////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Declarations and definitions
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
extern CFrame* main_frame;
|
||||
///////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Event table
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
BEGIN_EVENT_TABLE(CConfigMain, wxDialog)
|
||||
|
||||
EVT_CLOSE(CConfigMain::OnClose)
|
||||
EVT_BUTTON(ID_CLOSE, CConfigMain::CloseClick)
|
||||
|
||||
EVT_CHECKBOX(ID_INTERFACE_CONFIRMSTOP, CConfigMain::CoreSettingsChanged)
|
||||
EVT_CHECKBOX(ID_INTERFACE_HIDECURSOR, CConfigMain::CoreSettingsChanged)
|
||||
EVT_CHECKBOX(ID_INTERFACE_AUTOHIDECURSOR, CConfigMain::CoreSettingsChanged)
|
||||
EVT_RADIOBOX(ID_INTERFACE_THEME, CConfigMain::CoreSettingsChanged)
|
||||
|
||||
EVT_CHECKBOX(ID_ALLWAYS_HLEBIOS, CConfigMain::CoreSettingsChanged)
|
||||
EVT_CHECKBOX(ID_USEDYNAREC, CConfigMain::CoreSettingsChanged)
|
||||
EVT_CHECKBOX(ID_USEDUALCORE, CConfigMain::CoreSettingsChanged)
|
||||
|
@ -38,8 +57,6 @@ EVT_CHECKBOX(ID_LOCKTHREADS, CConfigMain::CoreSettingsChanged)
|
|||
EVT_CHECKBOX(ID_OPTIMIZEQUANTIZERS, CConfigMain::CoreSettingsChanged)
|
||||
EVT_CHECKBOX(ID_IDLESKIP, CConfigMain::CoreSettingsChanged)
|
||||
EVT_CHECKBOX(ID_ENABLECHEATS, CConfigMain::CoreSettingsChanged)
|
||||
EVT_CHECKBOX(ID_INTERFACE_CONFIRMSTOP, CConfigMain::CoreSettingsChanged)
|
||||
|
||||
EVT_CHOICE(ID_GC_SRAM_LNG, CConfigMain::GCSettingsChanged)
|
||||
|
||||
EVT_CHOICE(ID_WII_BT_BAR, CConfigMain::WiiSettingsChanged)
|
||||
|
@ -66,10 +83,16 @@ EVT_CHOICE(ID_WIIMOTE_CB, CConfigMain::OnSelectionChanged)
|
|||
EVT_BUTTON(ID_WIIMOTE_CONFIG, CConfigMain::OnConfig)
|
||||
|
||||
END_EVENT_TABLE()
|
||||
////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Window class
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
|
||||
: wxDialog(parent, id, title, position, size, style)
|
||||
{
|
||||
// Control refreshing of the ISOs list
|
||||
bRefreshList = false;
|
||||
|
||||
// Load Wii SYSCONF
|
||||
|
@ -89,6 +112,8 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
|
|||
}
|
||||
|
||||
CreateGUIControls();
|
||||
|
||||
// Update selected ISO paths
|
||||
for(u32 i = 0; i < SConfig::GetInstance().m_ISOFolder.size(); i++)
|
||||
{
|
||||
ISOPaths->Append(wxString(SConfig::GetInstance().m_ISOFolder[i].c_str(), wxConvUTF8));
|
||||
|
@ -98,227 +123,304 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
|
|||
CConfigMain::~CConfigMain()
|
||||
{
|
||||
}
|
||||
////////////////////////////////////////////
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// Enable or disable objects
|
||||
// -------------
|
||||
void CConfigMain::UpdateGUI()
|
||||
{
|
||||
if(Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||
{
|
||||
CorePage->Disable();
|
||||
GamecubePage->Disable();
|
||||
WiiPage->Disable();
|
||||
PathsPage->Disable();
|
||||
PluginPage->Disable();
|
||||
}
|
||||
}
|
||||
// ==========================
|
||||
|
||||
void CConfigMain::CreateGUIControls()
|
||||
{
|
||||
Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
|
||||
MainPage = new wxPanel(Notebook, ID_COREPAGE, wxDefaultPosition, wxDefaultSize);
|
||||
GeneralPage = new wxPanel(Notebook, ID_GENERALPAGE, wxDefaultPosition, wxDefaultSize);
|
||||
CorePage = new wxPanel(Notebook, ID_COREPAGE, wxDefaultPosition, wxDefaultSize);
|
||||
GamecubePage = new wxPanel(Notebook, ID_GAMECUBEPAGE, wxDefaultPosition, wxDefaultSize);
|
||||
WiiPage = new wxPanel(Notebook, ID_WIIPAGE, wxDefaultPosition, wxDefaultSize);
|
||||
PathsPage = new wxPanel(Notebook, ID_PATHSPAGE, wxDefaultPosition, wxDefaultSize);
|
||||
PluginPage = new wxPanel(Notebook, ID_PLUGINPAGE, wxDefaultPosition, wxDefaultSize);
|
||||
|
||||
Notebook->AddPage(MainPage, wxT("Main"));
|
||||
Notebook->AddPage(GeneralPage, wxT("General"));
|
||||
Notebook->AddPage(CorePage, wxT("Core"));
|
||||
Notebook->AddPage(GamecubePage, wxT("Gamecube"));
|
||||
Notebook->AddPage(WiiPage, wxT("Wii"));
|
||||
Notebook->AddPage(PathsPage, wxT("Paths"));
|
||||
Notebook->AddPage(PluginPage, wxT("Plugins"));
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
// Main page
|
||||
// --------
|
||||
sCore = new wxBoxSizer(wxVERTICAL);
|
||||
//////////////////////////////////
|
||||
// General page
|
||||
// --------
|
||||
|
||||
// Basic Settings
|
||||
sbBasic = new wxStaticBoxSizer(wxVERTICAL, MainPage, wxT("Basic Settings"));
|
||||
UseDualCore = new wxCheckBox(MainPage, ID_USEDUALCORE, wxT("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
UseDualCore->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore);
|
||||
SkipIdle = new wxCheckBox(MainPage, ID_IDLESKIP, wxT("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
SkipIdle->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle);
|
||||
EnableCheats = new wxCheckBox(MainPage, ID_ENABLECHEATS, wxT("Enable Cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
EnableCheats->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats);
|
||||
ConfirmStop = new wxCheckBox(MainPage, ID_INTERFACE_CONFIRMSTOP, wxT("Confirm On Stop"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
ConfirmStop->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop);
|
||||
// Confirm on stop
|
||||
ConfirmStop = new wxCheckBox(GeneralPage, ID_INTERFACE_CONFIRMSTOP, wxT("Confirm On Stop"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
ConfirmStop->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop);
|
||||
|
||||
AutoHideCursor = new wxCheckBox(GeneralPage, ID_INTERFACE_AUTOHIDECURSOR, wxT("Auto Hide Cursor"));
|
||||
AutoHideCursor->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor);
|
||||
|
||||
HideCursor = new wxCheckBox(GeneralPage, ID_INTERFACE_HIDECURSOR, wxT("Always Hide Cursor"));
|
||||
HideCursor->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor);
|
||||
|
||||
sbBasic->Add(UseDualCore, 0, wxALL, 5);
|
||||
sbBasic->Add(SkipIdle, 0, wxALL, 5);
|
||||
sbBasic->Add(EnableCheats, 0, wxALL, 5);
|
||||
sbBasic->Add(ConfirmStop, 0, wxALL, 5);
|
||||
|
||||
// Advanced Settings
|
||||
sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, MainPage, wxT("Advanced Settings"));
|
||||
AllwaysHLEBIOS = new wxCheckBox(MainPage, ID_ALLWAYS_HLEBIOS, wxT("HLE the BIOS all the time"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
AllwaysHLEBIOS->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHLEBios);
|
||||
UseDynaRec = new wxCheckBox(MainPage, ID_USEDYNAREC, wxT("Enable Dynamic Recompilation"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
UseDynaRec->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseJIT);
|
||||
LockThreads = new wxCheckBox(MainPage, ID_LOCKTHREADS, wxT("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
LockThreads->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bLockThreads);
|
||||
OptimizeQuantizers = new wxCheckBox(MainPage, ID_OPTIMIZEQUANTIZERS, wxT("Optimize Quantizers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
OptimizeQuantizers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bOptimizeQuantizers);
|
||||
|
||||
sbAdvanced->Add(AllwaysHLEBIOS, 0, wxALL, 5);
|
||||
sbAdvanced->Add(UseDynaRec, 0, wxALL, 5);
|
||||
sbAdvanced->Add(LockThreads, 0, wxALL, 5);
|
||||
sbAdvanced->Add(OptimizeQuantizers, 0, wxALL, 5);
|
||||
|
||||
// Populate sCore
|
||||
sCore->Add(sbBasic, 0, wxEXPAND|wxALL, 5);
|
||||
//sCore->AddStretchSpacer();
|
||||
sCore->Add(sbAdvanced, 0, wxEXPAND|wxALL, 5);
|
||||
MainPage->SetSizer(sCore);
|
||||
sCore->Layout();
|
||||
// Populate the settings
|
||||
sbInterface = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Interface Settings"));
|
||||
sbInterface->Add(ConfirmStop, 0, wxALL, 5);
|
||||
sbInterface->Add(AutoHideCursor, 0, wxALL, 5);
|
||||
sbInterface->Add(HideCursor, 0, wxALL, 5);
|
||||
|
||||
// ToolTips
|
||||
ConfirmStop->SetToolTip(wxT("Show a confirmation box before stopping a game."));
|
||||
AutoHideCursor->SetToolTip(wxT("This will auto hide the cursor in fullscreen mode."));
|
||||
HideCursor->SetToolTip(wxT("This will always hide the cursor when it's over the rendering window."
|
||||
" It can be convenient in a Wii game that already has a cursor."
|
||||
));
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
// Gamecube page
|
||||
// --------
|
||||
sbGamecubeIPLSettings = new wxStaticBoxSizer(wxVERTICAL, GamecubePage, wxT("IPL Settings"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("English"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("German"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("French"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("Spanish"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("Italian"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("Dutch"));
|
||||
GCSystemLangText = new wxStaticText(GamecubePage, ID_GC_SRAM_LNG_TEXT, wxT("System Language:"), wxDefaultPosition, wxDefaultSize);
|
||||
GCSystemLang = new wxChoice(GamecubePage, ID_GC_SRAM_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_GCSystemLang, 0, wxDefaultValidator);
|
||||
GCSystemLang->SetSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage);
|
||||
// -----------------------------------
|
||||
// Themes
|
||||
// -----------
|
||||
wxArrayString ThemeChoices;
|
||||
ThemeChoices.Add(wxT("Boomy"));
|
||||
ThemeChoices.Add(wxT("Vista"));
|
||||
ThemeChoices.Add(wxT("X-Plastik"));
|
||||
ThemeChoices.Add(wxT("KDE"));
|
||||
Theme = new wxRadioBox(GeneralPage, ID_INTERFACE_THEME, wxT("Theme"),
|
||||
wxDefaultPosition, wxDefaultSize, ThemeChoices, 1, wxRA_SPECIFY_COLS);
|
||||
|
||||
sGamecube = new wxBoxSizer(wxVERTICAL);
|
||||
sGamecubeIPLSettings = new wxGridBagSizer(0, 0);
|
||||
sGamecubeIPLSettings->Add(GCSystemLangText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sGamecubeIPLSettings->Add(GCSystemLang, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sbGamecubeIPLSettings->Add(sGamecubeIPLSettings);
|
||||
sGamecube->Add(sbGamecubeIPLSettings, 0, wxEXPAND|wxALL, 5);
|
||||
GamecubePage->SetSizer(sGamecube);
|
||||
sGamecube->Layout();
|
||||
// Set selected
|
||||
Theme->SetSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme);
|
||||
|
||||
// Copyright notice
|
||||
Theme->SetItemToolTip(0, wxT("Created by Milosz Wlazlo [miloszwl@miloszwl.com, miloszwl.deviantart.com]"));
|
||||
Theme->SetItemToolTip(1, wxT("Created by VistaIcons.com"));
|
||||
Theme->SetItemToolTip(2, wxT("Created by black_rider and published on ForumW.org > Web Developments"));
|
||||
Theme->SetItemToolTip(3, wxT("Created by KDE-Look.org"));
|
||||
|
||||
// Populate the entire page
|
||||
sGeneralPage = new wxBoxSizer(wxVERTICAL);
|
||||
sGeneralPage->Add(sbInterface, 0, wxEXPAND | wxALL, 5);
|
||||
sGeneralPage->Add(Theme, 0, wxEXPAND | (wxLEFT | wxRIGHT | wxBOTTOM), 5);
|
||||
|
||||
GeneralPage->SetSizer(sGeneralPage);
|
||||
sGeneralPage->Layout();
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
// Wii page
|
||||
// --------
|
||||
sbWiimoteSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, wxT("Wiimote Settings"));
|
||||
arrayStringFor_WiiSensBarPos.Add(wxT("Bottom")); arrayStringFor_WiiSensBarPos.Add(wxT("Top"));
|
||||
WiiSensBarPosText = new wxStaticText(WiiPage, ID_WII_BT_BAR_TEXT, wxT("Sensor Bar Position:"), wxDefaultPosition, wxDefaultSize);
|
||||
WiiSensBarPos = new wxChoice(WiiPage, ID_WII_BT_BAR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSensBarPos, 0, wxDefaultValidator);
|
||||
WiiSensBarPos->SetSelection(m_SYSCONF[BT_BAR]);
|
||||
WiiLeds = new wxCheckBox(WiiPage, ID_WII_BT_LEDS, wxT("Show Wiimote Leds in status bar"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
WiiLeds->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiLeds);
|
||||
WiiSpeakers = new wxCheckBox(WiiPage, ID_WII_BT_SPEAKERS, wxT("Show Wiimote Speaker status in status bar"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
WiiSpeakers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiSpeakers);
|
||||
//////////////////////////////////
|
||||
// Core page
|
||||
// --------
|
||||
sCore = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
sbWiiIPLSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, wxT("IPL Settings"));
|
||||
WiiScreenSaver = new wxCheckBox(WiiPage, ID_WII_IPL_SSV, wxT("Enable Screen Saver (burn-in reduction)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
WiiScreenSaver->SetValue(m_SYSCONF[IPL_SSV]!=0);
|
||||
WiiProgressiveScan = new wxCheckBox(WiiPage, ID_WII_IPL_PGS, wxT("Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
WiiProgressiveScan->SetValue(m_SYSCONF[IPL_PGS]!=0);
|
||||
WiiEuRGB60 = new wxCheckBox(WiiPage, ID_WII_IPL_E60, wxT("Use EuRGB60 Mode (PAL6)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
WiiEuRGB60->SetValue(m_SYSCONF[IPL_E60]!=0);
|
||||
arrayStringFor_WiiAspectRatio.Add(wxT("4:3")); arrayStringFor_WiiAspectRatio.Add(wxT("16:9"));
|
||||
WiiAspectRatioText = new wxStaticText(WiiPage, ID_WII_IPL_AR_TEXT, wxT("Aspect Ratio:"), wxDefaultPosition, wxDefaultSize);
|
||||
WiiAspectRatio = new wxChoice(WiiPage, ID_WII_IPL_AR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiAspectRatio, 0, wxDefaultValidator);
|
||||
WiiAspectRatio->SetSelection(m_SYSCONF[IPL_AR]);
|
||||
arrayStringFor_WiiSystemLang = arrayStringFor_GCSystemLang;
|
||||
arrayStringFor_WiiSystemLang.Insert(wxT("Japanese"), 0);
|
||||
WiiSystemLangText = new wxStaticText(WiiPage, ID_WII_IPL_LNG_TEXT, wxT("System Language:"), wxDefaultPosition, wxDefaultSize);
|
||||
WiiSystemLang = new wxChoice(WiiPage, ID_WII_IPL_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSystemLang, 0, wxDefaultValidator);
|
||||
WiiSystemLang->SetSelection(m_SYSCONF[IPL_LNG]);
|
||||
// Basic Settings
|
||||
sbBasic = new wxStaticBoxSizer(wxVERTICAL, CorePage, wxT("Basic Settings"));
|
||||
UseDualCore = new wxCheckBox(CorePage, ID_USEDUALCORE, wxT("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
UseDualCore->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore);
|
||||
SkipIdle = new wxCheckBox(CorePage, ID_IDLESKIP, wxT("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
SkipIdle->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle);
|
||||
EnableCheats = new wxCheckBox(CorePage, ID_ENABLECHEATS, wxT("Enable Cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
EnableCheats->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats);
|
||||
|
||||
// Populate sbWiimoteSettings
|
||||
sWii = new wxBoxSizer(wxVERTICAL);
|
||||
sWiimoteSettings = new wxGridBagSizer(0, 0);
|
||||
sWiimoteSettings->Add(WiiSensBarPosText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sWiimoteSettings->Add(WiiSensBarPos, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sWiimoteSettings->Add(WiiLeds, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sWiimoteSettings->Add(WiiSpeakers, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sbWiimoteSettings->Add(sWiimoteSettings);
|
||||
sWii->Add(sbWiimoteSettings, 0, wxEXPAND|wxALL, 5);
|
||||
sbBasic->Add(UseDualCore, 0, wxALL, 5);
|
||||
sbBasic->Add(SkipIdle, 0, wxALL, 5);
|
||||
sbBasic->Add(EnableCheats, 0, wxALL, 5);
|
||||
|
||||
sWiiIPLSettings = new wxGridBagSizer(0, 0);
|
||||
sWiiIPLSettings->Add(WiiScreenSaver, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiProgressiveScan, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiEuRGB60, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiAspectRatioText, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiAspectRatio, wxGBPosition(3, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiSystemLangText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiSystemLang, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sbWiiIPLSettings->Add(sWiiIPLSettings);
|
||||
sWii->Add(sbWiiIPLSettings, 0, wxEXPAND|wxALL, 5);
|
||||
WiiPage->SetSizer(sWii);
|
||||
sWii->Layout();
|
||||
// Advanced Settings
|
||||
sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, CorePage, wxT("Advanced Settings"));
|
||||
AllwaysHLEBIOS = new wxCheckBox(CorePage, ID_ALLWAYS_HLEBIOS, wxT("HLE the BIOS all the time"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
AllwaysHLEBIOS->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHLEBios);
|
||||
UseDynaRec = new wxCheckBox(CorePage, ID_USEDYNAREC, wxT("Enable Dynamic Recompilation"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
UseDynaRec->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseJIT);
|
||||
LockThreads = new wxCheckBox(CorePage, ID_LOCKTHREADS, wxT("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
LockThreads->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bLockThreads);
|
||||
OptimizeQuantizers = new wxCheckBox(CorePage, ID_OPTIMIZEQUANTIZERS, wxT("Optimize Quantizers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
OptimizeQuantizers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bOptimizeQuantizers);
|
||||
|
||||
sbAdvanced->Add(AllwaysHLEBIOS, 0, wxALL, 5);
|
||||
sbAdvanced->Add(UseDynaRec, 0, wxALL, 5);
|
||||
sbAdvanced->Add(LockThreads, 0, wxALL, 5);
|
||||
sbAdvanced->Add(OptimizeQuantizers, 0, wxALL, 5);
|
||||
|
||||
// Populate sCore
|
||||
sCore->Add(sbBasic, 0, wxEXPAND|wxALL, 5);
|
||||
//sCore->AddStretchSpacer();
|
||||
sCore->Add(sbAdvanced, 0, wxEXPAND|wxALL, 5);
|
||||
CorePage->SetSizer(sCore);
|
||||
sCore->Layout();
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
// Paths page
|
||||
// --------
|
||||
sbISOPaths = new wxStaticBoxSizer(wxVERTICAL, PathsPage, wxT("ISO Directories"));
|
||||
ISOPaths = new wxListBox(PathsPage, ID_ISOPATHS, wxDefaultPosition, wxDefaultSize, arrayStringFor_ISOPaths, wxLB_SINGLE, wxDefaultValidator);
|
||||
AddISOPath = new wxButton(PathsPage, ID_ADDISOPATH, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0);
|
||||
RemoveISOPath = new wxButton(PathsPage, ID_REMOVEISOPATH, wxT("Remove"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
RemoveISOPath->Enable(false);
|
||||
//////////////////////////////////
|
||||
// Gamecube page
|
||||
// --------
|
||||
sbGamecubeIPLSettings = new wxStaticBoxSizer(wxVERTICAL, GamecubePage, wxT("IPL Settings"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("English"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("German"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("French"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("Spanish"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("Italian"));
|
||||
arrayStringFor_GCSystemLang.Add(wxT("Dutch"));
|
||||
GCSystemLangText = new wxStaticText(GamecubePage, ID_GC_SRAM_LNG_TEXT, wxT("System Language:"), wxDefaultPosition, wxDefaultSize);
|
||||
GCSystemLang = new wxChoice(GamecubePage, ID_GC_SRAM_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_GCSystemLang, 0, wxDefaultValidator);
|
||||
GCSystemLang->SetSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage);
|
||||
|
||||
DefaultISOText = new wxStaticText(PathsPage, ID_DEFAULTISO_TEXT, wxT("Default ISO:"), wxDefaultPosition, wxDefaultSize);
|
||||
DefaultISO = new wxFilePickerCtrl(PathsPage, ID_DEFAULTISO, wxEmptyString, wxT("Choose a default ISO:"),
|
||||
wxString::Format(wxT("All GC/Wii images (gcm, iso, gcz)|*.gcm;*.iso;*.gcz|All files (%s)|%s"), wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr),
|
||||
wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN);
|
||||
DefaultISO->SetPath(wxString::FromAscii(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.c_str()));
|
||||
sGamecube = new wxBoxSizer(wxVERTICAL);
|
||||
sGamecubeIPLSettings = new wxGridBagSizer(0, 0);
|
||||
sGamecubeIPLSettings->Add(GCSystemLangText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sGamecubeIPLSettings->Add(GCSystemLang, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sbGamecubeIPLSettings->Add(sGamecubeIPLSettings);
|
||||
sGamecube->Add(sbGamecubeIPLSettings, 0, wxEXPAND|wxALL, 5);
|
||||
GamecubePage->SetSizer(sGamecube);
|
||||
sGamecube->Layout();
|
||||
|
||||
DVDRootText = new wxStaticText(PathsPage, ID_DVDROOT_TEXT, wxT("DVD Root:"), wxDefaultPosition, wxDefaultSize);
|
||||
DVDRoot = new wxDirPickerCtrl(PathsPage, ID_DVDROOT, wxEmptyString, wxT("Choose a DVD root directory:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
|
||||
DVDRoot->SetPath(wxString::FromAscii(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDVDRoot.c_str()));
|
||||
|
||||
sPaths = new wxBoxSizer(wxVERTICAL);
|
||||
//////////////////////////////////
|
||||
// Wii page
|
||||
// --------
|
||||
sbWiimoteSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, wxT("Wiimote Settings"));
|
||||
arrayStringFor_WiiSensBarPos.Add(wxT("Bottom")); arrayStringFor_WiiSensBarPos.Add(wxT("Top"));
|
||||
WiiSensBarPosText = new wxStaticText(WiiPage, ID_WII_BT_BAR_TEXT, wxT("Sensor Bar Position:"), wxDefaultPosition, wxDefaultSize);
|
||||
WiiSensBarPos = new wxChoice(WiiPage, ID_WII_BT_BAR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSensBarPos, 0, wxDefaultValidator);
|
||||
WiiSensBarPos->SetSelection(m_SYSCONF[BT_BAR]);
|
||||
WiiLeds = new wxCheckBox(WiiPage, ID_WII_BT_LEDS, wxT("Show Wiimote Leds in status bar"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
WiiLeds->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiLeds);
|
||||
WiiSpeakers = new wxCheckBox(WiiPage, ID_WII_BT_SPEAKERS, wxT("Show Wiimote Speaker status in status bar"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
WiiSpeakers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiSpeakers);
|
||||
|
||||
sbISOPaths->Add(ISOPaths, 1, wxEXPAND|wxALL, 0);
|
||||
sbWiiIPLSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, wxT("IPL Settings"));
|
||||
WiiScreenSaver = new wxCheckBox(WiiPage, ID_WII_IPL_SSV, wxT("Enable Screen Saver (burn-in reduction)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
WiiScreenSaver->SetValue(m_SYSCONF[IPL_SSV]!=0);
|
||||
WiiProgressiveScan = new wxCheckBox(WiiPage, ID_WII_IPL_PGS, wxT("Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
WiiProgressiveScan->SetValue(m_SYSCONF[IPL_PGS]!=0);
|
||||
WiiEuRGB60 = new wxCheckBox(WiiPage, ID_WII_IPL_E60, wxT("Use EuRGB60 Mode (PAL6)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
WiiEuRGB60->SetValue(m_SYSCONF[IPL_E60]!=0);
|
||||
arrayStringFor_WiiAspectRatio.Add(wxT("4:3")); arrayStringFor_WiiAspectRatio.Add(wxT("16:9"));
|
||||
WiiAspectRatioText = new wxStaticText(WiiPage, ID_WII_IPL_AR_TEXT, wxT("Aspect Ratio:"), wxDefaultPosition, wxDefaultSize);
|
||||
WiiAspectRatio = new wxChoice(WiiPage, ID_WII_IPL_AR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiAspectRatio, 0, wxDefaultValidator);
|
||||
WiiAspectRatio->SetSelection(m_SYSCONF[IPL_AR]);
|
||||
arrayStringFor_WiiSystemLang = arrayStringFor_GCSystemLang;
|
||||
arrayStringFor_WiiSystemLang.Insert(wxT("Japanese"), 0);
|
||||
WiiSystemLangText = new wxStaticText(WiiPage, ID_WII_IPL_LNG_TEXT, wxT("System Language:"), wxDefaultPosition, wxDefaultSize);
|
||||
WiiSystemLang = new wxChoice(WiiPage, ID_WII_IPL_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSystemLang, 0, wxDefaultValidator);
|
||||
WiiSystemLang->SetSelection(m_SYSCONF[IPL_LNG]);
|
||||
|
||||
sISOButtons = new wxBoxSizer(wxHORIZONTAL);
|
||||
sISOButtons->AddStretchSpacer(1);
|
||||
sISOButtons->Add(AddISOPath, 0, wxALL, 0);
|
||||
sISOButtons->Add(RemoveISOPath, 0, wxALL, 0);
|
||||
sbISOPaths->Add(sISOButtons, 0, wxEXPAND|wxALL, 5);
|
||||
sPaths->Add(sbISOPaths, 1, wxEXPAND|wxALL, 5);
|
||||
// Populate sbWiimoteSettings
|
||||
sWii = new wxBoxSizer(wxVERTICAL);
|
||||
sWiimoteSettings = new wxGridBagSizer(0, 0);
|
||||
sWiimoteSettings->Add(WiiSensBarPosText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sWiimoteSettings->Add(WiiSensBarPos, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sWiimoteSettings->Add(WiiLeds, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sWiimoteSettings->Add(WiiSpeakers, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sbWiimoteSettings->Add(sWiimoteSettings);
|
||||
sWii->Add(sbWiimoteSettings, 0, wxEXPAND|wxALL, 5);
|
||||
|
||||
sOtherPaths = new wxGridBagSizer(0, 0);
|
||||
sOtherPaths->AddGrowableCol(1);
|
||||
sOtherPaths->Add(DefaultISOText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sOtherPaths->Add(DefaultISO, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
|
||||
sOtherPaths->Add(DVDRootText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sOtherPaths->Add(DVDRoot, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
|
||||
sPaths->Add(sOtherPaths, 0, wxEXPAND|wxALL, 5);
|
||||
PathsPage->SetSizer(sPaths);
|
||||
sPaths->Layout();
|
||||
sWiiIPLSettings = new wxGridBagSizer(0, 0);
|
||||
sWiiIPLSettings->Add(WiiScreenSaver, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiProgressiveScan, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiEuRGB60, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiAspectRatioText, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiAspectRatio, wxGBPosition(3, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiSystemLangText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sWiiIPLSettings->Add(WiiSystemLang, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sbWiiIPLSettings->Add(sWiiIPLSettings);
|
||||
sWii->Add(sbWiiIPLSettings, 0, wxEXPAND|wxALL, 5);
|
||||
WiiPage->SetSizer(sWii);
|
||||
sWii->Layout();
|
||||
|
||||
//////////////////////////////////
|
||||
// Plugins page
|
||||
// --------
|
||||
sbGraphicsPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Graphics"));
|
||||
GraphicSelection = new wxChoice(PluginPage, ID_GRAPHIC_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
GraphicConfig = new wxButton(PluginPage, ID_GRAPHIC_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
sbDSPPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("DSP"));
|
||||
DSPSelection = new wxChoice(PluginPage, ID_DSP_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
DSPConfig = new wxButton(PluginPage, ID_DSP_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
//////////////////////////////////
|
||||
// Paths page
|
||||
// --------
|
||||
sbISOPaths = new wxStaticBoxSizer(wxVERTICAL, PathsPage, wxT("ISO Directories"));
|
||||
ISOPaths = new wxListBox(PathsPage, ID_ISOPATHS, wxDefaultPosition, wxDefaultSize, arrayStringFor_ISOPaths, wxLB_SINGLE, wxDefaultValidator);
|
||||
AddISOPath = new wxButton(PathsPage, ID_ADDISOPATH, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0);
|
||||
RemoveISOPath = new wxButton(PathsPage, ID_REMOVEISOPATH, wxT("Remove"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
RemoveISOPath->Enable(false);
|
||||
|
||||
sbPadPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Pad"));
|
||||
PADSelection = new wxChoice(PluginPage, ID_PAD_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
PADConfig = new wxButton(PluginPage, ID_PAD_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
DefaultISOText = new wxStaticText(PathsPage, ID_DEFAULTISO_TEXT, wxT("Default ISO:"), wxDefaultPosition, wxDefaultSize);
|
||||
DefaultISO = new wxFilePickerCtrl(PathsPage, ID_DEFAULTISO, wxEmptyString, wxT("Choose a default ISO:"),
|
||||
wxString::Format(wxT("All GC/Wii images (gcm, iso, gcz)|*.gcm;*.iso;*.gcz|All files (%s)|%s"), wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr),
|
||||
wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN);
|
||||
DefaultISO->SetPath(wxString::FromAscii(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.c_str()));
|
||||
|
||||
sbWiimotePlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Wiimote"));
|
||||
WiimoteSelection = new wxChoice(PluginPage, ID_WIIMOTE_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
WiimoteConfig = new wxButton(PluginPage, ID_WIIMOTE_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
FillChoiceBox(GraphicSelection, PLUGIN_TYPE_VIDEO, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
|
||||
FillChoiceBox(DSPSelection, PLUGIN_TYPE_DSP, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
|
||||
FillChoiceBox(PADSelection, PLUGIN_TYPE_PAD, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin);
|
||||
FillChoiceBox(WiimoteSelection, PLUGIN_TYPE_WIIMOTE, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin);
|
||||
DVDRootText = new wxStaticText(PathsPage, ID_DVDROOT_TEXT, wxT("DVD Root:"), wxDefaultPosition, wxDefaultSize);
|
||||
DVDRoot = new wxDirPickerCtrl(PathsPage, ID_DVDROOT, wxEmptyString, wxT("Choose a DVD root directory:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
|
||||
DVDRoot->SetPath(wxString::FromAscii(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDVDRoot.c_str()));
|
||||
|
||||
sPlugins = new wxBoxSizer(wxVERTICAL);
|
||||
sbGraphicsPlugin->Add(GraphicSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbGraphicsPlugin->Add(GraphicConfig, 0, wxALL, 5);
|
||||
sPlugins->Add(sbGraphicsPlugin, 0, wxEXPAND|wxALL, 5);
|
||||
sPaths = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
sbDSPPlugin->Add(DSPSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbDSPPlugin->Add(DSPConfig, 0, wxALL, 5);
|
||||
sPlugins->Add(sbDSPPlugin, 0, wxEXPAND|wxALL, 5);
|
||||
sbISOPaths->Add(ISOPaths, 1, wxEXPAND|wxALL, 0);
|
||||
|
||||
sISOButtons = new wxBoxSizer(wxHORIZONTAL);
|
||||
sISOButtons->AddStretchSpacer(1);
|
||||
sISOButtons->Add(AddISOPath, 0, wxALL, 0);
|
||||
sISOButtons->Add(RemoveISOPath, 0, wxALL, 0);
|
||||
sbISOPaths->Add(sISOButtons, 0, wxEXPAND|wxALL, 5);
|
||||
sPaths->Add(sbISOPaths, 1, wxEXPAND|wxALL, 5);
|
||||
|
||||
sOtherPaths = new wxGridBagSizer(0, 0);
|
||||
sOtherPaths->AddGrowableCol(1);
|
||||
sOtherPaths->Add(DefaultISOText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sOtherPaths->Add(DefaultISO, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
|
||||
sOtherPaths->Add(DVDRootText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sOtherPaths->Add(DVDRoot, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
|
||||
sPaths->Add(sOtherPaths, 0, wxEXPAND|wxALL, 5);
|
||||
PathsPage->SetSizer(sPaths);
|
||||
sPaths->Layout();
|
||||
|
||||
//////////////////////////////////
|
||||
// Plugins page
|
||||
// --------
|
||||
sbGraphicsPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Graphics"));
|
||||
GraphicSelection = new wxChoice(PluginPage, ID_GRAPHIC_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
GraphicConfig = new wxButton(PluginPage, ID_GRAPHIC_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
sbDSPPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Toolbar_PluginDSP"));
|
||||
DSPSelection = new wxChoice(PluginPage, ID_DSP_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
DSPConfig = new wxButton(PluginPage, ID_DSP_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
sbPadPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Pad"));
|
||||
PADSelection = new wxChoice(PluginPage, ID_PAD_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
PADConfig = new wxButton(PluginPage, ID_PAD_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
sbWiimotePlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Wiimote"));
|
||||
WiimoteSelection = new wxChoice(PluginPage, ID_WIIMOTE_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
WiimoteConfig = new wxButton(PluginPage, ID_WIIMOTE_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
FillChoiceBox(GraphicSelection, PLUGIN_TYPE_VIDEO, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
|
||||
FillChoiceBox(DSPSelection, PLUGIN_TYPE_DSP, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
|
||||
FillChoiceBox(PADSelection, PLUGIN_TYPE_PAD, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin);
|
||||
FillChoiceBox(WiimoteSelection, PLUGIN_TYPE_WIIMOTE, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin);
|
||||
|
||||
sPlugins = new wxBoxSizer(wxVERTICAL);
|
||||
sbGraphicsPlugin->Add(GraphicSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbGraphicsPlugin->Add(GraphicConfig, 0, wxALL, 5);
|
||||
sPlugins->Add(sbGraphicsPlugin, 0, wxEXPAND|wxALL, 5);
|
||||
|
||||
sbDSPPlugin->Add(DSPSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbDSPPlugin->Add(DSPConfig, 0, wxALL, 5);
|
||||
sPlugins->Add(sbDSPPlugin, 0, wxEXPAND|wxALL, 5);
|
||||
|
||||
sbPadPlugin->Add(PADSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbPadPlugin->Add(PADConfig, 0, wxALL, 5);
|
||||
sPlugins->Add(sbPadPlugin, 0, wxEXPAND|wxALL, 5);
|
||||
|
||||
sbWiimotePlugin->Add(WiimoteSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbWiimotePlugin->Add(WiimoteConfig, 0, wxALL, 5);
|
||||
sPlugins->Add(sbWiimotePlugin, 0, wxEXPAND|wxALL, 5);
|
||||
PluginPage->SetSizer(sPlugins);
|
||||
sPlugins->Layout();
|
||||
|
||||
sbPadPlugin->Add(PADSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbPadPlugin->Add(PADConfig, 0, wxALL, 5);
|
||||
sPlugins->Add(sbPadPlugin, 0, wxEXPAND|wxALL, 5);
|
||||
|
||||
sbWiimotePlugin->Add(WiimoteSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbWiimotePlugin->Add(WiimoteConfig, 0, wxALL, 5);
|
||||
sPlugins->Add(sbWiimotePlugin, 0, wxEXPAND|wxALL, 5);
|
||||
PluginPage->SetSizer(sPlugins);
|
||||
sPlugins->Layout();
|
||||
|
||||
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
|
@ -330,6 +432,8 @@ void CConfigMain::CreateGUIControls()
|
|||
sMain->Add(Notebook, 1, wxEXPAND|wxALL, 5);
|
||||
sMain->Add(sButtons, 0, wxEXPAND, 5);
|
||||
|
||||
UpdateGUI();
|
||||
|
||||
this->SetSizer(sMain);
|
||||
this->Layout();
|
||||
|
||||
|
@ -376,7 +480,25 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
|
|||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case ID_ALLWAYS_HLEBIOS:
|
||||
case ID_INTERFACE_CONFIRMSTOP: // Interface
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop = ConfirmStop->IsChecked();
|
||||
break;
|
||||
case ID_INTERFACE_AUTOHIDECURSOR:
|
||||
if (AutoHideCursor->IsChecked()) HideCursor->SetValue(!AutoHideCursor->IsChecked()); // Update the other one
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor = AutoHideCursor->IsChecked();
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor = HideCursor->IsChecked();
|
||||
break;
|
||||
case ID_INTERFACE_HIDECURSOR:
|
||||
if (HideCursor->IsChecked()) AutoHideCursor->SetValue(!HideCursor->IsChecked()); // Update the other one
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor = AutoHideCursor->IsChecked();
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor = HideCursor->IsChecked();
|
||||
break;
|
||||
case ID_INTERFACE_THEME:
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme = Theme->GetSelection();
|
||||
main_frame->InitBitmaps();
|
||||
break;
|
||||
|
||||
case ID_ALLWAYS_HLEBIOS: // Core
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bHLEBios = AllwaysHLEBIOS->IsChecked();
|
||||
break;
|
||||
case ID_USEDYNAREC:
|
||||
|
@ -397,9 +519,6 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
|
|||
case ID_ENABLECHEATS:
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats = EnableCheats->IsChecked();
|
||||
break;
|
||||
case ID_INTERFACE_CONFIRMSTOP:
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop = ConfirmStop->IsChecked();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ class CConfigMain
|
|||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE);
|
||||
virtual ~CConfigMain();
|
||||
void OnClick(wxMouseEvent& event);
|
||||
void CloseClick(wxCommandEvent& event);
|
||||
void OnSelectionChanged(wxCommandEvent& event);
|
||||
void OnConfig(wxCommandEvent& event);
|
||||
|
@ -44,18 +45,21 @@ class CConfigMain
|
|||
|
||||
private:
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
wxBoxSizer* sGeneralPage; // General Settings
|
||||
wxCheckBox* ConfirmStop, * AutoHideCursor, *HideCursor;
|
||||
wxRadioBox* Theme;
|
||||
|
||||
wxBoxSizer* sCore; // Core settings
|
||||
wxStaticBoxSizer* sbBasic, *sbAdvanced, *sbInterface;
|
||||
wxCheckBox* UseDualCore;
|
||||
wxCheckBox* SkipIdle;
|
||||
wxCheckBox* EnableCheats;
|
||||
wxCheckBox* ConfirmStop;
|
||||
wxCheckBox* AllwaysHLEBIOS;
|
||||
wxCheckBox* UseDynaRec;
|
||||
wxCheckBox* UseDualCore;
|
||||
wxCheckBox* LockThreads;
|
||||
wxCheckBox* OptimizeQuantizers;
|
||||
wxCheckBox* SkipIdle;
|
||||
wxCheckBox* EnableCheats;
|
||||
|
||||
wxBoxSizer* sGamecube; // GC settings
|
||||
wxStaticBoxSizer* sbGamecubeIPLSettings;
|
||||
|
@ -81,7 +85,7 @@ class CConfigMain
|
|||
|
||||
wxNotebook *Notebook;
|
||||
wxPanel *GeneralPage;
|
||||
wxPanel *MainPage;
|
||||
wxPanel *CorePage;
|
||||
wxPanel *GamecubePage;
|
||||
wxPanel *WiiPage;
|
||||
wxPanel *PathsPage;
|
||||
|
@ -210,7 +214,8 @@ class CConfigMain
|
|||
ID_GC_SRAM_LNG_TEXT,
|
||||
ID_GC_SRAM_LNG,
|
||||
|
||||
ID_INTERFACE_CONFIRMSTOP, // Interface settings
|
||||
ID_INTERFACE_CONFIRMSTOP, ID_INTERFACE_HIDECURSOR, ID_INTERFACE_AUTOHIDECURSOR,
|
||||
ID_INTERFACE_THEME, // Interface settings
|
||||
|
||||
ID_WII_BT_BAR_TEXT,
|
||||
ID_WII_BT_BAR,
|
||||
|
@ -248,7 +253,7 @@ class CConfigMain
|
|||
ID_GRAPHIC_CB
|
||||
};
|
||||
|
||||
void CreateGUIControls();
|
||||
void CreateGUIControls(); void UpdateGUI();
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void CoreSettingsChanged(wxCommandEvent& event);
|
||||
void GCSettingsChanged(wxCommandEvent& event);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -16,11 +16,33 @@
|
|||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
#ifndef __FRAME_H_
|
||||
#define __FRAME_H_
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/wx.h> // wxWidgets
|
||||
#include <wx/busyinfo.h>
|
||||
#include <wx/mstream.h>
|
||||
////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// A shortcut to access the bitmaps
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
#define wxGetBitmapFromMemory(name) _wxGetBitmapFromMemory(name, sizeof(name))
|
||||
inline wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length)
|
||||
{
|
||||
wxMemoryInputStream is(data, length);
|
||||
return(wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1));
|
||||
}
|
||||
////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Class declarations
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
class CGameListCtrl;
|
||||
class CFrame : public wxFrame
|
||||
{
|
||||
|
@ -33,21 +55,26 @@ class CFrame : public wxFrame
|
|||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
|
||||
|
||||
void* GetRenderHandle() {
|
||||
#ifdef _WIN32
|
||||
return(m_Panel->GetHandle());
|
||||
#else
|
||||
return this;
|
||||
#endif
|
||||
}
|
||||
void* GetRenderHandle()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return(m_Panel->GetHandle());
|
||||
#else
|
||||
return this;
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual ~CFrame();
|
||||
|
||||
// These have to be public
|
||||
wxStatusBar* m_pStatusBar;
|
||||
void InitBitmaps();
|
||||
void DoStop();
|
||||
bool bRenderToMain;
|
||||
|
||||
|
||||
// --------------------------------
|
||||
// ---------------------------------------
|
||||
// Wiimote leds
|
||||
// ---------
|
||||
|
||||
// ---------------
|
||||
void ModifyStatusBar();
|
||||
void CreateDestroy(int Case);
|
||||
void CreateLeds(); void CreateSpeakers();
|
||||
|
@ -60,25 +87,24 @@ class CFrame : public wxFrame
|
|||
wxStaticBitmap *m_StatBmp[7];
|
||||
u8 g_Leds[4]; u8 g_Leds_[4];
|
||||
u8 g_Speakers[3]; u8 g_Speakers_[3];
|
||||
// ---------
|
||||
|
||||
// ---------------
|
||||
|
||||
private:
|
||||
|
||||
wxBoxSizer* sizerPanel;
|
||||
CGameListCtrl* m_GameListCtrl;
|
||||
wxPanel* m_Panel;
|
||||
wxToolBar* theToolBar;
|
||||
wxToolBar* TheToolBar;
|
||||
wxToolBarToolBase* m_ToolPlay;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
// Music mod
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
#ifdef MUSICMOD
|
||||
wxToolBarToolBase* mm_ToolMute, * mm_ToolPlay, * mm_ToolLog;
|
||||
|
||||
void MM_UpdateGUI(); void MM_PopulateGUI(); void MM_InitBitmaps();
|
||||
void MM_UpdateGUI(); void MM_PopulateGUI(); void MM_InitBitmaps(int Theme);
|
||||
void MM_OnPlay();
|
||||
void MM_OnMute(wxCommandEvent& event);
|
||||
void MM_OnPause(wxCommandEvent& event);
|
||||
|
@ -88,7 +114,7 @@ class CFrame : public wxFrame
|
|||
///////////////////////////////////
|
||||
|
||||
|
||||
enum EBitmaps
|
||||
enum EToolbar
|
||||
{
|
||||
Toolbar_FileOpen,
|
||||
Toolbar_Refresh,
|
||||
|
@ -96,31 +122,41 @@ class CFrame : public wxFrame
|
|||
Toolbar_Play,
|
||||
Toolbar_Stop,
|
||||
Toolbar_Pause,
|
||||
Toolbar_FullScreen,
|
||||
Toolbar_PluginOptions,
|
||||
Toolbar_PluginGFX,
|
||||
Toolbar_PluginDSP,
|
||||
Toolbar_PluginPAD,
|
||||
Toolbar_FullScreen,
|
||||
Toolbar_Wiimote,
|
||||
Toolbar_Help,
|
||||
#ifdef MUSICMOD
|
||||
|
||||
#ifdef MUSICMOD // Music modification
|
||||
Toolbar_Log, Toolbar_PluginDSP_Dis, Toolbar_Log_Dis,
|
||||
#endif
|
||||
Bitmaps_Max,
|
||||
END
|
||||
|
||||
EToolbar_Max
|
||||
};
|
||||
|
||||
enum EBitmapsThemes
|
||||
{
|
||||
BOOMY,
|
||||
VISTA,
|
||||
XPLASTIK,
|
||||
KDE,
|
||||
THEMES_MAX
|
||||
};
|
||||
|
||||
enum WiimoteBitmaps // Wiimote speaker bitmaps
|
||||
{
|
||||
CREATELEDS = END,
|
||||
CREATELEDS,
|
||||
DESTROYLEDS,
|
||||
CREATESPEAKERS,
|
||||
DESTROYSPEAKERS
|
||||
};
|
||||
|
||||
wxBitmap m_Bitmaps[Bitmaps_Max];
|
||||
wxBitmap m_BitmapsMenu[Bitmaps_Max];
|
||||
wxBitmap m_Bitmaps[EToolbar_Max];
|
||||
wxBitmap m_BitmapsMenu[EToolbar_Max];
|
||||
|
||||
void InitBitmaps();
|
||||
void PopulateToolbar(wxToolBar* toolBar);
|
||||
void RecreateToolbar();
|
||||
void CreateMenu();
|
||||
|
@ -158,6 +194,8 @@ class CFrame : public wxFrame
|
|||
void OnToggleToolbar(wxCommandEvent& event);
|
||||
void OnToggleStatusbar(wxCommandEvent& event);
|
||||
void OnKeyDown(wxKeyEvent& event); void OnKeyUp(wxKeyEvent& event);
|
||||
void OnDoubleClick(wxMouseEvent& event); void OnMotion(wxMouseEvent& event);
|
||||
|
||||
void OnHostMessage(wxCommandEvent& event);
|
||||
|
||||
void OnMemcard(wxCommandEvent& event); // Misc
|
||||
|
@ -178,9 +216,18 @@ class CFrame : public wxFrame
|
|||
|
||||
void UpdateGUI();
|
||||
|
||||
// Old function that could be cool
|
||||
// Double click and mouse move options
|
||||
double m_fLastClickTime, m_iLastMotionTime; int LastMouseX, LastMouseY;
|
||||
|
||||
#if wxUSE_TIMER
|
||||
void Update();
|
||||
void OnTimer(wxTimerEvent& WXUNUSED(event)) { Update(); }
|
||||
wxTimer m_timer;
|
||||
#endif
|
||||
|
||||
// Event table
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
////////////////////////////////
|
||||
|
||||
#endif // __FRAME_H_
|
||||
|
|
|
@ -0,0 +1,775 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// 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, version 2.0.
|
||||
|
||||
// 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 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Windowses
|
||||
/* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
|
||||
CFrame is the main parent window. Inside CFrame there is an m_Panel that is the parent for
|
||||
the rendering window (when we render to the main window). In Windows the rendering window is
|
||||
created by giving CreateWindow() m_Panel->GetHandle() as parent window and creating a new
|
||||
child window to m_Panel. The new child window handle that is returned by CreateWindow() can
|
||||
be accessed from Core::GetWindowHandle().
|
||||
|
||||
///////////////////////////////////////////////*/
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Includes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "Globals.h" // Local
|
||||
#include "Frame.h"
|
||||
#include "ConfigMain.h"
|
||||
#include "PluginManager.h"
|
||||
#include "MemcardManager.h"
|
||||
#include "CheatsWindow.h"
|
||||
#include "AboutDolphin.h"
|
||||
#include "GameListCtrl.h"
|
||||
#include "BootManager.h"
|
||||
|
||||
#include "Common.h" // Common
|
||||
#include "FileUtil.h"
|
||||
#include "Timer.h"
|
||||
|
||||
#include "Config.h" // Core
|
||||
#include "Core.h"
|
||||
#include "HW/DVDInterface.h"
|
||||
#include "Plugins/Plugin_PAD.h"
|
||||
#include "State.h"
|
||||
#include "VolumeHandler.h"
|
||||
|
||||
#include <wx/datetime.h> // wxWidgets
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Resources
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
#include "../resources/Dolphin.c" // Dolphin icon
|
||||
#include "../resources/toolbar_browse.c"
|
||||
#include "../resources/toolbar_file_open.c"
|
||||
#include "../resources/toolbar_fullscreen.c"
|
||||
#include "../resources/toolbar_help.c"
|
||||
#include "../resources/toolbar_pause.c"
|
||||
#include "../resources/toolbar_play.c"
|
||||
#include "../resources/toolbar_plugin_dsp.c"
|
||||
#include "../resources/toolbar_plugin_gfx.c"
|
||||
#include "../resources/toolbar_plugin_options.c"
|
||||
#include "../resources/toolbar_plugin_pad.c"
|
||||
#include "../resources/toolbar_refresh.c"
|
||||
#include "../resources/toolbar_stop.c"
|
||||
#include "../resources/Boomy.h" // Theme packages
|
||||
#include "../resources/Vista.h"
|
||||
#include "../resources/X-Plastik.h"
|
||||
#include "../resources/KDE.h"
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static const long TOOLBAR_STYLE = wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Other Windows
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxCheatsWindow* CheatsWindow;
|
||||
|
||||
|
||||
// =======================================================
|
||||
// Create menu items
|
||||
// -------------
|
||||
void CFrame::CreateMenu()
|
||||
{
|
||||
delete m_pMenuBar;
|
||||
m_pMenuBar = new wxMenuBar(wxMB_DOCKABLE);
|
||||
|
||||
// file menu
|
||||
wxMenu* fileMenu = new wxMenu;
|
||||
m_pMenuItemOpen = fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O"));
|
||||
fileMenu->Append(wxID_REFRESH, _T("&Refresh"));
|
||||
fileMenu->Append(IDM_BROWSE, _T("&Browse for ISOs..."));
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Append(wxID_EXIT, _T("E&xit"), _T("Alt+F4"));
|
||||
m_pMenuBar->Append(fileMenu, _T("&File"));
|
||||
|
||||
// Emulation menu
|
||||
wxMenu* emulationMenu = new wxMenu;
|
||||
m_pMenuItemPlay = emulationMenu->Append(IDM_PLAY, _T("&Play"));
|
||||
m_pMenuChangeDisc = emulationMenu->Append(IDM_CHANGEDISC, _T("Change disc"));
|
||||
m_pMenuItemStop = emulationMenu->Append(IDM_STOP, _T("&Stop"));
|
||||
emulationMenu->AppendSeparator();
|
||||
wxMenu *saveMenu = new wxMenu;
|
||||
wxMenu *loadMenu = new wxMenu;
|
||||
m_pMenuItemLoad = emulationMenu->AppendSubMenu(saveMenu, _T("&Load State"));
|
||||
m_pMenuItemSave = emulationMenu->AppendSubMenu(loadMenu, _T("Sa&ve State"));
|
||||
for (int i = 1; i < 10; i++) {
|
||||
saveMenu->Append(IDM_LOADSLOT1 + i - 1, wxString::Format(_T("Slot %i\tF%i"), i, i));
|
||||
loadMenu->Append(IDM_SAVESLOT1 + i - 1, wxString::Format(_T("Slot %i\tShift+F%i"), i, i));
|
||||
}
|
||||
m_pMenuBar->Append(emulationMenu, _T("&Emulation"));
|
||||
|
||||
// Options menu
|
||||
wxMenu* pOptionsMenu = new wxMenu;
|
||||
m_pPluginOptions = pOptionsMenu->Append(IDM_CONFIG_MAIN, _T("Co&nfigure..."));
|
||||
pOptionsMenu->AppendSeparator();
|
||||
pOptionsMenu->Append(IDM_CONFIG_GFX_PLUGIN, _T("&Toolbar_PluginGFX settings"));
|
||||
pOptionsMenu->Append(IDM_CONFIG_DSP_PLUGIN, _T("&Toolbar_PluginDSP settings"));
|
||||
pOptionsMenu->Append(IDM_CONFIG_PAD_PLUGIN, _T("&Toolbar_PluginPAD settings"));
|
||||
#ifdef _WIN32
|
||||
pOptionsMenu->AppendSeparator();
|
||||
pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen\tAlt+Enter"));
|
||||
#endif
|
||||
m_pMenuBar->Append(pOptionsMenu, _T("&Options"));
|
||||
|
||||
// Misc menu
|
||||
wxMenu* miscMenu = new wxMenu;
|
||||
miscMenu->AppendCheckItem(IDM_TOGGLE_TOOLBAR, _T("View &toolbar"));
|
||||
miscMenu->Check(IDM_TOGGLE_TOOLBAR, true);
|
||||
miscMenu->AppendCheckItem(IDM_TOGGLE_STATUSBAR, _T("View &statusbar"));
|
||||
miscMenu->Check(IDM_TOGGLE_STATUSBAR, true);
|
||||
miscMenu->AppendSeparator();
|
||||
miscMenu->Append(IDM_MEMCARD, _T("&Memcard manager"));
|
||||
miscMenu->Append(IDM_CHEATS, _T("Action &Replay Manager"));
|
||||
m_pMenuBar->Append(miscMenu, _T("&Misc"));
|
||||
|
||||
// Help menu
|
||||
wxMenu* helpMenu = new wxMenu;
|
||||
/*helpMenu->Append(wxID_HELP, _T("&Help"));
|
||||
re-enable when there's something useful to display*/
|
||||
helpMenu->Append(IDM_HELPWEBSITE, _T("Dolphin &web site"));
|
||||
helpMenu->Append(IDM_HELPGOOGLECODE, _T("Dolphin at &Google Code"));
|
||||
helpMenu->AppendSeparator();
|
||||
helpMenu->Append(IDM_HELPABOUT, _T("&About..."));
|
||||
m_pMenuBar->Append(helpMenu, _T("&Help"));
|
||||
|
||||
// Associate the menu bar with the frame
|
||||
SetMenuBar(m_pMenuBar);
|
||||
}
|
||||
|
||||
|
||||
// =======================================================
|
||||
// Create toolbar items
|
||||
// -------------
|
||||
void CFrame::PopulateToolbar(wxToolBar* toolBar)
|
||||
{
|
||||
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
|
||||
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
|
||||
|
||||
toolBar->SetToolBitmapSize(wxSize(w, h));
|
||||
toolBar->AddTool(wxID_OPEN, _T("Open"), m_Bitmaps[Toolbar_FileOpen], _T("Open file..."));
|
||||
toolBar->AddTool(wxID_REFRESH, _T("Refresh"), m_Bitmaps[Toolbar_Refresh], _T("Refresh"));
|
||||
toolBar->AddTool(IDM_BROWSE, _T("Browse"), m_Bitmaps[Toolbar_Browse], _T("Browse for an ISO directory..."));
|
||||
toolBar->AddSeparator();
|
||||
|
||||
m_pToolPlay = toolBar->AddTool(IDM_PLAY, _T("Play"), m_Bitmaps[Toolbar_Play], _T("Play"));
|
||||
|
||||
|
||||
toolBar->AddTool(IDM_STOP, _T("Stop"), m_Bitmaps[Toolbar_Stop], _T("Stop"));
|
||||
#ifdef _WIN32
|
||||
toolBar->AddTool(IDM_TOGGLE_FULLSCREEN, _T("Fullscr."), m_Bitmaps[Toolbar_FullScreen], _T("Toggle Fullscreen"));
|
||||
#endif
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(IDM_CONFIG_MAIN, _T("Config"), m_Bitmaps[Toolbar_PluginOptions], _T("Configure..."));
|
||||
toolBar->AddTool(IDM_CONFIG_GFX_PLUGIN, _T("Gfx"), m_Bitmaps[Toolbar_PluginGFX], _T("Gfx settings"));
|
||||
toolBar->AddTool(IDM_CONFIG_DSP_PLUGIN, _T("DSP"), m_Bitmaps[Toolbar_PluginDSP], _T("DSP settings"));
|
||||
toolBar->AddTool(IDM_CONFIG_PAD_PLUGIN, _T("Pad"), m_Bitmaps[Toolbar_PluginPAD], _T("Pad settings"));
|
||||
toolBar->AddTool(IDM_CONFIG_WIIMOTE_PLUGIN, _T("Wiimote"), m_Bitmaps[Toolbar_Wiimote], _T("Wiimote settings"));
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(IDM_HELPABOUT, _T("About"), m_Bitmaps[Toolbar_Help], _T("About Dolphin"));
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Music mod
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
#ifdef MUSICMOD
|
||||
MM_PopulateGUI();
|
||||
#endif
|
||||
///////////////////////
|
||||
|
||||
|
||||
// after adding the buttons to the toolbar, must call Realize() to reflect
|
||||
// the changes
|
||||
toolBar->Realize();
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Delete and recreate the toolbar
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
void CFrame::RecreateToolbar()
|
||||
{
|
||||
|
||||
wxToolBarBase* toolBar = GetToolBar();
|
||||
long style = toolBar ? toolBar->GetWindowStyle() : TOOLBAR_STYLE;
|
||||
|
||||
delete toolBar;
|
||||
SetToolBar(NULL);
|
||||
|
||||
style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT | wxTB_TOP);
|
||||
TheToolBar = CreateToolBar(style, ID_TOOLBAR);
|
||||
|
||||
PopulateToolbar(TheToolBar);
|
||||
SetToolBar(TheToolBar);
|
||||
UpdateGUI();
|
||||
}
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
void CFrame::InitBitmaps()
|
||||
{
|
||||
// Get selected theme
|
||||
int Theme = SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme;
|
||||
|
||||
/* Save memory by only having one set of bitmaps loaded at any time. I mean, they are still
|
||||
in the exe, which is in memory, but at least we wont make another copy of all of them. */
|
||||
switch (Theme)
|
||||
{
|
||||
case BOOMY:
|
||||
{
|
||||
// These are stored as 48x48
|
||||
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(toolbar_file_open_png);
|
||||
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(toolbar_refresh_png);
|
||||
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(toolbar_browse_png);
|
||||
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(toolbar_play_png);
|
||||
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(toolbar_stop_png);
|
||||
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(toolbar_pause_png);
|
||||
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(toolbar_plugin_options_png);
|
||||
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(toolbar_plugin_gfx_png);
|
||||
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(toolbar_plugin_dsp_png);
|
||||
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(toolbar_plugin_pad_png);
|
||||
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(toolbar_plugin_pad_png);
|
||||
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(toolbar_fullscreen_png);
|
||||
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(toolbar_help_png);
|
||||
|
||||
// Scale the 48x48 bitmaps to 24x24
|
||||
for (size_t n = Toolbar_FileOpen; n <= Toolbar_Help; n++)
|
||||
{
|
||||
m_Bitmaps[n] = wxBitmap(m_Bitmaps[n].ConvertToImage().Scale(24, 24));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case VISTA:
|
||||
{
|
||||
// These are stored as 24x24 and need no scaling
|
||||
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(Toolbar_Open1_png);
|
||||
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(Toolbar_Refresh1_png);
|
||||
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(Toolbar_Browse1_png);
|
||||
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(Toolbar_Play1_png);
|
||||
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(Toolbar_Stop1_png);
|
||||
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(Toolbar_Pause1_png);
|
||||
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(Toolbar_Options1_png);
|
||||
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(Toolbar_Gfx1_png);
|
||||
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(Toolbar_DSP1_png);
|
||||
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(Toolbar_Pad1_png);
|
||||
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(Toolbar_Wiimote1_png);
|
||||
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(Toolbar_Fullscreen1_png);
|
||||
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(Toolbar_Help1_png);
|
||||
}
|
||||
break;
|
||||
|
||||
case XPLASTIK:
|
||||
{
|
||||
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(Toolbar_Open2_png);
|
||||
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(Toolbar_Refresh2_png);
|
||||
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(Toolbar_Browse2_png);
|
||||
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(Toolbar_Play2_png);
|
||||
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(Toolbar_Stop2_png);
|
||||
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(Toolbar_Pause2_png);
|
||||
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(Toolbar_Options2_png);
|
||||
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(Toolbar_Gfx2_png);
|
||||
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(Toolbar_DSP2_png);
|
||||
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(Toolbar_Pad2_png);
|
||||
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(Toolbar_Wiimote2_png);
|
||||
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(Toolbar_Fullscreen2_png);
|
||||
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(Toolbar_Help2_png);
|
||||
}
|
||||
break;
|
||||
|
||||
case KDE:
|
||||
{
|
||||
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(Toolbar_Open3_png);
|
||||
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(Toolbar_Refresh3_png);
|
||||
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(Toolbar_Browse3_png);
|
||||
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(Toolbar_Play3_png);
|
||||
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(Toolbar_Stop3_png);
|
||||
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(Toolbar_Pause3_png);
|
||||
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(Toolbar_Options3_png);
|
||||
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(Toolbar_Gfx3_png);
|
||||
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(Toolbar_DSP3_png);
|
||||
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(Toolbar_Pad3_png);
|
||||
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(Toolbar_Wiimote3_png);
|
||||
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(Toolbar_Fullscreen3_png);
|
||||
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(Toolbar_Help3_png);
|
||||
}
|
||||
break;
|
||||
|
||||
default: PanicAlert("Theme selection went wrong");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Music modification
|
||||
// -------------
|
||||
#ifdef MUSICMOD
|
||||
MM_InitBitmaps(Theme);
|
||||
#endif
|
||||
//////////////////////////
|
||||
|
||||
// Update in case the bitmap has been updated
|
||||
if (GetToolBar() != NULL) RecreateToolbar();
|
||||
}
|
||||
|
||||
|
||||
// =======================================================
|
||||
// Open file to boot or for changing disc
|
||||
// -------------
|
||||
void CFrame::OnOpen(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
// Don't allow this for an initialized core
|
||||
//if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||
// return;
|
||||
|
||||
DoOpen(true);
|
||||
}
|
||||
|
||||
void CFrame::DoOpen(bool Boot)
|
||||
{
|
||||
wxString path = wxFileSelector(
|
||||
_T("Select the file to load"),
|
||||
wxEmptyString, wxEmptyString, wxEmptyString,
|
||||
wxString::Format
|
||||
(
|
||||
_T("All GC/Wii files (elf, dol, gcm, iso)|*.elf;*.dol;*.gcm;*.iso;*.gcz|All files (%s)|%s"),
|
||||
wxFileSelectorDefaultWildcardStr,
|
||||
wxFileSelectorDefaultWildcardStr
|
||||
),
|
||||
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
|
||||
this);
|
||||
if (!path)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Should we boot a new game or just change the disc?
|
||||
if(Boot)
|
||||
{
|
||||
BootManager::BootCore(std::string(path.ToAscii()));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the current ISO name
|
||||
std::string OldName = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strFilename;
|
||||
|
||||
// Change the iso and make sure it's a valid file
|
||||
if(!VolumeHandler::SetVolumeName(std::string(path.ToAscii())))
|
||||
{
|
||||
PanicAlert("The file you selected is not a valid ISO file. Please try again.");
|
||||
|
||||
// Put back the old one
|
||||
VolumeHandler::SetVolumeName(OldName);
|
||||
}
|
||||
// Yes it is a valid ISO file
|
||||
else
|
||||
{
|
||||
std::string OldID = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID;
|
||||
std::string NewID = VolumeHandler::GetVolume()->GetUniqueID();
|
||||
|
||||
// Warn the user if he's selecting a completely different game
|
||||
if(OldID != NewID)
|
||||
PanicAlert(
|
||||
"The new game ID '%s' is not the same as the old game ID '%s'."
|
||||
" It is not recommended that you change the disc to another game this way."
|
||||
" It may crash your game. If you want to play another game you"
|
||||
" have to Stop this game and Start a new game."
|
||||
, NewID.c_str(), OldID.c_str()
|
||||
);
|
||||
|
||||
// Save the new ISO file name
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strFilename = std::string(path.ToAscii());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::OnChangeDisc(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
DVDInterface::SetLidOpen(true);
|
||||
DoOpen(false);
|
||||
DVDInterface::SetLidOpen(false);
|
||||
}
|
||||
// =============
|
||||
|
||||
|
||||
void CFrame::OnQuit(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
|
||||
void CFrame::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
// Don't forget the skip of the window won't be destroyed
|
||||
event.Skip();
|
||||
|
||||
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||
{
|
||||
Core::Stop();
|
||||
UpdateGUI();
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::OnHelp(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case IDM_HELPABOUT:
|
||||
{
|
||||
AboutDolphin frame(this);
|
||||
frame.ShowModal();
|
||||
break;
|
||||
}
|
||||
case IDM_HELPWEBSITE:
|
||||
File::Launch("http://www.dolphin-emu.com/");
|
||||
break;
|
||||
case IDM_HELPGOOGLECODE:
|
||||
File::Launch("http://code.google.com/p/dolphin-emu/");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =======================================================
|
||||
// Play button
|
||||
// -------------
|
||||
void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
#ifdef MUSICMOD // Music modification
|
||||
MM_OnPlay();
|
||||
#endif
|
||||
|
||||
|
||||
// shuffle2: wxBusyInfo is meant to be created on the stack
|
||||
// and only stay around for the life of the scope it's in.
|
||||
// If that is not what we want, find another solution. I don't
|
||||
// think such a dialog is needed anyways, so maybe kill it?
|
||||
wxBusyInfo bootingDialog(wxString::FromAscii("Booting..."), this);
|
||||
|
||||
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||
{
|
||||
if (Core::GetState() == Core::CORE_RUN)
|
||||
{
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
Core::SetState(Core::CORE_RUN);
|
||||
}
|
||||
UpdateGUI();
|
||||
}
|
||||
// Start the selected ISO
|
||||
else if (m_GameListCtrl->GetSelectedISO() != 0)
|
||||
{
|
||||
BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName());
|
||||
}
|
||||
/* Start the default ISO, or if we don't have a default ISO, start the last
|
||||
started ISO */
|
||||
else if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty() &&
|
||||
wxFileExists(wxString(SConfig::GetInstance().m_LocalCoreStartupParameter.
|
||||
m_strDefaultGCM.c_str(), wxConvUTF8)))
|
||||
{
|
||||
BootManager::BootCore(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM);
|
||||
}
|
||||
else if (!SConfig::GetInstance().m_LastFilename.empty() &&
|
||||
wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8)))
|
||||
{
|
||||
BootManager::BootCore(SConfig::GetInstance().m_LastFilename);
|
||||
}
|
||||
}
|
||||
// =============
|
||||
|
||||
void CFrame::DoStop()
|
||||
{
|
||||
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||
{
|
||||
Core::Stop();
|
||||
|
||||
/* This is needed to let GetState() == CORE_UNINITIALIZED together with the
|
||||
"delete g_pThread" in Core.cpp. Todo: Please feel free to fix it some other way. */
|
||||
//PanicAlert("%i", (int)bRenderToMain);
|
||||
#ifdef _WIN32
|
||||
if (bRenderToMain)
|
||||
while(Core::GetState() != Core::CORE_UNINITIALIZED) Sleep(10);
|
||||
#endif
|
||||
|
||||
UpdateGUI();
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::OnStop(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
// Ask for confirmation in case the user accidently clicked Stop
|
||||
bool answer;
|
||||
if(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop)
|
||||
{
|
||||
answer = AskYesNo("Are you sure you want to stop the current emulation?",
|
||||
"Confirm", wxYES_NO);
|
||||
}
|
||||
else
|
||||
{
|
||||
answer = true;
|
||||
}
|
||||
|
||||
if (answer) DoStop();
|
||||
}
|
||||
|
||||
|
||||
void CFrame::OnRefresh(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
if (m_GameListCtrl)
|
||||
{
|
||||
m_GameListCtrl->Update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CFrame::OnConfigMain(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CConfigMain ConfigMain(this);
|
||||
ConfigMain.ShowModal();
|
||||
if (ConfigMain.bRefreshList)
|
||||
m_GameListCtrl->Update();
|
||||
}
|
||||
|
||||
|
||||
void CFrame::OnPluginGFX(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
GetHandle(),
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void CFrame::OnPluginDSP(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
GetHandle(),
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
GetHandle(),
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin.c_str()
|
||||
);
|
||||
}
|
||||
void CFrame::OnPluginWiimote(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
GetHandle(),
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
void CFrame::OnBrowse(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
m_GameListCtrl->BrowseForDirectory();
|
||||
}
|
||||
|
||||
void CFrame::OnMemcard(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CMemcardManager MemcardManager(this);
|
||||
MemcardManager.ShowModal();
|
||||
}
|
||||
|
||||
void CFrame::OnShow_CheatsWindow(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CheatsWindow = new wxCheatsWindow(this, wxDefaultPosition, wxSize(600, 390));
|
||||
}
|
||||
|
||||
|
||||
// =======================================================
|
||||
/* Toogle fullscreen. In Windows the fullscreen mode is accomplished by expanding the m_Panel to cover
|
||||
the entire screen (when we render to the main window). */
|
||||
// -------------
|
||||
void CFrame::OnToggleFullscreen(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
ShowFullScreen(true);
|
||||
UpdateGUI();
|
||||
}
|
||||
|
||||
|
||||
void CFrame::OnToggleDualCore(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore = !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore;
|
||||
SConfig::GetInstance().SaveSettings();
|
||||
}
|
||||
void CFrame::OnToggleSkipIdle(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle = !SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle;
|
||||
SConfig::GetInstance().SaveSettings();
|
||||
}
|
||||
|
||||
void CFrame::OnLoadState(wxCommandEvent& event)
|
||||
{
|
||||
int id = event.GetId();
|
||||
int slot = id - IDM_LOADSLOT1 + 1;
|
||||
State_Load(slot);
|
||||
}
|
||||
|
||||
void CFrame::OnResize(wxSizeEvent& event)
|
||||
{
|
||||
DoMoveIcons(); // In FrameWiimote.cpp
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void CFrame::OnSaveState(wxCommandEvent& event)
|
||||
{
|
||||
int id = event.GetId();
|
||||
int slot = id - IDM_SAVESLOT1 + 1;
|
||||
State_Save(slot);
|
||||
}
|
||||
|
||||
|
||||
// =======================================================
|
||||
// Let us enable and disable the toolbar
|
||||
// -------------
|
||||
void CFrame::OnToggleToolbar(wxCommandEvent& event)
|
||||
{
|
||||
wxToolBarBase* toolBar = GetToolBar();
|
||||
|
||||
if (event.IsChecked())
|
||||
{
|
||||
CFrame::RecreateToolbar();
|
||||
}
|
||||
else
|
||||
{
|
||||
delete toolBar;
|
||||
SetToolBar(NULL);
|
||||
}
|
||||
|
||||
this->SendSizeEvent();
|
||||
}
|
||||
// ===================
|
||||
|
||||
|
||||
// =======================================================
|
||||
// Let us enable and disable the status bar
|
||||
// -------------
|
||||
void CFrame::OnToggleStatusbar(wxCommandEvent& event)
|
||||
{
|
||||
if (event.IsChecked())
|
||||
m_pStatusBar->Show();
|
||||
else
|
||||
m_pStatusBar->Hide();
|
||||
|
||||
this->SendSizeEvent();
|
||||
}
|
||||
// ===================
|
||||
|
||||
|
||||
// =======================================================
|
||||
// Update the enabled/disabled status
|
||||
// -------------
|
||||
void CFrame::UpdateGUI()
|
||||
{
|
||||
#ifdef MUSICMOD
|
||||
MM_UpdateGUI();
|
||||
#endif
|
||||
|
||||
// Save status
|
||||
bool initialized = Core::GetState() != Core::CORE_UNINITIALIZED;
|
||||
bool running = Core::GetState() == Core::CORE_RUN;
|
||||
bool paused = Core::GetState() == Core::CORE_PAUSE;
|
||||
|
||||
// Make sure that we have a toolbar
|
||||
if (GetToolBar() != NULL)
|
||||
{
|
||||
// Enable/disable the Config and Stop buttons
|
||||
//GetToolBar()->EnableTool(IDM_CONFIG_MAIN, !initialized);
|
||||
GetToolBar()->EnableTool(wxID_OPEN, !initialized);
|
||||
GetToolBar()->EnableTool(wxID_REFRESH, !initialized); // Don't allow refresh when we don't show the list
|
||||
GetToolBar()->EnableTool(IDM_STOP, running || paused);
|
||||
}
|
||||
|
||||
// File
|
||||
m_pMenuItemOpen->Enable(!initialized);
|
||||
|
||||
// Emulation
|
||||
m_pMenuItemStop->Enable(running || paused);
|
||||
m_pMenuItemLoad->Enable(initialized);
|
||||
m_pMenuItemSave->Enable(initialized);
|
||||
m_pPluginOptions->Enable(!running && !paused);
|
||||
|
||||
// Misc
|
||||
m_pMenuChangeDisc->Enable(initialized);
|
||||
|
||||
if (running)
|
||||
{
|
||||
if (GetToolBar() != NULL)
|
||||
{
|
||||
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Pause]);
|
||||
m_pToolPlay->SetShortHelp(_("Pause"));
|
||||
m_pToolPlay->SetLabel(_("Pause"));
|
||||
}
|
||||
m_pMenuItemPlay->SetText(_("&Pause"));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetToolBar() != NULL)
|
||||
{
|
||||
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Play]);
|
||||
m_pToolPlay->SetShortHelp(_("Play"));
|
||||
m_pToolPlay->SetLabel(_("Play"));
|
||||
}
|
||||
m_pMenuItemPlay->SetText(_("&Play"));
|
||||
|
||||
}
|
||||
if (GetToolBar() != NULL) GetToolBar()->Realize();
|
||||
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
if (m_GameListCtrl && !m_GameListCtrl->IsShown())
|
||||
{
|
||||
m_GameListCtrl->Enable();
|
||||
m_GameListCtrl->Show();
|
||||
sizerPanel->FitInside(m_Panel);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_GameListCtrl && m_GameListCtrl->IsShown())
|
||||
{
|
||||
m_GameListCtrl->Disable();
|
||||
m_GameListCtrl->Hide();
|
||||
}
|
||||
}
|
||||
|
||||
TheToolBar->Realize();
|
||||
}
|
||||
|
|
@ -109,6 +109,8 @@ enum
|
|||
IDM_UPDATEBREAKPOINTS,
|
||||
IDM_HOST_MESSAGE,
|
||||
|
||||
IDM_MPANEL, ID_STATUSBAR,
|
||||
|
||||
ID_TOOLBAR = 500,
|
||||
LIST_CTRL = 1000
|
||||
};
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "svnrev.h"
|
||||
|
@ -42,7 +46,12 @@
|
|||
#include "LogWindow.h"
|
||||
#include "ExtendedTrace.h"
|
||||
#include "BootManager.h"
|
||||
////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Declarations and definitions
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
IMPLEMENT_APP(DolphinApp)
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
|
@ -79,134 +88,150 @@ LONG WINAPI MyUnhandledExceptionFilter(LPEXCEPTION_POINTERS e) {
|
|||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
#endif
|
||||
///////////////////////////////////
|
||||
|
||||
// The `main program' equivalent, creating the windows and returning the
|
||||
// main frame
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
/* The `main program' equivalent that creates the mai nwindow and return the main frame */
|
||||
// ¯¯¯¯¯¯¯¯¯
|
||||
bool DolphinApp::OnInit()
|
||||
{
|
||||
DetectCPU();
|
||||
|
||||
#if defined _DEBUG && defined _WIN32
|
||||
int tmpflag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
|
||||
tmpflag |= _CRTDBG_DELAY_FREE_MEM_DF;
|
||||
_CrtSetDbgFlag(tmpflag);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
RegisterMsgAlertHandler(&wxMsgAlert);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
EXTENDEDTRACEINITIALIZE(".");
|
||||
SetUnhandledExceptionFilter(&MyUnhandledExceptionFilter);
|
||||
|
||||
// TODO: if First Boot
|
||||
if (!cpu_info.bSSE2)
|
||||
{
|
||||
MessageBox(0, _T("Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
|
||||
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
|
||||
"Sayonara!\n"), "Dolphin", MB_ICONINFORMATION);
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (!cpu_info.bSSE2)
|
||||
{
|
||||
printf("%s", "Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
|
||||
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
|
||||
"Sayonara!\n");
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
// ============
|
||||
// Check for debugger
|
||||
// Declarations and definitions
|
||||
bool UseDebugger = false;
|
||||
bool UseLogger = false;
|
||||
bool LoadElf = false; wxString ElfFile;
|
||||
|
||||
#if wxUSE_CMDLINE_PARSER
|
||||
wxCmdLineEntryDesc cmdLineDesc[] =
|
||||
{
|
||||
// Detect CPU info and write it to the cpu_info struct
|
||||
DetectCPU();
|
||||
//
|
||||
#if defined _DEBUG && defined _WIN32
|
||||
int tmpflag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
|
||||
tmpflag |= _CRTDBG_DELAY_FREE_MEM_DF;
|
||||
_CrtSetDbgFlag(tmpflag);
|
||||
#endif
|
||||
|
||||
// Register message box handler
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
RegisterMsgAlertHandler(&wxMsgAlert);
|
||||
#endif
|
||||
|
||||
|
||||
// ------------------------------------------
|
||||
// Show CPU message
|
||||
// ---------------
|
||||
#ifdef _WIN32
|
||||
EXTENDEDTRACEINITIALIZE(".");
|
||||
SetUnhandledExceptionFilter(&MyUnhandledExceptionFilter);
|
||||
|
||||
// TODO: if First Boot
|
||||
if (!cpu_info.bSSE2)
|
||||
{
|
||||
wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Show this help message"),
|
||||
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_SWITCH, _T("d"), _T("debugger"), _T("Opens the debugger")
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_SWITCH, _T("l"), _T("logger"), _T("Opens The Logger")
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_OPTION, _T("e"), _T("elf"), _T("Loads an elf file"),
|
||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_NONE
|
||||
MessageBox(0, _T("Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
|
||||
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
|
||||
"Sayonara!\n"), "Dolphin", MB_ICONINFORMATION);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
#else
|
||||
if (!cpu_info.bSSE2)
|
||||
{
|
||||
printf("%s", "Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
|
||||
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
|
||||
"Sayonara!\n");
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
// ---------------
|
||||
|
||||
#if defined(__APPLE__)
|
||||
// check to see if ~/Library/Application Support/Dolphin exists; if not, create it
|
||||
char AppSupportDir[MAXPATHLEN];
|
||||
snprintf(AppSupportDir, sizeof(AppSupportDir), "%s/Library/Application Support", getenv("HOME"));
|
||||
if (!File::Exists(AppSupportDir) || !File::IsDirectory(AppSupportDir))
|
||||
PanicAlert("Could not open ~/Library/Application Support");
|
||||
|
||||
strlcat(AppSupportDir, "/Dolphin", sizeof(AppSupportDir));
|
||||
|
||||
if (!File::Exists(AppSupportDir))
|
||||
File::CreateDir(AppSupportDir);
|
||||
|
||||
if (!File::IsDirectory(AppSupportDir))
|
||||
PanicAlert("~/Library/Application Support/Dolphin exists, but is not a directory");
|
||||
|
||||
chdir(AppSupportDir);
|
||||
// ------------------------------------------
|
||||
// Parse command lines
|
||||
// ---------------
|
||||
#if wxUSE_CMDLINE_PARSER
|
||||
wxCmdLineEntryDesc cmdLineDesc[] =
|
||||
{
|
||||
{
|
||||
wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Show this help message"),
|
||||
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_SWITCH, _T("d"), _T("debugger"), _T("Opens the debugger")
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_SWITCH, _T("l"), _T("logger"), _T("Opens The Logger")
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_OPTION, _T("e"), _T("elf"), _T("Loads an elf file"),
|
||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_NONE
|
||||
}
|
||||
};
|
||||
|
||||
if (!File::Exists("User")) File::CreateDir("User");
|
||||
if (!File::Exists("User/GC")) File::CreateDir("User/GC");
|
||||
|
||||
// HACK: Get rid of bogus osx param
|
||||
if (argc > 1 && wxString(argv[argc - 1]).StartsWith(_("-psn_"))) {
|
||||
delete argv[argc-1];
|
||||
argv[argc-1] = NULL;
|
||||
argc--;
|
||||
}
|
||||
#endif
|
||||
#if defined(__APPLE__)
|
||||
// check to see if ~/Library/Application Support/Dolphin exists; if not, create it
|
||||
char AppSupportDir[MAXPATHLEN];
|
||||
snprintf(AppSupportDir, sizeof(AppSupportDir), "%s/Library/Application Support", getenv("HOME"));
|
||||
if (!File::Exists(AppSupportDir) || !File::IsDirectory(AppSupportDir))
|
||||
PanicAlert("Could not open ~/Library/Application Support");
|
||||
|
||||
// Gets the passed media files from command line
|
||||
wxCmdLineParser parser(cmdLineDesc, argc, argv);
|
||||
strlcat(AppSupportDir, "/Dolphin", sizeof(AppSupportDir));
|
||||
|
||||
if (!File::Exists(AppSupportDir))
|
||||
File::CreateDir(AppSupportDir);
|
||||
|
||||
if (!File::IsDirectory(AppSupportDir))
|
||||
PanicAlert("~/Library/Application Support/Dolphin exists, but is not a directory");
|
||||
|
||||
chdir(AppSupportDir);
|
||||
|
||||
// Get filenames from the command line
|
||||
if (parser.Parse() != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!File::Exists("User")) File::CreateDir("User");
|
||||
if (!File::Exists("User/GC")) File::CreateDir("User/GC");
|
||||
|
||||
// HACK: Get rid of bogus osx param
|
||||
if (argc > 1 && wxString(argv[argc - 1]).StartsWith(_("-psn_"))) {
|
||||
delete argv[argc-1];
|
||||
argv[argc-1] = NULL;
|
||||
argc--;
|
||||
}
|
||||
#endif
|
||||
|
||||
UseDebugger = parser.Found(_T("debugger"));
|
||||
UseLogger = parser.Found(_T("logger"));
|
||||
LoadElf = parser.Found(_T("elf"), &ElfFile);
|
||||
// Gets the passed media files from command line
|
||||
wxCmdLineParser parser(cmdLineDesc, argc, argv);
|
||||
|
||||
if( LoadElf && ElfFile == wxEmptyString )
|
||||
PanicAlert("You did not specify a file name");
|
||||
// Get filenames from the command line
|
||||
if (parser.Parse() != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ============
|
||||
#endif
|
||||
UseDebugger = parser.Found(_T("debugger"));
|
||||
UseLogger = parser.Found(_T("logger"));
|
||||
LoadElf = parser.Found(_T("elf"), &ElfFile);
|
||||
|
||||
if( LoadElf && ElfFile == wxEmptyString )
|
||||
PanicAlert("You did not specify a file name");
|
||||
|
||||
// ============
|
||||
#endif
|
||||
|
||||
// Load CONFIG_FILE settings
|
||||
SConfig::GetInstance().LoadSettings();
|
||||
wxInitAllImageHandlers();
|
||||
// Create the main frame window
|
||||
|
||||
#ifdef _DEBUG
|
||||
const char *title = "Dolphin Debug SVN R " SVN_REV_STR;
|
||||
#else
|
||||
const char *title = "Dolphin SVN R " SVN_REV_STR;
|
||||
#endif
|
||||
// Enable the PNG image handler
|
||||
wxInitAllImageHandlers();
|
||||
|
||||
// Create the window title
|
||||
#ifdef _DEBUG
|
||||
const char *title = "Dolphin Debug SVN R " SVN_REV_STR;
|
||||
#else
|
||||
const char *title = "Dolphin SVN R " SVN_REV_STR;
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// If we are debugging let use save the main window position and size
|
||||
// TODO: Save position and size on exit
|
||||
// ---------
|
||||
// ------------
|
||||
IniFile ini;
|
||||
ini.Load(DEBUGGER_CONFIG_FILE);
|
||||
|
||||
|
@ -216,7 +241,7 @@ bool DolphinApp::OnInit()
|
|||
ini.Get("MainWindow", "y", &y, 100);
|
||||
ini.Get("MainWindow", "w", &w, 600);
|
||||
ini.Get("MainWindow", "h", &h, 800);
|
||||
// ---------
|
||||
// -------------------
|
||||
if(UseDebugger)
|
||||
{
|
||||
main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
|
||||
|
@ -227,9 +252,10 @@ bool DolphinApp::OnInit()
|
|||
main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
|
||||
wxPoint(100, 100), wxSize(800, 600));
|
||||
}
|
||||
// ---------
|
||||
// ------------------
|
||||
|
||||
// Create debugger
|
||||
|
||||
// Create debugging window
|
||||
if (UseDebugger)
|
||||
{
|
||||
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, main_frame);
|
||||
|
@ -237,15 +263,19 @@ bool DolphinApp::OnInit()
|
|||
}
|
||||
if(!UseDebugger && UseLogger)
|
||||
{
|
||||
#ifdef LOGGING
|
||||
// We aren't using debugger, just logger
|
||||
// Should be fine for a local copy
|
||||
CLogWindow* m_LogWindow = new CLogWindow(main_frame);
|
||||
m_LogWindow->Show(true);
|
||||
#endif
|
||||
}
|
||||
#ifdef LOGGING
|
||||
// We aren't using debugger, just logger
|
||||
// Should be fine for a local copy
|
||||
CLogWindow* m_LogWindow = new CLogWindow(main_frame);
|
||||
m_LogWindow->Show(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
// First check if we have a elf command line
|
||||
|
||||
// ---------------------------------------------------
|
||||
// Check the autoboot options.
|
||||
// ---------------------
|
||||
// First check if we have a elf command line. Todo: Should we place this under #if wxUSE_CMDLINE_PARSER?
|
||||
if (LoadElf && ElfFile != wxEmptyString)
|
||||
{
|
||||
BootManager::BootCore(std::string(ElfFile.ToAscii()));
|
||||
|
@ -267,7 +297,9 @@ bool DolphinApp::OnInit()
|
|||
BootManager::BootCore(SConfig::GetInstance().m_LastFilename);
|
||||
}
|
||||
}
|
||||
// ---------------------
|
||||
|
||||
// Set main parent window
|
||||
SetTopWindow(main_frame);
|
||||
return true;
|
||||
}
|
||||
|
@ -277,6 +309,8 @@ void DolphinApp::OnEndSession()
|
|||
{
|
||||
SConfig::GetInstance().SaveSettings();
|
||||
}
|
||||
/////////////////////////////////////// Main window created
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
/* We declare this here instead of in Common/MsgHandler.cpp because we want to keep Common
|
||||
|
@ -361,6 +395,9 @@ void Host_UpdateBreakPointView()
|
|||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
/* Update Wiimote status bar */
|
||||
// ¯¯¯¯¯¯¯¯¯
|
||||
void Host_UpdateLeds(int led_bits) {
|
||||
// Convert it to a simpler byte format
|
||||
main_frame->g_Leds[0] = led_bits >> 0;
|
||||
|
@ -376,7 +413,8 @@ void Host_UpdateSpeakerStatus(int index, int speaker_bits) {
|
|||
main_frame->UpdateSpeakers();
|
||||
}
|
||||
|
||||
void Host_UpdateStatus() {
|
||||
void Host_UpdateStatus()
|
||||
{
|
||||
// Debugging
|
||||
//std::string Tmp = ArrayToString(main_frame->g_Speakers, sizeof(main_frame->g_Speakers));
|
||||
//std::string Tmp2 = ArrayToString(main_frame->g_Speakers_, sizeof(main_frame->g_Speakers_));
|
||||
|
@ -391,6 +429,8 @@ void Host_UpdateStatus() {
|
|||
memcpy(main_frame->g_Speakers_, main_frame->g_Speakers, sizeof(main_frame->g_Speakers));
|
||||
}
|
||||
}
|
||||
///////////////////////////
|
||||
|
||||
|
||||
void Host_UpdateMemoryView()
|
||||
{}
|
||||
|
|
|
@ -22,6 +22,7 @@ if wxenv['HAVE_WX']:
|
|||
'ARCodeAddEdit.cpp',
|
||||
'ConfigMain.cpp',
|
||||
'Frame.cpp',
|
||||
'FrameTools.cpp',
|
||||
'GameListCtrl.cpp',
|
||||
'Globals.cpp',
|
||||
'ISOFile.cpp',
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
Const: yes
|
||||
*/
|
||||
|
||||
#ifndef _WXINCLUDE_MYHEADER_H_
|
||||
#define _WXINCLUDE_MYHEADER_H_
|
||||
#ifndef _WXINCLUDE_MYHEADER_0_H_
|
||||
#define _WXINCLUDE_MYHEADER_0_H_
|
||||
|
||||
static const unsigned char Toolbar_Log_png[] = {
|
||||
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -5,6 +5,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "Core\Core\Core.vcpr
|
|||
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
|
||||
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
|
||||
{71B16F46-0B00-4EDA-B253-D6D9D03A215C} = {71B16F46-0B00-4EDA-B253-D6D9D03A215C}
|
||||
{DE7C596C-CBC4-4278-8909-146D63990803} = {DE7C596C-CBC4-4278-8909-146D63990803}
|
||||
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
|
||||
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
|
||||
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
|
||||
|
@ -63,6 +64,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DolphinWX", "Core\DolphinWX
|
|||
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
|
||||
{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77} = {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}
|
||||
{F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
|
||||
{0B72B5D6-5D72-4391-84A7-9CCA5392668A} = {0B72B5D6-5D72-4391-84A7-9CCA5392668A}
|
||||
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
|
||||
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
|
||||
EndProjectSection
|
||||
|
@ -149,6 +151,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\Branches\Music
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Main", "..\Branches\MusicMod\Main\Main.vcproj", "{95CCAABC-7062-47C4-B8C1-A064DD5F16FF}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} = {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}
|
||||
{DE7C596C-CBC4-4278-8909-146D63990803} = {DE7C596C-CBC4-4278-8909-146D63990803}
|
||||
{0B72B5D6-5D72-4391-84A7-9CCA5392668A} = {0B72B5D6-5D72-4391-84A7-9CCA5392668A}
|
||||
EndProjectSection
|
||||
|
@ -233,6 +236,7 @@ Global
|
|||
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
|
||||
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.DebugFast|x64.ActiveCfg = DebugFast|x64
|
||||
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Release|Win32.Build.0 = Release|Win32
|
||||
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Release|x64.ActiveCfg = Release|x64
|
||||
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Release|x64.Build.0 = Release|x64
|
||||
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
|
@ -407,13 +411,13 @@ Global
|
|||
{9A183B48-ECC2-4121-876A-9B3793686073} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{8D612734-FAA5-4B8A-804F-4DEA2367D495} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{C6CC7A52-0FDD-433A-B2CF-9C6F187DA807} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{ADF64291-57ED-4B7A-AB76-37B4A991504B} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{521498BE-6089-4780-8223-E67C22F4E068} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {5C17B1EB-6C76-438A-A503-8F3C7831023B}
|
||||
{3E03C179-8251-46E4-81F4-466F114BAC63} = {4F427D1B-8C90-4D9C-B23D-A51493A1C471}
|
||||
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {4F427D1B-8C90-4D9C-B23D-A51493A1C471}
|
||||
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {4F427D1B-8C90-4D9C-B23D-A51493A1C471}
|
||||
|
|
|
@ -142,10 +142,16 @@ void UpdateFPSDisplay(const char *text)
|
|||
OpenGL_SetWindowText(temp);
|
||||
}
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Create window. Called from main.cpp
|
||||
// Create rendering window.
|
||||
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
||||
// ------------------
|
||||
bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight)
|
||||
{
|
||||
// --------------------------------------------
|
||||
// Check for fullscreen mode
|
||||
// ---------------
|
||||
int _twidth, _theight;
|
||||
if (g_Config.bFullscreen)
|
||||
{
|
||||
|
@ -171,9 +177,12 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||
_theight = _iheight;
|
||||
}
|
||||
}
|
||||
#if defined(_WIN32)
|
||||
EmuWindow::SetSize(_twidth, _theight);
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
EmuWindow::SetSize(_twidth, _theight);
|
||||
#endif
|
||||
// ----------------------------
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Control window size and picture scaling
|
||||
|
@ -247,8 +256,14 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||
|
||||
GLWin.glCanvas->SetCurrent(*GLWin.glCtxt);
|
||||
// GLWin.glCtxt->SetCurrent(*GLWin.glCanvas);
|
||||
|
||||
|
||||
#elif defined(_WIN32)
|
||||
// create the window
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Create rendering window in Windows
|
||||
// ----------------------
|
||||
|
||||
// Create the window
|
||||
if (!g_Config.renderToMainframe || g_VideoInitialize.pWindowHandle == NULL)
|
||||
{
|
||||
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create(NULL, g_hInstance, "Please wait...");
|
||||
|
@ -257,6 +272,8 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||
{
|
||||
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create((HWND)g_VideoInitialize.pWindowHandle, g_hInstance, "Please wait...");
|
||||
}
|
||||
|
||||
// Show the window
|
||||
EmuWindow::Show();
|
||||
|
||||
if (g_VideoInitialize.pWindowHandle == NULL)
|
||||
|
@ -359,6 +376,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||
MessageBox(NULL,"(4) Can't Create A GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
|
||||
return false;
|
||||
}
|
||||
// --------------------------------------
|
||||
|
||||
#elif defined(HAVE_X11) && HAVE_X11
|
||||
XVisualInfo *vi;
|
||||
|
|
|
@ -36,7 +36,6 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
|||
EVT_CHECKBOX(ID_FORCEFILTERING, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_STRETCHTOFIT, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_KEEPAR, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_HIDECURSOR, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_WIREFRAME, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SHOWFPS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_STATISTICS, ConfigDialog::AdvancedSettingsChanged)
|
||||
|
@ -109,8 +108,6 @@ void ConfigDialog::CreateGUIControls()
|
|||
m_StretchToFit->SetValue(g_Config.bStretchToFit);
|
||||
m_KeepAR = new wxCheckBox(m_PageGeneral, ID_KEEPAR, wxT("Keep 4:3 aspect ratio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_KeepAR->SetValue(g_Config.bKeepAR);
|
||||
m_HideCursor = new wxCheckBox(m_PageGeneral, ID_HIDECURSOR, wxT("Hide mouse cursor"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_HideCursor->SetValue(g_Config.bHideCursor);
|
||||
|
||||
wxStaticText *FSText = new wxStaticText(m_PageGeneral, ID_FSTEXT, wxT("Fullscreen video mode:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_FullscreenCB = new wxComboBox(m_PageGeneral, ID_FULLSCREENCB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenCB, 0, wxDefaultValidator);
|
||||
|
@ -152,13 +149,12 @@ void ConfigDialog::CreateGUIControls()
|
|||
sBasic->Add(m_RenderToMainWindow, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sBasic->Add(m_StretchToFit, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sBasic->Add(m_KeepAR, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sBasic->Add(m_HideCursor, wxGBPosition(4, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sBasic->Add(FSText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBasic->Add(m_FullscreenCB, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sBasic->Add(WMText, wxGBPosition(6, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBasic->Add(m_WindowResolutionCB, wxGBPosition(6, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sBasic->Add(BEText, wxGBPosition(7, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBasic->Add(m_RenderBackend, wxGBPosition(7, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sBasic->Add(FSText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBasic->Add(m_FullscreenCB, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sBasic->Add(WMText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBasic->Add(m_WindowResolutionCB, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sBasic->Add(BEText, wxGBPosition(6, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBasic->Add(m_RenderBackend, wxGBPosition(6, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sbBasic->Add(sBasic);
|
||||
sGeneral->Add(sbBasic, 0, wxEXPAND|wxALL, 5);
|
||||
|
||||
|
@ -219,7 +215,7 @@ void ConfigDialog::CreateGUIControls()
|
|||
m_EFBToTextureDisable->Enable(true);
|
||||
m_EFBToTextureDisable->SetValue(g_Config.bEFBToTextureDisable);
|
||||
m_EFBToTextureDisableHotKey = new wxCheckBox(m_PageAdvanced,
|
||||
ID_EFBTOTEXTUREDISABLEHOTKEY, wxT("with hotkey E"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
ID_EFBTOTEXTUREDISABLEHOTKEY, wxT("With hotkey E"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_EFBToTextureDisableHotKey->SetToolTip(wxT("Use the E key to turn this option on and off"));
|
||||
#ifndef _WIN32
|
||||
// JPeterson set the hot key to be Win32-specific
|
||||
|
@ -341,9 +337,6 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
|
|||
case ID_KEEPAR:
|
||||
g_Config.bKeepAR = m_KeepAR->IsChecked();
|
||||
break;
|
||||
case ID_HIDECURSOR:
|
||||
g_Config.bHideCursor = m_HideCursor->IsChecked();
|
||||
break;
|
||||
case ID_FULLSCREENCB:
|
||||
strcpy(g_Config.iFSResolution, m_FullscreenCB->GetValue().mb_str() );
|
||||
break;
|
||||
|
|
|
@ -72,7 +72,6 @@ class ConfigDialog : public wxDialog
|
|||
wxCheckBox *m_RenderToMainWindow;
|
||||
wxCheckBox *m_StretchToFit;
|
||||
wxCheckBox *m_KeepAR;
|
||||
wxCheckBox *m_HideCursor;
|
||||
wxArrayString arrayStringFor_FullscreenCB;
|
||||
wxComboBox *m_FullscreenCB;
|
||||
wxArrayString arrayStringFor_WindowResolutionCB;
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Include
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <windows.h>
|
||||
|
||||
#include <wx/wx.h>
|
||||
|
@ -24,15 +28,19 @@
|
|||
#include <wx/dialog.h>
|
||||
#include <wx/aboutdlg.h>
|
||||
|
||||
#include "../Globals.h"
|
||||
#include "../Globals.h" // Local
|
||||
#include "../Config.h"
|
||||
#include "main.h"
|
||||
|
||||
#include "Win32.h"
|
||||
#include "Render.h" // for AddMessage
|
||||
|
||||
#include "StringUtil.h" // for StringFromFormat
|
||||
#include "StringUtil.h" // Common: For StringFromFormat
|
||||
//////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Declarations and definitions
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
void OpenConsole();
|
||||
void CloseConsole();
|
||||
|
||||
|
@ -81,14 +89,23 @@ BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
|
|||
|
||||
void DoDllDebugger();
|
||||
extern bool gShowDebugger;
|
||||
//////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// The rendering window
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
namespace EmuWindow
|
||||
{
|
||||
HWND m_hWnd = NULL;
|
||||
HWND m_hParent = NULL;
|
||||
HWND m_hWnd = NULL; // The new window that is created here
|
||||
HWND m_hParent = NULL, m_hMain = NULL; // The main CPanel
|
||||
HINSTANCE m_hInstance = NULL;
|
||||
WNDCLASSEX wndClass;
|
||||
const TCHAR m_szClassName[] = "DolphinEmuWnd";
|
||||
int g_winstyle;
|
||||
|
||||
|
||||
// ------------------------------------------
|
||||
/* Invisible cursor option. In the lack of a predefined IDC_BLANK we make
|
||||
|
@ -116,11 +133,15 @@ namespace EmuWindow
|
|||
}
|
||||
|
||||
LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
{
|
||||
HDC hdc;
|
||||
PAINTSTRUCT ps;
|
||||
switch( iMsg )
|
||||
{
|
||||
case WM_CREATE:
|
||||
PostMessage(m_hMain, WM_USER, 15, (int)m_hParent); // 15 = WM_USER_CREATE, make enum table if it's confusing
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
hdc = BeginPaint( hWnd, &ps );
|
||||
EndPaint( hWnd, &ps );
|
||||
|
@ -129,12 +150,26 @@ namespace EmuWindow
|
|||
case WM_KEYDOWN:
|
||||
switch( LOWORD( wParam ))
|
||||
{
|
||||
case VK_ESCAPE: /* Pressing esc quits */
|
||||
case VK_ESCAPE: // Pressing Esc Stop or Maximize
|
||||
//DestroyWindow(hWnd);
|
||||
//PostQuitMessage(0);
|
||||
|
||||
/* The fullscreen option for Windows users is not very user friendly. With this the user
|
||||
can only get out of the fullscreen mode by pressing Esc or Alt + F4. But that also
|
||||
closes*/
|
||||
//if(m_hParent == NULL) ExitProcess(0);
|
||||
if(m_hParent == NULL)
|
||||
{
|
||||
if (g_Config.bFullscreen)
|
||||
PostMessage(m_hMain, WM_USER, 5, 0); // Stop
|
||||
else
|
||||
// Toggle maximize and restore
|
||||
if (IsZoomed(hWnd)) ShowWindow(hWnd, SW_RESTORE); else ShowWindow(hWnd, SW_MAXIMIZE);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
case MY_KEYS:
|
||||
case MY_KEYS:
|
||||
hypotheticalScene->sendMessage(KEYDOWN...);
|
||||
*/
|
||||
case 'E': // EFB hotkey
|
||||
|
@ -155,23 +190,65 @@ namespace EmuWindow
|
|||
because SetCursor is not supposed to actually change the cursor if it's the
|
||||
same as the one before. */
|
||||
case WM_MOUSEMOVE:
|
||||
if(g_Config.bHideCursor)
|
||||
SetCursor(hCursorBlank);
|
||||
/* Check rendering mode; child or parent. Then post the mouse moves to the main window
|
||||
it's nessesary for both the chil dwindow and separate rendering window because
|
||||
moves over the rendering window do not reach the main program then. */
|
||||
if (GetParentWnd() == NULL) // Separate rendering window
|
||||
PostMessage(m_hMain, iMsg, wParam, -1);
|
||||
else
|
||||
SetCursor(hCursor);
|
||||
PostMessage(GetParentWnd(), iMsg, wParam, lParam);
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
ExitProcess(0);
|
||||
/* To support the separate window rendering we get the message back here. So we basically
|
||||
only let it pass through DolphinWX > Frame.cpp to determine if it should be on or off
|
||||
and coordinate it with the other settings if nessesary */
|
||||
case WM_USER:
|
||||
/* I set wParam to 10 just in case there are other WM_USER events. If we want more
|
||||
WM_USER cases we would start making wParam or lParam cases */
|
||||
if(wParam == 10)
|
||||
{
|
||||
if(lParam)
|
||||
SetCursor(hCursor);
|
||||
else
|
||||
SetCursor(hCursorBlank);
|
||||
}
|
||||
break;
|
||||
|
||||
//Core::SetState(Core::CORE_UNINITIALIZED);
|
||||
return 0;
|
||||
/* Post thes mouse events to the main window, it's nessesary becase in difference to the
|
||||
keyboard inputs these events only appear here, not in the main WndProc() */
|
||||
case WM_LBUTTONDOWN:
|
||||
case WM_LBUTTONUP:
|
||||
case WM_LBUTTONDBLCLK:
|
||||
PostMessage(GetParentWnd(), iMsg, wParam, lParam);
|
||||
break;
|
||||
|
||||
// This is called when we close the window when we render to a separate window
|
||||
case WM_CLOSE:
|
||||
if(m_hParent == NULL)
|
||||
{
|
||||
ExitProcess(0);
|
||||
//Core::SetState(Core::CORE_UNINITIALIZED);
|
||||
|
||||
/* Attempt to only Stop when we close the separate window. But it didn't work, it hanged.
|
||||
It may need some more coordination with the Stop code in the Core */
|
||||
//PostMessage(m_hMain, WM_USER, 5, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This is called from the Core when we Stop, but currently we only use DefWindowProc(),
|
||||
whatever that does with it, if any */
|
||||
//case WM_QUIT:
|
||||
//Video_Shutdown();
|
||||
// ExitProcess(0);
|
||||
// return 0;
|
||||
|
||||
case WM_DESTROY:
|
||||
//Shutdown();
|
||||
//PostQuitMessage( 0 );
|
||||
//PostQuitMessage( 0 ); // Call WM_QUIT
|
||||
break;
|
||||
|
||||
// Called when a screensaver wants to show up while this window is active
|
||||
case WM_SYSCOMMAND:
|
||||
switch (wParam)
|
||||
{
|
||||
|
@ -186,6 +263,7 @@ namespace EmuWindow
|
|||
}
|
||||
|
||||
|
||||
// This is called from
|
||||
HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const TCHAR *title)
|
||||
{
|
||||
wndClass.cbSize = sizeof( wndClass );
|
||||
|
@ -196,7 +274,7 @@ namespace EmuWindow
|
|||
wndClass.hInstance = hInstance;
|
||||
wndClass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
|
||||
//wndClass.hCursor = LoadCursor( NULL, IDC_ARROW );
|
||||
wndClass.hCursor = NULL; // to interfer less with SetCursor() later
|
||||
wndClass.hCursor = NULL; // To interfer less with SetCursor() later
|
||||
wndClass.hbrBackground = (HBRUSH)GetStockObject( BLACK_BRUSH );
|
||||
wndClass.lpszMenuName = NULL;
|
||||
wndClass.lpszClassName = m_szClassName;
|
||||
|
@ -207,17 +285,20 @@ namespace EmuWindow
|
|||
|
||||
CreateCursors(m_hInstance);
|
||||
|
||||
// Create child window
|
||||
if (parent)
|
||||
{
|
||||
m_hParent = m_hMain = parent;
|
||||
|
||||
m_hWnd = CreateWindow(m_szClassName, title,
|
||||
WS_CHILD,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
parent, NULL, hInstance, NULL );
|
||||
|
||||
m_hParent = parent;
|
||||
|
||||
ShowWindow(m_hWnd, SW_SHOWMAXIMIZED);
|
||||
}
|
||||
|
||||
// Create new separate window
|
||||
else
|
||||
{
|
||||
DWORD style = g_Config.bFullscreen ? WS_POPUP : WS_OVERLAPPEDWINDOW;
|
||||
|
@ -233,6 +314,8 @@ namespace EmuWindow
|
|||
rc.top = (1024 - h)/2;
|
||||
rc.bottom = rc.top + h;
|
||||
|
||||
// I save this to m_hMain instead of m_hParent because it casused problems otherwise
|
||||
m_hMain = (HWND)g_VideoInitialize.pWindowHandle;
|
||||
|
||||
m_hWnd = CreateWindow(m_szClassName, title,
|
||||
style,
|
||||
|
@ -241,7 +324,6 @@ namespace EmuWindow
|
|||
|
||||
g_winstyle = GetWindowLong( m_hWnd, GWL_STYLE );
|
||||
g_winstyle &= ~WS_MAXIMIZE & ~WS_MINIMIZE; // remove minimize/maximize style
|
||||
|
||||
}
|
||||
|
||||
return m_hWnd;
|
||||
|
@ -290,4 +372,6 @@ namespace EmuWindow
|
|||
rc.bottom = rc.top + h;
|
||||
::MoveWindow(m_hWnd, rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
} // EmuWindow
|
||||
////////////////////////////////////
|
|
@ -55,7 +55,9 @@ SVideoInitialize g_VideoInitialize;
|
|||
if the OpenGL plugin was loaded before. I'll try to fix that. Currently you may have to
|
||||
clsoe the window if it has auto started, and then restart it after the dll has loaded
|
||||
for the purpose of the game. At that point there is no need to use the same dll instance
|
||||
as the one that is rendering the game. However, that could be done. */
|
||||
as the one that is rendering the game. However, that could be done.
|
||||
|
||||
Update: This crash seems to be gone for now. */
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
CDebugger* m_frame;
|
||||
|
@ -195,36 +197,43 @@ void DllConfig(HWND _hParent)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Initialize video
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
void Video_Initialize(SVideoInitialize* _pVideoInitialize)
|
||||
{
|
||||
if (_pVideoInitialize == NULL)
|
||||
return;
|
||||
// When will this happen?
|
||||
if (_pVideoInitialize == NULL) return;
|
||||
|
||||
#ifdef _WIN32
|
||||
// OpenConsole();
|
||||
#endif
|
||||
|
||||
/* Dolphin currently crashes if the dll is loaded when a game is started so we clsoe the
|
||||
debugger and open it again after loading */
|
||||
// --------------------------------------------------
|
||||
/* Dolphin currently crashes if the dll is loaded when a game is started so we close the
|
||||
debugger and open it again after loading
|
||||
|
||||
Status: Currently it's working so no need for this */
|
||||
/*
|
||||
if(m_frame)
|
||||
{
|
||||
m_frame->EndModal(0); wxEntryCleanup();
|
||||
}//use wxUninitialize() if you don't want GUI
|
||||
*/
|
||||
// --------------------------------------------------
|
||||
|
||||
frameCount = 0;
|
||||
g_VideoInitialize = *_pVideoInitialize;
|
||||
g_VideoInitialize = *_pVideoInitialize; // Create a shortcut to _pVideoInitialize that can also update it
|
||||
InitLUTs();
|
||||
InitXFBConvTables();
|
||||
g_Config.Load();
|
||||
|
||||
if (!OpenGL_Create(g_VideoInitialize, 640, 480)) { //640x480 will be the default if all else fails//
|
||||
if (!OpenGL_Create(g_VideoInitialize, 640, 480)) // 640x480 will be the default if all else fails
|
||||
{
|
||||
g_VideoInitialize.pLog("Renderer::Create failed\n", TRUE);
|
||||
return;
|
||||
}
|
||||
_pVideoInitialize->pPeekMessages = g_VideoInitialize.pPeekMessages;
|
||||
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
|
||||
|
||||
// Now the window handle is written
|
||||
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
|
||||
|
||||
Renderer::AddMessage("Dolphin OpenGL Video Plugin" ,5000);
|
||||
|
|
|
@ -111,7 +111,8 @@ ConfigBox::ConfigBox(wxWindow *parent, wxWindowID id, const wxString &title,
|
|||
CreateGUIControls();
|
||||
|
||||
#if wxUSE_TIMER
|
||||
m_timer.Start( floor((double)(1000 / 30)) );
|
||||
int TimesPerSecond = 30;
|
||||
m_timer.Start( floor((double)(1000 / TimesPerSecond)) );
|
||||
#endif
|
||||
|
||||
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN,
|
||||
|
@ -122,7 +123,10 @@ ConfigBox::ConfigBox(wxWindow *parent, wxWindowID id, const wxString &title,
|
|||
|
||||
ConfigBox::~ConfigBox()
|
||||
{
|
||||
// empty
|
||||
// The statbar sample has this so I add this to
|
||||
#if wxUSE_TIMER
|
||||
if (m_timer.IsRunning()) m_timer.Stop();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ConfigBox::OnKeyDown(wxKeyEvent& event)
|
||||
|
@ -339,7 +343,7 @@ void ConfigBox::CreateGUIControls()
|
|||
|
||||
#ifndef _WIN32
|
||||
// Force a 8pt font so that it looks more or less "correct" regardless of the default font setting
|
||||
wxFont f(8,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL);
|
||||
wxFont f(8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
||||
SetFont(f);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue