Resource centre for ZX Spectrum games
using Manic Miner and Jet Set Willy game engines
Archive of the
Manic Miner & Jet Set Willy Yahoo! Group
messages
|
|
||
|
|
Message: 4768
Author: andrewbroad
Date: 15/04/2005
Subject: Emulator file-formats: TAP, TZX, SNA and Z80
Daniel wrote:
>I release all my Spectrum software as TAP only, in order to minimise
> I am slowly getting ready to release "JSW - The 2005 Megamix" and
> I have a question regarding file formats. I planned to release the
> game, in one zip file, both in the .tap and the .z80 format, both
> files being a product of John Elliott's JSWED. I discarded the
> .sna format, since it's a 128k engine game and John warns that
> 128k .sna files "may not be compatible with emulators". I planned
> to include the .z80 file so that people using emulators unable to
> handle .tap files can open the game easily. However, I have
> noticed that the authors of JSW games released recently typically
> released them as .tap files only.
>
> Therefore, I would like to ask John and everyone else if there is
> any particular reason why it is preferable to release games in
> the .tap format only, and also if there is any reason whatsoever
> why it might be better NOT to release a .z80 file (especially a
> 128k .z80 file) - can there be any bugs, problems, etc.?
the number of versions (thus saving space, bandwidth, and possible
confusion over which is the definitive version).
There are two classes of emulator file-formats, tape-based and
snapshot:
* Tape-based (TAP and TZX): the file represents an audio cassette
with data on it, that can be loaded into a Spectrum-emulator the way
tapes are (or used to be) loaded into a Spectrum. It's the only
faithful way to preserve old Spectrum software, and IMO the best way
to encode new Spectrum software. The only disadvantage I can see is
that it can be more difficult for the lay user to load tapes into an
emulator than to load snapshots.
* Snapshot (SNA, Z80, etc.): the file represents the complete state
of the Spectrum's RAM and registers at the moment it was saved. It's
useful for saved positions, but is an inelegant way to release new
software, particularly if the snapshot is saved while the game is
running, when all sorts of temporary variables could `corrupt' the
data that would be on the tape (which might just possibly upset
MM/JSW editors, or corrupt the game if it is converted to a tape).
So if you're going to release a snapshot, make it a *perfect*
snapshot: one where you press a key to run the game (as in PAUSE 0:
RANDOMIZE USR 33792). I always write my BASIC loaders to give people
the opportunity to save a perfect snapshot, with particular regard
to those who may wish to apply one of my offensive-content filters
first.
----------
TAP vs TZX
----------
* TAP is an old tape-format that is very simple: a TAP file consists
of a sequence of Spectrum-files, each encoded as a header followed
by the payload - and the payload encodes the data exactly as
they are (although if you edit these data manually, you'll break the
checksum in the header). The TAP format respects simple file-
concatenation, and no half-decent emulator should lack the ability
to at least read TAP files.
* TZX is a new, enhanced tape-format that can represent the weird
loaders that software-houses used to protect their games, and can
annotate the tape with extra information. There is a school of
thought that TZX files should completely replace TAP files, but some
older emulators, JSWED and my own SPECSAISIE do not yet recognise
TZX files.
----------
SNA vs Z80
----------
* SNA is a simple representation of the Spectrum's registers (the
first 27 bytes of the file) plus the contents of the RAM exactly as
they are (addresses 16384 to 65535). Thus a 48K SNA file is exactly
49179 bytes. A 128K SNA file adds extra data, including of course
the extra RAM-banks. Some older emulators do not recognise 128K SNA
files; SPECSAISIE recognises them but currently only handles the
first 49179 bytes (I do intend to implement a 128K memory-model in
the future). With both RealSpec and MacSpectacle, I sometimes
experience memory-corruption (particularly of the screen) after
saving a SNA file.
* Z80 is a variable-length file-format that compresses the payload,
producing smaller files than the corresponding SNA files. SPECSAISIE
does not currently recognise Z80 files, but spconv solves that issue
at the expense of creating a temporary SNA file. The Z80 file-format
comes in various versions, and older emulators may not recognise
newer versions of the Z80 format.
A technical specification of each file-format can be found at
http://www.srcf.ucam.org/~pak21/cssfaq/reference/formats.htm
--
Dr. Andrew Broad
http://www.geocities.com/andrewbroad/
http://www.geocities.com/andrewbroad/spectrum/
http://www.geocities.com/andrewbroad/spectrum/download/
