The emulator can load any of the formats supported by (3) - this includes Z80, SNA and SZX snapshots, and TAP and TZX virtual-tape files. Saving to SZX, Z80 and SNA snapshots and TZX and TAP tape files is supported. The SLT extension to the Z80 format is partly supported (enough for multi-load games); however, loading of the old DAT-file variant is not. DSK disk images are supported when emulating a +3, TRD and SCL disk images are supported when emulating a Pentagon or Scorpion and DCK cartridge images are supported when emulating a TC2068. Interface II ROM cartridges are also supported.
Finally, there is also support for reading and writing the RZX input recording format.
See the COMPRESSED FILES section for details on reading files compressed with bzip2(3) or gzip(3).
--autosave-settings
--auto-load
--beeper-stereo
--bw-tv
--competition-code code
--competition-mode
--compress-rzx
--confirm-actions
--dock file
--embed-snapshot
-g filter --graphics-filter mode
--graphicsfile file
-h --help
--if2cart file
--interface2
--issue2
-j device --joystick-1 device
--joystick-2 device
--kempston
--loading-sound
-m type --machine type
-p file --playback file
--plus3disk file
--printer
--rate frame
-r file --record file
--separation
--simpleide
--simpleide-masterfile file
--simpleide-slavefile file
--slt
-s file --snapshot file
--snaps-as-z80
--sound
--sound-force-8bit
-d device --sound-device device
--speed percentage
--statusbar
-v mode --svgamode mode
-t file --tape file
--textfile file
--traps
--trdosdisk file
-V --version
--writable-roms
--zxatasp
--zxatasp-upload
--zxatasp-write-protect
--zxatasp-masterfile file
--zxatasp-slavefile file
--zxcf
--zxcf-upload
--zxcf-cffile file
All long options which control on/off settings can be disabled using `--no-foo' (for an option `--foo'). For example, the opposite of `--issue2' is `--no-issue2'. These options can also be modified while the emulator is running, using the options dialogs - see the documentation for the Options menu in the MENUS AND KEYS section for details.
The important difference to note is that the GTK+ version uses `native' dialog boxes etc. (behaving like a fairly normal GUI-based program) while the others use an alternative, Fuse-specific `widget UI'. This latter front-end is easily spotted by the way it uses the main Fuse window/screen for menus and dialogs, and uses the Spectrum's own font.
In the GTK+ version, the menu bar is always visible at the top of the Fuse window. You can click on a menu name to pop it up. Alternatively, you can press F1 to display a pop-up version of the menu bar, which you can then navigate with the cursor keys or mouse.
In the widget UI pressing F1 is the only way to get the main menu; and unlike the GTK+ version, the emulator pauses while the menus are being navigated. The menus show which key to press for each menu option in brackets. Pressing Esc exits a menu, and pressing Enter exits the menu system entirely (as well as `confirming' any current dialog).
Here's what the menu options do, along with the function key mappings for those items which have them:
F3 File, Open...
F2 File, Save Snapshot...
File, Recording, Record...
File, Recording, Record from snapshot...
File, Recording, Play...
File, Recording, Stop
File, AY Logging, Record...
File, AY Logging, Stop
File, Open SCR Screenshot...
File, Save Screen as SCR...
File, Save Screen as PNG...
File, Load Binary Data...
File, Save Binary Data...
F10 File, Exit
F4 Options, General...
The options available are:
Emulation speed
Frame rate
Issue 2 keyboard
Use tape traps
Auto-load media
Save snaps as .z80
This option has no effect on the GTK+ user interfaces.
Use .slt traps
Allow writes to ROM
Auto-save settings
Black and white TV
Confirm actions
Show statusbar
Options, Sound...
Sound enabled
Loading sound
AY stereo separation
Beeper pseudo-stereo
Force 8-bit
Options, Peripherals...
Kempston joystick
Interface II
Emulate printers
Simple 8-bit IDE
ZXATASP interface
ZXATASP upload
ZXATASP write protect
ZXCF interface
ZXCF upload
Options, RZX...
Compress RZX data
Competition mode
If libgcrypt was available when Fuse was compiled, then recordings made with competition mode active will be digitally signed, in theory to `certify' that it was made with the above restrictions in place. However, this procedure is not secure (and cannot be made so), so the presence of any signature on an RZX file should not be taken as providing proof that it was made with competition mode active. This feature is included in Fuse solely as it was one of the requirements for Fuse to be used in an on-line tournament.
Competition code
Always embed snapshot
Options, Joysticks
Each of the joysticks (including the `fake' keyboard joystick) can be configured to emulate any one of the following joystick types:
None
Cursor
Kempston
Sinclair 1 Sinclair 2
Timex 1 Timex 2
For the real joysticks, it is also possible to configure (although currently only when using the GTK+ interface) what effect each button on the joystick will have: this can be Joystick Fire, equivalent to presing the emulated joystick's fire button, Nothing, meaning to have no effect, or any Spectrum key, meaning that pressing that button will be equivalent to pressing that Spectrum key.
Options, Select ROMs
Options, Filter...
Options, Save
Pause Machine, Pause
F5 Machine, Reset
F9 Machine, Select...
Spectrum 16K Spectrum 48K
Spectrum 128K
Spectrum +2
Spectrum +2A Spectrum +3
Spectrum +3e
Timex TC2048 Timex TC2068
Pentagon 128K Scorpion ZS 256
Spectrum SE
Machine, Debugger...
Machine, Poke Finder...
Machine, Memory Browser...
Machine, NMI
F7 Media, Tape, Open...
To guarantee that TZX files will load properly, you should select the file, make sure tape-loading traps are disabled in the General Options dialog, then press F8 (or do Media, Tape, Play). That said, most TZXs will work with tape-loading traps enabled (often quickly loading partway, then loading the rest real-time), so you might want to try it that way first.
F8 Media, Tape, Play
Media, Tape, Browse
Media, Tape, Rewind
Media, Tape, Clear
F6 Media, Tape, Write...
Media, Disk
Note that (since version 0.6.2), Fuse works with true virtual disk images: any changes made to a disk image will not affect the file which was `inserted' into the drive. If you do want to keep any changes, use the appropriate `eject and write' option before exiting Fuse.
Media, Disk, Drive A:, Insert...
Media, Disk, Drive A:, Eject
Media, Disk, Drive A:, Eject and write...
Media, Disk, Drive B:, Insert...
Media, Disk, Drive B:, Eject
Media, Disk, Drive B:, Eject and write
Media, Cartridge, Timex Dock, Insert...
Media, Cartridge, Timex Dock, Eject
Media, Cartridge, Interface II, Insert...
Media, Cartridge, Interface II, Eject...
Media, IDE, Simple 8-bit, Master, Insert...
Media, IDE, Simple 8-bit, Master, Commit
Media, IDE, Simple 8-bit, Master, Eject
Media, IDE, Simple 8-bit, Slave, Insert... Media, IDE, Simple 8-bit, Slave, Commit Media, IDE, Simple 8-bit, Slave, Eject
Media, IDE, ZXATASP, Master, Insert... Media, IDE, ZXATASP, Master, Commit Media, IDE, ZXATASP, Master, Eject Media, IDE, ZXATASP, Slave, Insert... Media, IDE, ZXATASP, Slave, Commit Media, IDE, ZXATASP, Slave, Eject
Media, IDE, ZXCF CompactFlash, Insert... Media, IDE, ZXCF CompactFlash, Commit Media, IDE, ZXCF CompactFlash, Eject
Help, Keyboard picture...
Some further punctuation keys are supported, if they exist on your keyboard - `,', `.', `/', `;', `'', `#', `-', and `='. These are mapped to the appropriate symbol-shifted keys on the Spectrum.
A list of keys applicable when using the file selection dialogs is given in the FILE SELECTION section below.
If you're using the SDL UI under X11, the window will automatically resize to be the correct size for the graphics filter selected.
A further complication arises due to the fact that the Timex machines have their high-resolution video mode with twice the horizontal resolution. To deal with this, Fuse treats these machines as having a `normal' display size which is twice the size of a normal Spectrum's screen, leading to a different set of filters being available for these machines. Note that any of the double or triple-sizing filters are available for Timex machines only when using the SDL user interface.
The available filters, along with their short name used to select them from the command line, are:
Timex half (smoothed) (half) Timex half (skipping) (halfskip)
Normal (normal)
Double size (2x)
Triple size (3x)
2xSaI (2xsai) Super 2xSaI (super2xsai) SuperEagle (supereagle)
AdvMAME2x (advmame2x)
AdvMAME3x (advmame3x)
TV 2x (tv2x) Timex TV (timextv)
Dot matrix (dotmatrix)
Timex 1.5x (timex15x)
To emulate different kinds of Spectrum, select the Machine, Select... menu option, or press F9.
The Spectrum emulation is paused when any dialogs appear. In the widget UI, it's also paused when menus or the keyboard picture are displayed.
Any printout is appended to one (or both) of two files, depending on the printer - these default to printout.txt for text output, and printout.pbm for graphics (PBM images are supported by most image viewers and converters). These names can be changed with the --textfile and --graphicsfile options from the command line or configuration file. While the ZX Printer can only output graphically, simulated text output is generated at the same time using a crude sort of OCR based on the current character set (a bit like using SCREEN$). There is currently no support for graphics when using the serial/parallel output, though any escape codes used will be `printed' faithfully. (!)
By the way, it's not a good idea to modify the printout.pbm file outside of Fuse if you want to continue appending to it. The header needs to have a certain layout for Fuse to be able to continue appending to it correctly, and the file will be overwritten if it can't be appended to.
The real ZXATASP comes with either 128K or 512K of RAM and the ability to connect an IDE hard disks and a CompactFlash card, while the ZXCF comes with 128K, 512K or 1024K of RAM and the ability to connect a CompactFlash card. From an emulation point of view, the two interfaces are actually very similar as a CompactFlash card is logically just an IDE hard disk. Currently, Fuse's emulation is fixed at having 512K of RAM in the ZXATASP and 1024K in the ZXCF.
To activate the ZXATASP, simply select the ZXATASP interface option from the Options, Peripherals... dialog. The state of the upload and write protect jumpers is then controlled by the ZXATASP upload and ZXATASP write protect options. Similarly, the ZXCF is controlled by the ZXCF interface and ZXCF upload options (the ZXCF write protect is software controlled).
If you're using either the ZXATASP or ZXCF, you almost certainly
want to investigate ResiDOS, the operating system designed for use
with the ZXATASP and ZXCF. ResiDOS provides facilities for using
the extra RAM, accessing the mass storage devices and a task
manager allowing virtually instant switching between programs on
the Spectrum. See
for more details.
FILE SELECTION
The way you select a file (whether snapshot
or tape file) depends on which UI you're using. So firstly, here's
how to use the GTK+ file selector.
The selector shows the directories and files in the current directory in two separate subwindows. If either list is too big to fit in the window, you can use the scrollbar to see the rest (by dragging the slider, for example), or you can use Shift-Tab (to move the keyboard focus to a subwindow) and use the cursor keys. To change directory, double-click it.
To choose a file to load you can either double-click it, or click it then click Ok. Or click Cancel to abort.
If you're using the keyboard, probably the easiest way to use the selector is to just ignore it and type in the name. This isn't as irksome as it sounds, since the filename input box has filename completion - type part of a directory or file name, then press Tab. It should complete it. If it was a directory, it moves to that directory; if the completion was ambiguous, it completes as much as possible, and narrows the filenames shown to those which match. You should press Enter when you've finished typing the filename, or Esc to abort.
Now, if you're using the widget UI - the one using the Spectrum font - the selector works a bit differently. The files and directories are all listed in a single two-column-wide window (the directories are shown at the top, ending in `/') - the names may be truncated onscreen if they're too long to fit.
To move the cursor, you can either use the cursor keys, or the Spectrum equivalents 5/6/7/8, or (similarly) h/j/k/l. For faster movement, the Page Up, Page Down, Home, and End keys are supported and do what you'd expect. To select a file or directory, press Enter. To abort, press Esc.
With both selectors, do bear in mind that all files are shown, whether Fuse would be able to load them or not.
Firstly, note that the vast majority of this section applies only if you're using the GTK+ user interface; if you're using one of the widget user interfaces, you'll get a very basic monitor which shows the current values of the registers and allows you to single step through execution or continue.
If you are using the GTK+ user interface, Fuse features a moderately powerful, completely transparent monitor/debugger, which can be activated via the Machine, Debugger ... menu option. A debugger window will appear, showing the current state of the emulated machine: the top-left `pane' shows the current state of the Z80 and the last bytes written to any emulated peripherals. The bottom-left pane lists any active breakpoints. Moving right, the next pane shows where the Spectrum's 64K memory map (the `W?' and `C?' indicate whether each 8K chunk is writable or contended respectively), and the next a disassembly, which by default starts at the current program counter, although this can be modified either by the `disassemble' command (see below) or by dragging the scrollbar next to it. The next pane shows the current stack, and the final pane any `events' which are due to occur and could affect emulation. Any of these panes can be removed by use of the View menu. Below the displays are an entry box for debugger commands, and five buttons for controlling the debugger:
Evaluate
Single Step
Continue
Break
Close
Double-clicking on an entry in the stack pane will cause emulation to run until the program counter reaches the value stored at that address, while double-clicking on an entry in the `events' pane will cause emulation to run until that time is reached.
The main power of the debugger is via the commands entered into the entry box, which are similar in nature (but definitely not identical to or as powerful as) to those in gdb(1). In general, the debugger is case-insensitive, and numbers will be interpreted as decimal, unless prefixed by either `0x' or `$' when they will be interpreted as hex. Each command can be abbreviated to the portion not in curly braces.
ba{se} number
br{eakpoint} [address] [condition]
br{eakpoint} p{ort} (r{ead}|w{rite}) port [condition]
br{eakpoint} (r{ead}|w{rite}) [address] [condition]
br{eakpoint} ti{me} time [condition]
cl{ear} [address]
cond{ition} id [condition]
co{ntinue}
del{ete} [id]
di{sassemble} address
fi{nish}
i{gnore} id count
n{ext}
o{ut} port value
se{t} address value
se{t} register value
s{tep}
t{breakpoint} [options]
Addresses can be specified in one of two forms: either an absolute addresses, specifed by an integer in the range 0x0000 to 0xFFFF or as a `page:offset' combination, which refers to a location offset bytes into into memory bank page, independent of where that bank is currently paged into memory. RAM pages are indicated simply by an integer, while ROMs are prefixed by `R' (eg offset 0x1234 in ROM 1 is specified as `R1:0x1234'). Pages selected via the /ROMCS line are prefixed with `C', while the Timex Dock and Exrom use prefixes `D' and `X' respectively. The 48K machines are treated as having a permanent mapping of page 5 at 0x4000, page 2 at 0x8000 and page 0 at 0xC000; the 16K Spectrum is treated as having page 5 at 0x4000 and no page at 0x8000 and 0xC000.
Anywhere the debugger is expecting a numeric value, except where it expects a breakpoint id, you can instead use a numeric expression, which uses a restricted version of C's syntax; exactly the same syntax is used for conditional breakpoints, with `0' being false and any other value being true. In numeric expressions, you can use integer constants (all calculations is done in integers), register names (which simply evaluate to the value of the register), parentheses, the standard four numeric operations (`+', `-', `*' and `/'), the (non-)equality operators `==' and `!=', the comparision operators `>', `<', `>=' and `<=', bitwise and (`&'), or (`|') and exclusive or (`^') and logical and (`&&') and or (`||').
The `poke finder', available only under the GTK+ UI, is a tool which is designed to make the task of finding (infinite lives etc) pokes for games a bit easier: it is similar to the `Lifeguard' utility which was available for use with the Multiface. It works by maintaining a list of locations in which the current number of lives (etc) may be stored, and having the ability to remove from that list any locations which don't contain a specified value.
The poke finder dialog contains an entry box for specifying the value to be searched for, a count of the current number of possible locations and, if there are less than 20 possible locations, a list of the possible locations (in `page:offset' format). The five buttons act as follows:
Incremented
Search
Reset
Close
Double-clicking on an entry in the list of possible locations will cause a breakpoint to be set to trigger whenever that location is written to.
An example of how to use this may make things a bit clearer. We'll use the 128K version of Gryzor. Load the game, define keys to suit and start playing. Immediately pause the game and bring up the poke finder dialog. We note that we currently have 6 lives, so enter `6' into the `Search for' field and click `Search'. This reduces the number of possible locations to around 931 (you may get a slightly different number depending on exactly when you paused the game). Play along a bit and then (deliberately) lose a life. Pause the game again. As we now have 5 lives, replace the `6' in the 'Search for' field with a `5' and click `Search' again. This then reduces the list of possible locations to just one: page 2, offset 0x00BC. This is the only location in memory which stored `6' when we had 6 lives and `5' when we had 5 lives, so its pretty likely that this is where the lives count is stored. Double-clicking on the `2:0x00BC' entry in the dialog will set the appropriate breakpoint (you may wish to open the debugger at this point to confirm this). Play along a bit more. When you next lose a life, emulation is stopped with PC at 0x91CD. Scrolling up a few addresses in the debugger's disassembly pane shows a value was loaded from 0x80BC (our hypothetical lives counter), decremented and then stored again to 0x80BC, which looks very much like the code to reduce the number of lives. We can now use the debugger to replace the decrement with a NOP (`set 0x91c9 0'), and playing the game some more after this reveals that this has worked and we now have infinite lives.
In general, disk images for the +3 Spectrum are thought of as being in DSK format. However, this is actually an slight oversimplification; there in in fact two similar, but not identical, DSK formats. (The difference can be seen by doing `head -1 dskfile': one format will start `MV - CPCEMU' and the other will start `EXTENDED').
The `lib765' library used by Fuse to emulate the +3's FDC supports the `CPCEMU' format, but not the extended format. If the `libdsk' library was also found while compiling Fuse, this is used to provide support for the extended format, as well as for other goodies such as compressed disk images.
Fuse supports .SCL and .TRD images in its Pentagon and Scorpion emulation; truncated .TRD files need to be expanded with another utility before use with Fuse.
Assuming the appropriate libraries were available when
(3)
was compiled, snapshots, tape images, dock cartridges and input
recording files can be read from files compressed with bzip2(3) or
gzip(3) just
as if they were uncompressed. libdsk provides an equivalent
functionality for +3 disk images if available, but there is
currently no support for reading compressed TR-DOS disk images.
BUGS
Selecting a startup filter doesn't work properly with
user interfaces other than SDL.
Attempting to replay an RZX file without an embedded snapshot from the command-line doesn't work if you do `./fuse rzxfile snapshot'. `./fuse snapshot rzxfile' does work though, so use that instead.
Changing virtual consoles when using SVGAlib for joystick support causes Fuse to exit. If this is a problem, compile Fuse with the `--disable-ui-joystick' option.
The poke finder can't search outside `normal' RAM.
Using the Options, Joysticks, Joystick 1... or Options, Joysticks, Joystick 2... options under GTK+ 2.x produces a large number of GTK+ critical warnings. This is a GTK+ bug (#144427), which is fixed in GTK+ 2.4.4.
The comp.sys.sinclair Spectrum FAQ, at
.
AUTHOR
Philip Kendall (pak21-fuse@srcf.ucam.org).
Matan Ziv-Av wrote the svgalib and framebuffer UIs, the glib replacement code, and did some work on the OSS-specific sound code and the original widget UI code.
Russell Marks wrote the sound emulation and OSS-specific sound code, the joystick emulation, some of the printer code, and the original version of this man page.
John Elliott's lib765 library emulates the +3's disk controller chip, providing Fuse's +3 disk support, and his libdsk library provides support for more disk image formats.
Ian Collier wrote the ZX Printer emulation (for xz80).
Darren Salt wrote the original versions of the code for +3 emulation, SLT support, MITSHM support (for the Xlib UI), TZX raw data blocks, and RZX embedded snapshots and compression.
Alexander Yurchenko wrote the OpenBSD/Solaris-specific sound code.
Fredrick Meunier wrote the TC2048, Pentagon and Spectrum SE support as well as maintaining the OS X port and importing the graphics filter code.
Ludvig Strigeus and The ScummVM project wrote the original graphics filter code.
Dmitry Sanarin wrote the original TR-DOS emulation (for Glukalka).
Witold Filipczyk wrote the TC2068 support.
Matthew Westcott wrote the AY logging code.
Marek Januszewski wrote various bits of code to make Fuse work under Win32, including the DirectDraw user interface.
Stuart Brady wrote the Scorpion emulation and the HP-UX sound code.
Garry Lancaster wrote the 8-bit IDE, ZXATASP and ZXCF interface emulations.