UEF (file format)
From Wikipedia, the free encyclopedia
Unified Emulator Format | |
---|---|
File name extension | .uef |
Internet media type | application/octet-stream |
Magic number | UEF File! |
Developed by | Thomas Harte |
Initial release | prior to 10 August 2000 [1] |
Latest release | 0.10 draft 28 / 10 January 2006 |
Type of format | Emulation, chunked file format |
Website | http://electrem.emuunlim.com/UEFSpecs.html |
UEF (Unified Emulator Format) is a compressed, chunk based file format, first implemented by the ElectrEm emulator and related tools, for the storage of audio tape, ROM, floppy disk and machine state snapshots for the 8-bit range of computers manufactured by Acorn Computers Ltd. It is now supported by major emulators of Acorn machines and carried by two online archives of Acorn software numbering thousands of titles.
UEF was the first format[citation needed] to attempt to concisely reproduce media borne signals rather than simply the data represented by them, the intention being an accurate archive of original media rather than merely a capability to reproduce files stored on them. A selection of metadata can be included, such as compatibility ratings, position markers, images of packaging and the text of instruction manuals.[1]
The Acorn machines implement the Kansas City standard (KCS) for tape data encoding and as a result the file format is suitable for creating backups of original media for several non-Acorn machines. As of version 0.10 the file format carries BASICODE signals as well. TZX [2] is a chunked format with similar scope for the ZX Spectrum series.
Contents |
[edit] Structure
A UEF file consists of a fixed length header that identifies itself, followed by a linked list of chunks containing the data of interest. The header comprises the magic string UEF File!, a terminating null character, and a two-byte version number of the UEF specification in use. A reading application needs to pay attention to the version number, as the unit of measurement in some chunks differs according to the specification version, and one chunk has been redefined.
Each chunk consists of a two-byte ID which determines its meaning, the length of the body in four bytes, and the body itself. An application can readily skip the bodies of chunks it does not need to process. After the last chunk the file simply ends. Currently, UEF chunks do not nest.
The whole UEF file, including the header, may optionally be compressed in gzip format; by examining the start of the file for a gzip or UEF header, a decompression routine can be invoked as appropriate.
[edit] Content
The Unified Emulator Format models software on cassette as a contiguous sequence of segments, which may be carrier tones, modulated asynchronous signals, security cycles (modulated synchronous signals, said to be an "identification feature"[1]) or gaps where no recognised signal is present. Tape UEF chunks are concatenated in the order they appear, to build up the representation of a whole recording. When generated from a real source tape, each tape chunk corresponds directly to a waveform on the tape, such that the source can be accurately reconstructed (with any non-encodable signals replaced by gaps of equal length.) Standard Acorn streams are encoded so that their bytes reappear in the UEF chunk body.
There are some "modal variables" affecting the interpretation of these chunks: the baud rate, 1200 baud for Acorn signals or 300 baud for KCS; the exact carrier frequency, which determines the playing time of the reconstructed tape; and the phase of the signal. The latter two may change within a published recording, and their absolute values depend on the tape player, amplifier and sound card used to digitise the signal.[2]
A UEF file can contain markers to separate the tapes of a multiple-tape distribution, and the sides of each tape; positions of interest within each side can also be marked.
Disks are stored as raw sector dumps of each surface, plus their geometry and a byte identifying the file system. Previous versions of the specification had provisions to encode disks at the byte stream level, or the magnetic domain level.
Sideways ROMs are likewise stored as raw data, plus an indication of their purpose and a ROM slot recommendation.
State snapshot UEF files include standardised chunks to store the major portions of an Acorn Electron or BBC Micro's state: main memory, the CPU and floppy disk controller registers, and so on. A range of chunk IDs is reserved for private use by emulators, and they use these private chunks for state variables not accommodated in the standard chunks.
Multiplexed data is an expansion with one known implementation but no published specification:
Bit multiplexing supplies the emulator with additional information so that old programs may be run to produce a greater quality of output.
This feature is really only for emulation use of UEF files and ignoring bit multiplexing will have no effect on the accuracy of your tool to original hardware.
—Thomas Harte, UEF File Format Specs 0.10 (document draft 28)[1]
One salient application mentioned by Harte is to superimpose "new graphics on old games",[3] and a single example, a 256-color enhanced Daredevil Dennis, is available from StairwayToHell.com to run in ElectrEm.
Multiplexed data chunks are intended to follow ordinary data chunks in any of the above classes, supplementing the data. Their contents are not meant to be presented to Acorn computers, real or emulated, but otherwise their meaning has not been specified.
Content information includes a file origin chunk, which identifies the application that generated the UEF file. There are defined formats for scanned images of cassette inlays; the text of any accompanying instruction booklet can be included; the UEF file can recommend a "short title", minimum machine specification and keyboard mapping for the enclosed software; and where a game does not use the whole screen, the coordinates of the "visible area" can be given. A minority of UEF files available online contain anything in this class but an origin chunk.
A UEF file can contain multiple classes of data at once; it is not possible to know which classes it contains without scanning the whole file. In its file selection box ElectrEm displays an icon according to the first data class chunk it finds.
[edit] Applications
[edit] MakeUEF
MakeUEF is a Windows application written by Thomas Harte and expanded by Fraser Ross to convert audio samples into UEF files. Two grades are offered. An 'amateur' version reads WAV files or a live signal played to the sound card, and transcribes only standard data blocks with accuracy[2]. The 'professional' grade accepts only CSW files which represent waves preprocessed into rectangular pulse trains, but it encodes all audio information supported by the UEF specification.
In its manual MakeUEF[2] claims to have been the sole creator of UEF files that were available on the Web before November 2004, the month of its version 1.0 release. Although the file format was more capable, only "program data" was retained by MakeUEF prior to version 1.0. From November 2004 the fidelity of MakeUEF improved and the file spec was further refined, and an extension of .hq.uef ("high quality") was adopted to reflect this.[2] The AcornPreservation.org archive only carries the .hq.uef variety as well as the CSW source files. Its sister site StairwayToHell.com accepts 'amateur' UEF translations and files produced by pre-1.0 MakeUEF. As of 2008 the latter site hosts 1,494 transcriptions of BBC Micro cassette titles and at least 800 of Electron titles.
[edit] Others
- Several emulators of Acorn machines support UEF natively, to read and write tape data (at original speed or faster) and store state snapshots. Examples include ElectrEm, BeebEm and B-Em.
- FreeUEF by Thomas Harte and the UEFReader plugin to the jlGui media player, convert a UEF file to a wave suitable for recording on tape or playing back to a physical computer.
- The UEFwalk script validates and extracts data from UEF files.
- The XVUEF patch extends the Xv image editor to support the little-used inlay scan chunks of the UEF.
[edit] References
- ^ a b c Harte, Thomas (2006-01-10). UEF File Format Specs 0.10 (document draft 28). Retrieved on 2008-02-25.
- ^ a b c d Ross, Fraser; Harte, Thomas (2007-01-18). MakeUEF 2.1 distribution (ZIP archive containing PDF). Acornpreservation.org. Retrieved on 2008-02-24.
- ^ Harte, Thomas (2003-08-01). Re: BBC double density disc images. BBC Micro Mailing List Archive. Retrieved on 2008-05-25.