summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorGlenn Rice <glennricster@gmail.com>2010-12-31 15:47:42 +0000
committerGlenn Rice <glennricster@gmail.com>2010-12-31 15:47:42 +0000
commit4b3a6a6d474a8cea3a00a10a92d684983b4e78d5 (patch)
tree818623ccbb65c99ba9e7ddbe56a2848b6554e350 /Source/Core
parentbc78a98cbcbf5b1fc2e31881ba10fe985d4724a9 (diff)
This should fix wiimote extensions on linux. Now to figure out the windows issue, and then OSX ... Sigh!
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6702 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/HW/WiimoteReal/IONix.cpp2
-rw-r--r--Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp6
-rw-r--r--Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h116
3 files changed, 62 insertions, 62 deletions
diff --git a/Source/Core/Core/Src/HW/WiimoteReal/IONix.cpp b/Source/Core/Core/Src/HW/WiimoteReal/IONix.cpp
index a9233c21bb..cc8a51a8d1 100644
--- a/Source/Core/Core/Src/HW/WiimoteReal/IONix.cpp
+++ b/Source/Core/Core/Src/HW/WiimoteReal/IONix.cpp
@@ -223,7 +223,7 @@ unsigned char *Wiimote::IORead()
// Read the pending message into the buffer
unsigned char *buffer = new unsigned char[MAX_PAYLOAD];
- r = read(in_sock, buffer, sizeof(buffer));
+ r = read(in_sock, buffer, sizeof(unsigned char) * MAX_PAYLOAD);
if (r == -1)
{
// Error reading data
diff --git a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
index 442cd88bb7..dad72a6bdf 100644
--- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
+++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
@@ -51,11 +51,11 @@ Wiimote *g_wiimotes[MAX_WIIMOTES];
Wiimote::Wiimote(const unsigned int _index)
: index(_index)
#if defined(__linux__) && HAVE_BLUEZ
- , out_sock(-1), in_sock(-1)
+ , out_sock(-1), in_sock(-1)
#elif defined(_WIN32)
- , dev_handle(0), stack(MSBT_STACK_UNKNOWN)
+ , dev_handle(0), stack(MSBT_STACK_UNKNOWN)
#endif
- , leds(0) , m_last_data_report(NULL) , m_channel(0) , m_connected(false)
+ , leds(0), m_last_data_report(NULL), m_channel(0), m_connected(false)
{
#if defined(__linux__) && HAVE_BLUEZ
bdaddr = (bdaddr_t){{0, 0, 0, 0, 0, 0}};
diff --git a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h
index 7f152a4205..06d0be40f0 100644
--- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h
+++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.h
@@ -42,74 +42,74 @@ namespace WiimoteReal
class Wiimote
{
- friend class WiimoteEmu::Wiimote;
- public:
- Wiimote(const unsigned int _index);
- ~Wiimote();
+friend class WiimoteEmu::Wiimote;
+public:
+ Wiimote(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();
+ 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();
+ u8* ProcessReadQueue();
- bool Read();
- bool Write();
- bool Connect();
- bool IsConnected();
- void Disconnect();
- void DisableDataReporting();
- void Rumble();
- void SendPacket(const u8 rpt_id, const void* const data, const unsigned int size);
+ bool Read();
+ bool Write();
+ bool Connect();
+ bool IsConnected();
+ void Disconnect();
+ void DisableDataReporting();
+ void Rumble();
+ 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;
+ // Pointer to data, and size of data
+ typedef std::pair<u8*,u8> Report;
- const unsigned int index;
+ const unsigned int index;
#if defined(__APPLE__)
- IOBluetoothDevice *btd;
- IOBluetoothL2CAPChannel *ichan;
- IOBluetoothL2CAPChannel *cchan;
- #define QUEUE_SIZE 64
- struct qbuffer
- {
- char data[MAX_PAYLOAD];
- int len;
- } queue[QUEUE_SIZE];
- int reader;
- int writer;
- int outstanding;
- int watermark;
+ IOBluetoothDevice *btd;
+ IOBluetoothL2CAPChannel *ichan;
+ IOBluetoothL2CAPChannel *cchan;
+#define QUEUE_SIZE 64
+ struct qbuffer
+ {
+ char data[MAX_PAYLOAD];
+ int len;
+ } queue[QUEUE_SIZE];
+ int reader;
+ int writer;
+ int outstanding;
+ int watermark;
#elif defined(__linux__) && HAVE_BLUEZ
- bdaddr_t bdaddr; // Bluetooth address
- int out_sock; // Output socket
- int in_sock; // Input socket
+ bdaddr_t bdaddr; // Bluetooth address
+ int out_sock; // Output socket
+ int in_sock; // Input socket
#elif defined(_WIN32)
- char devicepath[255]; // Unique wiimote reference
- //ULONGLONG btaddr; // Bluetooth address
- HANDLE dev_handle; // HID handle
- OVERLAPPED hid_overlap; // Overlap handle
- enum win_bt_stack_t stack; // Type of bluetooth stack to use
+ char devicepath[255]; // Unique wiimote reference
+ //ULONGLONG btaddr; // Bluetooth address
+ HANDLE dev_handle; // HID handle
+ OVERLAPPED hid_overlap; // Overlap handle
+ enum win_bt_stack_t stack; // Type of bluetooth stack to use
#endif
- unsigned char leds; // Currently lit leds
-
- protected:
- u8 *m_last_data_report;
- u16 m_channel;
-
- private:
- void ClearReadQueue();
- void RealDisconnect();
- bool SendRequest(unsigned char report_type, unsigned char* data, int length);
- bool Handshake();
- void SetLEDs(int leds);
- unsigned char *IORead();
- int IOWrite(unsigned char* buf, int len);
-
- bool m_connected;
- Common::FifoQueue<u8*> m_read_reports;
- Common::FifoQueue<Report> m_write_reports;
+ unsigned char leds; // Currently lit leds
+
+protected:
+ u8 *m_last_data_report;
+ u16 m_channel;
+
+private:
+ void ClearReadQueue();
+ void RealDisconnect();
+ bool SendRequest(unsigned char report_type, unsigned char* data, int length);
+ bool Handshake();
+ void SetLEDs(int leds);
+ unsigned char *IORead();
+ int IOWrite(unsigned char* buf, int len);
+
+ bool m_connected;
+ Common::FifoQueue<u8*> m_read_reports;
+ Common::FifoQueue<Report> m_write_reports;
};
extern Common::CriticalSection g_refresh_critsec;