﻿======================================
DanSpec - A Sinclair Spectrum emulator
======================================

Version:      0.9.629beta3

Release date: 08 Nov 2026

Author:       Dan Offer
Email:		  dans.remakes@gmail.com


================
What is DanSpec?
================

Put simply, DanSpec is a Sinclair Spectrum emulator for Windows.

It emulates 48K, 128K and +2 models of the Sinclair Spectrum, and can run most software written for these machines.

Joysticks are automatically supported, but only one joystick at a time, with Button 1 being Fire, Button 2 mapping to UP on the joystick, and Button 3 mapping to SPACE.


==================
Supported Features
==================

The following systems are currently emulated:
---------------------------------------------

48K Spectrum
48K Spectrum + AY chip
48K Spectrum + SamRam interface (use F5 as the NMI key)
Sinclair 128K Spectrum
Sinclair +2 Spectrum


Snapshots loading supported: SNA, Z80
Tape files loading supported: TAP, TZX
Snapshot Saving: Z80
Loading from Zips containing the above formats are also supported.
ULA Plus support (beta)

Other Hardware: Snapshots made with MGT (Disciple), Interface 1 and SamRam expansions enabled are supported.

Front end game collection manager with options to create folders, rename, move and delete files, drag and drop file installation, with optional screenshots (saved and embedded), instructions, file information, game art and adverts.
Current list of games is saved between sessions, preventing the need from re-scanning the list every time the emulator starts, although there is an option to make it rescan at every startup if you want.
"Turbo loading" and "smart loading" TZX files.
Accurate 48K ULA emulation, including border effects.
Reasonably accurate 128K ULA emulation, including border effects.
Beeper and AY support.
Optional tape loading sounds for TZX files.
Windows gamepad / joystick support (automatically detected).
Kempson, Sinclair 1, Sinclair 2 and Cursor joystick supported.
SamRam interface/memory expansion support.
Full screen mode (with or without border artwork)
Scanlines support
Optional FPS counter


=====
Usage
=====

Launch DanSpec.EXE to launch the front end.


When you first start DanSpec the options screen will appear, you can select separate folders for 48K and 128K images.  This makes more difference for TAP/TZX files than for snapshots - 48K snapshots dropped into the 128K folder will still open in 48K mode, and visa versa.

Options Screen
==============

Emulator:
---------

Basic emulator settings.

Start Full Screen		-	Whether the emulator launches games full-screen or in a window.
TZX Loading sound on	-	Play Spectrum loading sound whilst loading TZX files.
Smart TZX Loading		-	Attempts to pause loading of TZX files (and resume playback) at the appropriate time, works for most but can cause some games to crash.
TZX Turbo load			-	Accelerates the emulator whilst loading TZX files.  TZX loading sound is disabled automatically if turbo load is enabled.
Joystick				-	Select what sort of Emulated joystick the emulator defaults to.  This can be changed whilst the emulator is running if required.

Machine:
--------

Choose which model will be used to load TAP / TZX files for the 48K and 128K folders.

48K						-	Choose between 48K and 48K + AY Sound support.
128K					-	Choose between original Sinclair 128K (Black Toastrack) Spectrum, and the Sinclair 128K +2 (Grey Amstrad) model.

File Paths:
-----------

Select folders to hold 48K and 128K files.

48K Files				-	Select area where 48K files are loaded from.  Sub-folders in there will be checked for games.
128K					-	Select area where 128K files are loaded from.  Sub-folders in there will be checked for games.

Interface:
----------

Select what will be shown in the emulator front end.  For Screenshots, Loading Screens, Instructions etc will be visible.  To add a screenshot, Loading Screen, Instructions or cover art these can be dragged into the preview window and will be automatically copied into the correct subfolder (see Subfolders section).

View Embedded Screenshots	-	Select whether embedded screenshots will be shown in the front-end.  Embedded screenshots are automatically decoded from TAP, TZX, SNA and Z80 images where possible.
Show Screenshots			-	Select whether game screenshots will be shown in the front end. JPEG, PNG, BMP, GIF images are supported.
Show Loading Screens		-	Select whether loading screen images will be shown in the front end. JPEG, PNG, BMP, GIF images are supported.
Show Cover Art				-	Select whether cover art will be shown in the front end. JPEG, PNG, BMP, GIF images are supported.
Show Adverts				-	Select whether game Adverts will be shown in the front end. JPEG, PNG, BMP, GIF images are supported.
Show Instructions			-	Show game instructions.  These should be added as text files (TXT).
Show file information		-	Show file information, such as snapshot image details for Z80 and SNA files, and tape image listings for TAP, TZX files.
Rescan files at launch		-	By default the front end maintains a database of the files in the 48K and 128K folders.  These are saved to your user profile and will be re-loaded the next time the emulator launches.  However if you would like to re-scan the files every time the front-end launches then select this option.
Fullscreen Border			-	Select optional border art when running in full-screen mode.

Subfolders:
-----------

Select the name of the sub-folders to store / retrieve screenshots, cover art, instructions etc for the emulator.  These folders will be automatically created in the root of the main 48K and 128K game folders as needed.


Front-end
=========

The front-end itself is fairly straight forward.

By default the game folders are collapsed.  Click the + sign next to the 48K and 128K folders to expand the folder, any sub-folders will also be collapsed but can be expanded in the same way.

Clicking on a game will highlight it, the "details" pane of the emulator will show either the embedded screenshots, screenshots, cover art etc. and can be changed to a different mode using the arrow icons.  The bottom "File Information" screen will show either "Instructions" or "File Information" and can be changed using the arrow icons as well.

Right-clicking on a game will show a context menu which will allow you to rename files, delete files or create folders.  This is not available when the view is filtered.  You can also drag files to move them between folders.

Spectrum files can be dragged from Windows into the file list and will be copied into whatever folder they are dropped into.  New sub-folders can also be created here.

To launch a game, either double-click the name in the file browser, press "Enter" when the game is selected, or press the "Play" icon in the icon bar above the "Details" pane.

When a tape is playing a small TAPE icon appears at the bottom right of the screen.  Clicking on that will open the tape control menu where you can pause, resume, enable or disable turbo loading, change tape file and skip to different blocks in the tape.  Once a tape file has finished then the tape icon should vanish automatically, but if not then it can be hidden using the button in the windowed version of the emulator.

There is also a text box above the file browser, which can be used to search for games in your collection.  To the right of the search box are a number of icons.

Magnifying Glass		-	Search
Eraser					-	Clear search filter
Two arrows pointing in	-	Close all sub-folders
Two arrows pointing out	-	Open all sub-folders
Circle with triangle in	-	Play button.  Play currently selected game


Tool menus
==========

File / Exit							-	Quit DanSpec
Tools / Rescan Files				-	Rescan 48K and 128K file paths
      / AY Music Player				-	Play AY sound files (Spectrum and Amstrad files are supported)
	  / Screen Viewer				-	View loading screen or screen memory in SNA, Z80, TAP or TZX files files.
	  / View BASIC in Tape			-	View BASIC listings within TAP and TZX files.
	  / Options						-	Set / change program options
	  / Run Emulator (Standalone)	-	Run standalone version of the emulator.
Help / About						-	View program version information


Emulator Options
================

When the emulator is running in windowed mode you can set various options from the toolbar.

If the emulator is in full-screen mode the menu will show when the mouse pointer is at the top of the screen.

If you are running the "stand-alone" emulator then there are additional options such as machine type that you can select.


Running from the command line
=============================

The emulator can now be ran from the commandline.

Usage:

	DanSpec.exe [file] [options]

Options:
	file		.tap, .tzx, .sna, .z80 or .zip file
	/machine	48k, 48k_ay, 128k, plus2
				default: 128k
	/fullscreen	Start in fullscreen mode
	/windowed	Start in windowed mode
	/?			Show help and exit

Notes:
	Machine selection applies to tape files or a blank start.
	For .sna and .z80 files the snapshot selects the machine.
	Options are case-insensitive and can appear before or after
	the file path. Quote paths may contain spaces.


===================
Future Development:
===================

Better TZX tape handling for multiload games is ongoing, but should work for the most part.  The "Smart TZX Loading" option and tape browser should make it fairly easy to handle multiload files, although this can be switched off if it causes problems.  STOP and PAUSE blocks in TZX files are supported regardless of whether smart loading is enabled.  Special loaders work (at least those that I've tested), but if you find one that doesn't load you'll probably need to find a Z80 snapshot of the game instead.

Other models?  ZX81 is a definite maybe.  Pendragon and other Russian clones, Sinclair Timex etc - probably not.  We will not be touching other non Z80 systems, unless I decide to code a separate one at some point.  Who knows?


=================================
So Why Another Spectrum Emulator?
=================================

Well, there are a few reasons, but probably the main one is that I haven't written one and it was on my "bucket list" of things to do.

Back in 2021 I'd started writing a generic front end for Spectrum Emulators, and have been tinkering with it for the last five years (or so) in my spare time.  As it progressed it ended up as a front end for one specific Emulator (Zesarux), which is a great emulator but supports a lot more stuff than I really need, and the small but unavoidable delay in launching it from the front end took away some of the immediacy of just running a game.  That takes us to the end of 2025.  Like I said, it was a "spare time" project, and not necessarily something I was intending for public consumption.  It did what I needed to manage my collection of Spectrum games, and that was that.

As part of the front end I'd already written code to read the screen memory from SNA files, and to extract the loading screen from TAP files.  Both are fairly simple to do, and the next step was to do the same for Z80 snapshots and TZX files too. Z80 snapshots are a bit more complex and involved essentially re-creating the Spectrum's memory model so that I could decompress the Z80 snapshot and pull out the screen memory.  And once you've got that far, you have already started to write a Spectrum emulator.

That brings us in a very round about way to earlier this year when I decided to try and add the extra parts to make an emulator.  The memory model was already there albeit in a basic form, so that would mean that I needed to add Z80 CPU emulation, and the ULA.  The Z80 CPU is thankfully well documented, and although there are a few open source ones available I wanted to write my own.  Again - there are a few resources showing how to do that, and as I was using VB.NET there weren't as much existing code to look at (although I have since found that other ones do exist).  Once that was done (at least the basic instruction set) then adding a basic ULA was relatively straightforward*, and DanSpec was born.

Getting the basics done is one thing, making it work correctly is another, and that has been the much longer part of the process.  Trying to get the timing right, and the video output correct, not to mention memory contention and the multitude of other gotchas that exist has been the real challenge.  Building some unit tests to check the CPU and ULA against results based on test software already written by others has been invaluable (thanks will be listed at the end of this novel), and much better than trying to fix it by trial and error by running games and trying to work out why they don't work correctly.

That brings us up to date

* OK, not actually THAT straightforward, but seeing as some of the bits such as decoding the screen memory to build our video signal had already been done, so it was more to do with adding the missing parts such as keyboard handling, tape support and sound.


=======
License
=======

This is currently freeware, but closed source.  Feel free to donate to the developer if you want to say thanks, but that is purely voluntary.  Copy for your friends if you think it's good enough, but don't charge money for it.  If you have had to pay to get hold of this then you've been taken advantage of.


========
Warranty
========

There is no warranty (implied or otherwise) with this software. As it is free you use it at your own risk, and if it eats your cat, makes sweet love to your sofa, raids the biscuit tin when you aren't looking, blows up your computer, deletes your files or just doesn't work - you're on your own.  By using it you accept responsibility for what happens.  You are the master of your destiny - embrace it!


===========================
Thanks and useful resources
===========================

Big thanks to:
--------------

Patrik Rak - for his Z80 CPU test suite, which has been invaluable in getting the CPU emulation something close to correct.
https://github.com/raxoft

Richard Butler - for his timing_tests-48k_v1.0.tzx, which was a godsend in working out some of the finer points in the ULA timing for the 48K Emulation.
https://zxspectrum4.net/op_timing.php

The team behind the ZOT timing tests.
https://github.com/redcode/ZXSpectrum/wiki/Tests

Gerton Lunter - The genius behind the original Z80 Spectrum Emulator, SamRam expansion, Z80 Snapshot format and probably much more that I've not mentioned.


Other useful resources:
-----------------------

https://github.com/redcode/ZXSpectrum/wiki/Technical-literature
https://worldofspectrum.net/documentation/
https://turbo80.com/fidelity.html


History
=======

Versions prior to 0.9.555 were never publicly released.

0.9.555		-		13/10/2026		-	Beta 1: Initial beta release of built-in Spectrum Emulator
0.9.594		-		24/10/2026		-	Beta 2: Bug fixes, tape management, ZIP file support, SamRam support, BASIC viewer.
0.9.629		-		08/11/2026		-	Beta 3: ULA Plus support (beta), AY Player, Scanlines, FPS counter, treeview state is now kept, TAP loading fixes, fix to 128K ram paging (required for Wizball Enhanced), buttons / checkboxes on Emulator form replaced with a Dropdown menu (gives a big reduction in CPU usage), launch from command line, multiple quality of life tweaks