Skip to content

Commit 254f035

Browse files
Add project files.
1 parent 872cf26 commit 254f035

23 files changed

+881
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net7.0</TargetFrameworks>
5+
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<None Remove="settings.json" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<Content Include="settings.json">
15+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
16+
</Content>
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
21+
<PackageReference Include="Serilog" Version="4.0.2" />
22+
<PackageReference Include="xunit" Version="2.9.0" />
23+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
24+
<PrivateAssets>all</PrivateAssets>
25+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
26+
</PackageReference>
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<ProjectReference Include="..\JoystickHelper\JoystickHelper.csproj" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<None Update="RyujinxConfigSample.json">
35+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
36+
</None>
37+
</ItemGroup>
38+
39+
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using JoystickHelper.Ryujinx;
5+
using Xunit;
6+
7+
namespace JoystickHelper.Tests;
8+
9+
public class RyujinxConfigHelperTest
10+
{
11+
12+
[Fact]
13+
public void TestRyujinxConfig()
14+
{
15+
var configJson = File.ReadAllText("./RyujinxConfigSample.json");
16+
var joysticks = new List<JoystickInfo> { new JoystickInfo { SdlJoystickGuid = Guid.NewGuid() } };
17+
var result = RyujinxConfigHelper.SetJoystickGuids(joysticks, configJson);
18+
19+
Assert.Contains(joysticks[0].SdlJoystickGuid.ToString(), result.ModifiedConfigJson);
20+
}
21+
}
Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
{
2+
"version": 49,
3+
"enable_file_log": true,
4+
"backend_threading": "Off",
5+
"res_scale": 2,
6+
"res_scale_custom": 1,
7+
"max_anisotropy": -1,
8+
"aspect_ratio": "Fixed16x9",
9+
"anti_aliasing": "None",
10+
"scaling_filter": "Bilinear",
11+
"scaling_filter_level": 80,
12+
"graphics_shaders_dump_path": "",
13+
"logging_enable_debug": false,
14+
"logging_enable_stub": true,
15+
"logging_enable_info": true,
16+
"logging_enable_warn": true,
17+
"logging_enable_error": true,
18+
"logging_enable_trace": false,
19+
"logging_enable_guest": true,
20+
"logging_enable_fs_access_log": false,
21+
"logging_filtered_classes": [
22+
23+
],
24+
"logging_graphics_debug_level": "None",
25+
"system_language": "AmericanEnglish",
26+
"system_region": "USA",
27+
"system_time_zone": "America/Vancouver",
28+
"system_time_offset": 0,
29+
"docked_mode": true,
30+
"enable_discord_integration": false,
31+
"check_updates_on_start": false,
32+
"show_confirm_exit": false,
33+
"hide_cursor": 2,
34+
"enable_vsync": true,
35+
"enable_shader_cache": true,
36+
"enable_texture_recompression": false,
37+
"enable_macro_hle": true,
38+
"enable_color_space_passthrough": false,
39+
"enable_ptc": true,
40+
"enable_internet_access": false,
41+
"enable_fs_integrity_checks": true,
42+
"fs_global_access_log_mode": 0,
43+
"audio_backend": "SDL2",
44+
"audio_volume": 1,
45+
"memory_manager_mode": "HostMappedUnsafe",
46+
"expand_ram": false,
47+
"ignore_missing_services": false,
48+
"gui_columns": {
49+
"fav_column": true,
50+
"icon_column": true,
51+
"app_column": true,
52+
"dev_column": true,
53+
"version_column": true,
54+
"time_played_column": true,
55+
"last_played_column": true,
56+
"file_ext_column": true,
57+
"file_size_column": true,
58+
"path_column": true
59+
},
60+
"column_sort": {
61+
"sort_column_id": 2,
62+
"sort_ascending": true
63+
},
64+
"game_dirs": [
65+
"F:\\Emulation\\ROMs\\Switch"
66+
],
67+
"shown_file_types": {
68+
"nsp": true,
69+
"pfs0": true,
70+
"xci": true,
71+
"nca": true,
72+
"nro": true,
73+
"nso": true
74+
},
75+
"window_startup": {
76+
"window_size_width": 1920,
77+
"window_size_height": 976,
78+
"window_position_x": -8,
79+
"window_position_y": -8,
80+
"window_maximized": true
81+
},
82+
"language_code": "en_US",
83+
"enable_custom_theme": false,
84+
"custom_theme_path": "",
85+
"base_style": "Dark",
86+
"game_list_view_mode": 0,
87+
"show_names": true,
88+
"grid_size": 2,
89+
"application_sort": 0,
90+
"is_ascending_order": true,
91+
"start_fullscreen": true,
92+
"show_console": false,
93+
"enable_keyboard": false,
94+
"enable_mouse": false,
95+
"hotkeys": {
96+
"toggle_vsync": "F1",
97+
"screenshot": "F8",
98+
"show_ui": "F4",
99+
"pause": "F5",
100+
"toggle_mute": "F2",
101+
"res_scale_up": "Unbound",
102+
"res_scale_down": "Unbound",
103+
"volume_up": "Unbound",
104+
"volume_down": "Unbound"
105+
},
106+
"keyboard_config": [
107+
108+
],
109+
"controller_config": [
110+
111+
],
112+
"input_config": [
113+
{
114+
"left_joycon_stick": {
115+
"joystick": "Left",
116+
"invert_stick_x": false,
117+
"invert_stick_y": false,
118+
"rotate90_cw": false,
119+
"stick_button": "LeftStick"
120+
},
121+
"right_joycon_stick": {
122+
"joystick": "Right",
123+
"invert_stick_x": false,
124+
"invert_stick_y": false,
125+
"rotate90_cw": false,
126+
"stick_button": "RightStick"
127+
},
128+
"deadzone_left": 0,
129+
"deadzone_right": 0,
130+
"range_left": 1,
131+
"range_right": 1,
132+
"trigger_threshold": 0,
133+
"motion": {
134+
"motion_backend": "GamepadDriver",
135+
"sensitivity": 100,
136+
"gyro_deadzone": 1,
137+
"enable_motion": false
138+
},
139+
"rumble": {
140+
"strong_rumble": 1,
141+
"weak_rumble": 1,
142+
"enable_rumble": false
143+
},
144+
"left_joycon": {
145+
"button_minus": "Back",
146+
"button_l": "LeftShoulder",
147+
"button_zl": "LeftTrigger",
148+
"button_sl": "Unbound",
149+
"button_sr": "Unbound",
150+
"dpad_up": "DpadUp",
151+
"dpad_down": "DpadDown",
152+
"dpad_left": "DpadLeft",
153+
"dpad_right": "DpadRight"
154+
},
155+
"right_joycon": {
156+
"button_plus": "Start",
157+
"button_r": "RightShoulder",
158+
"button_zr": "RightTrigger",
159+
"button_sl": "Unbound",
160+
"button_sr": "Unbound",
161+
"button_x": "Y",
162+
"button_b": "A",
163+
"button_y": "X",
164+
"button_a": "B"
165+
},
166+
"version": 1,
167+
"backend": "GamepadSDL2",
168+
"id": "0-f0440003-045e-0000-e002-000000007200",
169+
"controller_type": "JoyconPair",
170+
"player_index": "Player1"
171+
},
172+
{
173+
"left_joycon_stick": {
174+
"joystick": "Left",
175+
"invert_stick_x": false,
176+
"invert_stick_y": false,
177+
"rotate90_cw": false,
178+
"stick_button": "LeftStick"
179+
},
180+
"right_joycon_stick": {
181+
"joystick": "Right",
182+
"invert_stick_x": false,
183+
"invert_stick_y": false,
184+
"rotate90_cw": false,
185+
"stick_button": "RightStick"
186+
},
187+
"deadzone_left": 0.1,
188+
"deadzone_right": 0.1,
189+
"range_left": 1,
190+
"range_right": 1,
191+
"trigger_threshold": 0.5,
192+
"motion": {
193+
"motion_backend": "GamepadDriver",
194+
"sensitivity": 100,
195+
"gyro_deadzone": 1,
196+
"enable_motion": true
197+
},
198+
"rumble": {
199+
"strong_rumble": 1,
200+
"weak_rumble": 1,
201+
"enable_rumble": false
202+
},
203+
"left_joycon": {
204+
"button_minus": "Back",
205+
"button_l": "LeftShoulder",
206+
"button_zl": "LeftTrigger",
207+
"button_sl": "Unbound",
208+
"button_sr": "Unbound",
209+
"dpad_up": "DpadUp",
210+
"dpad_down": "DpadDown",
211+
"dpad_left": "DpadLeft",
212+
"dpad_right": "DpadRight"
213+
},
214+
"right_joycon": {
215+
"button_plus": "Start",
216+
"button_r": "RightShoulder",
217+
"button_zr": "RightTrigger",
218+
"button_sl": "Unbound",
219+
"button_sr": "Unbound",
220+
"button_x": "Y",
221+
"button_b": "A",
222+
"button_y": "X",
223+
"button_a": "B"
224+
},
225+
"version": 1,
226+
"backend": "GamepadSDL2",
227+
"id": "1-f0030003-045e-0000-8e02-000000007200",
228+
"controller_type": "JoyconPair",
229+
"player_index": "Player2"
230+
},
231+
{
232+
"left_joycon_stick": {
233+
"joystick": "Left",
234+
"invert_stick_x": false,
235+
"invert_stick_y": false,
236+
"rotate90_cw": false,
237+
"stick_button": "LeftStick"
238+
},
239+
"right_joycon_stick": {
240+
"joystick": "Right",
241+
"invert_stick_x": false,
242+
"invert_stick_y": false,
243+
"rotate90_cw": false,
244+
"stick_button": "RightStick"
245+
},
246+
"deadzone_left": 0.1,
247+
"deadzone_right": 0.1,
248+
"range_left": 1,
249+
"range_right": 1,
250+
"trigger_threshold": 0.5,
251+
"motion": {
252+
"motion_backend": "GamepadDriver",
253+
"sensitivity": 100,
254+
"gyro_deadzone": 1,
255+
"enable_motion": true
256+
},
257+
"rumble": {
258+
"strong_rumble": 1,
259+
"weak_rumble": 1,
260+
"enable_rumble": false
261+
},
262+
"left_joycon": {
263+
"button_minus": "Back",
264+
"button_l": "LeftShoulder",
265+
"button_zl": "LeftTrigger",
266+
"button_sl": "Unbound",
267+
"button_sr": "Unbound",
268+
"dpad_up": "DpadUp",
269+
"dpad_down": "DpadDown",
270+
"dpad_left": "DpadLeft",
271+
"dpad_right": "DpadRight"
272+
},
273+
"right_joycon": {
274+
"button_plus": "Start",
275+
"button_r": "RightShoulder",
276+
"button_zr": "RightTrigger",
277+
"button_sl": "Unbound",
278+
"button_sr": "Unbound",
279+
"button_x": "Y",
280+
"button_b": "A",
281+
"button_y": "X",
282+
"button_a": "B"
283+
},
284+
"version": 1,
285+
"backend": "GamepadSDL2",
286+
"id": "2-f0030003-045e-0000-8e02-000000007200",
287+
"controller_type": "JoyconPair",
288+
"player_index": "Player3"
289+
}
290+
],
291+
"graphics_backend": "Vulkan",
292+
"preferred_gpu": "0x10DE_0x2206",
293+
"multiplayer_mode": 0,
294+
"multiplayer_lan_interface_id": "0",
295+
"use_hypervisor": true
296+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using Xunit;
3+
using Xunit.Abstractions;
4+
5+
namespace JoystickHelper.Tests;
6+
7+
public class SdlHelperTest
8+
{
9+
private readonly ITestOutputHelper _testOutputHelper;
10+
11+
public SdlHelperTest(ITestOutputHelper testOutputHelper)
12+
{
13+
_testOutputHelper = testOutputHelper;
14+
}
15+
16+
[Fact]
17+
public void TestIfDetectsControllers()
18+
{
19+
var controllerGuids = SdlHelper.GetConnectedJoysticks();
20+
21+
_testOutputHelper.WriteLine(String.Join(", ", controllerGuids));
22+
23+
Assert.NotEmpty(controllerGuids);
24+
}
25+
}

0 commit comments

Comments
 (0)