mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
space changes, merge #defines, language fix, and code reorder/cleanup :P
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5614 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@@ -27,12 +27,7 @@
|
||||
|
||||
// Force enable logging in the right modes. For some reason, something had changed
|
||||
// so that debugfast no longer logged.
|
||||
#ifdef _DEBUG
|
||||
#undef LOGGING
|
||||
#define LOGGING 1
|
||||
#endif
|
||||
|
||||
#ifdef DEBUGFAST
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
#undef LOGGING
|
||||
#define LOGGING 1
|
||||
#endif
|
||||
@@ -137,7 +132,7 @@
|
||||
// A macro to disallow the copy constructor and operator= functions
|
||||
// This should be used in the private: declarations for a class
|
||||
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||
TypeName(const TypeName&); \
|
||||
void operator=(const TypeName&)
|
||||
TypeName(const TypeName&); \
|
||||
void operator=(const TypeName&)
|
||||
|
||||
#endif // _COMMON_H_
|
||||
|
||||
@@ -38,10 +38,10 @@ public:
|
||||
int Unload();
|
||||
|
||||
// Gets a pointer to the function symbol of funcname by getting it from the
|
||||
// share object
|
||||
// shared object
|
||||
void *Get(const char *funcname) const;
|
||||
|
||||
// Returns true is the library is loaded
|
||||
// Returns true if the library is loaded
|
||||
bool IsLoaded() const { return library != 0; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -43,7 +43,7 @@ CPlugin::CPlugin(const char* _szName) : valid(false)
|
||||
m_EmuStateChange = NULL;
|
||||
|
||||
if (m_hInstLib.Load(_szName))
|
||||
{
|
||||
{
|
||||
m_GetDllInfo = reinterpret_cast<TGetDllInfo>
|
||||
(m_hInstLib.Get("GetDllInfo"));
|
||||
m_DllConfig = reinterpret_cast<TDllConfig>
|
||||
@@ -61,7 +61,7 @@ CPlugin::CPlugin(const char* _szName) : valid(false)
|
||||
m_EmuStateChange = reinterpret_cast<TEmuStateChange>
|
||||
(m_hInstLib.Get("EmuStateChange"));
|
||||
|
||||
// Check if the plugin has all the functions it shold have
|
||||
// Check if the plugin has all the functions it should have
|
||||
if (m_GetDllInfo != 0 &&
|
||||
m_DllConfig != 0 &&
|
||||
m_DllDebugger != 0 &&
|
||||
@@ -88,7 +88,7 @@ bool CPlugin::GetInfo(PLUGIN_INFO& _pluginInfo)
|
||||
if (m_GetDllInfo != NULL) {
|
||||
m_GetDllInfo(&_pluginInfo);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,14 +24,14 @@
|
||||
|
||||
namespace Common
|
||||
{
|
||||
typedef void (__cdecl * TGetDllInfo)(PLUGIN_INFO*);
|
||||
typedef void (__cdecl * TDllConfig)(HWND);
|
||||
typedef void (__cdecl * TDllDebugger)(HWND, bool);
|
||||
typedef void (__cdecl * TSetDllGlobals)(PLUGIN_GLOBALS*);
|
||||
typedef void (__cdecl * TInitialize)(void *);
|
||||
typedef void (__cdecl * TShutdown)();
|
||||
typedef void (__cdecl * TDoState)(unsigned char**, int);
|
||||
typedef void (__cdecl * TEmuStateChange)(PLUGIN_EMUSTATE);
|
||||
typedef void (__cdecl * TGetDllInfo)(PLUGIN_INFO*);
|
||||
typedef void (__cdecl * TDllConfig)(HWND);
|
||||
typedef void (__cdecl * TDllDebugger)(HWND, bool);
|
||||
typedef void (__cdecl * TSetDllGlobals)(PLUGIN_GLOBALS*);
|
||||
typedef void (__cdecl * TInitialize)(void *);
|
||||
typedef void (__cdecl * TShutdown)();
|
||||
typedef void (__cdecl * TDoState)(unsigned char**, int);
|
||||
typedef void (__cdecl * TEmuStateChange)(PLUGIN_EMUSTATE);
|
||||
|
||||
class CPlugin
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ void SConfig::SaveSettings()
|
||||
ini.Set("General", tmp, m_ISOFolder[i]);
|
||||
}
|
||||
|
||||
ini.Set("General", "RecersiveGCMPaths", m_RecursiveISOFolder);
|
||||
ini.Set("General", "RecursiveGCMPaths", m_RecursiveISOFolder);
|
||||
|
||||
// Interface
|
||||
ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
|
||||
@@ -209,7 +209,7 @@ void SConfig::LoadSettings()
|
||||
}
|
||||
}
|
||||
|
||||
ini.Get("General", "RecersiveGCMPaths", &m_RecursiveISOFolder, false);
|
||||
ini.Get("General", "RecursiveGCMPaths", &m_RecursiveISOFolder, false);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -287,13 +287,13 @@ void SConfig::LoadSettings()
|
||||
ini.Get("Core", sidevicenum, (u32*)&m_SIDevice[i], i==0 ? SI_GC_CONTROLLER:SI_NONE);
|
||||
}
|
||||
|
||||
ini.Get("Core", "WiiSDCard", &m_WiiSDCard, false);
|
||||
ini.Get("Core", "WiiKeyboard", &m_WiiKeyboard, false);
|
||||
ini.Get("Core", "WiiSDCard", &m_WiiSDCard, false);
|
||||
ini.Get("Core", "WiiKeyboard", &m_WiiKeyboard, false);
|
||||
ini.Get("Core", "RunCompareServer", &m_LocalCoreStartupParameter.bRunCompareServer, false);
|
||||
ini.Get("Core", "RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false);
|
||||
ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.iTLBHack, 0);
|
||||
ini.Get("Core", "FrameLimit", &m_Framelimit, 1); // auto frame limit by default
|
||||
ini.Get("Core", "UseFPS", &b_UseFPS, false); // use vps as default
|
||||
ini.Get("Core", "UseFPS", &b_UseFPS, false); // use vps as default
|
||||
|
||||
// Plugins
|
||||
ini.Get("Core", "GFXPlugin", &m_LocalCoreStartupParameter.m_strVideoPlugin, m_DefaultGFXPlugin.c_str());
|
||||
|
||||
@@ -130,13 +130,13 @@ bool PanicAlertToVideo(const char* text, bool yes_no)
|
||||
void DisplayMessage(const std::string &message, int time_in_ms)
|
||||
{
|
||||
CPluginManager::GetInstance().GetVideo()->Video_AddMessage(message.c_str(),
|
||||
time_in_ms);
|
||||
time_in_ms);
|
||||
}
|
||||
|
||||
void DisplayMessage(const char *message, int time_in_ms)
|
||||
{
|
||||
CPluginManager::GetInstance().GetVideo()->Video_AddMessage(message,
|
||||
time_in_ms);
|
||||
time_in_ms);
|
||||
}
|
||||
|
||||
void Callback_DebuggerBreak()
|
||||
@@ -325,25 +325,25 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||
|
||||
// Load the VideoPlugin
|
||||
SVideoInitialize VideoInitialize;
|
||||
VideoInitialize.pGetMemoryPointer = Memory::GetPointer;
|
||||
VideoInitialize.pSetInterrupt = ProcessorInterface::SetInterrupt;
|
||||
VideoInitialize.pRegisterEvent = CoreTiming::RegisterEvent;
|
||||
VideoInitialize.pScheduleEvent_Threadsafe = CoreTiming::ScheduleEvent_Threadsafe;
|
||||
VideoInitialize.pGetMemoryPointer = Memory::GetPointer;
|
||||
VideoInitialize.pSetInterrupt = ProcessorInterface::SetInterrupt;
|
||||
VideoInitialize.pRegisterEvent = CoreTiming::RegisterEvent;
|
||||
VideoInitialize.pScheduleEvent_Threadsafe = CoreTiming::ScheduleEvent_Threadsafe;
|
||||
// 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 = Callback_VideoRequestWindowSize;
|
||||
VideoInitialize.pCopiedToXFB = Callback_VideoCopiedToXFB;
|
||||
VideoInitialize.pPeekMessages = NULL;
|
||||
VideoInitialize.pUpdateFPSDisplay = NULL;
|
||||
VideoInitialize.pMemoryBase = Memory::base;
|
||||
VideoInitialize.pCoreMessage = Callback_CoreMessage;
|
||||
VideoInitialize.bWii = _CoreParameter.bWii;
|
||||
VideoInitialize.pWindowHandle = _CoreParameter.hMainWindow;
|
||||
VideoInitialize.pLog = Callback_VideoLog;
|
||||
VideoInitialize.pSysMessage = Host_SysMessage;
|
||||
VideoInitialize.pRequestWindowSize = Callback_VideoRequestWindowSize;
|
||||
VideoInitialize.pCopiedToXFB = Callback_VideoCopiedToXFB;
|
||||
VideoInitialize.pPeekMessages = NULL;
|
||||
VideoInitialize.pUpdateFPSDisplay = NULL;
|
||||
VideoInitialize.pMemoryBase = Memory::base;
|
||||
VideoInitialize.pCoreMessage = Callback_CoreMessage;
|
||||
VideoInitialize.bWii = _CoreParameter.bWii;
|
||||
VideoInitialize.bOnThread = _CoreParameter.bCPUThread;
|
||||
VideoInitialize.Fifo_CPUBase = &ProcessorInterface::Fifo_CPUBase;
|
||||
VideoInitialize.Fifo_CPUEnd = &ProcessorInterface::Fifo_CPUEnd;
|
||||
VideoInitialize.Fifo_CPUWritePointer = &ProcessorInterface::Fifo_CPUWritePointer;
|
||||
VideoInitialize.Fifo_CPUBase = &ProcessorInterface::Fifo_CPUBase;
|
||||
VideoInitialize.Fifo_CPUEnd = &ProcessorInterface::Fifo_CPUEnd;
|
||||
VideoInitialize.Fifo_CPUWritePointer = &ProcessorInterface::Fifo_CPUWritePointer;
|
||||
bool aspectWide = _CoreParameter.bWii;
|
||||
if (aspectWide)
|
||||
{
|
||||
@@ -351,7 +351,7 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||
gameIni.Load(_CoreParameter.m_strGameIni.c_str());
|
||||
gameIni.Get("Wii", "Widescreen", &aspectWide, !!SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.AR"));
|
||||
}
|
||||
VideoInitialize.bAutoAspectIs16_9 = aspectWide;
|
||||
VideoInitialize.bAutoAspectIs16_9 = aspectWide;
|
||||
|
||||
Plugins.GetVideo()->Initialize(&VideoInitialize); // Call the dll
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ void SCoreStartupParameter::LoadDefaults()
|
||||
bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
||||
{
|
||||
std::string Region(EUR_DIR);
|
||||
|
||||
|
||||
switch (_BootBS2)
|
||||
{
|
||||
case BOOT_DEFAULT:
|
||||
@@ -123,7 +123,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
||||
PanicAlert("The file you specified (%s) does not exists", m_strFilename.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
std::string Extension;
|
||||
SplitPath(m_strFilename, NULL, NULL, &Extension);
|
||||
if (!strcasecmp(Extension.c_str(), ".gcm") ||
|
||||
@@ -143,7 +143,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
||||
}
|
||||
m_strName = pVolume->GetName();
|
||||
m_strUniqueID = pVolume->GetUniqueID();
|
||||
|
||||
|
||||
// Check if we have a Wii disc
|
||||
bWii = DiscIO::IsVolumeWiiDisc(pVolume);
|
||||
switch (pVolume->GetCountry())
|
||||
@@ -152,7 +152,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
||||
bNTSC = true;
|
||||
Region = USA_DIR;
|
||||
break;
|
||||
|
||||
|
||||
case DiscIO::IVolume::COUNTRY_TAIWAN:
|
||||
case DiscIO::IVolume::COUNTRY_KOREA:
|
||||
// TODO: Should these have their own Region Dir?
|
||||
@@ -160,14 +160,14 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
||||
bNTSC = true;
|
||||
Region = JAP_DIR;
|
||||
break;
|
||||
|
||||
|
||||
case DiscIO::IVolume::COUNTRY_EUROPE:
|
||||
case DiscIO::IVolume::COUNTRY_FRANCE:
|
||||
case DiscIO::IVolume::COUNTRY_ITALY:
|
||||
bNTSC = false;
|
||||
Region = EUR_DIR;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
if (PanicYesNo("Your GCM/ISO file seems to be invalid (invalid country)."
|
||||
"\nContinue with PAL region?"))
|
||||
@@ -177,7 +177,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
||||
break;
|
||||
}else return false;
|
||||
}
|
||||
|
||||
|
||||
delete pVolume;
|
||||
}
|
||||
else if (!strcasecmp(Extension.c_str(), ".elf"))
|
||||
@@ -194,7 +194,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
||||
m_BootType = BOOT_DOL;
|
||||
bNTSC = true;
|
||||
}
|
||||
else if (DiscIO::CNANDContentManager::Access().GetNANDLoader(m_strFilename).IsValid())
|
||||
else if (DiscIO::CNANDContentManager::Access().GetNANDLoader(m_strFilename).IsValid())
|
||||
{
|
||||
const DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(m_strFilename.c_str());
|
||||
const DiscIO::INANDContentLoader& ContentLoader = DiscIO::CNANDContentManager::Access().GetNANDLoader(m_strFilename);
|
||||
|
||||
@@ -37,7 +37,7 @@ enum Hotkey {
|
||||
|
||||
struct SCoreStartupParameter
|
||||
{
|
||||
void * hInstance; // HINSTANCE but we don't want to include <windows.h>
|
||||
void* hInstance; // HINSTANCE but we don't want to include <windows.h>
|
||||
|
||||
// Windows/GUI related
|
||||
void* hMainWindow;
|
||||
@@ -93,12 +93,12 @@ struct SCoreStartupParameter
|
||||
int iHotkeyModifier[NUM_HOTKEYS];
|
||||
|
||||
// Display settings
|
||||
bool bFullscreen, bRenderToMain;
|
||||
std::string strFullscreenResolution;
|
||||
int iRenderWindowXPos, iRenderWindowYPos;
|
||||
int iRenderWindowWidth, iRenderWindowHeight;
|
||||
bool bFullscreen, bRenderToMain;
|
||||
|
||||
int iTheme;
|
||||
int iTheme;
|
||||
int iPosX, iPosY, iWidth, iHeight;
|
||||
|
||||
enum EBootBS2
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "../Core.h"
|
||||
|
||||
CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(u32 _DeviceID, const std::string& _rDeviceName)
|
||||
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
|
||||
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
|
||||
, m_Status(CARD_NOT_EXIST)
|
||||
, m_BlockLength(0)
|
||||
, m_BusWidth(0)
|
||||
@@ -64,9 +64,9 @@ bool CWII_IPC_HLE_Device_sdio_slot0::Open(u32 _CommandAddress, u32 _Mode)
|
||||
}
|
||||
}
|
||||
|
||||
Memory::Write_U32(GetDeviceID(), _CommandAddress + 0x4);
|
||||
Memory::Write_U32(GetDeviceID(), _CommandAddress + 0x4);
|
||||
m_Active = true;
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress, bool _bForce)
|
||||
@@ -82,9 +82,9 @@ bool CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress, bool _bForce)
|
||||
m_BusWidth = 0;
|
||||
|
||||
if (!_bForce)
|
||||
Memory::Write_U32(0, _CommandAddress + 0x4);
|
||||
Memory::Write_U32(0, _CommandAddress + 0x4);
|
||||
m_Active = false;
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// The front SD slot
|
||||
@@ -94,8 +94,8 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
|
||||
|
||||
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
|
||||
u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14);
|
||||
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
|
||||
u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
|
||||
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
|
||||
u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
|
||||
|
||||
// As a safety precaution we fill the out buffer with zeros to avoid
|
||||
// returning nonsense values
|
||||
@@ -163,7 +163,7 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
|
||||
{
|
||||
INFO_LOG(WII_IPC_SD, "IOCTL_SENDCMD 0x%08x", Memory::Read_U32(BufferIn));
|
||||
}
|
||||
ReturnValue = ExecuteCommand(BufferIn, BufferInSize, 0, 0, BufferOut, BufferOutSize);
|
||||
ReturnValue = ExecuteCommand(BufferIn, BufferInSize, 0, 0, BufferOut, BufferOutSize);
|
||||
break;
|
||||
|
||||
case IOCTL_GETSTATUS:
|
||||
@@ -197,7 +197,7 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CWII_IPC_HLE_Device_sdio_slot0::IOCtlV(u32 _CommandAddress)
|
||||
bool CWII_IPC_HLE_Device_sdio_slot0::IOCtlV(u32 _CommandAddress)
|
||||
{
|
||||
// PPC sending commands
|
||||
|
||||
@@ -212,7 +212,7 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtlV(u32 _CommandAddress)
|
||||
}
|
||||
|
||||
u32 ReturnValue = 0;
|
||||
switch(CommandBuffer.Parameter) {
|
||||
switch(CommandBuffer.Parameter) {
|
||||
case IOCTLV_SENDCMD:
|
||||
INFO_LOG(WII_IPC_SD, "IOCTLV_SENDCMD 0x%08x", Memory::Read_U32(CommandBuffer.InBuffer[0].m_Address));
|
||||
ReturnValue = ExecuteCommand(
|
||||
@@ -230,7 +230,7 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtlV(u32 _CommandAddress)
|
||||
|
||||
Memory::Write_U32(ReturnValue, _CommandAddress + 0x4);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize,
|
||||
@@ -251,13 +251,13 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
|
||||
u32 pad0;
|
||||
} req;
|
||||
|
||||
req.command = Memory::Read_U32(_BufferIn + 0);
|
||||
req.type = Memory::Read_U32(_BufferIn + 4);
|
||||
req.resp = Memory::Read_U32(_BufferIn + 8);
|
||||
req.arg = Memory::Read_U32(_BufferIn + 12);
|
||||
req.blocks = Memory::Read_U32(_BufferIn + 16);
|
||||
req.bsize = Memory::Read_U32(_BufferIn + 20);
|
||||
req.addr = Memory::Read_U32(_BufferIn + 24);
|
||||
req.command = Memory::Read_U32(_BufferIn + 0);
|
||||
req.type = Memory::Read_U32(_BufferIn + 4);
|
||||
req.resp = Memory::Read_U32(_BufferIn + 8);
|
||||
req.arg = Memory::Read_U32(_BufferIn + 12);
|
||||
req.blocks = Memory::Read_U32(_BufferIn + 16);
|
||||
req.bsize = Memory::Read_U32(_BufferIn + 20);
|
||||
req.addr = Memory::Read_U32(_BufferIn + 24);
|
||||
req.isDMA = Memory::Read_U32(_BufferIn + 28);
|
||||
req.pad0 = Memory::Read_U32(_BufferIn + 32);
|
||||
|
||||
@@ -431,5 +431,5 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
|
||||
break;
|
||||
}
|
||||
|
||||
return rwFail;
|
||||
return rwFail;
|
||||
}
|
||||
|
||||
@@ -46,15 +46,16 @@ bool g_bPolled = false;
|
||||
int g_numRerecords = 0;
|
||||
std::string g_recordFile;
|
||||
|
||||
void FrameUpdate() {
|
||||
void FrameUpdate()
|
||||
{
|
||||
g_frameCounter++;
|
||||
|
||||
if(!g_bPolled)
|
||||
g_lagCounter++;
|
||||
|
||||
|
||||
if (g_bFrameStep)
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
|
||||
|
||||
// ("framestop") the only purpose of this is to cause interpreter/jit Run() to return temporarily.
|
||||
// after that we set it back to CPU_RUNNING and continue as normal.
|
||||
if (g_bFrameStop)
|
||||
@@ -62,7 +63,7 @@ void FrameUpdate() {
|
||||
|
||||
if(g_framesToSkip)
|
||||
FrameSkipping();
|
||||
|
||||
|
||||
if (g_bAutoFire)
|
||||
g_bFirstKey = !g_bFirstKey;
|
||||
|
||||
@@ -70,35 +71,38 @@ void FrameUpdate() {
|
||||
if(IsRecordingInput())
|
||||
fwrite(g_padStates, sizeof(ControllerState), g_numPads, g_recordfd);
|
||||
else if(IsPlayingInput()) {
|
||||
fread(g_padStates, sizeof(ControllerState), g_numPads, g_recordfd);
|
||||
fread(g_padStates, sizeof(ControllerState), g_numPads, g_recordfd);
|
||||
|
||||
// End of recording
|
||||
if(feof(g_recordfd))
|
||||
EndPlayInput();
|
||||
}
|
||||
|
||||
|
||||
g_bPolled = false;
|
||||
}
|
||||
|
||||
void SetFrameSkipping(unsigned int framesToSkip) {
|
||||
void SetFrameSkipping(unsigned int framesToSkip)
|
||||
{
|
||||
cs_frameSkip.Enter();
|
||||
|
||||
|
||||
g_framesToSkip = framesToSkip;
|
||||
g_frameSkipCounter = 0;
|
||||
|
||||
|
||||
// Don't forget to re-enable rendering in case it wasn't...
|
||||
// as this won't be changed anymore when frameskip is turned off
|
||||
if (framesToSkip == 0)
|
||||
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(true);
|
||||
|
||||
|
||||
cs_frameSkip.Leave();
|
||||
}
|
||||
|
||||
int FrameSkippingFactor() {
|
||||
int FrameSkippingFactor()
|
||||
{
|
||||
return g_framesToSkip;
|
||||
}
|
||||
|
||||
void SetPolledDevice() {
|
||||
void SetPolledDevice()
|
||||
{
|
||||
g_bPolled = true;
|
||||
}
|
||||
|
||||
@@ -119,15 +123,17 @@ void SetAutoFire(bool bEnabled, u32 keyOne, u32 keyTwo)
|
||||
g_autoSecondKey = keyTwo;
|
||||
} else
|
||||
g_autoFirstKey = g_autoSecondKey = 0;
|
||||
|
||||
|
||||
g_bFirstKey = true;
|
||||
}
|
||||
|
||||
bool IsAutoFiring() {
|
||||
bool IsAutoFiring()
|
||||
{
|
||||
return g_bAutoFire;
|
||||
}
|
||||
|
||||
void SetFrameStepping(bool bEnabled) {
|
||||
void SetFrameStepping(bool bEnabled)
|
||||
{
|
||||
g_bFrameStep = bEnabled;
|
||||
}
|
||||
void SetFrameStopping(bool bEnabled) {
|
||||
@@ -138,18 +144,18 @@ void ModifyController(SPADStatus *PadStatus, int controllerID)
|
||||
{
|
||||
if(controllerID < 0)
|
||||
return;
|
||||
|
||||
|
||||
u32 keyToPress = (g_bFirstKey) ? g_autoFirstKey : g_autoSecondKey;
|
||||
|
||||
if (!keyToPress)
|
||||
return;
|
||||
|
||||
PadStatus->button |= keyToPress;
|
||||
|
||||
|
||||
switch(keyToPress) {
|
||||
default:
|
||||
return;
|
||||
|
||||
|
||||
case PAD_BUTTON_A:
|
||||
PadStatus->analogA = 255;
|
||||
break;
|
||||
@@ -164,7 +170,6 @@ void ModifyController(SPADStatus *PadStatus, int controllerID)
|
||||
PadStatus->triggerRight = 255;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FrameSkipping()
|
||||
@@ -174,9 +179,9 @@ void FrameSkipping()
|
||||
g_frameSkipCounter++;
|
||||
if (g_frameSkipCounter > g_framesToSkip || Core::report_slow(g_frameSkipCounter) == false)
|
||||
g_frameSkipCounter = 0;
|
||||
|
||||
|
||||
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(!g_frameSkipCounter);
|
||||
|
||||
|
||||
cs_frameSkip.Leave();
|
||||
}
|
||||
|
||||
@@ -195,30 +200,30 @@ bool BeginRecordingInput(const char *filename, int controllers)
|
||||
{
|
||||
if(!filename || g_playMode != MODE_NONE || g_recordfd)
|
||||
return false;
|
||||
|
||||
|
||||
if(File::Exists(filename))
|
||||
File::Delete(filename);
|
||||
|
||||
|
||||
g_recordfd = fopen(filename, "wb");
|
||||
if(!g_recordfd) {
|
||||
PanicAlert("Error opening file %s for recording", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Write initial empty header
|
||||
DTMHeader dummy;
|
||||
fwrite(&dummy, sizeof(DTMHeader), 1, g_recordfd);
|
||||
|
||||
|
||||
g_numPads = controllers;
|
||||
g_padStates = new ControllerState[controllers];
|
||||
|
||||
|
||||
g_frameCounter = 0;
|
||||
g_lagCounter = 0;
|
||||
|
||||
|
||||
g_playMode = MODE_RECORDING;
|
||||
|
||||
|
||||
g_recordFile = filename;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -229,31 +234,31 @@ void EndRecordingInput()
|
||||
// Create the real header now and write it
|
||||
DTMHeader header;
|
||||
memset(&header, 0, sizeof(DTMHeader));
|
||||
|
||||
|
||||
header.filetype[0] = 'D'; header.filetype[1] = 'T'; header.filetype[2] = 'M'; header.filetype[3] = 0x1A;
|
||||
strncpy((char *)header.gameID, Core::g_CoreStartupParameter.GetUniqueID().c_str(), 6);
|
||||
header.bWii = Core::g_CoreStartupParameter.bWii;
|
||||
header.numControllers = g_numPads;
|
||||
|
||||
header.bFromSaveState = false; // TODO: add the case where it's true
|
||||
header.numControllers = g_numPads;
|
||||
|
||||
header.bFromSaveState = false; // TODO: add the case where it's true
|
||||
header.frameCount = g_frameCounter;
|
||||
header.lagCount = g_lagCounter;
|
||||
|
||||
// TODO
|
||||
header.uniqueID = 0;
|
||||
header.numRerecords = 0;
|
||||
// header.author;
|
||||
// header.videoPlugin;
|
||||
// header.audioPlugin;
|
||||
// header.padPlugin;
|
||||
|
||||
|
||||
// TODO
|
||||
header.uniqueID = 0;
|
||||
header.numRerecords = 0;
|
||||
// header.author;
|
||||
// header.videoPlugin;
|
||||
// header.audioPlugin;
|
||||
// header.padPlugin;
|
||||
|
||||
fwrite(&header, sizeof(DTMHeader), 1, g_recordfd);
|
||||
|
||||
|
||||
fclose(g_recordfd);
|
||||
g_recordfd = NULL;
|
||||
|
||||
|
||||
delete[] g_padStates;
|
||||
|
||||
|
||||
g_playMode = MODE_NONE;
|
||||
}
|
||||
|
||||
@@ -262,27 +267,27 @@ void RecordInput(SPADStatus *PadStatus, int controllerID)
|
||||
if(!IsRecordingInput() || controllerID >= g_numPads || controllerID < 0)
|
||||
return;
|
||||
|
||||
g_padStates[controllerID].A = ((PadStatus->button & PAD_BUTTON_A) != 0);
|
||||
g_padStates[controllerID].B = ((PadStatus->button & PAD_BUTTON_B) != 0);
|
||||
g_padStates[controllerID].X = ((PadStatus->button & PAD_BUTTON_X) != 0);
|
||||
g_padStates[controllerID].Y = ((PadStatus->button & PAD_BUTTON_Y) != 0);
|
||||
g_padStates[controllerID].Z = ((PadStatus->button & PAD_TRIGGER_Z) != 0);
|
||||
g_padStates[controllerID].A = ((PadStatus->button & PAD_BUTTON_A) != 0);
|
||||
g_padStates[controllerID].B = ((PadStatus->button & PAD_BUTTON_B) != 0);
|
||||
g_padStates[controllerID].X = ((PadStatus->button & PAD_BUTTON_X) != 0);
|
||||
g_padStates[controllerID].Y = ((PadStatus->button & PAD_BUTTON_Y) != 0);
|
||||
g_padStates[controllerID].Z = ((PadStatus->button & PAD_TRIGGER_Z) != 0);
|
||||
g_padStates[controllerID].Start = ((PadStatus->button & PAD_BUTTON_START) != 0);
|
||||
|
||||
g_padStates[controllerID].DPadUp = ((PadStatus->button & PAD_BUTTON_UP) != 0);
|
||||
|
||||
g_padStates[controllerID].DPadUp = ((PadStatus->button & PAD_BUTTON_UP) != 0);
|
||||
g_padStates[controllerID].DPadDown = ((PadStatus->button & PAD_BUTTON_DOWN) != 0);
|
||||
g_padStates[controllerID].DPadLeft = ((PadStatus->button & PAD_BUTTON_LEFT) != 0);
|
||||
g_padStates[controllerID].DPadRight = ((PadStatus->button & PAD_BUTTON_RIGHT) != 0);
|
||||
|
||||
|
||||
g_padStates[controllerID].L = PadStatus->triggerLeft;
|
||||
g_padStates[controllerID].R = PadStatus->triggerRight;
|
||||
|
||||
|
||||
g_padStates[controllerID].AnalogStickX = PadStatus->stickX;
|
||||
g_padStates[controllerID].AnalogStickY = PadStatus->stickY;
|
||||
|
||||
|
||||
g_padStates[controllerID].CStickX = PadStatus->substickX;
|
||||
g_padStates[controllerID].CStickY = PadStatus->substickY;
|
||||
|
||||
|
||||
PlayController(PadStatus, controllerID);
|
||||
}
|
||||
|
||||
@@ -290,23 +295,23 @@ bool PlayInput(const char *filename)
|
||||
{
|
||||
if(!filename || g_playMode != MODE_NONE || g_recordfd)
|
||||
return false;
|
||||
|
||||
|
||||
if(!File::Exists(filename))
|
||||
return false;
|
||||
|
||||
|
||||
DTMHeader header;
|
||||
|
||||
|
||||
g_recordfd = fopen(filename, "rb");
|
||||
if(!g_recordfd)
|
||||
return false;
|
||||
|
||||
|
||||
fread(&header, sizeof(DTMHeader), 1, g_recordfd);
|
||||
|
||||
|
||||
if(header.filetype[0] != 'D' || header.filetype[1] != 'T' || header.filetype[2] != 'M' || header.filetype[3] != 0x1A) {
|
||||
PanicAlert("Invalid recording file");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
||||
// Load savestate (and skip to frame data)
|
||||
if(header.bFromSaveState) {
|
||||
// TODO
|
||||
@@ -318,22 +323,22 @@ bool PlayInput(const char *filename)
|
||||
PanicAlert("Recording Unique ID Verification Failed");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
||||
if(strncmp((char *)header.gameID, Core::g_CoreStartupParameter.GetUniqueID().c_str(), 6)) {
|
||||
PanicAlert("The recorded game (%s) is not the same as the selected game (%s)", header.gameID, Core::g_CoreStartupParameter.GetUniqueID().c_str());
|
||||
goto cleanup;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
g_numPads = header.numControllers;
|
||||
g_padStates = new ControllerState[g_numPads];
|
||||
g_numRerecords = header.numRerecords;
|
||||
g_recordFile = filename;
|
||||
|
||||
|
||||
g_playMode = MODE_PLAYING;
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
cleanup:
|
||||
fclose(g_recordfd);
|
||||
g_recordfd = NULL;
|
||||
@@ -344,11 +349,11 @@ void PlayController(SPADStatus *PadStatus, int controllerID)
|
||||
{
|
||||
if(!IsPlayingInput() || controllerID >= g_numPads || controllerID < 0)
|
||||
return;
|
||||
|
||||
|
||||
memset(PadStatus, 0, sizeof(SPADStatus));
|
||||
|
||||
|
||||
PadStatus->button |= PAD_USE_ORIGIN;
|
||||
|
||||
|
||||
if(g_padStates[controllerID].A) {
|
||||
PadStatus->button |= PAD_BUTTON_A;
|
||||
PadStatus->analogA = 0xFF;
|
||||
@@ -365,7 +370,7 @@ void PlayController(SPADStatus *PadStatus, int controllerID)
|
||||
PadStatus->button |= PAD_TRIGGER_Z;
|
||||
if(g_padStates[controllerID].Start)
|
||||
PadStatus->button |= PAD_BUTTON_START;
|
||||
|
||||
|
||||
if(g_padStates[controllerID].DPadUp)
|
||||
PadStatus->button |= PAD_BUTTON_UP;
|
||||
if(g_padStates[controllerID].DPadDown)
|
||||
@@ -374,17 +379,17 @@ void PlayController(SPADStatus *PadStatus, int controllerID)
|
||||
PadStatus->button |= PAD_BUTTON_LEFT;
|
||||
if(g_padStates[controllerID].DPadRight)
|
||||
PadStatus->button |= PAD_BUTTON_RIGHT;
|
||||
|
||||
|
||||
PadStatus->triggerLeft = g_padStates[controllerID].L;
|
||||
if(PadStatus->triggerLeft > 230)
|
||||
PadStatus->button |= PAD_TRIGGER_L;
|
||||
PadStatus->triggerRight = g_padStates[controllerID].R;
|
||||
if(PadStatus->triggerRight > 230)
|
||||
PadStatus->button |= PAD_TRIGGER_R;
|
||||
|
||||
|
||||
PadStatus->stickX = g_padStates[controllerID].AnalogStickX;
|
||||
PadStatus->stickY = g_padStates[controllerID].AnalogStickY;
|
||||
|
||||
|
||||
PadStatus->substickX = g_padStates[controllerID].CStickX;
|
||||
PadStatus->substickY = g_padStates[controllerID].CStickY;
|
||||
}
|
||||
|
||||
@@ -108,8 +108,6 @@ CPluginManager::~CPluginManager()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Init and Shutdown Plugins
|
||||
// ------------
|
||||
// Function: Point the m_pad[] and other variables to a certain plugin
|
||||
@@ -122,10 +120,6 @@ bool CPluginManager::InitPlugins()
|
||||
}
|
||||
strcpy(m_PluginGlobals->game_ini, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
|
||||
strcpy(m_PluginGlobals->unique_id, SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID().c_str());
|
||||
if (!GetDSP()) {
|
||||
PanicAlert("Can't init DSP Plugin");
|
||||
return false;
|
||||
}
|
||||
INFO_LOG(CONSOLE, "Before GetVideo\n");
|
||||
|
||||
if (!GetVideo()) {
|
||||
@@ -134,6 +128,10 @@ bool CPluginManager::InitPlugins()
|
||||
}
|
||||
INFO_LOG(CONSOLE, "After GetVideo\n");
|
||||
|
||||
if (!GetDSP()) {
|
||||
PanicAlert("Can't init DSP Plugin");
|
||||
return false;
|
||||
}
|
||||
// Check if we get at least one pad or wiimote
|
||||
bool pad = false;
|
||||
bool wiimote = false;
|
||||
@@ -291,7 +289,7 @@ void *CPluginManager::LoadPlugin(const char *_rFilename)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PLUGIN_TYPE type = info->GetPluginInfo().Type;
|
||||
PLUGIN_TYPE type = info->GetPluginInfo().Type;
|
||||
Common::CPlugin *plugin = NULL;
|
||||
|
||||
switch (type)
|
||||
@@ -379,8 +377,6 @@ void CPluginManager::ScanForPlugins()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create or return the already created plugin pointers. This will be called
|
||||
often for the Pad and Wiimote from the SI_.cpp files. And often for the DSP
|
||||
from the DSP files.
|
||||
@@ -442,7 +438,7 @@ Common::PluginVideo *CPluginManager::GetVideo()
|
||||
// Check if the video plugin has been changed
|
||||
if (m_video->GetFilename() == m_params->m_strVideoPlugin)
|
||||
return m_video;
|
||||
// Then free the current video plugin,
|
||||
// Then free the current video plugin
|
||||
else
|
||||
FreeVideo();
|
||||
}
|
||||
@@ -475,7 +471,7 @@ void CPluginManager::FreePad(u32 Pad)
|
||||
if (Pad < MAXPADS)
|
||||
{
|
||||
delete m_pad[Pad];
|
||||
m_pad[Pad] = NULL;
|
||||
m_pad[Pad] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -484,7 +480,7 @@ void CPluginManager::FreeWiimote(u32 Wiimote)
|
||||
if (Wiimote < MAXWIIMOTES)
|
||||
{
|
||||
delete m_wiimote[Wiimote];
|
||||
m_wiimote[Wiimote] = NULL;
|
||||
m_wiimote[Wiimote] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,7 +490,7 @@ void CPluginManager::EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
GetDSP()->EmuStateChange(newState);
|
||||
//TODO: OpenConfig below only uses GetXxx(0) aswell
|
||||
// Would we need to call all plugins?
|
||||
// If yes, how would one check if the plugin was not
|
||||
// If yes, how would one check if the plugin was not
|
||||
// just created by GetXxx(idx) because there was none?
|
||||
GetPad(0)->EmuStateChange(newState);
|
||||
GetWiimote(0)->EmuStateChange(newState);
|
||||
@@ -528,7 +524,7 @@ void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename, PLUGIN_TY
|
||||
GetWiimote(0)->Config((HWND)_Parent);
|
||||
break;
|
||||
default:
|
||||
PanicAlert("Type %d config not supported in plugin %s", Type, _rFilename);
|
||||
PanicAlert("Type %d config not supported in plugin %s", Type, _rFilename);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,7 +537,7 @@ void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYP
|
||||
return;
|
||||
}
|
||||
|
||||
switch(Type)
|
||||
switch(Type)
|
||||
{
|
||||
case PLUGIN_TYPE_VIDEO:
|
||||
GetVideo()->Debug((HWND)_Parent, Show);
|
||||
@@ -550,7 +546,7 @@ void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYP
|
||||
GetDSP()->Debug((HWND)_Parent, Show);
|
||||
break;
|
||||
default:
|
||||
PanicAlert("Type %d debug not supported in plugin %s", Type, _rFilename);
|
||||
PanicAlert("Type %d debug not supported in plugin %s", Type, _rFilename);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,10 +75,10 @@ private:
|
||||
|
||||
CPluginInfos m_PluginInfos;
|
||||
PLUGIN_GLOBALS *m_PluginGlobals;
|
||||
Common::PluginPAD *m_pad[4];
|
||||
Common::PluginVideo *m_video;
|
||||
Common::PluginWiimote *m_wiimote[4];
|
||||
Common::PluginDSP *m_dsp;
|
||||
Common::PluginPAD *m_pad[4];
|
||||
Common::PluginWiimote *m_wiimote[4];
|
||||
|
||||
SCoreStartupParameter * m_params;
|
||||
CPluginManager();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@ public:
|
||||
long style = wxDEFAULT_DIALOG_STYLE);
|
||||
virtual ~CConfigMain();
|
||||
|
||||
void OnClick(wxMouseEvent& event);
|
||||
void OnOk(wxCommandEvent& event);
|
||||
void CloseClick(wxCommandEvent& event);
|
||||
void OnSelectionChanged(wxCommandEvent& event);
|
||||
void OnConfig(wxCommandEvent& event);
|
||||
@@ -47,119 +47,131 @@ public:
|
||||
bool bRefreshList;
|
||||
|
||||
private:
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
wxNotebook* Notebook;
|
||||
wxPanel* GeneralPage;
|
||||
wxPanel* GamecubePage;
|
||||
wxPanel* DisplayPage;
|
||||
wxPanel* WiiPage;
|
||||
wxPanel* PathsPage;
|
||||
wxPanel* PluginsPage;
|
||||
|
||||
wxBoxSizer* sGeneralPage; // General Settings
|
||||
wxCheckBox* ConfirmStop, *UsePanicHandlers, *UseFPSForLimiting;
|
||||
wxChoice* InterfaceLang;
|
||||
wxChoice* Framelimit;
|
||||
wxRadioBox* Theme;
|
||||
|
||||
wxStaticBoxSizer* sbBasic, *sbAdvanced, *sbInterface, *sbDisplay;
|
||||
wxCheckBox* AlwaysHLE_BS2;
|
||||
wxRadioButton* m_RadioInt;
|
||||
wxRadioButton* m_RadioJIT;
|
||||
wxRadioButton* m_RadioJITIL;
|
||||
wxStaticBoxSizer* sbBasic, *sbAdvanced; // Basic and Advanced sections
|
||||
|
||||
// Basic
|
||||
wxCheckBox* CPUThread;
|
||||
wxCheckBox* DSPThread;
|
||||
wxCheckBox* LockThreads;
|
||||
wxCheckBox* SkipIdle;
|
||||
wxCheckBox* EnableCheats;
|
||||
wxChoice* Framelimit;
|
||||
wxCheckBox* UseFPSForLimiting;
|
||||
|
||||
// Advanced
|
||||
wxCheckBox* AlwaysHLE_BS2;
|
||||
wxRadioBox* CPUEngine;
|
||||
wxCheckBox* DSPThread;
|
||||
wxCheckBox* LockThreads;
|
||||
|
||||
// Display settings
|
||||
wxBoxSizer* sDisplayPage;
|
||||
wxCheckBox* HideCursor;
|
||||
wxCheckBox* Fullscreen;
|
||||
|
||||
wxBoxSizer* sDisplayPage; // Display settings
|
||||
wxStaticBoxSizer* sbDisplay, *sbInterface; // Display and Interface sections
|
||||
|
||||
// Display
|
||||
wxChoice* FullscreenResolution;
|
||||
wxSpinCtrl *WindowWidth;
|
||||
wxSpinCtrl *WindowHeight;
|
||||
wxSpinCtrl* WindowWidth, *WindowHeight;
|
||||
wxCheckBox* Fullscreen;
|
||||
wxCheckBox* HideCursor;
|
||||
wxCheckBox* RenderToMain;
|
||||
|
||||
// Interface
|
||||
wxCheckBox* ConfirmStop;
|
||||
wxCheckBox* UsePanicHandlers;
|
||||
wxRadioBox* Theme;
|
||||
wxChoice* InterfaceLang;
|
||||
wxButton* HotkeyConfig;
|
||||
|
||||
wxBoxSizer* sGamecube; // GC settings
|
||||
|
||||
wxBoxSizer* sGamecubePage; // GC settings
|
||||
wxStaticBoxSizer* sbGamecubeIPLSettings;
|
||||
wxGridBagSizer* sGamecubeIPLSettings;
|
||||
wxStaticText* GCSystemLangText;
|
||||
|
||||
// IPL
|
||||
wxChoice* GCSystemLang;
|
||||
wxChoice *GCEXIDevice[3];
|
||||
wxButton *GCMemcardPath[2];
|
||||
wxChoice *GCSIDevice[4];
|
||||
|
||||
wxBoxSizer* sWii; // Wii settings
|
||||
wxStaticBoxSizer* sbWiimoteSettings;
|
||||
wxGridBagSizer* sWiimoteSettings;
|
||||
wxStaticBoxSizer* sbWiiIPLSettings;
|
||||
wxGridBagSizer* sWiiIPLSettings;
|
||||
wxStaticBoxSizer* sbWiiDeviceSettings;
|
||||
wxBoxSizer* sPaths;
|
||||
wxStaticBoxSizer* sbISOPaths;
|
||||
wxBoxSizer* sISOButtons;
|
||||
wxGridBagSizer* sOtherPaths;
|
||||
wxBoxSizer* sPlugins;
|
||||
wxStaticBoxSizer* sbGraphicsPlugin;
|
||||
wxStaticBoxSizer* sbDSPPlugin;
|
||||
wxStaticBoxSizer* sbPadPlugin;
|
||||
wxStaticBoxSizer* sbWiimotePlugin;
|
||||
// Device
|
||||
wxChoice* GCEXIDevice[3];
|
||||
wxButton* GCMemcardPath[2];
|
||||
wxChoice* GCSIDevice[4];
|
||||
|
||||
wxNotebook *Notebook;
|
||||
wxPanel *GeneralPage;
|
||||
wxPanel *DisplayPage;
|
||||
wxPanel *GamecubePage;
|
||||
wxPanel *WiiPage;
|
||||
wxPanel *PathsPage;
|
||||
wxPanel *PluginPage;
|
||||
|
||||
wxButton* m_Close;
|
||||
wxBoxSizer* sWiiPage; // Wii settings
|
||||
wxStaticBoxSizer* sbWiimoteSettings, *sbWiiIPLSettings, *sbWiiDeviceSettings; // Wiimote, Misc and Device sections
|
||||
wxGridBagSizer* sWiimoteSettings, *sWiiIPLSettings;
|
||||
|
||||
FILE* pStream;
|
||||
|
||||
wxStaticText* WiiSensBarPosText;
|
||||
// Wiimote
|
||||
wxChoice* WiiSensBarPos;
|
||||
|
||||
wxCheckBox* WiiScreenSaver; // IPL settings
|
||||
// Misc
|
||||
wxCheckBox* WiiScreenSaver;
|
||||
wxCheckBox* WiiProgressiveScan;
|
||||
wxCheckBox* WiiEuRGB60;
|
||||
wxStaticText* WiiAspectRatioText;
|
||||
wxChoice* WiiAspectRatio;
|
||||
wxStaticText* WiiSystemLangText;
|
||||
wxChoice* WiiSystemLang;
|
||||
|
||||
// Device
|
||||
wxCheckBox* WiiSDCard;
|
||||
wxCheckBox* WiiKeyboard;
|
||||
|
||||
|
||||
wxBoxSizer* sPathsPage; // Paths settings
|
||||
wxStaticBoxSizer* sbISOPaths;
|
||||
wxGridBagSizer* sOtherPaths;
|
||||
|
||||
// ISO Directories
|
||||
wxListBox* ISOPaths;
|
||||
wxCheckBox* RecursiveISOPath;
|
||||
wxButton* AddISOPath;
|
||||
wxButton* RemoveISOPath;
|
||||
wxCheckBox* RecersiveISOPath;
|
||||
wxStaticText* DefaultISOText;
|
||||
|
||||
// DefaultISO, DVD Root, Apploader
|
||||
wxFilePickerCtrl* DefaultISO;
|
||||
wxStaticText* DVDRootText;
|
||||
wxDirPickerCtrl* DVDRoot;
|
||||
wxStaticText* ApploaderPathText;
|
||||
wxFilePickerCtrl* ApploaderPath;
|
||||
|
||||
wxStaticText* PADText;
|
||||
wxButton* PADConfig;
|
||||
wxChoice* PADSelection;
|
||||
wxButton* DSPConfig;
|
||||
wxStaticText* DSPText;
|
||||
wxChoice* DSPSelection;
|
||||
wxButton* GraphicConfig;
|
||||
wxStaticText* GraphicText;
|
||||
wxChoice* GraphicSelection;
|
||||
wxButton* WiimoteConfig;
|
||||
wxStaticText* WiimoteText;
|
||||
wxChoice* WiimoteSelection;
|
||||
|
||||
wxArrayString arrayStringFor_InterfaceLang;
|
||||
wxBoxSizer* sPluginsPage; // Plugins settings
|
||||
wxStaticBoxSizer* sbGraphicsPlugin, *sbDSPPlugin, *sbPadPlugin, *sbWiimotePlugin; // Graphics, DSP, Pad and Wiimote sections
|
||||
|
||||
// Graphics
|
||||
wxChoice* GraphicSelection;
|
||||
wxButton* GraphicConfig;
|
||||
|
||||
// DSP
|
||||
wxChoice* DSPSelection;
|
||||
wxButton* DSPConfig;
|
||||
|
||||
// Pad
|
||||
wxChoice* PADSelection;
|
||||
wxButton* PADConfig;
|
||||
|
||||
// Wiimote
|
||||
wxChoice* WiimoteSelection;
|
||||
wxButton* WiimoteConfig;
|
||||
|
||||
|
||||
wxButton* m_Ok;
|
||||
|
||||
FILE* pStream;
|
||||
|
||||
wxArrayString arrayStringFor_Framelimit;
|
||||
wxArrayString arrayStringFor_CPUEngine;
|
||||
wxArrayString arrayStringFor_Themes;
|
||||
wxArrayString arrayStringFor_InterfaceLang;
|
||||
wxArrayString arrayStringFor_FullscreenResolution;
|
||||
wxArrayString arrayStringFor_GCSystemLang;
|
||||
wxArrayString arrayStringFor_WiiSensBarPos;
|
||||
wxArrayString arrayStringFor_WiiAspectRatio;
|
||||
wxArrayString arrayStringFor_WiiSystemLang;
|
||||
wxArrayString arrayStringFor_ISOPaths;
|
||||
wxArrayString arrayStringFor_Themes;
|
||||
wxArrayString arrayStringFor_FullscreenResolution;
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -171,33 +183,36 @@ private:
|
||||
ID_PATHSPAGE,
|
||||
ID_PLUGINPAGE,
|
||||
|
||||
ID_ALWAYS_HLE_BS2,
|
||||
ID_RADIOJIT,
|
||||
ID_RADIOJITIL,
|
||||
ID_RADIOINT,
|
||||
ID_CPUTHREAD,
|
||||
ID_DSPTHREAD,
|
||||
ID_LOCKTHREADS,
|
||||
ID_IDLESKIP,
|
||||
ID_ENABLECHEATS,
|
||||
ID_FRAMELIMIT_TEXT, ID_FRAMELIMIT,
|
||||
ID_FRAMELIMIT_USEFPSFORLIMITING,
|
||||
|
||||
ID_ALWAYS_HLE_BS2,
|
||||
ID_CPUENGINE,
|
||||
ID_LOCKTHREADS,
|
||||
ID_DSPTHREAD,
|
||||
|
||||
|
||||
ID_INTERFACE_CONFIRMSTOP, // Interface settings
|
||||
ID_INTERFACE_USEPANICHANDLERS,
|
||||
ID_DISPLAY_FULLSCREENRES,
|
||||
ID_DISPLAY_WINDOWWIDTH,
|
||||
ID_DISPLAY_WINDOWHEIGHT,
|
||||
ID_DISPLAY_FULLSCREEN,
|
||||
ID_DISPLAY_HIDECURSOR,
|
||||
ID_DISPLAY_RENDERTOMAIN,
|
||||
ID_HOTKEY_CONFIG,
|
||||
ID_INTERFACE_LANG_TEXT, ID_INTERFACE_LANG,
|
||||
|
||||
// Interface settings
|
||||
ID_INTERFACE_CONFIRMSTOP,
|
||||
ID_INTERFACE_USEPANICHANDLERS,
|
||||
ID_INTERFACE_THEME,
|
||||
ID_FRAMELIMIT_TEXT,
|
||||
ID_FRAMELIMIT,
|
||||
ID_FRAMELIMIT_USEFPSFORLIMITING,
|
||||
ID_INTERFACE_LANG_TEXT, ID_INTERFACE_LANG,
|
||||
ID_HOTKEY_CONFIG,
|
||||
|
||||
|
||||
ID_GC_SRAM_LNG_TEXT,
|
||||
ID_GC_SRAM_LNG,
|
||||
|
||||
ID_GC_EXIDEVICE_SLOTA_TEXT,
|
||||
ID_GC_EXIDEVICE_SLOTA,
|
||||
ID_GC_EXIDEVICE_SLOTA_PATH,
|
||||
@@ -212,8 +227,10 @@ private:
|
||||
ID_GC_SIDEVICE2,
|
||||
ID_GC_SIDEVICE3,
|
||||
|
||||
|
||||
ID_WII_BT_BAR_TEXT,
|
||||
ID_WII_BT_BAR,
|
||||
|
||||
ID_WII_IPL_SSV,
|
||||
ID_WII_IPL_PGS,
|
||||
ID_WII_IPL_E60,
|
||||
@@ -221,13 +238,16 @@ private:
|
||||
ID_WII_IPL_AR,
|
||||
ID_WII_IPL_LNG_TEXT,
|
||||
ID_WII_IPL_LNG,
|
||||
|
||||
ID_WII_SD_CARD,
|
||||
ID_WII_KEYBOARD,
|
||||
|
||||
|
||||
ID_ISOPATHS,
|
||||
ID_RECURSIVEISOPATH,
|
||||
ID_ADDISOPATH,
|
||||
ID_REMOVEISOPATH,
|
||||
ID_RECERSIVEISOPATH,
|
||||
|
||||
ID_DEFAULTISO_TEXT,
|
||||
ID_DEFAULTISO,
|
||||
ID_DVDROOT_TEXT,
|
||||
@@ -235,22 +255,26 @@ private:
|
||||
ID_APPLOADERPATH_TEXT,
|
||||
ID_APPLOADERPATH,
|
||||
|
||||
ID_WIIMOTE_ABOUT,
|
||||
ID_WIIMOTE_CONFIG,
|
||||
ID_WIIMOTE_TEXT,
|
||||
ID_WIIMOTE_CB,
|
||||
ID_PAD_TEXT,
|
||||
ID_PAD_ABOUT ,
|
||||
ID_PAD_CONFIG,
|
||||
ID_PAD_CB,
|
||||
ID_DSP_ABOUT,
|
||||
ID_DSP_CONFIG,
|
||||
|
||||
ID_GRAPHIC_TEXT,
|
||||
ID_GRAPHIC_CB,
|
||||
ID_GRAPHIC_CONFIG,
|
||||
ID_GRAPHIC_ABOUT,
|
||||
|
||||
ID_DSP_TEXT,
|
||||
ID_DSP_CB,
|
||||
ID_GRAPHIC_ABOUT,
|
||||
ID_GRAPHIC_CONFIG,
|
||||
ID_GRAPHIC_TEXT,
|
||||
ID_GRAPHIC_CB
|
||||
ID_DSP_CONFIG,
|
||||
ID_DSP_ABOUT,
|
||||
|
||||
ID_PAD_TEXT,
|
||||
ID_PAD_CB,
|
||||
ID_PAD_CONFIG,
|
||||
ID_PAD_ABOUT,
|
||||
|
||||
ID_WIIMOTE_TEXT,
|
||||
ID_WIIMOTE_CB,
|
||||
ID_WIIMOTE_CONFIG,
|
||||
ID_WIIMOTE_ABOUT
|
||||
};
|
||||
|
||||
void InitializeGUILists();
|
||||
@@ -260,13 +284,20 @@ private:
|
||||
void CreateGUIControls();
|
||||
void UpdateGUI();
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void OnSpin(wxSpinEvent& event);
|
||||
|
||||
void CoreSettingsChanged(wxCommandEvent& event);
|
||||
|
||||
void DisplaySettingsChanged(wxCommandEvent& event);
|
||||
void AddResolutions();
|
||||
void OnSpin(wxSpinEvent& event);
|
||||
|
||||
void GCSettingsChanged(wxCommandEvent& event);
|
||||
void ChooseMemcardPath(std::string& strMemcard, bool isSlotA);
|
||||
void ChooseSIDevice(std::string deviceName, int deviceNum);
|
||||
void ChooseEXIDevice(std::string deviceName, int deviceNum);
|
||||
|
||||
void WiiSettingsChanged(wxCommandEvent& event);
|
||||
|
||||
void ISOPathsSelectionChanged(wxCommandEvent& event);
|
||||
void RecursiveDirectoryChanged(wxCommandEvent& event);
|
||||
void AddRemoveISOPaths(wxCommandEvent& event);
|
||||
@@ -277,6 +308,6 @@ private:
|
||||
void FillChoiceBox(wxChoice* _pChoice, int _PluginType, const std::string& _SelectFilename);
|
||||
void CallConfig(wxChoice* _pChoice);
|
||||
bool GetFilename(wxChoice* _pChoice, std::string& _rFilename);
|
||||
void AddResolutions();
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -357,7 +357,6 @@ CFrame::CFrame(wxFrame* parent,
|
||||
#if wxUSE_TIMER
|
||||
, m_timer(this)
|
||||
#endif
|
||||
|
||||
{
|
||||
if (ShowLogWindow) SConfig::GetInstance().m_InterfaceLogWindow = true;
|
||||
|
||||
@@ -616,7 +615,7 @@ void CFrame::OnMove(wxMoveEvent& event)
|
||||
event.Skip();
|
||||
|
||||
if (!IsMaximized() &&
|
||||
!(SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && RendererIsFullscreen()))
|
||||
!(SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && RendererIsFullscreen()))
|
||||
{
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iPosX = GetPosition().x;
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iPosY = GetPosition().y;
|
||||
@@ -627,7 +626,7 @@ void CFrame::OnResize(wxSizeEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
if (!IsMaximized() &&
|
||||
!(SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && RendererIsFullscreen()))
|
||||
!(SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && RendererIsFullscreen()))
|
||||
{
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth = GetSize().GetWidth();
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iHeight = GetSize().GetHeight();
|
||||
@@ -745,7 +744,7 @@ bool CFrame::RendererHasFocus()
|
||||
// Host_RendererHasFocus()?
|
||||
if (m_RenderParent)
|
||||
if (m_RenderParent->GetParent()->GetHWND() == GetForegroundWindow())
|
||||
return true;
|
||||
return true;
|
||||
return false;
|
||||
#else
|
||||
return m_RenderParent && (m_RenderParent == wxWindow::FindFocus());
|
||||
@@ -930,15 +929,17 @@ wxFrame * CFrame::CreateParentFrame(wxWindowID Id, const wxString& Title, wxWind
|
||||
Frame->Show();
|
||||
return Frame;
|
||||
}
|
||||
|
||||
wxPanel* CFrame::CreateEmptyPanel(wxWindowID Id)
|
||||
{
|
||||
wxPanel* Panel = new wxPanel(this, Id);
|
||||
return Panel;
|
||||
{
|
||||
wxPanel* Panel = new wxPanel(this, Id);
|
||||
return Panel;
|
||||
}
|
||||
|
||||
wxAuiNotebook* CFrame::CreateEmptyNotebook()
|
||||
{
|
||||
wxAuiNotebook* NB = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, NOTEBOOK_STYLE);
|
||||
return NB;
|
||||
{
|
||||
wxAuiNotebook* NB = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, NOTEBOOK_STYLE);
|
||||
return NB;
|
||||
}
|
||||
|
||||
void CFrame::DoFullscreen(bool bF)
|
||||
@@ -1034,22 +1035,22 @@ void CFrame::ListChildren()
|
||||
|
||||
void CFrame::ListTopWindows()
|
||||
{
|
||||
wxWindowList::const_iterator i;
|
||||
wxWindowList::const_iterator i;
|
||||
int j = 0;
|
||||
const wxWindowList::const_iterator end = wxTopLevelWindows.end();
|
||||
const wxWindowList::const_iterator end = wxTopLevelWindows.end();
|
||||
|
||||
for (i = wxTopLevelWindows.begin(); i != end; ++i)
|
||||
{
|
||||
wxTopLevelWindow * const Win = wx_static_cast(wxTopLevelWindow *, *i);
|
||||
for (i = wxTopLevelWindows.begin(); i != end; ++i)
|
||||
{
|
||||
wxTopLevelWindow * const Win = wx_static_cast(wxTopLevelWindow *, *i);
|
||||
NOTICE_LOG(CONSOLE, "%i: %i %s", j, Win, (const char *)Win->GetTitle().mb_str());
|
||||
/*
|
||||
if ( win->ShouldPreventAppExit() )
|
||||
{
|
||||
// there remains at least one important TLW, don't exit
|
||||
return false;
|
||||
}
|
||||
if ( win->ShouldPreventAppExit() )
|
||||
{
|
||||
// there remains at least one important TLW, don't exit
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
j++;
|
||||
}
|
||||
}
|
||||
NOTICE_LOG(CONSOLE, "\n");
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ wxString CFrame::GetMenuLabel(int Id)
|
||||
void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar)
|
||||
{
|
||||
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
|
||||
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
|
||||
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
|
||||
ToolBar->SetToolBitmapSize(wxSize(w, h));
|
||||
|
||||
|
||||
@@ -549,7 +549,7 @@ void CFrame::OnOpen(wxCommandEvent& WXUNUSED (event))
|
||||
|
||||
void CFrame::DoOpen(bool Boot)
|
||||
{
|
||||
std::string currentDir = File::GetCurrentDir();
|
||||
std::string currentDir = File::GetCurrentDir();
|
||||
|
||||
wxString path = wxFileSelector(
|
||||
_T("Select the file to load"),
|
||||
@@ -565,13 +565,13 @@ void CFrame::DoOpen(bool Boot)
|
||||
|
||||
bool fileChosen = !path.IsEmpty();
|
||||
|
||||
std::string currentDir2 = File::GetCurrentDir();
|
||||
std::string currentDir2 = File::GetCurrentDir();
|
||||
|
||||
if (currentDir != currentDir2)
|
||||
{
|
||||
PanicAlert("Current dir changed from %s to %s after wxFileSelector!",currentDir.c_str(),currentDir2.c_str());
|
||||
File::SetCurrentDir(currentDir.c_str());
|
||||
}
|
||||
if (currentDir != currentDir2)
|
||||
{
|
||||
PanicAlert("Current dir changed from %s to %s after wxFileSelector!",currentDir.c_str(),currentDir2.c_str());
|
||||
File::SetCurrentDir(currentDir.c_str());
|
||||
}
|
||||
|
||||
|
||||
// Should we boot a new game or just change the disc?
|
||||
@@ -1311,7 +1311,7 @@ void CFrame::UpdateGUI()
|
||||
}
|
||||
else
|
||||
{
|
||||
// Game has been loaded, enable the play button
|
||||
// Game has been loaded, enable the pause button
|
||||
if (m_ToolBar)
|
||||
m_ToolBar->EnableTool(IDM_PLAY, true);
|
||||
GetMenuBar()->FindItem(IDM_PLAY)->Enable(true);
|
||||
@@ -1424,4 +1424,3 @@ void CFrame::OnToggleStatusbar(wxCommandEvent& event)
|
||||
|
||||
this->SendSizeEvent();
|
||||
}
|
||||
|
||||
|
||||
@@ -189,25 +189,25 @@ bool DolphinApp::OnInit()
|
||||
return false;
|
||||
}
|
||||
#if wxCHECK_VERSION(2, 9, 0)
|
||||
UseDebugger = parser.Found("debugger");
|
||||
UseLogger = parser.Found("logger");
|
||||
LoadElf = parser.Found("elf", &ElfFile);
|
||||
UseDebugger = parser.Found(wxT("debugger"));
|
||||
UseLogger = parser.Found(wxT("logger"));
|
||||
LoadElf = parser.Found(wxT("elf"), &ElfFile);
|
||||
#else
|
||||
UseDebugger = parser.Found(_("debugger"));
|
||||
UseLogger = parser.Found(_("logger"));
|
||||
LoadElf = parser.Found(_("elf"), &ElfFile);
|
||||
UseDebugger = parser.Found(wxT("debugger"));
|
||||
UseLogger = parser.Found(wxT("logger"));
|
||||
LoadElf = parser.Found(wxT("elf"), &ElfFile);
|
||||
#endif
|
||||
|
||||
#if wxCHECK_VERSION(2, 9, 0)
|
||||
selectVideoPlugin = parser.Found("video_plugin", &videoPluginFilename);
|
||||
selectAudioPlugin = parser.Found("audio_plugin", &audioPluginFilename);
|
||||
selectPadPlugin = parser.Found("pad_plugin", &padPluginFilename);
|
||||
selectWiimotePlugin = parser.Found("wiimote_plugin", &wiimotePluginFilename);
|
||||
selectVideoPlugin = parser.Found(wxT("video_plugin"), &videoPluginFilename);
|
||||
selectAudioPlugin = parser.Found(wxT("audio_plugin"), &audioPluginFilename);
|
||||
selectPadPlugin = parser.Found(wxT"pad_plugin", &padPluginFilename);
|
||||
selectWiimotePlugin = parser.Found(wxT("wiimote_plugin"), &wiimotePluginFilename);
|
||||
#else
|
||||
selectVideoPlugin = parser.Found(_T("video_plugin"), &videoPluginFilename);
|
||||
selectAudioPlugin = parser.Found(_T("audio_plugin"), &audioPluginFilename);
|
||||
selectVideoPlugin = parser.Found(wxT("video_plugin"), &videoPluginFilename);
|
||||
selectAudioPlugin = parser.Found(wxT("audio_plugin"), &audioPluginFilename);
|
||||
selectPadPlugin = parser.Found(_T("pad_plugin"), &padPluginFilename);
|
||||
selectWiimotePlugin = parser.Found(_T("wiimote_plugin"), &wiimotePluginFilename);
|
||||
selectWiimotePlugin = parser.Found(wxT("wiimote_plugin"), &wiimotePluginFilename);
|
||||
#endif
|
||||
#endif // wxUSE_CMDLINE_PARSER
|
||||
|
||||
@@ -324,21 +324,21 @@ bool DolphinApp::OnInit()
|
||||
File::CopyDir(SHARED_USER_DIR WII_USER_DIR DIR_SEP, File::GetUserPath(D_WIIUSER_IDX));
|
||||
|
||||
if (!File::Exists(File::GetUserPath(D_GCUSER_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_CACHE_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_CACHE_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_CACHE_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_DUMPDSP_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_DUMPTEXTURES_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_HIRESTEXTURES_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_SCREENSHOTS_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_SCREENSHOTS_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_SCREENSHOTS_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_STATESAVES_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_STATESAVES_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_STATESAVES_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_MAILLOGS_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_MAILLOGS_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_MAILLOGS_IDX));
|
||||
#endif
|
||||
|
||||
LogManager::Init();
|
||||
@@ -352,7 +352,7 @@ bool DolphinApp::OnInit()
|
||||
|
||||
if (selectAudioPlugin && audioPluginFilename != wxEmptyString)
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin =
|
||||
std::string(audioPluginFilename.mb_str());
|
||||
std::string(audioPluginFilename.mb_str());
|
||||
|
||||
if (selectPadPlugin && padPluginFilename != wxEmptyString)
|
||||
{
|
||||
@@ -367,7 +367,7 @@ bool DolphinApp::OnInit()
|
||||
int k;
|
||||
for(k=0;k<MAXWIIMOTES;k++)
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[k] =
|
||||
std::string(wiimotePluginFilename.mb_str());
|
||||
std::string(wiimotePluginFilename.mb_str());
|
||||
}
|
||||
|
||||
// Enable the PNG image handler
|
||||
@@ -378,12 +378,10 @@ bool DolphinApp::OnInit()
|
||||
// Create the window title
|
||||
#ifdef _DEBUG
|
||||
const char *title = "Dolphin Debug SVN R " SVN_REV_STR;
|
||||
#else
|
||||
#ifdef DEBUGFAST
|
||||
#elif defined DEBUGFAST
|
||||
const char *title = "Dolphin Debugfast SVN R " SVN_REV_STR;
|
||||
#else
|
||||
const char *title = "Dolphin SVN R " SVN_REV_STR;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int x = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosX;
|
||||
@@ -406,9 +404,9 @@ bool DolphinApp::OnInit()
|
||||
wxPoint(x, y), wxSize(w, h), UseDebugger, UseLogger);
|
||||
|
||||
// ------------
|
||||
// Check the autoboot options.
|
||||
// Check the autoboot options.
|
||||
|
||||
// First check if we have an elf command line.
|
||||
// First check if we have an elf command line.
|
||||
if (LoadElf && ElfFile != wxEmptyString)
|
||||
{
|
||||
main_frame->BootGame(std::string(ElfFile.mb_str()));
|
||||
@@ -493,7 +491,7 @@ void Host_SysMessage(const char *fmt, ...)
|
||||
|
||||
bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/)
|
||||
{
|
||||
return wxYES == wxMessageBox(wxString::FromAscii(text),
|
||||
return wxYES == wxMessageBox(wxString::FromAscii(text),
|
||||
wxString::FromAscii(caption),
|
||||
(yes_no)?wxYES_NO:wxOK);
|
||||
}
|
||||
|
||||
@@ -455,7 +455,7 @@ std::string Joystick::Axis::GetName() const
|
||||
{
|
||||
std::ostringstream ss;
|
||||
// axis
|
||||
if ( m_index < 6 )
|
||||
if ( m_index < 6 )
|
||||
{
|
||||
ss << "Axis " << "XYZ"[m_index%3];
|
||||
if ( m_index > 2 )
|
||||
|
||||
@@ -56,7 +56,7 @@ bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &_NumPads, int &_
|
||||
|
||||
// Get device status
|
||||
int numjoy = SDL_NumJoysticks();
|
||||
for (int i = 0; i < numjoy; i++ )
|
||||
for (int i = 0; i < numjoy; i++)
|
||||
{
|
||||
CONTROLLER_INFO Tmp;
|
||||
|
||||
@@ -97,16 +97,16 @@ bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &_NumPads, int &_
|
||||
|
||||
// Avoid extreme axis values
|
||||
// ---------------------
|
||||
/* Function: We have to avoid very big values to becuse some triggers are -0x8000 in the
|
||||
/* Function: We have to avoid very big values because some triggers are -0x8000 in the
|
||||
unpressed state (and then go from -0x8000 to 0x8000 as they are fully pressed) */
|
||||
bool AvoidValues(int value, bool NoTriggerFilter)
|
||||
{
|
||||
// Avoid detecting very small or very big (for triggers) values
|
||||
if( (value > -0x1000 && value < 0x1000) // Small values
|
||||
if((value > -0x1000 && value < 0x1000) // Small values
|
||||
|| ((value < -0x7000 || value > 0x7000) && !NoTriggerFilter)) // Big values
|
||||
return true; // Avoid
|
||||
else
|
||||
return false; // Keep
|
||||
return false; // Keep
|
||||
}
|
||||
|
||||
|
||||
@@ -141,14 +141,14 @@ void GetButton(SDL_Joystick *joy, int ControllerID, int buttons, int axes, int h
|
||||
if(Hat)
|
||||
{
|
||||
for(int i = 0; i < hats; i++)
|
||||
{
|
||||
{
|
||||
value = SDL_JoystickGetHat(joy, i);
|
||||
if(value)
|
||||
{
|
||||
pressed = i;
|
||||
type = InputCommon::CTL_HAT;
|
||||
Succeed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ void GetButton(SDL_Joystick *joy, int ControllerID, int buttons, int axes, int h
|
||||
if(Button)
|
||||
{
|
||||
for(int i = 0; i < buttons; i++)
|
||||
{
|
||||
{
|
||||
// Some kind of bug in SDL 1.3 would give button 9 and 10 (nonexistent) the value 48 on the 360 pad
|
||||
if (SDL_JoystickGetButton(joy, i) > 1) continue;
|
||||
|
||||
@@ -174,7 +174,7 @@ void GetButton(SDL_Joystick *joy, int ControllerID, int buttons, int axes, int h
|
||||
if(XInput && LeftRight)
|
||||
{
|
||||
for(int i = 0; i <= InputCommon::XI_TRIGGER_R; i++)
|
||||
{
|
||||
{
|
||||
if(XInput::GetXI(ControllerID, i))
|
||||
{
|
||||
pressed = i + 1000;
|
||||
@@ -209,7 +209,7 @@ void GetButton(SDL_Joystick *joy, int ControllerID, int buttons, int axes, int h
|
||||
}
|
||||
// Only accept the escape key
|
||||
else if (KeyboardKey == WXK_ESCAPE)
|
||||
{
|
||||
{
|
||||
Succeed = true;
|
||||
KeyboardKey = 0;
|
||||
pressed = -1;
|
||||
|
||||
@@ -48,9 +48,10 @@ namespace XInput
|
||||
|
||||
struct CONTROLER_STATE
|
||||
{
|
||||
XINPUT_STATE state;
|
||||
bool bConnected;
|
||||
XINPUT_STATE state;
|
||||
bool bConnected;
|
||||
};
|
||||
|
||||
CONTROLER_STATE g_Controllers[MAX_CONTROLLERS];
|
||||
|
||||
|
||||
@@ -61,33 +62,32 @@ CONTROLER_STATE g_Controllers[MAX_CONTROLLERS];
|
||||
we currently only try to connect to XInput device 0 */
|
||||
void Init()
|
||||
{
|
||||
// Init state
|
||||
//ZeroMemory( g_Controllers, sizeof( CONTROLER_STATE ) * MAX_CONTROLLERS );
|
||||
// Init state
|
||||
//ZeroMemory( g_Controllers, sizeof( CONTROLER_STATE ) * MAX_CONTROLLERS );
|
||||
|
||||
// Declaration
|
||||
DWORD dwResult;
|
||||
|
||||
// Calculate the number of connected XInput devices
|
||||
for( DWORD i = 0; i < MAX_CONTROLLERS; i++ )
|
||||
{
|
||||
// Simply get the state of the controller from XInput.
|
||||
dwResult = XInputGetState( i, &g_Controllers[i].state );
|
||||
{
|
||||
// Simply get the state of the controller from XInput.
|
||||
dwResult = XInputGetState( i, &g_Controllers[i].state );
|
||||
|
||||
if( dwResult == ERROR_SUCCESS )
|
||||
g_Controllers[i].bConnected = true;
|
||||
else
|
||||
g_Controllers[i].bConnected = false;
|
||||
}
|
||||
|
||||
}
|
||||
if( dwResult == ERROR_SUCCESS )
|
||||
g_Controllers[i].bConnected = true;
|
||||
else
|
||||
g_Controllers[i].bConnected = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Get the trigger status
|
||||
// -------------------
|
||||
int GetXI(int Controller, int Button)
|
||||
{
|
||||
// Update the internal status
|
||||
DWORD dwResult;
|
||||
DWORD dwResult;
|
||||
dwResult = XInputGetState(Controller, &g_Controllers[Controller].state);
|
||||
|
||||
if (dwResult != ERROR_SUCCESS) return -1;
|
||||
@@ -105,7 +105,6 @@ int GetXI(int Controller, int Button)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if a certain controller is connected
|
||||
// -------------------
|
||||
bool IsConnected(int Controller)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user