diff --git a/roles/gaming/programs/pcsx2.nix b/roles/gaming/programs/pcsx2.nix index cb288d6..c475c07 100644 --- a/roles/gaming/programs/pcsx2.nix +++ b/roles/gaming/programs/pcsx2.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: let +{ + pkgs, + lib, + ... +}: let ps2-isos = pkgs.symlinkJoin { name = "ps2-isos"; paths = [ @@ -14,9 +18,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 ''; @@ -32,6 +34,70 @@ 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; + # Use the system theme + Theme = ""; + HideMouseCursor = true; + }; + Folders = { + Bios = "/home/toast/.local/share/PCSX2/bios"; + }; + GameList.RecursivePaths = [ + "/home/toast/Games/Isos/PS2/" + ]; + "EmuCore/GS".dithering_ps2 = 1; + 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"; + }; + }; + # 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 # the bios folder needs to be writable to store the bios settings