Speccy
Speccy emulates Sinclair ZX Spectrum, Timex Computer 2048, Timex Sinclair 2068 and MGT SAM Coupe. It reads 14 files, 1 of them required: without a required file it does not start games. A required file is needed only by the machines that use it. Each file below cites the line of source code that reads it.
About this profile
Technical notes
Sinclair emulator by Marat Fayzullin, covering ZX Spectrum 16kB, 48kB and 128kB, Spectrum +2, +2A and +3, Timex TC2048 and TS2068, the Slovak Didaktik Gama, the Russian Pentagon and Scorpion clones, and the Sam Coupe. The build read here is the free Android package com.fms.speccy, versionName 5.9.13 versionCode 5913, taken as the Play app bundle drop, xapk sha256 02ba433a0dbebf33742381ef3d126a2e0853bbd820d9b8fa93c52f61a4762300, base apk sha256 d87a8f042d57840e8c773404bcd7011a717cba698b2434e253a0bc7852772999, native split config.arm64_v8a sha256 b86c8c044032c7cdb7accb5a1530b7664271825b13469b0d20984dfd24250adf. Both splits carry no v1 signature and are signed through the APK Signing Block alone, the v2 and v3 signer being the author's own key, CN=Marat Fayzullin O=Garage Research issued 2011, fingerprint d09469e9b550cbc9005d3bd089f3df5f0ba89cba71cdd3b33736a0382d6f9848, beside a Play distribution source stamp. The paid package com.fms.speccy.deluxe, last published as 5.9.3 versionCode 5903 in December 2021, is carried by no mirror that answers: the author's site links only to Play for it, apkcombo bounces its download page back to the app page, apkpure redirects to its generic downloader, apkvision holds no copy and archive.org none either. The drop carries one native split, arm64-v8a, whose libmain.so keeps its dynamic symbol table, so the readings below cite offsets in that slice and Java lines in a jadx 1.5.6 decompile of the base apk. Against the 5.9.11 arm64-v8a library only OriginalDebugZ80 changed size, every loader function keeping its code at a shifted address. The free Speccy 5.9 builds for Windows and Ubuntu were read beside it and open the same names with the same lengths and the same order. No source has ever been published: every download on the site, from 1.7 for MSDOS through 5.9, is a binary package, while ColEm and fMSX on the same site ship source archives. ref: com.fms.speccy.apk APK Signing Block, https://fms.komkon.org/Speccy/, Speccy59-Windows-bin.zip, Speccy59-Ubuntu-x86-bin.tgz (sha256 723eef7f34c50532, speccy sha256 2c335e4b7ead43f8)
One directory holds everything. MainActivity hands the home directory to jniStart, which copies it into the buffer GetHomeDir returns and passes that same buffer to SetPrivateDir, and Application stores what GetHomeDir returns as the directory LoadBIOS changes into before it opens the first ROM and back out of when it is done. That directory is external storage joined with the application label up to its first space, so /sdcard/Speccy for the package read here, falling back to getExternalFilesDirs(null) when it is not a writable directory. Every open goes through mopen, which calls OpenRealFile first: the name is tried as given, and again as <PrivateDir>/<basename>, keeping the larger of the two when both open. mopen then layers gzdopen over the descriptor, so any of these files also opens gzipped, and a content:// name is routed to the Android storage framework. The desktop builds have no home directory of their own and open every name where they stand. Option -home stores its argument as the one directory LoadBIOS changes into before the first ROM and back out of after the last, so it moves the system ROMs alone. ref: MainActivity.java:1091-1104, EMULib.java:178, 315-361, 363-373, libmain.so jniStart 0x30ad8-0x310e3 (0x30eec-0x30efc, 0x30f58), GetHomeDir 0x2e73c, SetPrivateDir 0x509e0, Application 0x57784-0x577a4, OpenRealFile 0x50bd8-0x50dff, mopen 0x50e00-0x50f8f, LoadBIOS 0x5b0c4-0x5b0e8, 0x5b3d4-0x5b3e0, Speccy59-Ubuntu-x86-bin speccy main 0xc000-0xc053 (option table 0x593b0, entry 48 home), 0xc22f-0xc258 (argument stored at 0x6f9f0), LoadBIOS 0x3dae5-0x3db17 (getcwd, chdir to 0x6f9f0), 0x3de68-0x3de6e (chdir back)
LoadBIOS drives the whole set from one word of hardware flags, calling TryLoadROM once per name in a fixed order with the length to read and the bit that asks for it. TryLoadROM does nothing when the bit is clear, and clears the bit when mopen fails, which is the only check the emulator makes: the count mread returns is compared against the requested length solely to pick the word it logs, OK or FAILED, and a short read leaves the bit set. Nothing else about a file is examined and no hash is compared. A machine ROM that loads clears every other machine bit and a peripheral ROM that loads clears every other peripheral bit, so one machine and one disk interface stand at a time. StartZXS gives up when no machine bit survives, logging FAILED TO LOAD SYSTEM ROM! and returning zero without starting the emulation, which makes the ROM of the selected model the one file the emulator cannot run without. ref: libmain.so LoadBIOS 0x5b090-0x5b43b, TryLoadROM 0x5c64c-0x5c777 (mopen 0x5c680, mread 0x5c6ec, bit cleared 0x5c75c-0x5c760, masks 0x5c728-0x5c744), StartZXS 0x5ad74-0x5b08f (LoadBIOS 0x5ae9c, mask 0x5aea0-0x5aeac, message 0x5b058-0x5b06c), Speccy59-Ubuntu-x86-bin speccy 0x3dac0-0x3ddaa, 0x3d970-0x3da04, 0x3f43c-0x3f469, 0x3f640
Two names are reached only through another. ZXS128TR.ROM is tried in place of ZXS128.ROM when the 128kB model and the TR-DOS interface are both asked for, and ZXS128.ROM is loaded after it when it fails. The Multiface bit picks its image from the machine already loaded, MFPLUS3.ROM behind a +2A or +3, MF128.ROM behind a 128kB or +2 and MF1.ROM behind a 16kB or 48kB, and the 8192 bytes at offset 8192 of what it read are copied into the page below the machine ROM. ref: libmain.so LoadBIOS 0x5b29c-0x5b2c4, 0x5b32c-0x5b348, 0x5b2fc-0x5b3b4, Speccy59-Ubuntu-x86-bin speccy 0x3dc79-0x3dca1, 0x3ddf0-0x3de10, 0x3dcd9-0x3dd64
Thirteen of the nineteen ROMs ship inside the Android package. MainActivity reads assets/memfs.mp3 whole and jniStart mounts it through SetMemoryFS as an in-memory filesystem, which mopen consults only after OpenRealFile has failed, so a copy in the home directory is served ahead of the packaged one. The directory is a run of 32 byte entries, a length then a name, closed by an entry with an empty name whose first word is the key: rotated left by three times the entry count, XORed sixteen bits at a time into each length and rotated right by three after each, it yields the thirteen lengths, which run consecutively from the end of the directory and account for the file exactly. Eleven of the thirteen are the same bytes the Windows and Ubuntu distributions ship, and TC2048.ROM and TS2068.ROM appear in no distribution at all. ref: MainActivity.java:1091-1104, libmain.so jniStart 0x30c28-0x30c50, InitMemoryFS 0x50998, SetMemoryFS 0x50a08-0x50bd7 (key 0x50a74-0x50aac, lengths 0x50b74-0x50bb0), mopen 0x50ecc-0x50f74
Companion files come from the loaded program's path. LoadFile derives .sta, .pok, .cht and .pal from it and reads each when it is there, and the startup palette is a name of its own, <HomeDir>/Speccy.pal on Android and Speccy.pal beside the binary on the desktop, which -palette redirects. ref: libmain.so LoadFile 0x5c100, 0x5c1e8, 0x5c210, 0x5c234, Application 0x57874-0x578d0, StartZXS 0x5af00-0x5af10, LoadPAL 0x5b5f4, Speccy59-Ubuntu-x86-bin speccy 0x3f4ac-0x3f4bd, 0x3e450-0x3e494, main 0xc25d-0xc29b (option -palette, entry 47: a one digit argument picks a built-in palette at 0xc809-0xc833, any other is stored at 0x6a708, which defaults to Speccy.pal at 0x5aca9)
14 files: 1 required, 13 optional. 13 more files come with the app.
By kind: 19 BIOS and 8 game data.
In this collection: 7 in repo, 1 missing and 6 unsourceable.
Required
Section titled “Required”| File | Status |
|---|---|
ZXS16.ROMZX Spectrum 16kB BASIC ROM
Source
|
required for Sinclair ZX Spectrum missing |
Optional
Section titled “Optional”| File | Status |
|---|---|
DISCIPLE.ROMDISCiPLE disk interface ROM
|
in repo |
PLUSD.ROMMGT +D disk interface ROM
|
in repo |
MF1.ROMMultiface One ROM
Source
|
in repo |
MF128.ROMMultiface 128 ROM
Source
|
in repo |
MFPLUS3.ROMMultiface +3 ROM
Source
|
in repo |
Game data
Section titled “Game data”| File | Status | Hash |
|---|---|---|
Speccy.palstartup colour palette
Source
|
optional unsourceable game data | - |
ROOT.chtscheat database read by the Cheatopedia browser
Hashes and source
|
optional in repo game data | MD5 b41d9ebf8148 |
Controls.pngvirtual joystick skin
Hashes and source
|
optional in repo game data | MD5 d10635cb6f10 |
Backdrop.pngbackdrop drawn around the emulated screen
Source
|
optional unsourceable game data | - |
<game>.back.pngbackdrop for one title
Source
|
optional unsourceable game data | - |
<game>.pokPOKE list for one title
Source
|
optional unsourceable game data | - |
<game>.chtcheat codes for one title
Source
|
optional unsourceable game data | - |
<game>.palcolour palette for one title
Source
|
optional unsourceable game data | - |
Comes with the app
Section titled “Comes with the app”| File | Hash |
|---|---|
ZXS48.ROMZX Spectrum 48kB BASIC ROM
Hashes and source
|
MD5 4c42a2f07521 |
ZXS128.ROMZX Spectrum 128kB ROM pair
Hashes and source
|
MD5 85fede415f42 |
ZXS128TR.ROMZX Spectrum 128kB ROM pair carrying TR-DOS
Hashes and source
|
MD5 44082607f78a |
ZXSPLUS2.ROMZX Spectrum +2 ROM pair
Hashes and source
|
MD5 238f77692156 |
ZXSPLUS3.ROMZX Spectrum +2A and +3 ROM set
Hashes and source
|
MD5 7e00ed3562ab |
TC2048.ROMTimex Computer 2048 ROM
Hashes and source
|
MD5 9dd7ecf784a6 |
TS2068.ROMTimex Sinclair 2068 ROM set
Hashes and source
|
MD5 9194283503a1 |
DIDAKTIK.ROMDidaktik Gama ROM
Hashes and source
|
MD5 28287c397def |
PENTAGON.ROMPentagon 128kB ROM set
Hashes and source
|
MD5 36e48cd89847 |
SCORPION.ROMScorpion 256kB ROM set
Hashes and source
|
MD5 b26cba495108 |
COUPE.ROMSam Coupe ROM
Hashes and source
|
MD5 9f40c46cce40 |
TRDOS.ROMBeta Disk TR-DOS interface ROM
Hashes and source
|
MD5 53e2f417c699 |
IF1.ROMSinclair Interface I ROM
Hashes and source
|
MD5 31b704ae9253 |
Next steps
Section titled “Next steps”- Get the files, for the setup in use
- Every system, and the files each one needs
- When a game does not start