New Wiimote Plugin Config GUI
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3676 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
8c6c18823f
commit
c921fe1c13
|
@ -525,18 +525,6 @@
|
|||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Debugging"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Src\Logging.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\Logging.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Emulated Wiimote"
|
||||
>
|
||||
|
@ -621,21 +609,44 @@
|
|||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\ConfigDlg.cpp"
|
||||
RelativePath=".\Src\ConfigBasicDlg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\ConfigDlg.h"
|
||||
RelativePath=".\Src\ConfigBasicDlg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\ConfigGamepad.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\ConfigPadDlg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\ConfigPadDlg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\ConfigRecording.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\ConfigRecordingDlg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\ConfigRecordingDlg.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\Src\main.cpp"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -43,19 +43,18 @@ Config g_Config;
|
|||
Config::Config()
|
||||
{
|
||||
// Set all default values to zero
|
||||
memset(this, 0, sizeof(Config));
|
||||
memset(this, 0, sizeof(Config));
|
||||
}
|
||||
|
||||
void Config::Load(bool ChangePad)
|
||||
{
|
||||
std::string temp;
|
||||
IniFile iniFile;
|
||||
iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini");
|
||||
std::string temp;
|
||||
IniFile iniFile;
|
||||
iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini");
|
||||
|
||||
// General
|
||||
iniFile.Get("Settings", "SidewaysDPad", &bSidewaysDPad, false);
|
||||
iniFile.Get("Settings", "NunchuckConnected", &bNunchuckConnected, false);
|
||||
iniFile.Get("Settings", "ClassicControllerConnected", &bClassicControllerConnected, false);
|
||||
iniFile.Get("Settings", "SidewaysDPad", &bSidewaysDPad, false);
|
||||
iniFile.Get("Settings", "ExtensionConnected", &iExtensionConnected, EXT_NONE);
|
||||
|
||||
// Real Wiimote
|
||||
iniFile.Get("Real", "Connect", &bConnectRealWiimote, true);
|
||||
|
@ -219,11 +218,10 @@ void Config::Load(bool ChangePad)
|
|||
|
||||
void Config::Save(int Slot)
|
||||
{
|
||||
IniFile iniFile;
|
||||
iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini");
|
||||
iniFile.Set("Settings", "SidewaysDPad", bSidewaysDPad);
|
||||
iniFile.Set("Settings", "NunchuckConnected", bNunchuckConnected);
|
||||
iniFile.Set("Settings", "ClassicControllerConnected", bClassicControllerConnected);
|
||||
IniFile iniFile;
|
||||
iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini");
|
||||
iniFile.Set("Settings", "SidewaysDPad", bSidewaysDPad);
|
||||
iniFile.Set("Settings", "ExtensionConnected", iExtensionConnected);
|
||||
|
||||
iniFile.Set("Real", "Connect", bConnectRealWiimote);
|
||||
iniFile.Set("Real", "Use", bUseRealWiimote);
|
||||
|
@ -353,4 +351,4 @@ void Config::Save(int Slot)
|
|||
|
||||
// Logging
|
||||
INFO_LOG(CONSOLE, "Save()\n");
|
||||
}
|
||||
}
|
|
@ -18,12 +18,20 @@
|
|||
#ifndef _PLUGIN_WIIMOTE_CONFIG_H
|
||||
#define _PLUGIN_WIIMOTE_CONFIG_H
|
||||
|
||||
enum
|
||||
{
|
||||
EXT_NONE = 0,
|
||||
EXT_NUNCHUCK,
|
||||
EXT_CLASSIC_CONTROLLER,
|
||||
EXT_GUITARHERO3_CONTROLLER,
|
||||
EXT_GUITARHEROWT_DRUMS,
|
||||
};
|
||||
|
||||
struct Config
|
||||
{
|
||||
Config();
|
||||
void Load(bool ChangePad = false);
|
||||
void Save(int Slot = -1);
|
||||
Config();
|
||||
void Load(bool ChangePad = false);
|
||||
void Save(int Slot = -1);
|
||||
|
||||
struct PadRange
|
||||
{
|
||||
|
@ -81,12 +89,10 @@ struct Config
|
|||
int TType; // Whammy bar
|
||||
};
|
||||
|
||||
// Emulated Wiimote
|
||||
// Emulated Wiimote
|
||||
bool bSidewaysDPad;
|
||||
bool bWideScreen;
|
||||
bool bNunchuckConnected;
|
||||
bool bClassicControllerConnected;
|
||||
bool bGuitarConnected;
|
||||
int iExtensionConnected;
|
||||
|
||||
// Real Wiimote
|
||||
bool bConnectRealWiimote, bUseRealWiimote, bUpdateRealWiimote;
|
||||
|
@ -105,5 +111,4 @@ struct Config
|
|||
};
|
||||
|
||||
extern Config g_Config;
|
||||
|
||||
#endif // _PLUGIN_WIIMOTE_CONFIG_H
|
|
@ -0,0 +1,484 @@
|
|||
// Copyright (C) 2003-2009 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/
|
||||
|
||||
#include "CommonTypes.h" // for u16
|
||||
#include "IniFile.h"
|
||||
#include "wiimote_real.h" // Local
|
||||
#include "wiimote_hid.h"
|
||||
#include "main.h"
|
||||
#include "ConfigBasicDlg.h"
|
||||
#include "ConfigPadDlg.h"
|
||||
#include "ConfigRecordingDlg.h"
|
||||
#include "Config.h"
|
||||
#include "EmuMain.h" // for SetDefaultExtensionRegistry
|
||||
#include "EmuSubroutines.h" // for WmRequestStatus
|
||||
|
||||
BEGIN_EVENT_TABLE(WiimoteBasicConfigDialog,wxDialog)
|
||||
EVT_CLOSE(WiimoteBasicConfigDialog::OnClose)
|
||||
EVT_BUTTON(ID_CLOSE, WiimoteBasicConfigDialog::ButtonClick)
|
||||
EVT_BUTTON(ID_APPLY, WiimoteBasicConfigDialog::ButtonClick)
|
||||
EVT_BUTTON(ID_BUTTONMAPPING, WiimoteBasicConfigDialog::ButtonClick)
|
||||
EVT_BUTTON(ID_BUTTONRECORDING, WiimoteBasicConfigDialog::ButtonClick)
|
||||
EVT_CHECKBOX(ID_CONNECT_REAL, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_USE_REAL, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SIDEWAYSDPAD, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
||||
//EVT_CHECKBOX(ID_MOTIONPLUSCONNECTED, WiimoteConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHOICE(ID_EXTCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
||||
EVT_TIMER(IDTM_UPDATE_ONCE, WiimoteBasicConfigDialog::UpdateOnce)
|
||||
EVT_TIMER(IDTM_SHUTDOWN, WiimoteBasicConfigDialog::ShutDown)
|
||||
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
WiimoteBasicConfigDialog::WiimoteBasicConfigDialog(wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
const wxPoint &position, const wxSize& size, long style)
|
||||
: wxDialog(parent, id, title, position, size, style)
|
||||
{
|
||||
#if wxUSE_TIMER
|
||||
m_TimeoutOnce = new wxTimer(this, IDTM_UPDATE_ONCE);
|
||||
m_ShutDownTimer = new wxTimer(this, IDTM_SHUTDOWN);
|
||||
#endif
|
||||
|
||||
ControlsCreated = false;
|
||||
m_bEnableUseRealWiimote = true;
|
||||
Closing = true;
|
||||
Page = 0;
|
||||
g_Config.Load();
|
||||
CreateGUIControls();
|
||||
UpdateGUI();
|
||||
}
|
||||
|
||||
WiimoteBasicConfigDialog::~WiimoteBasicConfigDialog(){}
|
||||
|
||||
void WiimoteBasicConfigDialog::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
g_FrameOpen = false;
|
||||
g_Config.Save();
|
||||
if ((m_PadConfigFrame && m_PadConfigFrame->IsShown()) || (m_RecordingConfigFrame && m_RecordingConfigFrame->IsShown()))
|
||||
{
|
||||
Closing = false;
|
||||
Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
Closing = true;
|
||||
if (m_PadConfigFrame)
|
||||
{
|
||||
m_PadConfigFrame->Close();
|
||||
m_PadConfigFrame = NULL;
|
||||
}
|
||||
if (m_RecordingConfigFrame)
|
||||
{
|
||||
m_RecordingConfigFrame->Close();
|
||||
m_RecordingConfigFrame = NULL;
|
||||
}
|
||||
|
||||
if (!g_EmulatorRunning) Shutdown();
|
||||
}
|
||||
// This will let the Close() function close and remove the wxDialog
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
/* Timeout the shutdown. In Windows at least the g_pReadThread execution will hang at any attempt to
|
||||
call a frame function after the main thread has entered WaitForSingleObject() or any other loop.
|
||||
We must therefore shut down the thread from here and wait for that before we can call ShutDown(). */
|
||||
void WiimoteBasicConfigDialog::ShutDown(wxTimerEvent& WXUNUSED(event))
|
||||
{
|
||||
// Close() is a wxWidgets function that will trigger EVT_CLOSE() and then call this->Destroy().
|
||||
if(!WiiMoteReal::g_ThreadGoing)
|
||||
{
|
||||
m_ShutDownTimer->Stop();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
void WiimoteBasicConfigDialog::ButtonClick(wxCommandEvent& event)
|
||||
{
|
||||
switch(event.GetId())
|
||||
{
|
||||
case ID_CLOSE:
|
||||
// Wait for the Wiimote thread to stop, then close and shutdown
|
||||
if(!g_EmulatorRunning)
|
||||
{
|
||||
WiiMoteReal::g_Shutdown = true;
|
||||
m_ShutDownTimer->Start(10);
|
||||
}
|
||||
// Close directly
|
||||
else
|
||||
{
|
||||
Close();
|
||||
}
|
||||
break;
|
||||
case ID_APPLY:
|
||||
g_Config.Save();
|
||||
break;
|
||||
case ID_BUTTONMAPPING:
|
||||
if (!m_PadConfigFrame)
|
||||
m_PadConfigFrame = new WiimotePadConfigDialog(this);
|
||||
if (!m_PadConfigFrame->IsShown())
|
||||
m_PadConfigFrame->Show();
|
||||
break;
|
||||
case ID_BUTTONRECORDING:
|
||||
if (!m_RecordingConfigFrame)
|
||||
m_RecordingConfigFrame = new WiimoteRecordingConfigDialog(this);
|
||||
|
||||
if (!m_RecordingConfigFrame->IsShown())
|
||||
m_RecordingConfigFrame->Show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Execute a delayed function
|
||||
void WiimoteBasicConfigDialog::UpdateOnce(wxTimerEvent& event)
|
||||
{
|
||||
switch(event.GetId())
|
||||
{
|
||||
case IDTM_UPDATE_ONCE:
|
||||
// Reenable the checkbox
|
||||
m_bEnableUseRealWiimote = true;
|
||||
SetCursor(wxCursor(wxCURSOR_ARROW));
|
||||
UpdateGUI();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void WiimoteBasicConfigDialog::CreateGUIControls()
|
||||
{
|
||||
m_Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
|
||||
|
||||
for (int i = 0; i < MAX_WIIMOTES; i++)
|
||||
{
|
||||
m_Controller[i] = new wxPanel(m_Notebook, ID_CONTROLLERPAGE1 + i, wxDefaultPosition, wxDefaultSize);
|
||||
m_Notebook->AddPage(m_Controller[i], wxString::Format(wxT("Wiimote %d"), i+1));
|
||||
|
||||
m_ConnectRealWiimote[i] = new wxCheckBox(m_Controller[i], ID_CONNECT_REAL, wxT("Connect Real Wiimote"));
|
||||
m_UseRealWiimote[i] = new wxCheckBox(m_Controller[i], ID_USE_REAL, wxT("Use Real Wiimote"));
|
||||
|
||||
m_ConnectRealWiimote[0]->SetValue(g_Config.bConnectRealWiimote);
|
||||
m_UseRealWiimote[0]->SetValue(g_Config.bUseRealWiimote);
|
||||
|
||||
m_ConnectRealWiimote[i]->SetToolTip(wxT("Connected to the real wiimote. This can not be changed during gameplay."));
|
||||
m_UseRealWiimote[i]->SetToolTip(wxT("Use the real Wiimote in the game. This can be changed during gameplay. This can not be selected"
|
||||
" when a recording is to be done. No status in this window will be updated when this is checked."));
|
||||
|
||||
m_SizeReal[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Real Wiimote"));
|
||||
m_SizeReal[i]->Add(m_ConnectRealWiimote[i], 0, wxEXPAND | wxALL, 5);
|
||||
m_SizeReal[i]->Add(m_UseRealWiimote[i], 0, wxEXPAND | wxALL, 5);
|
||||
|
||||
m_WiiMotionPlusConnected[i] = new wxCheckBox(m_Controller[i], wxID_ANY, wxT("Wii Motion Plus Connected"));
|
||||
m_WiiMotionPlusConnected[0]->Enable(false);
|
||||
|
||||
wxArrayString arrayStringFor_extension;
|
||||
arrayStringFor_extension.Add(wxT("None"));
|
||||
arrayStringFor_extension.Add(wxT("Nunchuck"));
|
||||
arrayStringFor_extension.Add(wxT("Classic Controller"));
|
||||
arrayStringFor_extension.Add(wxT("Guitar Hero 3 Guitar"));
|
||||
//arrayStringFor_extension.Add(wxT("Guitar Hero World Tour Drums Connected"));
|
||||
// Prolly needs to be a separate plugin
|
||||
//arrayStringFor_extension.Add(wxT("Balance Board"));
|
||||
|
||||
extensionChoice[i] = new wxChoice(m_Controller[i], wxID_ANY, wxDefaultPosition, wxDefaultSize, arrayStringFor_extension, 0, wxDefaultValidator);
|
||||
extensionChoice[i]->SetSelection(0);
|
||||
|
||||
m_SizeExtensions[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Emulated Extension"));
|
||||
m_SizeExtensions[i]->Add(m_WiiMotionPlusConnected[i], 0, wxEXPAND | wxALL, 5);
|
||||
m_SizeExtensions[i]->Add(extensionChoice[i], 0, wxEXPAND | wxALL, 5);
|
||||
|
||||
m_SizeBasicGeneralLeft[i] = new wxBoxSizer(wxVERTICAL);
|
||||
m_SizeBasicGeneralLeft[i]->Add(m_SizeReal[i], 0, wxEXPAND | wxALL, 5);
|
||||
m_SizeBasicGeneralLeft[i]->Add(m_SizeExtensions[i], 0, wxEXPAND | wxALL, 5);
|
||||
|
||||
// Basic Settings
|
||||
m_WiimoteOnline[i] = new wxCheckBox(m_Controller[i], IDC_WIMOTE_ON, wxT("Wiimote On"));
|
||||
m_WiimoteOnline[i]->SetValue(true);
|
||||
m_WiimoteOnline[i]->Enable(false);
|
||||
m_WiimoteOnline[i]->SetToolTip(wxString::Format(wxT("Decide if Wiimote %i shall be detected by the game"), i));
|
||||
|
||||
m_SizeBasic[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("General Settings"));
|
||||
m_SizeBasic[i]->Add(m_WiimoteOnline[i], 0, wxEXPAND | wxALL, 5);
|
||||
|
||||
// Emulated Wiimote
|
||||
m_SidewaysDPad[i] = new wxCheckBox(m_Controller[i], ID_SIDEWAYSDPAD, wxT("Sideways D-Pad"));
|
||||
m_SidewaysDPad[i]->SetValue(g_Config.bSidewaysDPad);
|
||||
|
||||
m_SizeEmu[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Emulated Wiimote"));
|
||||
m_SizeEmu[i]->Add(m_SidewaysDPad[i], 0, wxEXPAND | wxALL, 5);
|
||||
|
||||
//IR Pointer
|
||||
m_TextScreenWidth[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Width: 000"));
|
||||
m_TextScreenHeight[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Height: 000"));
|
||||
m_TextScreenLeft[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Left: 000"));
|
||||
m_TextScreenTop[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Top: 000"));
|
||||
|
||||
m_SliderWidth[i] = new wxSlider(m_Controller[i], IDS_WIDTH, 0, 100, 923, wxDefaultPosition, wxSize(75, -1));
|
||||
m_SliderHeight[i] = new wxSlider(m_Controller[i], IDS_HEIGHT, 0, 0, 727, wxDefaultPosition, wxSize(75, -1));
|
||||
m_SliderLeft[i] = new wxSlider(m_Controller[i], IDS_LEFT, 0, 100, 500, wxDefaultPosition, wxSize(75, -1));
|
||||
m_SliderTop[i] = new wxSlider(m_Controller[i], IDS_TOP, 0, 0, 500, wxDefaultPosition, wxSize(75, -1));
|
||||
|
||||
m_SizerIRPointerWidth[i] = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_SizerIRPointerWidth[i]->Add(m_TextScreenLeft[i], 0, wxEXPAND | (wxTOP), 3);
|
||||
m_SizerIRPointerWidth[i]->Add(m_SliderLeft[i], 0, wxEXPAND | (wxRIGHT), 0);
|
||||
m_SizerIRPointerWidth[i]->Add(m_TextScreenWidth[i], 0, wxEXPAND | (wxTOP), 3);
|
||||
m_SizerIRPointerWidth[i]->Add(m_SliderWidth[i], 0, wxEXPAND | (wxLEFT), 0);
|
||||
m_SizerIRPointerHeight[i] = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_SizerIRPointerHeight[i]->Add(m_TextScreenTop[i], 0, wxEXPAND | (wxTOP), 3);
|
||||
m_SizerIRPointerHeight[i]->Add(m_SliderTop[i], 0, wxEXPAND | (wxRIGHT), 0);
|
||||
m_SizerIRPointerHeight[i]->Add(m_TextScreenHeight[i], 0, wxEXPAND | (wxTOP), 3);
|
||||
m_SizerIRPointerHeight[i]->Add(m_SliderHeight[i], 0, wxEXPAND | (wxLEFT), 0);
|
||||
|
||||
//m_ScreenSize = new wxCheckBox(m_Controller[i], IDC_SCREEN_SIZE, wxT("Adjust screen size and position"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
//m_ScreenSize[i]->SetToolTip(wxT("Use the adjusted screen size."));
|
||||
|
||||
// These are changed from the graphics plugin settings, so they are just here to show the loaded status
|
||||
m_TextAR[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Aspect Ratio"));
|
||||
m_CheckAR43[i] = new wxCheckBox(m_Controller[i], wxID_ANY, wxT("4:3"), wxDefaultPosition, wxSize(-1, -1), 0, wxDefaultValidator);
|
||||
m_CheckAR169[i] = new wxCheckBox(m_Controller[i], wxID_ANY, wxT("16:9"), wxDefaultPosition, wxSize(-1, -1), 0, wxDefaultValidator);
|
||||
m_Crop[i] = new wxCheckBox(m_Controller[i], wxID_ANY, wxT("Crop"), wxDefaultPosition, wxSize(-1, -1), 0, wxDefaultValidator);
|
||||
|
||||
m_CheckAR43[i]->SetValue(g_Config.bKeepAR43);
|
||||
m_CheckAR169[i]->SetValue(g_Config.bKeepAR169);
|
||||
m_Crop[i]->SetValue(g_Config.bCrop);
|
||||
|
||||
m_TextAR[i]->Enable(false);
|
||||
m_CheckAR43[i]->Enable(false);
|
||||
m_CheckAR169[i]->Enable(false);
|
||||
m_Crop[i]->Enable(false);
|
||||
|
||||
m_SizerIRPointerScreen[i] = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_SizerIRPointerScreen[i]->Add(m_TextAR[i], 0, wxEXPAND | (wxTOP), 0);
|
||||
m_SizerIRPointerScreen[i]->Add(m_CheckAR43[i], 0, wxEXPAND | (wxLEFT), 5);
|
||||
m_SizerIRPointerScreen[i]->Add(m_CheckAR169[i], 0, wxEXPAND | (wxLEFT), 5);
|
||||
m_SizerIRPointerScreen[i]->Add(m_Crop[i], 0, wxEXPAND | (wxLEFT), 5);
|
||||
|
||||
m_SizerIRPointer[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("IR pointer"));
|
||||
//m_SizerIRPointer[i]->Add(m_ScreenSize[i], 0, wxEXPAND | (wxALL), 5);
|
||||
m_SizerIRPointer[i]->Add(m_SizerIRPointerWidth[i], 0, wxEXPAND | (wxLEFT | wxDOWN | wxRIGHT), 5);
|
||||
m_SizerIRPointer[i]->Add(m_SizerIRPointerHeight[i], 0, wxEXPAND | (wxLEFT | wxDOWN | wxRIGHT), 5);
|
||||
m_SizerIRPointer[i]->Add(m_SizerIRPointerScreen[i], 0, wxEXPAND | (wxLEFT | wxDOWN | wxRIGHT), 5);
|
||||
|
||||
m_SizeBasicGeneralRight[i] = new wxBoxSizer(wxVERTICAL);
|
||||
m_SizeBasicGeneralRight[i]->Add(m_SizeBasic[i], 0, wxEXPAND | (wxUP), 0);
|
||||
m_SizeBasicGeneralRight[i]->Add(m_SizeEmu[i], 0, wxEXPAND | (wxUP), 5);
|
||||
m_SizeBasicGeneralRight[i]->Add(m_SizerIRPointer[i], 0, wxEXPAND | (wxUP), 5);
|
||||
|
||||
m_SizeBasicGeneral[i] = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_SizeBasicGeneral[i]->Add(m_SizeBasicGeneralLeft[i], 0, wxEXPAND | (wxUP), 0);
|
||||
m_SizeBasicGeneral[i]->Add(m_SizeBasicGeneralRight[i], 0, wxEXPAND | (wxLEFT), 5);
|
||||
|
||||
m_SizeParent[i] = new wxBoxSizer(wxVERTICAL);
|
||||
m_SizeParent[i]->Add(m_SizeBasicGeneral[i], 0, wxBORDER_STATIC | wxEXPAND | (wxALL), 5);
|
||||
// The sizer m_sMain will be expanded inside m_Controller, m_SizeParent will not
|
||||
m_sMain[i] = new wxBoxSizer(wxVERTICAL);
|
||||
m_sMain[i]->Add(m_SizeParent[i]);
|
||||
|
||||
// Set the main sizer
|
||||
m_Controller[i]->SetSizer(m_sMain[i]);
|
||||
}
|
||||
|
||||
m_ButtonMapping = new wxButton(this, ID_BUTTONMAPPING, wxT("Button Mapping"));
|
||||
m_Recording = new wxButton(this, ID_BUTTONRECORDING, wxT("Recording"));
|
||||
m_Apply = new wxButton(this, ID_APPLY, wxT("Apply"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"));
|
||||
m_Close->SetToolTip(wxT("Apply and Close"));
|
||||
|
||||
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
|
||||
sButtons->Add(m_ButtonMapping, 0, (wxALL), 0);
|
||||
sButtons->Add(m_Recording, 0, (wxALL), 0);
|
||||
sButtons->AddStretchSpacer();
|
||||
sButtons->Add(m_Apply, 0, (wxALL), 0);
|
||||
sButtons->Add(m_Close, 0, (wxLEFT), 5);
|
||||
|
||||
m_MainSizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_MainSizer->Add(m_Notebook, 1, wxEXPAND | wxALL, 5);
|
||||
m_MainSizer->Add(sButtons, 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
||||
|
||||
this->SetSizer(m_MainSizer);
|
||||
this->Layout();
|
||||
Fit();
|
||||
|
||||
// Center the window if there is room for it
|
||||
#ifdef _WIN32
|
||||
if (GetSystemMetrics(SM_CYFULLSCREEN) > 800)
|
||||
Center();
|
||||
#endif
|
||||
ControlsCreated = true;
|
||||
}
|
||||
|
||||
void WiimoteBasicConfigDialog::DoConnectReal()
|
||||
{
|
||||
g_Config.bConnectRealWiimote = m_ConnectRealWiimote[Page]->IsChecked();
|
||||
|
||||
if(g_Config.bConnectRealWiimote)
|
||||
{
|
||||
if (!g_RealWiiMoteInitialized) WiiMoteReal::Initialize();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(CONSOLE, "Post Message: %i\n", g_RealWiiMoteInitialized);
|
||||
if (g_RealWiiMoteInitialized)
|
||||
{
|
||||
WiiMoteReal::Shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WiimoteBasicConfigDialog::DoUseReal()
|
||||
{
|
||||
// Clear any eventual events in the Wiimote queue
|
||||
WiiMoteReal::ClearEvents();
|
||||
|
||||
// Are we using an extension now? The report that it's removed, then reconnected.
|
||||
bool UsingExtension = false;
|
||||
if (g_Config.iExtensionConnected != EXT_NONE)
|
||||
UsingExtension = true;
|
||||
|
||||
INFO_LOG(CONSOLE, "\nDoUseReal() Connect extension: %i\n", !UsingExtension);
|
||||
DoExtensionConnectedDisconnected(UsingExtension ? 0 : 1);
|
||||
|
||||
UsingExtension = !UsingExtension;
|
||||
INFO_LOG(CONSOLE, "\nDoUseReal() Connect extension: %i\n", !UsingExtension);
|
||||
DoExtensionConnectedDisconnected(UsingExtension ? 1 : 0);
|
||||
|
||||
if(g_EmulatorRunning)
|
||||
{
|
||||
// Disable the checkbox for a moment
|
||||
SetCursor(wxCursor(wxCURSOR_WAIT));
|
||||
m_bEnableUseRealWiimote = false;
|
||||
// We may not need this if there is already a message queue that allows the nessesary timeout
|
||||
//sleep(100);
|
||||
|
||||
/* Start the timer to allow the approximate time it takes for the Wiimote to come online
|
||||
it would simpler to use sleep(1000) but that doesn't work because we need the functions in main.cpp
|
||||
to work */
|
||||
m_TimeoutOnce->Start(1000, true);
|
||||
}
|
||||
}
|
||||
|
||||
// ===================================================
|
||||
/* Generate connect/disconnect status event */
|
||||
// ----------------
|
||||
void WiimoteBasicConfigDialog::DoExtensionConnectedDisconnected(int Extension)
|
||||
{
|
||||
// There is no need for this if no game is running
|
||||
if(!g_EmulatorRunning) return;
|
||||
|
||||
u8 DataFrame[8]; // make a blank report for it
|
||||
wm_request_status *rs = (wm_request_status*)DataFrame;
|
||||
|
||||
// Check if a game is running, in that case change the status
|
||||
if(WiiMoteEmu::g_ReportingChannel > 0)
|
||||
WiiMoteEmu::WmRequestStatus(WiiMoteEmu::g_ReportingChannel, rs, Extension);
|
||||
}
|
||||
|
||||
|
||||
void WiimoteBasicConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case ID_CONNECT_REAL:
|
||||
DoConnectReal();
|
||||
break;
|
||||
case ID_USE_REAL:
|
||||
// Enable the Wiimote thread
|
||||
g_Config.bUseRealWiimote = m_UseRealWiimote[Page]->IsChecked();
|
||||
if(g_Config.bUseRealWiimote) DoUseReal();
|
||||
break;
|
||||
|
||||
case ID_SIDEWAYSDPAD:
|
||||
g_Config.bSidewaysDPad = m_SidewaysDPad[Page]->IsChecked();
|
||||
break;
|
||||
|
||||
case ID_MOTIONPLUSCONNECTED:
|
||||
break;
|
||||
case ID_EXTCONNECTED:
|
||||
g_Config.iExtensionConnected = EXT_NONE;
|
||||
// Disconnect the extension so that the game recognize the change
|
||||
DoExtensionConnectedDisconnected();
|
||||
// It doesn't seem to be needed but shouldn't it at least take 25 ms to
|
||||
// reconnect an extension after we disconnected another?
|
||||
if(g_EmulatorRunning) SLEEP(25);
|
||||
|
||||
// Update status
|
||||
g_Config.iExtensionConnected = extensionChoice[Page]->GetSelection();
|
||||
|
||||
// Copy the calibration data
|
||||
WiiMoteEmu::SetDefaultExtensionRegistry();
|
||||
|
||||
// Generate connect/disconnect status event
|
||||
DoExtensionConnectedDisconnected();
|
||||
break;
|
||||
}
|
||||
g_Config.Save();
|
||||
UpdateGUI();
|
||||
}
|
||||
|
||||
void WiimoteBasicConfigDialog::IRCursorChanged(wxScrollEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case IDS_WIDTH:
|
||||
g_Config.iIRWidth = m_SliderWidth[Page]->GetValue();
|
||||
break;
|
||||
case IDS_HEIGHT:
|
||||
g_Config.iIRHeight = m_SliderHeight[Page]->GetValue();
|
||||
break;
|
||||
case IDS_LEFT:
|
||||
g_Config.iIRLeft = m_SliderLeft[Page]->GetValue();
|
||||
break;
|
||||
case IDS_TOP:
|
||||
g_Config.iIRTop = m_SliderTop[Page]->GetValue();
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateGUI();
|
||||
}
|
||||
|
||||
void WiimoteBasicConfigDialog::UpdateIRCalibration()
|
||||
{
|
||||
// Update the slider position if a configuration has been loaded
|
||||
m_SliderWidth[Page]->SetValue(g_Config.iIRWidth);
|
||||
m_SliderHeight[Page]->SetValue(g_Config.iIRHeight);
|
||||
m_SliderLeft[Page]->SetValue(g_Config.iIRLeft);
|
||||
m_SliderTop[Page]->SetValue(g_Config.iIRTop);
|
||||
|
||||
// Update the labels
|
||||
m_TextScreenWidth[Page]->SetLabel(wxString::Format(wxT("Width: %i"), g_Config.iIRWidth));
|
||||
m_TextScreenHeight[Page]->SetLabel(wxString::Format(wxT("Height: %i"), g_Config.iIRHeight));
|
||||
m_TextScreenLeft[Page]->SetLabel(wxString::Format(wxT("Left: %i"), g_Config.iIRLeft));
|
||||
m_TextScreenTop[Page]->SetLabel(wxString::Format(wxT("Top: %i"), g_Config.iIRTop));
|
||||
}
|
||||
|
||||
void WiimoteBasicConfigDialog::UpdateGUI(int Slot)
|
||||
{
|
||||
// Update the Wiimote IR pointer calibration
|
||||
UpdateIRCalibration();
|
||||
|
||||
/* We only allow a change of extension if we are not currently using the real Wiimote, if it's in use the status will be updated
|
||||
from the data scanning functions in main.cpp */
|
||||
bool AllowExtensionChange = !(g_RealWiiMotePresent && g_Config.bConnectRealWiimote && g_Config.bUseRealWiimote && g_EmulatorRunning);
|
||||
extensionChoice[Page]->SetSelection(g_Config.iExtensionConnected);
|
||||
extensionChoice[Page]->Enable(AllowExtensionChange);
|
||||
|
||||
/* I have disabled this option during a running game because it's enough to be able to switch
|
||||
between using and not using then. To also use the connect option during a running game would
|
||||
mean that the wiimote must be sent the current reporting mode and the channel ID after it
|
||||
has been initialized. Functions for that are basically already in place so these two options
|
||||
could possibly be simplified to one option. */
|
||||
m_ConnectRealWiimote[Page]->Enable(!g_EmulatorRunning);
|
||||
m_UseRealWiimote[Page]->Enable((m_bEnableUseRealWiimote && g_RealWiiMotePresent && g_Config.bConnectRealWiimote) || (!g_EmulatorRunning && g_Config.bConnectRealWiimote));
|
||||
}
|
|
@ -0,0 +1,156 @@
|
|||
// Copyright (C) 2003-2009 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/
|
||||
|
||||
#ifndef __BASICCONFIGDIALOG_h__
|
||||
#define __BASICCONFIGDIALOG_h__
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/combobox.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/gbsizer.h>
|
||||
|
||||
class WiimoteBasicConfigDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
WiimoteBasicConfigDialog(wxWindow *parent,
|
||||
wxWindowID id = 1,
|
||||
const wxString &title = wxT("Wii Remote Plugin Configuration"),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE | wxWANTS_CHARS);
|
||||
virtual ~WiimoteBasicConfigDialog();
|
||||
|
||||
// General open, close and event functions
|
||||
void ButtonClick(wxCommandEvent& event);
|
||||
void UpdateGUI(int Slot = 0);
|
||||
void UpdateIRCalibration();
|
||||
void ShutDown(wxTimerEvent& WXUNUSED(event));
|
||||
void UpdateOnce(wxTimerEvent& event);
|
||||
|
||||
// Timers
|
||||
wxTimer *m_TimeoutOnce,
|
||||
*m_ShutDownTimer;
|
||||
wxCheckBox *m_UseRealWiimote[4];
|
||||
|
||||
bool Closing;
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
bool ControlsCreated,
|
||||
m_bEnableUseRealWiimote;
|
||||
int Page;
|
||||
|
||||
wxNotebook *m_Notebook;
|
||||
wxPanel *m_Controller[4];
|
||||
wxButton *m_Close,
|
||||
*m_Apply,
|
||||
*m_ButtonMapping,
|
||||
*m_Recording;
|
||||
|
||||
wxBoxSizer *m_MainSizer,
|
||||
*m_sMain[4],
|
||||
*m_SizeParent[4];
|
||||
|
||||
wxSlider *m_SliderWidth[4],
|
||||
*m_SliderHeight[4],
|
||||
*m_SliderLeft[4],
|
||||
*m_SliderTop[4];
|
||||
|
||||
// Emulated Wiimote settings
|
||||
wxCheckBox *m_SidewaysDPad[4],
|
||||
*m_WiimoteOnline[4],
|
||||
*m_WiiMotionPlusConnected[4],
|
||||
*m_CheckAR43[4],
|
||||
*m_CheckAR169[4],
|
||||
*m_Crop[4];
|
||||
|
||||
wxStaticText *m_TextScreenWidth[4],
|
||||
*m_TextScreenHeight[4],
|
||||
*m_TextScreenLeft[4],
|
||||
*m_TextScreenTop[4],
|
||||
*m_TextAR[4];
|
||||
wxBoxSizer *m_SizeBasicGeneral[4],
|
||||
*m_SizeBasicGeneralLeft[4],
|
||||
*m_SizeBasicGeneralRight[4],
|
||||
*m_SizerIRPointerWidth[4],
|
||||
*m_SizerIRPointerHeight[4],
|
||||
*m_SizerIRPointerScreen[4];
|
||||
|
||||
wxStaticBoxSizer *m_SizeBasic[4],
|
||||
*m_SizeEmu[4],
|
||||
*m_SizeReal[4],
|
||||
*m_SizeExtensions[4],
|
||||
*m_SizerIRPointer[4];
|
||||
|
||||
wxChoice* extensionChoice[4];
|
||||
|
||||
// Real Wiimote settings
|
||||
wxCheckBox *m_ConnectRealWiimote[4];
|
||||
|
||||
enum
|
||||
{
|
||||
ID_CLOSE = 1000,
|
||||
ID_APPLY,
|
||||
ID_BUTTONMAPPING,
|
||||
ID_BUTTONRECORDING,
|
||||
IDTM_SHUTDOWN,
|
||||
IDTM_UPDATE,
|
||||
IDTM_UPDATE_ONCE,
|
||||
|
||||
ID_NOTEBOOK,
|
||||
ID_CONTROLLERPAGE1,
|
||||
ID_CONTROLLERPAGE2,
|
||||
ID_CONTROLLERPAGE3,
|
||||
ID_CONTROLLERPAGE4,
|
||||
|
||||
// Emulated Wiimote
|
||||
ID_SIDEWAYSDPAD,
|
||||
ID_MOTIONPLUSCONNECTED,
|
||||
ID_EXTCONNECTED,
|
||||
IDC_WIMOTE_ON,
|
||||
|
||||
IDS_WIDTH,
|
||||
IDS_HEIGHT,
|
||||
IDS_LEFT,
|
||||
IDS_TOP,
|
||||
|
||||
// Real
|
||||
ID_CONNECT_REAL,
|
||||
ID_USE_REAL,
|
||||
};
|
||||
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void CreateGUIControls();
|
||||
void GeneralSettingsChanged(wxCommandEvent& event);
|
||||
void IRCursorChanged(wxScrollEvent& event);
|
||||
|
||||
void DoConnectReal(); // Real
|
||||
void DoUseReal();
|
||||
|
||||
void DoExtensionConnectedDisconnected(int Extension = -1); // Emulated
|
||||
};
|
||||
|
||||
extern WiimoteBasicConfigDialog *m_BasicConfigFrame;
|
||||
#endif
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -15,11 +15,6 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
//#include "Common.h" // for u16
|
||||
#include "CommonTypes.h" // for u16
|
||||
#include "IniFile.h"
|
||||
#include "Timer.h"
|
||||
|
@ -27,21 +22,18 @@
|
|||
#include "wiimote_real.h" // Local
|
||||
#include "wiimote_hid.h"
|
||||
#include "main.h"
|
||||
#include "ConfigDlg.h"
|
||||
#include "ConfigPadDlg.h"
|
||||
#include "Config.h"
|
||||
#include "EmuMain.h" // for LoadRecordedMovements()
|
||||
#include "EmuSubroutines.h" // for WmRequestStatus
|
||||
#include "EmuDefinitions.h" // for joyinfo
|
||||
//////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Change Joystick
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
/* Function: When changing the joystick we save and load the settings and update the PadMapping
|
||||
and PadState array. PadState[].joy is the gamepad handle that is used to access the pad throughout
|
||||
the plugin. Joyinfo[].joy is only used the first time the pads are checked. */
|
||||
void WiimoteConfigDialog::DoChangeJoystick()
|
||||
void WiimotePadConfigDialog::DoChangeJoystick()
|
||||
{
|
||||
// Close the current pad, unless it's used by another slot
|
||||
//if (PadMapping[notebookpage].enabled) PadClose(notebookpage);
|
||||
|
@ -56,7 +48,7 @@ void WiimoteConfigDialog::DoChangeJoystick()
|
|||
// Open the new pad
|
||||
if (WiiMoteEmu::PadMapping[Page].enabled) PadOpen(Page);
|
||||
}
|
||||
void WiimoteConfigDialog::PadOpen(int Open) // Open for slot 1, 2, 3 or 4
|
||||
void WiimotePadConfigDialog::PadOpen(int Open) // Open for slot 1, 2, 3 or 4
|
||||
{
|
||||
// Check that we got a good pad
|
||||
if (!WiiMoteEmu::joyinfo.at(WiiMoteEmu::PadMapping[Open].ID).Good)
|
||||
|
@ -69,13 +61,13 @@ void WiimoteConfigDialog::PadOpen(int Open) // Open for slot 1, 2, 3 or 4
|
|||
INFO_LOG(CONSOLE, "Update the Slot %i handle to Id %i\n", Page, WiiMoteEmu::PadMapping[Open].ID);
|
||||
WiiMoteEmu::PadState[Open].joy = SDL_JoystickOpen(WiiMoteEmu::PadMapping[Open].ID);
|
||||
}
|
||||
void WiimoteConfigDialog::PadClose(int Close) // Close for slot 1, 2, 3 or 4
|
||||
void WiimotePadConfigDialog::PadClose(int Close) // Close for slot 1, 2, 3 or 4
|
||||
{
|
||||
if (SDL_JoystickOpened(WiiMoteEmu::PadMapping[Close].ID)) SDL_JoystickClose(WiiMoteEmu::PadState[Close].joy);
|
||||
WiiMoteEmu::PadState[Close].joy = NULL;
|
||||
}
|
||||
|
||||
void WiimoteConfigDialog::DoChangeDeadZone(bool Left)
|
||||
void WiimotePadConfigDialog::DoChangeDeadZone(bool Left)
|
||||
{
|
||||
if(Left)
|
||||
{
|
||||
|
@ -104,7 +96,7 @@ void WiimoteConfigDialog::DoChangeDeadZone(bool Left)
|
|||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
|
||||
// Set the button text for all four Wiimotes
|
||||
void WiimoteConfigDialog::SetButtonTextAll(int id, char text[128])
|
||||
void WiimotePadConfigDialog::SetButtonTextAll(int id, char text[128])
|
||||
{
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
|
@ -116,7 +108,7 @@ void WiimoteConfigDialog::SetButtonTextAll(int id, char text[128])
|
|||
}
|
||||
|
||||
|
||||
void WiimoteConfigDialog::SaveButtonMappingAll(int Slot)
|
||||
void WiimotePadConfigDialog::SaveButtonMappingAll(int Slot)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
|
@ -129,7 +121,7 @@ void WiimoteConfigDialog::SaveButtonMappingAll(int Slot)
|
|||
|
||||
// Set dialog items from saved values
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
void WiimoteConfigDialog::UpdateGUIButtonMapping(int controller)
|
||||
void WiimotePadConfigDialog::UpdateGUIButtonMapping(int controller)
|
||||
{
|
||||
// Temporary storage
|
||||
wxString tmp;
|
||||
|
@ -215,7 +207,7 @@ void WiimoteConfigDialog::UpdateGUIButtonMapping(int controller)
|
|||
/* Populate the PadMapping array with the dialog items settings (for example
|
||||
selected joystick, enabled or disabled status and so on) */
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
void WiimoteConfigDialog::SaveButtonMapping(int controller, bool DontChangeId, int FromSlot)
|
||||
void WiimotePadConfigDialog::SaveButtonMapping(int controller, bool DontChangeId, int FromSlot)
|
||||
{
|
||||
// Temporary storage
|
||||
wxString tmp;
|
||||
|
@ -263,7 +255,7 @@ void WiimoteConfigDialog::SaveButtonMapping(int controller, bool DontChangeId, i
|
|||
}
|
||||
|
||||
// Save keyboard key mapping
|
||||
void WiimoteConfigDialog::SaveKeyboardMapping(int Controller, int Id, int Key)
|
||||
void WiimotePadConfigDialog::SaveKeyboardMapping(int Controller, int Id, int Key)
|
||||
{
|
||||
switch(Id)
|
||||
{
|
||||
|
@ -323,7 +315,7 @@ void WiimoteConfigDialog::SaveKeyboardMapping(int Controller, int Id, int Key)
|
|||
|
||||
// Replace the harder to understand -1 with "" for the sake of user friendliness
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
void WiimoteConfigDialog::ToBlank(bool ToBlank)
|
||||
void WiimotePadConfigDialog::ToBlank(bool ToBlank)
|
||||
{
|
||||
if (!ControlsCreated) return;
|
||||
|
||||
|
@ -352,7 +344,7 @@ void WiimoteConfigDialog::ToBlank(bool ToBlank)
|
|||
|
||||
// Update the textbox for the buttons
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
void WiimoteConfigDialog::SetButtonText(int id, char text[128], int _Page)
|
||||
void WiimotePadConfigDialog::SetButtonText(int id, char text[128], int _Page)
|
||||
{
|
||||
// Set controller value
|
||||
int controller;
|
||||
|
@ -424,7 +416,7 @@ void WiimoteConfigDialog::SetButtonText(int id, char text[128], int _Page)
|
|||
|
||||
// Get the text in the textbox for the buttons
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
wxString WiimoteConfigDialog::GetButtonText(int id, int _Page)
|
||||
wxString WiimotePadConfigDialog::GetButtonText(int id, int _Page)
|
||||
{
|
||||
//INFO_LOG(CONSOLE, "GetButtonText: %i\n", id);
|
||||
|
||||
|
@ -462,12 +454,12 @@ wxString WiimoteConfigDialog::GetButtonText(int id, int _Page)
|
|||
is that we start another parallel loop (at least in Windows) that blocks the old loop. And our only
|
||||
option to wait for the old loop to finish is with a new loop, and that will block the old loop for as
|
||||
long as it's going on. Therefore a timer is easier to control. */
|
||||
void WiimoteConfigDialog::GetButtons(wxCommandEvent& event)
|
||||
void WiimotePadConfigDialog::GetButtons(wxCommandEvent& event)
|
||||
{
|
||||
DoGetButtons(event.GetId());
|
||||
}
|
||||
|
||||
void WiimoteConfigDialog::DoGetButtons(int GetId)
|
||||
void WiimotePadConfigDialog::DoGetButtons(int GetId)
|
||||
{
|
||||
// =============================================
|
||||
// Collect the starting values
|
||||
|
@ -642,7 +634,7 @@ void WiimoteConfigDialog::DoGetButtons(int GetId)
|
|||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
|
||||
// Convert the 0x8000 range values to BoxW and BoxH for the plot
|
||||
void WiimoteConfigDialog::Convert2Box(int &x)
|
||||
void WiimotePadConfigDialog::Convert2Box(int &x)
|
||||
{
|
||||
// Border adjustment
|
||||
int BoxW_ = BoxW - 2; int BoxH_ = BoxH - 2;
|
||||
|
@ -653,7 +645,7 @@ void WiimoteConfigDialog::Convert2Box(int &x)
|
|||
|
||||
// Update the input status boxes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
void WiimoteConfigDialog::PadGetStatus()
|
||||
void WiimotePadConfigDialog::PadGetStatus()
|
||||
{
|
||||
//INFO_LOG(CONSOLE, "SDL_WasInit: %i\n", SDL_WasInit(0));
|
||||
|
||||
|
@ -819,7 +811,7 @@ void WiimoteConfigDialog::PadGetStatus()
|
|||
|
||||
// Populate the advanced tab
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
void WiimoteConfigDialog::UpdatePad(wxTimerEvent& WXUNUSED(event))
|
||||
void WiimotePadConfigDialog::UpdatePad(wxTimerEvent& WXUNUSED(event))
|
||||
{
|
||||
// Show the current status
|
||||
/*
|
||||
|
@ -833,4 +825,4 @@ void WiimoteConfigDialog::UpdatePad(wxTimerEvent& WXUNUSED(event))
|
|||
|
||||
PadGetStatus();
|
||||
}
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -15,14 +15,13 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef __CONFIGDIALOG_h__
|
||||
#define __CONFIGDIALOG_h__
|
||||
#ifndef __PADCONFIGDIALOG_h__
|
||||
#define __PADCONFIGDIALOG_h__
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/stattext.h>
|
||||
|
@ -30,84 +29,136 @@
|
|||
#include <wx/checkbox.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/filepicker.h>
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/progdlg.h>
|
||||
|
||||
class WiimoteConfigDialog : public wxDialog
|
||||
class WiimotePadConfigDialog : public wxFrame
|
||||
{
|
||||
public:
|
||||
WiimoteConfigDialog(wxWindow *parent,
|
||||
WiimotePadConfigDialog(wxWindow *parent,
|
||||
wxWindowID id = 1,
|
||||
const wxString &title = wxT("Wii Remote Plugin Configuration"),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE | wxWANTS_CHARS);
|
||||
virtual ~WiimoteConfigDialog();
|
||||
virtual ~WiimotePadConfigDialog(){;}
|
||||
|
||||
// General open, close and event functions
|
||||
void CloseClick(wxCommandEvent& event);
|
||||
void UpdateGUI(int Slot = 0); void UpdateGUIButtonMapping(int controller); void UpdateControls();
|
||||
void UpdateGUI(int Slot = 0);
|
||||
void UpdateGUIButtonMapping(int controller);
|
||||
void UpdateControls();
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
void LoadFile(); void SaveFile();
|
||||
|
||||
// Timers
|
||||
wxTimer *m_TimeoutTimer, *m_ShutDownTimer, *m_TimeoutOnce, *m_ButtonMappingTimer, *m_UpdatePad;
|
||||
|
||||
// General status
|
||||
wxStaticText * m_TextUpdateRate;
|
||||
|
||||
// Wiimote status
|
||||
wxGauge *m_GaugeBattery, *m_GaugeRoll[2], *m_GaugeGForce[3], *m_GaugeAccel[3];
|
||||
wxStaticBitmap *m_bmpDotLeftIn[4], *m_bmpDotLeftOut[4], *m_bmpDotRightIn[4], *m_bmpDotRightOut[4],
|
||||
*m_bmpDeadZoneLeftIn[4], *m_bmpDeadZoneRightIn[4];
|
||||
wxStaticText *m_TextIR;
|
||||
bool m_bWaitForRecording, m_bRecording, m_bAllowA;
|
||||
int m_iRecordTo;
|
||||
void RecordMovement(wxCommandEvent& event);
|
||||
void DoRecordMovement(int _x, int _y, int _z, const u8 *_IR, int IRBytes);
|
||||
void DoRecordA(bool Pressed);
|
||||
void Convert2Box(int &x);
|
||||
void ConvertToString();
|
||||
void Update(wxTimerEvent& WXUNUSED(event));
|
||||
void ShutDown(wxTimerEvent& WXUNUSED(event));
|
||||
void UpdateOnce(wxTimerEvent& event);
|
||||
|
||||
// Gamepad configuration
|
||||
void OnButtonTimer(wxTimerEvent& WXUNUSED(event)) { DoGetButtons(GetButtonWaitingID); }
|
||||
void UpdatePad(wxTimerEvent& WXUNUSED(event));
|
||||
|
||||
wxTimer *m_UpdatePad,
|
||||
*m_ButtonMappingTimer;
|
||||
|
||||
wxStaticBitmap *m_bmpDotLeftIn[4],
|
||||
*m_bmpDotLeftOut[4],
|
||||
*m_bmpDotRightIn[4],
|
||||
*m_bmpDotRightOut[4],
|
||||
*m_bmpDeadZoneLeftIn[4],
|
||||
*m_bmpDeadZoneRightIn[4];
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
bool ControlsCreated, m_bEnableUseRealWiimote; int Page, BoxW, BoxH, g_Pressed;
|
||||
bool ControlsCreated;
|
||||
int Page, BoxW, BoxH, g_Pressed;
|
||||
|
||||
wxNotebook *m_Notebook;
|
||||
wxPanel *m_Controller[4], *m_PageRecording;
|
||||
wxButton *m_About, *m_Close, *m_Apply;
|
||||
wxBoxSizer *m_MainSizer, *m_sMain[4], *m_SizeParent[4], *m_sRecordingMain;
|
||||
wxPanel *m_Controller[4];
|
||||
wxButton *m_Close,
|
||||
*m_Apply;
|
||||
wxBoxSizer *m_MainSizer,
|
||||
*m_sMain[4],
|
||||
*m_SizeParent[4];
|
||||
|
||||
wxCheckBox *m_CheckC2S[4],
|
||||
*m_TiltInvertRoll[4],
|
||||
*m_TiltInvertPitch[4];
|
||||
|
||||
// Emulated Wiimote key settings
|
||||
wxBoxSizer *m_SizerIRPointerWidth[4], *m_SizerIRPointerHeight[4], *m_SizerIRPointerScreen[4],
|
||||
*m_SizeBasicPadding[4], *m_SizeEmuPadding[4], *m_SizeRealPadding[4], *m_SizeExtensionsPadding[4],
|
||||
*m_SizeBasicGeneral[4], *m_SizeBasicGeneralLeft[4], *m_SizeBasicGeneralRight[4],
|
||||
*m_HorizControllers[4], *m_gC2SDeadZone[4], *m_gCircle2Square[4], *m_gCircle2SquareVert[4], *m_gDeadZone[4], *m_gDeadZoneHoriz[4], *m_HorizControllerTiltParent[4], *m_HorizControllerTilt[4], *m_TiltHoriz[4],
|
||||
*m_SizeAnalogLeft[4], *m_SizeAnalogLeftHorizX[4], *m_SizeAnalogLeftHorizY[4], *m_SizeAnalogRight[4], *m_SizeAnalogRightHorizX[4], *m_SizeAnalogRightHorizY[4],
|
||||
*m_SizeAnalogTriggerVertLeft[4], *m_SizeAnalogTriggerVertRight[4], *m_SizeAnalogTriggerHorizInput[4],
|
||||
// Nunchuck
|
||||
*m_SNcShake[4], *m_SNcZ[4], *m_SNcC[4], *m_SNcL[4], *m_SNcR[4], *m_SNcU[4], *m_SNcD[4],
|
||||
// Wiimote
|
||||
*m_SWmVertLeft[4], *m_SWmVertRight[4], *m_SWmShake[4], *m_SWmPitchL[4], *m_SWmPitchR[4], *m_SWmA[4], *m_SWmB[4], *m_SWm1[4], *m_SWm2[4], *m_SWmP[4], *m_SWmM[4], *m_SWmH[4], *m_SWmL[4], *m_SWmR[4], *m_SWmU[4], *m_SWmD[4],
|
||||
*m_HorizControllerMapping[4], *m_NunchuckStick[4],
|
||||
// Classic Controller
|
||||
*m_SCcVertLeft[4], *m_SCcVertMiddle[4], *m_SCcVertRight[4],
|
||||
*m_SCcLeftStick[4], *m_SCcRightStick[4], *m_SCcTriggers[4],
|
||||
*m_SCcA[4], *m_SCcB[4], *m_SCcX[4], *m_SCcY[4],
|
||||
*m_SCcP[4], *m_SCcM[4], *m_SCcH[4],
|
||||
*m_SCcTl[4], *m_SCcZl[4], *m_SCcZr[4], *m_SCcTr[4],
|
||||
*m_SCcDl[4], *m_SCcDu[4], *m_SCcDr[4], *m_SCcDd[4],
|
||||
*m_SCcLl[4], *m_SCcLu[4], *m_SCcLr[4], *m_SCcLd[4],
|
||||
*m_SCcRl[4], *m_SCcRu[4], *m_SCcRr[4], *m_SCcRd[4];
|
||||
wxBoxSizer *m_HorizControllers[4],
|
||||
*m_gC2SDeadZone[4],
|
||||
*m_gCircle2Square[4],
|
||||
*m_gCircle2SquareVert[4],
|
||||
*m_gDeadZone[4],
|
||||
*m_gDeadZoneHoriz[4],
|
||||
*m_HorizControllerTiltParent[4],
|
||||
*m_HorizControllerTilt[4],
|
||||
*m_TiltHoriz[4],
|
||||
*m_SizeAnalogLeft[4],
|
||||
*m_SizeAnalogLeftHorizX[4],
|
||||
*m_SizeAnalogLeftHorizY[4],
|
||||
*m_SizeAnalogRight[4],
|
||||
*m_SizeAnalogRightHorizX[4],
|
||||
*m_SizeAnalogRightHorizY[4],
|
||||
*m_SizeAnalogTriggerVertLeft[4],
|
||||
*m_SizeAnalogTriggerVertRight[4],
|
||||
*m_SizeAnalogTriggerHorizInput[4];
|
||||
|
||||
// Nunchuck
|
||||
wxBoxSizer *m_SNcShake[4],
|
||||
*m_SNcZ[4],
|
||||
*m_SNcC[4],
|
||||
*m_SNcL[4],
|
||||
*m_SNcR[4],
|
||||
*m_SNcU[4],
|
||||
*m_SNcD[4];
|
||||
|
||||
// Wiimote
|
||||
wxBoxSizer *m_SWmVertLeft[4],
|
||||
*m_SWmVertRight[4],
|
||||
*m_SWmShake[4],
|
||||
*m_SWmPitchL[4],
|
||||
*m_SWmPitchR[4],
|
||||
*m_SWmA[4],
|
||||
*m_SWmB[4],
|
||||
*m_SWm1[4],
|
||||
*m_SWm2[4],
|
||||
*m_SWmP[4],
|
||||
*m_SWmM[4],
|
||||
*m_SWmH[4],
|
||||
*m_SWmL[4],
|
||||
*m_SWmR[4],
|
||||
*m_SWmU[4],
|
||||
*m_SWmD[4],
|
||||
*m_HorizControllerMapping[4],
|
||||
*m_NunchuckStick[4];
|
||||
|
||||
// Classic Controller
|
||||
wxBoxSizer *m_SCcVertLeft[4],
|
||||
*m_SCcVertMiddle[4],
|
||||
*m_SCcVertRight[4],
|
||||
*m_SCcLeftStick[4],
|
||||
*m_SCcRightStick[4],
|
||||
*m_SCcTriggers[4],
|
||||
*m_SCcA[4],
|
||||
*m_SCcB[4],
|
||||
*m_SCcX[4],
|
||||
*m_SCcY[4],
|
||||
*m_SCcP[4],
|
||||
*m_SCcM[4],
|
||||
*m_SCcH[4],
|
||||
*m_SCcTl[4],
|
||||
*m_SCcZl[4],
|
||||
*m_SCcZr[4],
|
||||
*m_SCcTr[4],
|
||||
*m_SCcDl[4],
|
||||
*m_SCcDu[4],
|
||||
*m_SCcDr[4],
|
||||
*m_SCcDd[4],
|
||||
*m_SCcLl[4],
|
||||
*m_SCcLu[4],
|
||||
*m_SCcLr[4],
|
||||
*m_SCcLd[4],
|
||||
*m_SCcRl[4],
|
||||
*m_SCcRu[4],
|
||||
*m_SCcRr[4],
|
||||
*m_SCcRd[4];
|
||||
|
||||
wxGridBagSizer *m_SizeAnalogTriggerHorizConfig[4], *m_SizeAnalogTriggerStatusBox[4], *m_TiltGrid[4],
|
||||
*m_GridLeftStick[4], *m_GridRightStick[4];
|
||||
wxStaticBoxSizer *m_SizeBasic[4], *m_SizeEmu[4], *m_SizeReal[4], *m_SizeExtensions[4], *m_SizerIRPointer[4], *m_gTilt[4], *m_gJoyname[4];
|
||||
|
@ -146,61 +197,33 @@ class WiimoteConfigDialog : public wxDialog
|
|||
*m_CcTextLeftStick[4], *m_CcTextRightStick[4], *m_CcTextTriggers[4];
|
||||
wxButton *ClickedButton;
|
||||
wxString OldLabel;
|
||||
wxSlider *m_SliderWidth[4], *m_SliderHeight[4], *m_SliderLeft[4], *m_SliderTop[4];
|
||||
|
||||
// Emulated Wiimote settings
|
||||
wxCheckBox *m_SidewaysDPad[4], *m_WiimoteOnline[4],
|
||||
*m_CheckC2S[4], *m_TiltInvertRoll[4], *m_TiltInvertPitch[4],
|
||||
*m_WiiMotionPlusConnected[4], *m_NunchuckConnected[4], *m_ClassicControllerConnected[4], *m_BalanceBoardConnected[4], *m_GuitarHeroGuitarConnected[4], *m_GuitarHeroWorldTourDrumsConnected[4],
|
||||
*m_CheckAR43[4], *m_CheckAR169[4], *m_Crop[4];
|
||||
wxComboBox *m_TiltComboInput[4], *m_TiltComboRangeRoll[4], *m_TiltComboRangePitch[4], *m_Joyname[4], *m_ComboDiagonal[4], *m_ComboDeadZoneLeft[4], *m_ComboDeadZoneRight[4], *m_TriggerType[4],
|
||||
*m_NunchuckComboStick[4], *m_CcComboLeftStick[4], *m_CcComboRightStick[4], *m_CcComboTriggers[4];
|
||||
|
||||
// Real Wiimote settings
|
||||
wxCheckBox *m_ConnectRealWiimote[4], *m_UseRealWiimote[4], *m_UpdateMeters;
|
||||
|
||||
wxPanel *m_pLeftInStatus[4], *m_pLeftOutStatus[4], *m_pRightInStatus[4], *m_pRightOutStatus[4];
|
||||
wxStaticBitmap *m_bmpSquareLeftIn[4], *m_bmpSquareLeftOut[4], *m_bmpSquareRightIn[4], *m_bmpSquareRightOut[4];
|
||||
wxStaticBoxSizer *m_gAnalogLeft[4], *m_gAnalogRight[4], *m_gTrigger[4],
|
||||
*m_gWiimote[4], *m_gNunchuck[4], *m_gClassicController[4];
|
||||
wxBitmap CreateBitmapDot(), CreateBitmap(), CreateBitmapDeadZone(int Radius), CreateBitmapClear();
|
||||
|
||||
wxButton * m_RecordButton[RECORDING_ROWS + 1];
|
||||
wxChoice * m_RecordHotKeySwitch[RECORDING_ROWS + 1];
|
||||
wxChoice * m_RecordHotKeyWiimote[RECORDING_ROWS + 1];
|
||||
wxChoice * m_RecordHotKeyNunchuck[RECORDING_ROWS + 1];
|
||||
wxChoice * m_RecordHotKeyIR[RECORDING_ROWS + 1];
|
||||
wxTextCtrl * m_RecordText[RECORDING_ROWS + 1];
|
||||
wxTextCtrl * m_RecordGameText[RECORDING_ROWS + 1];
|
||||
wxTextCtrl * m_RecordIRBytesText[RECORDING_ROWS + 1];
|
||||
wxTextCtrl * m_RecordSpeed[RECORDING_ROWS + 1];
|
||||
wxChoice * m_RecordPlayBackSpeed[RECORDING_ROWS + 1];
|
||||
|
||||
/*
|
||||
struct m_sRecording
|
||||
{
|
||||
u8 x;
|
||||
u8 y;
|
||||
u8 z;
|
||||
double Time;
|
||||
};
|
||||
*/
|
||||
std::vector<SRecording> m_vRecording;
|
||||
int IRBytes;
|
||||
wxBitmap CreateBitmapDot();
|
||||
wxBitmap CreateBitmap();
|
||||
wxBitmap CreateBitmapDeadZone(int Radius);
|
||||
wxBitmap CreateBitmapClear();
|
||||
|
||||
enum
|
||||
{
|
||||
ID_CLOSE = 1000,
|
||||
ID_APPLY,
|
||||
ID_ABOUTOGL,
|
||||
IDTM_EXIT, IDTM_UPDATE, IDTM_SHUTDOWN, IDTM_UPDATE_ONCE, IDTM_BUTTON, IDTM_UPDATE_PAD, // Timer
|
||||
IDTM_EXIT,
|
||||
IDTM_BUTTON,
|
||||
IDTM_UPDATE_PAD, // Timer
|
||||
|
||||
ID_NOTEBOOK, ID_CONTROLLERPAGE1, ID_CONTROLLERPAGE2, ID_CONTROLLERPAGE3, ID_CONTROLLERPAGE4, ID_PAGE_RECORDING,
|
||||
|
||||
// Emulated Wiimote
|
||||
ID_SIDEWAYSDPAD,
|
||||
ID_NUNCHUCKCONNECTED, ID_CLASSICCONTROLLERCONNECTED,
|
||||
IDC_WIMOTE_ON,
|
||||
ID_NOTEBOOK,
|
||||
ID_CONTROLLERPAGE1,
|
||||
ID_CONTROLLERPAGE2,
|
||||
ID_CONTROLLERPAGE3,
|
||||
ID_CONTROLLERPAGE4,
|
||||
|
||||
// Gamepad <It's important that the internal ordering of these are unchanged>
|
||||
IDB_ANALOG_LEFT_X, IDB_ANALOG_LEFT_Y,
|
||||
|
@ -236,25 +259,11 @@ class WiimoteConfigDialog : public wxDialog
|
|||
IDC_JOYNAME, IDC_LEFT_C2S, IDCB_LEFT_DIAGONAL, IDCB_DEAD_ZONE_LEFT, IDCB_DEAD_ZONE_RIGHT,
|
||||
ID_TRIGGER_TYPE, ID_TILT_INPUT, ID_TILT_RANGE_ROLL, ID_TILT_RANGE_PITCH, ID_TILT_INVERT_ROLL, ID_TILT_INVERT_PITCH,
|
||||
IDCB_NUNCHUCK_STICK, IDCB_CC_LEFT_STICK, IDCB_CC_RIGHT_STICK, IDCB_CC_TRIGGERS,
|
||||
|
||||
// Real
|
||||
ID_CONNECT_REAL, ID_USE_REAL, ID_UPDATE_REAL, IDT_STATUS,
|
||||
IDB_RECORD = 2000,
|
||||
IDC_RECORD = 3000,
|
||||
IDC_PLAY_WIIMOTE, IDC_PLAY_NUNCHUCK, IDC_PLAY_IR, IDT_RECORD_TEXT, IDT_RECORD_GAMETEXT, IDT_RECORD_IRBYTESTEXT, IDT_RECORD_SPEED, IDT_RECORD_PLAYSPEED
|
||||
};
|
||||
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void CreateGUIControls();
|
||||
void CreateGUIControlsRecording();
|
||||
void AboutClick(wxCommandEvent& event);
|
||||
void CreatePadGUIControls();
|
||||
void GeneralSettingsChanged(wxCommandEvent& event);
|
||||
void GeneralSettingsChangedScroll(wxScrollEvent& event);
|
||||
|
||||
void DoConnectReal(); // Real
|
||||
void DoUseReal();
|
||||
|
||||
void DoExtensionConnectedDisconnected(int Extension = -1); // Emulated
|
||||
|
||||
// Gamepad configuration
|
||||
void SetButtonText(int id, char text[128], int _Page = -1); void SetButtonTextAll(int id, char text[128]);
|
||||
|
@ -271,7 +280,5 @@ class WiimoteConfigDialog : public wxDialog
|
|||
// Configure buttons
|
||||
int GetButtonWaitingID, GetButtonWaitingTimer;
|
||||
};
|
||||
|
||||
extern WiimoteConfigDialog *m_ConfigFrame;
|
||||
|
||||
#endif
|
||||
extern WiimotePadConfigDialog *m_PadConfigFrame;
|
||||
#endif
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -15,11 +15,6 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
//#include "Common.h" // for u16
|
||||
#include "CommonTypes.h" // for u16
|
||||
#include "IniFile.h"
|
||||
#include "Timer.h"
|
||||
|
@ -27,15 +22,14 @@
|
|||
#include "wiimote_real.h" // Local
|
||||
#include "wiimote_hid.h"
|
||||
#include "main.h"
|
||||
#include "ConfigDlg.h"
|
||||
#include "ConfigRecordingDlg.h"
|
||||
#include "ConfigBasicDlg.h"
|
||||
#include "Config.h"
|
||||
#include "EmuMain.h" // for LoadRecordedMovements()
|
||||
#include "EmuSubroutines.h" // for WmRequestStatus
|
||||
//////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
void WiimoteConfigDialog::LoadFile()
|
||||
void WiimoteRecordingConfigDialog::LoadFile()
|
||||
{
|
||||
INFO_LOG(CONSOLE, "LoadFile()\n");
|
||||
|
||||
|
@ -77,7 +71,8 @@ void WiimoteConfigDialog::LoadFile()
|
|||
file.Get(SaveName.c_str(), "PlaybackSpeed", &iTmp, -1); m_RecordPlayBackSpeed[i]->SetSelection(iTmp);
|
||||
}
|
||||
}
|
||||
void WiimoteConfigDialog::SaveFile()
|
||||
|
||||
void WiimoteRecordingConfigDialog::SaveFile()
|
||||
{
|
||||
INFO_LOG(CONSOLE, "SaveFile\n");
|
||||
|
||||
|
@ -117,24 +112,11 @@ void WiimoteConfigDialog::SaveFile()
|
|||
file.Save(FULL_CONFIG_DIR "WiimoteMovement.ini");
|
||||
INFO_LOG(CONSOLE, "SaveFile()\n");
|
||||
}
|
||||
/////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Create GUI
|
||||
// ------------
|
||||
void WiimoteConfigDialog::CreateGUIControlsRecording()
|
||||
void WiimoteRecordingConfigDialog::CreateGUIControlsRecording()
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Real Wiimote
|
||||
// ----------------
|
||||
m_PageRecording = new wxPanel(this, ID_RECORDINGPAGE, wxDefaultPosition, wxDefaultSize);
|
||||
|
||||
// ---------------------------------------------
|
||||
// Status
|
||||
// ----------------
|
||||
m_TextUpdateRate = new wxStaticText(m_PageRecording, wxID_ANY, wxT("Update rate: 000 times/s"));
|
||||
m_UpdateMeters = new wxCheckBox(m_PageRecording, ID_UPDATE_REAL, wxT("Update gauges"));
|
||||
|
||||
|
@ -144,10 +126,9 @@ void WiimoteConfigDialog::CreateGUIControlsRecording()
|
|||
"You can turn this off when a game is running to avoid a potential slowdown that may come from redrawing the\n"
|
||||
"configuration screen. Remember that you also need to press '+' on your Wiimote before you can record movements."
|
||||
));
|
||||
// -----------------------
|
||||
|
||||
// Width and height of the gauges
|
||||
static const int Gw = 35, Gh = 110;
|
||||
static const int Gw = 35, Gh = 110; //ugly
|
||||
|
||||
m_GaugeBattery = new wxGauge( m_PageRecording, wxID_ANY, 100, wxDefaultPosition, wxSize(Gw, Gh), wxGA_VERTICAL | wxNO_BORDER | wxGA_SMOOTH);
|
||||
m_GaugeRoll[0] = new wxGauge( m_PageRecording, wxID_ANY, 360, wxDefaultPosition, wxSize(Gw, Gh), wxGA_VERTICAL | wxNO_BORDER | wxGA_SMOOTH);
|
||||
|
@ -162,9 +143,6 @@ void WiimoteConfigDialog::CreateGUIControlsRecording()
|
|||
// The text controls
|
||||
m_TextIR = new wxStaticText(m_PageRecording, wxID_ANY, wxT("Cursor: 000 000\nDistance: 0000"));
|
||||
|
||||
// ------------------------------------
|
||||
// The sizers for all gauges together with their label
|
||||
// -----------
|
||||
wxBoxSizer * sBoxBattery = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer * sBoxRoll[2];
|
||||
sBoxRoll[0] = new wxBoxSizer(wxVERTICAL);
|
||||
|
@ -185,11 +163,7 @@ void WiimoteConfigDialog::CreateGUIControlsRecording()
|
|||
m_TextX[0] = new wxStaticText(m_PageRecording, wxID_ANY, wxT("X"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE); m_TextX[1] = new wxStaticText(m_PageRecording, wxID_ANY, wxT("X"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
|
||||
m_TextY[0] = new wxStaticText(m_PageRecording, wxID_ANY, wxT("Y"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE); m_TextY[1] = new wxStaticText(m_PageRecording, wxID_ANY, wxT("Y"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
|
||||
m_TextZ[0] = new wxStaticText(m_PageRecording, wxID_ANY, wxT("Z"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE); m_TextZ[1] = new wxStaticText(m_PageRecording, wxID_ANY, wxT("Z"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
|
||||
// ----------------
|
||||
|
||||
// ----------------------------------------------
|
||||
// Row 1 Sizers
|
||||
// -----------
|
||||
sBoxBattery->Add(m_GaugeBattery, 0, wxEXPAND | (wxALL), 0); sBoxBattery->Add(m_TextBattery, 0, wxEXPAND | (wxUP), 5);
|
||||
|
||||
sBoxRoll[0]->Add(m_GaugeRoll[0], 0, wxEXPAND | (wxUP | wxDOWN | wxLEFT), 0); sBoxRoll[0]->Add(m_TextRoll, 0, wxEXPAND | (wxUP), 5);
|
||||
|
@ -231,16 +205,9 @@ void WiimoteConfigDialog::CreateGUIControlsRecording()
|
|||
sbRealWiimoteStatus->Add(sbRealRoll, 0, wxEXPAND | (wxLEFT), 5);
|
||||
sbRealWiimoteStatus->Add(sbRealGForce, 0, wxEXPAND | (wxLEFT), 5);
|
||||
sbRealWiimoteStatus->Add(sbRealAccel, 0, wxEXPAND | (wxLEFT), 5);
|
||||
// --------------------
|
||||
|
||||
// Tool tips
|
||||
m_GaugeBattery->SetToolTip(wxT("Press '+' to show the current status. Press '-' to stop recording the status."));
|
||||
// ==========================================
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// Record movement
|
||||
// ----------------
|
||||
wxStaticBoxSizer * sbRealRecord = new wxStaticBoxSizer(wxVERTICAL, m_PageRecording, wxT("Record movements"));
|
||||
|
||||
wxArrayString StrHotKeySwitch;
|
||||
|
@ -338,27 +305,42 @@ void WiimoteConfigDialog::CreateGUIControlsRecording()
|
|||
|
||||
sbRealRecord->Add(sRealRecord[i], 0, wxEXPAND | (wxTOP), 2);
|
||||
}
|
||||
// ==========================================
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Set up sizers for the whole page
|
||||
// ----------------
|
||||
m_sRecordingMain = new wxBoxSizer(wxVERTICAL);
|
||||
m_sRecordingMain->Add(sbRealWiimoteStatus, 0, wxEXPAND | (wxLEFT | wxRIGHT | wxUP), 5);
|
||||
m_sRecordingMain->Add(sbRealRecord, 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
||||
|
||||
m_PageRecording->SetSizer(m_sRecordingMain);
|
||||
m_PageRecording->SetSizer(m_sRecordingMain);
|
||||
|
||||
m_Apply = new wxButton(this, ID_APPLY, wxT("Apply"));
|
||||
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"));
|
||||
m_Close->SetToolTip(wxT("Apply and Close"));
|
||||
|
||||
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
|
||||
sButtons->AddStretchSpacer();
|
||||
sButtons->Add(m_Apply, 0, (wxALL), 0);
|
||||
sButtons->Add(m_Close, 0, (wxLEFT), 5);
|
||||
|
||||
m_MainSizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_MainSizer->Add(m_PageRecording, 1, wxEXPAND | wxALL, 5);
|
||||
m_MainSizer->Add(sButtons, 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
||||
|
||||
this->SetSizer(m_MainSizer);
|
||||
this->Layout();
|
||||
|
||||
Fit();
|
||||
|
||||
// Center the window if there is room for it
|
||||
#ifdef _WIN32
|
||||
if (GetSystemMetrics(SM_CYFULLSCREEN) > 800)
|
||||
Center();
|
||||
#endif
|
||||
|
||||
ControlsCreated = true;
|
||||
}
|
||||
/////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
/* Record movement */
|
||||
// ------------
|
||||
|
||||
void WiimoteConfigDialog::ConvertToString()
|
||||
void WiimoteRecordingConfigDialog::ConvertToString()
|
||||
{
|
||||
// Load ini file
|
||||
IniFile file;
|
||||
file.Load(FULL_CONFIG_DIR "WiimoteMovement.ini");
|
||||
std::string TmpStr = "", TmpIR = "", TmpTime = "";
|
||||
|
@ -382,8 +364,8 @@ void WiimoteConfigDialog::ConvertToString()
|
|||
TmpTime += StringFromFormat("%05i", Time);
|
||||
if (i < ((int)m_vRecording.size() - 1)) TmpTime += ",";
|
||||
|
||||
/* Break just short of the IniFile.cpp byte limit so that we don't crash file.Load() the next time.
|
||||
This limit should never be hit because of the recording limit below. I keep it here just in case. */
|
||||
// Break just short of the IniFile.cpp byte limit so that we don't crash file.Load() the next time.
|
||||
// This limit should never be hit because of the recording limit below. I keep it here just in case.
|
||||
if(TmpStr.length() > (1024*10 - 10) || TmpIR.length() > (1024*10 - 10) || TmpTime.length() > (1024*10 - 10))
|
||||
{
|
||||
break;
|
||||
|
@ -428,15 +410,15 @@ void WiimoteConfigDialog::ConvertToString()
|
|||
}
|
||||
|
||||
// Timeout the recording
|
||||
void WiimoteConfigDialog::Update(wxTimerEvent& WXUNUSED(event))
|
||||
void WiimoteRecordingConfigDialog::Update(wxTimerEvent& WXUNUSED(event))
|
||||
{
|
||||
m_bWaitForRecording = false;
|
||||
m_bRecording = false;
|
||||
m_RecordButton[m_iRecordTo]->SetLabel(wxT(""));
|
||||
UpdateGUI();
|
||||
UpdateRecordingGUI();
|
||||
}
|
||||
|
||||
void WiimoteConfigDialog::RecordMovement(wxCommandEvent& event)
|
||||
void WiimoteRecordingConfigDialog::RecordMovement(wxCommandEvent& event)
|
||||
{
|
||||
m_iRecordTo = event.GetId() - 2000;
|
||||
|
||||
|
@ -454,20 +436,21 @@ void WiimoteConfigDialog::RecordMovement(wxCommandEvent& event)
|
|||
m_RecordButton[m_iRecordTo]->SetLabel(wxT("Press +"));
|
||||
// This is for usability purposes, it may not be obvious at all that this must be unchecked
|
||||
// for the recording to work
|
||||
for(int i = 0; i < 1; i++) m_UseRealWiimote[i]->SetValue(false); g_Config.bUseRealWiimote = false;
|
||||
for(int i = 0; i < MAX_WIIMOTES; i++)
|
||||
m_BasicConfigFrame->m_UseRealWiimote[i]->SetValue(false);
|
||||
g_Config.bUseRealWiimote = false;
|
||||
return;
|
||||
}
|
||||
|
||||
m_bWaitForRecording = true;
|
||||
m_bAllowA = true;
|
||||
m_bRecording = false;
|
||||
|
||||
UpdateGUI();
|
||||
UpdateRecordingGUI();
|
||||
|
||||
m_TimeoutTimer->Start(5000, true);
|
||||
}
|
||||
|
||||
void WiimoteConfigDialog::DoRecordA(bool Pressed)
|
||||
void WiimoteRecordingConfigDialog::DoRecordA(bool Pressed)
|
||||
{
|
||||
// Return if we are not waiting or recording
|
||||
if (! (m_bWaitForRecording || m_bRecording)) return;
|
||||
|
@ -498,10 +481,10 @@ void WiimoteConfigDialog::DoRecordA(bool Pressed)
|
|||
ConvertToString();
|
||||
}
|
||||
|
||||
UpdateGUI();
|
||||
UpdateRecordingGUI();
|
||||
}
|
||||
|
||||
void WiimoteConfigDialog::DoRecordMovement(int _x, int _y, int _z, const u8 *_IR, int _IRBytes)
|
||||
void WiimoteRecordingConfigDialog::DoRecordMovement(int _x, int _y, int _z, const u8 *_IR, int _IRBytes)
|
||||
{
|
||||
//std::string Tmp1 = ArrayToString(_IR, 20, 0, 30);
|
||||
//INFO_LOG(CONSOLE, "DoRecordMovement: %s\n", Tmp1.c_str());
|
||||
|
@ -521,15 +504,13 @@ void WiimoteConfigDialog::DoRecordMovement(int _x, int _y, int _z, const u8 *_IR
|
|||
// Save the number of IR bytes
|
||||
IRBytes = _IRBytes;
|
||||
|
||||
/* The upper limit of a recording coincides with the IniFile.cpp limit, each list element
|
||||
is 7 bytes, therefore be divide by 7 */
|
||||
// The upper limit of a recording coincides with the IniFile.cpp limit, each list element
|
||||
// is 7 bytes, therefore be divide by 7
|
||||
if (m_vRecording.size() > (10*1024 / 7 - 2) )
|
||||
{
|
||||
m_bRecording = false;
|
||||
m_RecordButton[m_iRecordTo]->SetLabel(wxT("Done"));
|
||||
ConvertToString();
|
||||
UpdateGUI();
|
||||
UpdateRecordingGUI();
|
||||
}
|
||||
}
|
||||
/////////////////////////////////
|
||||
|
||||
}
|
|
@ -0,0 +1,158 @@
|
|||
// Copyright (C) 2003-2009 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/
|
||||
|
||||
|
||||
#include "CommonTypes.h" // for u16
|
||||
#include "IniFile.h"
|
||||
#include "StringUtil.h"
|
||||
|
||||
#include "wiimote_real.h" // Local
|
||||
#include "wiimote_hid.h"
|
||||
#include "main.h"
|
||||
#include "ConfigRecordingDlg.h"
|
||||
#include "ConfigBasicDlg.h"
|
||||
#include "Config.h"
|
||||
#include "EmuMain.h" // for LoadRecordedMovements()
|
||||
#include "EmuSubroutines.h" // for WmRequestStatus
|
||||
#include "EmuDefinitions.h" // for joyinfo
|
||||
|
||||
BEGIN_EVENT_TABLE(WiimoteRecordingConfigDialog,wxFrame)//wxDialog)
|
||||
EVT_CLOSE(WiimoteRecordingConfigDialog::OnClose)
|
||||
EVT_BUTTON(ID_CLOSE, WiimoteRecordingConfigDialog::CloseClick)
|
||||
EVT_BUTTON(ID_APPLY, WiimoteRecordingConfigDialog::CloseClick)
|
||||
|
||||
EVT_CHOICE(IDC_RECORD + 1, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 2, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 3, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 4, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 5, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 6, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 7, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 8, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 9, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 10, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 11, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 12, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 13, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 14, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_CHOICE(IDC_RECORD + 15, WiimoteRecordingConfigDialog::RecordingChanged)
|
||||
EVT_BUTTON(IDB_RECORD + 1, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 2, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 3, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 4, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 5, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 6, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 7, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 8, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 9, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 10, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 11, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 12, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 13, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 14, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_BUTTON(IDB_RECORD + 15, WiimoteRecordingConfigDialog::RecordMovement)
|
||||
EVT_TIMER(IDTM_UPDATE, WiimoteRecordingConfigDialog::Update)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
WiimoteRecordingConfigDialog::WiimoteRecordingConfigDialog(wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
const wxPoint &position, const wxSize& size, long style)
|
||||
: wxFrame
|
||||
(parent, id, title, position, size, style)
|
||||
{
|
||||
#if wxUSE_TIMER
|
||||
m_TimeoutTimer = new wxTimer(this, IDTM_UPDATE);
|
||||
m_bWaitForRecording = false;
|
||||
m_bRecording = false;
|
||||
#endif
|
||||
m_vRecording.resize(RECORDING_ROWS + 1);
|
||||
|
||||
g_Config.Load();
|
||||
CreateGUIControlsRecording();
|
||||
SetBackgroundColour(m_PageRecording->GetBackgroundColour());
|
||||
LoadFile();
|
||||
// Set control values
|
||||
UpdateRecordingGUI();
|
||||
}
|
||||
|
||||
void WiimoteRecordingConfigDialog::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
g_FrameOpen = false;
|
||||
SaveFile();
|
||||
g_Config.Save();
|
||||
|
||||
Hide();
|
||||
if(!m_BasicConfigFrame->Closing)
|
||||
m_BasicConfigFrame->Close();
|
||||
}
|
||||
|
||||
|
||||
void WiimoteRecordingConfigDialog::CloseClick(wxCommandEvent& event)
|
||||
{
|
||||
switch(event.GetId())
|
||||
{
|
||||
case ID_CLOSE:
|
||||
g_Config.Save();
|
||||
SaveFile();
|
||||
Close();
|
||||
break;
|
||||
case ID_APPLY:
|
||||
g_Config.Save();
|
||||
SaveFile();
|
||||
WiiMoteEmu::LoadRecordedMovements();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void WiimoteRecordingConfigDialog::RecordingChanged(wxCommandEvent& event)
|
||||
{
|
||||
|
||||
switch (event.GetId())
|
||||
{
|
||||
case ID_UPDATE_REAL:
|
||||
g_Config.bUpdateRealWiimote = m_UpdateMeters->IsChecked();
|
||||
break;
|
||||
default:
|
||||
// Check if any of the other choice boxes has the same hotkey
|
||||
for (int i = 1; i < (RECORDING_ROWS + 1); i++)
|
||||
{
|
||||
int CurrentChoiceBox = (event.GetId() - IDC_RECORD);
|
||||
if (i == CurrentChoiceBox) continue;
|
||||
if (m_RecordHotKeyWiimote[i]->GetSelection() == m_RecordHotKeyWiimote[CurrentChoiceBox]->GetSelection()) m_RecordHotKeyWiimote[i]->SetSelection(10);
|
||||
if (m_RecordHotKeyNunchuck[i]->GetSelection() == m_RecordHotKeyNunchuck[CurrentChoiceBox]->GetSelection()) m_RecordHotKeyNunchuck[i]->SetSelection(10);
|
||||
if (m_RecordHotKeyIR[i]->GetSelection() == m_RecordHotKeyIR[CurrentChoiceBox]->GetSelection()) m_RecordHotKeyIR[i]->SetSelection(10);
|
||||
|
||||
//INFO_LOG(CONSOLE, "HotKey: %i %i\n",
|
||||
// m_RecordHotKey[i]->GetSelection(), m_RecordHotKey[CurrentChoiceBox]->GetSelection());
|
||||
}
|
||||
break;
|
||||
}
|
||||
g_Config.Save();
|
||||
UpdateRecordingGUI();
|
||||
}
|
||||
|
||||
|
||||
void WiimoteRecordingConfigDialog::UpdateRecordingGUI(int Slot)
|
||||
{
|
||||
// Disable all recording buttons
|
||||
bool ActiveRecording = !(m_bWaitForRecording || m_bRecording);
|
||||
#ifdef _WIN32
|
||||
for(int i = IDB_RECORD + 1; i < (IDB_RECORD + RECORDING_ROWS + 1); i++)
|
||||
if(ControlsCreated) m_PageRecording->FindItem(i)->Enable(ActiveRecording);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
// Copyright (C) 2003-2009 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/
|
||||
|
||||
#ifndef __CONFIGDIALOG_h__
|
||||
#define __CONFIGDIALOG_h__
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/combobox.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/panel.h>
|
||||
|
||||
class WiimoteRecordingConfigDialog : public wxFrame
|
||||
{
|
||||
public:
|
||||
WiimoteRecordingConfigDialog(wxWindow *parent,
|
||||
wxWindowID id = 1,
|
||||
const wxString &title = wxT("Wii Remote Plugin Configuration"),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE | wxWANTS_CHARS);
|
||||
virtual ~WiimoteRecordingConfigDialog(){;}
|
||||
|
||||
|
||||
void UpdateRecordingGUI(int Slot = 0);
|
||||
void LoadFile();
|
||||
void SaveFile();
|
||||
void DoRecordMovement(int _x, int _y, int _z, const u8 *_IR, int IRBytes);
|
||||
void DoRecordA(bool Pressed);
|
||||
void ConvertToString();
|
||||
|
||||
void CloseClick(wxCommandEvent& event);
|
||||
void RecordMovement(wxCommandEvent& event);
|
||||
void Update(wxTimerEvent& WXUNUSED(event));
|
||||
|
||||
bool m_bWaitForRecording,
|
||||
m_bRecording;
|
||||
|
||||
int m_iRecordTo;
|
||||
|
||||
wxTimer *m_TimeoutTimer;
|
||||
|
||||
// General status
|
||||
wxStaticText * m_TextUpdateRate,
|
||||
*m_TextIR;
|
||||
|
||||
// Wiimote status
|
||||
wxGauge *m_GaugeBattery,
|
||||
*m_GaugeRoll[2],
|
||||
*m_GaugeGForce[3],
|
||||
*m_GaugeAccel[3];
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
bool ControlsCreated;
|
||||
|
||||
wxPanel *m_PageRecording;
|
||||
wxButton *m_Close,
|
||||
*m_Apply;
|
||||
|
||||
wxBoxSizer *m_MainSizer,
|
||||
*m_sRecordingMain;
|
||||
|
||||
wxCheckBox *m_UpdateMeters;
|
||||
|
||||
wxButton * m_RecordButton[RECORDING_ROWS + 1];
|
||||
wxChoice * m_RecordHotKeySwitch[RECORDING_ROWS + 1];
|
||||
wxChoice * m_RecordHotKeyWiimote[RECORDING_ROWS + 1];
|
||||
wxChoice * m_RecordHotKeyNunchuck[RECORDING_ROWS + 1];
|
||||
wxChoice * m_RecordHotKeyIR[RECORDING_ROWS + 1];
|
||||
wxTextCtrl * m_RecordText[RECORDING_ROWS + 1];
|
||||
wxTextCtrl * m_RecordGameText[RECORDING_ROWS + 1];
|
||||
wxTextCtrl * m_RecordIRBytesText[RECORDING_ROWS + 1];
|
||||
wxTextCtrl * m_RecordSpeed[RECORDING_ROWS + 1];
|
||||
wxChoice * m_RecordPlayBackSpeed[RECORDING_ROWS + 1];
|
||||
|
||||
std::vector<SRecording> m_vRecording;
|
||||
int IRBytes;
|
||||
|
||||
enum
|
||||
{
|
||||
ID_CLOSE = 1000,
|
||||
ID_APPLY,
|
||||
ID_RECORDINGPAGE,
|
||||
IDTM_UPDATE,
|
||||
|
||||
// Real
|
||||
ID_UPDATE_REAL,
|
||||
IDB_RECORD = 2000,
|
||||
IDC_RECORD = 3000,
|
||||
IDC_PLAY_WIIMOTE,
|
||||
IDC_PLAY_NUNCHUCK,
|
||||
IDC_PLAY_IR,
|
||||
IDT_RECORD_TEXT,
|
||||
IDT_RECORD_GAMETEXT,
|
||||
IDT_RECORD_IRBYTESTEXT,
|
||||
IDT_RECORD_SPEED,
|
||||
IDT_RECORD_PLAYSPEED
|
||||
};
|
||||
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void CreateGUIControlsRecording();
|
||||
void RecordingChanged(wxCommandEvent& event);
|
||||
};
|
||||
|
||||
extern WiimoteRecordingConfigDialog *m_RecordingConfigFrame;
|
||||
#endif
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -45,11 +45,6 @@
|
|||
|
||||
// ================
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include "pluginspecs_wiimote.h"
|
||||
|
||||
#include <vector>
|
||||
|
@ -64,16 +59,9 @@
|
|||
#include "EmuSubroutines.h"
|
||||
#include "EmuDefinitions.h"
|
||||
#include "Encryption.h" // for extension encryption
|
||||
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
#include "Config.h" // for g_Config
|
||||
///////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Declarations and definitions
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
namespace WiiMoteEmu
|
||||
|
@ -226,13 +214,13 @@ void SendReportCoreAccelExt16(u16 _channelID)
|
|||
FillReportAcc(pReport->a);
|
||||
#endif
|
||||
|
||||
if(g_Config.bNunchuckConnected)
|
||||
if(g_Config.iExtensionConnected == EXT_NUNCHUCK)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
FillReportExtension(pReport->ext);
|
||||
#endif
|
||||
}
|
||||
else if(g_Config.bClassicControllerConnected)
|
||||
else if(g_Config.iExtensionConnected == EXT_CLASSIC_CONTROLLER)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
FillReportClassicExtension(_ext);
|
||||
|
@ -274,13 +262,13 @@ void SendReportCoreAccelIr10Ext(u16 _channelID)
|
|||
FillReportIRBasic(pReport->ir[0], pReport->ir[1]);
|
||||
#endif
|
||||
|
||||
if(g_Config.bNunchuckConnected)
|
||||
if(g_Config.iExtensionConnected == EXT_NUNCHUCK)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
FillReportExtension(pReport->ext);
|
||||
#endif
|
||||
}
|
||||
else if(g_Config.bClassicControllerConnected)
|
||||
else if(g_Config.iExtensionConnected == EXT_CLASSIC_CONTROLLER)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
FillReportClassicExtension(_ext);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -15,9 +15,6 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#ifndef _EMU_DEFINITIONS_
|
||||
#define _EMU_DEFINITIONS_
|
||||
|
||||
|
@ -29,8 +26,6 @@
|
|||
#include "wiimote_hid.h"
|
||||
#include "EmuDefinitions.h"
|
||||
#include "Encryption.h"
|
||||
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
//////////////////////////
|
||||
|
||||
extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include "wiimote_hid.h" // Local
|
||||
#include "Encryption.h"
|
||||
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
|
||||
extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -15,10 +15,6 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
|
@ -37,9 +33,7 @@
|
|||
#include "EmuSubroutines.h"
|
||||
#include "EmuMain.h"
|
||||
#include "Encryption.h" // for extension encryption
|
||||
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
#include "Config.h" // for g_Config
|
||||
////////////////////////////////////
|
||||
|
||||
|
||||
namespace WiiMoteEmu
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -15,10 +15,6 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
|
@ -36,9 +32,7 @@
|
|||
#include "EmuSubroutines.h"
|
||||
#include "EmuMain.h"
|
||||
#include "Encryption.h" // for extension encryption
|
||||
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
#include "Config.h" // for g_Config
|
||||
////////////////////////////////////
|
||||
extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
|
||||
namespace WiiMoteEmu
|
||||
|
@ -358,7 +352,7 @@ void UpdateEeprom()
|
|||
INFO_LOG(CONSOLE, "\nUpdateEeprom: %i %i %i\n",
|
||||
WiiMoteEmu::g_Eeprom[22], WiiMoteEmu::g_Eeprom[23], WiiMoteEmu::g_Eeprom[28]);
|
||||
|
||||
if(g_Config.bNunchuckConnected)
|
||||
if(g_Config.iExtensionConnected == EXT_NUNCHUCK)
|
||||
{
|
||||
g_nu.cal_zero.x = g_RegExt[0x20];
|
||||
g_nu.cal_zero.y = g_RegExt[0x21];
|
||||
|
@ -377,7 +371,7 @@ void UpdateEeprom()
|
|||
WiiMoteEmu::g_RegExt[0x2a], WiiMoteEmu::g_RegExt[0x2d],
|
||||
WiiMoteEmu::g_RegExt[0x20], WiiMoteEmu::g_RegExt[0x21], WiiMoteEmu::g_RegExt[0x26]);
|
||||
}
|
||||
else if(g_Config.bClassicControllerConnected)
|
||||
else if(g_Config.iExtensionConnected == EXT_CLASSIC_CONTROLLER)
|
||||
{
|
||||
g_ClassicContCalibration.Lx.max = g_RegExt[0x20];
|
||||
g_ClassicContCalibration.Lx.min = g_RegExt[0x21];
|
||||
|
@ -447,19 +441,19 @@ void ResetVariables()
|
|||
void SetDefaultExtensionRegistry()
|
||||
{
|
||||
// Copy extension id and calibration to its register
|
||||
if(g_Config.bNunchuckConnected)
|
||||
if(g_Config.iExtensionConnected == EXT_NUNCHUCK)
|
||||
{
|
||||
memcpy(g_RegExt + 0x20, nunchuck_calibration, sizeof(nunchuck_calibration));
|
||||
memcpy(g_RegExt + 0x30, nunchuck_calibration, sizeof(nunchuck_calibration));
|
||||
memcpy(g_RegExt + 0xfa, nunchuck_id, sizeof(nunchuck_id));
|
||||
}
|
||||
else if(g_Config.bClassicControllerConnected)
|
||||
else if(g_Config.iExtensionConnected == EXT_CLASSIC_CONTROLLER)
|
||||
{
|
||||
memcpy(g_RegExt + 0x20, classic_calibration, sizeof(classic_calibration));
|
||||
memcpy(g_RegExt + 0x30, classic_calibration, sizeof(classic_calibration));
|
||||
memcpy(g_RegExt + 0xfa, classic_id, sizeof(classic_id));
|
||||
}
|
||||
else if(g_Config.bGuitarConnected)
|
||||
else if(g_Config.iExtensionConnected == EXT_GUITARHERO3_CONTROLLER)
|
||||
{
|
||||
// memcpy(g_RegExt + 0x20, classic_calibration, sizeof(classic_calibration));
|
||||
// memcpy(g_RegExt + 0x30, classic_calibration, sizeof(classic_calibration));
|
||||
|
@ -787,4 +781,4 @@ void Update()
|
|||
}
|
||||
|
||||
|
||||
} // end of namespace
|
||||
} // end of namespace
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -15,10 +15,6 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
|
@ -36,9 +32,7 @@
|
|||
#include "EmuSubroutines.h"
|
||||
#include "EmuMain.h"
|
||||
#include "Encryption.h" // for extension encryption
|
||||
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
#include "Config.h" // for g_Config
|
||||
////////////////////////////////////
|
||||
|
||||
extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
|
||||
|
@ -192,4 +186,3 @@ void GetJoyState(InputCommon::CONTROLLER_STATE_NEW &_PadState, InputCommon::CONT
|
|||
|
||||
|
||||
} // end of namespace WiiMoteEmu
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -36,9 +36,6 @@
|
|||
// ================
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
|
@ -48,7 +45,6 @@
|
|||
|
||||
#include "EmuMain.h" // Local
|
||||
#include "EmuSubroutines.h"
|
||||
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
#include "Config.h" // for g_Config
|
||||
/////////////////////////////////
|
||||
|
||||
|
@ -580,10 +576,10 @@ void WmRequestStatus(u16 _channelID, wm_request_status* rs, int Extension)
|
|||
if (Extension == -1)
|
||||
{
|
||||
// Read config value for this one
|
||||
if(g_Config.bNunchuckConnected || g_Config.bClassicControllerConnected)
|
||||
pStatus->extension = 1;
|
||||
else
|
||||
if(g_Config.iExtensionConnected == EXT_NONE)
|
||||
pStatus->extension = 0;
|
||||
else
|
||||
pStatus->extension = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -15,10 +15,6 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Include
|
||||
// ¯¯¯¯¯¯¯¯¯
|
||||
#ifndef _EMU_SUBFUNCTIONS_
|
||||
#define _EMU_SUBFUNCTIONS_
|
||||
|
||||
|
@ -32,13 +28,7 @@
|
|||
#include "wiimote_hid.h" // Local
|
||||
#include "EmuDefinitions.h"
|
||||
#include "Encryption.h"
|
||||
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Declarations and definitions
|
||||
// ¯¯¯¯¯¯¯¯¯
|
||||
extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 Dolphin Project.
|
||||
// Copyright (C) Hector Martin "marcan" (hector@marcansoft.com)
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
|
@ -19,7 +19,6 @@
|
|||
|
||||
#include "pluginspecs_wiimote.h"
|
||||
#include "Common.h"
|
||||
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
#include "Encryption.h"
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 Dolphin Project.
|
||||
// Copyright (C) Hector Martin "marcan" (hector@marcansoft.com)
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -15,10 +15,6 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <wx/msgdlg.h>
|
||||
|
||||
#include <vector>
|
||||
|
@ -33,9 +29,7 @@
|
|||
#include "EmuMain.h"
|
||||
#include "EmuSubroutines.h"
|
||||
#include "EmuDefinitions.h"
|
||||
#include "Logging.h" // For startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
#include "Config.h" // For g_Config
|
||||
//////////////////////////////////
|
||||
|
||||
extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
|
||||
|
|
|
@ -1,119 +0,0 @@
|
|||
// 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/
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// -------------
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "StringUtil.h"
|
||||
|
||||
#define HAVE_WX 1
|
||||
#if defined(HAVE_WX) && HAVE_WX // wxWidgets
|
||||
#include <wx/datetime.h> // for the timestamps
|
||||
#endif
|
||||
///////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Settings
|
||||
// -------------
|
||||
|
||||
// On and off
|
||||
bool g_consoleEnable = true;
|
||||
bool gSaveFile = true;
|
||||
#define DEBUG_WIIMOTE // On or off
|
||||
const int nFiles = 1;
|
||||
|
||||
// Create handles
|
||||
#ifdef DEBUG_WIIMOTE
|
||||
FILE* __fStdOut[nFiles];
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
HANDLE __hStdOut = NULL;
|
||||
#endif
|
||||
|
||||
//////////////////////////////
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
/* Get Timestamp */
|
||||
// -------------
|
||||
std::string Tm(bool Ms)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
std::string Tmp;
|
||||
if(Ms)
|
||||
{
|
||||
wxDateTime datetime = wxDateTime::UNow(); // Get timestamp
|
||||
Tmp = StringFromFormat("%02i:%02i:%03i",
|
||||
datetime.GetMinute(), datetime.GetSecond(), datetime.GetMillisecond());
|
||||
}
|
||||
else
|
||||
{
|
||||
wxDateTime datetime = wxDateTime::Now(); // Get timestamp
|
||||
Tmp = StringFromFormat("%02i:%02i",
|
||||
datetime.GetMinute(), datetime.GetSecond());
|
||||
}
|
||||
return Tmp;
|
||||
#else
|
||||
std::string Tmp = "";
|
||||
return Tmp;
|
||||
#endif
|
||||
}
|
||||
// ===========================
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// File printf function
|
||||
// ---------------
|
||||
int PrintFile(int a, char *fmt, ...)
|
||||
{
|
||||
#if defined(DEBUG_WIIMOTE) && defined(_WIN32)
|
||||
if(gSaveFile)
|
||||
{
|
||||
char s[500]; // WARNING: mind this value
|
||||
va_list argptr;
|
||||
int cnt;
|
||||
|
||||
va_start(argptr, fmt);
|
||||
cnt = vsnprintf(s, 500, fmt, argptr); // remember to update this value to
|
||||
va_end(argptr);
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
if(__fStdOut[a]) // TODO: make this work, we have to set all default values to NULL
|
||||
//to make it work
|
||||
fprintf(__fStdOut[a], s);
|
||||
fflush(__fStdOut[0]); // Write file now, don't wait
|
||||
// -------------
|
||||
|
||||
return(cnt);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
// 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/
|
||||
|
||||
#ifndef WIIMOTE_CONSOLE_H
|
||||
#define WIIMOTE_CONSOLE_H
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <iostream>
|
||||
//////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Declarations
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
std::string Tm(bool Ms = false);
|
||||
int PrintFile(int a, const char *fmt, ...);
|
||||
void ClearScreen();
|
||||
|
||||
#ifdef _WIN32
|
||||
HWND GetConsoleHwnd(void);
|
||||
#endif
|
||||
///////////////////////////////
|
||||
|
||||
#endif // WIIMOTE_CONSOLE_H
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -15,10 +15,6 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <iostream> // System
|
||||
|
||||
#include "wiiuse.h" // Externals
|
||||
|
@ -33,10 +29,11 @@
|
|||
#include "EmuMain.h"
|
||||
#include "main.h"
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
#include "ConfigDlg.h"
|
||||
#include "ConfigBasicDlg.h"
|
||||
#include "ConfigRecordingDlg.h"
|
||||
#include "ConfigPadDlg.h"
|
||||
#endif
|
||||
#include "Config.h"
|
||||
////////////////////////////////////////
|
||||
|
||||
namespace WiiMoteReal
|
||||
{
|
||||
|
@ -114,8 +111,8 @@ void handle_event(struct wiimote_t* wm)
|
|||
|
||||
// Print battery status
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if(m_ConfigFrame && g_Config.bUpdateRealWiimote)
|
||||
m_ConfigFrame->m_GaugeBattery->SetValue((int)floor((wm->battery_level * 100) + 0.5));
|
||||
if(m_RecordingConfigFrame && g_Config.bUpdateRealWiimote)
|
||||
m_RecordingConfigFrame->m_GaugeBattery->SetValue((int)floor((wm->battery_level * 100) + 0.5));
|
||||
#endif
|
||||
// Create shortcut to the nunchuck
|
||||
struct nunchuk_t* nc = NULL;
|
||||
|
@ -170,7 +167,7 @@ void handle_event(struct wiimote_t* wm)
|
|||
//INFO_LOG(CONSOLE, "%s\n\n", Tmp.c_str());
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if(m_ConfigFrame)
|
||||
if(m_RecordingConfigFrame)
|
||||
{
|
||||
// Produce adjusted accelerometer values
|
||||
float _Gx = (float)(wm->accel.x - wm->accel_calib.cal_zero.x) / (float)wm->accel_calib.cal_g.x;
|
||||
|
@ -194,56 +191,58 @@ void handle_event(struct wiimote_t* wm)
|
|||
if(g_Config.bUpdateRealWiimote)
|
||||
{
|
||||
// Update gauges
|
||||
m_ConfigFrame->m_GaugeRoll[0]->SetValue(wm->orient.roll + 180);
|
||||
m_ConfigFrame->m_GaugeRoll[1]->SetValue(wm->orient.pitch + 180);
|
||||
m_RecordingConfigFrame->m_GaugeRoll[0]->SetValue(wm->orient.roll + 180);
|
||||
m_RecordingConfigFrame->m_GaugeRoll[1]->SetValue(wm->orient.pitch + 180);
|
||||
|
||||
// Show g. forces between -3 and 3
|
||||
m_ConfigFrame->m_GaugeGForce[0]->SetValue((int)floor((wm->gforce.x * 100) + 300.5));
|
||||
m_ConfigFrame->m_GaugeGForce[1]->SetValue((int)floor((wm->gforce.y * 100) + 300.5));
|
||||
m_ConfigFrame->m_GaugeGForce[2]->SetValue((int)floor((wm->gforce.z * 100) + 300.5));
|
||||
m_RecordingConfigFrame->m_GaugeGForce[0]->SetValue((int)floor((wm->gforce.x * 100) + 300.5));
|
||||
m_RecordingConfigFrame->m_GaugeGForce[1]->SetValue((int)floor((wm->gforce.y * 100) + 300.5));
|
||||
m_RecordingConfigFrame->m_GaugeGForce[2]->SetValue((int)floor((wm->gforce.z * 100) + 300.5));
|
||||
|
||||
m_ConfigFrame->m_GaugeAccel[0]->SetValue(wm->accel.x);
|
||||
m_ConfigFrame->m_GaugeAccel[1]->SetValue(wm->accel.y);
|
||||
m_ConfigFrame->m_GaugeAccel[2]->SetValue(wm->accel.z);
|
||||
m_RecordingConfigFrame->m_GaugeAccel[0]->SetValue(wm->accel.x);
|
||||
m_RecordingConfigFrame->m_GaugeAccel[1]->SetValue(wm->accel.y);
|
||||
m_RecordingConfigFrame->m_GaugeAccel[2]->SetValue(wm->accel.z);
|
||||
|
||||
m_ConfigFrame->m_TextIR->SetLabel(wxString::Format(
|
||||
m_RecordingConfigFrame->m_TextIR->SetLabel(wxString::Format(
|
||||
wxT("Cursor: %03u %03u\nDistance:%4.0f"), wm->ir.x, wm->ir.y, wm->ir.z));
|
||||
|
||||
//m_ConfigFrame->m_TextAccNeutralCurrent->SetLabel(wxString::Format(
|
||||
//m_RecordingConfigFrame->m_TextAccNeutralCurrent->SetLabel(wxString::Format(
|
||||
// wxT("Current: %03u %03u %03u"), Gx, Gy, Gz));
|
||||
|
||||
if(m_ConfigFrame->m_bRecording)
|
||||
if(m_RecordingConfigFrame->m_bRecording)
|
||||
INFO_LOG(CONSOLE, "Wiiuse Recorded accel x, y, z: %03i %03i %03i\n", Gx, Gy, Gz);
|
||||
//INFO_LOG(CONSOLE, "Wiiuse Recorded accel x, y, z: %02x %02x %02x\n", Gx, Gy, Gz);
|
||||
}
|
||||
|
||||
// Send the data to be saved
|
||||
//const u8* data = (const u8*)wm->event_buf;
|
||||
m_ConfigFrame->DoRecordMovement(Gx, Gy, Gz, (g_EventBuffer + 6),
|
||||
m_RecordingConfigFrame->DoRecordMovement(Gx, Gy, Gz, (g_EventBuffer + 6),
|
||||
(WIIUSE_USING_EXP(wm) ? 10 : 12));
|
||||
|
||||
// Turn recording on and off
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_A)) m_ConfigFrame->DoRecordA(true);
|
||||
else m_ConfigFrame->DoRecordA(false);
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_A)) m_RecordingConfigFrame->DoRecordA(true);
|
||||
else m_RecordingConfigFrame->DoRecordA(false);
|
||||
|
||||
// ------------------------------------
|
||||
// Show roll and pitch in the status box
|
||||
// --------------
|
||||
/*
|
||||
|
||||
if(!g_DebugData)
|
||||
{
|
||||
// Console::ClearScreen();
|
||||
INFO_LOG(CONSOLE, "Roll:%03i Pitch:%03i\n", (int)wm->orient.roll, (int)wm->orient.pitch);
|
||||
}
|
||||
// Convert Roll and Pitch from 180 to 0x8000
|
||||
int Roll = (int)wm->orient.roll * (0x8000 / 180);
|
||||
int Pitch = (int)wm->orient.pitch * (0x8000 / 180);
|
||||
// Convert it to the box
|
||||
m_ConfigFrame->Convert2Box(Roll);
|
||||
m_ConfigFrame->Convert2Box(Pitch);
|
||||
// Show roll and pitch in the axis boxes
|
||||
m_ConfigFrame->m_bmpDotRightOut[0]->SetPosition(wxPoint(Roll, Pitch));*/
|
||||
// ---------------------
|
||||
if(m_PadConfigFrame)
|
||||
{
|
||||
// Convert Roll and Pitch from 180 to 0x8000
|
||||
int Roll = (int)wm->orient.roll * (0x8000 / 180);
|
||||
int Pitch = (int)wm->orient.pitch * (0x8000 / 180);
|
||||
// Convert it to the box
|
||||
m_PadConfigFrame->Convert2Box(Roll);
|
||||
m_PadConfigFrame->Convert2Box(Pitch);
|
||||
// Show roll and pitch in the axis boxes
|
||||
m_PadConfigFrame->m_bmpDotRightOut[0]->SetPosition(wxPoint(Roll, Pitch));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -251,20 +250,20 @@ void handle_event(struct wiimote_t* wm)
|
|||
else
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (m_ConfigFrame)
|
||||
if (m_RecordingConfigFrame)
|
||||
{
|
||||
m_ConfigFrame->m_GaugeRoll[0]->SetValue(0);
|
||||
m_ConfigFrame->m_GaugeRoll[1]->SetValue(0);
|
||||
m_RecordingConfigFrame->m_GaugeRoll[0]->SetValue(0);
|
||||
m_RecordingConfigFrame->m_GaugeRoll[1]->SetValue(0);
|
||||
|
||||
m_ConfigFrame->m_GaugeGForce[0]->SetValue(0);
|
||||
m_ConfigFrame->m_GaugeGForce[1]->SetValue(0);
|
||||
m_ConfigFrame->m_GaugeGForce[2]->SetValue(0);
|
||||
m_RecordingConfigFrame->m_GaugeGForce[0]->SetValue(0);
|
||||
m_RecordingConfigFrame->m_GaugeGForce[1]->SetValue(0);
|
||||
m_RecordingConfigFrame->m_GaugeGForce[2]->SetValue(0);
|
||||
|
||||
m_ConfigFrame->m_GaugeAccel[0]->SetValue(0);
|
||||
m_ConfigFrame->m_GaugeAccel[1]->SetValue(0);
|
||||
m_ConfigFrame->m_GaugeAccel[2]->SetValue(0);
|
||||
m_RecordingConfigFrame->m_GaugeAccel[0]->SetValue(0);
|
||||
m_RecordingConfigFrame->m_GaugeAccel[1]->SetValue(0);
|
||||
m_RecordingConfigFrame->m_GaugeAccel[2]->SetValue(0);
|
||||
|
||||
m_ConfigFrame->m_TextIR->SetLabel(wxT("Cursor:\nDistance:"));
|
||||
m_RecordingConfigFrame->m_TextIR->SetLabel(wxT("Cursor:\nDistance:"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -384,4 +383,3 @@ void ReadWiimote()
|
|||
|
||||
|
||||
}; // end of namespace
|
||||
|
||||
|
|
|
@ -19,7 +19,9 @@ files = [
|
|||
]
|
||||
if wmenv['HAVE_WX']:
|
||||
files += [
|
||||
"ConfigDlg.cpp",
|
||||
"ConfigBasicDlg.cpp",
|
||||
"ConfigPadDlg.cpp",
|
||||
"ConfigRecordingDlg.cpp",
|
||||
"ConfigGamepad.cpp",
|
||||
"ConfigRecording.cpp",
|
||||
"Logging.cpp",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -16,10 +16,8 @@
|
|||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Current issues
|
||||
/* ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
|
||||
/*
|
||||
The real Wiimote fails to answer the core correctly sometmes. Leading to an unwanted disconnection. And
|
||||
there is currenty no functions to reconnect with the game. There are two ways to solve this:
|
||||
1. Make a reconnect function in the IOS emulation
|
||||
|
@ -27,14 +25,8 @@ there is currenty no functions to reconnect with the game. There are two ways to
|
|||
|
||||
The first solution seems easier, if I knew a little better how the /dev/usb/oh1 and Wiimote functions
|
||||
worked.
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include "Common.h" // Common
|
||||
#include "StringUtil.h"
|
||||
#include "Timer.h"
|
||||
|
@ -43,10 +35,14 @@ worked.
|
|||
#include "EmuDefinitions.h" // Local
|
||||
#include "wiimote_hid.h"
|
||||
#include "main.h"
|
||||
#include "Logging.h"
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
#include "ConfigDlg.h"
|
||||
WiimoteConfigDialog *m_ConfigFrame = NULL;
|
||||
#include "ConfigPadDlg.h"
|
||||
#include "ConfigRecordingDlg.h"
|
||||
#include "ConfigBasicDlg.h"
|
||||
|
||||
WiimotePadConfigDialog *m_PadConfigFrame = NULL;
|
||||
WiimoteRecordingConfigDialog *m_RecordingConfigFrame = NULL;
|
||||
WiimoteBasicConfigDialog *m_BasicConfigFrame = NULL;
|
||||
#endif
|
||||
#include "Config.h"
|
||||
#include "pluginspecs_wiimote.h"
|
||||
|
@ -54,12 +50,7 @@ worked.
|
|||
#if HAVE_WIIUSE
|
||||
#include "wiimote_real.h"
|
||||
#endif
|
||||
///////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Declarations and definitions
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
SWiimoteInitialize g_WiimoteInitialize;
|
||||
PLUGIN_GLOBALS* globals = NULL;
|
||||
|
||||
|
@ -191,16 +182,16 @@ void DllConfig(HWND _hParent)
|
|||
|
||||
DoInitialize();
|
||||
|
||||
if (!m_ConfigFrame)
|
||||
m_ConfigFrame = new WiimoteConfigDialog(GetParentedWxWindow(_hParent));
|
||||
else if (!m_ConfigFrame->GetParent()->IsShown())
|
||||
m_ConfigFrame->Close(true);
|
||||
if (!m_BasicConfigFrame)
|
||||
m_BasicConfigFrame = new WiimoteBasicConfigDialog(GetParentedWxWindow(_hParent));
|
||||
else if (!m_BasicConfigFrame->GetParent()->IsShown())
|
||||
m_BasicConfigFrame->Close(true);
|
||||
|
||||
// Only allow one open at a time
|
||||
if (!m_ConfigFrame->IsShown())
|
||||
m_ConfigFrame->ShowModal();
|
||||
if (!m_BasicConfigFrame->IsShown())
|
||||
m_BasicConfigFrame->ShowModal();
|
||||
else
|
||||
m_ConfigFrame->Hide();
|
||||
m_BasicConfigFrame->Hide();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -222,7 +213,7 @@ void Initialize(void *init)
|
|||
g_ISOId = g_WiimoteInitialize.ISOId;
|
||||
// Load the settings
|
||||
g_Config.Load();
|
||||
if(m_ConfigFrame) m_ConfigFrame->UpdateGUI();
|
||||
if(m_BasicConfigFrame) m_BasicConfigFrame->UpdateGUI();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -247,7 +238,7 @@ void Shutdown(void)
|
|||
if (g_FrameOpen)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if(m_ConfigFrame) m_ConfigFrame->UpdateGUI();
|
||||
if(m_BasicConfigFrame) m_BasicConfigFrame->UpdateGUI();
|
||||
#endif
|
||||
|
||||
// Reset the variables
|
||||
|
@ -341,7 +332,7 @@ void Wiimote_ControlChannel(u16 _channelID, const void* _pData, u32 _Size)
|
|||
g_EmulatorRunning = false;
|
||||
g_WiimoteUnexpectedDisconnect = true;
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (m_ConfigFrame) m_ConfigFrame->UpdateGUI();
|
||||
if (m_BasicConfigFrame) m_BasicConfigFrame->UpdateGUI();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
@ -374,12 +365,12 @@ void Wiimote_Update()
|
|||
{
|
||||
// Tell us about the update rate, but only about once every second to avoid a major slowdown
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (m_ConfigFrame)
|
||||
if (m_RecordingConfigFrame)
|
||||
{
|
||||
GetUpdateRate();
|
||||
if (g_UpdateWriteScreen > g_UpdateRate)
|
||||
{
|
||||
m_ConfigFrame->m_TextUpdateRate->SetLabel(wxString::Format(wxT("Update rate: %03i times/s"), g_UpdateRate));
|
||||
m_RecordingConfigFrame->m_TextUpdateRate->SetLabel(wxString::Format(wxT("Update rate: %03i times/s"), g_UpdateRate));
|
||||
g_UpdateWriteScreen = 0;
|
||||
}
|
||||
g_UpdateWriteScreen++;
|
||||
|
@ -472,7 +463,9 @@ bool IsFocus()
|
|||
HWND Parent = GetParent(RenderingWindow);
|
||||
HWND TopLevel = GetParent(Parent);
|
||||
// Allow updates when the config window is in focus to
|
||||
HWND Config = NULL; if (m_ConfigFrame) Config = (HWND)m_ConfigFrame->GetHWND();
|
||||
HWND Config = NULL;
|
||||
if (m_BasicConfigFrame)
|
||||
Config = (HWND)m_BasicConfigFrame->GetHWND();
|
||||
// Support both rendering to main window and not
|
||||
if (GetForegroundWindow() == TopLevel || GetForegroundWindow() == RenderingWindow || GetForegroundWindow() == Config)
|
||||
return true;
|
||||
|
@ -486,12 +479,7 @@ bool IsFocus()
|
|||
// Turn off all extensions
|
||||
void DisableExtensions()
|
||||
{
|
||||
//g_Config.bMotionPlus = false;
|
||||
g_Config.bNunchuckConnected = false;
|
||||
g_Config.bClassicControllerConnected = false;
|
||||
//g_Config.bBalanceBoard = false;
|
||||
g_Config.bGuitarConnected = false;
|
||||
//g_Config.bDrums = false;
|
||||
g_Config.iExtensionConnected = EXT_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -539,7 +527,7 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
|||
{
|
||||
DisableExtensions();
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (m_ConfigFrame) m_ConfigFrame->UpdateGUI();
|
||||
if (m_BasicConfigFrame) m_BasicConfigFrame->UpdateGUI();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -574,12 +562,14 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
|||
if(data[4] == 0x10)
|
||||
{
|
||||
if (!Emu) DisableExtensions();
|
||||
if (!Emu && data[7] == 0x00 && data[8] == 0x00) g_Config.bNunchuckConnected = true;
|
||||
if (!Emu && data[7] == 0x01 && data[8] == 0x01) g_Config.bClassicControllerConnected = true;
|
||||
if (!Emu && data[7] == 0x00 && data[8] == 0x00)
|
||||
g_Config.iExtensionConnected = EXT_NUNCHUCK;
|
||||
if (!Emu && data[7] == 0x01 && data[8] == 0x01)
|
||||
g_Config.iExtensionConnected = EXT_CLASSIC_CONTROLLER;
|
||||
g_Config.Save();
|
||||
WiiMoteEmu::UpdateEeprom();
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (m_ConfigFrame) m_ConfigFrame->UpdateGUI();
|
||||
if (m_BasicConfigFrame) m_BasicConfigFrame->UpdateGUI();
|
||||
#endif
|
||||
INFO_LOG(CONSOLE, "%s", TmpData.c_str());
|
||||
INFO_LOG(CONSOLE, "Game got the decrypted extension ID: %02x%02x\n\n", data[7], data[8]);
|
||||
|
@ -587,12 +577,14 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
|||
else if(data[4] == 0x50)
|
||||
{
|
||||
if (!Emu) DisableExtensions();
|
||||
if (!Emu && data[11] == 0x00 && data[12] == 0x00) g_Config.bNunchuckConnected = true;
|
||||
if (!Emu && data[11] == 0x01 && data[12] == 0x01) g_Config.bClassicControllerConnected = true;
|
||||
if (!Emu && data[11] == 0x00 && data[12] == 0x00)
|
||||
g_Config.iExtensionConnected = EXT_NUNCHUCK;
|
||||
if (!Emu && data[11] == 0x01 && data[12] == 0x01)
|
||||
g_Config.iExtensionConnected = EXT_CLASSIC_CONTROLLER;
|
||||
g_Config.Save();
|
||||
WiiMoteEmu::UpdateEeprom();
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (m_ConfigFrame) m_ConfigFrame->UpdateGUI();
|
||||
if (m_BasicConfigFrame) m_BasicConfigFrame->UpdateGUI();
|
||||
#endif
|
||||
INFO_LOG(CONSOLE, "%s", TmpData.c_str());
|
||||
INFO_LOG(CONSOLE, "Game got the decrypted extension ID: %02x%02x%02x%02x%02x%02x\n\n", data[7], data[8], data[9], data[10], data[11], data[12]);
|
||||
|
@ -632,7 +624,7 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
|||
if(WiiMoteEmu::g_Encryption)
|
||||
wiimote_decrypt(&WiiMoteEmu::g_ExtKey, &data[0x07], 0x00, (data[4] >> 0x04) + 1);
|
||||
|
||||
if (g_Config.bNunchuckConnected)
|
||||
if (g_Config.iExtensionConnected == EXT_NUNCHUCK)
|
||||
{
|
||||
INFO_LOG(CONSOLE, "\nGame got the Nunchuck calibration:\n");
|
||||
INFO_LOG(CONSOLE, "Cal_zero.x: %i\n", data[7 + 0]);
|
||||
|
@ -1044,9 +1036,9 @@ double GetDoubleTime()
|
|||
wxDateTime datetime = wxDateTime::UNow(); // Get timestamp
|
||||
u64 TmpSeconds = Common::Timer::GetTimeSinceJan1970(); // Get continous timestamp
|
||||
|
||||
/* Remove a few years. We only really want enough seconds to make sure that we are
|
||||
detecting actual actions, perhaps 60 seconds is enough really, but I leave a
|
||||
year of seconds anyway, in case the user's clock is incorrect or something like that */
|
||||
// Remove a few years. We only really want enough seconds to make sure that we are
|
||||
// detecting actual actions, perhaps 60 seconds is enough really, but I leave a
|
||||
// year of seconds anyway, in case the user's clock is incorrect or something like that
|
||||
TmpSeconds = TmpSeconds - (38 * 365 * 24 * 60 * 60);
|
||||
|
||||
//if (TmpSeconds < 0) return 0; // Check the the user's clock is working somewhat
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -16,9 +16,6 @@
|
|||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include <iostream> // System
|
||||
#include <queue>
|
||||
|
||||
|
@ -37,12 +34,8 @@
|
|||
#include "EmuDefinitions.h"
|
||||
#define EXCLUDE_H // Avoid certain declarations in wiimote_real.h
|
||||
#include "wiimote_real.h"
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
#include "ConfigDlg.h"
|
||||
#endif
|
||||
|
||||
extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
////////////////////////////////////////
|
||||
|
||||
|
||||
namespace WiiMoteReal
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
// Copyright (C) 2003-2009 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
|
||||
|
@ -20,12 +20,8 @@
|
|||
#define WIIMOTE_REAL_H
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
#include "wiiuse.h"
|
||||
#include "ChunkFile.h"
|
||||
///////////////////////////////////
|
||||
|
||||
|
||||
namespace WiiMoteReal
|
||||
|
|
Loading…
Reference in New Issue