feat: emulator mode field, archive ZX81 standalone ROMs

emulator profiles support mode: standalone | libretro | both.
cross_reference.py skips standalone-only files for libretro platforms.
81.yml: type standalone + libretro, upstream ref added, files listed
with mode: standalone and source_refs to both codebases.
bios/Sinclair/ZX 81/: zx81.rom (8K) and dkchr.rom (4K) archived.
This commit is contained in:
Abdessamad Derraz
2026-03-18 17:37:01 +01:00
parent b3b279ccf3
commit 846640dd7c
5 changed files with 67 additions and 40 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,7 +1,7 @@
{ {
"generated_at": "2026-03-18T15:11:54Z", "generated_at": "2026-03-18T16:37:01Z",
"total_files": 5565, "total_files": 5567,
"total_size": 4908280385, "total_size": 4908292673,
"files": { "files": {
"520d3d1b5897800af47f92efd2444a26b7a7dead": { "520d3d1b5897800af47f92efd2444a26b7a7dead": {
"path": "bios/3DO Company/3DO/3do_arcade_saot.bin", "path": "bios/3DO Company/3DO/3do_arcade_saot.bin",
@@ -47127,6 +47127,24 @@
"sha256": "8a39aae2b2eb3c9fff09dc0d80bca9ffcb981f1665d9067ea1131129f3353b2b", "sha256": "8a39aae2b2eb3c9fff09dc0d80bca9ffcb981f1665d9067ea1131129f3353b2b",
"crc32": "37f87fac" "crc32": "37f87fac"
}, },
"04e352ab6d6ca7f50109f67c850d9dc0f467de77": {
"path": "bios/Sinclair/ZX 81/dkchr.rom",
"name": "dkchr.rom",
"size": 4096,
"sha1": "04e352ab6d6ca7f50109f67c850d9dc0f467de77",
"md5": "5cba3a306fbb94454811ba262b27c958",
"sha256": "079ad784af12e6bf0b5c52a7b4d92da5ae4acddd0b13d73ec4221b49636a6c51",
"crc32": "761137d7"
},
"7b143ee964e9ada89d1f9e88f0bd48d919184cfc": {
"path": "bios/Sinclair/ZX 81/zx81.rom",
"name": "zx81.rom",
"size": 8192,
"sha1": "7b143ee964e9ada89d1f9e88f0bd48d919184cfc",
"md5": "db398d4e4e93a6d4dee3bfe146918219",
"sha256": "14ad84f4243efcd41587ff46ab932d11087043e8d455a1ed2a227b9657828dfa",
"crc32": "4b1dd6eb"
},
"4f4b11ec22326280bdb96e3baf9db4b4cb1d02c5": { "4f4b11ec22326280bdb96e3baf9db4b4cb1d02c5": {
"path": "bios/Sinclair/ZX Spectrum/128-0.rom", "path": "bios/Sinclair/ZX Spectrum/128-0.rom",
"name": "128-0.rom", "name": "128-0.rom",
@@ -55327,6 +55345,8 @@
"cc78d4f4900f622bd6de1aed7f52592f": "77511fc58798404701f66b6bbc9cbde06596eba7", "cc78d4f4900f622bd6de1aed7f52592f": "77511fc58798404701f66b6bbc9cbde06596eba7",
"0617321daa182c3f3d6f41fd02fb3275": "e33cdcdb69cd257b0b211ef46e7a8b144637db57", "0617321daa182c3f3d6f41fd02fb3275": "e33cdcdb69cd257b0b211ef46e7a8b144637db57",
"27fbde30ffc81dbf909d4287be7c0f28": "cede52455ac2a92607b4a16b59a9296f9be3b78e", "27fbde30ffc81dbf909d4287be7c0f28": "cede52455ac2a92607b4a16b59a9296f9be3b78e",
"5cba3a306fbb94454811ba262b27c958": "04e352ab6d6ca7f50109f67c850d9dc0f467de77",
"db398d4e4e93a6d4dee3bfe146918219": "7b143ee964e9ada89d1f9e88f0bd48d919184cfc",
"b4d2692115a9f2924df92a3cbfb358fb": "4f4b11ec22326280bdb96e3baf9db4b4cb1d02c5", "b4d2692115a9f2924df92a3cbfb358fb": "4f4b11ec22326280bdb96e3baf9db4b4cb1d02c5",
"6e09e5d3c4aef166601669feaaadc01c": "80080644289ed93d71a1103992a154cc9802b2fa", "6e09e5d3c4aef166601669feaaadc01c": "80080644289ed93d71a1103992a154cc9802b2fa",
"c1231a70b8129311216acb7479b031d5": "968937b1c750f0ef6205f01c6db4148da4cca4e3", "c1231a70b8129311216acb7479b031d5": "968937b1c750f0ef6205f01c6db4148da4cca4e3",
@@ -69789,6 +69809,12 @@
"sram.dat": [ "sram.dat": [
"cede52455ac2a92607b4a16b59a9296f9be3b78e" "cede52455ac2a92607b4a16b59a9296f9be3b78e"
], ],
"dkchr.rom": [
"04e352ab6d6ca7f50109f67c850d9dc0f467de77"
],
"zx81.rom": [
"7b143ee964e9ada89d1f9e88f0bd48d919184cfc"
],
"128-0.rom": [ "128-0.rom": [
"4f4b11ec22326280bdb96e3baf9db4b4cb1d02c5" "4f4b11ec22326280bdb96e3baf9db4b4cb1d02c5"
], ],
@@ -77161,6 +77187,8 @@
"6c7ef608": "77511fc58798404701f66b6bbc9cbde06596eba7", "6c7ef608": "77511fc58798404701f66b6bbc9cbde06596eba7",
"00eeb408": "e33cdcdb69cd257b0b211ef46e7a8b144637db57", "00eeb408": "e33cdcdb69cd257b0b211ef46e7a8b144637db57",
"37f87fac": "cede52455ac2a92607b4a16b59a9296f9be3b78e", "37f87fac": "cede52455ac2a92607b4a16b59a9296f9be3b78e",
"761137d7": "04e352ab6d6ca7f50109f67c850d9dc0f467de77",
"4b1dd6eb": "7b143ee964e9ada89d1f9e88f0bd48d919184cfc",
"e76799d2": "4f4b11ec22326280bdb96e3baf9db4b4cb1d02c5", "e76799d2": "4f4b11ec22326280bdb96e3baf9db4b4cb1d02c5",
"b96a36be": "80080644289ed93d71a1103992a154cc9802b2fa", "b96a36be": "80080644289ed93d71a1103992a154cc9802b2fa",
"453d86b2": "968937b1c750f0ef6205f01c6db4148da4cca4e3", "453d86b2": "968937b1c750f0ef6205f01c6db4148da4cca4e3",

View File

@@ -1,6 +1,7 @@
emulator: EightyOne emulator: EightyOne
type: libretro type: standalone + libretro
source: "https://github.com/libretro/81-libretro" source: "https://github.com/libretro/81-libretro"
upstream: "https://github.com/charlierobson/EightyOne"
profiled_date: "2026-03-18" profiled_date: "2026-03-18"
core_version: "1.0a" core_version: "1.0a"
display_name: "Sinclair - ZX 81 (EightyOne)" display_name: "Sinclair - ZX 81 (EightyOne)"
@@ -10,43 +11,34 @@ systems:
- sinclair-zx81 - sinclair-zx81
notes: | notes: |
EightyOne is a Sinclair ZX81 emulator ported to libretro. Also supports Libretro core embeds zx81.rom and dkchr.rom as C arrays (xxd -i at build).
ZX80, Jupiter ACE, TS1500, Lambda, R470, TK85, and ZX97LE machines, but Core never calls RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY.
the libretro port hardcodes MACHINEZX81 in retro_load_game (libretro.cpp:393). Standalone EightyOne loads ROMs from filesystem (cwd/ROM/<filename>).
ROM loading is in snap.c:487-512. The memory_load() function matches the Original emulator supports ~15 machines (ZX80, ZX81, Jupiter ACE, TS1500,
requested ROM filename against a compiled-in table and copies from embedded Lambda, R470, TK85, ZX97LE, Spectrum variants). Libretro port hardcodes
byte arrays generated by xxd -i at build time (Makefile.libretro:519-522). MACHINEZX81 — only zx81.rom and dkchr.rom are embedded.
Only two ROMs are embedded: zx81.rom (the ZX81 8K BASIC ROM) and dkchr.rom
(dK'tronics character ROM). Any other ROM name logs an error and returns 0.
The core never calls RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, never opens files:
files from the filesystem for ROM data, and need_fullpath is set to false # mode: standalone = only needed when running as standalone emulator
(libretro.cpp:308). All ROM data is baked into the compiled .so/.dll. # mode: libretro = only needed when running as libretro core
# mode: both (default if absent) = needed in both modes
No external BIOS or firmware files are needed. # ref: 81-libretro/81/zx81/snap.c:37,489-496 — embedded as bin_ROM_zx81_rom
# ref: EightyOne/Source/zx81/snap.cpp:1219-1279 — open(cwd/ROM/zx81.rom)
- name: zx81.rom
system: sinclair-zx81
required: true
mode: standalone
size: 8192
note: "ZX81 8K BASIC ROM. Embedded in libretro core, external for standalone."
source_ref: "EightyOne/Source/zx81/snap.cpp:1264, 81-libretro/81/zx81/snap.c:489"
files: [] # ref: 81-libretro/81/zx81/snap.c:38,499-508 — embedded as bin_ROM_dkchr_rom
- name: dkchr.rom
analysis: system: sinclair-zx81
embedded_roms: required: false
zx81_rom: mode: standalone
variable: bin_ROM_zx81_rom size: 4096
source_file: "bin/ROM/zx81.rom" note: "dK'tronics character ROM. Embedded in libretro core."
build_step: "xxd -i -> C array" source_ref: "81-libretro/81/zx81/snap.c:499"
source_ref: "snap.c:489-498"
dkchr_rom:
variable: bin_ROM_dkchr_rom
source_file: "bin/ROM/dkchr.rom"
build_step: "xxd -i -> C array"
source_ref: "snap.c:499-508"
machine_roms:
notes: |
eo.c sets CurRom based on machine type. The libretro port forces
MACHINEZX81 (eo.c:39-41), so CurRom is always zx81.ROM81 which
defaults to "zx81.rom". Other machine ROMs (zx80, ace, ts1500,
lambda, zx97le, ringo470, tk85) are referenced but only zx81.rom
and dkchr.rom are embedded. Selecting other machines would log
"ROM not found" and load nothing.
filesystem_access: false
system_directory_used: false

View File

@@ -106,6 +106,13 @@ def cross_reference(
if not fname: if not fname:
continue continue
# Skip standalone-only files when comparing against libretro
# platforms (RetroArch, Lakka, etc.). These files are embedded
# in the core and don't need to be in the platform pack.
file_mode = f.get("mode", "both")
if file_mode == "standalone":
continue
in_platform = fname in platform_names in_platform = fname in platform_names
in_repo = _find_in_repo(fname, by_name, by_name_lower) in_repo = _find_in_repo(fname, by_name, by_name_lower)