-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathMainWindow.xaml
338 lines (312 loc) · 22.5 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<adonisControls:AdonisWindow x:Class="BthPS3CfgUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BthPS3CfgUI"
xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI"
xmlns:adonisControls="clr-namespace:AdonisUI.Controls;assembly=AdonisUI"
mc:Ignorable="d"
Title="BthPS3 Driver Configuration Utility" Height="540" Width="800"
ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
<adonisControls:AdonisWindow.TitleBarContent>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right">
<Button Content="?"
Style="{DynamicResource {x:Static adonisUi:Styles.WindowButton}}"
FontFamily="Segoe UI"
FontSize="14"
Click="Help_OnClick"/>
</StackPanel>
</adonisControls:AdonisWindow.TitleBarContent>
<adonisControls:AdonisWindow.Resources >
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</adonisControls:AdonisWindow.Resources>
<Grid>
<TabControl>
<!-- Profile Driver Settings -->
<TabItem Header="Profile Driver Settings">
<StackPanel>
<TextBlock>Changing these settings applies to newly connected devices.</TextBlock>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- IsSIXAXISSupported -->
<GroupBox Grid.Column="0" Grid.Row="0"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=IsSIXAXISSupported}">Enable SIXAXIS™️/DualShock™️ 3 Support</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
SIXAXIS™️/DualShock™️ 3 compatible wireless devices will be picked up by the driver and exposed to the system.
</TextBlock>
</GroupBox.Content>
</GroupBox>
<!-- IsNAVIGATIONSupported -->
<GroupBox Grid.Column="0" Grid.Row="1"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=IsNAVIGATIONSupported}">Enable PlayStation®️ Move Navigation Support</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
PlayStation®️ Move Navigation compatible wireless devices will be picked up by the driver and exposed to the system.
</TextBlock>
</GroupBox.Content>
</GroupBox>
<!-- IsMOTIONSupported -->
<GroupBox Grid.Column="0" Grid.Row="2"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=IsMOTIONSupported}">Enable PlayStation®️ Move Motion Support</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
PlayStation®️ Move Motion compatible wireless devices will be picked up by the driver and exposed to the system.
This option needs to be turned off to not break compatibility with the
<Hyperlink NavigateUri="https://github.com/psmoveservice/PSMoveService"
RequestNavigate="Hyperlink_OnRequestNavigate">
PSMoveService
</Hyperlink>
project.
</TextBlock>
</GroupBox.Content>
</GroupBox>
<!-- IsWIRELESSSupported -->
<GroupBox Grid.Column="0" Grid.Row="3"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=IsWIRELESSSupported}">Enable Wireless Controller (DualShock™️ 4) Support</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
DualShock™️ 4 (1/2) compatible wireless devices will be picked up by the driver and exposed to the system.
This option needs to be turned off to not break compatibility with the
<Hyperlink NavigateUri="https://github.com/Ryochan7/DS4Windows"
RequestNavigate="Hyperlink_OnRequestNavigate">
DS4Windows
</Hyperlink>
project.
</TextBlock>
</GroupBox.Content>
</GroupBox>
<!-- AutoEnableFilter -->
<GroupBox Grid.Column="1" Grid.Row="0"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=AutoEnableFilter}">Automatically re-enable filter after grace period has passed</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
The profile driver will instruct the filter to enable the L2CAP patch again automatically after the defined grace period has passed.
</TextBlock>
</GroupBox.Content>
</GroupBox>
<!-- AutoEnableFilterDelay -->
<GroupBox Grid.Column="1" Grid.Row="1"
Margin="{adonisUi:Space 1}"
IsEnabled="{Binding Path=AutoEnableFilter}">
<GroupBox.Header>
<DockPanel>
<Slider Width="100"
AutoToolTipPlacement="TopLeft" AutoToolTipPrecision="0"
Minimum="10"
TickFrequency="1"
Maximum="60"
IsSnapToTickEnabled="True"
Value="{Binding Path=AutoEnableFilterDelay}" />
<TextBlock Margin="5,0,5,0">Re-enable filter after</TextBlock>
<TextBlock Text="{Binding Path=AutoEnableFilterDelay}" />
<TextBlock Margin="5,0,0,0">Seconds</TextBlock>
</DockPanel>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
Time span (grace period) within the L2CAP patch will stay disabled
(a workaround to mitigate interference with other HID devices).
</TextBlock>
</GroupBox.Content>
</GroupBox>
<!-- AutoDisableFilter -->
<GroupBox Grid.Column="1" Grid.Row="2"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=AutoDisableFilter}">Automatically disable filter on unsupported device arrival</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
The profile driver will instruct the filter to disable the L2CAP patch after an unsupported or disabled device tried to connect.
When the grace period becomes active, the filter is basically set to "pass-thru" and standard-compliant operation is ensured.
</TextBlock>
</GroupBox.Content>
</GroupBox>
</Grid>
</StackPanel>
</TabItem>
<!-- Filter Driver Settings -->
<TabItem Header="Filter Driver Settings">
<StackPanel>
<TextBlock>Changing these settings applies to newly connected devices.</TextBlock>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<!-- <ColumnDefinition Width="*" /> -->
</Grid.ColumnDefinitions>
<!-- Is filter patch enabled/disabled -->
<GroupBox Grid.Column="0" Grid.Row="0"
Visibility="{Binding Path=IsBluetoothRadioAvailable.Value, Converter={StaticResource BoolToVisibilityConverter}}"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=IsPSMPatchEnabled}">Enable PSM patching</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
The L2CAP PSM (Protocol/Service Multiplexer) patching the filter driver performs is the core functionality required for this solution to work.
While in operation, the filter transparently alters some incoming packets causing a re-routing of traffic to the Profile Driver.
This behaviour can be either manually or automatically disabled to circumvent possible compatibility issues with other wireless devices.
To influence the automatism please refer to the Profile Driver Settings tab. Changing this setting has no effect on currently connected devices.
<LineBreak/><LineBreak/>
An example when run under default (shipped) settings:<LineBreak/><LineBreak/>
- Pair/power on a DualShock 4 controller in PC mode<LineBreak/>
- Patch is enabled, traffic will be sent to profile driver<LineBreak/>
- Profile driver drops connection and instructs filter to disable itself for 10 seconds<LineBreak/>
- Within these 10 seconds, power on the controller again<LineBreak/>
- Patch is disabled, traffic will now flow as in vanilla operation<LineBreak/>
- The DualShock 4 operates in PC mode as expected<LineBreak/>
- The filter gets enabled automatically after 10 seconds pass<LineBreak/>
- Other PS3 peripherals can now connect again<LineBreak/><LineBreak/>
This example will not work if "Enable Wireless Controller (DualShock™️ 4) Support" is ticked.
</TextBlock>
</GroupBox.Content>
</GroupBox>
<TextBlock
Grid.Column="0" Grid.Row="0"
FontSize="16"
Visibility="{Binding Path=IsBluetoothRadioAvailable.Invert, Converter={StaticResource BoolToVisibilityConverter}}"
Margin="{adonisUi:Space 1}">
Bluetooth Radio not found, these settings can't be altered without a functioning host.
</TextBlock>
</Grid>
</StackPanel>
</TabItem>
<!-- Danger Zone -->
<TabItem Header="Danger Zone" Background="{DynamicResource {x:Static adonisUi:Brushes.ErrorBrush}}">
<StackPanel>
<TextBlock>Changing these settings can cause unpredicted or unwanted behavior. Modify at your own risk. Device reconnect required.</TextBlock>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- RawPDO -->
<GroupBox Grid.Column="0" Grid.Row="0"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=RawPDO}">Expose PDO as RAW device to user-land</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
Connected devices will be exposed in RAW PDO mode, making them available for reading/writing to any user-land application that has permissions to open the device.
</TextBlock>
</GroupBox.Content>
</GroupBox>
<!-- HidePDO -->
<GroupBox Grid.Column="0" Grid.Row="1"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=HidePDO}">Hide PDO from Device Manager</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
Hide connected devices from Device Manager. Useful as a cosmetic fix if no NULL or function driver is present for the device.
</TextBlock>
</GroupBox.Content>
</GroupBox>
<!-- AdminOnlyPDO -->
<GroupBox Grid.Column="0" Grid.Row="2"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=AdminOnlyPDO}">Restrict PDO access to elevated users</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
Only processes running under elevated users (System Services, Administrators) can access connected devices.
</TextBlock>
</GroupBox.Content>
</GroupBox>
<!-- ExclusivePDO -->
<GroupBox Grid.Column="0" Grid.Row="3"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<CheckBox IsChecked="{Binding Path=ExclusivePDO}">Exclusive PDO access enforced</CheckBox>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
Restrict PDO access to one handle only. Recommended to keep applications from taking over devices which are already read/written to.
</TextBlock>
</GroupBox.Content>
</GroupBox>
<!-- ChildIdleTimeout -->
<GroupBox Grid.Column="1" Grid.Row="0"
Margin="{adonisUi:Space 1}">
<GroupBox.Header>
<DockPanel>
<Slider Width="120"
AutoToolTipPlacement="TopLeft" AutoToolTipPrecision="0"
Minimum="2000"
TickFrequency="1000"
Maximum="120000"
IsSnapToTickEnabled="True"
Value="{Binding Path=ChildIdleTimeout}" />
<TextBlock Margin="5,0,5,0">PDO S0 Idle Timeout:</TextBlock>
<TextBlock Text="{Binding Path=ChildIdleTimeout}" />
<TextBlock Margin="5,0,0,0">Milliseconds</TextBlock>
</DockPanel>
</GroupBox.Header>
<GroupBox.Content>
<TextBlock TextWrapping="Wrap" TextAlignment="Justify">
When S0 Idle Timeout is triggered (e.g. no I/O activity for the defined time span), the device will be disconnected to mitigate uncontrolled kernel memory consumption.
</TextBlock>
</GroupBox.Content>
</GroupBox>
</Grid>
</StackPanel>
</TabItem>
<!-- About -->
<TabItem Header="About">
<TextBlock TextAlignment="Justify" TextWrapping="Wrap">
Copyright (c) 2018-2024 - Nefarius Software Solutions e.U.<LineBreak/><LineBreak/>
This is a community project and not affiliated with Sony Interactive Entertainment Inc. in any way.<LineBreak/><LineBreak/>
"PlayStation", "PSP", "PS2", "PS one", "DUALSHOCK" and "SIXAXIS" are registered trademarks of Sony Interactive Entertainment Inc.<LineBreak/><LineBreak/>
BthPS3 is released as freeware. You are allowed to freely distribute this solution via floppy disk, CD-ROM, Internet, or in any other way, as long as you don't charge anything for this. If you distribute this solution, you must include all files in the distribution package, without any modification.<LineBreak/><LineBreak/>
Should you wish to redistribute this program, or any part of it, you should read the full terms and conditions set out in the license agreement before doing so. A copy of the license is available on our website.<LineBreak/><LineBreak/>
If you simply wish to install and use this software, you need only be aware of the disclaimer conditions in the license, which are set out below.<LineBreak/><LineBreak/>
<Bold>NO WARRANTY</Bold><LineBreak/><LineBreak/>
Because the program is licensed free of charge, there is no warranty for the program, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide the program "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. Should the program prove defective, you assume the cost of all necessary servicing, repair or correction.<LineBreak/><LineBreak/>
In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who may modify and/or redistribute the program as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages.<LineBreak/><LineBreak/>
</TextBlock>
</TabItem>
</TabControl>
</Grid>
</adonisControls:AdonisWindow>