New Wiimote Plugin: Added a "Hybrid Wiimote" input source type. This allows a real wiimote to be used with an emulated extension.(and in the future, real wiimote with emulated motion plus) If the emulated extension is set to "None", a real extension can be used. Real/Emulated buttons are combined. Real acceleration data is used. Currently, emulated IR data is used.(might change this to allow both) Switching between an emulated and a real extension in-game is a bit testy right now, but if you switch the emu-extension to "None" before connecting a real extension, it usually works.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6082 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak
2010-08-10 04:12:32 +00:00
parent a1daa636c2
commit 2b45e87b3e
9 changed files with 603 additions and 417 deletions

View File

@ -21,6 +21,9 @@
#include "wiiuse.h"
#include "ChunkFile.h"
#include "Thread.h"
#include "FifoQueue.h"
#include "../WiimoteEmu/WiimoteEmu.h"
#include "../../InputCommon/Src/InputConfig.h"
@ -33,13 +36,53 @@ extern SWiimoteInitialize g_WiimoteInitialize;
enum
{
WIIMOTE_SRC_NONE = 0,
WIIMOTE_SRC_EMU,
WIIMOTE_SRC_REAL,
WIIMOTE_SRC_EMU = 1,
WIIMOTE_SRC_REAL = 2,
WIIMOTE_SRC_HYBRID = 3, // emu + real
};
namespace WiimoteReal
{
class Wiimote
{
friend class WiimoteEmu::Wiimote;
public:
Wiimote(wiimote_t* const wm, const unsigned int index);
~Wiimote();
void ControlChannel(const u16 channel, const void* const data, const u32 size);
void InterruptChannel(const u16 channel, const void* const data, const u32 size);
void Update();
u8* ProcessReadQueue();
void Read();
void Write();
void Disconnect();
void DisableDataReporting();
void SendPacket(const u8 rpt_id, const void* const data, const unsigned int size);
// pointer to data, and size of data
typedef std::pair<u8*,u8> Report;
protected:
u8 *m_last_data_report;
u16 m_channel;
private:
void ClearReports();
wiimote_t* const m_wiimote;
const unsigned int m_index;
Common::FifoQueue<u8*> m_read_reports;
Common::FifoQueue<Report> m_write_reports;
};
extern Common::CriticalSection g_refresh_critsec;
extern Wiimote *g_wiimotes[4];
unsigned int Initialize();
void Shutdown();
void Refresh();