From f13ac0b8ece284a836179a435f84c998a41b5c23 Mon Sep 17 00:00:00 2001 From: Toast Date: Mon, 29 Apr 2024 10:06:58 +0200 Subject: [PATCH 1/5] Gaming/pcsx2: compress roms to chd --- roles/gaming/programs/pcsx2.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/roles/gaming/programs/pcsx2.nix b/roles/gaming/programs/pcsx2.nix index cb288d6..70d8d18 100644 --- a/roles/gaming/programs/pcsx2.nix +++ b/roles/gaming/programs/pcsx2.nix @@ -14,9 +14,7 @@ cd ${ps2-isos} for file in ./* do - echo $out - echo $file - ${pkgs.pigz}/bin/pigz -9 -c -v "$file" > "$out/$file.gz" + ${pkgs.mame-tools}/bin/chdman createdvd -i "$file" -o "$out/''${file%.iso}.chd" done ''; From f6cb581dd2d1229f39df90e745af6846237f2d30 Mon Sep 17 00:00:00 2001 From: Toast Date: Mon, 29 Apr 2024 10:27:39 +0200 Subject: [PATCH 2/5] Gaming/pcsx2: configure declaratively --- roles/gaming/programs/pcsx2.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/roles/gaming/programs/pcsx2.nix b/roles/gaming/programs/pcsx2.nix index 70d8d18..089c56d 100644 --- a/roles/gaming/programs/pcsx2.nix +++ b/roles/gaming/programs/pcsx2.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: let +{pkgs, lib, ...}: let ps2-isos = pkgs.symlinkJoin { name = "ps2-isos"; paths = [ @@ -30,6 +30,23 @@ in { ]; file."Games/Isos/PS2".source = compressed-ps2-isos; }; + 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; + }; + Folders = { + Bios = "/home/toast/.local/share/PCSX2/bios"; + }; + GameList.RecursivePaths = [ + "/home/toast/Games/Isos/PS2/" + ]; + }; + }; xdg.dataFile = { # I would prefer to use symlinkJoin like I do for the ISOs, but # the bios folder needs to be writable to store the bios settings From 7bd66a216dd05b10f4a8740c897f8609bc662002 Mon Sep 17 00:00:00 2001 From: Toast Date: Mon, 29 Apr 2024 11:45:29 +0200 Subject: [PATCH 3/5] Gaming/pcsx2: add controller settings and enable discord presence --- roles/gaming/programs/pcsx2.nix | 65 ++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 13 deletions(-) diff --git a/roles/gaming/programs/pcsx2.nix b/roles/gaming/programs/pcsx2.nix index 089c56d..8c3fd08 100644 --- a/roles/gaming/programs/pcsx2.nix +++ b/roles/gaming/programs/pcsx2.nix @@ -1,4 +1,8 @@ -{pkgs, lib, ...}: let +{ + pkgs, + lib, + ... +}: let ps2-isos = pkgs.symlinkJoin { name = "ps2-isos"; paths = [ @@ -33,19 +37,54 @@ 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; + "PCSX2/inis/PCSX2.ini".text = + lib.generators.toINI { + listsAsDuplicateKeys = true; + } { + UI = { + SettingsVersion = 1; + # Use the system theme + Theme = ""; + }; + Folders = { + Bios = "/home/toast/.local/share/PCSX2/bios"; + }; + GameList.RecursivePaths = [ + "/home/toast/Games/Isos/PS2/" + ]; + EmuCore.EnableDiscordPresence = true; + + # 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"; + }; }; - Folders = { - Bios = "/home/toast/.local/share/PCSX2/bios"; - }; - GameList.RecursivePaths = [ - "/home/toast/Games/Isos/PS2/" - ]; - }; }; xdg.dataFile = { # I would prefer to use symlinkJoin like I do for the ISOs, but From 4b1ea077d3223c7aa6324852a8f47ca8707f0f71 Mon Sep 17 00:00:00 2001 From: Toast Date: Mon, 29 Apr 2024 12:45:41 +0200 Subject: [PATCH 4/5] Gaming/pcsx2: add per-game settings and hide cursor on fullscreen --- roles/gaming/programs/pcsx2.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/gaming/programs/pcsx2.nix b/roles/gaming/programs/pcsx2.nix index 8c3fd08..7679c22 100644 --- a/roles/gaming/programs/pcsx2.nix +++ b/roles/gaming/programs/pcsx2.nix @@ -45,6 +45,7 @@ in { SettingsVersion = 1; # Use the system theme Theme = ""; + HideMouseCursor = true; }; Folders = { Bios = "/home/toast/.local/share/PCSX2/bios"; @@ -85,6 +86,10 @@ in { SmallMotor = "SDL-0/SmallMotor"; }; }; + # 007 nightfire + "PCSX2/gamesettings/SLUS-20579_5B86BB62.ini".text = lib.generators.toINI {} { + "EmuCore/GS".AspectRatio = "16:9"; + }; }; xdg.dataFile = { # I would prefer to use symlinkJoin like I do for the ISOs, but From 56442c00ddb35c9ba472ad110725d520d711b01e Mon Sep 17 00:00:00 2001 From: Toast Date: Mon, 29 Apr 2024 13:09:17 +0200 Subject: [PATCH 5/5] Gaming/pcsx2: add more settings --- roles/gaming/programs/pcsx2.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/gaming/programs/pcsx2.nix b/roles/gaming/programs/pcsx2.nix index 7679c22..c475c07 100644 --- a/roles/gaming/programs/pcsx2.nix +++ b/roles/gaming/programs/pcsx2.nix @@ -53,7 +53,14 @@ in { GameList.RecursivePaths = [ "/home/toast/Games/Isos/PS2/" ]; - EmuCore.EnableDiscordPresence = true; + "EmuCore/GS".dithering_ps2 = 1; + EmuCore = { + EnableDiscordPresence = true; + EnableFastBoot = true; + McdFolderAutoManage = false; + }; + + MemoryCards.Slot1_Filename = "MemoryCard1.ps2"; # Controller settings Pad1 = {