From 2009f3825638523ebd54c65e49dcf70d42f7b934 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:14:17 +0100 Subject: [PATCH] fix: dev9 files load from the working directory DEV9 opens eeprom.dat and flash.dat by bare name (pcsx2/DEV9/DEV9.cpp:144 at f0523f8a, AetherSX2 DEV9/flash.cpp:89, PCSX2 1.6 dev9ghzdrk/flash.cpp:73), so the process working directory answers, never the BIOS folder. Only yaps2 said so: the other PCSX2 profiles had the file packed into the BIOS folder and the RetroDECK export add it there. --- emulators/aethersx2.yml | 2 ++ emulators/armsx2.yml | 2 ++ emulators/emucorex.yml | 2 ++ emulators/nethersx2-turnip-classic.yml | 2 ++ emulators/nethersx2-turnip.yml | 2 ++ emulators/nethersx2.yml | 2 ++ emulators/pcee2.yml | 1 + emulators/pcsx2-legacy.yml | 2 ++ emulators/pcsx2.yml | 1 + emulators/pcsx2x6.yml | 2 ++ tests/test_audit_regressions.py | 20 ++++++++++++++++++++ 11 files changed, 38 insertions(+) diff --git a/emulators/aethersx2.yml b/emulators/aethersx2.yml index 2f63e2e41..87e28cb3b 100644 --- a/emulators/aethersx2.yml +++ b/emulators/aethersx2.yml @@ -149,6 +149,7 @@ files: source_ref: "source aethersx2/pcsx2/CDVD/CDVD.cpp:120-144, aethersx2 v1.5-3606 usr/share/aethersx2 0x95e7fc" - name: eeprom.dat + load_from: working_directory required: false hle_fallback: true size: 64 @@ -157,6 +158,7 @@ files: source_ref: "source aethersx2/pcsx2/DEV9/DEV9.cpp:146-161, aethersx2 v1.5-3606 usr/share/aethersx2 0x97ac90" - name: flash.dat + load_from: working_directory required: false hle_fallback: true max_size: 8650752 diff --git a/emulators/armsx2.yml b/emulators/armsx2.yml index ea9bc68c8..1845e9aca 100644 --- a/emulators/armsx2.yml +++ b/emulators/armsx2.yml @@ -287,6 +287,7 @@ files: source_ref: "source pcsx2/CDVD/CDVD.cpp:63-64, source pcsx2/CDVD/CDVD.cpp:207-220" - name: eeprom.dat + load_from: working_directory required: false hle_fallback: true size: 64 @@ -298,6 +299,7 @@ files: source_ref: "source pcsx2/DEV9/DEV9.cpp:78, source pcsx2/DEV9/DEV9.cpp:225-276" - name: flash.dat + load_from: working_directory required: false hle_fallback: true max_size: 8650752 diff --git a/emulators/emucorex.yml b/emulators/emucorex.yml index f1e4aa854..9effe6e6b 100644 --- a/emulators/emucorex.yml +++ b/emulators/emucorex.yml @@ -257,6 +257,7 @@ files: source_ref: "source app/src/main/cpp/pcsx2/pcsx2/CDVD/CDVD.cpp:50-51, source app/src/main/cpp/pcsx2/pcsx2/CDVD/CDVD.cpp:195-208" - name: eeprom.dat + load_from: working_directory system: sony-playstation-2 required: false hle_fallback: true @@ -269,6 +270,7 @@ files: source_ref: "source app/src/main/cpp/pcsx2/pcsx2/DEV9/DEV9.cpp:104-167" - name: flash.dat + load_from: working_directory system: sony-playstation-2 required: false hle_fallback: true diff --git a/emulators/nethersx2-turnip-classic.yml b/emulators/nethersx2-turnip-classic.yml index 8b4994455..81114f2b3 100644 --- a/emulators/nethersx2-turnip-classic.yml +++ b/emulators/nethersx2-turnip-classic.yml @@ -231,6 +231,7 @@ files: source_ref: "upstream aethersx2/pcsx2/CDVD/CDVD.cpp:120-144, nethersx2-turnip-classic v0.7 libemucore.so 0x791700-0x7918f4" - name: eeprom.dat + load_from: working_directory required: false hle_fallback: true size: 64 @@ -242,6 +243,7 @@ files: source_ref: "upstream aethersx2/pcsx2/DEV9/DEV9.cpp:73, upstream aethersx2/pcsx2/DEV9/DEV9.cpp:145-160, nethersx2-turnip-classic v0.7 libemucore.so 0x7bb620-0x7bb680" - name: flash.dat + load_from: working_directory required: false hle_fallback: true max_size: 8650752 diff --git a/emulators/nethersx2-turnip.yml b/emulators/nethersx2-turnip.yml index 258f7f4a9..ffda7922a 100644 --- a/emulators/nethersx2-turnip.yml +++ b/emulators/nethersx2-turnip.yml @@ -212,6 +212,7 @@ files: source_ref: "upstream aethersx2/pcsx2/CDVD/CDVD.cpp:120-144, nethersx2-turnip v0.7 libemucore.so 0x79cbd0-0x79cc20" - name: eeprom.dat + load_from: working_directory required: false hle_fallback: true size: 64 @@ -223,6 +224,7 @@ files: source_ref: "upstream aethersx2/pcsx2/DEV9/DEV9.cpp:146-161, nethersx2-turnip v0.7 libemucore.so 0x7c5c44" - name: flash.dat + load_from: working_directory required: false hle_fallback: true max_size: 8650752 diff --git a/emulators/nethersx2.yml b/emulators/nethersx2.yml index 65075c10f..861fca70d 100644 --- a/emulators/nethersx2.yml +++ b/emulators/nethersx2.yml @@ -195,6 +195,7 @@ files: source_ref: "upstream aethersx2/pcsx2/CDVD/CDVD.cpp:120-144, nethersx2 v2.2n-4248 libemucore.so 0x79cbc0-0x79cdc4" - name: eeprom.dat + load_from: working_directory required: false hle_fallback: true size: 64 @@ -206,6 +207,7 @@ files: source_ref: "upstream aethersx2/pcsx2/DEV9/DEV9.cpp:146-161, nethersx2 v2.2n-4248 libemucore.so 0x7c5c40-0x7c5ca0" - name: flash.dat + load_from: working_directory required: false hle_fallback: true max_size: 8650752 diff --git a/emulators/pcee2.yml b/emulators/pcee2.yml index 3c9355b1c..d45fb9549 100644 --- a/emulators/pcee2.yml +++ b/emulators/pcee2.yml @@ -160,6 +160,7 @@ files: failure to open is reported once on screen. - name: "eeprom.dat" + load_from: working_directory description: "DEV9 network adapter EEPROM" size: 64 required: false diff --git a/emulators/pcsx2-legacy.yml b/emulators/pcsx2-legacy.yml index fda0bd950..75024d13b 100644 --- a/emulators/pcsx2-legacy.yml +++ b/emulators/pcsx2-legacy.yml @@ -127,6 +127,7 @@ files: source_ref: "pcsx2/CDVD/CDVD.cpp:93-122" - name: eeprom.dat + load_from: working_directory system: sony-playstation-2 required: false hle_fallback: true @@ -136,6 +137,7 @@ files: source_ref: "plugins/dev9ghzdrk/DEV9.cpp:176-227, plugins/dev9ghzdrk/DEV9.cpp:71-81" - name: flash.dat + load_from: working_directory system: sony-playstation-2 required: false hle_fallback: true diff --git a/emulators/pcsx2.yml b/emulators/pcsx2.yml index 7c2f5206d..98d37d31c 100644 --- a/emulators/pcsx2.yml +++ b/emulators/pcsx2.yml @@ -67,6 +67,7 @@ files: source_ref: "pcsx2/CDVD/CDVD.cpp:190-204" - name: eeprom.dat + load_from: working_directory required: false hle_fallback: true size: 64 diff --git a/emulators/pcsx2x6.yml b/emulators/pcsx2x6.yml index 7732c22d6..3b433f832 100644 --- a/emulators/pcsx2x6.yml +++ b/emulators/pcsx2x6.yml @@ -142,6 +142,7 @@ files: source_ref: "source pcsx2/CDVD/CDVD.cpp:51-52, source pcsx2/CDVD/CDVD.cpp:196-209" - name: eeprom.dat + load_from: working_directory system: namco-system246 required: false hle_fallback: true @@ -151,6 +152,7 @@ files: source_ref: "source pcsx2/DEV9/DEV9.cpp:67-77, source pcsx2/DEV9/DEV9.cpp:116-167" - name: flash.dat + load_from: working_directory system: namco-system246 required: false hle_fallback: true diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 929ecceea..8d0bdf2a5 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -6904,5 +6904,25 @@ class Ps2BiosImagesAreFoundByContent(unittest.TestCase): self.assertEqual(named, []) +class Dev9FilesAreReadFromTheWorkingDirectory(unittest.TestCase): + """DEV9 opens eeprom.dat and flash.dat by bare name (PCSX2 + pcsx2/DEV9/DEV9.cpp:144, AetherSX2 DEV9/flash.cpp:89): the working + directory, never the BIOS folder. Eight profiles left load_from unset, + so the file was packed into the BIOS folder, where nothing reads it.""" + + def test_every_dev9_file_names_the_working_directory(self): + import yaml + + unset = [] + for path in sorted((ROOT / "emulators").glob("*.yml")): + profile = yaml.safe_load(path.read_text(encoding="utf-8")) or {} + for entry in profile.get("files") or []: + if entry.get("name") in ("eeprom.dat", "flash.dat") and "DEV9" in str( + entry.get("source_ref") + ) and entry.get("load_from") != "working_directory": + unset.append(f"{path.stem}: {entry['name']}") + self.assertEqual(unset, []) + + if __name__ == "__main__": unittest.main()