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

View File

@@ -1,6 +1,7 @@
emulator: EightyOne
type: libretro
type: standalone + libretro
source: "https://github.com/libretro/81-libretro"
upstream: "https://github.com/charlierobson/EightyOne"
profiled_date: "2026-03-18"
core_version: "1.0a"
display_name: "Sinclair - ZX 81 (EightyOne)"
@@ -10,43 +11,34 @@ systems:
- sinclair-zx81
notes: |
EightyOne is a Sinclair ZX81 emulator ported to libretro. Also supports
ZX80, Jupiter ACE, TS1500, Lambda, R470, TK85, and ZX97LE machines, but
the libretro port hardcodes MACHINEZX81 in retro_load_game (libretro.cpp:393).
Libretro core embeds zx81.rom and dkchr.rom as C arrays (xxd -i at build).
Core never calls RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY.
Standalone EightyOne loads ROMs from filesystem (cwd/ROM/<filename>).
ROM loading is in snap.c:487-512. The memory_load() function matches the
requested ROM filename against a compiled-in table and copies from embedded
byte arrays generated by xxd -i at build time (Makefile.libretro:519-522).
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.
Original emulator supports ~15 machines (ZX80, ZX81, Jupiter ACE, TS1500,
Lambda, R470, TK85, ZX97LE, Spectrum variants). Libretro port hardcodes
MACHINEZX81 — only zx81.rom and dkchr.rom are embedded.
The core never calls RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, never opens
files from the filesystem for ROM data, and need_fullpath is set to false
(libretro.cpp:308). All ROM data is baked into the compiled .so/.dll.
files:
# mode: standalone = only needed when running as standalone emulator
# 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: []
analysis:
embedded_roms:
zx81_rom:
variable: bin_ROM_zx81_rom
source_file: "bin/ROM/zx81.rom"
build_step: "xxd -i -> C array"
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
# ref: 81-libretro/81/zx81/snap.c:38,499-508 — embedded as bin_ROM_dkchr_rom
- name: dkchr.rom
system: sinclair-zx81
required: false
mode: standalone
size: 4096
note: "dK'tronics character ROM. Embedded in libretro core."
source_ref: "81-libretro/81/zx81/snap.c:499"