summary refs log tree commit diff
path: root/pkgs/applications/emulators
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/emulators')
-rw-r--r--pkgs/applications/emulators/86box/default.nix4
-rw-r--r--pkgs/applications/emulators/blink/default.nix10
-rw-r--r--pkgs/applications/emulators/box64/default.nix49
-rw-r--r--pkgs/applications/emulators/cdemu/daemon.nix10
-rw-r--r--pkgs/applications/emulators/cemu/default.nix6
-rw-r--r--pkgs/applications/emulators/dolphin-emu/default.nix6
-rw-r--r--pkgs/applications/emulators/dosbox-staging/default.nix133
-rw-r--r--pkgs/applications/emulators/dosbox-x/default.nix101
-rw-r--r--pkgs/applications/emulators/dosbox/default.nix9
-rw-r--r--pkgs/applications/emulators/duckstation/001-fix-test-inclusion.diff11
-rw-r--r--pkgs/applications/emulators/duckstation/002-hardcode-vars.diff19
-rw-r--r--pkgs/applications/emulators/duckstation/default.nix58
-rw-r--r--pkgs/applications/emulators/emulationstation/default.nix27
-rw-r--r--pkgs/applications/emulators/firebird-emu/default.nix28
-rw-r--r--pkgs/applications/emulators/flycast/default.nix40
-rw-r--r--pkgs/applications/emulators/fs-uae/launcher.nix4
-rw-r--r--pkgs/applications/emulators/gxemul/default.nix4
-rw-r--r--pkgs/applications/emulators/kega-fusion/default.nix4
-rw-r--r--pkgs/applications/emulators/mame/default.nix4
-rw-r--r--pkgs/applications/emulators/ppsspp/default.nix126
-rw-r--r--pkgs/applications/emulators/retroarch/cores.nix40
-rw-r--r--pkgs/applications/emulators/retroarch/default.nix4
-rw-r--r--pkgs/applications/emulators/retroarch/hashes.json12
-rw-r--r--pkgs/applications/emulators/retroarch/patches/mame2015-python311.patch61
-rw-r--r--pkgs/applications/emulators/retroarch/patches/mame2016-python311.patch74
-rwxr-xr-xpkgs/applications/emulators/retroarch/update_cores.py4
-rw-r--r--pkgs/applications/emulators/ryujinx/default.nix6
-rw-r--r--pkgs/applications/emulators/ryujinx/deps.nix70
-rw-r--r--pkgs/applications/emulators/vbam/default.nix1
-rw-r--r--pkgs/applications/emulators/vice/default.nix128
-rw-r--r--pkgs/applications/emulators/wine/base.nix11
-rw-r--r--pkgs/applications/emulators/wine/darwin-metal-compat-pre8.18.patch12
-rw-r--r--pkgs/applications/emulators/wine/darwin-metal-compat.patch13
-rw-r--r--pkgs/applications/emulators/wine/sources.nix18
-rw-r--r--pkgs/applications/emulators/wine/staging.nix2
-rw-r--r--pkgs/applications/emulators/wineasio/default.nix12
-rw-r--r--pkgs/applications/emulators/xemu/default.nix4
-rw-r--r--pkgs/applications/emulators/yuzu/generic.nix4
-rw-r--r--pkgs/applications/emulators/yuzu/sources.nix14
-rw-r--r--pkgs/applications/emulators/zesarux/default.nix97
-rw-r--r--pkgs/applications/emulators/zsnes/default.nix5
-rw-r--r--pkgs/applications/emulators/zsnes/fortify3.patch20
-rw-r--r--pkgs/applications/emulators/zsnes/zlib-1.3.patch41
43 files changed, 624 insertions, 682 deletions
diff --git a/pkgs/applications/emulators/86box/default.nix b/pkgs/applications/emulators/86box/default.nix
index e14d3d0d713..3083f2dccbe 100644
--- a/pkgs/applications/emulators/86box/default.nix
+++ b/pkgs/applications/emulators/86box/default.nix
@@ -10,13 +10,13 @@
 
 stdenv.mkDerivation rec {
   pname = "86Box";
-  version = "4.0";
+  version = "4.0.1";
 
   src = fetchFromGitHub {
     owner = "86Box";
     repo = "86Box";
     rev = "v${version}";
-    hash = "sha256-VTfYCVEbArcYVzh3NkX1yBXhtRnGZ/+khk0KG42fs24=";
+    hash = "sha256-1005Czm4CftL96G0+sKV1wx/ogXTKS0vQAzZHtIMlKA=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/emulators/blink/default.nix b/pkgs/applications/emulators/blink/default.nix
index e522546078c..bdaf36bf661 100644
--- a/pkgs/applications/emulators/blink/default.nix
+++ b/pkgs/applications/emulators/blink/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, lib }:
+{ stdenv, fetchFromGitHub, fetchpatch, lib }:
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "blink";
@@ -11,6 +11,14 @@ stdenv.mkDerivation (finalAttrs: {
     hash = "sha256-W7yL7Ut3MRygJhFGr+GIj/CK57MkuDTcenft8IvH7jU=";
   };
 
+  # Drop after next release
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/jart/blink/commit/b31fed832b10d32eadaec885fb20dacbb0eb6986.patch";
+      hash = "sha256-DfZxW/H58qXAjkQz31YS4SPMz7152ZzNHK7wHopgnQA=";
+    })
+  ];
+
   # 'make check' requires internet connection
   doCheck = true;
   checkTarget = "test";
diff --git a/pkgs/applications/emulators/box64/default.nix b/pkgs/applications/emulators/box64/default.nix
index 35ed421469a..a02eb526fee 100644
--- a/pkgs/applications/emulators/box64/default.nix
+++ b/pkgs/applications/emulators/box64/default.nix
@@ -1,29 +1,39 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , gitUpdater
 , cmake
 , python3
-, withDynarec ? stdenv.hostPlatform.isAarch64
+, withDynarec ? (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isRiscV64)
 , runCommand
 , hello-x86_64
-, box64
 }:
 
-# Currently only supported on ARM
-assert withDynarec -> stdenv.hostPlatform.isAarch64;
+# Currently only supported on ARM & RISC-V
+assert withDynarec -> (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isRiscV64);
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "box64";
   version = "0.2.4";
 
   src = fetchFromGitHub {
     owner = "ptitSeb";
-    repo = pname;
-    rev = "v${version}";
+    repo = "box64";
+    rev = "v${finalAttrs.version}";
     hash = "sha256-iCZv/WvqZkH6i23fSLA/p0nG5/CgzjyU5glVgje4c3w=";
   };
 
+  patches = [
+    # Fix crash due to regression in SDL1 AudioCallback signature in 0.2.4
+    # Remove when version > 0.2.4
+    (fetchpatch {
+      name = "0001-box64-Fixed_signature_of_SDL1_AudioCallback.patch";
+      url = "https://github.com/ptitSeb/box64/commit/5fabd602aea1937e3c5ce58843504c2492b8c0ec.patch";
+      hash = "sha256-dBdKijTljCFtSJ2smHrbjH/ok0puGw4YEy/kluLl4AQ=";
+    })
+  ];
+
   nativeBuildInputs = [
     cmake
     python3
@@ -31,12 +41,20 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [
     "-DNOGIT=ON"
-    "-DARM_DYNAREC=${if withDynarec then "ON" else "OFF"}"
-    "-DRV64=${if stdenv.hostPlatform.isRiscV64 then "ON" else "OFF"}"
-    "-DPPC64LE=${if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then "ON" else "OFF"}"
+
+    # Arch mega-option
+    "-DARM64=${lib.boolToString stdenv.hostPlatform.isAarch64}"
+    "-DRV64=${lib.boolToString stdenv.hostPlatform.isRiscV64}"
+    "-DPPC64LE=${lib.boolToString (stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian)}"
+    "-DLARCH64=${lib.boolToString stdenv.hostPlatform.isLoongArch64}"
   ] ++ lib.optionals stdenv.hostPlatform.isx86_64 [
+    # x86_64 has no arch-specific mega-option, manually enable the options that apply to it
     "-DLD80BITS=ON"
     "-DNOALIGN=ON"
+  ] ++ [
+    # Arch dynarec
+    "-DARM_DYNAREC=${lib.boolToString (withDynarec && stdenv.hostPlatform.isAarch64)}"
+    "-DRV64_DYNAREC=${lib.boolToString (withDynarec && stdenv.hostPlatform.isRiscV64)}"
   ];
 
   installPhase = ''
@@ -47,9 +65,9 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  doCheck = true;
+  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
 
-  doInstallCheck = true;
+  doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
 
   installCheckPhase = ''
     runHook preInstallCheck
@@ -68,7 +86,7 @@ stdenv.mkDerivation rec {
       rev-prefix = "v";
     };
     tests.hello = runCommand "box64-test-hello" {
-      nativeBuildInputs = [ box64 hello-x86_64 ];
+      nativeBuildInputs = [ finalAttrs.finalPackage ];
     } ''
       # There is no actual "Hello, world!" with any of the logging enabled, and with all logging disabled it's hard to
       # tell what problems the emulator has run into.
@@ -81,6 +99,7 @@ stdenv.mkDerivation rec {
     description = "Lets you run x86_64 Linux programs on non-x86_64 Linux systems";
     license = licenses.mit;
     maintainers = with maintainers; [ gador OPNA2608 ];
-    platforms = [ "x86_64-linux" "aarch64-linux" "riscv64-linux" "powerpc64le-linux" ];
+    mainProgram = "box64";
+    platforms = [ "x86_64-linux" "aarch64-linux" "riscv64-linux" "powerpc64le-linux" "loongarch64-linux" "mips64el-linux" ];
   };
-}
+})
diff --git a/pkgs/applications/emulators/cdemu/daemon.nix b/pkgs/applications/emulators/cdemu/daemon.nix
index 5d376955ea6..359b2f26a57 100644
--- a/pkgs/applications/emulators/cdemu/daemon.nix
+++ b/pkgs/applications/emulators/cdemu/daemon.nix
@@ -1,4 +1,4 @@
-{ callPackage, glib, libao, intltool, libmirage }:
+{ callPackage, glib, libao, intltool, libmirage, coreutils }:
 let pkg = import ./base.nix {
   version = "3.2.5";
   pname = "cdemu-daemon";
@@ -7,4 +7,12 @@ let pkg = import ./base.nix {
 in callPackage pkg {
   nativeBuildInputs = [ intltool ];
   buildInputs = [ glib libao libmirage ];
+  drvParams.postInstall = ''
+    mkdir -p $out/share/dbus-1/services
+    cp -R ../$pname-$version/service-example $out/share/cdemu
+    substitute \
+      $out/share/cdemu/net.sf.cdemu.CDEmuDaemon.service \
+      $out/share/dbus-1/services/net.sf.cdemu.CDEmuDaemon.service \
+      --replace /bin/true ${coreutils}/bin/true
+  '';
 }
diff --git a/pkgs/applications/emulators/cemu/default.nix b/pkgs/applications/emulators/cemu/default.nix
index d38865adc20..3858ddf55b0 100644
--- a/pkgs/applications/emulators/cemu/default.nix
+++ b/pkgs/applications/emulators/cemu/default.nix
@@ -13,6 +13,7 @@
 , fmt_9
 , glm
 , gtk3
+, hidapi
 , imgui
 , libpng
 , libzip
@@ -31,13 +32,13 @@
 
 stdenv.mkDerivation rec {
   pname = "cemu";
-  version = "2.0-45";
+  version = "2.0-47";
 
   src = fetchFromGitHub {
     owner = "cemu-project";
     repo = "Cemu";
     rev = "v${version}";
-    hash = "sha256-Bi2ws08e+6rNv83ypLrgB/KZWt95i7UkFrqhCr/0Zko=";
+    hash = "sha256-0N/bJJHWMHF+ZlVxNHV8t/1jFr3ER3GNF8CPAHVSsak=";
   };
 
   patches = [
@@ -64,6 +65,7 @@ stdenv.mkDerivation rec {
     fmt_9
     glm
     gtk3
+    hidapi
     imgui
     libpng
     libzip
diff --git a/pkgs/applications/emulators/dolphin-emu/default.nix b/pkgs/applications/emulators/dolphin-emu/default.nix
index 6e3f93701c0..664399f7573 100644
--- a/pkgs/applications/emulators/dolphin-emu/default.nix
+++ b/pkgs/applications/emulators/dolphin-emu/default.nix
@@ -26,7 +26,6 @@
 , libXrandr
 , lzo
 , mbedtls_2
-, mgba
 , miniupnpc
 , minizip-ng
 , openal
@@ -38,7 +37,6 @@
 , vulkan-loader
 , xxHash
 , xz
-, zlib-ng
 
   # Used in passthru
 , common-updater-scripts
@@ -78,6 +76,8 @@ stdenv.mkDerivation rec {
     ./find-minizip-ng.patch
   ];
 
+  strictDeps = true;
+
   nativeBuildInputs = [
     stdenv.cc
     cmake
@@ -118,7 +118,6 @@ stdenv.mkDerivation rec {
     sfml
     xxHash
     xz # LibLZMA
-    zlib-ng
   ] ++ lib.optionals stdenv.isLinux [
     alsa-lib
     bluez
@@ -175,6 +174,7 @@ stdenv.mkDerivation rec {
     tests.version = testers.testVersion {
       package = dolphin-emu;
       command = "dolphin-emu-nogui --version";
+      version = if stdenv.hostPlatform.isDarwin then "Dolphin 5.0" else version;
     };
 
     updateScript = writeShellScript "dolphin-update-script" ''
diff --git a/pkgs/applications/emulators/dosbox-staging/default.nix b/pkgs/applications/emulators/dosbox-staging/default.nix
deleted file mode 100644
index fca2cf42104..00000000000
--- a/pkgs/applications/emulators/dosbox-staging/default.nix
+++ /dev/null
@@ -1,133 +0,0 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, fetchpatch
-, SDL2
-, SDL2_image
-, SDL2_net
-, alsa-lib
-, copyDesktopItems
-, fluidsynth
-, glib
-, gtest
-, iir1
-, libGL
-, libGLU
-, libjack2
-, libmt32emu
-, libogg
-, libpng
-, libpulseaudio
-, libslirp
-, libsndfile
-, makeDesktopItem
-, makeWrapper
-, meson
-, ninja
-, opusfile
-, pkg-config
-, speexdsp
-}:
-
-stdenv.mkDerivation (finalAttrs: {
-  pname = "dosbox-staging";
-  version = "0.80.1";
-
-  src = fetchFromGitHub {
-    owner = "dosbox-staging";
-    repo = "dosbox-staging";
-    rev = "v${finalAttrs.version}";
-    hash = "sha256-I90poBeLSq1c8PXyjrx7/UcbfqFNnnNiXfJdWhLPGMc=";
-  };
-
-  patches = [
-    # Pull missind SDL2_net dependency:
-    #   https://github.com/dosbox-staging/dosbox-staging/pull/2358
-    (fetchpatch {
-      name = "sdl2-net.patch";
-      url = "https://github.com/dosbox-staging/dosbox-staging/commit/1b02f187a39263f4b0285323dcfe184bccd749c2.patch";
-      hash = "sha256-Ev97xApInu6r5wvI9Q7FhkSXqtMW/rwJj48fExvqnT0=";
-    })
-
-    # Pull missing SDL2_image dependency:
-    #   https://github.com/dosbox-staging/dosbox-staging/pull/2239
-    (fetchpatch {
-      name = "sdl2-image.patch";
-      url = "https://github.com/dosbox-staging/dosbox-staging/commit/ca8b7a906d29a3f8ce956c4af7dc829a6ac3e229.patch";
-      hash = "sha256-WtTVSWWSlfXrdPVsnlDe4P5K/Fnj4QsOzx3Wo/Kusmg=";
-      includes = [ "src/gui/meson.build" ];
-    })
-  ];
-
-  nativeBuildInputs = [
-    copyDesktopItems
-    gtest
-    makeWrapper
-    meson
-    ninja
-    pkg-config
-  ];
-
-  buildInputs = [
-    alsa-lib
-    fluidsynth
-    glib
-    iir1
-    libGL
-    libGLU
-    libjack2
-    libmt32emu
-    libogg
-    libpng
-    libpulseaudio
-    libslirp
-    libsndfile
-    opusfile
-    SDL2
-    SDL2_image
-    SDL2_net
-    speexdsp
-  ];
-
-  desktopItems = [
-    (makeDesktopItem {
-      name = "dosbox-staging";
-      exec = "dosbox-staging";
-      icon = "dosbox-staging";
-      comment = "x86 dos emulator enhanced";
-      desktopName = "DosBox-Staging";
-      genericName = "DOS emulator";
-      categories = [ "Emulator" "Game" ];
-    })
-  ];
-
-  postFixup = ''
-    # Rename binary, add a wrapper, and copy manual to avoid conflict with
-    # original dosbox. Doing it this way allows us to work with frontends and
-    # launchers that expect the binary to be named dosbox, but get out of the
-    # way of vanilla dosbox if the user desires to install that as well.
-    mv $out/bin/dosbox $out/bin/dosbox-staging
-    makeWrapper $out/bin/dosbox-staging $out/bin/dosbox
-
-    # Create a symlink to dosbox manual instead of copying it
-    pushd $out/share/man/man1/
-    ln -s dosbox.1.gz dosbox-staging.1.gz
-    popd
-  '';
-
-  meta = {
-    homepage = "https://dosbox-staging.github.io/";
-    description = "A modernized DOS emulator";
-    longDescription = ''
-      DOSBox Staging is an attempt to revitalize DOSBox's development
-      process. It's not a rewrite, but a continuation and improvement on the
-      existing DOSBox codebase while leveraging modern development tools and
-      practices.
-    '';
-    license = lib.licenses.gpl2Plus;
-    maintainers = with lib.maintainers; [ joshuafern AndersonTorres ];
-    platforms = lib.platforms.unix;
-    priority = 101;
-  };
-})
-# TODO: report upstream about not finding SDL2_net
diff --git a/pkgs/applications/emulators/dosbox-x/default.nix b/pkgs/applications/emulators/dosbox-x/default.nix
new file mode 100644
index 00000000000..3c0805e270b
--- /dev/null
+++ b/pkgs/applications/emulators/dosbox-x/default.nix
@@ -0,0 +1,101 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, alsa-lib
+, AudioUnit
+, autoreconfHook
+, Carbon
+, Cocoa
+, ffmpeg
+, fluidsynth
+, freetype
+, glib
+, libpcap
+, libpng
+, libslirp
+, libxkbfile
+, libXrandr
+, makeWrapper
+, ncurses
+, pkg-config
+, SDL2
+, SDL2_net
+, testers
+, yad
+, zlib
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "dosbox-x";
+  version = "2023.10.06";
+
+  src = fetchFromGitHub {
+    owner = "joncampbell123";
+    repo = "dosbox-x";
+    rev = "dosbox-x-v${finalAttrs.version}";
+    hash = "sha256-YNYtYqcpTOx4xS/LXI53h3S+na8JVpn4w8Dhf4fWNBQ=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    autoreconfHook
+    makeWrapper
+    pkg-config
+  ];
+
+  buildInputs = [
+    ffmpeg
+    fluidsynth
+    freetype
+    glib
+    libpcap
+    libpng
+    libslirp
+    ncurses
+    SDL2
+    SDL2_net
+    zlib
+  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
+    alsa-lib
+    libxkbfile
+    libXrandr
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
+    AudioUnit
+    Carbon
+    Cocoa
+  ];
+
+  configureFlags = [ "--enable-sdl2" ];
+
+  enableParallelBuilding = true;
+
+  hardeningDisable = [ "format" ]; # https://github.com/joncampbell123/dosbox-x/issues/4436
+
+  postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
+    wrapProgram $out/bin/dosbox-x \
+      --prefix PATH : ${lib.makeBinPath [ yad ]}
+  '';
+
+  passthru.tests.version = testers.testVersion {
+    package = finalAttrs.finalPackage;
+    # Version output on stderr, program returns status code 1
+    command = "${lib.getExe finalAttrs.finalPackage} -version 2>&1 || true";
+  };
+
+  meta = {
+    homepage = "https://dosbox-x.com";
+    description = "A cross-platform DOS emulator based on the DOSBox project";
+    longDescription = ''
+      DOSBox-X is an expanded fork of DOSBox with specific focus on running
+      Windows 3.x/9x/Me, PC-98 and 3D support via 3dfx.
+
+      The full expanded feature list is available here:
+      https://dosbox-x.com/wiki/DOSBox%E2%80%90X%E2%80%99s-Feature-Highlights
+    '';
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ hughobrien OPNA2608 ];
+    platforms = lib.platforms.unix;
+    mainProgram = "dosbox-x";
+  };
+})
diff --git a/pkgs/applications/emulators/dosbox/default.nix b/pkgs/applications/emulators/dosbox/default.nix
index 4a6d229762b..d0c9d8450e2 100644
--- a/pkgs/applications/emulators/dosbox/default.nix
+++ b/pkgs/applications/emulators/dosbox/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchurl
+, fetchpatch
 , autoreconfHook
 , SDL
 , SDL_net
@@ -23,6 +24,14 @@ stdenv.mkDerivation rec {
     hash = "sha256-wNE91+0u02O2jeYVR1eB6JHNWC6BYrXDZpE3UCIiJgo=";
   };
 
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/joncampbell123/dosbox-x/commit/006d5727d36d1ec598e387f2f1a3c521e3673dcb.patch";
+      includes = [ "src/gui/render_templates_sai.h" ];
+      hash = "sha256-HSO29/LgZRKQ3HQBA0QF5henG8pCSoe1R2joYNPcUcE=";
+    })
+  ];
+
   nativeBuildInputs = [
     autoreconfHook
     copyDesktopItems
diff --git a/pkgs/applications/emulators/duckstation/001-fix-test-inclusion.diff b/pkgs/applications/emulators/duckstation/001-fix-test-inclusion.diff
new file mode 100644
index 00000000000..b2dabe0262d
--- /dev/null
+++ b/pkgs/applications/emulators/duckstation/001-fix-test-inclusion.diff
@@ -0,0 +1,11 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 879d46bc..95570f6b 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -20,5 +20,5 @@ if(BUILD_REGTEST)
+ endif()
+ 
+ if(BUILD_TESTS)
+-  add_subdirectory(common-tests EXCLUDE_FROM_ALL)
++  add_subdirectory(common-tests)
+ endif()
diff --git a/pkgs/applications/emulators/duckstation/002-hardcode-vars.diff b/pkgs/applications/emulators/duckstation/002-hardcode-vars.diff
new file mode 100644
index 00000000000..f0b7bb67a0e
--- /dev/null
+++ b/pkgs/applications/emulators/duckstation/002-hardcode-vars.diff
@@ -0,0 +1,19 @@
+diff --git a/src/scmversion/gen_scmversion.sh b/src/scmversion/gen_scmversion.sh
+index 9c1dacab..d1f895ee 100755
+--- a/src/scmversion/gen_scmversion.sh
++++ b/src/scmversion/gen_scmversion.sh
+@@ -10,10 +10,10 @@ else
+ fi
+ 
+ 
+-HASH=$(git rev-parse HEAD)
+-BRANCH=$(git rev-parse --abbrev-ref HEAD | tr -d '\r\n')
+-TAG=$(git describe --tags --dirty --exclude latest --exclude preview --exclude legacy --exclude previous-latest | tr -d '\r\n')
+-DATE=$(git log -1 --date=iso8601-strict --format=%cd)
++HASH="@gitHash@"
++BRANCH="@gitBranch@"
++TAG="@gitTag@"
++DATE="@gitDate@"
+ 
+ cd $CURDIR
+ 
diff --git a/pkgs/applications/emulators/duckstation/default.nix b/pkgs/applications/emulators/duckstation/default.nix
index 87470f56141..e7980e20ddd 100644
--- a/pkgs/applications/emulators/duckstation/default.nix
+++ b/pkgs/applications/emulators/duckstation/default.nix
@@ -8,31 +8,45 @@
 , curl
 , extra-cmake-modules
 , libXrandr
+, libbacktrace
 , makeDesktopItem
-, mesa # for libgbm
 , ninja
 , pkg-config
 , qtbase
 , qtsvg
 , qttools
 , qtwayland
+, substituteAll
 , vulkan-loader
 , wayland
 , wrapQtAppsHook
 , enableWayland ? true
 }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation (finalAttrs: {
   pname = "duckstation";
-  version = "unstable-2023-04-14";
+  version = "unstable-2023-09-30";
 
   src = fetchFromGitHub {
     owner = "stenzek";
     repo = "duckstation";
-    rev = "5fee6f5abee7f3aad65da5523e57896e10e2a53a";
-    sha256 = "sha256-sRs/b4GVXhF3zrOef8DSBKJJGYECUER/nNWZAqv7suA=";
+    rev = "d5608bf12df7a7e03750cb94a08a3d7999034ae2";
+    hash = "sha256-ktfZgacjkN6GQb1vLmyTZMr8QmmH12qAvFSIBTjgRSs=";
   };
 
+  patches = [
+    # Tests are not built by default
+    ./001-fix-test-inclusion.diff
+    # Patching yet another script that fills data based on git commands...
+    (substituteAll {
+      src = ./002-hardcode-vars.diff;
+      gitHash = finalAttrs.src.rev;
+      gitBranch = "master";
+      gitTag = "0.1-5889-gd5608bf1";
+      gitDate = "2023-09-30T23:20:09+10:00";
+    })
+  ];
+
   nativeBuildInputs = [
     cmake
     copyDesktopItems
@@ -49,7 +63,7 @@ stdenv.mkDerivation {
     SDL2
     curl
     libXrandr
-    mesa
+    libbacktrace
     qtbase
     qtsvg
     vulkan-loader
@@ -60,10 +74,12 @@ stdenv.mkDerivation {
   ]
   ++ cubeb.passthru.backendLibs;
 
+  strictDeps = true;
+
   cmakeFlags = [
-    "-DUSE_DRMKMS=ON"
-  ]
-  ++ lib.optionals enableWayland [ "-DUSE_WAYLAND=ON" ];
+    (lib.cmakeBool "BUILD_TESTS" true)
+    (lib.cmakeBool "ENABLE_WAYLAND" enableWayland)
+  ];
 
   desktopItems = [
     (makeDesktopItem {
@@ -79,6 +95,13 @@ stdenv.mkDerivation {
     })
   ];
 
+  doCheck = true;
+  checkPhase = ''
+    runHook preCheck
+    bin/common-tests
+    runHook postCheck
+  '';
+
   installPhase = ''
     runHook preInstall
 
@@ -92,23 +115,16 @@ stdenv.mkDerivation {
     runHook postInstall
   '';
 
-  doCheck = true;
-  checkPhase = ''
-    runHook preCheck
-    bin/common-tests
-    runHook postCheck
-  '';
-
   qtWrapperArgs = [
     "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ vulkan-loader ] ++ cubeb.passthru.backendLibs)}"
   ];
 
-  meta = with lib; {
+  meta = {
     homepage = "https://github.com/stenzek/duckstation";
     description = "Fast PlayStation 1 emulator for x86-64/AArch32/AArch64";
-    license = licenses.gpl3Only;
+    license = lib.licenses.gpl3Only;
     mainProgram = "duckstation-qt";
-    maintainers = with maintainers; [ guibou AndersonTorres ];
-    platforms = platforms.linux;
+    maintainers = with lib.maintainers; [ guibou AndersonTorres ];
+    platforms = lib.platforms.linux;
   };
-}
+})
diff --git a/pkgs/applications/emulators/emulationstation/default.nix b/pkgs/applications/emulators/emulationstation/default.nix
index 170a3c30e54..f0434ecdedf 100644
--- a/pkgs/applications/emulators/emulationstation/default.nix
+++ b/pkgs/applications/emulators/emulationstation/default.nix
@@ -1,34 +1,25 @@
 { lib, stdenv, fetchFromGitHub, pkg-config, cmake, curl, boost, eigen
-, freeimage, freetype, libGLU, libGL, SDL2, alsa-lib, libarchive
-, fetchpatch }:
+, freeimage, freetype, libGLU, libGL, rapidjson, SDL2, alsa-lib
+, vlc }:
 
 stdenv.mkDerivation {
   pname = "emulationstation";
-  version = "2.0.1a";
+  version = "2.11.2";
 
   src = fetchFromGitHub {
-    owner = "Aloshi";
+    fetchSubmodules = true;
+    owner = "RetroPie";
     repo = "EmulationStation";
-    rev = "646bede3d9ec0acf0ae378415edac136774a66c5";
-    sha256 = "0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v";
+    rev = "cda7de687924c4c1ab83d6b0ceb88aa734fe6cfe";
+    hash = "sha256-J5h/578FVe4DXJx/AvpRnCIUpqBeFtmvFhUDYH5SErQ=";
   };
 
-  patches = [
-    (fetchpatch {
-      url = "https://github.com/Aloshi/EmulationStation/commit/49ccd8fc7a7b1dfd974fc57eb13317c42842f22c.patch";
-      sha256 = "1v5d81l7bav0k5z4vybrc3rjcysph6lkm5pcfr6m42wlz7jmjw0p";
-    })
-  ];
-
-  postPatch = ''
-    sed -i "7i #include <stack>" es-app/src/views/gamelist/ISimpleGameListView.h
-  '';
-
   nativeBuildInputs = [ pkg-config cmake ];
-  buildInputs = [ alsa-lib boost curl eigen freeimage freetype libarchive libGLU libGL SDL2 ];
+  buildInputs = [ alsa-lib boost curl eigen freeimage freetype libGLU libGL rapidjson SDL2 vlc ];
 
   installPhase = ''
     install -D ../emulationstation $out/bin/emulationstation
+    cp -r ../resources/ $out/bin/resources/
   '';
 
   meta = {
diff --git a/pkgs/applications/emulators/firebird-emu/default.nix b/pkgs/applications/emulators/firebird-emu/default.nix
index d117a93fba4..9fd99014616 100644
--- a/pkgs/applications/emulators/firebird-emu/default.nix
+++ b/pkgs/applications/emulators/firebird-emu/default.nix
@@ -1,6 +1,13 @@
-{ mkDerivation, lib, fetchFromGitHub, qmake, qtbase, qtdeclarative }:
-
-mkDerivation rec {
+{ stdenv
+, lib
+, fetchFromGitHub
+, qmake
+, qtbase
+, qtdeclarative
+, qtquickcontrols
+, wrapQtAppsHook
+}:
+stdenv.mkDerivation rec {
   pname = "firebird-emu";
   version = "1.6";
 
@@ -12,16 +19,23 @@ mkDerivation rec {
     hash = "sha256-ZptjlnOiF+hKuKYvBFJL95H5YQuR99d4biOco/MVEmE=";
   };
 
-  nativeBuildInputs = [ qmake ];
+  # work around https://github.com/NixOS/nixpkgs/issues/19098
+  env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && stdenv.isDarwin) "-fno-lto";
+
+  nativeBuildInputs = [ wrapQtAppsHook qmake ];
+
+  buildInputs = [ qtbase qtdeclarative qtquickcontrols ];
 
-  buildInputs = [ qtbase qtdeclarative ];
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    mkdir $out/Applications
+    mv $out/bin/${pname}.app $out/Applications/
+  '';
 
   meta = {
     homepage = "https://github.com/nspire-emus/firebird";
     description = "Third-party multi-platform emulator of the ARM-based TI-Nspireâ„¢ calculators";
     license = lib.licenses.gpl3;
     maintainers = with lib.maintainers; [ pneumaticat ];
-    # Only tested on Linux, but likely possible to build on, e.g. macOS
-    platforms = lib.platforms.linux;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/emulators/flycast/default.nix b/pkgs/applications/emulators/flycast/default.nix
index f1874d62fba..ee02b1eee07 100644
--- a/pkgs/applications/emulators/flycast/default.nix
+++ b/pkgs/applications/emulators/flycast/default.nix
@@ -6,35 +6,24 @@
 , makeWrapper
 , alsa-lib
 , curl
-, egl-wayland
 , libao
-, libdecor
-, libevdev
-, libffi
-, libGL
 , libpulseaudio
-, libX11
-, libXext
-, libxkbcommon
 , libzip
-, mesa
+, lua
 , miniupnpc
-, udev
-, vulkan-headers
+, SDL2
 , vulkan-loader
-, wayland
-, zlib
 }:
 
 stdenv.mkDerivation rec {
   pname = "flycast";
-  version = "2.1";
+  version = "2.2";
 
   src = fetchFromGitHub {
     owner = "flyinghead";
     repo = "flycast";
-    rev = "V${version}";
-    sha256 = "sha256-PRInOqg9OpaUVLwSj1lOxDtjpVaYehkRsp0jLrVKPyY=";
+    rev = "v${version}";
+    sha256 = "sha256-eQMKaUaZ1b0oXre4Ouli4qIyNaG64KntyRGk3/YIopc=";
     fetchSubmodules = true;
   };
 
@@ -47,23 +36,16 @@ stdenv.mkDerivation rec {
   buildInputs = [
     alsa-lib
     curl
-    egl-wayland
     libao
-    libdecor
-    libevdev
-    libffi
-    libGL
     libpulseaudio
-    libX11
-    libXext
-    libxkbcommon
     libzip
-    mesa # for libgbm
+    lua
     miniupnpc
-    udev
-    vulkan-headers
-    wayland
-    zlib
+    SDL2
+  ];
+
+  cmakeFlags = [
+    "-DUSE_HOST_SDL=ON"
   ];
 
   postFixup = ''
diff --git a/pkgs/applications/emulators/fs-uae/launcher.nix b/pkgs/applications/emulators/fs-uae/launcher.nix
index 63ff7eee2ea..51349182832 100644
--- a/pkgs/applications/emulators/fs-uae/launcher.nix
+++ b/pkgs/applications/emulators/fs-uae/launcher.nix
@@ -36,9 +36,11 @@ stdenv.mkDerivation (finalAttrs: {
     wrapQtApp "$out/bin/fs-uae-launcher" \
       --set PYTHONPATH "$PYTHONPATH"
 
-    # fs-uae-launcher search side by side for fs-uae
+    # fs-uae-launcher search side by side for executables and shared files
     # see $src/fsgs/plugins/pluginexecutablefinder.py#find_executable
     ln -s ${fsuae}/bin/fs-uae $out/bin
+    ln -s ${fsuae}/bin/fs-uae-device-helper $out/bin
+    ln -s ${fsuae}/share/fs-uae $out/share/fs-uae
   '';
 
   meta = {
diff --git a/pkgs/applications/emulators/gxemul/default.nix b/pkgs/applications/emulators/gxemul/default.nix
index cacb521c2fb..05f837b1876 100644
--- a/pkgs/applications/emulators/gxemul/default.nix
+++ b/pkgs/applications/emulators/gxemul/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   version = "0.7.0";
 
   src = fetchurl {
-    url = "http://gavare.se/gxemul/src/${pname}-${version}.tar.gz";
+    url = "https://gavare.se/gxemul/src/${pname}-${version}.tar.gz";
     sha256 = "sha256-ecRDfG+MqQT0bTOsNgYqZf3PSpKiSEeOQIqxEpXPjoM=";
   };
 
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    homepage = "http://gavare.se/gxemul/";
+    homepage = "https://gavare.se/gxemul/";
     description = "Gavare's experimental emulator";
     longDescription = ''
       GXemul is a framework for full-system computer architecture
diff --git a/pkgs/applications/emulators/kega-fusion/default.nix b/pkgs/applications/emulators/kega-fusion/default.nix
index 1b95dec89fa..f69a9c3206c 100644
--- a/pkgs/applications/emulators/kega-fusion/default.nix
+++ b/pkgs/applications/emulators/kega-fusion/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, lib, writeText, fetchurl, upx, libGLU, glib, gtk2, alsa-lib, libSM, libX11, gdk-pixbuf, pango, libXinerama, mpg123, runtimeShell }:
+{ stdenv, lib, writeText, fetchurl, upx, libGL, libGLU, glib, gtk2, alsa-lib, libSM, libX11, gdk-pixbuf, pango, libXinerama, mpg123, runtimeShell }:
 
 let
-  libPath = lib.makeLibraryPath [ stdenv.cc.cc libGLU glib gtk2 alsa-lib libSM libX11 gdk-pixbuf pango libXinerama ];
+  libPath = lib.makeLibraryPath [ stdenv.cc.cc libGL libGLU glib gtk2 alsa-lib libSM libX11 gdk-pixbuf pango libXinerama ];
 
 in stdenv.mkDerivation {
   pname = "kega-fusion";
diff --git a/pkgs/applications/emulators/mame/default.nix b/pkgs/applications/emulators/mame/default.nix
index 6edfd2e149d..0688947f6ba 100644
--- a/pkgs/applications/emulators/mame/default.nix
+++ b/pkgs/applications/emulators/mame/default.nix
@@ -38,14 +38,14 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "mame";
-  version = "0.258";
+  version = "0.260";
   srcVersion = builtins.replaceStrings [ "." ] [ "" ] version;
 
   src = fetchFromGitHub {
     owner = "mamedev";
     repo = "mame";
     rev = "mame${srcVersion}";
-    hash = "sha256-5wsPlI3xTCeadxvOjjNSGtaa8F7M6gZobsv2Ks8DSGE=";
+    hash = "sha256-spWnaf7xXK2xzgdUagsgN5doVrpJk7EA6fzYd9FlFm0=";
   };
 
   outputs = [ "out" "tools" ];
diff --git a/pkgs/applications/emulators/ppsspp/default.nix b/pkgs/applications/emulators/ppsspp/default.nix
deleted file mode 100644
index bdca27eec69..00000000000
--- a/pkgs/applications/emulators/ppsspp/default.nix
+++ /dev/null
@@ -1,126 +0,0 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, SDL2
-, cmake
-, copyDesktopItems
-, ffmpeg_4
-, glew
-, libffi
-, libsForQt5
-, libzip
-, makeDesktopItem
-, makeWrapper
-, pkg-config
-, python3
-, snappy
-, vulkan-loader
-, wayland
-, zlib
-, enableQt ? false
-, enableVulkan ? true
-, forceWayland ? false
-}:
-
-let
-  # experimental, see https://github.com/hrydgard/ppsspp/issues/13845
-  vulkanWayland = enableVulkan && forceWayland;
-  inherit (libsForQt5) qtbase qtmultimedia wrapQtAppsHook;
-in
-# Only SDL frontend needs to specify whether to use Wayland
-assert forceWayland -> !enableQt;
-stdenv.mkDerivation (finalAttrs: {
-  pname = "ppsspp"
-          + lib.optionalString enableQt "-qt"
-          + lib.optionalString (!enableQt) "-sdl"
-          + lib.optionalString forceWayland "-wayland";
-  version = "1.16.2";
-
-  src = fetchFromGitHub {
-    owner = "hrydgard";
-    repo = "ppsspp";
-    rev = "v${finalAttrs.version}";
-    fetchSubmodules = true;
-    sha256 = "sha256-Ygi7ioLOBQbD+QTD7pO2hIATV8HUDyrdhw7gBSSiHmc=";
-  };
-
-  postPatch = ''
-    substituteInPlace git-version.cmake --replace unknown ${finalAttrs.src.rev}
-    substituteInPlace UI/NativeApp.cpp --replace /usr/share $out/share
-  '';
-
-  nativeBuildInputs = [
-    cmake
-    copyDesktopItems
-    makeWrapper
-    pkg-config
-    python3
-  ] ++ lib.optional enableQt wrapQtAppsHook;
-
-  buildInputs = [
-    SDL2
-    ffmpeg_4
-    (glew.override { enableEGL = forceWayland; })
-    libzip
-    snappy
-    zlib
-  ] ++ lib.optionals enableQt [
-    qtbase
-    qtmultimedia
-  ] ++ lib.optional enableVulkan vulkan-loader
-  ++ lib.optionals vulkanWayland [ wayland libffi ];
-
-  cmakeFlags = [
-    "-DHEADLESS=${if enableQt then "OFF" else "ON"}"
-    "-DOpenGL_GL_PREFERENCE=GLVND"
-    "-DUSE_SYSTEM_FFMPEG=ON"
-    "-DUSE_SYSTEM_LIBZIP=ON"
-    "-DUSE_SYSTEM_SNAPPY=ON"
-    "-DUSE_WAYLAND_WSI=${if vulkanWayland then "ON" else "OFF"}"
-    "-DUSING_QT_UI=${if enableQt then "ON" else "OFF"}"
-  ];
-
-  desktopItems = [
-    (makeDesktopItem {
-      desktopName = "PPSSPP";
-      name = "ppsspp";
-      exec = "ppsspp";
-      icon = "ppsspp";
-      comment = "Play PSP games on your computer";
-      categories = [ "Game" "Emulator" ];
-    })
-  ];
-
-  installPhase = let
-    vulkanPath = lib.makeLibraryPath [ vulkan-loader ];
-  in
-    ''
-      runHook preInstall
-
-      mkdir -p $out/share/{applications,ppsspp,icons}
-    '' + (if enableQt then ''
-      install -Dm555 PPSSPPQt $out/bin/ppsspp
-      wrapProgram $out/bin/ppsspp \
-    '' else ''
-      install -Dm555 PPSSPPHeadless $out/bin/ppsspp-headless
-      install -Dm555 PPSSPPSDL $out/share/ppsspp/
-      makeWrapper $out/share/ppsspp/PPSSPPSDL $out/bin/ppsspp \
-        --set SDL_VIDEODRIVER ${if forceWayland then "wayland" else "x11"} \
-    '') + lib.optionalString enableVulkan ''
-        --prefix LD_LIBRARY_PATH : ${vulkanPath} \
-    '' + "\n" + ''
-      mv assets $out/share/ppsspp
-      mv ../icons/hicolor $out/share/icons
-
-      runHook postInstall
-    '';
-
-  meta = {
-    homepage = "https://www.ppsspp.org/";
-    description = "A HLE Playstation Portable emulator, written in C++ ("
-                  + (if enableQt then "Qt" else "SDL + headless") + ")";
-    license = lib.licenses.gpl2Plus;
-    maintainers = [ lib.maintainers.AndersonTorres ];
-    platforms = lib.platforms.linux;
-  };
-})
diff --git a/pkgs/applications/emulators/retroarch/cores.nix b/pkgs/applications/emulators/retroarch/cores.nix
index 216d9c14df2..d84ae907b17 100644
--- a/pkgs/applications/emulators/retroarch/cores.nix
+++ b/pkgs/applications/emulators/retroarch/cores.nix
@@ -100,12 +100,22 @@ in
     };
   };
 
+  beetle-pce = mkLibretroCore {
+    core = "mednafen-pce";
+    src = getCoreSrc "beetle-pce";
+    makefile = "Makefile";
+    meta = {
+      description = "Port of Mednafen's PC Engine core to libretro";
+      license = lib.licenses.gpl2Only;
+    };
+  };
+
   beetle-pce-fast = mkLibretroCore {
     core = "mednafen-pce-fast";
     src = getCoreSrc "beetle-pce-fast";
     makefile = "Makefile";
     meta = {
-      description = "Port of Mednafen's PC Engine core to libretro";
+      description = "Port of Mednafen's PC Engine fast core to libretro";
       license = lib.licenses.gpl2Only;
     };
   };
@@ -154,16 +164,6 @@ in
     };
   };
 
-  beetle-snes = mkLibretroCore {
-    core = "mednafen-snes";
-    src = getCoreSrc "beetle-snes";
-    makefile = "Makefile";
-    meta = {
-      description = "Port of Mednafen's SNES core to libretro";
-      license = lib.licenses.gpl2Only;
-    };
-  };
-
   beetle-supafaust = mkLibretroCore {
     core = "mednafen-supafaust";
     src = getCoreSrc "beetle-supafaust";
@@ -291,7 +291,11 @@ in
     core = "citra";
     extraBuildInputs = [ libGLU libGL boost ffmpeg nasm ];
     makefile = "Makefile";
-    makeFlags = [ "HAVE_FFMPEG_STATIC=0" ];
+    makeFlags = [
+      "HAVE_FFMPEG_STATIC=0"
+      # https://github.com/libretro/citra/blob/1a66174355b5ed948de48ef13c0ed508b6d6169f/Makefile#L90
+      "BUILD_DATE=01/01/1970_00:00"
+    ];
     meta = {
       description = "Port of Citra to libretro";
       license = lib.licenses.gpl2Plus;
@@ -506,15 +510,11 @@ in
     core = "mame";
     extraNativeBuildInputs = [ python3 ];
     extraBuildInputs = [ alsa-lib libGLU libGL ];
+    # Setting this is breaking compilation of src/3rdparty/genie for some reason
+    makeFlags = [ "ARCH=" ];
     meta = {
       description = "Port of MAME to libretro";
       license = with lib.licenses; [ bsd3 gpl2Plus ];
-      # Build fail with errors:
-      # gcc: warning: <arch>: linker input file unused because linking not done
-      # gcc: error: <arch>: linker input file not found: No such file or directory
-      # Removing it from platforms instead of marking as broken to allow
-      # retroarchFull to be built
-      platforms = [ ];
     };
   };
 
@@ -558,6 +558,7 @@ in
 
   mame2015 = mkLibretroCore {
     core = "mame2015";
+    patches = [ ./patches/mame2015-python311.patch ];
     makeFlags = [ "PYTHON=python3" ];
     extraNativeBuildInputs = [ python3 ];
     extraBuildInputs = [ alsa-lib ];
@@ -571,6 +572,7 @@ in
 
   mame2016 = mkLibretroCore {
     core = "mame2016";
+    patches = [ ./patches/mame2016-python311.patch ];
     extraNativeBuildInputs = [ python3 ];
     extraBuildInputs = [ alsa-lib ];
     makeFlags = [ "PYTHON_EXECUTABLE=python3" ];
@@ -758,7 +760,7 @@ in
     # causes redefinition of _FORTIFY_SOURCE
     hardeningDisable = [ "fortify3" ];
 
-    postBuild = "cd /build/source/build/pcsx2";
+    postBuild = "cd pcsx2";
     meta = {
       description = "Port of PCSX2 to libretro";
       license = lib.licenses.gpl3Plus;
diff --git a/pkgs/applications/emulators/retroarch/default.nix b/pkgs/applications/emulators/retroarch/default.nix
index 4bbf63bb1c3..6b7da614cdb 100644
--- a/pkgs/applications/emulators/retroarch/default.nix
+++ b/pkgs/applications/emulators/retroarch/default.nix
@@ -46,12 +46,12 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "retroarch-bare";
-  version = "1.16.0";
+  version = "1.16.0.3";
 
   src = fetchFromGitHub {
     owner = "libretro";
     repo = "RetroArch";
-    hash = "sha256-aP3/IDs18Q32efFlp4XYDKpdoAm2+QwzhrMxmt3pSvE=";
+    hash = "sha256-BT+LzRDoQF03aNT2Kg7YaSWhK74CvOOiHUeHDtFpe9s=";
     rev = "v${version}";
   };
 
diff --git a/pkgs/applications/emulators/retroarch/hashes.json b/pkgs/applications/emulators/retroarch/hashes.json
index 0ee7ff4d793..78cb11c7d98 100644
--- a/pkgs/applications/emulators/retroarch/hashes.json
+++ b/pkgs/applications/emulators/retroarch/hashes.json
@@ -29,6 +29,12 @@
         "rev": "65460e3a9ad529f6901caf669abbda11f437ab55",
         "hash": "sha256-+xfD1ZMKtbv5Lp12+5RM7Vl3eEF38kykKW8wj/2EN5w="
     },
+    "beetle-pce": {
+        "owner": "libretro",
+        "repo": "beetle-pce-libretro",
+        "rev": "541463bd937dad175aec09c2a0c8d6a52d175386",
+        "hash": "sha256-wWS9reb6aN71Q7OlGst+32T8XX1yMCSOHUKHkXht3hg="
+    },
     "beetle-pce-fast": {
         "owner": "libretro",
         "repo": "beetle-pce-fast-libretro",
@@ -53,12 +59,6 @@
         "rev": "cd395e9e3ee407608450ebc565e871b24e7ffed6",
         "hash": "sha256-EIZRv1EydfLWFoBb8TzvAY3kkL9Qr2OrwrljOnnM92A="
     },
-    "beetle-snes": {
-        "owner": "libretro",
-        "repo": "beetle-bsnes-libretro",
-        "rev": "d770563fc3c4bd9abb522952cefb4aa923ba0b91",
-        "hash": "sha256-zHPtfgp9hc8Q4gXJ5VgfJLWLeYjCsQhkfU1T5RM7AL0="
-    },
     "beetle-supafaust": {
         "owner": "libretro",
         "repo": "supafaust",
diff --git a/pkgs/applications/emulators/retroarch/patches/mame2015-python311.patch b/pkgs/applications/emulators/retroarch/patches/mame2015-python311.patch
new file mode 100644
index 00000000000..5827ba14150
--- /dev/null
+++ b/pkgs/applications/emulators/retroarch/patches/mame2015-python311.patch
@@ -0,0 +1,61 @@
+diff --git a/src/emu/cpu/m6502/m6502make.py b/src/emu/cpu/m6502/m6502make.py
+index da29fc722a..3de641dd69 100755
+--- a/src/emu/cpu/m6502/m6502make.py
++++ b/src/emu/cpu/m6502/m6502make.py
+@@ -16,7 +16,7 @@ def load_opcodes(fname):
+     opcodes = []
+     logging.info("load_opcodes: %s", fname)
+     try:
+-        f = open(fname, "rU")
++        f = open(fname, "r")
+     except Exception:
+         err = sys.exc_info()[1]
+         logging.error("cannot read opcodes file %s [%s]", fname, err)
+@@ -39,7 +39,7 @@ def load_disp(fname):
+     logging.info("load_disp: %s", fname)
+     states = []
+     try:
+-        f = open(fname, "rU")
++        f = open(fname, "r")
+     except Exception:
+         err = sys.exc_info()[1]
+         logging.error("cannot read display file %s [%s]", fname, err)
+diff --git a/src/emu/cpu/m6809/m6809make.py b/src/emu/cpu/m6809/m6809make.py
+index c3d5b0f66e..79f6f90cdd 100644
+--- a/src/emu/cpu/m6809/m6809make.py
++++ b/src/emu/cpu/m6809/m6809make.py
+@@ -14,7 +14,7 @@ def load_file(fname, lines):
+ 	if path != "":
+ 		path += '/'
+ 	try:
+-		f = open(fname, "rU")
++		f = open(fname, "r")
+ 	except Exception:
+ 		err = sys.exc_info()[1]
+ 		sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err))
+diff --git a/src/emu/cpu/mcs96/mcs96make.py b/src/emu/cpu/mcs96/mcs96make.py
+index ec5ec37a78..7ab806a653 100644
+--- a/src/emu/cpu/mcs96/mcs96make.py
++++ b/src/emu/cpu/mcs96/mcs96make.py
+@@ -71,7 +71,7 @@ def __init__(self, fname, is_196):
+         self.ea = {}
+         self.macros = {}
+         try:
+-            f = open(fname, "rU")
++            f = open(fname, "r")
+         except Exception:
+             err = sys.exc_info()[1]
+             sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err))
+diff --git a/src/emu/cpu/tms57002/tmsmake.py b/src/emu/cpu/tms57002/tmsmake.py
+index 62092097d9..78f9fe43cd 100755
+--- a/src/emu/cpu/tms57002/tmsmake.py
++++ b/src/emu/cpu/tms57002/tmsmake.py
+@@ -326,7 +326,7 @@ def ins_cmp_dasm(a, b):
+ def LoadLst(filename):
+     instructions = []
+     ins = None
+-    for n, line in enumerate(open(filename, "rU")):
++    for n, line in enumerate(open(filename, "r")):
+         line = line.rstrip()
+         if not line and ins:
+             # new lines separate intructions
diff --git a/pkgs/applications/emulators/retroarch/patches/mame2016-python311.patch b/pkgs/applications/emulators/retroarch/patches/mame2016-python311.patch
new file mode 100644
index 00000000000..6647e445a08
--- /dev/null
+++ b/pkgs/applications/emulators/retroarch/patches/mame2016-python311.patch
@@ -0,0 +1,74 @@
+diff --git a/scripts/build/verinfo.py b/scripts/build/verinfo.py
+index a73d8ad268..82a80c0984 100644
+--- a/scripts/build/verinfo.py
++++ b/scripts/build/verinfo.py
+@@ -63,7 +63,7 @@ def extract_version(input):
+ build, outfmt, srcfile, dstfile = parse_args()
+ 
+ try:
+-    fp = open(srcfile, 'rU')
++    fp = open(srcfile, 'r')
+ except IOError:
+     sys.stderr.write("Unable to open source file '%s'\n" % srcfile)
+     sys.exit(1)
+diff --git a/src/devices/cpu/m6502/m6502make.py b/src/devices/cpu/m6502/m6502make.py
+index 8bcd85f8e2..557b175966 100755
+--- a/src/devices/cpu/m6502/m6502make.py
++++ b/src/devices/cpu/m6502/m6502make.py
+@@ -18,7 +18,7 @@ def load_opcodes(fname):
+     opcodes = []
+     logging.info("load_opcodes: %s", fname)
+     try:
+-        f = open(fname, "rU")
++        f = open(fname, "r")
+     except Exception:
+         err = sys.exc_info()[1]
+         logging.error("cannot read opcodes file %s [%s]", fname, err)
+@@ -41,7 +41,7 @@ def load_disp(fname):
+     logging.info("load_disp: %s", fname)
+     states = []
+     try:
+-        f = open(fname, "rU")
++        f = open(fname, "r")
+     except Exception:
+         err = sys.exc_info()[1]
+         logging.error("cannot read display file %s [%s]", fname, err)
+diff --git a/src/devices/cpu/m6809/m6809make.py b/src/devices/cpu/m6809/m6809make.py
+index 8838b96019..e1ea25db06 100644
+--- a/src/devices/cpu/m6809/m6809make.py
++++ b/src/devices/cpu/m6809/m6809make.py
+@@ -16,7 +16,7 @@ def load_file(fname, lines):
+ 	if path != "":
+ 		path += '/'
+ 	try:
+-		f = open(fname, "rU")
++		f = open(fname, "r")
+ 	except Exception:
+ 		err = sys.exc_info()[1]
+ 		sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err))
+diff --git a/src/devices/cpu/mcs96/mcs96make.py b/src/devices/cpu/mcs96/mcs96make.py
+index b4844942e3..207208d2b6 100644
+--- a/src/devices/cpu/mcs96/mcs96make.py
++++ b/src/devices/cpu/mcs96/mcs96make.py
+@@ -73,7 +73,7 @@ def __init__(self, fname, is_196):
+         self.ea = {}
+         self.macros = {}
+         try:
+-            f = open(fname, "rU")
++            f = open(fname, "r")
+         except Exception:
+             err = sys.exc_info()[1]
+             sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err))
+diff --git a/src/devices/cpu/tms57002/tmsmake.py b/src/devices/cpu/tms57002/tmsmake.py
+index e2e12b5a4b..942ec09537 100755
+--- a/src/devices/cpu/tms57002/tmsmake.py
++++ b/src/devices/cpu/tms57002/tmsmake.py
+@@ -323,7 +323,7 @@ def AddInfo(self, line):
+ def LoadLst(filename):
+     instructions = []
+     ins = None
+-    for n, line in enumerate(open(filename, "rU")):
++    for n, line in enumerate(open(filename, "r")):
+         line = line.rstrip()
+         if not line and ins:
+             # new lines separate intructions
diff --git a/pkgs/applications/emulators/retroarch/update_cores.py b/pkgs/applications/emulators/retroarch/update_cores.py
index 8e45b7f4fdf..e9536d8318d 100755
--- a/pkgs/applications/emulators/retroarch/update_cores.py
+++ b/pkgs/applications/emulators/retroarch/update_cores.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env nix-shell
-#!nix-shell -I nixpkgs=../../../../ -i python3 -p "python3.withPackages (ps: with ps; [ requests nix-prefetch-github ])" -p "git"
+#!nix-shell -I nixpkgs=../../../../ -i python3 -p "python3.withPackages (ps: with ps; [ nix-prefetch-github ])" -p "git"
 
 import json
 import os
@@ -17,11 +17,11 @@ CORES = {
     "beetle-gba": {"repo": "beetle-gba-libretro"},
     "beetle-lynx": {"repo": "beetle-lynx-libretro"},
     "beetle-ngp": {"repo": "beetle-ngp-libretro"},
+    "beetle-pce": {"repo": "beetle-pce-libretro"},
     "beetle-pce-fast": {"repo": "beetle-pce-fast-libretro"},
     "beetle-pcfx": {"repo": "beetle-pcfx-libretro"},
     "beetle-psx": {"repo": "beetle-psx-libretro"},
     "beetle-saturn": {"repo": "beetle-saturn-libretro"},
-    "beetle-snes": {"repo": "beetle-bsnes-libretro"},
     "beetle-supafaust": {"repo": "supafaust"},
     "beetle-supergrafx": {"repo": "beetle-supergrafx-libretro"},
     "beetle-vb": {"repo": "beetle-vb-libretro"},
diff --git a/pkgs/applications/emulators/ryujinx/default.nix b/pkgs/applications/emulators/ryujinx/default.nix
index 028e1daff09..f4fe6f467ab 100644
--- a/pkgs/applications/emulators/ryujinx/default.nix
+++ b/pkgs/applications/emulators/ryujinx/default.nix
@@ -28,13 +28,13 @@
 
 buildDotnetModule rec {
   pname = "ryujinx";
-  version = "1.1.1012"; # Based off of the official github actions builds: https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml
+  version = "1.1.1053"; # Based off of the official github actions builds: https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml
 
   src = fetchFromGitHub {
     owner = "Ryujinx";
     repo = "Ryujinx";
-    rev = "e6700b314f1384f015666767baf9ea1d8411e330";
-    sha256 = "1szgmvwril7zwfbvqz850xavrk70i56i1yyqfh9mxpxlc3n9xxzr";
+    rev = "28dd7d80af56701887dbb538b56aa58edaf39d91";
+    sha256 = "09h4423z18q8r8fqcd5kv34iwmy9gkmpgw8an8myrhhvkmxi3zwg";
   };
 
   dotnet-sdk = dotnetCorePackages.sdk_7_0;
diff --git a/pkgs/applications/emulators/ryujinx/deps.nix b/pkgs/applications/emulators/ryujinx/deps.nix
index 7d952d9371f..8a7c89f4dbd 100644
--- a/pkgs/applications/emulators/ryujinx/deps.nix
+++ b/pkgs/applications/emulators/ryujinx/deps.nix
@@ -2,35 +2,33 @@
 # Please dont edit it manually, your changes might get overwritten!
 
 { fetchNuGet }: [
-  (fetchNuGet { pname = "Avalonia"; version = "11.0.3"; sha256 = "1ig635386glxgfv9l894dqp98l93ymsylml649xm42lc9a9f1khc"; })
+  (fetchNuGet { pname = "Avalonia"; version = "11.0.4"; sha256 = "0jid0x90dc8m609wqwbq87014yzih2iimz74wm6zi1j02k080jk0"; })
   (fetchNuGet { pname = "Avalonia.Angle.Windows.Natives"; version = "2.1.0.2023020321"; sha256 = "1az4s1g22ipak9a3xfh55z2h3rm6lpqh7svbpw6ag4ysrgsjjsjd"; })
   (fetchNuGet { pname = "Avalonia.BuildServices"; version = "0.0.29"; sha256 = "05mm7f0jssih3gbzqfgjnfq5cnqa85ihsg0z1897ciihv8qd3waq"; })
-  (fetchNuGet { pname = "Avalonia.Controls.ColorPicker"; version = "11.0.0"; sha256 = "06wgzhxkivlaxkn8p61wainsprml2g1q4jmvy9fpn64qnfywjdn7"; })
-  (fetchNuGet { pname = "Avalonia.Controls.ColorPicker"; version = "11.0.3"; sha256 = "0xcxwc588lc2ify2d3m53pmwjgf7p9lwz5q11hn8p5c9zh01iai9"; })
-  (fetchNuGet { pname = "Avalonia.Controls.DataGrid"; version = "11.0.3"; sha256 = "1kls0v2rjimcv7k0dvqd3l694xdg9nf8wdzcz1cadi4qvj0bx7l4"; })
-  (fetchNuGet { pname = "Avalonia.Controls.ItemsRepeater"; version = "11.0.0"; sha256 = "1qxw096av0n4ks0jixh7xxrzgsn9fshp1ypy3vvij7r0a1sk7y1q"; })
+  (fetchNuGet { pname = "Avalonia.Controls.ColorPicker"; version = "11.0.4"; sha256 = "1sqdcaknqazq4mw2x1jb6pfmfnyhpkd4xh6fl4ld85qikzzj7796"; })
+  (fetchNuGet { pname = "Avalonia.Controls.DataGrid"; version = "11.0.4"; sha256 = "10kc1pfyi0jq29xavq059vfjm51igi45yikz7i1ys061zbjs0n62"; })
   (fetchNuGet { pname = "Avalonia.Controls.ItemsRepeater"; version = "11.0.0-rc2.1"; sha256 = "0pmc0fi2abn9qaqwx9lvqnd1a5a8lzp8zin72d3k3xjsh1w1g0n8"; })
-  (fetchNuGet { pname = "Avalonia.Desktop"; version = "11.0.3"; sha256 = "0g8hzvkf2rrfnpmm56m2miwpdw14l04rr0q8xz03j220fy9xk5fm"; })
-  (fetchNuGet { pname = "Avalonia.Diagnostics"; version = "11.0.3"; sha256 = "1rificg9ikf8m2550ylrqavkkvihf8xb22agmdrbz07v7s93v731"; })
-  (fetchNuGet { pname = "Avalonia.FreeDesktop"; version = "11.0.3"; sha256 = "0w8qc45phfz4mnnx1mfxi042qmq31shmjmz5inb4maw9xha0yr3c"; })
-  (fetchNuGet { pname = "Avalonia.Markup.Xaml.Loader"; version = "11.0.3"; sha256 = "09g4flx6sg2b2mkwbqrwl51q87xzy0d43j2xjxvnwc8vwhr1h8gs"; })
-  (fetchNuGet { pname = "Avalonia.Native"; version = "11.0.3"; sha256 = "1gi3y2cdfcjkwjldavahyx09a1n91jpvx8szwrfgr3kk4ycc5lyn"; })
-  (fetchNuGet { pname = "Avalonia.Remote.Protocol"; version = "11.0.0"; sha256 = "1b5031k8slwiz7bncih67fjl6ny234yd4skqxk611l9zp5snjic2"; })
-  (fetchNuGet { pname = "Avalonia.Remote.Protocol"; version = "11.0.3"; sha256 = "0syh20a6892pip4qz32kgc5w77ig40yjgwbcknivhjr8arc3126r"; })
+  (fetchNuGet { pname = "Avalonia.Controls.ItemsRepeater"; version = "11.0.4"; sha256 = "1p7mz33a6dn6ghvwajxdghq15mn5f6isvvqzxcjbnhh3m5c1zhrz"; })
+  (fetchNuGet { pname = "Avalonia.Desktop"; version = "11.0.4"; sha256 = "101jlqx24d19nk0nd7x19pvbjjybckzgqh9h78c85vb98xbwh3ky"; })
+  (fetchNuGet { pname = "Avalonia.Diagnostics"; version = "11.0.4"; sha256 = "1dxylsvaffzravz64rwq2wjjlr3392i5153nmkqk89ldaq70wjja"; })
+  (fetchNuGet { pname = "Avalonia.FreeDesktop"; version = "11.0.4"; sha256 = "1sbgs6d1b751h0ipq249w7z3aclpfb42sw3f7g31vin9w8wxwa6q"; })
+  (fetchNuGet { pname = "Avalonia.Markup.Xaml.Loader"; version = "11.0.4"; sha256 = "1yxand1h0ybwbykn12ixdanbp74rd5spcz8xifmzjmvisjzglvsi"; })
+  (fetchNuGet { pname = "Avalonia.Native"; version = "11.0.4"; sha256 = "10fyr63sqb4xyr7rlk94rzjbnb9mbln95mb9papip5kb3sm8jx60"; })
+  (fetchNuGet { pname = "Avalonia.Remote.Protocol"; version = "11.0.4"; sha256 = "096436hhg45v02pp4f43mf00xn6blx7x66sb8fq5j4jn7479fynp"; })
   (fetchNuGet { pname = "Avalonia.Skia"; version = "11.0.0"; sha256 = "1ra1kd0kkblppr5zy7rzdbwllggrzvp9lkxblf9mg3y8rnp6fk83"; })
-  (fetchNuGet { pname = "Avalonia.Skia"; version = "11.0.3"; sha256 = "0089z8ml8pblq6hispj1nf7lvf6zplrrlix22jcd87pm13232pg2"; })
-  (fetchNuGet { pname = "Avalonia.Svg"; version = "11.0.0"; sha256 = "1xmgaj2wnjdl16x4y6rmfp3q9faca5na90zlb8j62rxcwf1v3lkr"; })
-  (fetchNuGet { pname = "Avalonia.Svg.Skia"; version = "11.0.0"; sha256 = "0cd8w9pm7lpifdzjmsnmjlzdqgq3qw653mcj3adczb5ycqqbd8p3"; })
-  (fetchNuGet { pname = "Avalonia.Themes.Simple"; version = "11.0.3"; sha256 = "0zkm0asxcbsybswxs0p6ybsiq6j1l1j02h0xfxzsmhcimm3y92kk"; })
-  (fetchNuGet { pname = "Avalonia.Win32"; version = "11.0.3"; sha256 = "14pj98057fmfgafq0pni7pw79ls0lsf3jaydfjmdjyw5x2b2x51q"; })
-  (fetchNuGet { pname = "Avalonia.X11"; version = "11.0.3"; sha256 = "0pb41fpiwndcf34r53apxf92qgqxavc4zfl1xy847pz3kj1vsclp"; })
+  (fetchNuGet { pname = "Avalonia.Skia"; version = "11.0.4"; sha256 = "1ysmq4f8bxabpq3nhcrrvgwvxb9z7gx9565bvdyksdhsq16wyxym"; })
+  (fetchNuGet { pname = "Avalonia.Svg"; version = "11.0.0.2"; sha256 = "0b07rszfp87lj08bsni6vjynqcpfdwr8cqxpwy68620qki8w953l"; })
+  (fetchNuGet { pname = "Avalonia.Svg.Skia"; version = "11.0.0.2"; sha256 = "12bqmm0sdc5a1xxz1hffvpgpjc5m64cn7w45bd67wnapz2w943rv"; })
+  (fetchNuGet { pname = "Avalonia.Themes.Simple"; version = "11.0.4"; sha256 = "1rncb8ifqarjc5gfh6ld0ldahvxy57a2hzi7vs826an4zl3r0yrx"; })
+  (fetchNuGet { pname = "Avalonia.Win32"; version = "11.0.4"; sha256 = "07ijkpbhz59gvsxsik8mib8rhpm5yrpnjz66sjnxl8m0ghqnkf02"; })
+  (fetchNuGet { pname = "Avalonia.X11"; version = "11.0.4"; sha256 = "0xq6xqd3cwwdcqsipvrs4rpf82nqhr45ispwjj4dxlyn4i1n8ryd"; })
   (fetchNuGet { pname = "CommandLineParser"; version = "2.9.1"; sha256 = "1sldkj8lakggn4hnyabjj1fppqh50fkdrr1k99d4gswpbk5kv582"; })
   (fetchNuGet { pname = "Concentus"; version = "1.1.7"; sha256 = "0y5z444wrbhlmsqpy2sxmajl1fbf74843lvgj3y6vz260dn2q0l0"; })
   (fetchNuGet { pname = "DiscordRichPresence"; version = "1.2.1.24"; sha256 = "0maw0yd6xgwy0cgk593z3zva0r5j267zpdmmpq8avj3zbna6n4x1"; })
   (fetchNuGet { pname = "DynamicData"; version = "7.14.2"; sha256 = "07k79w4702masq71rk865mi3h1kaxamyp7dgl08ny4n22gg8482k"; })
   (fetchNuGet { pname = "ExCSS"; version = "4.1.4"; sha256 = "1y50xp6rihkydbf5l73mr3qq2rm6rdfjrzdw9h1dw9my230q5lpd"; })
   (fetchNuGet { pname = "Fizzler"; version = "1.2.1"; sha256 = "1w5jb1d0figbv68dydbnlcsfmqlc3sv9z1zxp7d79dg2dkarc4qm"; })
-  (fetchNuGet { pname = "FluentAvaloniaUI"; version = "2.0.1"; sha256 = "12w6rk3qgn6i2zk06appf98pgdf89pw10865qcwn5xpjwm7487k2"; })
+  (fetchNuGet { pname = "FluentAvaloniaUI"; version = "2.0.4"; sha256 = "1xizjlk34xi4z837j6lbv4mc5vfb8gimkxicxcz0012wkzlmmzb1"; })
   (fetchNuGet { pname = "FSharp.Core"; version = "7.0.200"; sha256 = "1ji816r8idwjmxk8bzyq1z32ybz7xdg3nb0a7pnvqr8vys11bkgb"; })
   (fetchNuGet { pname = "GtkSharp.Dependencies"; version = "1.1.1"; sha256 = "0ffywnc3ca1lwhxdnk99l238vsprsrsh678bgm238lb7ja7m52pw"; })
   (fetchNuGet { pname = "HarfBuzzSharp"; version = "2.8.2.3"; sha256 = "115aybicqs9ijjlcv6k6r5v0agkjm1bm1nkd0rj3jglv8s0xvmp2"; })
@@ -45,31 +43,30 @@
   (fetchNuGet { pname = "Microsoft.CodeAnalysis.Analyzers"; version = "3.0.0"; sha256 = "0bbl0jpqywqmzz2gagld1p2gvdfldjfjmm25hil9wj2nq1zc4di8"; })
   (fetchNuGet { pname = "Microsoft.CodeAnalysis.Analyzers"; version = "3.3.4"; sha256 = "0wd6v57p53ahz5z9zg4iyzmy3src7rlsncyqpcag02jjj1yx6g58"; })
   (fetchNuGet { pname = "Microsoft.CodeAnalysis.Common"; version = "3.8.0"; sha256 = "12n7rvr39bzkf2maw7zplw8rwpxpxss4ich3bb2pw770rx4nyvyw"; })
-  (fetchNuGet { pname = "Microsoft.CodeAnalysis.Common"; version = "4.6.0"; sha256 = "0qvkwkbqz4dhkxsisanax1lwm3nzyyb4kgb40qczxbl8g251cjp2"; })
+  (fetchNuGet { pname = "Microsoft.CodeAnalysis.Common"; version = "4.7.0"; sha256 = "1zj4wwsad2j7y1byigm3c386rv56xr05mwxjlgqh0h0n5w5yjc4w"; })
   (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp"; version = "3.8.0"; sha256 = "1kmry65csvfn72zzc16vj1nfbfwam28wcmlrk3m5rzb8ydbzgylb"; })
-  (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp"; version = "4.6.0"; sha256 = "1yfvwygx795c9lswpiv8q19zydifarzljdmvv67vjmi559cm8b1q"; })
+  (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp"; version = "4.7.0"; sha256 = "1lz3ha3pp58hd4y031z64slcf9rh7g1cgkrlrbhi4vpa67xhynnh"; })
   (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp.Scripting"; version = "3.8.0"; sha256 = "0w0yx0lpg54iw5jazqk46h48gx43ij32gwac8iywdj6kxfxm03vw"; })
   (fetchNuGet { pname = "Microsoft.CodeAnalysis.Scripting.Common"; version = "3.8.0"; sha256 = "0hjgxcsj5zy27lqk0986m59n5dbplx2vjjla2lsvg4bwg8qa7bpk"; })
-  (fetchNuGet { pname = "Microsoft.CodeCoverage"; version = "17.6.3"; sha256 = "1xxzd2yxlbq2h4k6flp7lvffmmwrjlyha2z1yvrxxymiyyggk2zg"; })
+  (fetchNuGet { pname = "Microsoft.CodeCoverage"; version = "17.7.2"; sha256 = "09mf5kpxn1a1m8ciwklhh6ascx0yqpcs5r2hvmfj80j44n3qrwhm"; })
   (fetchNuGet { pname = "Microsoft.CSharp"; version = "4.3.0"; sha256 = "0gw297dgkh0al1zxvgvncqs0j15lsna9l1wpqas4rflmys440xvb"; })
-  (fetchNuGet { pname = "Microsoft.CSharp"; version = "4.5.0"; sha256 = "01i28nvzccxbqmiz217fxs6hnjwmd5fafs37rd49a6qp53y6623l"; })
   (fetchNuGet { pname = "Microsoft.CSharp"; version = "4.7.0"; sha256 = "0gd67zlw554j098kabg887b5a6pq9kzavpa3jjy5w53ccjzjfy8j"; })
   (fetchNuGet { pname = "Microsoft.DotNet.PlatformAbstractions"; version = "3.1.6"; sha256 = "0b9myd7gqbpaw9pkd2bx45jhik9mwj0f1ss57sk2cxmag2lkdws5"; })
   (fetchNuGet { pname = "Microsoft.Extensions.DependencyModel"; version = "6.0.0"; sha256 = "08c4fh1n8vsish1vh7h73mva34g0as4ph29s4lvps7kmjb4z64nl"; })
-  (fetchNuGet { pname = "Microsoft.IdentityModel.Abstractions"; version = "6.31.0"; sha256 = "0l1y4q5syl6kcnk6yrjphdj3clfjnmlnxrkvmfjffvfnl9slsh9m"; })
-  (fetchNuGet { pname = "Microsoft.IdentityModel.JsonWebTokens"; version = "6.31.0"; sha256 = "0vfrrrvz6axfg41pcnwlhqh7gkxl1vrm8hbxjkzkw5a5ijh0i4pc"; })
-  (fetchNuGet { pname = "Microsoft.IdentityModel.Logging"; version = "6.31.0"; sha256 = "0dbvi7ifsl6gdsa1hc4bvma9qyr63gvgamwndy0k7wyvvh492rhm"; })
-  (fetchNuGet { pname = "Microsoft.IdentityModel.Tokens"; version = "6.31.0"; sha256 = "0yrsysxgjfwrh1n2mplpm4jwm0ws4p49pdd3zcsql7kjjhs525lv"; })
+  (fetchNuGet { pname = "Microsoft.IdentityModel.Abstractions"; version = "7.0.0"; sha256 = "0sc96z969qfybq5njsqm8hwhqv8jj6gysyjq7n9r9km1nqnhazmi"; })
+  (fetchNuGet { pname = "Microsoft.IdentityModel.JsonWebTokens"; version = "7.0.0"; sha256 = "12xa4yx19j5q7nbisl57jla8x6pby964cr9xkv0qm4834x4zdd3h"; })
+  (fetchNuGet { pname = "Microsoft.IdentityModel.Logging"; version = "7.0.0"; sha256 = "0hv1qb51v6frvhybwcn6m3haq768jgdx59p17jn217fbjiprq14s"; })
+  (fetchNuGet { pname = "Microsoft.IdentityModel.Tokens"; version = "7.0.0"; sha256 = "0cjdbi3ximvfz2nyp2vlxqskmscxw8drjighvy7dna3mi749isrh"; })
   (fetchNuGet { pname = "Microsoft.IO.RecyclableMemoryStream"; version = "2.3.2"; sha256 = "115bm7dljchr7c02hiv1r3l21r22wpml1j26fyn2amaflaihpq4l"; })
-  (fetchNuGet { pname = "Microsoft.NET.Test.Sdk"; version = "17.6.3"; sha256 = "1f2b9ljc3l6lk2qq3ps6pzb5r4dvqvs9j1xav8kj2yy52i2dbz7r"; })
+  (fetchNuGet { pname = "Microsoft.NET.Test.Sdk"; version = "17.7.2"; sha256 = "08g9dpp766racnh90s1sy3ncl291majgq6v2604hfw1f6zkmbjqh"; })
   (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.0.1"; sha256 = "01al6cfxp68dscl15z7rxfw9zvhm64dncsw09a1vmdkacsa2v6lr"; })
   (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.1.0"; sha256 = "08vh1r12g6ykjygq5d3vq09zylgb84l63k49jc4v8faw9g93iqqm"; })
   (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "2.0.0"; sha256 = "1fk2fk2639i7nzy58m9dvpdnzql4vb8yl8vr19r2fp8lmj9w2jr0"; })
   (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "2.1.2"; sha256 = "1507hnpr9my3z4w1r6xk5n0s1j3y6a2c2cnynj76za7cphxi1141"; })
   (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.0.1"; sha256 = "0ppdkwy6s9p7x9jix3v4402wb171cdiibq7js7i13nxpdky7074p"; })
   (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.1.0"; sha256 = "193xwf33fbm0ni3idxzbr5fdq3i2dlfgihsac9jj7whj0gd902nh"; })
-  (fetchNuGet { pname = "Microsoft.TestPlatform.ObjectModel"; version = "17.6.3"; sha256 = "0czzs36ybgipn9bga2swkdd653vh0wvs5hsi2lgykhblimdmb947"; })
-  (fetchNuGet { pname = "Microsoft.TestPlatform.TestHost"; version = "17.6.3"; sha256 = "0yi0n8jxf4l6v8bscgi8ws9zf5i84213pf1qj5d7nwx4jb05m23l"; })
+  (fetchNuGet { pname = "Microsoft.TestPlatform.ObjectModel"; version = "17.7.2"; sha256 = "0xdjkdnrvnaxqgg38y5w1l3jbppigg68cc8q9jn0p21vn48bgrxq"; })
+  (fetchNuGet { pname = "Microsoft.TestPlatform.TestHost"; version = "17.7.2"; sha256 = "1szsg1iy77f0caxzkk0ihpp4ifbfnbdbn8k0wbbhbdprxj8pr356"; })
   (fetchNuGet { pname = "Microsoft.Win32.Primitives"; version = "4.0.1"; sha256 = "1n8ap0cmljbqskxpf8fjzn7kh1vvlndsa75k01qig26mbw97k2q7"; })
   (fetchNuGet { pname = "Microsoft.Win32.Registry"; version = "4.5.0"; sha256 = "1zapbz161ji8h82xiajgriq6zgzmb1f3ar517p2h63plhsq5gh2q"; })
   (fetchNuGet { pname = "Microsoft.Win32.SystemEvents"; version = "7.0.0"; sha256 = "1bh77misznh19m1swqm3dsbji499b8xh9gk6w74sgbkarf6ni8lb"; })
@@ -141,7 +138,7 @@
   (fetchNuGet { pname = "Ryujinx.SDL2-CS"; version = "2.28.1-build28"; sha256 = "0kn7f6cgvb2rsybiif6g7xkw1srmfr306zpv029lvi264dv6aj6l"; })
   (fetchNuGet { pname = "shaderc.net"; version = "0.1.0"; sha256 = "0f35s9h0vj9f1rx9bssj66hibc3j9bzrb4wgb5q2jwkf5xncxbpq"; })
   (fetchNuGet { pname = "SharpZipLib"; version = "1.4.2"; sha256 = "0ijrzz2szxjmv2cipk7rpmg14dfaigdkg7xabjvb38ih56m9a27y"; })
-  (fetchNuGet { pname = "ShimSkiaSharp"; version = "1.0.0"; sha256 = "0gdsrzh8q8mxlm7sxvai7zshaz93a3dm1ha4cgs4845lfhpn8nhc"; })
+  (fetchNuGet { pname = "ShimSkiaSharp"; version = "1.0.0.2"; sha256 = "0l28whcj3r8gmdg7vyb4sxbjdr12w5q9lqibclfrwrwhlx3rxhb0"; })
   (fetchNuGet { pname = "Silk.NET.Core"; version = "2.16.0"; sha256 = "1mkqc2aicvknmpyfry2v7jjxh3apaxa6dmk1vfbwxnkysl417x0k"; })
   (fetchNuGet { pname = "Silk.NET.Vulkan"; version = "2.16.0"; sha256 = "0sg5mxv7ga5pq6wc0lz52j07fxrcfmb0an30r4cxsxk66298z2wy"; })
   (fetchNuGet { pname = "Silk.NET.Vulkan.Extensions.EXT"; version = "2.16.0"; sha256 = "05918f6fl8byla2m7qjp7dvxww2rbpj2sqd4xq26rl885fmddfvf"; })
@@ -156,9 +153,9 @@
   (fetchNuGet { pname = "SkiaSharp.NativeAssets.WebAssembly"; version = "2.88.3"; sha256 = "1w5njksq3amrrp7fqxw89nv6ar2kgc5yx092i4rxv7hrjbd1aagx"; })
   (fetchNuGet { pname = "SkiaSharp.NativeAssets.Win32"; version = "2.88.3"; sha256 = "03wwfbarsxjnk70qhqyd1dw65098dncqk2m0vksx92j70i7lry6q"; })
   (fetchNuGet { pname = "SPB"; version = "0.0.4-build28"; sha256 = "1ran6qwzlkv6xpvnp7n0nkva0zfrzwlcxj7zfzz9v8mpicqs297x"; })
-  (fetchNuGet { pname = "Svg.Custom"; version = "1.0.0"; sha256 = "0bmvgaqy4iaxw9x88ifx3a2zz0vw3p9w6pj4bk3xfnf5p9vjx1mr"; })
-  (fetchNuGet { pname = "Svg.Model"; version = "1.0.0"; sha256 = "0yrjcqcrlgqpdm3bi59nc3fppcqgrfc7jddjwxjj2q423gimip97"; })
-  (fetchNuGet { pname = "Svg.Skia"; version = "1.0.0"; sha256 = "1bs2l9fjiqpip4qh0aw7x8f8m0ja0xlcj5vwd329knkww2jx1d3c"; })
+  (fetchNuGet { pname = "Svg.Custom"; version = "1.0.0.2"; sha256 = "0xkv2h80s4nz2yypiax30s1ws0yd6zdijf5rq1lqjcxaiggf6a7q"; })
+  (fetchNuGet { pname = "Svg.Model"; version = "1.0.0.2"; sha256 = "0zdj69w5dxzwj4fqcsjfjjbc67x931f7qb32i1jsn2k91v904gsd"; })
+  (fetchNuGet { pname = "Svg.Skia"; version = "1.0.0.2"; sha256 = "1877z97c8qbsr1adbc0hvfls03icgmzh4j3pjp8cfnxflxrxql6a"; })
   (fetchNuGet { pname = "System.AppContext"; version = "4.1.0"; sha256 = "0fv3cma1jp4vgj7a8hqc9n7hr1f1kjp541s6z0q1r6nazb4iz9mz"; })
   (fetchNuGet { pname = "System.Buffers"; version = "4.0.0"; sha256 = "13s659bcmg9nwb6z78971z1lr6bmh2wghxi1ayqyzl4jijd351gr"; })
   (fetchNuGet { pname = "System.Buffers"; version = "4.3.0"; sha256 = "0fgns20ispwrfqll4q1zc1waqcmylb3zc50ys9x8zlwxh9pmd9jy"; })
@@ -183,7 +180,7 @@
   (fetchNuGet { pname = "System.Globalization"; version = "4.3.0"; sha256 = "1cp68vv683n6ic2zqh2s1fn4c2sd87g5hpp6l4d4nj4536jz98ki"; })
   (fetchNuGet { pname = "System.Globalization.Calendars"; version = "4.0.1"; sha256 = "0bv0alrm2ck2zk3rz25lfyk9h42f3ywq77mx1syl6vvyncnpg4qh"; })
   (fetchNuGet { pname = "System.Globalization.Extensions"; version = "4.0.1"; sha256 = "0hjhdb5ri8z9l93bw04s7ynwrjrhx2n0p34sf33a9hl9phz69fyc"; })
-  (fetchNuGet { pname = "System.IdentityModel.Tokens.Jwt"; version = "6.31.0"; sha256 = "03bwmmznb4axcvlx8ql5cgigpbldjc1zrxnf5kj25r4drq8yp1cm"; })
+  (fetchNuGet { pname = "System.IdentityModel.Tokens.Jwt"; version = "7.0.0"; sha256 = "15c717z4kspqxiwnia7dk1mj5gv7hg584q4x1xc7z1g0rnz28pwd"; })
   (fetchNuGet { pname = "System.IO"; version = "4.1.0"; sha256 = "1g0yb8p11vfd0kbkyzlfsbsp5z44lwsvyc0h3dpw6vqnbi035ajp"; })
   (fetchNuGet { pname = "System.IO"; version = "4.3.0"; sha256 = "05l9qdrzhm4s5dixmx68kxwif4l99ll5gqmh7rqgw554fx0agv5f"; })
   (fetchNuGet { pname = "System.IO.Compression"; version = "4.1.0"; sha256 = "0iym7s3jkl8n0vzm3jd6xqg9zjjjqni05x45dwxyjr2dy88hlgji"; })
@@ -247,7 +244,6 @@
   (fetchNuGet { pname = "System.Security.Claims"; version = "4.3.0"; sha256 = "0jvfn7j22l3mm28qjy3rcw287y9h65ha4m940waaxah07jnbzrhn"; })
   (fetchNuGet { pname = "System.Security.Cryptography.Algorithms"; version = "4.2.0"; sha256 = "148s9g5dgm33ri7dnh19s4lgnlxbpwvrw2jnzllq2kijj4i4vs85"; })
   (fetchNuGet { pname = "System.Security.Cryptography.Cng"; version = "4.2.0"; sha256 = "118jijz446kix20blxip0f0q8mhsh9bz118mwc2ch1p6g7facpzc"; })
-  (fetchNuGet { pname = "System.Security.Cryptography.Cng"; version = "4.5.0"; sha256 = "1pm4ykbcz48f1hdmwpia432ha6qbb9kbrxrrp7cg3m8q8xn52ngn"; })
   (fetchNuGet { pname = "System.Security.Cryptography.Csp"; version = "4.0.0"; sha256 = "1cwv8lqj8r15q81d2pz2jwzzbaji0l28xfrpw29kdpsaypm92z2q"; })
   (fetchNuGet { pname = "System.Security.Cryptography.Encoding"; version = "4.0.0"; sha256 = "0a8y1a5wkmpawc787gfmnrnbzdgxmx1a14ax43jf3rj9gxmy3vk4"; })
   (fetchNuGet { pname = "System.Security.Cryptography.OpenSsl"; version = "4.0.0"; sha256 = "16sx3cig3d0ilvzl8xxgffmxbiqx87zdi8fc73i3i7zjih1a7f4q"; })
@@ -261,9 +257,7 @@
   (fetchNuGet { pname = "System.Text.Encoding.CodePages"; version = "4.5.1"; sha256 = "1z21qyfs6sg76rp68qdx0c9iy57naan89pg7p6i3qpj8kyzn921w"; })
   (fetchNuGet { pname = "System.Text.Encoding.CodePages"; version = "7.0.0"; sha256 = "0sn6hxdjm7bw3xgsmg041ccchsa4sp02aa27cislw3x61dbr68kq"; })
   (fetchNuGet { pname = "System.Text.Encoding.Extensions"; version = "4.0.11"; sha256 = "08nsfrpiwsg9x5ml4xyl3zyvjfdi4mvbqf93kjdh11j4fwkznizs"; })
-  (fetchNuGet { pname = "System.Text.Encodings.Web"; version = "4.7.2"; sha256 = "0ap286ykazrl42if59bxhzv81safdfrrmfqr3112siwyajx4wih9"; })
   (fetchNuGet { pname = "System.Text.Encodings.Web"; version = "6.0.0"; sha256 = "06n9ql3fmhpjl32g3492sj181zjml5dlcc5l76xq2h38c4f87sai"; })
-  (fetchNuGet { pname = "System.Text.Json"; version = "4.7.2"; sha256 = "10xj1pw2dgd42anikvj9qm23ccssrcp7dpznpj4j7xjp1ikhy3y4"; })
   (fetchNuGet { pname = "System.Text.Json"; version = "6.0.0"; sha256 = "1si2my1g0q0qv1hiqnji4xh9wd05qavxnzj9dwgs23iqvgjky0gl"; })
   (fetchNuGet { pname = "System.Text.RegularExpressions"; version = "4.1.0"; sha256 = "1mw7vfkkyd04yn2fbhm38msk7dz2xwvib14ygjsb8dq2lcvr18y7"; })
   (fetchNuGet { pname = "System.Threading"; version = "4.0.11"; sha256 = "19x946h926bzvbsgj28csn46gak2crv2skpwsx80hbgazmkgb1ls"; })
diff --git a/pkgs/applications/emulators/vbam/default.nix b/pkgs/applications/emulators/vbam/default.nix
index f0cd38de894..b090864d0d0 100644
--- a/pkgs/applications/emulators/vbam/default.nix
+++ b/pkgs/applications/emulators/vbam/default.nix
@@ -44,7 +44,6 @@ stdenv.mkDerivation rec {
   ];
 
   cmakeFlags = [
-    "-DCMAKE_BUILD_TYPE='Release'"
     "-DENABLE_FFMPEG='true'"
     "-DENABLE_LINK='true'"
     "-DSYSCONFDIR=etc"
diff --git a/pkgs/applications/emulators/vice/default.nix b/pkgs/applications/emulators/vice/default.nix
index f16ee43352f..0b6dac32865 100644
--- a/pkgs/applications/emulators/vice/default.nix
+++ b/pkgs/applications/emulators/vice/default.nix
@@ -6,116 +6,23 @@
 , perl
 , libpng
 , giflib
-, libjpeg
 , alsa-lib
 , readline
 , libGLU
 , libGL
-, libXaw
 , pkg-config
-, gtk2
+, gtk3
+, glew
 , SDL
 , SDL_image
-, autoreconfHook
-, makeDesktopItem
 , dos2unix
+, runtimeShell
 , xa
 , file
+, wrapGAppsHook
+, xdg-utils
 }:
 
-let
-  desktopItems = [
-    (makeDesktopItem {
-      name = "x128";
-      exec = "x128";
-      comment = "VICE: C128 Emulator";
-      desktopName = "VICE: C128 Emulator";
-      genericName = "Commodore 128 emulator";
-      categories = [ "System" ];
-    })
-
-    (makeDesktopItem {
-      name = "x64dtv";
-      exec = "x64dtv";
-      comment = "VICE: C64 DTV Emulator";
-      desktopName = "VICE: C64 DTV Emulator";
-      genericName = "Commodore 64 DTV emulator";
-      categories = [ "System" ];
-    })
-
-    (makeDesktopItem {
-      name = "x64sc";
-      exec = "x64sc";
-      comment = "VICE: C64 Emulator";
-      desktopName = "VICE: C64 Emulator";
-      genericName = "Commodore 64 SC emulator";
-      categories = [ "System" ];
-    })
-
-    (makeDesktopItem {
-      name = "xcbm2";
-      exec = "xcbm2";
-      comment = "VICE: CBM-II B-Model Emulator";
-      desktopName = "VICE: CBM-II B-Model Emulator";
-      genericName = "CBM-II B-Model Emulator";
-      categories = [ "System" ];
-    })
-
-    (makeDesktopItem {
-      name = "xcbm5x0";
-      exec = "xcbm5x0";
-      comment = "VICE: CBM-II P-Model Emulator";
-      desktopName = "VICE: CBM-II P-Model Emulator";
-      genericName = "CBM-II P-Model Emulator";
-      categories = [ "System" ];
-    })
-
-    (makeDesktopItem {
-      name = "xpet";
-      exec = "xpet";
-      comment = "VICE: PET Emulator";
-      desktopName = "VICE: PET Emulator";
-      genericName = "Commodore PET Emulator";
-      categories = [ "System" ];
-    })
-
-    (makeDesktopItem {
-      name = "xplus4";
-      exec = "xplus4";
-      comment = "VICE: PLUS4 Emulator";
-      desktopName = "VICE: PLUS4 Emulator";
-      genericName = "Commodore PLUS4 Emulator";
-      categories = [ "System" ];
-    })
-
-    (makeDesktopItem {
-      name = "xscpu64";
-      exec = "xscpu64";
-      comment = "VICE: SCPU64 Emulator";
-      desktopName = "VICE: SCPU64 Emulator";
-      genericName = "Commodore SCPU64 Emulator";
-      categories = [ "System" ];
-    })
-
-    (makeDesktopItem {
-      name = "xvic";
-      exec = "xvic";
-      comment = "VICE: VIC-20 Emulator";
-      desktopName = "VICE: VIC-20 Emulator";
-      genericName = "Commodore VIC-20 Emulator";
-      categories = [ "System" ];
-    })
-
-    (makeDesktopItem {
-      name = "vsid";
-      exec = "vsid";
-      comment = "VSID: The SID Emulator";
-      desktopName = "VSID: The SID Emulator";
-      genericName = "SID Emulator";
-      categories = [ "System" ];
-    })
-  ];
-in
 stdenv.mkDerivation rec {
   pname = "vice";
   version = "3.7.1";
@@ -126,46 +33,41 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    autoreconfHook
     bison
     dos2unix
     file
     flex
     pkg-config
+    wrapGAppsHook
   ];
 
   buildInputs = [
     alsa-lib
     giflib
-    gtk2
+    gtk3
+    glew
     libGL
     libGLU
-    libXaw
-    libjpeg
     libpng
     perl
     readline
     SDL
     SDL_image
     xa
+    xdg-utils
   ];
   dontDisableStatic = true;
-  configureFlags = [ "--enable-fullscreen" "--enable-gnomeui" "--disable-pdf-docs" ];
+  configureFlags = [ "--enable-sdl2ui" "--enable-gtk3ui" "--enable-desktop-files" "--disable-pdf-docs" "--with-gif" ];
+
+  LIBS = "-lGL";
 
   preBuild = ''
-    for i in src/resid src/resid-dtv
-    do
-      mkdir -pv $i/src
-      ln -sv ../../wrap-u-ar.sh $i/src
-    done
+    sed -i -e 's|#!/usr/bin/env bash|${runtimeShell}/bin/bash|' src/arch/gtk3/novte/box_drawing_generate.sh
   '';
 
   postInstall = ''
-    for app in ${toString desktopItems}
-    do
-        mkdir -p $out/share/applications
-        cp $app/share/applications/* $out/share/applications
-    done
+    mkdir -p $out/share/applications
+    cp src/arch/gtk3/data/unix/vice-org-*.desktop $out/share/applications
   '';
 
   meta = {
diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix
index 2e84a8f2091..68814ca5ba5 100644
--- a/pkgs/applications/emulators/wine/base.nix
+++ b/pkgs/applications/emulators/wine/base.nix
@@ -37,8 +37,11 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
     # The Wine preloader must _not_ be linked to any system libraries, but `NIX_LDFLAGS` will link
     # to libintl, libiconv, and CoreFoundation no matter what. Delete the one that was built and
     # rebuild it with empty NIX_LDFLAGS.
-    rm loader/wine64-preloader
-    make loader/wine64-preloader NIX_LDFLAGS="" NIX_LDFLAGS_${stdenv.cc.suffixSalt}=""
+    for preloader in wine-preloader wine64-preloader; do
+      rm loader/$preloader &> /dev/null \
+      && ( echo "Relinking loader/$preloader"; make loader/$preloader NIX_LDFLAGS="" NIX_LDFLAGS_${stdenv.cc.suffixSalt}="" ) \
+      || echo "loader/$preloader not built, skipping relink."
+    done
   '';
 }) // rec {
   inherit version src;
@@ -109,7 +112,8 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
       # uses property syntax in one place. The first patch is necessary only with older
       # versions of Wine. The second is needed on all versions of Wine.
       (lib.optional (lib.versionOlder version "8.12") ./darwin-metal-compat-pre8.12.patch)
-      ./darwin-metal-compat.patch
+      (lib.optional (lib.versionOlder version "8.18") ./darwin-metal-compat-pre8.18.patch)
+      (lib.optional (lib.versionAtLeast version "8.18") ./darwin-metal-compat.patch)
       # Wine requires `qos.h`, which is not included by default on the 10.12 SDK in nixpkgs.
       ./darwin-qos.patch
     ]
@@ -203,6 +207,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
       fromSource
       binaryNativeCode  # mono, gecko
     ];
+    broken = stdenv.isDarwin && !supportFlags.mingwSupport;
     description = if supportFlags.waylandSupport then "An Open Source implementation of the Windows API on top of OpenGL and Unix (with experimental Wayland support)" else "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
     platforms = if supportFlags.waylandSupport then (lib.remove "x86_64-darwin" prevPlatforms) else prevPlatforms;
     maintainers = with lib.maintainers; [ avnik raskin bendlas jmc-figueira reckenrode ];
diff --git a/pkgs/applications/emulators/wine/darwin-metal-compat-pre8.18.patch b/pkgs/applications/emulators/wine/darwin-metal-compat-pre8.18.patch
new file mode 100644
index 00000000000..181b2a0d1a4
--- /dev/null
+++ b/pkgs/applications/emulators/wine/darwin-metal-compat-pre8.18.patch
@@ -0,0 +1,12 @@
+diff --git a/dlls/winemac.drv/cocoa_display.m b/dlls/winemac.drv/cocoa_display.m
+--- a/dlls/winemac.drv/cocoa_display.m
++++ b/dlls/winemac.drv/cocoa_display.m
+@@ -354,7 +354,7 @@ static int macdrv_get_gpu_info_from_display_id_using_metal(struct macdrv_gpu* gp
+ 
+     device = [CGDirectDisplayCopyCurrentMetalDevice(display_id) autorelease];
+     if (device && [device respondsToSelector:@selector(registryID)])
+-        ret = macdrv_get_gpu_info_from_registry_id(gpu, device.registryID);
++        ret = macdrv_get_gpu_info_from_registry_id(gpu, [device registryID]);
+ 
+ done:
+     [pool release];
diff --git a/pkgs/applications/emulators/wine/darwin-metal-compat.patch b/pkgs/applications/emulators/wine/darwin-metal-compat.patch
index 181b2a0d1a4..8176be8ef38 100644
--- a/pkgs/applications/emulators/wine/darwin-metal-compat.patch
+++ b/pkgs/applications/emulators/wine/darwin-metal-compat.patch
@@ -1,12 +1,13 @@
 diff --git a/dlls/winemac.drv/cocoa_display.m b/dlls/winemac.drv/cocoa_display.m
+index fbbe16efcbf..2db375ff3d5 100644
 --- a/dlls/winemac.drv/cocoa_display.m
 +++ b/dlls/winemac.drv/cocoa_display.m
-@@ -354,7 +354,7 @@ static int macdrv_get_gpu_info_from_display_id_using_metal(struct macdrv_gpu* gp
+@@ -387,7 +387,7 @@ static int macdrv_get_gpu_info_from_display_id_using_metal(struct macdrv_gpu* gp
  
      device = [CGDirectDisplayCopyCurrentMetalDevice(display_id) autorelease];
      if (device && [device respondsToSelector:@selector(registryID)])
--        ret = macdrv_get_gpu_info_from_registry_id(gpu, device.registryID);
-+        ret = macdrv_get_gpu_info_from_registry_id(gpu, [device registryID]);
- 
- done:
-     [pool release];
+-        return macdrv_get_gpu_info_from_registry_id(gpu, device.registryID);
++        return macdrv_get_gpu_info_from_registry_id(gpu, [device registryID]);
+     else
+         return -1;
+ }
diff --git a/pkgs/applications/emulators/wine/sources.nix b/pkgs/applications/emulators/wine/sources.nix
index aca98741755..1bd1d6a8214 100644
--- a/pkgs/applications/emulators/wine/sources.nix
+++ b/pkgs/applications/emulators/wine/sources.nix
@@ -69,9 +69,9 @@ in rec {
 
   unstable = fetchurl rec {
     # NOTE: Don't forget to change the hash for staging as well.
-    version = "8.14";
+    version = "8.20";
     url = "https://dl.winehq.org/wine/source/8.x/wine-${version}.tar.xz";
-    hash = "sha256-4YNu9msYJfqdoEKDDASVsqw5SBVENkNGaXnuif3X+vQ=";
+    hash = "sha256-SNa3a9ZDBaICBX+8GdkiwfSWJfbRqYJZJ8ChhXJzmYI=";
     inherit (stable) patches;
 
     ## see http://wiki.winehq.org/Gecko
@@ -88,9 +88,9 @@ in rec {
 
     ## see http://wiki.winehq.org/Mono
     mono = fetchurl rec {
-      version = "8.0.0";
+      version = "8.1.0";
       url = "https://dl.winehq.org/wine/wine-mono/${version}/wine-mono-${version}-x86.msi";
-      hash = "sha256-dbP0XcodyJhX/p6TLaeHEPZMxtSe8asMcjoXcIW0cRs=";
+      hash = "sha256-DtPsUzrvebLzEhVZMc97EIAAmsDFtMK8/rZ4rJSOCBA=";
     };
 
     updateScript = writeShellScript "update-wine-unstable" ''
@@ -116,8 +116,8 @@ in rec {
 
   staging = fetchFromGitHub rec {
     # https://github.com/wine-staging/wine-staging/releases
-    inherit (unstable) version;
-    hash = "sha256-ct/RGXt9B6F3PHbirX8K03AZ0Kunitd2HmI0N5k6VHI=";
+    version = "8.20";
+    hash = "sha256-CiWTXjUR1+GY+MO7djHfVUH71zSo3lpH9IaqS5zCeJ8=";
     owner = "wine-staging";
     repo = "wine-staging";
     rev = "v${version}";
@@ -127,12 +127,12 @@ in rec {
 
   wayland = fetchFromGitLab {
     # https://gitlab.collabora.com/alf/wine/-/tree/wayland
-    version = "8.0";
-    hash = "sha256-whRnm21UyKZ4AQufNmctzivISVobnCeidmpYz65vlyk=";
+    version = "8.2";
+    hash = "sha256-Eb2SFBIeQQ3cVZkUQcwNT5mcYe0ShFxBdMc3BlqkwTo=";
     domain = "gitlab.collabora.com";
     owner = "alf";
     repo = "wine";
-    rev = "2f80bd757739f2dd8da41abceae6b87d2c568152";
+    rev = "b2547ddf9e08cafce98cf7734d5c4ec926ef3536";
 
     inherit (unstable) gecko32 gecko64;
 
diff --git a/pkgs/applications/emulators/wine/staging.nix b/pkgs/applications/emulators/wine/staging.nix
index b36d4862a7f..9e9a03ebfc5 100644
--- a/pkgs/applications/emulators/wine/staging.nix
+++ b/pkgs/applications/emulators/wine/staging.nix
@@ -5,7 +5,7 @@ with callPackage ./util.nix {};
 let patch = (callPackage ./sources.nix {}).staging;
     build-inputs = pkgNames: extra:
       (mkBuildInputs wineUnstable.pkgArches pkgNames) ++ extra;
-in assert lib.getVersion wineUnstable == patch.version;
+in assert lib.versions.majorMinor wineUnstable.version == lib.versions.majorMinor patch.version;
 
 (lib.overrideDerivation wineUnstable (self: {
   buildInputs = build-inputs [ "perl" "util-linux" "autoconf" "gitMinimal" ] self.buildInputs;
diff --git a/pkgs/applications/emulators/wineasio/default.nix b/pkgs/applications/emulators/wineasio/default.nix
index 5a47111610d..5c95f7f828f 100644
--- a/pkgs/applications/emulators/wineasio/default.nix
+++ b/pkgs/applications/emulators/wineasio/default.nix
@@ -9,13 +9,13 @@
 
 multiStdenv.mkDerivation rec {
   pname = "wineasio";
-  version = "1.1.0";
+  version = "1.2.0";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-HEnJj9yfXe+NQuPATMpPvseFs+3TkiMLd1L+fIfQd+o=";
+    hash = "sha256-d5BGJAkaM5XZXyqm6K/UzFE4sD6QVHHGnLi1bcHxiaM=";
     fetchSubmodules = true;
   };
 
@@ -36,10 +36,10 @@ multiStdenv.mkDerivation rec {
 
   installPhase = ''
     runHook preInstall
-    install -D build32/wineasio.dll $out/lib/wine/i386-windows/wineasio.dll
-    install -D build32/wineasio.dll.so $out/lib/wine/i386-unix/wineasio.dll.so
-    install -D build64/wineasio.dll $out/lib/wine/x86_64-windows/wineasio.dll
-    install -D build64/wineasio.dll.so $out/lib/wine/x86_64-unix/wineasio.dll.so
+    install -D build32/wineasio32.dll    $out/lib/wine/i386-windows/wineasio32.dll
+    install -D build32/wineasio32.dll.so $out/lib/wine/i386-unix/wineasio32.dll.so
+    install -D build64/wineasio64.dll    $out/lib/wine/x86_64-windows/wineasio64.dll
+    install -D build64/wineasio64.dll.so $out/lib/wine/x86_64-unix/wineasio64.dll.so
     runHook postInstall
   '';
 
diff --git a/pkgs/applications/emulators/xemu/default.nix b/pkgs/applications/emulators/xemu/default.nix
index fddef8deef1..25f0511c476 100644
--- a/pkgs/applications/emulators/xemu/default.nix
+++ b/pkgs/applications/emulators/xemu/default.nix
@@ -28,13 +28,13 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "xemu";
-  version = "0.7.111";
+  version = "0.7.116";
 
   src = fetchFromGitHub {
     owner = "xemu-project";
     repo = "xemu";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-j7VNNKGm8mFEz+8779ylw1Yjd+jDuoL19Sw52kJll4s=";
+    hash = "sha256-/fUTQYi6EDG4wUFc17nuBUt/F1zBdhk/MEizwTo5I8Q=";
     fetchSubmodules = true;
   };
 
diff --git a/pkgs/applications/emulators/yuzu/generic.nix b/pkgs/applications/emulators/yuzu/generic.nix
index 3fdd6db8466..a24ded85253 100644
--- a/pkgs/applications/emulators/yuzu/generic.nix
+++ b/pkgs/applications/emulators/yuzu/generic.nix
@@ -49,10 +49,10 @@
 }:
 
 let
-  tzinfoVersion = "220816";
+  tzinfoVersion = "221202";
   tzinfo = fetchurl {
     url = "https://github.com/lat9nq/tzdb_to_nx/releases/download/${tzinfoVersion}/${tzinfoVersion}.zip";
-    hash = "sha256-yv8ykEYPu9upeXovei0u16iqQ7NasH6873KnQy4+KwI=";
+    hash = "sha256-mRzW+iIwrU1zsxHmf+0RArU8BShAoEMvCz+McXFFK3c=";
   };
 in stdenv.mkDerivation {
   pname = "yuzu-${branch}";
diff --git a/pkgs/applications/emulators/yuzu/sources.nix b/pkgs/applications/emulators/yuzu/sources.nix
index 4a792c973b5..24997cbdcdc 100644
--- a/pkgs/applications/emulators/yuzu/sources.nix
+++ b/pkgs/applications/emulators/yuzu/sources.nix
@@ -1,19 +1,19 @@
 # Generated by ./update.sh - do not update manually!
-# Last updated: 2023-09-13
+# Last updated: 2023-11-05
 {
   compatList = {
-    rev = "463d5f3537eed71638d4f5809467afec1eb5988c";
+    rev = "e9c4e5da6e5e88e889c87582dfd826d204ca8782";
     hash = "sha256:1hdsza3wf9a0yvj6h55gsl7xqvhafvbz1i8paz9kg7l49b0gnlh1";
   };
 
   mainline = {
-    version = "1557";
-    hash = "sha256:19wlia1g2ll9fwbn4yj57cax4lvs3d6w41z2yy2pjdq84yzgg1gs";
+    version = "1611";
+    hash = "sha256:18rrw63j2zjwakbn99wbzprb1rpmlznl6gb09ay9sq8brxy7zjsv";
   };
 
   ea = {
-    version = "3864";
-    distHash = "sha256:02dxf9f33agnp91myxxklrdjalh6d32zjlg07p7v5v48mymnxhv9";
-    fullHash = "sha256:020ljbgb79i66y6fqj4xblzv4s808l50jy7wwl0d6jwpck1q3i11";
+    version = "3966";
+    distHash = "sha256:1p60455s0h3dwigxm2lxdfgxgv4l2ibwybisja1khcy4i8lgss03";
+    fullHash = "sha256:1jq2bfbv9a6i3dlqsdgmi87rccvks45iyybxwf8p6rxdjqh4bvl2";
   };
 }
diff --git a/pkgs/applications/emulators/zesarux/default.nix b/pkgs/applications/emulators/zesarux/default.nix
deleted file mode 100644
index 4a00f9b0349..00000000000
--- a/pkgs/applications/emulators/zesarux/default.nix
+++ /dev/null
@@ -1,97 +0,0 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, fetchpatch
-, SDL2
-, aalib
-, alsa-lib
-, libXext
-, libXxf86vm
-, libcaca
-, libpulseaudio
-, libsndfile
-, ncurses
-, openssl
-, which
-}:
-
-stdenv.mkDerivation rec {
-  pname = "zesarux";
-  version = "10.0";
-
-  src = fetchFromGitHub {
-    owner = "chernandezba";
-    repo = pname;
-    rev = version;
-    hash = "sha256-cxV2dAzGnIzJiCRdq8vN/Cl4AQeJqjmiCAahijIJQ9k=";
-  };
-
-  nativeBuildInputs = [
-    which
-  ];
-
-  buildInputs = [
-    SDL2
-    aalib
-    alsa-lib
-    libXxf86vm
-    libXext
-    libcaca
-    libpulseaudio
-    libsndfile
-    ncurses
-    openssl
-  ];
-
-  patches = [
-    # Patch the shell scripts; remove it when the next version arrives
-    (fetchpatch {
-      name = "000-fix-shebangs.patch";
-      url = "https://github.com/chernandezba/zesarux/commit/4493439b38f565c5be7c36239ecaf0cf80045627.diff";
-      sha256 = "sha256-f+21naPcPXdcVvqU8ymlGfl1WkYGOeOBe9B/WFUauTI=";
-    })
-
-    # Patch pending upstream release for libcaca-0.99.beta20 support:
-    #  https://github.com/chernandezba/zesarux/pull/1
-    (fetchpatch {
-      name = "libcaca-0.99.beta20.patch";
-      url = "https://github.com/chernandezba/zesarux/commit/542786338d00ab6fcdf712bbd6f5e891e8b26c34.diff";
-      sha256 = "sha256-UvXvBb9Nzw5HNz0uiv2SV1Oeiw7aVCa0jhEbThDRVec=";
-    })
-  ];
-
-  postPatch = ''
-    cd src
-    patchShebangs ./configure *.sh
-  '';
-
-  configureFlags = [
-    "--prefix=${placeholder "out"}"
-    "--c-compiler ${stdenv.cc.targetPrefix}cc"
-    "--enable-cpustats"
-    "--enable-memptr"
-    "--enable-sdl2"
-    "--enable-ssl"
-    "--enable-undoc-scfccf"
-    "--enable-visualmem"
-  ];
-
-  installPhase = ''
-    runHook preInstall
-
-    ./generate_install_sh.sh
-    patchShebangs ./install.sh
-    ./install.sh
-
-    runHook postInstall
-  '';
-
-  meta = with lib; {
-    homepage = "https://github.com/chernandezba/zesarux";
-    description = " ZX Second-Emulator And Released for UniX";
-    license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ AndersonTorres ];
-    platforms = platforms.unix;
-  };
-}
-# TODO: Darwin support
diff --git a/pkgs/applications/emulators/zsnes/default.nix b/pkgs/applications/emulators/zsnes/default.nix
index 1583777a058..8e12d7cd7bb 100644
--- a/pkgs/applications/emulators/zsnes/default.nix
+++ b/pkgs/applications/emulators/zsnes/default.nix
@@ -23,6 +23,11 @@ in stdenv.mkDerivation {
     sha256 = "1gy79d5wdaacph0cc1amw7mqm7i0716n6mvav16p1svi26iz193v";
   };
 
+  patches = [
+    ./zlib-1.3.patch
+    ./fortify3.patch
+  ];
+
   buildInputs = [ nasm SDL zlib libpng ncurses libGLU libGL ];
 
   prePatch = ''
diff --git a/pkgs/applications/emulators/zsnes/fortify3.patch b/pkgs/applications/emulators/zsnes/fortify3.patch
new file mode 100644
index 00000000000..cbd55a1c7af
--- /dev/null
+++ b/pkgs/applications/emulators/zsnes/fortify3.patch
@@ -0,0 +1,20 @@
+pal16bxcl is an array of 256 dwords, not bytes:
+    src/endmem.asm:NEWSYM pal16bxcl, resd 256
+
+While at it fixes off-by-4 out of bounds exit.
+
+Detected by _FORTIFY_SOURCE=3:
+    *** buffer overflow detected ***: terminated
+    #7  0x08057c14 in memset (__len=2, __ch=255, __dest=<optimized out>) at ...-glibc-2.38-23-dev/include/bits/string_fortified.h:59
+#8  clearmem () at initc.c:1461
+--- a/src/initc.c
++++ b/src/initc.c
+@@ -1389,7 +1389,7 @@ extern unsigned char vidmemch8[4096];
+ extern unsigned char pal16b[1024];
+ extern unsigned char pal16bcl[1024];
+ extern unsigned char pal16bclha[1024];
+-extern unsigned char pal16bxcl[256];
++extern unsigned char pal16bxcl[1024];
+ extern unsigned char SPCRAM[65472];
+ unsigned char *SPCState = SPCRAM;
+ 
diff --git a/pkgs/applications/emulators/zsnes/zlib-1.3.patch b/pkgs/applications/emulators/zsnes/zlib-1.3.patch
new file mode 100644
index 00000000000..0c4771f0892
--- /dev/null
+++ b/pkgs/applications/emulators/zsnes/zlib-1.3.patch
@@ -0,0 +1,41 @@
+Add support for 2-digit zlib version like "1.3".
+--- a/src/acinclude.m4
++++ b/src/acinclude.m4
+@@ -67,7 +67,7 @@ char* my_strdup (char *str)
+ 
+ int main (int argc, char *argv[])
+ {
+-  int major, minor, micro, zlib_major_version, zlib_minor_version, zlib_micro_version;
++  int major, minor, micro, zlib_major_version, zlib_minor_version, zlib_micro_version = 0;
+ 
+   char *zlibver, *tmp_version;
+ 
+@@ -85,7 +85,7 @@ int main (int argc, char *argv[])
+     printf("%s, bad version string for\n\tmin_zlib_version... ", "$min_zlib_version");
+     exit(1);
+   }
+-  if (sscanf(zlibver, "%d.%d.%d", &zlib_major_version, &zlib_minor_version, &zlib_micro_version) != 3) {
++  if (sscanf(zlibver, "%d.%d.%d", &zlib_major_version, &zlib_minor_version, &zlib_micro_version) != 3 && sscanf(zlibver, "%d.%d", &zlib_major_version, &zlib_minor_version) != 2) {
+     printf("%s, bad version string given\n", zlibver);
+     puts("\tby zlib, sometimes due to very old zlibs that didnt correctly");
+     printf("\tdefine their version. Please upgrade if you are running an\n\told zlib... ");
+--- a/src/configure
++++ b/src/configure
+@@ -3817,7 +3817,7 @@ char* my_strdup (char *str)
+ 
+ int main (int argc, char *argv[])
+ {
+-  int major, minor, micro, zlib_major_version, zlib_minor_version, zlib_micro_version;
++  int major, minor, micro, zlib_major_version, zlib_minor_version, zlib_micro_version = 0;
+ 
+   char *zlibver, *tmp_version;
+ 
+@@ -3835,7 +3835,7 @@ int main (int argc, char *argv[])
+     printf("%s, bad version string for\n\tmin_zlib_version... ", "$min_zlib_version");
+     exit(1);
+   }
+-  if (sscanf(zlibver, "%d.%d.%d", &zlib_major_version, &zlib_minor_version, &zlib_micro_version) != 3) {
++  if (sscanf(zlibver, "%d.%d.%d", &zlib_major_version, &zlib_minor_version, &zlib_micro_version) != 3 && sscanf(zlibver, "%d.%d", &zlib_major_version, &zlib_minor_version) != 2) {
+     printf("%s, bad version string given\n", zlibver);
+     puts("\tby zlib, sometimes due to very old zlibs that didnt correctly");
+     printf("\tdefine their version. Please upgrade if you are running an\n\told zlib... ");