Permalink
Browse files

Initial commit from upstream

  • Loading branch information...
0 parents commit e1f77b38406eb53b7499cec3885989f31de99c1f @d235j d235j committed Sep 25, 2013
Showing with 19,175 additions and 0 deletions.
  1. +390 −0 360Controller/360Controller.xcodeproj/project.pbxproj
  2. +150 −0 360Controller/ChatPad.cpp
  3. +53 −0 360Controller/ChatPad.h
  4. +115 −0 360Controller/ControlStruct.h
  5. +211 −0 360Controller/Controller.cpp
  6. +53 −0 360Controller/Controller.h
  7. +4 −0 360Controller/English.lproj/InfoPlist.strings
  8. +56 −0 360Controller/Info copy.plist
  9. +1,453 −0 360Controller/Info.plist
  10. +861 −0 360Controller/_60Controller.cpp
  11. +126 −0 360Controller/_60Controller.h
  12. +58 −0 360Controller/chatpadhid.h
  13. +54 −0 360Controller/chatpadkeys.cpp
  14. +24 −0 360Controller/chatpadkeys.h
  15. +16 −0 360Controller/version.plist
  16. +125 −0 360Controller/xbox360hid.h
  17. +79 −0 360Daemon/360Daemon.1
  18. +308 −0 360Daemon/360Daemon.m
  19. +248 −0 360Daemon/360Daemon.xcodeproj/project.pbxproj
  20. +7 −0 360Daemon/360Daemon_Prefix.pch
  21. BIN 360Daemon/Alert.tif
  22. +45 −0 360Daemon/ControlPrefs.h
  23. +102 −0 360Daemon/ControlPrefs.m
  24. +259 −0 360Daemon/FoundationTool.pbproj/project.pbxproj
  25. +16 −0 360Daemon/com.mice.360Daemon.plist
  26. +79 −0 DriverTool/DriverTool.1
  27. +194 −0 DriverTool/DriverTool.m
  28. +235 −0 DriverTool/DriverTool.xcodeproj/project.pbxproj
  29. +7 −0 DriverTool/DriverTool_Prefix.pch
  30. +4 −0 Feedback360/English.lproj/InfoPlist.strings
  31. +1,326 −0 Feedback360/Feedback360.xcodeproj/colin.mode1
  32. +285 −0 Feedback360/Feedback360.xcodeproj/project.pbxproj
  33. +40 −0 Feedback360/Info.plist
  34. +62 −0 Feedback360/devlink.c
  35. +33 −0 Feedback360/devlink.h
  36. +343 −0 Feedback360/emulator.c
  37. +112 −0 Feedback360/emulator.h
  38. +447 −0 Feedback360/main.c
  39. +58 −0 Feedback360/main.h
  40. +16 −0 Feedback360/version.plist
  41. +1,065 −0 Install360Controller/Install360Controller.pkgproj
  42. +5 −0 Install360Controller/Scripts/finish.sh
  43. +38 −0 Install360Controller/Scripts/upgrade.sh
  44. +148 −0 Install360Controller/Text/Welcome.rtf
  45. +340 −0 Licence.txt
  46. +44 −0 Pref360Control/DeviceItem.h
  47. +100 −0 Pref360Control/DeviceItem.m
  48. +41 −0 Pref360Control/DeviceLister.h
  49. +522 −0 Pref360Control/DeviceLister.m
  50. BIN Pref360Control/English.lproj/InfoPlist.strings
  51. +2,148 −0 Pref360Control/English.lproj/Pref360ControlPref.nib/designable.nib
  52. BIN Pref360Control/English.lproj/Pref360ControlPref.nib/keyedobjects.nib
  53. +34 −0 Pref360Control/Info.plist
  54. +39 −0 Pref360Control/MyAnalogStick.h
  55. +133 −0 Pref360Control/MyAnalogStick.m
  56. +34 −0 Pref360Control/MyCentreButtons.h
  57. +95 −0 Pref360Control/MyCentreButtons.m
  58. +36 −0 Pref360Control/MyDigitalStick.h
  59. +132 −0 Pref360Control/MyDigitalStick.m
  60. +35 −0 Pref360Control/MyMainButtons.h
  61. +119 −0 Pref360Control/MyMainButtons.m
  62. +32 −0 Pref360Control/MyShoulderButton.h
  63. +59 −0 Pref360Control/MyShoulderButton.m
  64. +507 −0 Pref360Control/Pref360Control.xcodeproj/project.pbxproj
  65. +93 −0 Pref360Control/Pref360ControlPref.h
  66. +716 −0 Pref360Control/Pref360ControlPref.m
  67. +8 −0 Pref360Control/Pref360Control_Prefix.pch
  68. BIN Pref360Control/batt0.tif
  69. BIN Pref360Control/batt1.tif
  70. BIN Pref360Control/batt2.tif
  71. BIN Pref360Control/batt3.tif
  72. BIN Pref360Control/battNone.tif
  73. BIN Pref360Control/pref360controlpref.tiff
  74. +18 −0 Pref360Control/version.plist
  75. +86 −0 Readme.rtf
  76. BIN Wireless360Controller/English.lproj/InfoPlist.strings
  77. +311 −0 Wireless360Controller/IOKitDriver.pbproj/project.pbxproj
  78. +58 −0 Wireless360Controller/Info.plist
  79. +248 −0 Wireless360Controller/Wireless360Controller.cpp
  80. +61 −0 Wireless360Controller/Wireless360Controller.h
  81. +259 −0 Wireless360Controller/Wireless360Controller.xcodeproj/project.pbxproj
  82. +16 −0 Wireless360Controller/version.plist
  83. +3 −0 WirelessGamingReceiver/English.lproj/InfoPlist.strings
  84. +311 −0 WirelessGamingReceiver/IOKitDriver.pbproj/project.pbxproj
  85. +72 −0 WirelessGamingReceiver/Info.plist
  86. +113 −0 WirelessGamingReceiver/WirelessDevice.cpp
  87. +58 −0 WirelessGamingReceiver/WirelessDevice.h
  88. +588 −0 WirelessGamingReceiver/WirelessGamingReceiver.cpp
  89. +89 −0 WirelessGamingReceiver/WirelessGamingReceiver.h
  90. +1,564 −0 WirelessGamingReceiver/WirelessGamingReceiver.xcodeproj/colin.mode1
  91. +280 −0 WirelessGamingReceiver/WirelessGamingReceiver.xcodeproj/project.pbxproj
  92. +282 −0 WirelessGamingReceiver/WirelessHIDDevice.cpp
  93. +60 −0 WirelessGamingReceiver/WirelessHIDDevice.h
  94. +30 −0 WirelessGamingReceiver/devices.h
  95. +16 −0 WirelessGamingReceiver/version.plist
  96. +75 −0 build
Oops, something went wrong.
@@ -0,0 +1,150 @@
+/*
+ MICE Xbox 360 Controller driver for Mac OS X
+ Copyright (C) 2006-2013 Colin Munro
+
+ ChatPad.cpp - Implementation of the ChatPad Accessory driver
+
+ This file is part of Xbox360Controller.
+
+ Xbox360Controller 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; either version 2 of the License, or
+ (at your option) any later version.
+
+ Xbox360Controller 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 for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Foobar; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <IOKit/IOLib.h>
+#include "ChatPad.h"
+namespace HID_ChatPad {
+#include "chatpadhid.h"
+}
+#include "chatpadkeys.h"
+#include "_60Controller.h"
+
+OSDefineMetaClassAndStructors(ChatPadKeyboardClass, IOHIDDevice)
+
+IOReturn ChatPadKeyboardClass::newReportDescriptor(IOMemoryDescriptor **descriptor) const
+{
+ IOBufferMemoryDescriptor *buffer;
+
+ buffer = IOBufferMemoryDescriptor::inTaskWithOptions(kernel_task, 0, sizeof(HID_ChatPad::ReportDescriptor));
+ if (buffer == NULL)
+ return kIOReturnNoResources;
+ buffer->writeBytes(0, HID_ChatPad::ReportDescriptor, sizeof(HID_ChatPad::ReportDescriptor));
+ *descriptor = buffer;
+ return kIOReturnSuccess;
+}
+
+IOReturn ChatPadKeyboardClass::setReport(IOMemoryDescriptor *report, IOHIDReportType reportType, IOOptionBits options)
+{
+ // Maybe add LED support later?
+ return kIOReturnUnsupported;
+}
+
+IOReturn ChatPadKeyboardClass::getReport(IOMemoryDescriptor *report, IOHIDReportType reportType, IOOptionBits options)
+{
+ return kIOReturnUnsupported;
+}
+
+IOReturn ChatPadKeyboardClass::handleReport(IOMemoryDescriptor *report, IOHIDReportType reportType, IOOptionBits options)
+{
+ IOBufferMemoryDescriptor *realReport = OSDynamicCast(IOBufferMemoryDescriptor, report);
+ if (realReport != NULL)
+ {
+ unsigned char *data = (unsigned char*)realReport->getBytesNoCopy();
+ if (data[0] == 0x00)
+ {
+ for (int i = 2; i < 5; i++)
+ {
+ data[i] = ChatPad2USB(data[i]);
+ }
+ }
+ }
+ return IOHIDDevice::handleReport(report, reportType, options);
+}
+
+OSNumber* ChatPadKeyboardClass::newPrimaryUsageNumber() const
+{
+ return OSNumber::withNumber(HID_ChatPad::ReportDescriptor[3], 8);
+}
+
+OSNumber* ChatPadKeyboardClass::newPrimaryUsagePageNumber() const
+{
+ return OSNumber::withNumber(HID_ChatPad::ReportDescriptor[1], 8);
+}
+
+OSString* ChatPadKeyboardClass::newProductString() const
+{
+ return OSString::withCString("ChatPad");
+}
+
+OSString* ChatPadKeyboardClass::newTransportString() const
+{
+ return OSString::withCString("Serial");
+}
+
+OSNumber* ChatPadKeyboardClass::newVendorIDNumber() const
+{
+ // Same as USB
+ return OSNumber::withNumber(100, 32);
+}
+
+OSNumber* ChatPadKeyboardClass::newProductIDNumber() const
+{
+ // Same as USB, plus one
+ return OSNumber::withNumber(100, 32);
+}
+
+static IOHIDDevice* GetParent(const IOService *current)
+{
+ Xbox360Peripheral *owner;
+
+ owner = OSDynamicCast(Xbox360Peripheral, current->getProvider());
+ if (owner == NULL)
+ return NULL;
+ return owner->getController(0);
+}
+
+bool ChatPadKeyboardClass::start(IOService *provider)
+{
+ if (!IOHIDDevice::start(provider))
+ return false;
+ return OSDynamicCast(Xbox360Peripheral, provider) != NULL;
+}
+
+OSString* ChatPadKeyboardClass::newManufacturerString() const
+{
+ IOHIDDevice *device = GetParent(this);
+ if (device == NULL)
+ return NULL;
+ return device->newManufacturerString();
+}
+
+OSString* ChatPadKeyboardClass::newSerialNumberString() const
+{
+ IOHIDDevice *device = GetParent(this);
+ if (device == NULL)
+ return NULL;
+ return device->newSerialNumberString();
+}
+
+OSNumber* ChatPadKeyboardClass::newLocationIDNumber() const
+{
+ IOHIDDevice *device = GetParent(this);
+ if (device == NULL)
+ return NULL;
+ OSNumber *number = device->newLocationIDNumber();
+ if (number == NULL)
+ return NULL;
+ UInt32 value = number->unsigned32BitValue();
+ number->release();
+ return OSNumber::withNumber(value + 1, 32);
+}
@@ -0,0 +1,53 @@
+/*
+ MICE Xbox 360 Controller driver for Mac OS X
+ Copyright (C) 2006-2013 Colin Munro
+
+ ChatPad.h - Driver class for the ChatPad accessory
+
+ This file is part of Xbox360Controller.
+
+ Xbox360Controller 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; either version 2 of the License, or
+ (at your option) any later version.
+
+ Xbox360Controller 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 for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Foobar; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <IOKit/hid/IOHIDDevice.h>
+
+class ChatPadKeyboardClass : public IOHIDDevice
+{
+ OSDeclareDefaultStructors(ChatPadKeyboardClass)
+
+private:
+
+public:
+ virtual bool start(IOService *provider);
+
+ // IOHidDevice methods
+ virtual IOReturn newReportDescriptor(IOMemoryDescriptor **descriptor) const;
+
+ virtual IOReturn setReport(IOMemoryDescriptor *report,IOHIDReportType reportType,IOOptionBits options=0);
+ virtual IOReturn getReport(IOMemoryDescriptor *report,IOHIDReportType reportType,IOOptionBits options);
+
+ virtual IOReturn handleReport(IOMemoryDescriptor *report, IOHIDReportType reportType = kIOHIDReportTypeInput, IOOptionBits options = 0);
+
+ virtual OSString* newManufacturerString() const;
+ virtual OSNumber* newPrimaryUsageNumber() const;
+ virtual OSNumber* newPrimaryUsagePageNumber() const;
+ virtual OSNumber* newProductIDNumber() const;
+ virtual OSString* newProductString() const;
+ virtual OSString* newSerialNumberString() const;
+ virtual OSString* newTransportString() const;
+ virtual OSNumber* newVendorIDNumber() const;
+
+ virtual OSNumber* newLocationIDNumber() const;
+};
@@ -0,0 +1,115 @@
+/*
+ MICE Xbox 360 Controller driver for Mac OS X
+ Copyright (C) 2006-2013 Colin Munro
+
+ ControlStruct.h - Structures used by the device
+
+ This file is part of Xbox360Controller.
+
+ Xbox360Controller 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; either version 2 of the License, or
+ (at your option) any later version.
+
+ Xbox360Controller 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 for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Foobar; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#ifndef __CONTROLSTRUCT_H__
+#define __CONTROLSTRUCT_H__
+
+typedef UInt8 XBox360_Byte;
+typedef UInt16 XBox360_Short;
+typedef SInt16 XBox360_SShort;
+
+#define Xbox360_Prepare(x,t) {memset(&x,0,sizeof(x));x.header.command=t;x.header.size=sizeof(x);}
+
+#define PACKED __attribute__((__packed__))
+
+// Common structure format
+typedef struct {
+ XBox360_Byte command;
+ XBox360_Byte size;
+} PACKED XBOX360_PACKET;
+
+// Analog stick format
+typedef struct {
+ XBox360_SShort x,y;
+} PACKED XBOX360_HAT;
+
+// Structure describing the report had back from the controller
+typedef struct {
+ XBOX360_PACKET header;
+ XBox360_Short buttons;
+ XBox360_Byte trigL,trigR;
+ XBOX360_HAT left,right;
+ XBox360_Byte reserved[6];
+} PACKED XBOX360_IN_REPORT;
+
+// Structure describing the command to change LED status
+typedef struct {
+ XBOX360_PACKET header;
+ XBox360_Byte pattern;
+} PACKED XBOX360_OUT_LED;
+
+// Structure describing the command to change rumble motor status
+typedef struct {
+ XBOX360_PACKET header;
+ XBox360_Byte reserved1;
+ XBox360_Byte big,little;
+ XBox360_Byte reserved[3];
+} PACKED XBOX360_OUT_RUMBLE;
+
+// Enumeration of command types
+enum {
+ // In
+ inReport = 0,
+ // Out
+ outRumble = 0,
+ outLed = 1
+};
+
+// Button bits
+enum {
+ btnHatRight = 0x8000,
+ btnHatLeft = 0x4000,
+ btnBack = 0x2000,
+ btnStart = 0x1000,
+ btnDigiRight = 0x0800,
+ btnDigiLeft = 0x0400,
+ btnDigiDown = 0x0200,
+ btnDigiUp = 0x0100,
+ btnY = 0x0080,
+ btnX = 0x0040,
+ btnB = 0x0020,
+ btnA = 0x0010,
+ btnReserved1 = 0x0008, // Unused?
+ btnXbox = 0x0004,
+ btnShoulderRight = 0x0002,
+ btnShoulderLeft = 0x0001
+};
+
+// LED values
+enum {
+ ledOff = 0x00,
+ ledBlinkingAll = 0x01,
+ ledFlashOn1 = 0x02,
+ ledFlashOn2 = 0x03,
+ ledFlashOn3 = 0x04,
+ ledFlashOn4 = 0x05,
+ ledOn1 = 0x06,
+ ledOn2 = 0x07,
+ ledOn3 = 0x08,
+ ledOn4 = 0x09,
+ ledRotating = 0x0a,
+ ledBlinking = 0x0b, // Blinking of previously enabled LED (e.g. from 0x01-0x09)
+ ledBlinkingSlow = 0x0c, // As above
+ ldAlternating = 0x0d // 1+4, 2+3, then back to previous after a short time
+};
+
+#endif // __CONTROLSTRUCT_H__
Oops, something went wrong.

0 comments on commit e1f77b3

Please sign in to comment.