mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 10:09:36 -06:00
Moved InputPluginCommon into the Plugins directory. I don't think it made sense in Core. Some minor fixes to the new wiimote plugin also.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5362 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -44,7 +44,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\..\Core\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;Plugin_WiimoteNew_TEST_EXPORTS;_SECURE_SCL=0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@ -130,7 +130,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\..\Core\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;Plugin_WiimoteNew_TEST_EXPORTS;_SECURE_SCL=0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@ -213,7 +213,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\..\Core\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;Plugin_WiimoteNew_TEST_EXPORTS;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="0"
|
||||
AssemblerListingLocation="$(IntDir)\"
|
||||
@ -299,7 +299,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\..\Core\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;Plugin_WiimoteNew_TEST_EXPORTS;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="0"
|
||||
AssemblerListingLocation="$(IntDir)\"
|
||||
@ -382,7 +382,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\..\Core\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
PreprocessorDefinitions="DEBUGFAST;WIN32;NDEBUG;_WINDOWS;_USRDLL;Plugin_WiimoteNew_TEST_EXPORTS;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
RuntimeLibrary="0"
|
||||
WarningLevel="3"
|
||||
@ -465,7 +465,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\..\Core\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\Include;..\..\Core\Common\Src;..\InputPluginCommon\Src;..\..\Core\InputCommon\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;Plugin_WiimoteNew_TEST_EXPORTS;DEBUGFAST;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
RuntimeLibrary="0"
|
||||
WarningLevel="3"
|
||||
|
@ -68,7 +68,7 @@ void Wiimote::ReportMode(u16 _channelID, wm_report_mode* dr)
|
||||
m_reporting_channel = _channelID;
|
||||
|
||||
if (0 == dr->all_the_time)
|
||||
PanicAlert("Wiimote: Reporting Always is set to OFF!");
|
||||
PanicAlert("Wiimote: Reporting Always is set to OFF! Everything should be fine, but games never do this.");
|
||||
|
||||
// Validation check
|
||||
switch (dr->mode)
|
||||
@ -200,23 +200,21 @@ void Wiimote::RequestStatus(u16 _channelID, wm_request_status* rs, int Extension
|
||||
// handle switch extension
|
||||
if ( m_extension->active_extension != m_extension->switch_extension )
|
||||
{
|
||||
if ( m_extension->active_extension && m_extension->switch_extension )
|
||||
// detach extension first
|
||||
// if an extension is currently connected and we want to switch to a different extension
|
||||
if ( (m_extension->active_extension > 0) && m_extension->switch_extension )
|
||||
// detach extension first, wait til next Update() or RequestStatus() call to change to the new extension
|
||||
m_extension->active_extension = 0;
|
||||
else
|
||||
// set the wanted extension
|
||||
m_extension->active_extension = m_extension->switch_extension;
|
||||
|
||||
|
||||
// update status struct
|
||||
m_status.extension = m_extension->active_extension ? 1 : 0;
|
||||
|
||||
// set register, I hate this line
|
||||
m_register[ 0xa40000 ] = ((WiimoteEmu::Attachment*)m_extension->attachments[ m_extension->active_extension ])->reg;
|
||||
|
||||
// Wiibrew: Following a connection or disconnection event on the Extension Port,
|
||||
// data reporting is disabled and the Data Reporting Mode must be reset before new data can arrive.
|
||||
m_reporting_auto = false;
|
||||
}
|
||||
|
||||
// extension status
|
||||
m_status.extension = m_extension->active_extension ? 1 : 0;
|
||||
|
||||
// set up report
|
||||
u8 data[8];
|
||||
data[0] = 0xA1;
|
||||
@ -317,14 +315,13 @@ void Wiimote::ReadData(u16 _channelID, wm_read_data* rd)
|
||||
// Read from EEPROM
|
||||
if (address + size > WIIMOTE_EEPROM_FREE_SIZE)
|
||||
{
|
||||
// generate a read error
|
||||
size = 0;
|
||||
|
||||
if (address + size > WIIMOTE_EEPROM_SIZE)
|
||||
{
|
||||
PanicAlert("ReadData: address + size out of bounds");
|
||||
return;
|
||||
}
|
||||
// generate a read error
|
||||
size = 0;
|
||||
}
|
||||
SendReadDataReply(_channelID, m_eeprom + address, address, size);
|
||||
}
|
||||
|
@ -76,6 +76,10 @@ void Wiimote::Reset()
|
||||
m_reporting_channel = 0;
|
||||
m_reporting_auto = false;
|
||||
|
||||
// will make the first Update() call send a status request
|
||||
// the first call to RequestStatus() will then set up the status struct extension bit
|
||||
m_extension->active_extension = -1;
|
||||
|
||||
// eeprom
|
||||
memset( m_eeprom, 0, sizeof(m_eeprom) );
|
||||
// calibration data
|
||||
@ -109,9 +113,6 @@ Wiimote::Wiimote( const unsigned int index, SWiimoteInitialize* const wiimote_in
|
||||
: m_index(index)
|
||||
, m_wiimote_init( wiimote_initialize )
|
||||
{
|
||||
// reset eeprom/register/values to default
|
||||
Reset();
|
||||
|
||||
// ---- set up all the controls ----
|
||||
|
||||
// buttons
|
||||
@ -157,6 +158,10 @@ Wiimote::Wiimote( const unsigned int index, SWiimoteInitialize* const wiimote_in
|
||||
groups.push_back( options = new ControlGroup( "Options" ) );
|
||||
options->settings.push_back( new ControlGroup::Setting( "Background Input", false ) );
|
||||
options->settings.push_back( new ControlGroup::Setting( "Sideways Wiimote", false ) );
|
||||
|
||||
|
||||
// --- reset eeprom/register/values to default ---
|
||||
Reset();
|
||||
}
|
||||
|
||||
std::string Wiimote::GetName() const
|
||||
@ -173,17 +178,23 @@ void Wiimote::Update()
|
||||
m_buttons->GetState( &m_status.buttons, button_bitmasks );
|
||||
m_dpad->GetState( &m_status.buttons, is_sideways ? dpad_sideways_bitmasks : dpad_bitmasks );
|
||||
|
||||
if ( false == m_reporting_auto )
|
||||
return;
|
||||
|
||||
// handle extension switching
|
||||
if ( m_extension->active_extension != m_extension->switch_extension )
|
||||
// check if a status report needs to be sent
|
||||
// this happens on wiimote sync and when extensions are switched
|
||||
if (m_extension->active_extension != m_extension->switch_extension)
|
||||
{
|
||||
RequestStatus( m_reporting_channel, NULL );
|
||||
// games don't seem to like me sending the status report and the data report
|
||||
return;
|
||||
|
||||
// Wiibrew: Following a connection or disconnection event on the Extension Port,
|
||||
// data reporting is disabled and the Data Reporting Mode must be reset before new data can arrive.
|
||||
|
||||
// after a game receives an unrequested status report,
|
||||
// it expects data reports to stop until it sets the reporting mode again
|
||||
m_reporting_auto = false;
|
||||
}
|
||||
|
||||
if ( false == m_reporting_auto )
|
||||
return;
|
||||
|
||||
// figure out what data we need
|
||||
size_t rpt_size = 0;
|
||||
size_t rpt_core = 0;
|
||||
|
Reference in New Issue
Block a user