firmware
Firmware sync: the BIOS files RomM holds for a platform, placed where the emulator looks.
Firmware sync: the BIOS files RomM holds for a platform, placed where the emulator looks.
RomM sends the firmware uploaded to the launched game's platform on activate,
each file as a path under ROM_ROOT with its size and hashes. Each emulator
says where a file goes through Emulator.firmware_targets; this module holds
the shared half: checking the paths, naming a file by its hash, and copying it
in without ever replacing a file the broker did not put there itself.
A file is copied when the target is missing. It is left alone when the target
already holds the same bytes. It is replaced only when the record at
settings.FIRMWARE_RECORD says the broker placed it and its bytes still match
what was placed, so a user's own dump, or a flash image an emulator has
written to since, always stays. Nothing here fails a launch: a file that cannot
be placed is logged and reported, and the emulator's own missing-BIOS message
stays the signal.
attributelog= logging.getLogger(__name__)attributeMAX_FILE_BYTES= 512 * 1024 * 1024Largest firmware file copied, 512 MiB.
Every BIOS the placing emulators take is a few MiB at most. The cap only stops a large upload (a console's system update, say) being copied on every launch.
attributeKNOWN_NAMES_SUPPLEMENTdict[str, str]= {'924e392ed05558ffdb115408c263dccf': 'scph1001.bin', '1e68c231d0896b7eadcad1d7d8e76129': 'scph7001.bin'}md5 to file name for BIOS that core info has no hash for.
Each one matches RomM's known_bios_files.json (psx:scph1001.bin,
psx:scph7001.bin).