diff --git a/Installers/Drivers/SCP_Driver/DIFxAPI/amd64/DIFxAPI.dll b/Installers/Drivers/SCP_Driver/DIFxAPI/amd64/DIFxAPI.dll
deleted file mode 100644
index 76ccfd2..0000000
Binary files a/Installers/Drivers/SCP_Driver/DIFxAPI/amd64/DIFxAPI.dll and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/ScpControl.dll b/Installers/Drivers/SCP_Driver/ScpControl.dll
deleted file mode 100644
index af5cd7c..0000000
Binary files a/Installers/Drivers/SCP_Driver/ScpControl.dll and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/ScpControl.xml b/Installers/Drivers/SCP_Driver/ScpControl.xml
deleted file mode 100644
index 7ed3fdf..0000000
--- a/Installers/Drivers/SCP_Driver/ScpControl.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- 600000
- False
- False
- False
- False
- False
- False
- False
- False
- 128
- 0
- 0
- False
-
\ No newline at end of file
diff --git a/Installers/Drivers/SCP_Driver/ScpDriver.exe b/Installers/Drivers/SCP_Driver/ScpDriver.exe
deleted file mode 100644
index 46db78a..0000000
Binary files a/Installers/Drivers/SCP_Driver/ScpDriver.exe and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/ScpMonitor.exe b/Installers/Drivers/SCP_Driver/ScpMonitor.exe
deleted file mode 100644
index b254eca..0000000
Binary files a/Installers/Drivers/SCP_Driver/ScpMonitor.exe and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/ScpService.InstallLog b/Installers/Drivers/SCP_Driver/ScpService.InstallLog
deleted file mode 100644
index 5892b2e..0000000
--- a/Installers/Drivers/SCP_Driver/ScpService.InstallLog
+++ /dev/null
@@ -1,56 +0,0 @@
-Installing assembly 'C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe'.
-Affected parameters are:
- assemblypath = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe
- logfile = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog
-Installing service Ds3Service...
-Service Ds3Service has been successfully installed.
-Creating EventLog source Ds3Service in log Application...
-See the contents of the log file for the C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe assembly's progress.
-The file is located at C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog.
-Committing assembly 'C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe'.
-Affected parameters are:
- logtoconsole =
- assemblypath = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe
- logfile = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog
-Uninstalling assembly 'C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe'.
-Affected parameters are:
- assemblypath = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe
- logfile = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog
-Removing EventLog source Ds3Service.
-Service Ds3Service is being removed from the system...
-Service Ds3Service was successfully removed from the system.
-Installing assembly 'C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe'.
-Affected parameters are:
- assemblypath = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe
- logfile = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog
-Installing service Ds3Service...
-Service Ds3Service has been successfully installed.
-Creating EventLog source Ds3Service in log Application...
-See the contents of the log file for the C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe assembly's progress.
-The file is located at C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog.
-Committing assembly 'C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe'.
-Affected parameters are:
- logtoconsole =
- assemblypath = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe
- logfile = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog
-Uninstalling assembly 'C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe'.
-Affected parameters are:
- assemblypath = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe
- logfile = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog
-Removing EventLog source Ds3Service.
-Service Ds3Service is being removed from the system...
-Service Ds3Service was successfully removed from the system.
-Installing assembly 'C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe'.
-Affected parameters are:
- assemblypath = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe
- logfile = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog
-Installing service Ds3Service...
-Service Ds3Service has been successfully installed.
-Creating EventLog source Ds3Service in log Application...
-See the contents of the log file for the C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe assembly's progress.
-The file is located at C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog.
-Committing assembly 'C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe'.
-Affected parameters are:
- logtoconsole =
- assemblypath = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.exe
- logfile = C:\Users\Justin\Desktop\ScpServer\bin\ScpService.InstallLog
diff --git a/Installers/Drivers/SCP_Driver/ScpService.InstallState b/Installers/Drivers/SCP_Driver/ScpService.InstallState
deleted file mode 100644
index 16079ef..0000000
--- a/Installers/Drivers/SCP_Driver/ScpService.InstallState
+++ /dev/null
@@ -1 +0,0 @@
-0.7223_reserved_nestedSavedStates_reserved_lastInstallerAttempted0.72230.7247Account-1LocalSystem0.7247installedtrue00.7267alreadyRegisteredbaseInstalledAndPlatformOKlogExists-1falsetruetrue10
\ No newline at end of file
diff --git a/Installers/Drivers/SCP_Driver/ScpService.exe b/Installers/Drivers/SCP_Driver/ScpService.exe
deleted file mode 100644
index 8ae6d8e..0000000
Binary files a/Installers/Drivers/SCP_Driver/ScpService.exe and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/System/BthWinUsb.cat b/Installers/Drivers/SCP_Driver/System/BthWinUsb.cat
deleted file mode 100644
index 169cb02..0000000
Binary files a/Installers/Drivers/SCP_Driver/System/BthWinUsb.cat and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/System/BthWinUsb.inf b/Installers/Drivers/SCP_Driver/System/BthWinUsb.inf
deleted file mode 100644
index c390687..0000000
--- a/Installers/Drivers/SCP_Driver/System/BthWinUsb.inf
+++ /dev/null
@@ -1,227 +0,0 @@
-; =============================================================================
-; Copyright (c) Scarlet.Crush Productions 2012, 2013. All rights reserved.
-;
-; BthWinUsb.inf
-; =============================================================================
-
-[Version]
-Signature = "$Windows NT$"
-Class = UsbDevice
-ClassGuid = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
-Provider = %ProviderName%
-DriverVer = 05/05/2013, 1.0.0.103
-CatalogFile = BthWinUsb.cat
-
-; =============================================================================
-
-[ClassInstall32]
-Addreg = SCPWinUsbClassReg
-
-[SCPWinUsbClassReg]
-HKR,,,0,%ClassName%
-HKR,,Icon,,-20
-
-; =============================================================================
-
-[DestinationDirs]
-CoInstallers_CopyFiles = 11
-
-[Manufacturer]
-%ProviderName% = SCProductions, NTx86, NTamd64
-
-[SourceDisksNames]
-1 = %DISK_NAME%,,,\x86
-2 = %DISK_NAME%,,,\amd64
-
-[SCProductions.NTx86]
-%DeviceName% = USB_Install, USB\VID_03F0&PID_231D
-%DeviceName% = USB_Install, USB\VID_044E&PID_3010
-%DeviceName% = USB_Install, USB\VID_045E&PID_3500
-%DeviceName% = USB_Install, USB\VID_0461&PID_4D75
-%DeviceName% = USB_Install, USB\VID_046D&PID_C709
-%DeviceName% = USB_Install, USB\VID_047D&PID_105E
-%DeviceName% = USB_Install, USB\VID_0489&PID_E011
-%DeviceName% = USB_Install, USB\VID_0489&PID_E027
-%DeviceName% = USB_Install, USB\VID_0489&PID_E042
-%DeviceName% = USB_Install, USB\VID_0489&PID_E04D
-%DeviceName% = USB_Install, USB\VID_0489&PID_E04E
-%DeviceName% = USB_Install, USB\VID_04CA&PID_3006
-%DeviceName% = USB_Install, USB\VID_050D&PID_016A
-%DeviceName% = USB_Install, USB\VID_050D&PID_065A
-%DeviceName% = USB_Install, USB\VID_05AC&PID_8216
-%DeviceName% = USB_Install, USB\VID_05AC&PID_821A
-%DeviceName% = USB_Install, USB\VID_05AC&PID_821D
-%DeviceName% = USB_Install, USB\VID_05AC&PID_821F
-%DeviceName% = USB_Install, USB\VID_05AC&PID_8286
-%DeviceName% = USB_Install, USB\VID_07D1&PID_F101
-%DeviceName% = USB_Install, USB\VID_0930&PID_0214
-%DeviceName% = USB_Install, USB\VID_0930&PID_0215
-%DeviceName% = USB_Install, USB\VID_0A12&PID_0001
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_200A
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2021
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2100
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2101
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2146
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2148
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2150
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2153
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2154
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_217D
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2190
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2198
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_21B4
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_21E1
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_21E3
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_21E8
-%DeviceName% = USB_Install, USB\VID_0B05&PID_1715
-%DeviceName% = USB_Install, USB\VID_0B05&PID_1783
-%DeviceName% = USB_Install, USB\VID_0B05&PID_1785
-%DeviceName% = USB_Install, USB\VID_0B05&PID_1788
-%DeviceName% = USB_Install, USB\VID_0B05&PID_179C
-%DeviceName% = USB_Install, USB\VID_0B05&PID_17B5
-%DeviceName% = USB_Install, USB\VID_0B05&PID_B700
-%DeviceName% = USB_Install, USB\VID_0BDA&PID_0724
-%DeviceName% = USB_Install, USB\VID_0BDA&PID_8723
-%DeviceName% = USB_Install, USB\VID_0C10&PID_0000
-%DeviceName% = USB_Install, USB\VID_0CF3&PID_3002
-%DeviceName% = USB_Install, USB\VID_0CF3&PID_3004
-%DeviceName% = USB_Install, USB\VID_0CF3&PID_3005
-%DeviceName% = USB_Install, USB\VID_0DB0&PID_3801
-%DeviceName% = USB_Install, USB\VID_0DF6&PID_2200
-%DeviceName% = USB_Install, USB\VID_0E5E&PID_6622
-%DeviceName% = USB_Install, USB\VID_1131&PID_1001
-%DeviceName% = USB_Install, USB\VID_1131&PID_1004
-%DeviceName% = USB_Install, USB\VID_1286&PID_2044&MI_00
-%DeviceName% = USB_Install, USB\VID_13D3&PID_3304
-%DeviceName% = USB_Install, USB\VID_13D3&PID_3315
-%DeviceName% = USB_Install, USB\VID_413C&PID_8126
-%DeviceName% = USB_Install, USB\VID_413C&PID_8197
-%DeviceName% = USB_Install, USB\VID_8086&PID_0189
-%DeviceName% = USB_Install, USB\VID_8087&PID_07DA
-
-[SourceDisksFiles.x86]
-WinUSBCoInstaller2.dll = 1
-WdfCoInstaller01009.dll = 1
-
-[SCProductions.NTamd64]
-%DeviceName% = USB_Install, USB\VID_03F0&PID_231D
-%DeviceName% = USB_Install, USB\VID_044E&PID_3010
-%DeviceName% = USB_Install, USB\VID_045E&PID_3500
-%DeviceName% = USB_Install, USB\VID_0461&PID_4D75
-%DeviceName% = USB_Install, USB\VID_046D&PID_C709
-%DeviceName% = USB_Install, USB\VID_047D&PID_105E
-%DeviceName% = USB_Install, USB\VID_0489&PID_E011
-%DeviceName% = USB_Install, USB\VID_0489&PID_E027
-%DeviceName% = USB_Install, USB\VID_0489&PID_E042
-%DeviceName% = USB_Install, USB\VID_0489&PID_E04D
-%DeviceName% = USB_Install, USB\VID_0489&PID_E04E
-%DeviceName% = USB_Install, USB\VID_04CA&PID_3006
-%DeviceName% = USB_Install, USB\VID_050D&PID_016A
-%DeviceName% = USB_Install, USB\VID_050D&PID_065A
-%DeviceName% = USB_Install, USB\VID_05AC&PID_8216
-%DeviceName% = USB_Install, USB\VID_05AC&PID_821A
-%DeviceName% = USB_Install, USB\VID_05AC&PID_821D
-%DeviceName% = USB_Install, USB\VID_05AC&PID_821F
-%DeviceName% = USB_Install, USB\VID_05AC&PID_8286
-%DeviceName% = USB_Install, USB\VID_07D1&PID_F101
-%DeviceName% = USB_Install, USB\VID_0930&PID_0214
-%DeviceName% = USB_Install, USB\VID_0930&PID_0215
-%DeviceName% = USB_Install, USB\VID_0A12&PID_0001
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_200A
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2021
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2100
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2101
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2146
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2148
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2150
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2153
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2154
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_217D
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2190
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_2198
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_21B4
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_21E1
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_21E3
-%DeviceName% = USB_Install, USB\VID_0A5C&PID_21E8
-%DeviceName% = USB_Install, USB\VID_0B05&PID_1715
-%DeviceName% = USB_Install, USB\VID_0B05&PID_1783
-%DeviceName% = USB_Install, USB\VID_0B05&PID_1785
-%DeviceName% = USB_Install, USB\VID_0B05&PID_1788
-%DeviceName% = USB_Install, USB\VID_0B05&PID_179C
-%DeviceName% = USB_Install, USB\VID_0B05&PID_17B5
-%DeviceName% = USB_Install, USB\VID_0B05&PID_B700
-%DeviceName% = USB_Install, USB\VID_0BDA&PID_0724
-%DeviceName% = USB_Install, USB\VID_0BDA&PID_8723
-%DeviceName% = USB_Install, USB\VID_0C10&PID_0000
-%DeviceName% = USB_Install, USB\VID_0CF3&PID_3002
-%DeviceName% = USB_Install, USB\VID_0CF3&PID_3004
-%DeviceName% = USB_Install, USB\VID_0CF3&PID_3005
-%DeviceName% = USB_Install, USB\VID_0DB0&PID_3801
-%DeviceName% = USB_Install, USB\VID_0DF6&PID_2200
-%DeviceName% = USB_Install, USB\VID_0E5E&PID_6622
-%DeviceName% = USB_Install, USB\VID_1131&PID_1001
-%DeviceName% = USB_Install, USB\VID_1131&PID_1004
-%DeviceName% = USB_Install, USB\VID_1286&PID_2044&MI_00
-%DeviceName% = USB_Install, USB\VID_13D3&PID_3304
-%DeviceName% = USB_Install, USB\VID_13D3&PID_3315
-%DeviceName% = USB_Install, USB\VID_413C&PID_8126
-%DeviceName% = USB_Install, USB\VID_413C&PID_8197
-%DeviceName% = USB_Install, USB\VID_8086&PID_0189
-%DeviceName% = USB_Install, USB\VID_8087&PID_07DA
-
-[SourceDisksFiles.amd64]
-WinUSBCoInstaller2.dll = 2
-WdfCoInstaller01009.dll = 2
-
-; =============================================================================
-
-[USB_Install]
-Include = WinUsb.inf
-Needs = WINUSB.NT
-
-[USB_Install.Services]
-Include = WinUsb.inf
-AddService = WinUSB,0x00000002,WinUSB_ServiceInstall
-
-[WinUSB_ServiceInstall]
-DisplayName = %WinUSB_SvcDesc%
-ServiceType = 1
-StartType = 3
-ErrorControl = 1
-ServiceBinary = %12%\WinUSB.sys
-
-; =============================================================================
-
-[USB_Install.Wdf]
-KmdfService = WINUSB, WinUSB_Install
-
-[WinUSB_Install]
-KmdfLibraryVersion = 1.9
-
-[USB_Install.HW]
-AddReg = Dev_AddReg
-
-[Dev_AddReg]
-HKR,,DeviceInterfaceGUIDs,0x10000,"{2F87C733-60E0-4355-8515-95D6978418B2}"
-
-[USB_Install.CoInstallers]
-AddReg = CoInstallers_AddReg
-CopyFiles = CoInstallers_CopyFiles
-
-[CoInstallers_AddReg]
-HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
-
-[CoInstallers_CopyFiles]
-WinUSBCoInstaller2.dll
-WdfCoInstaller01009.dll
-
-; =============================================================================
-
-[Strings]
-ProviderName = "Scarlet.Crush Productions"
-DeviceName = "BTH DS3 Device"
-WinUSB_SvcDesc = "BTH DS3 Driver"
-DISK_NAME = "BTH DS3 WinUsb Installation Media"
-ClassName = "Universal Serial Bus devices"
-
-; =============================================================================
diff --git a/Installers/Drivers/SCP_Driver/System/Ds3WinUsb.cat b/Installers/Drivers/SCP_Driver/System/Ds3WinUsb.cat
deleted file mode 100644
index 3886960..0000000
Binary files a/Installers/Drivers/SCP_Driver/System/Ds3WinUsb.cat and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/System/Ds3WinUsb.inf b/Installers/Drivers/SCP_Driver/System/Ds3WinUsb.inf
deleted file mode 100644
index c366625..0000000
--- a/Installers/Drivers/SCP_Driver/System/Ds3WinUsb.inf
+++ /dev/null
@@ -1,103 +0,0 @@
-; =============================================================================
-; Copyright (c) Scarlet.Crush Productions 2012, 2013. All rights reserved.
-;
-; Ds3WinUsb.inf
-; =============================================================================
-
-[Version]
-Signature = "$Windows NT$"
-Class = UsbDevice
-ClassGuid = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
-Provider = %ProviderName%
-DriverVer = 05/05/2013, 1.0.0.103
-CatalogFile = Ds3WinUsb.cat
-
-; =============================================================================
-
-[ClassInstall32]
-Addreg = SCPWinUsbClassReg
-
-[SCPWinUsbClassReg]
-HKR,,,0,%ClassName%
-HKR,,Icon,,-20
-
-; =============================================================================
-
-[DestinationDirs]
-CoInstallers_CopyFiles = 11
-
-[Manufacturer]
-%ProviderName% = SCProductions, NTx86, NTamd64
-
-[SourceDisksNames]
-1 = %DISK_NAME%,,,\x86
-2 = %DISK_NAME%,,,\amd64
-
-[SCProductions.NTx86]
-%DeviceName% = USB_Install, USB\VID_054C&PID_0268
-%DeviceName% = USB_Install, USB\VID_054C&PID_042F
-
-[SourceDisksFiles.x86]
-WinUSBCoInstaller2.dll = 1
-WdfCoInstaller01009.dll = 1
-
-[SCProductions.NTamd64]
-%DeviceName% = USB_Install, USB\VID_054C&PID_0268
-%DeviceName% = USB_Install, USB\VID_054C&PID_042F
-
-[SourceDisksFiles.amd64]
-WinUSBCoInstaller2.dll = 2
-WdfCoInstaller01009.dll = 2
-
-; =============================================================================
-
-[USB_Install]
-Include = WinUsb.inf
-Needs = WINUSB.NT
-
-[USB_Install.Services]
-Include = WinUsb.inf
-AddService = WinUSB,0x00000002,WinUSB_ServiceInstall
-
-[WinUSB_ServiceInstall]
-DisplayName = %WinUSB_SvcDesc%
-ServiceType = 1
-StartType = 3
-ErrorControl = 1
-ServiceBinary = %12%\WinUSB.sys
-
-; =============================================================================
-
-[USB_Install.Wdf]
-KmdfService = WINUSB, WinUSB_Install
-
-[WinUSB_Install]
-KmdfLibraryVersion = 1.9
-
-[USB_Install.HW]
-AddReg = Dev_AddReg
-
-[Dev_AddReg]
-HKR,,DeviceInterfaceGUIDs,0x10000,"{E2824A09-DBAA-4407-85CA-C8E8FF5F6FFA}"
-
-[USB_Install.CoInstallers]
-AddReg = CoInstallers_AddReg
-CopyFiles = CoInstallers_CopyFiles
-
-[CoInstallers_AddReg]
-HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
-
-[CoInstallers_CopyFiles]
-WinUSBCoInstaller2.dll
-WdfCoInstaller01009.dll
-
-; =============================================================================
-
-[Strings]
-ProviderName = "Scarlet.Crush Productions"
-DeviceName = "USB DS3 Device"
-WinUSB_SvcDesc = "USB DS3 Driver"
-DISK_NAME = "USB DS3 WinUsb Installation Media"
-ClassName = "Universal Serial Bus devices"
-
-; =============================================================================
diff --git a/Installers/Drivers/SCP_Driver/System/ScpVBus.cat b/Installers/Drivers/SCP_Driver/System/ScpVBus.cat
deleted file mode 100644
index 895bd16..0000000
Binary files a/Installers/Drivers/SCP_Driver/System/ScpVBus.cat and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/System/ScpVBus.inf b/Installers/Drivers/SCP_Driver/System/ScpVBus.inf
deleted file mode 100644
index 18a4df4..0000000
--- a/Installers/Drivers/SCP_Driver/System/ScpVBus.inf
+++ /dev/null
@@ -1,71 +0,0 @@
-; =============================================================================
-; Copyright (c) Scarlet.Crush Productions. All rights reserved.
-;
-; ScpVBus.inf
-; =============================================================================
-
-[Version]
-Provider = %SCProd%
-Signature = "$Windows NT$"
-Class = System
-ClassGuid = {4D36E97D-E325-11CE-BFC1-08002BE10318}
-DriverVer = 05/05/2013, 1.0.0.103
-CatalogFile = ScpVBus.cat
-
-; =============================================================================
-
-[DestinationDirs]
-DefaultDestDir = 12
-
-[Manufacturer]
-%SCProd% = SCProductions, NTx86, NTamd64
-
-[SourceDisksNames]
-1 = %MediaDescription%
-
-[SCProductions.NTx86]
-%ScpVBus.DeviceDesc% = ScpVBus_Install, root\ScpVBus
-
-[SourceDisksFiles.x86]
-ScpVBus.sys = 1, .\x86,
-
-[SCProductions.NTamd64]
-%ScpVBus.DeviceDesc% = ScpVBus_Install, root\ScpVBus
-
-[SourceDisksFiles.amd64]
-ScpVBus.sys = 1, .\amd64,
-
-; =============================================================================
-
-[ScpVBus_Install.NT]
-CopyFiles = ScpVBus_Install.NT.Copy
-
-[ScpVBus_Install.NT.hw]
-AddReg = ScpVBus_Device_AddReg
-
-[ScpVBus_Install.NT.Copy]
-ScpVBus.sys
-
-[ScpVBus_Device_AddReg]
-
-[ScpVBus_Install.NT.Services]
-AddService = ScpVBus, %SPSVCINST_ASSOCSERVICE%, ScpVBus_Service_Inst
-
-[ScpVBus_Service_Inst]
-DisplayName = %ScpVBus.SVCDESC%
-ServiceType = 1 ; SERVICE_KERNEL_DRIVER
-StartType = 3 ; SERVICE_DEMAND_START
-ErrorControl = 1 ; SERVICE_ERROR_NORMAL
-ServiceBinary = %12%\ScpVBus.sys
-LoadOrderGroup = Extended Base
-
-; =============================================================================
-
-[Strings]
-SCProd = "Scarlet.Crush Productions"
-MediaDescription = "Scp Virtual Bus Installation Media"
-ScpVBus.DeviceDesc = "Scp Virtual Bus Driver"
-ScpVBus.SVCDESC = "Scp Virtual Bus Driver"
-SPSVCINST_ASSOCSERVICE = 0x00000002
-
-; =============================================================================
diff --git a/Installers/Drivers/SCP_Driver/System/amd64/ScpVBus.sys b/Installers/Drivers/SCP_Driver/System/amd64/ScpVBus.sys
deleted file mode 100644
index ae55f41..0000000
Binary files a/Installers/Drivers/SCP_Driver/System/amd64/ScpVBus.sys and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/System/amd64/WUDFUpdate_01009.dll b/Installers/Drivers/SCP_Driver/System/amd64/WUDFUpdate_01009.dll
deleted file mode 100644
index 1424634..0000000
Binary files a/Installers/Drivers/SCP_Driver/System/amd64/WUDFUpdate_01009.dll and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/System/amd64/WdfCoInstaller01009.dll b/Installers/Drivers/SCP_Driver/System/amd64/WdfCoInstaller01009.dll
deleted file mode 100644
index 1731b96..0000000
Binary files a/Installers/Drivers/SCP_Driver/System/amd64/WdfCoInstaller01009.dll and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/System/amd64/WinUsbCoInstaller2.dll b/Installers/Drivers/SCP_Driver/System/amd64/WinUsbCoInstaller2.dll
deleted file mode 100644
index 30e5502..0000000
Binary files a/Installers/Drivers/SCP_Driver/System/amd64/WinUsbCoInstaller2.dll and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/Win32/LilyPad-Scp-r5350.dll b/Installers/Drivers/SCP_Driver/Win32/LilyPad-Scp-r5350.dll
deleted file mode 100644
index 435f4ad..0000000
Binary files a/Installers/Drivers/SCP_Driver/Win32/LilyPad-Scp-r5350.dll and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/Win32/SCPUser.exe b/Installers/Drivers/SCP_Driver/Win32/SCPUser.exe
deleted file mode 100644
index 414b66c..0000000
Binary files a/Installers/Drivers/SCP_Driver/Win32/SCPUser.exe and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/Win32/XInput1_3.dll b/Installers/Drivers/SCP_Driver/Win32/XInput1_3.dll
deleted file mode 100644
index 89672c3..0000000
Binary files a/Installers/Drivers/SCP_Driver/Win32/XInput1_3.dll and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/Win64/SCPUser.exe b/Installers/Drivers/SCP_Driver/Win64/SCPUser.exe
deleted file mode 100644
index 3ed00e5..0000000
Binary files a/Installers/Drivers/SCP_Driver/Win64/SCPUser.exe and /dev/null differ
diff --git a/Installers/Drivers/SCP_Driver/Win64/XInput1_3.dll b/Installers/Drivers/SCP_Driver/Win64/XInput1_3.dll
deleted file mode 100644
index c933882..0000000
Binary files a/Installers/Drivers/SCP_Driver/Win64/XInput1_3.dll and /dev/null differ
diff --git a/Installers/Drivers/Xbox360_32Eng_7.exe b/Installers/Drivers/Xbox360_32Eng_7.exe
deleted file mode 100644
index c8e0e83..0000000
Binary files a/Installers/Drivers/Xbox360_32Eng_7.exe and /dev/null differ
diff --git a/Installers/Drivers/Xbox360_32Eng_Vista.exe b/Installers/Drivers/Xbox360_32Eng_Vista.exe
deleted file mode 100644
index c8e0e83..0000000
Binary files a/Installers/Drivers/Xbox360_32Eng_Vista.exe and /dev/null differ
diff --git a/Installers/Drivers/Xbox360_32Eng_XPSP2.exe b/Installers/Drivers/Xbox360_32Eng_XPSP2.exe
deleted file mode 100644
index c8e0e83..0000000
Binary files a/Installers/Drivers/Xbox360_32Eng_XPSP2.exe and /dev/null differ
diff --git a/Installers/Drivers/Xbox360_64Eng_7.exe b/Installers/Drivers/Xbox360_64Eng_7.exe
deleted file mode 100644
index 71c3a98..0000000
Binary files a/Installers/Drivers/Xbox360_64Eng_7.exe and /dev/null differ
diff --git a/Installers/Drivers/Xbox360_64Eng_Vista.exe b/Installers/Drivers/Xbox360_64Eng_Vista.exe
deleted file mode 100644
index 71c3a98..0000000
Binary files a/Installers/Drivers/Xbox360_64Eng_Vista.exe and /dev/null differ
diff --git a/Installers/Drivers/Xbox360_64Eng_XP.exe b/Installers/Drivers/Xbox360_64Eng_XP.exe
deleted file mode 100644
index c1bce6d..0000000
Binary files a/Installers/Drivers/Xbox360_64Eng_XP.exe and /dev/null differ
diff --git a/Installers/wiinusoft_installer.iss b/Installers/wiinusoft_installer.iss
deleted file mode 100644
index 923b326..0000000
--- a/Installers/wiinusoft_installer.iss
+++ /dev/null
@@ -1,285 +0,0 @@
-#define MyAppName "WiinUSoft"
-#define MyAppVersion "3.0"
-#define MyAppPublisher "Justin Keys"
-#define MyAppURL "http://www.wiinupro.com/"
-#define MyAppExeName "WiinUSoft.exe"
-
-[Setup]
-; NOTE: The value of AppId uniquely identifies this application.
-; Do not use the same AppId value in installers for other applications.
-; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
-AppId={{1BFC4F9F-BB85-4CE3-AC22-0CBFF78D5EE4}
-AppName={#MyAppName}
-AppVersion={#MyAppVersion}
-;AppVerName={#MyAppName} {#MyAppVersion}
-AppPublisher={#MyAppPublisher}
-AppPublisherURL={#MyAppURL}
-AppSupportURL={#MyAppURL}
-AppUpdatesURL={#MyAppURL}
-DefaultDirName={pf}\{#MyAppName}
-DefaultGroupName={#MyAppName}
-AllowNoIcons=yes
-OutputDir=.\
-OutputBaseFilename=wiinusoft_setup
-Compression=lzma
-SolidCompression=yes
-ArchitecturesInstallIn64BitMode=x64
-
-[Languages]
-Name: "english"; MessagesFile: "compiler:Default.isl"
-;Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
-;Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
-;Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
-;Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
-;Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
-;Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
-;Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
-;Name: "french"; MessagesFile: "compiler:Languages\French.isl"
-;Name: "german"; MessagesFile: "compiler:Languages\German.isl"
-;Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
-;Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
-;Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
-;Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
-;Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
-;Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
-;Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
-;Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
-;Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
-;Name: "scottishgaelic"; MessagesFile: "compiler:Languages\ScottishGaelic.isl"
-;Name: "serbiancyrillic"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl"
-;Name: "serbianlatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl"
-;Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
-;Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
-;Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
-;Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
-
-[Types]
-Name: "full"; Description: "Install Everything";
-Name: "custom"; Description: "Pick and Choose"; Flags: iscustom
-
-[Components]
-Name: "main"; Description: "WiinUSoft"; Types: full custom; Flags: fixed;
-Name: "scp"; Description: "Scarlet Crush Production Driver"; Types: full
-Name: "xbox"; Description: "Xbox 360 Controller Driver (Required on Windows XP, Vista, and 7)"; Types: full
-
-[Tasks]
-Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
-Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
-
-[Files]
-Source: "..\WiinUSoft\bin\Release\WiinUSoft.exe"; DestDir: "{app}"; Components: main; Flags: ignoreversion
-Source: "..\WiinUSoft\bin\Release\Nintroller.dll"; DestDir: "{app}"; Components: main; Flags: ignoreversion
-Source: "..\WiinUSoft\bin\Release\RestSharp.dll"; DestDir: "{app}"; Components: main; Flags: ignoreversion
-Source: "..\WiinUSoft\bin\Release\ScpControl.dll"; DestDir: "{app}"; Components: main; Flags: ignoreversion
-Source: "..\WiinUSoft\bin\Release\Hardcodet.Wpf.TaskbarNotification.dll"; Components: main; DestDir: "{app}"; Flags: ignoreversion
-Source: "..\WiinUSoft\ReadMe.txt"; DestDir: "{app}"; Components: main; Flags: ignoreversion isreadme
-Source: "Drivers\SCP_Driver\*"; DestDir: "{app}\SCP_Driver"; Components: scp; Flags: ignoreversion recursesubdirs createallsubdirs
-Source: "Drivers\Xbox360_32Eng_7.exe"; DestDir: "{app}"; DestName: "Xbox360Driver.exe"; Components: xbox; Check: IsWindows7OrAbove and not Is64BitInstallMode; Flags: ignoreversion
-Source: "Drivers\Xbox360_64Eng_7.exe"; DestDir: "{app}"; DestName: "Xbox360Driver.exe"; Components: xbox; Check: IsWindows7OrAbove and Is64BitInstallMode; Flags: ignoreversion
-Source: "Drivers\Xbox360_32Eng_Vista.exe"; DestDir: "{app}"; DestName: "Xbox360Driver.exe"; Components: xbox; Check: IsWindowsVista and not Is64BitInstallMode; Flags: ignoreversion
-Source: "Drivers\Xbox360_64Eng_Vista.exe"; DestDir: "{app}"; DestName: "Xbox360Driver.exe"; Components: xbox; Check: IsWindowsVista and Is64BitInstallMode; Flags: ignoreversion
-Source: "Drivers\Xbox360_32Eng_XPSP2.exe"; DestDir: "{app}"; DestName: "Xbox360Driver.exe"; Components: xbox; Check: IsWindowsXpSp2 and not Is64BitInstallMode; Flags: ignoreversion
-Source: "Drivers\Xbox360_64Eng_XP.exe"; DestDir: "{app}"; DestName: "Xbox360Driver.exe"; Components: xbox; Check: IsWindowsXp and Is64BitInstallMode; Flags: ignoreversion
-
-[Icons]
-Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
-Name: "{group}\ReadMe"; Filename: "{app}\ReadMe.txt"
-Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
-Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
-Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
-
-[Run]
-Filename: "{app}\SCP_Driver\ScpDriver.exe"; Components: scp
-Filename: "{app}\Xbox360Driver.exe"; Components: xbox;
-Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
-
-[UninstallRun]
-Filename: "{app}\SCP_Driver\ScpDriver.exe"; Components: scp
-
-[Code]
-/////////////////////////////////////////////////////////////////////
-function GetUninstallString(): String;
-var
- sUnInstPath: String;
- sUnInstallString: String;
-begin
- sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
- sUnInstallString := '';
- if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
- RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
- Result := sUnInstallString;
-end;
-
-procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
-var
- FileName: String;
-begin
- if CurUninstallStep = usPostUninstall then
- begin
- FileName := ExpandConstant('{userappdata}') + '\WiinUSoft_prefs.config';
- if FileExists(FileName) then
- begin
- if (GetUninstallString() = '') then
- begin
- if MsgBox('Do you want to delete your saved WiinUSoft preferences ?',
- mbConfirmation, MB_YESNO) = IDYES
- then
- DeleteFile(FileName);
- end
- else
- DeleteFile(FileName);
- end
- end;
-end;
-
-function IsWindowsXp: Boolean;
-var
- Version: TWindowsVersion;
-begin
- GetWindowsVersionEx(Version);
-
- if Version.NTPlatform and
- (Version.Major = 5) and
- (Version.Minor > 0) then
- begin
- Result := True;
- Exit;
- end
-
- Result := False;
-end;
-
-function IsWindowsXpSp2: Boolean;
-var
- Version: TWindowsVersion;
-begin
- GetWindowsVersionEx(Version);
-
- if Version.NTPlatform and
- (Version.Major = 5) and
- (Version.Minor > 0) and
- (Version.ServicePackMajor > 1) then
- begin
- Result := True;
- Exit;
- end
-
- Result := False;
-end;
-
-function IsWindowsVista: Boolean;
-var
- Version: TWindowsVersion;
-begin
- GetWindowsVersionEx(Version);
-
- if Version.NTPlatform and
- (Version.Major = 6) and
- (Version.Minor = 0) then
- begin
- Result := True;
- Exit;
- end
-
- Result := False;
-end;
-
-function IsWindows7OrAbove: Boolean;
-var
- Version: TWindowsVersion;
-begin
- GetWindowsVersionEx(Version);
-
- // Windows 7
- if Version.NTPlatform and
- (Version.Major = 6) and
- (Version.Minor = 1) then
- begin
- Result := True;
- Exit;
- end
-
- // Windows 8
- if Version.NTPlatform and
- (Version.Major = 6) and
- (Version.Minor = 2) then
- begin
- Result := True;
- Exit;
- end
-
- // Windows 8.1
- if Version.NTPlatform and
- (Version.Major = 6) and
- (Version.Minor = 3) then
- begin
- Result := True;
- Exit;
- end
-
- // Windows 10
- if Version.NTPlatform and
- (Version.Major = 10) then
- begin
- Result := True;
- Exit;
- end
-
- Result := False;
-end;
-
-// code for uninstalling the previous version
-
-
-
-/////////////////////////////////////////////////////////////////////
-function IsUpgrade(): Boolean;
-begin
- Result := False;
- if (GetUninstallString() <> '') then
- begin
- if MsgBox('There is another version of WiinUSoft installed. Uninstall it?',
- mbConfirmation, MB_YESNO) = IDYES
- then
- Result := True;
- end
-end;
-
-
-/////////////////////////////////////////////////////////////////////
-function UnInstallOldVersion(): Integer;
-var
- sUnInstallString: String;
- iResultCode: Integer;
-begin
-// Return Values:
-// 1 - uninstall string is empty
-// 2 - error executing the UnInstallString
-// 3 - successfully executed the UnInstallString
-
- // default return value
- Result := 0;
-
- // get the uninstall string of the old app
- sUnInstallString := GetUninstallString();
- if sUnInstallString <> '' then begin
- sUnInstallString := RemoveQuotes(sUnInstallString);
- if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
- Result := 3
- else
- Result := 2;
- end else
- Result := 1;
-end;
-
-/////////////////////////////////////////////////////////////////////
-procedure CurStepChanged(CurStep: TSetupStep);
-begin
- if (CurStep=ssInstall) then
- begin
- if (IsUpgrade()) then
- begin
- UnInstallOldVersion();
- end;
- end;
-end;
\ No newline at end of file
diff --git a/Nintroller/Calibrations.cs b/Nintroller/Calibrations.cs
index d5cbac8..fb76e88 100644
--- a/Nintroller/Calibrations.cs
+++ b/Nintroller/Calibrations.cs
@@ -604,7 +604,7 @@ public class Default
}
};
- public WiiGuitar WiiGuitarDefault = new WiiGuitar()
+ public Guitar GuitarDefault = new Guitar()
{
Joy = new Joystick()
{
diff --git a/Nintroller/ControllerStructs.cs b/Nintroller/ControllerStructs.cs
deleted file mode 100644
index 33a2fb7..0000000
--- a/Nintroller/ControllerStructs.cs
+++ /dev/null
@@ -1,1786 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Forms;
-
-namespace NintrollerLib
-{
- public struct Wiimote : INintrollerState
- {
-#if DEBUG
- private bool _debugViewActive;
- public bool DebugViewActive
- {
- get
- {
- return _debugViewActive;
- }
- set
- {
- _debugViewActive = value;
- }
- }
-#endif
-
- public CoreButtons buttons;
- public Accelerometer accelerometer;
- public IR irSensor;
- //INintrollerState extension;
-
- public Wiimote(byte[] rawData)
- {
- buttons = new CoreButtons();
- accelerometer = new Accelerometer();
- irSensor = new IR();
- //extension = null;
-
-#if DEBUG
- _debugViewActive = false;
-#endif
-
- Update(rawData);
- }
-
- public void Update(byte[] data)
- {
- buttons.Parse(data, 1);
- accelerometer.Parse(data, 3);
- irSensor.Parse(data, 3);
-
- accelerometer.Normalize();
- }
-
- public float GetValue(string input)
- {
- throw new NotImplementedException();
- }
-
- public void SetCalibration(Calibrations.CalibrationPreset preset)
- {
- switch (preset)
- {
- case Calibrations.CalibrationPreset.Default:
- //accelerometer.Calibrate(Calibrations.Defaults.WiimoteDefault.accelerometer);
- SetCalibration(Calibrations.Defaults.WiimoteDefault);
- break;
-
- case Calibrations.CalibrationPreset.Modest:
- SetCalibration(Calibrations.Moderate.WiimoteModest);
- break;
-
- case Calibrations.CalibrationPreset.Extra:
- SetCalibration(Calibrations.Extras.WiimoteExtra);
- break;
-
- case Calibrations.CalibrationPreset.Minimum:
- SetCalibration(Calibrations.Minimum.WiimoteMinimal);
- break;
-
- case Calibrations.CalibrationPreset.None:
- SetCalibration(Calibrations.None.WiimoteRaw);
- break;
- }
- }
-
- public void SetCalibration(INintrollerState from)
- {
- if (from.CalibrationEmpty)
- {
- // don't apply empty calibrations
- return;
- }
-
- if (from.GetType() == typeof(Wiimote))
- {
- accelerometer.Calibrate(((Wiimote)from).accelerometer);
- irSensor.boundingArea = ((Wiimote)from).irSensor.boundingArea;
- }
- else if (from.GetType() == typeof(Nunchuk))
- {
- accelerometer.Calibrate(((Nunchuk)from).wiimote.accelerometer);
- irSensor.boundingArea = ((Nunchuk)from).wiimote.irSensor.boundingArea;
- }
- else if (from.GetType() == typeof(ClassicController))
- {
- accelerometer.Calibrate(((ClassicController)from).wiimote.accelerometer);
- irSensor.boundingArea = ((ClassicController)from).wiimote.irSensor.boundingArea;
- }
- else if (from.GetType() == typeof(ClassicControllerPro))
- {
- accelerometer.Calibrate(((ClassicControllerPro)from).wiimote.accelerometer);
- irSensor.boundingArea = ((ClassicControllerPro)from).wiimote.irSensor.boundingArea;
- }
- }
-
- public void SetCalibration(string calibrationString)
- {
- if (calibrationString.Count(c => c == '0') > 5)
- {
- // don't set empty calibrations
- return;
- }
-
- string[] components = calibrationString.Split(new char[] {':'});
-
- foreach (string component in components)
- {
- if (component.StartsWith("acc"))
- {
- string[] accConfig = component.Split(new char[] { '|' });
-
- for (int a = 1; a < accConfig.Length; a++)
- {
- int value = 0;
- if (int.TryParse(accConfig[a], out value))
- {
- switch (a)
- {
- case 1: accelerometer.centerX = value; break;
- case 2: accelerometer.minX = value; break;
- case 3: accelerometer.maxX = value; break;
- case 4: accelerometer.deadX = value; break;
- case 5: accelerometer.centerY = value; break;
- case 6: accelerometer.minY = value; break;
- case 7: accelerometer.maxY = value; break;
- case 8: accelerometer.deadY = value; break;
- case 9: accelerometer.centerZ = value; break;
- case 10: accelerometer.minZ = value; break;
- case 11: accelerometer.maxZ = value; break;
- case 12: accelerometer.deadZ = value; break;
- }
- }
- }
- }
- else if (component.StartsWith("irSqr"))
- {
- SquareBoundry sBoundry = new SquareBoundry();
- string[] sqrConfig = component.Split(new char[] { '|' });
-
- for (int s = 1; s < sqrConfig.Length; s++)
- {
- int value = 0;
- if (int.TryParse(sqrConfig[s], out value))
- {
- switch (s)
- {
- case 1: sBoundry.center_x = value; break;
- case 2: sBoundry.center_y = value; break;
- case 3: sBoundry.width = value; break;
- case 4: sBoundry.height = value; break;
- }
- }
- }
-
- irSensor.boundingArea = sBoundry;
- }
- else if (component.StartsWith("irCir"))
- {
- CircularBoundry sBoundry = new CircularBoundry();
- string[] cirConfig = component.Split(new char[] { '|' });
-
- for (int c = 1; c < cirConfig.Length; c++)
- {
- int value = 0;
- if (int.TryParse(cirConfig[c], out value))
- {
- switch (c)
- {
- case 1: sBoundry.center_x = value; break;
- case 2: sBoundry.center_y = value; break;
- case 3: sBoundry.radius = value; break;
- }
- }
- }
-
- irSensor.boundingArea = sBoundry;
- }
- }
- }
-
- ///
- /// Creates a string containing the calibration settings for the Wiimote.
- /// String is in the following format
- /// -wm:acc|centerX|minX|minY|deadX|centerY|[...]:ir
- ///
- /// String representing the Wiimote's calibration settings.
- public string GetCalibrationString()
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("-wm");
- sb.Append(":acc");
- sb.Append("|"); sb.Append(accelerometer.centerX);
- sb.Append("|"); sb.Append(accelerometer.minX);
- sb.Append("|"); sb.Append(accelerometer.maxX);
- sb.Append("|"); sb.Append(accelerometer.deadX);
-
- sb.Append("|"); sb.Append(accelerometer.centerY);
- sb.Append("|"); sb.Append(accelerometer.minY);
- sb.Append("|"); sb.Append(accelerometer.maxY);
- sb.Append("|"); sb.Append(accelerometer.deadY);
-
- sb.Append("|"); sb.Append(accelerometer.centerZ);
- sb.Append("|"); sb.Append(accelerometer.minZ);
- sb.Append("|"); sb.Append(accelerometer.maxZ);
- sb.Append("|"); sb.Append(accelerometer.deadZ);
-
- if (irSensor.boundingArea != null)
- {
- if (irSensor.boundingArea is SquareBoundry)
- {
- SquareBoundry sqr = (SquareBoundry)irSensor.boundingArea;
- sb.Append(":irSqr");
- sb.Append("|"); sb.Append(sqr.center_x);
- sb.Append("|"); sb.Append(sqr.center_y);
- sb.Append("|"); sb.Append(sqr.width);
- sb.Append("|"); sb.Append(sqr.height);
- }
- else if (irSensor.boundingArea is CircularBoundry)
- {
- CircularBoundry cir = (CircularBoundry)irSensor.boundingArea;
- sb.Append(":irCir");
- sb.Append("|"); sb.Append(cir.center_x);
- sb.Append("|"); sb.Append(cir.center_y);
- sb.Append("|"); sb.Append(cir.radius);
- }
- }
-
- return sb.ToString();
- }
-
- public bool CalibrationEmpty
- {
- get
- {
- if (accelerometer.maxX == 0 && accelerometer.maxY == 0 && accelerometer.maxZ == 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-
- public IEnumerator> GetEnumerator()
- {
- // Buttons
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.PLUS, buttons.Plus ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.MINUS, buttons.Minus ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.HOME, buttons.Home ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.A, buttons.A ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.B, buttons.B ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.ONE, buttons.One ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.TWO, buttons.Two ? 1.0f : 0.0f);
-
- // D-Pad
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.UP, buttons.Up ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.DOWN, buttons.Down ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.LEFT, buttons.Left ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.RIGHT, buttons.Right ? 1.0f : 0.0f);
-
- // IR Sensor
- irSensor.Normalize();
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.IR_X, irSensor.X);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.IR_Y, irSensor.Y);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.IR_UP, irSensor.Y > 0 ? irSensor.Y : 0);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.IR_DOWN, irSensor.Y > 0 ? -irSensor.Y : 0);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.IR_LEFT, irSensor.X < 0 ? -irSensor.X : 0);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.IR_RIGHT, irSensor.X > 0 ? irSensor.X : 0);
-
- // Accelerometer
- accelerometer.Normalize();
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.ACC_X, accelerometer.X);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.ACC_Y, accelerometer.Y);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.ACC_Z, accelerometer.Z);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.TILT_LEFT, accelerometer.X < 0 ? -accelerometer.X : 0);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.TILT_RIGHT, accelerometer.X > 0 ? accelerometer.X : 0);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.TILT_UP, accelerometer.Y > 0 ? accelerometer.Y : 0);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.TILT_DOWN, accelerometer.Y < 0 ? -accelerometer.Y : 0);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.FACE_UP, accelerometer.Z > 0 ? accelerometer.Z : 0);
- yield return new KeyValuePair(INPUT_NAMES.WIIMOTE.FACE_DOWN, accelerometer.Z < 0 ? -accelerometer.Z : 0);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-
- public struct Nunchuk : INintrollerState
- {
-#if DEBUG
- private bool _debugViewActive;
- public bool DebugViewActive
- {
- get
- {
- return _debugViewActive;
- }
- set
- {
- _debugViewActive = value;
- }
- }
-#endif
-
- public Wiimote wiimote;
- public Accelerometer accelerometer;
- public Joystick joystick;
- public bool C, Z;
-
- public Nunchuk(Wiimote wm)
- {
- this = new Nunchuk();
- wiimote = wm;
- }
-
- public Nunchuk(byte[] rawData)
- {
- wiimote = new Wiimote(rawData);
- accelerometer = new Accelerometer();
- joystick = new Joystick();
-
- C = Z = false;
-
-#if DEBUG
- _debugViewActive = false;
-#endif
-
- Update(rawData);
- }
-
- public void Update(byte[] data)
- {
- int offset = 0;
- switch((InputReport)data[0])
- {
- case InputReport.BtnsExt:
- case InputReport.BtnsExtB:
- offset = 3;
- break;
- case InputReport.BtnsAccExt:
- offset = 6;
- break;
- case InputReport.BtnsIRExt:
- offset = 13;
- break;
- case InputReport.BtnsAccIRExt:
- offset = 16;
- break;
- case InputReport.ExtOnly:
- offset = 1;
- break;
- case InputReport.Status:
- offset = -1;
- break;
- default:
- return;
- }
-
- if (offset > 0)
- {
- // Buttons
- C = (data[offset + 5] & 0x02) == 0;
- Z = (data[offset + 5] & 0x01) == 0;
-
- // Joystick
- joystick.rawX = data[offset];
- joystick.rawY = data[offset + 1];
-
- // Accelerometer
- accelerometer.Parse(data, offset + 2);
-
- // Normalize
- joystick.Normalize();
- accelerometer.Normalize();
- }
-
- wiimote.Update(data);
- }
-
- public float GetValue(string input)
- {
- throw new NotImplementedException();
- }
-
- public void SetCalibration(Calibrations.CalibrationPreset preset)
- {
- wiimote.SetCalibration(preset);
-
- switch (preset)
- {
- case Calibrations.CalibrationPreset.Default:
- SetCalibration(Calibrations.Defaults.NunchukDefault);
- break;
-
- case Calibrations.CalibrationPreset.Modest:
- SetCalibration(Calibrations.Moderate.NunchukModest);
- break;
-
- case Calibrations.CalibrationPreset.Extra:
- SetCalibration(Calibrations.Extras.NunchukExtra);
- break;
-
- case Calibrations.CalibrationPreset.Minimum:
- SetCalibration(Calibrations.Minimum.NunchukMinimal);
- break;
-
- case Calibrations.CalibrationPreset.None:
- SetCalibration(Calibrations.None.NunchukRaw);
- break;
- }
- }
-
- public void SetCalibration(INintrollerState from)
- {
- if (from.CalibrationEmpty)
- {
- // don't apply empty calibrations
- return;
- }
-
- if (from.GetType() == typeof(Nunchuk))
- {
- accelerometer.Calibrate(((Nunchuk)from).accelerometer);
- joystick.Calibrate(((Nunchuk)from).joystick);
- }
- else if (from.GetType() == typeof(Wiimote))
- {
- wiimote.SetCalibration(from);
- }
- }
-
- public void SetCalibration(string calibrationString)
- {
- if (calibrationString.Count(c => c == '0') > 5)
- {
- // don't set empty calibrations
- return;
- }
-
- string[] components = calibrationString.Split(new char[] { ':' });
-
- foreach (string component in components)
- {
- if (component.StartsWith("joy"))
- {
- string[] joyConfig = component.Split(new char[] { '|' });
-
- for (int j = 1; j < joyConfig.Length; j++)
- {
- int value = 0;
- if (int.TryParse(joyConfig[j], out value))
- {
- switch (j)
- {
- case 1: joystick.centerX = value; break;
- case 2: joystick.minX = value; break;
- case 3: joystick.maxX = value; break;
- case 4: joystick.deadX = value; break;
- case 5: joystick.centerY = value; break;
- case 6: joystick.minY = value; break;
- case 7: joystick.maxY = value; break;
- case 8: joystick.deadY = value; break;
- default: break;
- }
- }
- }
- }
- else if (component.StartsWith("acc"))
- {
- string[] accConfig = component.Split(new char[] { '|' });
-
- for (int a = 1; a < accConfig.Length; a++)
- {
- int value = 0;
- if (int.TryParse(accConfig[a], out value))
- {
- switch (a)
- {
- case 1: accelerometer.centerX = value; break;
- case 2: accelerometer.minX = value; break;
- case 3: accelerometer.maxX = value; break;
- case 4: accelerometer.deadX = value; break;
- case 5: accelerometer.centerY = value; break;
- case 6: accelerometer.minY = value; break;
- case 7: accelerometer.maxY = value; break;
- case 8: accelerometer.deadY = value; break;
- case 9: accelerometer.centerZ = value; break;
- case 10: accelerometer.minZ = value; break;
- case 11: accelerometer.maxZ = value; break;
- case 12: accelerometer.deadZ = value; break;
- default: break;
- }
- }
- }
- }
- }
- }
-
- public string GetCalibrationString()
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("-nun");
- sb.Append(":joy");
- sb.Append("|"); sb.Append(joystick.centerX);
- sb.Append("|"); sb.Append(joystick.minX);
- sb.Append("|"); sb.Append(joystick.maxX);
- sb.Append("|"); sb.Append(joystick.deadX);
-
- sb.Append("|"); sb.Append(joystick.centerY);
- sb.Append("|"); sb.Append(joystick.minY);
- sb.Append("|"); sb.Append(joystick.maxY);
- sb.Append("|"); sb.Append(joystick.deadY);
- sb.Append(":acc");
- sb.Append("|"); sb.Append(accelerometer.centerX);
- sb.Append("|"); sb.Append(accelerometer.minX);
- sb.Append("|"); sb.Append(accelerometer.maxX);
- sb.Append("|"); sb.Append(accelerometer.deadX);
-
- sb.Append("|"); sb.Append(accelerometer.centerY);
- sb.Append("|"); sb.Append(accelerometer.minY);
- sb.Append("|"); sb.Append(accelerometer.maxY);
- sb.Append("|"); sb.Append(accelerometer.deadY);
-
- sb.Append("|"); sb.Append(accelerometer.centerZ);
- sb.Append("|"); sb.Append(accelerometer.minZ);
- sb.Append("|"); sb.Append(accelerometer.maxZ);
- sb.Append("|"); sb.Append(accelerometer.deadZ);
-
- return sb.ToString();
- }
-
- public bool CalibrationEmpty
- {
- get
- {
- if (accelerometer.maxX == 0 && accelerometer.maxY == 0 && accelerometer.maxZ == 0)
- {
- return true;
- }
- else if (joystick.maxX == 0 && joystick.maxY == 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-
- public IEnumerator> GetEnumerator()
- {
- // Wiimote
- foreach (var input in wiimote)
- {
- yield return input;
- }
-
- // Buttons
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.C, C ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.Z, Z ? 1.0f : 0.0f);
-
- // Joystick
- joystick.Normalize();
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.JOY_X, joystick.X);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.JOY_Y, joystick.Y);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.UP, joystick.Y > 0 ? joystick.Y : 0);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.DOWN, joystick.Y > 0 ? 0 : -joystick.Y);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.LEFT, joystick.X > 0 ? 0 : -joystick.X);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.RIGHT, joystick.X > 0 ? joystick.X : 0);
-
- // Accelerometer
- accelerometer.Normalize();
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.ACC_X, accelerometer.X);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.ACC_Y, accelerometer.Y);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.ACC_Z, accelerometer.Z);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.TILT_LEFT, accelerometer.X > 0 ? 0 : -accelerometer.X);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.TILT_RIGHT, accelerometer.X > 0 ? accelerometer.X : 0);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.TILT_UP, accelerometer.Y > 0 ? accelerometer.Y : 0);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.TILT_DOWN, accelerometer.Y > 0 ? 0 : -accelerometer.Y);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.FACE_UP, accelerometer.Z > 0 ? accelerometer.Z : 0);
- yield return new KeyValuePair(INPUT_NAMES.NUNCHUK.FACE_DOWN, accelerometer.Z > 0 ? 0 : -accelerometer.Z);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-
- public struct ClassicController : INintrollerState
- {
-#if DEBUG
- private bool _debugViewActive;
- public bool DebugViewActive
- {
- get
- {
- return _debugViewActive;
- }
- set
- {
- _debugViewActive = value;
- }
- }
-#endif
-
- public Wiimote wiimote;
- public Joystick LJoy, RJoy;
- public Trigger L, R;
- public bool A, B, X, Y;
- public bool Up, Down, Left, Right;
- public bool ZL, ZR, LFull, RFull;
- public bool Plus, Minus, Home;
-
- public ClassicController(Wiimote wm)
- {
- this = new ClassicController();
- wiimote = wm;
- }
-
- public bool Start
- {
- get { return Plus; }
- set { Plus = value; }
- }
-
- public bool Select
- {
- get { return Minus; }
- set { Minus = value; }
- }
-
- public void Update(byte[] data)
- {
- int offset = 0;
- switch ((InputReport)data[0])
- {
- case InputReport.BtnsExt:
- case InputReport.BtnsExtB:
- offset = 3;
- break;
- case InputReport.BtnsAccExt:
- offset = 6;
- break;
- case InputReport.BtnsIRExt:
- offset = 13;
- break;
- case InputReport.BtnsAccIRExt:
- offset = 16;
- break;
- case InputReport.ExtOnly:
- offset = 1;
- break;
- default:
- return;
- }
-
- if (offset > 0)
- {
- // Buttons
- A = (data[offset + 5] & 0x10) == 0;
- B = (data[offset + 5] & 0x40) == 0;
- X = (data[offset + 5] & 0x08) == 0;
- Y = (data[offset + 5] & 0x20) == 0;
- LFull = (data[offset + 4] & 0x20) == 0; // Until the Click
- RFull = (data[offset + 4] & 0x02) == 0; // Until the Click
- ZL = (data[offset + 5] & 0x80) == 0;
- ZR = (data[offset + 5] & 0x04) == 0;
- Plus = (data[offset + 4] & 0x04) == 0;
- Minus = (data[offset + 4] & 0x10) == 0;
- Home = (data[offset + 4] & 0x08) == 0;
-
- // Dpad
- Up = (data[offset + 5] & 0x01) == 0;
- Down = (data[offset + 4] & 0x40) == 0;
- Left = (data[offset + 5] & 0x02) == 0;
- Right = (data[offset + 4] & 0x80) == 0;
-
- // Joysticks
- LJoy.rawX = (byte)(data[offset] & 0x3F);
- LJoy.rawY = (byte)(data[offset + 1] & 0x03F);
- RJoy.rawX = (byte)(data[offset + 2] >> 7 | (data[offset + 1] & 0xC0) >> 5 | (data[offset] & 0xC0) >> 3);
- RJoy.rawY = (byte)(data[offset + 2] & 0x1F);
-
- // Triggers
- L.rawValue = (byte)(((data[offset + 2] & 0x60) >> 2) | (data[offset + 3] >> 5));
- R.rawValue = (byte)(data[offset + 3] & 0x1F);
- L.full = LFull;
- R.full = RFull;
-
- // Normalize
- LJoy.Normalize();
- RJoy.Normalize();
- L.Normalize();
- R.Normalize();
- }
-
- wiimote.Update(data);
- }
-
- public float GetValue(string input)
- {
- throw new NotImplementedException();
- }
-
- public void SetCalibration(Calibrations.CalibrationPreset preset)
- {
- wiimote.SetCalibration(preset);
-
- switch (preset)
- {
- case Calibrations.CalibrationPreset.Default:
- //LJoy.Calibrate(Calibrations.Defaults.ClassicControllerDefault.LJoy);
- //RJoy.Calibrate(Calibrations.Defaults.ClassicControllerDefault.RJoy);
- //L.Calibrate(Calibrations.Defaults.ClassicControllerDefault.L);
- //R.Calibrate(Calibrations.Defaults.ClassicControllerDefault.R);
- SetCalibration(Calibrations.Defaults.ClassicControllerDefault);
- break;
-
- case Calibrations.CalibrationPreset.Modest:
- SetCalibration(Calibrations.Moderate.ClassicControllerModest);
- break;
-
- case Calibrations.CalibrationPreset.Extra:
- SetCalibration(Calibrations.Extras.ClassicControllerExtra);
- break;
-
- case Calibrations.CalibrationPreset.Minimum:
- SetCalibration(Calibrations.Minimum.ClassicControllerMinimal);
- break;
-
- case Calibrations.CalibrationPreset.None:
- SetCalibration(Calibrations.None.ClassicControllerRaw);
- break;
- }
- }
-
- public void SetCalibration(INintrollerState from)
- {
- if (from.CalibrationEmpty)
- {
- // don't apply empty calibrations
- return;
- }
-
- if (from.GetType() == typeof(ClassicController))
- {
- LJoy.Calibrate(((ClassicController)from).LJoy);
- RJoy.Calibrate(((ClassicController)from).RJoy);
- L.Calibrate(((ClassicController)from).L);
- R.Calibrate(((ClassicController)from).R);
- }
- else if (from.GetType() == typeof(Wiimote))
- {
- wiimote.SetCalibration(from);
- }
- }
-
- public void SetCalibration(string calibrationString)
- {
- if (calibrationString.Count(c => c == '0') > 5)
- {
- // don't set empty calibrations
- return;
- }
-
- string[] components = calibrationString.Split(new char[] { ':' });
-
- foreach (string component in components)
- {
- if (component.StartsWith("joyL"))
- {
- string[] joyLConfig = component.Split(new char[] { '|' });
-
- for (int jL = 1; jL < joyLConfig.Length; jL++)
- {
- int value = 0;
- if (int.TryParse(joyLConfig[jL], out value))
- {
- switch (jL)
- {
- case 1: LJoy.centerX = value; break;
- case 2: LJoy.minX = value; break;
- case 3: LJoy.maxX = value; break;
- case 4: LJoy.deadX = value; break;
- case 5: LJoy.centerY = value; break;
- case 6: LJoy.minY = value; break;
- case 7: LJoy.maxY = value; break;
- case 8: LJoy.deadY = value; break;
- default: break;
- }
- }
- }
- }
- else if (component.StartsWith("joyR"))
- {
- string[] joyRConfig = component.Split(new char[] { '|' });
-
- for (int jR = 1; jR < joyRConfig.Length; jR++)
- {
- int value = 0;
- if (int.TryParse(joyRConfig[jR], out value))
- {
- switch (jR)
- {
- case 1: RJoy.centerX = value; break;
- case 2: RJoy.minX = value; break;
- case 3: RJoy.maxX = value; break;
- case 4: RJoy.deadX = value; break;
- case 5: RJoy.centerY = value; break;
- case 6: RJoy.minY = value; break;
- case 7: RJoy.maxY = value; break;
- case 8: RJoy.deadY = value; break;
- default: break;
- }
- }
- }
- }
- else if (component.StartsWith("tl"))
- {
- string[] triggerLConfig = component.Split(new char[] { '|' });
-
- for (int tl = 1; tl < triggerLConfig.Length; tl++)
- {
- int value = 0;
- if (int.TryParse(triggerLConfig[tl], out value))
- {
- switch (tl)
- {
- case 1: L.min = value; break;
- case 2: L.max = value; break;
- default: break;
- }
- }
- }
- }
- else if (component.StartsWith("tr"))
- {
- string[] triggerRConfig = component.Split(new char[] { '|' });
-
- for (int tr = 1; tr < triggerRConfig.Length; tr++)
- {
- int value = 0;
- if (int.TryParse(triggerRConfig[tr], out value))
- {
- switch (tr)
- {
- case 1: R.min = value; break;
- case 2: R.max = value; break;
- default: break;
- }
- }
- }
- }
- }
- }
-
- public string GetCalibrationString()
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("-cla");
- sb.Append(":joyL");
- sb.Append("|"); sb.Append(LJoy.centerX);
- sb.Append("|"); sb.Append(LJoy.minX);
- sb.Append("|"); sb.Append(LJoy.maxX);
- sb.Append("|"); sb.Append(LJoy.deadX);
- sb.Append("|"); sb.Append(LJoy.centerY);
- sb.Append("|"); sb.Append(LJoy.minY);
- sb.Append("|"); sb.Append(LJoy.maxY);
- sb.Append("|"); sb.Append(LJoy.deadY);
- sb.Append(":joyR");
- sb.Append("|"); sb.Append(RJoy.centerX);
- sb.Append("|"); sb.Append(RJoy.minX);
- sb.Append("|"); sb.Append(RJoy.maxX);
- sb.Append("|"); sb.Append(RJoy.deadX);
- sb.Append("|"); sb.Append(RJoy.centerY);
- sb.Append("|"); sb.Append(RJoy.minY);
- sb.Append("|"); sb.Append(RJoy.maxY);
- sb.Append("|"); sb.Append(RJoy.deadY);
- sb.Append(":tl");
- sb.Append("|"); sb.Append(L.min);
- sb.Append("|"); sb.Append(L.max);
- sb.Append(":tr");
- sb.Append("|"); sb.Append(R.min);
- sb.Append("|"); sb.Append(R.max);
-
- return sb.ToString();
- }
-
- public bool CalibrationEmpty
- {
- get
- {
- if (LJoy.maxX == 0 && LJoy.maxY == 0 && RJoy.maxX == 0 && RJoy.maxY == 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-
- public IEnumerator> GetEnumerator()
- {
- // Wiimote
- foreach (var input in wiimote)
- {
- yield return input;
- }
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.A, A ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.B, B ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.X, X ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.Y, Y ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.L, L.value > 0 ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.R, R.value > 0 ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.ZL, ZL ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.ZR, ZR ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.UP, Up ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.DOWN, Down ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LEFT, Left ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RIGHT, Right ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.START, Start ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.SELECT, Select ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.HOME, Home ? 1.0f : 0.0f);
-
- L.Normalize();
- R.Normalize();
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LFULL, L.full ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RFULL, R.full ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LT, L.value);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RT, R.value);
-
- LJoy.Normalize();
- RJoy.Normalize();
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LX, LJoy.X);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LY, LJoy.Y);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RX, RJoy.X);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RY, RJoy.X);
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LUP, LJoy.Y > 0f ? LJoy.Y : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LDOWN, LJoy.Y > 0f ? 0.0f : -LJoy.Y); // These are inverted
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LLEFT, LJoy.X > 0f ? 0.0f : -LJoy.X); // because they
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LRIGHT, LJoy.X > 0f ? LJoy.X : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RUP, RJoy.Y > 0f ? RJoy.Y : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RDOWN, RJoy.Y > 0f ? 0.0f : -RJoy.Y); // represents how far the
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RLEFT, RJoy.X > 0f ? 0.0f : -RJoy.X); // input is left or down
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RRIGHT, RJoy.X > 0f ? RJoy.X : 0.0f);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-
- public struct ClassicControllerPro : INintrollerState
- {
-#if DEBUG
- private bool _debugViewActive;
- public bool DebugViewActive
- {
- get
- {
- return _debugViewActive;
- }
- set
- {
- _debugViewActive = value;
- }
- }
-#endif
-
- public Wiimote wiimote;
- public Joystick LJoy, RJoy;
- public bool A, B, X, Y;
- public bool Up, Down, Left, Right;
- public bool L, R, ZL, ZR;
- public bool Plus, Minus, Home;
-
- public ClassicControllerPro(Wiimote wm)
- {
- this = new ClassicControllerPro();
- wiimote = wm;
- }
-
- public bool Start
- {
- get { return Plus; }
- set { Plus = value; }
- }
-
- public bool Select
- {
- get { return Minus; }
- set { Minus = value; }
- }
-
- public void Update(byte[] data)
- {
- int offset = 0;
- switch ((InputReport)data[0])
- {
- case InputReport.BtnsExt:
- case InputReport.BtnsExtB:
- offset = 3;
- break;
- case InputReport.BtnsAccExt:
- offset = 6;
- break;
- case InputReport.BtnsIRExt:
- offset = 13;
- break;
- case InputReport.BtnsAccIRExt:
- offset = 16;
- break;
- case InputReport.ExtOnly:
- offset = 1;
- break;
- default:
- return;
- }
-
- if (offset > 0)
- {
- // Buttons
- A = (data[offset + 5] & 0x10) == 0;
- B = (data[offset + 5] & 0x40) == 0;
- X = (data[offset + 5] & 0x08) == 0;
- Y = (data[offset + 5] & 0x20) == 0;
- L = (data[offset + 4] & 0x20) == 0;
- R = (data[offset + 4] & 0x02) == 0;
- ZL = (data[offset + 5] & 0x80) == 0;
- ZR = (data[offset + 5] & 0x04) == 0;
- Plus = (data[offset + 4] & 0x04) == 0;
- Minus = (data[offset + 4] & 0x10) == 0;
- Home = (data[offset + 4] & 0x08) == 0;
-
- // Dpad
- Up = (data[offset + 5] & 0x01) == 0;
- Down = (data[offset + 4] & 0x40) == 0;
- Left = (data[offset + 5] & 0x02) == 0;
- Right = (data[offset + 4] & 0x80) == 0;
-
- // Joysticks
- LJoy.rawX = (byte)(data[offset] & 0x3F);
- LJoy.rawY = (byte)(data[offset + 1] & 0x03F);
- RJoy.rawX = (byte)(data[offset + 2] >> 7 | (data[offset + 1] & 0xC0) >> 5 | (data[offset] & 0xC0) >> 3);
- RJoy.rawY = (byte)(data[offset + 2] & 0x1F);
-
- // Normalize
- LJoy.Normalize();
- RJoy.Normalize();
- }
-
- wiimote.Update(data);
- }
-
- public float GetValue(string input)
- {
- throw new NotImplementedException();
- }
-
- public void SetCalibration(Calibrations.CalibrationPreset preset)
- {
- wiimote.SetCalibration(preset);
-
- switch (preset)
- {
- case Calibrations.CalibrationPreset.Default:
- //LJoy.Calibrate(Calibrations.Defaults.ClassicControllerProDefault.LJoy);
- //RJoy.Calibrate(Calibrations.Defaults.ClassicControllerProDefault.RJoy);
- SetCalibration(Calibrations.Defaults.ClassicControllerProDefault);
- break;
-
- case Calibrations.CalibrationPreset.Modest:
- SetCalibration(Calibrations.Moderate.ClassicControllerProModest);
- break;
-
- case Calibrations.CalibrationPreset.Extra:
- SetCalibration(Calibrations.Extras.ClassicControllerProExtra);
- break;
-
- case Calibrations.CalibrationPreset.Minimum:
- SetCalibration(Calibrations.Minimum.ClassicControllerProMinimal);
- break;
-
- case Calibrations.CalibrationPreset.None:
- SetCalibration(Calibrations.None.ClassicControllerProRaw);
- break;
- }
- }
-
- public void SetCalibration(INintrollerState from)
- {
- if (from.CalibrationEmpty)
- {
- // don't apply empty calibrations
- return;
- }
-
- if (from.GetType() == typeof(ClassicControllerPro))
- {
- LJoy.Calibrate(((ClassicControllerPro)from).LJoy);
- RJoy.Calibrate(((ClassicControllerPro)from).RJoy);
- }
- else if (from.GetType() == typeof(Wiimote))
- {
- wiimote.SetCalibration(from);
- }
- }
-
- public void SetCalibration(string calibrationString)
- {
- if (calibrationString.Count(c => c == '0') > 5)
- {
- // don't set empty calibrations
- return;
- }
-
- string[] components = calibrationString.Split(new char[] { ':' });
-
- foreach (string component in components)
- {
- if (component.StartsWith("joyL"))
- {
- string[] joyLConfig = component.Split(new char[] { '|' });
-
- for (int jL = 1; jL < joyLConfig.Length; jL++)
- {
- int value = 0;
- if (int.TryParse(joyLConfig[jL], out value))
- {
- switch (jL)
- {
- case 1: LJoy.centerX = value; break;
- case 2: LJoy.minX = value; break;
- case 3: LJoy.maxX = value; break;
- case 4: LJoy.deadX = value; break;
- case 5: LJoy.centerY = value; break;
- case 6: LJoy.minY = value; break;
- case 7: LJoy.maxY = value; break;
- case 8: LJoy.deadY = value; break;
- default: break;
- }
- }
- }
- }
- else if (component.StartsWith("joyR"))
- {
- string[] joyRConfig = component.Split(new char[] { '|' });
-
- for (int jR = 1; jR < joyRConfig.Length; jR++)
- {
- int value = 0;
- if (int.TryParse(joyRConfig[jR], out value))
- {
- switch (jR)
- {
- case 1: RJoy.centerX = value; break;
- case 2: RJoy.minX = value; break;
- case 3: RJoy.maxX = value; break;
- case 4: RJoy.deadX = value; break;
- case 5: RJoy.centerY = value; break;
- case 6: RJoy.minY = value; break;
- case 7: RJoy.maxY = value; break;
- case 8: RJoy.deadY = value; break;
- default: break;
- }
- }
- }
- }
- }
- }
-
- public string GetCalibrationString()
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("-ccp");
- sb.Append(":joyL");
- sb.Append("|"); sb.Append(LJoy.centerX);
- sb.Append("|"); sb.Append(LJoy.minX);
- sb.Append("|"); sb.Append(LJoy.maxX);
- sb.Append("|"); sb.Append(LJoy.deadX);
- sb.Append("|"); sb.Append(LJoy.centerY);
- sb.Append("|"); sb.Append(LJoy.minY);
- sb.Append("|"); sb.Append(LJoy.maxY);
- sb.Append("|"); sb.Append(LJoy.deadY);
- sb.Append(":joyR");
- sb.Append("|"); sb.Append(RJoy.centerX);
- sb.Append("|"); sb.Append(RJoy.minX);
- sb.Append("|"); sb.Append(RJoy.maxX);
- sb.Append("|"); sb.Append(RJoy.deadX);
- sb.Append("|"); sb.Append(RJoy.centerY);
- sb.Append("|"); sb.Append(RJoy.minY);
- sb.Append("|"); sb.Append(RJoy.maxY);
- sb.Append("|"); sb.Append(RJoy.deadY);
-
- return sb.ToString();
- }
-
- public bool CalibrationEmpty
- {
- get
- {
- if (LJoy.maxX == 0 && LJoy.maxY == 0 && RJoy.maxX == 0 && RJoy.maxY == 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-
- public IEnumerator> GetEnumerator()
- {
- foreach (var input in wiimote)
- {
- yield return input;
- }
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.A, A ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.B, B ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.X, X ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.Y, Y ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.L, L ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.R, R ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.ZL, ZL ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.ZR, ZR ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.UP, Up ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.DOWN, Down ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LEFT, Left ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RIGHT, Right ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.START, Start ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.SELECT, Select ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.HOME, Home ? 1.0f : 0.0f);
-
- LJoy.Normalize();
- RJoy.Normalize();
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LX, LJoy.X);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LY, LJoy.Y);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RX, RJoy.X);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RY, RJoy.X);
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LUP, LJoy.Y > 0f ? LJoy.Y : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LDOWN, LJoy.Y > 0f ? 0.0f : -LJoy.Y); // These are inverted
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LLEFT, LJoy.X > 0f ? 0.0f : -LJoy.X); // because they
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LRIGHT, LJoy.X > 0f ? LJoy.X : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RUP, RJoy.Y > 0f ? RJoy.Y : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RDOWN, RJoy.Y > 0f ? 0.0f : -RJoy.Y); // represents how far the
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RLEFT, RJoy.X > 0f ? 0.0f : -RJoy.X); // input is left or down
- yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RRIGHT, RJoy.X > 0f ? RJoy.X : 0.0f);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-
- public struct ProController : INintrollerState
- {
-#if DEBUG
- private bool _debugViewActive;
- public bool DebugViewActive
- {
- get
- {
- return _debugViewActive;
- }
- set
- {
- _debugViewActive = value;
- }
- }
-#endif
-
- public Joystick LJoy, RJoy;
- public bool A, B, X, Y;
- public bool Up, Down, Left, Right;
- public bool L, R, ZL, ZR;
- public bool Plus, Minus, Home;
- public bool LStick, RStick;
- public bool charging, usbConnected;
-
- public bool Start
- {
- get { return Plus; }
- set { Plus = value; }
- }
-
- public bool Select
- {
- get { return Minus; }
- set { Minus = value; }
- }
-
- public void Update(byte[] data)
- {
- int offset = 0;
-
- switch ((InputReport)data[0])
- {
- case InputReport.ExtOnly:
- offset = 1;
- break;
- case InputReport.BtnsExt:
- case InputReport.BtnsExtB:
- offset = 3;
- break;
- case InputReport.BtnsAccExt:
- offset = 6;
- break;
- case InputReport.BtnsIRExt:
- offset = 13;
- break;
- case InputReport.BtnsAccIRExt:
- offset = 16;
- break;
- case InputReport.Status:
- Plus = (data[1] & 0x04) == 0;
- Home = (data[1] & 0x08) == 0;
- Minus = (data[1] & 0x10) == 0;
- Down = (data[1] & 0x40) == 0;
- Right = (data[1] & 0x80) == 0;
- Up = (data[2] & 0x01) == 0;
- Left = (data[2] & 0x02) == 0;
- A = (data[2] & 0x10) == 0;
- B = (data[2] & 0x40) == 0;
- return;
- default:
- return;
- }
-
- // Buttons
- A = (data[offset + 9] & 0x10) == 0;
- B = (data[offset + 9] & 0x40) == 0;
- X = (data[offset + 9] & 0x08) == 0;
- Y = (data[offset + 9] & 0x20) == 0;
- L = (data[offset + 8] & 0x20) == 0;
- R = (data[offset + 8] & 0x02) == 0;
- ZL = (data[offset + 9] & 0x80) == 0;
- ZR = (data[offset + 9] & 0x04) == 0;
- Plus = (data[offset + 8] & 0x04) == 0;
- Minus = (data[offset + 8] & 0x10) == 0;
- Home = (data[offset + 8] & 0x08) == 0;
- LStick = (data[offset + 10] & 0x02) == 0;
- RStick = (data[offset + 10] & 0x01) == 0;
-
- // DPad
- Up = (data[offset + 9] & 0x01) == 0;
- Down = (data[offset + 8] & 0x40) == 0;
- Left = (data[offset + 9] & 0x02) == 0;
- Right = (data[offset + 8] & 0x80) == 0;
-
- // Joysticks
- LJoy.rawX = BitConverter.ToInt16(data, offset);
- LJoy.rawY = BitConverter.ToInt16(data, offset + 4);
- RJoy.rawX = BitConverter.ToInt16(data, offset + 2);
- RJoy.rawY = BitConverter.ToInt16(data, offset + 6);
-
- // Other
- charging = (data[offset + 10] & 0x04) == 0;
- usbConnected = (data[offset + 10] & 0x08) == 0;
-
- // Normalize
- LJoy.Normalize();
- RJoy.Normalize();
- }
-
- public float GetValue(string input)
- {
- throw new NotImplementedException();
- }
-
- public void SetCalibration(Calibrations.CalibrationPreset preset)
- {
- switch (preset)
- {
- case Calibrations.CalibrationPreset.Default:
- //LJoy.Calibrate(Calibrations.Defaults.ProControllerDefault.LJoy);
- //RJoy.Calibrate(Calibrations.Defaults.ProControllerDefault.RJoy);
- SetCalibration(Calibrations.Defaults.ProControllerDefault);
- break;
-
- case Calibrations.CalibrationPreset.Modest:
- SetCalibration(Calibrations.Moderate.ProControllerModest);
- break;
-
- case Calibrations.CalibrationPreset.Extra:
- SetCalibration(Calibrations.Extras.ProControllerExtra);
- break;
-
- case Calibrations.CalibrationPreset.Minimum:
- SetCalibration(Calibrations.Minimum.ProControllerMinimal);
- break;
-
- case Calibrations.CalibrationPreset.None:
- SetCalibration(Calibrations.None.ProControllerRaw);
- break;
- }
- }
-
- public void SetCalibration(INintrollerState from)
- {
- if (from.CalibrationEmpty)
- {
- // don't apply empty calibrations
- return;
- }
-
- if (from.GetType() == typeof(ProController))
- {
- LJoy.Calibrate(((ProController)from).LJoy);
- RJoy.Calibrate(((ProController)from).RJoy);
- }
- }
-
- public void SetCalibration(string calibrationString)
- {
- if (calibrationString.Count(c => c == '0') > 5)
- {
- // don't set empty calibrations
- return;
- }
-
- string[] components = calibrationString.Split(new char[] { ':' });
-
- foreach (string component in components)
- {
- if (component.StartsWith("joyL"))
- {
- string[] joyLConfig = component.Split(new char[] { '|' });
-
- for (int jL = 1; jL < joyLConfig.Length; jL++)
- {
- int value = 0;
- if (int.TryParse(joyLConfig[jL], out value))
- {
- switch (jL)
- {
- case 1: LJoy.centerX = value; break;
- case 2: LJoy.minX = value; break;
- case 3: LJoy.maxX = value; break;
- case 4: LJoy.deadX = value; break;
- case 5: LJoy.centerY = value; break;
- case 6: LJoy.minY = value; break;
- case 7: LJoy.maxY = value; break;
- case 8: LJoy.deadY = value; break;
- default: break;
- }
- }
- }
- }
- else if (component.StartsWith("joyR"))
- {
- string[] joyRConfig = component.Split(new char[] { '|' });
-
- for (int jR = 1; jR < joyRConfig.Length; jR++)
- {
- int value = 0;
- if (int.TryParse(joyRConfig[jR], out value))
- {
- switch (jR)
- {
- case 1: RJoy.centerX = value; break;
- case 2: RJoy.minX = value; break;
- case 3: RJoy.maxX = value; break;
- case 4: RJoy.deadX = value; break;
- case 5: RJoy.centerY = value; break;
- case 6: RJoy.minY = value; break;
- case 7: RJoy.maxY = value; break;
- case 8: RJoy.deadY = value; break;
- default: break;
- }
- }
- }
- }
- }
- }
-
- public string GetCalibrationString()
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("-pro");
- sb.Append(":joyL");
- sb.Append("|"); sb.Append(LJoy.centerX);
- sb.Append("|"); sb.Append(LJoy.minX);
- sb.Append("|"); sb.Append(LJoy.maxX);
- sb.Append("|"); sb.Append(LJoy.deadX);
- sb.Append("|"); sb.Append(LJoy.centerY);
- sb.Append("|"); sb.Append(LJoy.minY);
- sb.Append("|"); sb.Append(LJoy.maxY);
- sb.Append("|"); sb.Append(LJoy.deadY);
- sb.Append(":joyR");
- sb.Append("|"); sb.Append(RJoy.centerX);
- sb.Append("|"); sb.Append(RJoy.minX);
- sb.Append("|"); sb.Append(RJoy.maxX);
- sb.Append("|"); sb.Append(RJoy.deadX);
- sb.Append("|"); sb.Append(RJoy.centerY);
- sb.Append("|"); sb.Append(RJoy.minY);
- sb.Append("|"); sb.Append(RJoy.maxY);
- sb.Append("|"); sb.Append(RJoy.deadY);
-
- return sb.ToString();
- }
-
- public bool CalibrationEmpty
- {
- get
- {
- if (LJoy.maxX == 0 && LJoy.maxY == 0 && RJoy.maxX == 0 && RJoy.maxY == 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-
- public IEnumerator> GetEnumerator()
- {
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.A, A ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.B, B ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.X, X ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.Y, Y ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.L, L ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.R, R ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.ZL, ZL ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.ZR, ZR ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.UP, Up ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.DOWN, Down ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.LEFT, Left ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.RIGHT, Right ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.START, Start ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.SELECT, Select ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.HOME, Home ? 1.0f : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.LS, LStick ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.RS, RStick ? 1.0f : 0.0f);
-
- LJoy.Normalize();
- RJoy.Normalize();
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.LX, LJoy.X);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.LY, LJoy.Y);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.RX, RJoy.X);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.RY, RJoy.X);
-
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.LUP, LJoy.Y > 0f ? LJoy.Y : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.LDOWN, LJoy.Y > 0f ? 0.0f : -LJoy.Y); // These are inverted
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.LLEFT, LJoy.X > 0f ? 0.0f : -LJoy.X); // because they
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.LRIGHT, LJoy.X > 0f ? LJoy.X : 0.0f);
-
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.RUP, RJoy.Y > 0f ? RJoy.Y : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.RDOWN, RJoy.Y > 0f ? 0.0f : -RJoy.Y); // represents how far the
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.RLEFT, RJoy.X > 0f ? 0.0f : -RJoy.X); // input is left or down
- yield return new KeyValuePair(INPUT_NAMES.PRO_CONTROLLER.RRIGHT, RJoy.X > 0f ? RJoy.X : 0.0f);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-
- public struct BalanceBoard : INintrollerState
- {
-#if DEBUG
- private bool _debugViewActive;
- public bool DebugViewActive
- {
- get
- {
- return _debugViewActive;
- }
- set
- {
- _debugViewActive = value;
- }
- }
-#endif
-
- public void Update(byte[] data)
- {
- throw new NotImplementedException();
- }
-
- public float GetValue(string input)
- {
- throw new NotImplementedException();
- }
-
- // TODO: Calibration - Balance Board Calibration
- public void SetCalibration(Calibrations.CalibrationPreset preset)
- {
- switch (preset)
- {
- case Calibrations.CalibrationPreset.Default:
- break;
-
- case Calibrations.CalibrationPreset.Modest:
- break;
-
- case Calibrations.CalibrationPreset.Extra:
- break;
-
- case Calibrations.CalibrationPreset.Minimum:
- break;
-
- case Calibrations.CalibrationPreset.None:
- break;
- }
- }
-
- public void SetCalibration(INintrollerState from)
- {
- if (from.GetType() == typeof(BalanceBoard))
- {
-
- }
- }
-
- public void SetCalibration(string calibrationString)
- {
-
- }
-
- public string GetCalibrationString()
- {
- return "";
- }
-
-
- public bool CalibrationEmpty
- {
- get { return false; }
- }
-
- public IEnumerator> GetEnumerator()
- {
- yield return new KeyValuePair("bb", 0);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-
- public struct WiimotePlus : INintrollerState
- {
-#if DEBUG
- private bool _debugViewActive;
- public bool DebugViewActive
- {
- get
- {
- return _debugViewActive;
- }
- set
- {
- _debugViewActive = value;
- }
- }
-#endif
-
- Wiimote wiimote;
- //gyro
-
- public void Update(byte[] data)
- {
- throw new NotImplementedException();
- }
-
- public float GetValue(string input)
- {
- throw new NotImplementedException();
- }
-
- // TODO: Calibration - Balance Board Calibration
- public void SetCalibration(Calibrations.CalibrationPreset preset)
- {
- switch (preset)
- {
- case Calibrations.CalibrationPreset.Default:
- break;
-
- case Calibrations.CalibrationPreset.Modest:
- break;
-
- case Calibrations.CalibrationPreset.Extra:
- break;
-
- case Calibrations.CalibrationPreset.Minimum:
- break;
-
- case Calibrations.CalibrationPreset.None:
- break;
- }
- }
-
- public void SetCalibration(INintrollerState from)
- {
- if (from.GetType() == typeof(WiimotePlus))
- {
-
- }
- }
-
- public void SetCalibration(string calibrationString)
- {
-
- }
-
- public string GetCalibrationString()
- {
- return "";
- }
-
- public bool CalibrationEmpty
- {
- get { return false; }
- }
-
- public IEnumerator> GetEnumerator()
- {
- foreach (var input in wiimote)
- {
- yield return input;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
-
- }
-
-
-}
diff --git a/Nintroller/Controllers/BalanceBoard.cs b/Nintroller/Controllers/BalanceBoard.cs
new file mode 100644
index 0000000..6b2db80
--- /dev/null
+++ b/Nintroller/Controllers/BalanceBoard.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace NintrollerLib
+{
+ public struct BalanceBoard : INintrollerState
+ {
+#if DEBUG
+ private bool _debugViewActive;
+ public bool DebugViewActive
+ {
+ get
+ {
+ return _debugViewActive;
+ }
+ set
+ {
+ _debugViewActive = value;
+ }
+ }
+#endif
+
+ public void Update(byte[] data)
+ {
+ throw new NotImplementedException();
+ }
+
+ public float GetValue(string input)
+ {
+ throw new NotImplementedException();
+ }
+
+ // TODO: Calibration - Balance Board Calibration
+ public void SetCalibration(Calibrations.CalibrationPreset preset)
+ {
+ switch (preset)
+ {
+ case Calibrations.CalibrationPreset.Default:
+ break;
+
+ case Calibrations.CalibrationPreset.Modest:
+ break;
+
+ case Calibrations.CalibrationPreset.Extra:
+ break;
+
+ case Calibrations.CalibrationPreset.Minimum:
+ break;
+
+ case Calibrations.CalibrationPreset.None:
+ break;
+ }
+ }
+
+ public void SetCalibration(INintrollerState from)
+ {
+ if (from.GetType() == typeof(BalanceBoard))
+ {
+
+ }
+ }
+
+ public void SetCalibration(string calibrationString)
+ {
+
+ }
+
+ public string GetCalibrationString()
+ {
+ return "";
+ }
+
+
+ public bool CalibrationEmpty
+ {
+ get { return false; }
+ }
+
+ public IEnumerator> GetEnumerator()
+ {
+ yield return new KeyValuePair("bb", 0);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
diff --git a/Nintroller/Controllers/ClassicController.cs b/Nintroller/Controllers/ClassicController.cs
new file mode 100644
index 0000000..b700985
--- /dev/null
+++ b/Nintroller/Controllers/ClassicController.cs
@@ -0,0 +1,381 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace NintrollerLib
+{
+ public struct ClassicController : INintrollerState
+ {
+#if DEBUG
+ private bool _debugViewActive;
+ public bool DebugViewActive
+ {
+ get
+ {
+ return _debugViewActive;
+ }
+ set
+ {
+ _debugViewActive = value;
+ }
+ }
+#endif
+
+ public Wiimote wiimote;
+ public Joystick LJoy, RJoy;
+ public Trigger L, R;
+ public bool A, B, X, Y;
+ public bool Up, Down, Left, Right;
+ public bool ZL, ZR, LFull, RFull;
+ public bool Plus, Minus, Home;
+
+ public ClassicController(Wiimote wm)
+ {
+ this = new ClassicController();
+ wiimote = wm;
+ }
+
+ public bool Start
+ {
+ get { return Plus; }
+ set { Plus = value; }
+ }
+
+ public bool Select
+ {
+ get { return Minus; }
+ set { Minus = value; }
+ }
+
+ public void Update(byte[] data)
+ {
+ int offset = 0;
+ switch ((InputReport)data[0])
+ {
+ case InputReport.BtnsExt:
+ case InputReport.BtnsExtB:
+ offset = 3;
+ break;
+ case InputReport.BtnsAccExt:
+ offset = 6;
+ break;
+ case InputReport.BtnsIRExt:
+ offset = 13;
+ break;
+ case InputReport.BtnsAccIRExt:
+ offset = 16;
+ break;
+ case InputReport.ExtOnly:
+ offset = 1;
+ break;
+ default:
+ return;
+ }
+
+ if (offset > 0)
+ {
+ // Buttons
+ A = (data[offset + 5] & 0x10) == 0;
+ B = (data[offset + 5] & 0x40) == 0;
+ X = (data[offset + 5] & 0x08) == 0;
+ Y = (data[offset + 5] & 0x20) == 0;
+ LFull = (data[offset + 4] & 0x20) == 0; // Until the Click
+ RFull = (data[offset + 4] & 0x02) == 0; // Until the Click
+ ZL = (data[offset + 5] & 0x80) == 0;
+ ZR = (data[offset + 5] & 0x04) == 0;
+ Plus = (data[offset + 4] & 0x04) == 0;
+ Minus = (data[offset + 4] & 0x10) == 0;
+ Home = (data[offset + 4] & 0x08) == 0;
+
+ // Dpad
+ Up = (data[offset + 5] & 0x01) == 0;
+ Down = (data[offset + 4] & 0x40) == 0;
+ Left = (data[offset + 5] & 0x02) == 0;
+ Right = (data[offset + 4] & 0x80) == 0;
+
+ // Joysticks
+ LJoy.rawX = (byte)(data[offset] & 0x3F);
+ LJoy.rawY = (byte)(data[offset + 1] & 0x03F);
+ RJoy.rawX = (byte)(data[offset + 2] >> 7 | (data[offset + 1] & 0xC0) >> 5 | (data[offset] & 0xC0) >> 3);
+ RJoy.rawY = (byte)(data[offset + 2] & 0x1F);
+
+ // Triggers
+ L.rawValue = (byte)(((data[offset + 2] & 0x60) >> 2) | (data[offset + 3] >> 5));
+ R.rawValue = (byte)(data[offset + 3] & 0x1F);
+ L.full = LFull;
+ R.full = RFull;
+
+ // Normalize
+ LJoy.Normalize();
+ RJoy.Normalize();
+ L.Normalize();
+ R.Normalize();
+ }
+
+ wiimote.Update(data);
+ }
+
+ public float GetValue(string input)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void SetCalibration(Calibrations.CalibrationPreset preset)
+ {
+ wiimote.SetCalibration(preset);
+
+ switch (preset)
+ {
+ case Calibrations.CalibrationPreset.Default:
+ //LJoy.Calibrate(Calibrations.Defaults.ClassicControllerDefault.LJoy);
+ //RJoy.Calibrate(Calibrations.Defaults.ClassicControllerDefault.RJoy);
+ //L.Calibrate(Calibrations.Defaults.ClassicControllerDefault.L);
+ //R.Calibrate(Calibrations.Defaults.ClassicControllerDefault.R);
+ SetCalibration(Calibrations.Defaults.ClassicControllerDefault);
+ break;
+
+ case Calibrations.CalibrationPreset.Modest:
+ SetCalibration(Calibrations.Moderate.ClassicControllerModest);
+ break;
+
+ case Calibrations.CalibrationPreset.Extra:
+ SetCalibration(Calibrations.Extras.ClassicControllerExtra);
+ break;
+
+ case Calibrations.CalibrationPreset.Minimum:
+ SetCalibration(Calibrations.Minimum.ClassicControllerMinimal);
+ break;
+
+ case Calibrations.CalibrationPreset.None:
+ SetCalibration(Calibrations.None.ClassicControllerRaw);
+ break;
+ }
+ }
+
+ public void SetCalibration(INintrollerState from)
+ {
+ if (from.CalibrationEmpty)
+ {
+ // don't apply empty calibrations
+ return;
+ }
+
+ if (from.GetType() == typeof(ClassicController))
+ {
+ LJoy.Calibrate(((ClassicController)from).LJoy);
+ RJoy.Calibrate(((ClassicController)from).RJoy);
+ L.Calibrate(((ClassicController)from).L);
+ R.Calibrate(((ClassicController)from).R);
+ }
+ else if (from.GetType() == typeof(Wiimote))
+ {
+ wiimote.SetCalibration(from);
+ }
+ }
+
+ public void SetCalibration(string calibrationString)
+ {
+ if (calibrationString.Count(c => c == '0') > 5)
+ {
+ // don't set empty calibrations
+ return;
+ }
+
+ string[] components = calibrationString.Split(new char[] { ':' });
+
+ foreach (string component in components)
+ {
+ if (component.StartsWith("joyL"))
+ {
+ string[] joyLConfig = component.Split(new char[] { '|' });
+
+ for (int jL = 1; jL < joyLConfig.Length; jL++)
+ {
+ int value = 0;
+ if (int.TryParse(joyLConfig[jL], out value))
+ {
+ switch (jL)
+ {
+ case 1: LJoy.centerX = value; break;
+ case 2: LJoy.minX = value; break;
+ case 3: LJoy.maxX = value; break;
+ case 4: LJoy.deadX = value; break;
+ case 5: LJoy.centerY = value; break;
+ case 6: LJoy.minY = value; break;
+ case 7: LJoy.maxY = value; break;
+ case 8: LJoy.deadY = value; break;
+ default: break;
+ }
+ }
+ }
+ }
+ else if (component.StartsWith("joyR"))
+ {
+ string[] joyRConfig = component.Split(new char[] { '|' });
+
+ for (int jR = 1; jR < joyRConfig.Length; jR++)
+ {
+ int value = 0;
+ if (int.TryParse(joyRConfig[jR], out value))
+ {
+ switch (jR)
+ {
+ case 1: RJoy.centerX = value; break;
+ case 2: RJoy.minX = value; break;
+ case 3: RJoy.maxX = value; break;
+ case 4: RJoy.deadX = value; break;
+ case 5: RJoy.centerY = value; break;
+ case 6: RJoy.minY = value; break;
+ case 7: RJoy.maxY = value; break;
+ case 8: RJoy.deadY = value; break;
+ default: break;
+ }
+ }
+ }
+ }
+ else if (component.StartsWith("tl"))
+ {
+ string[] triggerLConfig = component.Split(new char[] { '|' });
+
+ for (int tl = 1; tl < triggerLConfig.Length; tl++)
+ {
+ int value = 0;
+ if (int.TryParse(triggerLConfig[tl], out value))
+ {
+ switch (tl)
+ {
+ case 1: L.min = value; break;
+ case 2: L.max = value; break;
+ default: break;
+ }
+ }
+ }
+ }
+ else if (component.StartsWith("tr"))
+ {
+ string[] triggerRConfig = component.Split(new char[] { '|' });
+
+ for (int tr = 1; tr < triggerRConfig.Length; tr++)
+ {
+ int value = 0;
+ if (int.TryParse(triggerRConfig[tr], out value))
+ {
+ switch (tr)
+ {
+ case 1: R.min = value; break;
+ case 2: R.max = value; break;
+ default: break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public string GetCalibrationString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.Append("-cla");
+ sb.Append(":joyL");
+ sb.Append("|"); sb.Append(LJoy.centerX);
+ sb.Append("|"); sb.Append(LJoy.minX);
+ sb.Append("|"); sb.Append(LJoy.maxX);
+ sb.Append("|"); sb.Append(LJoy.deadX);
+ sb.Append("|"); sb.Append(LJoy.centerY);
+ sb.Append("|"); sb.Append(LJoy.minY);
+ sb.Append("|"); sb.Append(LJoy.maxY);
+ sb.Append("|"); sb.Append(LJoy.deadY);
+ sb.Append(":joyR");
+ sb.Append("|"); sb.Append(RJoy.centerX);
+ sb.Append("|"); sb.Append(RJoy.minX);
+ sb.Append("|"); sb.Append(RJoy.maxX);
+ sb.Append("|"); sb.Append(RJoy.deadX);
+ sb.Append("|"); sb.Append(RJoy.centerY);
+ sb.Append("|"); sb.Append(RJoy.minY);
+ sb.Append("|"); sb.Append(RJoy.maxY);
+ sb.Append("|"); sb.Append(RJoy.deadY);
+ sb.Append(":tl");
+ sb.Append("|"); sb.Append(L.min);
+ sb.Append("|"); sb.Append(L.max);
+ sb.Append(":tr");
+ sb.Append("|"); sb.Append(R.min);
+ sb.Append("|"); sb.Append(R.max);
+
+ return sb.ToString();
+ }
+
+ public bool CalibrationEmpty
+ {
+ get
+ {
+ if (LJoy.maxX == 0 && LJoy.maxY == 0 && RJoy.maxX == 0 && RJoy.maxY == 0)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+
+ public IEnumerator> GetEnumerator()
+ {
+ // Wiimote
+ foreach (var input in wiimote)
+ {
+ yield return input;
+ }
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.A, A ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.B, B ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.X, X ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.Y, Y ? 1.0f : 0.0f);
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.L, L.value > 0 ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.R, R.value > 0 ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.ZL, ZL ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.ZR, ZR ? 1.0f : 0.0f);
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.UP, Up ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.DOWN, Down ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LEFT, Left ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RIGHT, Right ? 1.0f : 0.0f);
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.START, Start ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.SELECT, Select ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.HOME, Home ? 1.0f : 0.0f);
+
+ L.Normalize();
+ R.Normalize();
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LFULL, L.full ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RFULL, R.full ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LT, L.value);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RT, R.value);
+
+ LJoy.Normalize();
+ RJoy.Normalize();
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LX, LJoy.X);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LY, LJoy.Y);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RX, RJoy.X);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RY, RJoy.X);
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LUP, LJoy.Y > 0f ? LJoy.Y : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LDOWN, LJoy.Y > 0f ? 0.0f : -LJoy.Y); // These are inverted
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LLEFT, LJoy.X > 0f ? 0.0f : -LJoy.X); // because they
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.LRIGHT, LJoy.X > 0f ? LJoy.X : 0.0f);
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RUP, RJoy.Y > 0f ? RJoy.Y : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RDOWN, RJoy.Y > 0f ? 0.0f : -RJoy.Y); // represents how far the
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RLEFT, RJoy.X > 0f ? 0.0f : -RJoy.X); // input is left or down
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER.RRIGHT, RJoy.X > 0f ? RJoy.X : 0.0f);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
diff --git a/Nintroller/Controllers/ClassicControllerPro.cs b/Nintroller/Controllers/ClassicControllerPro.cs
new file mode 100644
index 0000000..a1769ea
--- /dev/null
+++ b/Nintroller/Controllers/ClassicControllerPro.cs
@@ -0,0 +1,318 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace NintrollerLib
+{
+ public struct ClassicControllerPro : INintrollerState
+ {
+#if DEBUG
+ private bool _debugViewActive;
+ public bool DebugViewActive
+ {
+ get
+ {
+ return _debugViewActive;
+ }
+ set
+ {
+ _debugViewActive = value;
+ }
+ }
+#endif
+
+ public Wiimote wiimote;
+ public Joystick LJoy, RJoy;
+ public bool A, B, X, Y;
+ public bool Up, Down, Left, Right;
+ public bool L, R, ZL, ZR;
+ public bool Plus, Minus, Home;
+
+ public ClassicControllerPro(Wiimote wm)
+ {
+ this = new ClassicControllerPro();
+ wiimote = wm;
+ }
+
+ public bool Start
+ {
+ get { return Plus; }
+ set { Plus = value; }
+ }
+
+ public bool Select
+ {
+ get { return Minus; }
+ set { Minus = value; }
+ }
+
+ public void Update(byte[] data)
+ {
+ int offset = 0;
+ switch ((InputReport)data[0])
+ {
+ case InputReport.BtnsExt:
+ case InputReport.BtnsExtB:
+ offset = 3;
+ break;
+ case InputReport.BtnsAccExt:
+ offset = 6;
+ break;
+ case InputReport.BtnsIRExt:
+ offset = 13;
+ break;
+ case InputReport.BtnsAccIRExt:
+ offset = 16;
+ break;
+ case InputReport.ExtOnly:
+ offset = 1;
+ break;
+ default:
+ return;
+ }
+
+ if (offset > 0)
+ {
+ // Buttons
+ A = (data[offset + 5] & 0x10) == 0;
+ B = (data[offset + 5] & 0x40) == 0;
+ X = (data[offset + 5] & 0x08) == 0;
+ Y = (data[offset + 5] & 0x20) == 0;
+ L = (data[offset + 4] & 0x20) == 0;
+ R = (data[offset + 4] & 0x02) == 0;
+ ZL = (data[offset + 5] & 0x80) == 0;
+ ZR = (data[offset + 5] & 0x04) == 0;
+ Plus = (data[offset + 4] & 0x04) == 0;
+ Minus = (data[offset + 4] & 0x10) == 0;
+ Home = (data[offset + 4] & 0x08) == 0;
+
+ // Dpad
+ Up = (data[offset + 5] & 0x01) == 0;
+ Down = (data[offset + 4] & 0x40) == 0;
+ Left = (data[offset + 5] & 0x02) == 0;
+ Right = (data[offset + 4] & 0x80) == 0;
+
+ // Joysticks
+ LJoy.rawX = (byte)(data[offset] & 0x3F);
+ LJoy.rawY = (byte)(data[offset + 1] & 0x03F);
+ RJoy.rawX = (byte)(data[offset + 2] >> 7 | (data[offset + 1] & 0xC0) >> 5 | (data[offset] & 0xC0) >> 3);
+ RJoy.rawY = (byte)(data[offset + 2] & 0x1F);
+
+ // Normalize
+ LJoy.Normalize();
+ RJoy.Normalize();
+ }
+
+ wiimote.Update(data);
+ }
+
+ public float GetValue(string input)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void SetCalibration(Calibrations.CalibrationPreset preset)
+ {
+ wiimote.SetCalibration(preset);
+
+ switch (preset)
+ {
+ case Calibrations.CalibrationPreset.Default:
+ //LJoy.Calibrate(Calibrations.Defaults.ClassicControllerProDefault.LJoy);
+ //RJoy.Calibrate(Calibrations.Defaults.ClassicControllerProDefault.RJoy);
+ SetCalibration(Calibrations.Defaults.ClassicControllerProDefault);
+ break;
+
+ case Calibrations.CalibrationPreset.Modest:
+ SetCalibration(Calibrations.Moderate.ClassicControllerProModest);
+ break;
+
+ case Calibrations.CalibrationPreset.Extra:
+ SetCalibration(Calibrations.Extras.ClassicControllerProExtra);
+ break;
+
+ case Calibrations.CalibrationPreset.Minimum:
+ SetCalibration(Calibrations.Minimum.ClassicControllerProMinimal);
+ break;
+
+ case Calibrations.CalibrationPreset.None:
+ SetCalibration(Calibrations.None.ClassicControllerProRaw);
+ break;
+ }
+ }
+
+ public void SetCalibration(INintrollerState from)
+ {
+ if (from.CalibrationEmpty)
+ {
+ // don't apply empty calibrations
+ return;
+ }
+
+ if (from.GetType() == typeof(ClassicControllerPro))
+ {
+ LJoy.Calibrate(((ClassicControllerPro)from).LJoy);
+ RJoy.Calibrate(((ClassicControllerPro)from).RJoy);
+ }
+ else if (from.GetType() == typeof(Wiimote))
+ {
+ wiimote.SetCalibration(from);
+ }
+ }
+
+ public void SetCalibration(string calibrationString)
+ {
+ if (calibrationString.Count(c => c == '0') > 5)
+ {
+ // don't set empty calibrations
+ return;
+ }
+
+ string[] components = calibrationString.Split(new char[] { ':' });
+
+ foreach (string component in components)
+ {
+ if (component.StartsWith("joyL"))
+ {
+ string[] joyLConfig = component.Split(new char[] { '|' });
+
+ for (int jL = 1; jL < joyLConfig.Length; jL++)
+ {
+ int value = 0;
+ if (int.TryParse(joyLConfig[jL], out value))
+ {
+ switch (jL)
+ {
+ case 1: LJoy.centerX = value; break;
+ case 2: LJoy.minX = value; break;
+ case 3: LJoy.maxX = value; break;
+ case 4: LJoy.deadX = value; break;
+ case 5: LJoy.centerY = value; break;
+ case 6: LJoy.minY = value; break;
+ case 7: LJoy.maxY = value; break;
+ case 8: LJoy.deadY = value; break;
+ default: break;
+ }
+ }
+ }
+ }
+ else if (component.StartsWith("joyR"))
+ {
+ string[] joyRConfig = component.Split(new char[] { '|' });
+
+ for (int jR = 1; jR < joyRConfig.Length; jR++)
+ {
+ int value = 0;
+ if (int.TryParse(joyRConfig[jR], out value))
+ {
+ switch (jR)
+ {
+ case 1: RJoy.centerX = value; break;
+ case 2: RJoy.minX = value; break;
+ case 3: RJoy.maxX = value; break;
+ case 4: RJoy.deadX = value; break;
+ case 5: RJoy.centerY = value; break;
+ case 6: RJoy.minY = value; break;
+ case 7: RJoy.maxY = value; break;
+ case 8: RJoy.deadY = value; break;
+ default: break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public string GetCalibrationString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.Append("-ccp");
+ sb.Append(":joyL");
+ sb.Append("|"); sb.Append(LJoy.centerX);
+ sb.Append("|"); sb.Append(LJoy.minX);
+ sb.Append("|"); sb.Append(LJoy.maxX);
+ sb.Append("|"); sb.Append(LJoy.deadX);
+ sb.Append("|"); sb.Append(LJoy.centerY);
+ sb.Append("|"); sb.Append(LJoy.minY);
+ sb.Append("|"); sb.Append(LJoy.maxY);
+ sb.Append("|"); sb.Append(LJoy.deadY);
+ sb.Append(":joyR");
+ sb.Append("|"); sb.Append(RJoy.centerX);
+ sb.Append("|"); sb.Append(RJoy.minX);
+ sb.Append("|"); sb.Append(RJoy.maxX);
+ sb.Append("|"); sb.Append(RJoy.deadX);
+ sb.Append("|"); sb.Append(RJoy.centerY);
+ sb.Append("|"); sb.Append(RJoy.minY);
+ sb.Append("|"); sb.Append(RJoy.maxY);
+ sb.Append("|"); sb.Append(RJoy.deadY);
+
+ return sb.ToString();
+ }
+
+ public bool CalibrationEmpty
+ {
+ get
+ {
+ if (LJoy.maxX == 0 && LJoy.maxY == 0 && RJoy.maxX == 0 && RJoy.maxY == 0)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+
+ public IEnumerator> GetEnumerator()
+ {
+ foreach (var input in wiimote)
+ {
+ yield return input;
+ }
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.A, A ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.B, B ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.X, X ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.Y, Y ? 1.0f : 0.0f);
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.L, L ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.R, R ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.ZL, ZL ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.ZR, ZR ? 1.0f : 0.0f);
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.UP, Up ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.DOWN, Down ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LEFT, Left ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RIGHT, Right ? 1.0f : 0.0f);
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.START, Start ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.SELECT, Select ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.HOME, Home ? 1.0f : 0.0f);
+
+ LJoy.Normalize();
+ RJoy.Normalize();
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LX, LJoy.X);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LY, LJoy.Y);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RX, RJoy.X);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RY, RJoy.X);
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LUP, LJoy.Y > 0f ? LJoy.Y : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LDOWN, LJoy.Y > 0f ? 0.0f : -LJoy.Y); // These are inverted
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LLEFT, LJoy.X > 0f ? 0.0f : -LJoy.X); // because they
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LRIGHT, LJoy.X > 0f ? LJoy.X : 0.0f);
+
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RUP, RJoy.Y > 0f ? RJoy.Y : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RDOWN, RJoy.Y > 0f ? 0.0f : -RJoy.Y); // represents how far the
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RLEFT, RJoy.X > 0f ? 0.0f : -RJoy.X); // input is left or down
+ yield return new KeyValuePair(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RRIGHT, RJoy.X > 0f ? RJoy.X : 0.0f);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
diff --git a/Nintroller/WiiDrums.cs b/Nintroller/Controllers/Drums.cs
similarity index 94%
rename from Nintroller/WiiDrums.cs
rename to Nintroller/Controllers/Drums.cs
index deed067..dfd59ec 100644
--- a/Nintroller/WiiDrums.cs
+++ b/Nintroller/Controllers/Drums.cs
@@ -9,7 +9,7 @@
namespace NintrollerLib
{
//Source of mapping info: https://wiibrew.org/wiki/Wiimote/Extension_Controllers/Guitar_Hero_World_Tour_(Wii)_Drums
- public struct WiiDrums : INintrollerState
+ public struct Drums : INintrollerState
{
private bool SpecialButtonSelect => wiimote.buttons.A;
private bool SpecialButtonTiltCalibMin => wiimote.buttons.One;
@@ -47,16 +47,16 @@ public bool DebugViewActive
private bool DebugButton_Dump;
#endif
- public WiiDrums(Wiimote wm)
+ public Drums(Wiimote wm)
{
- this = new WiiDrums();
+ this = new Drums();
wiimote = wm;
#if DEBUG
DebugLastData = new byte[] { 0 };
#endif
- Joy.Calibrate(Calibrations.Defaults.WiiGuitarDefault.Joy);
+ Joy.Calibrate(Calibrations.Defaults.GuitarDefault.Joy);
}
public bool Start
@@ -71,7 +71,7 @@ public bool Select
set { Minus = value; }
}
- private const float WGT_JOY_DIGITAL_THRESH = 0.5f;
+ private const float GTR_JOY_DIGITAL_THRESH = 0.5f;
private static float _MapRange(float s, float a1, float a2, float b1, float b2)
{
@@ -185,7 +185,7 @@ public void Update(byte[] data)
Joy.Normalize();
- bool isJoyPressed = (((Joy.X * Joy.X) + (Joy.Y * Joy.Y)) >= (WGT_JOY_DIGITAL_THRESH * WGT_JOY_DIGITAL_THRESH));
+ bool isJoyPressed = (((Joy.X * Joy.X) + (Joy.Y * Joy.Y)) >= (GTR_JOY_DIGITAL_THRESH * GTR_JOY_DIGITAL_THRESH));
double joyDirection = (int)((Math.Atan2(Joy.Y, Joy.X) + (Math.PI / 2)) / (Math.PI / 8));
int joyDirStep = (int)(Math.Abs(joyDirection));
@@ -368,7 +368,7 @@ public void SetCalibration(Calibrations.CalibrationPreset preset)
- Joy.Calibrate(Calibrations.Defaults.WiiGuitarDefault.Joy);
+ Joy.Calibrate(Calibrations.Defaults.GuitarDefault.Joy);
//SetCalibration(Calibrations.Defaults.ClassicControllerProDefault);
}
@@ -381,9 +381,9 @@ public void SetCalibration(INintrollerState from)
// return;
//}
- //if (from.GetType() == typeof(WiiGuitar))
+ //if (from.GetType() == typeof(Guitar))
//{
- // Joy.Calibrate(((WiiGuitar)from).Joy);
+ // Joy.Calibrate(((Guitar)from).Joy);
//}
//else if (from.GetType() == typeof(ClassicControllerPro))
//{
@@ -437,7 +437,7 @@ public void SetCalibration(string calibrationString)
public string GetCalibrationString()
{
StringBuilder sb = new StringBuilder();
- sb.Append("-wdr");
+ sb.Append("-drm");
sb.Append(":joy");
sb.Append("|"); sb.Append(Joy.centerX);
sb.Append("|"); sb.Append(Joy.minX);
@@ -473,20 +473,20 @@ public IEnumerator> GetEnumerator()
yield return input;
}
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.G, G ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.R, R ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.Y, Y ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.B, B ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.O, O ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.BASS, Bass ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.G, G ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.R, R ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.Y, Y ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.B, B ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.O, O ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.BASS, Bass ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.UP, (Up ? 1.0f : 0.0f));
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.DOWN, (Down ? 1.0f : 0.0f));
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.LEFT, (Left ? 1.0f : 0.0f));
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.RIGHT, (Right ? 1.0f : 0.0f));
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.UP, (Up ? 1.0f : 0.0f));
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.DOWN, (Down ? 1.0f : 0.0f));
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.LEFT, (Left ? 1.0f : 0.0f));
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.RIGHT, (Right ? 1.0f : 0.0f));
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.START, Start ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_DRUMS.SELECT, Select ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.START, Start ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.DRUMS.SELECT, Select ? 1.0f : 0.0f);
}
IEnumerator IEnumerable.GetEnumerator()
diff --git a/Nintroller/WiiGuitar.cs b/Nintroller/Controllers/Guitar.cs
similarity index 81%
rename from Nintroller/WiiGuitar.cs
rename to Nintroller/Controllers/Guitar.cs
index aec65a9..181cc34 100644
--- a/Nintroller/WiiGuitar.cs
+++ b/Nintroller/Controllers/Guitar.cs
@@ -8,7 +8,7 @@
namespace NintrollerLib
{
- public struct WiiGuitar : INintrollerState
+ public struct Guitar : INintrollerState
{
private bool SpecialButtonSelect => wiimote.buttons.A;
private bool SpecialButtonTiltCalibMin => wiimote.buttons.One;
@@ -60,9 +60,9 @@ public bool DebugViewActive
private byte CALIB_Whammy_Min;
private byte CALIB_Whammy_Max;
- public WiiGuitar(Wiimote wm)
+ public Guitar(Wiimote wm)
{
- this = new WiiGuitar();
+ this = new Guitar();
wiimote = wm;
CALIB_Whammy_Min = 0xFF;
@@ -70,7 +70,7 @@ public WiiGuitar(Wiimote wm)
CALIB_Enable_TouchStrip = false;
- oldTouchStripValue = WGT_TOUCH_STRIP_None;
+ oldTouchStripValue = GTR_TOUCH_STRIP_None;
IsGH3SetYet = false;
IsGH3 = false;
@@ -82,7 +82,7 @@ public WiiGuitar(Wiimote wm)
DebugLastData = new byte[] { 0 };
#endif
- Joy.Calibrate(Calibrations.Defaults.WiiGuitarDefault.Joy);
+ Joy.Calibrate(Calibrations.Defaults.GuitarDefault.Joy);
}
public bool Start
@@ -103,40 +103,40 @@ public bool Select
public float CALIB_Tilt_TiltedREEEE;
public float CALIB_Tilt_StartingZ;
- private const byte WGT_TOUCH_STRIP_None = 0x0F;
- private const byte WGT_TOUCH_STRIP_Green = 0x04;
- private const byte WGT_TOUCH_STRIP_Green2 = 0x05;
- private const byte WGT_TOUCH_STRIP_GreenToRed = 0x06;
- private const byte WGT_TOUCH_STRIP_GreenToRed2 = 0x07;
- private const byte WGT_TOUCH_STRIP_GreenToRed3 = 0x08;
- private const byte WGT_TOUCH_STRIP_GreenToRed4 = 0x09;
- private const byte WGT_TOUCH_STRIP_Red = 0x0A;
- private const byte WGT_TOUCH_STRIP_Red2 = 0x0B;
- private const byte WGT_TOUCH_STRIP_Red3 = 0x0C;
- private const byte WGT_TOUCH_STRIP_RedToYellow = 0x0D;
- private const byte WGT_TOUCH_STRIP_RedToYellow2 = 0x0E;
- //private const byte WGT_TOUCH_STRIP_RedToYellow3 = 0x0F; //conflicts with None
- private const byte WGT_TOUCH_STRIP_RedToYellow4 = 0x10;
- private const byte WGT_TOUCH_STRIP_RedToYellow5 = 0x11;
- private const byte WGT_TOUCH_STRIP_Yellow = 0x12;
- private const byte WGT_TOUCH_STRIP_Yellow2 = 0x13;
- private const byte WGT_TOUCH_STRIP_YellowToBlue = 0x14;
- private const byte WGT_TOUCH_STRIP_YellowToBlue2 = 0x15;
- private const byte WGT_TOUCH_STRIP_YellowToBlue3 = 0x16;
- private const byte WGT_TOUCH_STRIP_Blue = 0x17;
- private const byte WGT_TOUCH_STRIP_Blue2 = 0x18;
- private const byte WGT_TOUCH_STRIP_Blue3 = 0x19;
- private const byte WGT_TOUCH_STRIP_BlueToOrange = 0x1A;
- private const byte WGT_TOUCH_STRIP_BlueToOrange2 = 0x1B;
- private const byte WGT_TOUCH_STRIP_BlueToOrange3 = 0x1C;
- private const byte WGT_TOUCH_STRIP_BlueToOrange4 = 0x1D;
- private const byte WGT_TOUCH_STRIP_BlueToOrange5 = 0x1E;
- private const byte WGT_TOUCH_STRIP_Orange = 0x1F;
-
- private const float WGT_JOY_DIGITAL_THRESH = 0.5f;
-
- //private const byte WGT_WHAMMY_MIN = 0x10;
- //private const byte WGT_WHAMMY_MAX = 0x1B;
+ private const byte GTR_TOUCH_STRIP_None = 0x0F;
+ private const byte GTR_TOUCH_STRIP_Green = 0x04;
+ private const byte GTR_TOUCH_STRIP_Green2 = 0x05;
+ private const byte GTR_TOUCH_STRIP_GreenToRed = 0x06;
+ private const byte GTR_TOUCH_STRIP_GreenToRed2 = 0x07;
+ private const byte GTR_TOUCH_STRIP_GreenToRed3 = 0x08;
+ private const byte GTR_TOUCH_STRIP_GreenToRed4 = 0x09;
+ private const byte GTR_TOUCH_STRIP_Red = 0x0A;
+ private const byte GTR_TOUCH_STRIP_Red2 = 0x0B;
+ private const byte GTR_TOUCH_STRIP_Red3 = 0x0C;
+ private const byte GTR_TOUCH_STRIP_RedToYellow = 0x0D;
+ private const byte GTR_TOUCH_STRIP_RedToYellow2 = 0x0E;
+ //private const byte GTR_TOUCH_STRIP_RedToYellow3 = 0x0F; //conflicts with None
+ private const byte GTR_TOUCH_STRIP_RedToYellow4 = 0x10;
+ private const byte GTR_TOUCH_STRIP_RedToYellow5 = 0x11;
+ private const byte GTR_TOUCH_STRIP_Yellow = 0x12;
+ private const byte GTR_TOUCH_STRIP_Yellow2 = 0x13;
+ private const byte GTR_TOUCH_STRIP_YellowToBlue = 0x14;
+ private const byte GTR_TOUCH_STRIP_YellowToBlue2 = 0x15;
+ private const byte GTR_TOUCH_STRIP_YellowToBlue3 = 0x16;
+ private const byte GTR_TOUCH_STRIP_Blue = 0x17;
+ private const byte GTR_TOUCH_STRIP_Blue2 = 0x18;
+ private const byte GTR_TOUCH_STRIP_Blue3 = 0x19;
+ private const byte GTR_TOUCH_STRIP_BlueToOrange = 0x1A;
+ private const byte GTR_TOUCH_STRIP_BlueToOrange2 = 0x1B;
+ private const byte GTR_TOUCH_STRIP_BlueToOrange3 = 0x1C;
+ private const byte GTR_TOUCH_STRIP_BlueToOrange4 = 0x1D;
+ private const byte GTR_TOUCH_STRIP_BlueToOrange5 = 0x1E;
+ private const byte GTR_TOUCH_STRIP_Orange = 0x1F;
+
+ private const float GTR_JOY_DIGITAL_THRESH = 0.5f;
+
+ //private const byte GTR_WHAMMY_MIN = 0x10;
+ //private const byte GTR_WHAMMY_MAX = 0x1B;
private static float _MapRange(float s, float a1, float a2, float b1, float b2)
{
@@ -237,7 +237,7 @@ public void Update(byte[] data)
Joy.Normalize();
- bool isJoyPressed = (((Joy.X * Joy.X) + (Joy.Y * Joy.Y)) >= (WGT_JOY_DIGITAL_THRESH * WGT_JOY_DIGITAL_THRESH));
+ bool isJoyPressed = (((Joy.X * Joy.X) + (Joy.Y * Joy.Y)) >= (GTR_JOY_DIGITAL_THRESH * GTR_JOY_DIGITAL_THRESH));
double joyDirection = (int)((Math.Atan2(Joy.Y, Joy.X) + (Math.PI / 2)) / (Math.PI / 8));
int joyDirStep = (int)(Math.Abs(joyDirection));
@@ -327,7 +327,7 @@ public void Update(byte[] data)
{
if (G || R || Y || B || O)
{
- if (data[offset + 2] != WGT_TOUCH_STRIP_None && oldTouchStripValue == WGT_TOUCH_STRIP_None)
+ if (data[offset + 2] != GTR_TOUCH_STRIP_None && oldTouchStripValue == GTR_TOUCH_STRIP_None)
{
Down = true;
}
@@ -336,54 +336,54 @@ public void Update(byte[] data)
{
switch (data[offset + 2] & 0x1F)
{
- case WGT_TOUCH_STRIP_Green:
- case WGT_TOUCH_STRIP_Green2:
+ case GTR_TOUCH_STRIP_Green:
+ case GTR_TOUCH_STRIP_Green2:
G = true;
break;
- case WGT_TOUCH_STRIP_GreenToRed:
- case WGT_TOUCH_STRIP_GreenToRed2:
- case WGT_TOUCH_STRIP_GreenToRed3:
- case WGT_TOUCH_STRIP_GreenToRed4:
+ case GTR_TOUCH_STRIP_GreenToRed:
+ case GTR_TOUCH_STRIP_GreenToRed2:
+ case GTR_TOUCH_STRIP_GreenToRed3:
+ case GTR_TOUCH_STRIP_GreenToRed4:
G = true;
R = true;
break;
- case WGT_TOUCH_STRIP_Red:
- case WGT_TOUCH_STRIP_Red2:
- case WGT_TOUCH_STRIP_Red3:
+ case GTR_TOUCH_STRIP_Red:
+ case GTR_TOUCH_STRIP_Red2:
+ case GTR_TOUCH_STRIP_Red3:
R = true;
break;
- case WGT_TOUCH_STRIP_RedToYellow:
- case WGT_TOUCH_STRIP_RedToYellow2:
- //case WGT_TOUCH_STRIP_RedToYellow3: //conflicts with None
- case WGT_TOUCH_STRIP_RedToYellow4:
- case WGT_TOUCH_STRIP_RedToYellow5:
+ case GTR_TOUCH_STRIP_RedToYellow:
+ case GTR_TOUCH_STRIP_RedToYellow2:
+ //case GTR_TOUCH_STRIP_RedToYellow3: //conflicts with None
+ case GTR_TOUCH_STRIP_RedToYellow4:
+ case GTR_TOUCH_STRIP_RedToYellow5:
R = true;
Y = true;
break;
- case WGT_TOUCH_STRIP_Yellow:
- case WGT_TOUCH_STRIP_Yellow2:
+ case GTR_TOUCH_STRIP_Yellow:
+ case GTR_TOUCH_STRIP_Yellow2:
Y = true;
break;
- case WGT_TOUCH_STRIP_YellowToBlue:
- case WGT_TOUCH_STRIP_YellowToBlue2:
- case WGT_TOUCH_STRIP_YellowToBlue3:
+ case GTR_TOUCH_STRIP_YellowToBlue:
+ case GTR_TOUCH_STRIP_YellowToBlue2:
+ case GTR_TOUCH_STRIP_YellowToBlue3:
Y = true;
B = true;
break;
- case WGT_TOUCH_STRIP_Blue:
- case WGT_TOUCH_STRIP_Blue2:
- case WGT_TOUCH_STRIP_Blue3:
+ case GTR_TOUCH_STRIP_Blue:
+ case GTR_TOUCH_STRIP_Blue2:
+ case GTR_TOUCH_STRIP_Blue3:
B = true;
break;
- case WGT_TOUCH_STRIP_BlueToOrange:
- case WGT_TOUCH_STRIP_BlueToOrange2:
- case WGT_TOUCH_STRIP_BlueToOrange3:
- case WGT_TOUCH_STRIP_BlueToOrange4:
- case WGT_TOUCH_STRIP_BlueToOrange5:
+ case GTR_TOUCH_STRIP_BlueToOrange:
+ case GTR_TOUCH_STRIP_BlueToOrange2:
+ case GTR_TOUCH_STRIP_BlueToOrange3:
+ case GTR_TOUCH_STRIP_BlueToOrange4:
+ case GTR_TOUCH_STRIP_BlueToOrange5:
B = true;
O = true;
break;
- case WGT_TOUCH_STRIP_Orange:
+ case GTR_TOUCH_STRIP_Orange:
O = true;
break;
}
@@ -575,7 +575,7 @@ public void SetCalibration(Calibrations.CalibrationPreset preset)
- Joy.Calibrate(Calibrations.Defaults.WiiGuitarDefault.Joy);
+ Joy.Calibrate(Calibrations.Defaults.GuitarDefault.Joy);
//SetCalibration(Calibrations.Defaults.ClassicControllerProDefault);
}
@@ -588,9 +588,9 @@ public void SetCalibration(INintrollerState from)
// return;
//}
- //if (from.GetType() == typeof(WiiGuitar))
+ //if (from.GetType() == typeof(Guitar))
//{
- // Joy.Calibrate(((WiiGuitar)from).Joy);
+ // Joy.Calibrate(((Guitar)from).Joy);
//}
//else if (from.GetType() == typeof(ClassicControllerPro))
//{
@@ -644,7 +644,7 @@ public void SetCalibration(string calibrationString)
public string GetCalibrationString()
{
StringBuilder sb = new StringBuilder();
- sb.Append("-wgt");
+ sb.Append("-gtr");
sb.Append(":joy");
sb.Append("|"); sb.Append(Joy.centerX);
sb.Append("|"); sb.Append(Joy.minX);
@@ -680,25 +680,25 @@ public IEnumerator> GetEnumerator()
yield return input;
}
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.G, G ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.R, R ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.Y, Y ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.B, B ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.O, O ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.G, G ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.R, R ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.Y, Y ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.B, B ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.O, O ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.UP, (Up ? 1.0f : 0.0f));
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.DOWN, (Down ? 1.0f : 0.0f));
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.LEFT, (Left ? 1.0f : 0.0f));
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.RIGHT, (Right ? 1.0f : 0.0f));
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.UP, (Up ? 1.0f : 0.0f));
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.DOWN, (Down ? 1.0f : 0.0f));
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.LEFT, (Left ? 1.0f : 0.0f));
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.RIGHT, (Right ? 1.0f : 0.0f));
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.START, Start ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.SELECT, Select ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.START, Start ? 1.0f : 0.0f);
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.SELECT, Select ? 1.0f : 0.0f);
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.WHAMMYHIGH, WhammyHigh);
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.WHAMMYLOW, WhammyLow);
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.WHAMMYHIGH, WhammyHigh);
+ yield return new KeyValuePair(INPUT_NAMES.GUITAR.WHAMMYLOW, WhammyLow);
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.TILTHIGH, TiltHigh);
- yield return new KeyValuePair(INPUT_NAMES.WII_GUITAR.TILTLOW, TiltLow);
+ yield return new KeyValuePair