Compare commits

...

2 commits

3 changed files with 115 additions and 84 deletions

View file

@ -1,6 +1,16 @@
{...}: {
{pkgs, ...}: {
imports = [
./programs
./services
];
system.replaceDependencies.replacements = [
{
oldDependency = pkgs.sdl3;
newDependency = pkgs.sdl3.overrideAttrs {
patches = [
./sdl-keychron-blacklist.patch
];
};
}
];
}

View file

@ -7,6 +7,7 @@
url = "https://myrient.erista.me/files/Redump/Sony%20-%20PlayStation%202%20-%20BIOS%20Images%20%28DoM%20Version%29/ps2-0200a-20040614.zip";
hash = "sha256-wMvswgmsKl+cJl49VlVW84tvU5Jzd+2dl07SOiUDtwA=";
};
toPcsx2INI = lib.generators.toINI {listsAsDuplicateKeys = true;};
in {
home-manager.users.toast = {
home.packages = with pkgs; [
@ -15,93 +16,100 @@ in {
xdg.configFile = {
#PCSX2 silently overwrites the symlink so I need to force it's creation
"PCSX2/inis/PCSX2.ini".force = true;
"PCSX2/inis/PCSX2.ini".text =
lib.generators.toINI {
listsAsDuplicateKeys = true;
} {
UI = {
SettingsVersion = 1;
# Use the system theme
Theme = "";
HideMouseCursor = true;
};
Folders = {
Bios = "/home/toast/.local/share/PCSX2/bios";
};
GameList.RecursivePaths = [
"/home/toast/Games/PS2/"
];
"EmuCore/GS" = {
dithering_ps2 = 1;
upscale_multiplier = 2;
};
EmuCore = {
EnableDiscordPresence = true;
EnableFastBoot = true;
McdFolderAutoManage = false;
};
MemoryCards.Slot1_Filename = "MemoryCard1.ps2";
# Controller settings
Pad1 = {
Up = "SDL-0/DPadUp";
Right = "SDL-0/DPadRight";
Down = "SDL-0/DPadDown";
Left = "SDL-0/DPadLeft";
Triangle = "SDL-0/Y";
Circle = "SDL-0/B";
Cross = "SDL-0/A";
Square = "SDL-0/X";
Select = "SDL-0/Back";
Start = "SDL-0/Start";
L1 = "SDL-0/LeftShoulder";
L2 = "SDL-0/+LeftTrigger";
R1 = "SDL-0/RightShoulder";
R2 = "SDL-0/+RightTrigger";
L3 = "SDL-0/LeftStick";
R3 = "SDL-0/RightStick";
Analog = "SDL-0/Guide";
LUp = "SDL-0/-LeftY";
LRight = "SDL-0/+LeftX";
LDown = "SDL-0/+LeftY";
LLeft = "SDL-0/-LeftX";
RUp = "SDL-0/-RightY";
RRight = "SDL-0/+RightX";
RDown = "SDL-0/+RightY";
RLeft = "SDL-0/-RightX";
LargeMotor = "SDL-0/LargeMotor";
SmallMotor = "SDL-0/SmallMotor";
};
# Default hotkeys
Hotkeys = {
ToggleFullscreen = "Keyboard/Alt & Keyboard/Return";
CycleAspectRatio = "Keyboard/F6";
CycleInterlaceMode = "Keyboard/F5";
CycleMipmapMode = "Keyboard/Insert";
GSDumpMultiFrame = "Keyboard/Control & Keyboard/Shift & Keyboard/F8";
Screenshot = "Keyboard/F8";
GSDumpSingleFrame = "Keyboard/Shift & Keyboard/F8";
ToggleSoftwareRendering = "Keyboard/F9";
ZoomIn = "Keyboard/Control & Keyboard/Plus";
ZoomOut = "Keyboard/Control & Keyboard/Minus";
InputRecToggleMode = "Keyboard/Shift & Keyboard/R";
LoadStateFromSlot = "Keyboard/F3";
SaveStateToSlot = "Keyboard/F1";
NextSaveStateSlot = "Keyboard/F2";
PreviousSaveStateSlot = "Keyboard/Shift & Keyboard/F2";
OpenPauseMenu = "Keyboard/Escape";
ToggleFrameLimit = "Keyboard/F4";
TogglePause = "Keyboard/Space";
ToggleSlowMotion = "Keyboard/Shift & Keyboard/Backtab";
ToggleTurbo = "Keyboard/Tab";
HoldTurbo = "Keyboard/Period";
};
"PCSX2/inis/PCSX2.ini".text = toPcsx2INI {
UI = {
SettingsVersion = 1;
# Use the system theme
Theme = "";
HideMouseCursor = true;
};
Folders = {
Bios = "/home/toast/.local/share/PCSX2/bios";
};
GameList.RecursivePaths = [
"/home/toast/Games/PS2/"
];
"EmuCore/GS" = {
dithering_ps2 = 1;
upscale_multiplier = 2;
};
EmuCore = {
EnableDiscordPresence = true;
EnableFastBoot = true;
McdFolderAutoManage = false;
};
MemoryCards.Slot1_Filename = "MemoryCard1.ps2";
# Controller settings
Pad1 = {
Up = "SDL-0/DPadUp";
Right = "SDL-0/DPadRight";
Down = "SDL-0/DPadDown";
Left = "SDL-0/DPadLeft";
Triangle = "SDL-0/Y";
Circle = "SDL-0/B";
Cross = "SDL-0/A";
Square = "SDL-0/X";
Select = "SDL-0/Back";
Start = "SDL-0/Start";
L1 = "SDL-0/LeftShoulder";
L2 = "SDL-0/+LeftTrigger";
R1 = "SDL-0/RightShoulder";
R2 = "SDL-0/+RightTrigger";
L3 = "SDL-0/LeftStick";
R3 = "SDL-0/RightStick";
Analog = "SDL-0/Guide";
LUp = "SDL-0/-LeftY";
LRight = "SDL-0/+LeftX";
LDown = "SDL-0/+LeftY";
LLeft = "SDL-0/-LeftX";
RUp = "SDL-0/-RightY";
RRight = "SDL-0/+RightX";
RDown = "SDL-0/+RightY";
RLeft = "SDL-0/-RightX";
LargeMotor = "SDL-0/LargeMotor";
SmallMotor = "SDL-0/SmallMotor";
};
# Default hotkeys
Hotkeys = {
ToggleFullscreen = "Keyboard/Alt & Keyboard/Return";
CycleAspectRatio = "Keyboard/F6";
CycleInterlaceMode = "Keyboard/F5";
CycleMipmapMode = "Keyboard/Insert";
GSDumpMultiFrame = "Keyboard/Control & Keyboard/Shift & Keyboard/F8";
Screenshot = "Keyboard/F8";
GSDumpSingleFrame = "Keyboard/Shift & Keyboard/F8";
ToggleSoftwareRendering = "Keyboard/F9";
ZoomIn = "Keyboard/Control & Keyboard/Plus";
ZoomOut = "Keyboard/Control & Keyboard/Minus";
InputRecToggleMode = "Keyboard/Shift & Keyboard/R";
LoadStateFromSlot = "Keyboard/F3";
SaveStateToSlot = "Keyboard/F1";
NextSaveStateSlot = "Keyboard/F2";
PreviousSaveStateSlot = "Keyboard/Shift & Keyboard/F2";
OpenPauseMenu = "Keyboard/Escape";
ToggleFrameLimit = "Keyboard/F4";
TogglePause = "Keyboard/Space";
ToggleSlowMotion = "Keyboard/Shift & Keyboard/Backtab";
ToggleTurbo = "Keyboard/Tab";
HoldTurbo = "Keyboard/Period";
};
};
# 007 nightfire
"PCSX2/gamesettings/SLUS-20579_5B86BB62.ini".text = lib.generators.toINI {} {
"PCSX2/gamesettings/SLUS-20579_5B86BB62.ini".text = toPcsx2INI {
"EmuCore/GS".AspectRatio = "16:9";
};
"PCSX2/gamesettings/SLUS-21050_BEBF8793.ini".text = toPcsx2INI {
"EmuCore/GS".AspectRatio = "16:9";
Patches.Enable = [
"60 FPS for Crashes"
"60 FPS for Menus"
"Progressive Scan"
"MPH to KPH"
"Extra Particles While Driving"
];
};
};
xdg.dataFile = {
# I would prefer to use symlinkJoin like I do for the ISOs, but

View file

@ -0,0 +1,13 @@
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 5ce36de86..37bf5ca85 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -281,6 +281,8 @@ static Uint32 initial_blacklist_devices[] = {
MAKE_VIDPID(0x3297, 0x1969), // Moonlander MK1 Keyboard
MAKE_VIDPID(0x3434, 0x0211), // Keychron K1 Pro System Control
MAKE_VIDPID(0x04f2, 0xa13c), // HP Deluxe Webcam KQ246AA
+ MAKE_VIDPID(0x3434, 0x0353), // Keychron V5 System Control
+ MAKE_VIDPID(0x3434, 0xd030), // Keychron Link
};
static SDL_vidpid_list blacklist_devices = {
SDL_HINT_JOYSTICK_BLACKLIST_DEVICES, 0, 0, NULL,