mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-20 18:59:07 -05:00
fix: a RetroDECK addition needs its component core
Additions took the component their system's entries sit in, whatever core reads them. 104 armsx2 and yaps2 files went into PCSX2's manifest, beetle_psx and rustation dumps into DuckStation's, a directxbox image into xemu's, all counted as added. An addition now lands only where a core reading it is that component's emulator: 132 additions instead of 581.
This commit is contained in:
1 parent
132c69a4b2
commit
e74d182d32
2 files changed
+29
-3
No files matched your search
@@ -104,8 +104,11 @@ class Exporter(BaseExporter):
|
||||
|
||||
A component is one emulator's manifest, and only the platform's
|
||||
entries name it. A system whose entries all sit in one component
|
||||
takes the addition there. One spread over several, or with none of
|
||||
its own, cannot say which manifest is meant, and the addition is
|
||||
takes the addition there, when a core reading the file is that
|
||||
component's emulator: armsx2's flash.dat is no file PCSX2 opens, and
|
||||
beetle_psx's scph5903.bin none DuckStation's manifest should ask for.
|
||||
One spread over several, with none of its own, or of another
|
||||
emulator cannot say which manifest is meant, and the addition is
|
||||
left out and counted as such.
|
||||
"""
|
||||
for system in systems.values():
|
||||
@@ -118,7 +121,10 @@ class Exporter(BaseExporter):
|
||||
continue
|
||||
component = components.pop()
|
||||
for fe in system.files:
|
||||
if fe.platform is None and fe.truth is not None:
|
||||
if fe.platform is None and fe.truth is not None and any(
|
||||
name == component if standalone else component == "retroarch"
|
||||
for standalone, name in fe.runners
|
||||
):
|
||||
fe.truth = {**fe.truth, "component": component}
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -1724,5 +1724,25 @@ class RocknixRunnersFollowTheBuild(unittest.TestCase):
|
||||
self.assertTrue(EMULATORS_MK)
|
||||
|
||||
|
||||
class RetroDeckAdditionsFollowTheirCore(unittest.TestCase):
|
||||
"""Every RetroDECK ps2 entry sits in the pcsx2 component, so every ps2
|
||||
addition went into PCSX2's manifest, armsx2's flash.dat included: a file
|
||||
PCSX2 never opens, asked of PCSX2 users and counted as added."""
|
||||
|
||||
def test_only_the_components_emulator_places_a_file(self):
|
||||
exporter = discover_exporters()["retrodeck"]()
|
||||
own = NativeFile("scph39001.bin", "bios/scph39001.bin", "ps2",
|
||||
platform={"md5": "0" * 32, "component": "pcsx2"})
|
||||
read_by_pcsx2 = NativeFile("rom1.bin", "bios/rom1.bin", "ps2",
|
||||
truth={"md5": "1" * 32}, runners=[(True, "pcsx2")])
|
||||
read_by_armsx2 = NativeFile("flash.dat", "bios/flash.dat", "ps2",
|
||||
truth={"md5": "2" * 32}, runners=[(False, "armsx2")])
|
||||
system = NativeSystem("ps2", "PS2", from_platform=True,
|
||||
files=[own, read_by_pcsx2, read_by_armsx2])
|
||||
exporter._place_additions({"ps2": system})
|
||||
self.assertEqual(read_by_pcsx2.native("component", ""), "pcsx2")
|
||||
self.assertEqual(read_by_armsx2.native("component", ""), "")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user