v0.2-alpha

This commit is contained in:
redcode
2022-05-17 12:53:52 +02:00
parent b60d21889e
commit 028f50cbde
47 changed files with 7210 additions and 2335 deletions

View File

@@ -0,0 +1,54 @@
=============
API reference
=============
Macros
------
.. doxygendefine:: Z80_LIBRARY_VERSION_MAJOR
.. doxygendefine:: Z80_LIBRARY_VERSION_MINOR
.. doxygendefine:: Z80_LIBRARY_VERSION_MICRO
.. doxygendefine:: Z80_LIBRARY_VERSION_STRING
.. doxygendefine:: Z80_CYCLE_LIMIT
.. doxygendefine:: Z80_HOOK
.. doxygendefine:: Z80_MODEL_ZILOG_NMOS
.. doxygendefine:: Z80_MODEL_ZILOG_CMOS
.. doxygendefine:: Z80_REQUEST_SPECIAL_RESET
.. doxygendefine:: Z80_REQUEST_RESET
.. doxygendefine:: Z80_REQUEST_NMI
.. doxygendefine:: Z80_REQUEST_INT
.. doxygendefine:: Z80_RESUME_HALT
.. doxygendefine:: Z80_RESUME_XY
.. doxygendefine:: Z80_RESUME_IM0_XY
Callback Types
--------------
.. doxygentypedef:: Z80Read
.. doxygentypedef:: Z80Write
.. doxygentypedef:: Z80HALT
.. doxygentypedef:: Z80Notify
Objects
-------
.. doxygenstruct:: Z80
:members:
Functions
---------
.. doxygenfunction:: z80_in_offset
.. doxygenfunction:: z80_instant_reset
.. doxygenfunction:: z80_out_offset
.. doxygenfunction:: z80_execute
.. doxygenfunction:: z80_int
.. doxygenfunction:: z80_nmi
.. doxygenfunction:: z80_normal_reset
.. doxygenfunction:: z80_power
.. doxygenfunction:: z80_refresh_address
.. doxygenfunction:: z80_run
.. doxygenfunction:: z80_special_reset

View File

@@ -0,0 +1,100 @@
# Z80 - documentation/CMakeLists.txt
# ______ ______ ______
# /\___ \/\ __ \\ __ \
# \/__/ /\_\ __ \\ \/\ \
# /\_____\\_____\\_____\
# Zilog \/_____//_____//_____/ CPU Emulator
# Copyright (C) 1999-2022 Manuel Sainz de Baranda y Goñi.
# Released under the terms of the GNU Lesser General Public License v3.
find_package(Doxygen REQUIRED)
find_package(Sphinx REQUIRED)
find_package(Breathe REQUIRED)
set(DOXYGEN_INPUT_DIR "${PROJECT_SOURCE_DIR}/API" )
set(DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
set(DOXYGEN_XML_OUTPUT "API-XML" )
set(_doxyfile_in "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in")
set(_doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" )
get_target_property(DOXYGEN_INCLUDE_PATH Zeta INTERFACE_INCLUDE_DIRECTORIES)
configure_file(${_doxyfile_in} ${_doxyfile} @ONLY)
file(GLOB_RECURSE _public_headers ${DOXYGEN_INPUT_DIR}/*.h)
set(_api_xml_output "${DOXYGEN_OUTPUT_DIR}/${DOXYGEN_XML_OUTPUT}")
add_custom_command(
OUTPUT ${_api_xml_output}
DEPENDS ${_public_headers}
COMMAND ${DOXYGEN_EXECUTABLE} ${_doxyfile}
MAIN_DEPENDENCY ${_doxyfile}
COMMENT "Extracting API reference")
add_custom_target(API-XML ALL DEPENDS ${_api_xml_output})
if(${PROJECT_NAME}_WITH_HTML_DOCUMENTATION)
set(_html_documentation_output "${CMAKE_CURRENT_BINARY_DIR}/HTML")
if(${PROJECT_NAME}_SPHINX_HTML_THEME STREQUAL "")
set(_html_theme_option "")
else()
set(_html_theme_option "-Dhtml_theme=${${PROJECT_NAME}_SPHINX_HTML_THEME}")
endif()
add_custom_command(
OUTPUT ${_html_documentation_output}
COMMAND ${SPHINX_BUILD_EXECUTABLE}
-b html
${_html_theme_option}
"-Dbreathe_projects.${PROJECT_NAME}=${_api_xml_output}"
${CMAKE_CURRENT_SOURCE_DIR}
${_html_documentation_output}
MAIN_DEPENDENCY ${_api_xml_output}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating documentation in HTML format")
add_custom_target(Documentation-HTML ALL DEPENDS ${_html_documentation_output})
add_dependencies(Documentation-HTML API-XML)
install(DIRECTORY "${_html_documentation_output}/"
DESTINATION "${CMAKE_INSTALL_DOCDIR}/documentation")
endif()
if(${PROJECT_NAME}_WITH_PDF_DOCUMENTATION)
find_package(LATEX REQUIRED COMPONENTS PDFLATEX)
set(_latex_documentation_output "${CMAKE_CURRENT_BINARY_DIR}/LaTeX")
add_custom_command(
OUTPUT ${_latex_documentation_output}
COMMAND ${SPHINX_BUILD_EXECUTABLE}
-b latex
"-Dbreathe_projects.${PROJECT_NAME}=${_api_xml_output}"
${CMAKE_CURRENT_SOURCE_DIR}
${_latex_documentation_output}
MAIN_DEPENDENCY ${_api_xml_output}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating documentation in LaTeX format")
add_custom_target(Documentation-LaTeX ALL DEPENDS ${_latex_documentation_output})
add_dependencies(Documentation-LaTeX API-XML)
string(TOLOWER ${PROJECT_NAME} _pdf_documentation_output)
set(_pdf_documentation_output "${_latex_documentation_output}/${_pdf_documentation_output}.pdf")
add_custom_command(
OUTPUT ${_pdf_documentation_output}
COMMAND make
MAIN_DEPENDENCY ${_latex_documentation_output}
WORKING_DIRECTORY ${_latex_documentation_output}
COMMENT "Converting documentation to PDF format")
add_custom_target(Documentation-PDF ALL DEPENDS ${_pdf_documentation_output})
add_dependencies(Documentation-PDF Documentation-LaTeX)
install(FILES ${_pdf_documentation_output}
DESTINATION ${CMAKE_INSTALL_DOCDIR}
RENAME "${PROJECT_NAME} v${PROJECT_VERSION}.pdf")
endif()
# documentation/CMakeLists.txt EOF

376
documentation/Doxyfile.in Normal file
View File

@@ -0,0 +1,376 @@
# Doxyfile 1.8.15
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "@PROJECT_NAME@"
PROJECT_NUMBER =
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = "@DOXYGEN_OUTPUT_DIR@"
CREATE_SUBDIRS = NO
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
OUTPUT_TEXT_DIRECTION = None
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = "@DOXYGEN_INPUT_DIR@"
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES = "overline="
TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
OPTIMIZE_OUTPUT_SLICE = NO
EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
TOC_INCLUDE_HEADINGS = 0
AUTOLINK_SUPPORT = NO
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
GROUP_NESTED_COMPOUNDS = NO
SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = YES
EXTRACT_PACKAGE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = NO
HIDE_COMPOUND_REFERENCE= NO
SHOW_INCLUDE_FILES = YES
SHOW_GROUPED_MEMB_INC = NO
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_MEMBERS_CTORS_1ST = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_AS_ERROR = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = "@DOXYGEN_INPUT_DIR@"
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
SOURCE_TOOLTIPS = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = NO
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET =
HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = NO
HTML_DYNAMIC_MENUS = YES
HTML_DYNAMIC_SECTIONS = NO
HTML_INDEX_NUM_ENTRIES = 100
GENERATE_DOCSET = YES
DOCSET_FEEDNAME = "Zilog Z80 CPU Emulator"
DOCSET_BUNDLE_ID = com.redcode.Z80
DOCSET_PUBLISHER_ID = com.redcode
DOCSET_PUBLISHER_NAME = "Manuel Sainz de Baranda y Goñi"
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
GENERATE_TREEVIEW = NO
ENUM_VALUES_PER_LINE = 4
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/
MATHJAX_EXTENSIONS =
MATHJAX_CODEFILE =
SEARCHENGINE = YES
SERVER_BASED_SEARCH = NO
EXTERNAL_SEARCH = NO
SEARCHENGINE_URL =
SEARCHDATA_FILE = searchdata.xml
EXTERNAL_SEARCH_ID =
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME =
MAKEINDEX_CMD_NAME = makeindex
LATEX_MAKEINDEX_CMD = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
LATEX_EXTRA_STYLESHEET =
LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
LATEX_TIMESTAMP = NO
LATEX_EMOJI_DIRECTORY =
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_SUBDIR =
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = YES
XML_OUTPUT = "@DOXYGEN_XML_OUTPUT@"
XML_PROGRAMLISTING = YES
XML_NS_MEMB_FILE_SCOPE = NO
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH = "@DOXYGEN_INCLUDE_PATH@"
INCLUDE_FILE_PATTERNS =
PREDEFINED = Z80_API=
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = NO
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
DIA_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
UML_LIMIT_NUM_FIELDS = 10
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
INTERACTIVE_SVG = NO
DOT_PATH =
DOTFILE_DIRS =
MSCFILE_DIRS =
DIAFILE_DIRS =
PLANTUML_JAR_PATH =
PLANTUML_CFG_FILE =
PLANTUML_INCLUDE_PATH =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES

View File

@@ -0,0 +1,3 @@
==================
Emulation accuracy
==================

View File

@@ -0,0 +1,170 @@
============
Installation
============
.. only:: html
.. |br| raw:: html
<br />
.. only:: latex
.. |nl| raw:: latex
\newline
You will need `CMake <https://cmake.org>`_ v3.14 or later to build the package and, optionally, recent versions of `Doxygen <https://www.doxygen.nl>`_, `Sphinx <https://www.sphinx-doc.org>`_ and `Breathe <https://github.com/michaeljones/breathe>`_ to compile the documentation. Also make sure you have `LaTeX <https://www.latex-project.org>`_ with PDF support installed on your system in case you want to generate the documentation in PDF format.
The emulator requires some types and macros included in `Zeta <https://zeta.st>`_, a dependency-free, `header-only <https://en.wikipedia.org/wiki/Header-only>`_ library used to retain compatibility with most C compilers. Install Zeta or extract its official source code package to the directory of the Z80 project or its parent directory. Zeta is the sole dependency; the emulator is a freestanding implementation and as such does not depend on the
`C standard library <https://en.wikipedia.org/wiki/C_standard_library>`_.
Once all requirements are met, create a directory and run ``cmake`` from there to prepare the build system:
.. code-block:: sh
mkdir build
cd build
cmake <path to the Z80 project> [options]
The resulting build files can be configured by passing options to ``cmake``. To show a complete list of those available along with their current settings, type the following:
.. code-block:: sh
cmake -LAH
If in doubt, read the `CMake documentation <https://cmake.org/documentation/>`_ for more information on configuration options. The following are some of the most relevant standard options of CMake:
.. option:: -DBUILD_SHARED_LIBS=(YES|NO)
Build the project as a shared library rather than a static one. |br| |nl|
The default is ``NO``.
.. option:: -DCMAKE_BUILD_TYPE=(Debug|Release|RelWithDebInfo)
Choose the type of build (configuration) to generate. |br| |nl|
The default is ``Release``.
.. option:: -DCMAKE_INSTALL_PREFIX="<path>"
Specify the installation prefix on `UNIX <https://en.wikipedia.org/wiki/Unix>`_ and `UNIX-like <https://en.wikipedia.org/wiki/Unix-like>`_ operating systems. |br| |nl|
The default is ``"/usr/local"``.
Package-specific options are prefixed with ``Z80_`` and can be divided into two groups. The first one controls aspects not related to the source code of the library:
.. option:: -DZ80_DOWNLOAD_TEST_FILES=(YES|NO)
Download the firmware and software used by the testing tool. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_INSTALL_CMAKEDIR="<path>"
Specify the directory in which to install the CMake `config-file package <https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#config-file-packages>`_. |br| |nl|
The default is ``"${CMAKE_INSTALL_LIBDIR}/cmake/Z80"``.
.. option:: -DZ80_INSTALL_PKGCONFIGDIR="<path>"
Specify the directory in which to install the `pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config>`_ `file <https://people.freedesktop.org/~dbn/pkg-config-guide.html>`_. |br| |nl|
The default is ``"${CMAKE_INSTALL_LIBDIR}/pkgconfig"``.
.. option:: -DZ80_NOSTDLIB_FLAGS=(Auto|[<flag>[;<flag>...]])
Specify the linker flags used to avoid linking against system libraries. |br| |nl|
The default is ``Auto`` (autoconfigure flags). If you get linker errors, set this option to ``""``.
.. option:: -DZ80_SHARED_LIBS=(YES|NO)
Build the project as a shared library rather than a static one. |br| |nl|
This option takes precedence over ``BUILD_SHARED_LIBS``. |br| |nl|
Not defined by default.
.. option:: -DZ80_SPHINX_HTML_THEME="[<name>]"
Specify the Sphinx theme for the documentation in HTML format. |br| |nl|
The default is ``""`` (use the default theme).
.. option:: -DZ80_WITH_CMAKE_SUPPORT=(YES|NO)
Generate and install the CMake `config-file package <https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#config-file-packages>`_. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_HTML_DOCUMENTATION=(YES|NO)
Build and install the documentation in HTML format. |br| |nl|
It requires Doxygen, Sphinx and Breathe. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_PDF_DOCUMENTATION=(YES|NO)
Build and install the documentation in PDF format. |br| |nl|
It requires Doxygen, Sphinx, Breathe and LaTeX with PDF support. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_PKGCONFIG_SUPPORT=(YES|NO)
Generate and install the `pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config>`_ `file <https://people.freedesktop.org/~dbn/pkg-config-guide.html>`_. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_STANDARD_DOCUMENTS=(YES|NO)
Install the standard text documents distributed with the package: ``AUTHORS``, ``COPYING``, ``COPYING.LESSER``, ``HISTORY``, ``README`` and ``THANKS``. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_TESTS=(YES|NO)
Build the testing tool. |br| |nl|
The default is ``NO``.
The second group of package-specific options configures the source code of the library by predefining macros that enable optional implementations:
.. option:: -DZ80_WITH_EXECUTE=(YES|NO)
Build the implementation of the ``z80_execute`` function. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_FULL_IM0=(YES|NO)
Build the full implementation of the interrupt mode 0 rather than the reduced one. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_Q=(YES|NO)
Build the implementation of the `Q "register" <https://worldofspectrum.org/forums/discussion/41704>`_. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_RESET_SIGNAL=(YES|NO)
Build the implementation of the normal RESET signal. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_SPECIAL_RESET_SIGNAL=(YES|NO)
Build the implementation of the `special RESET <http://www.primrosebank.net/computers/z80/z80_special_reset.htm>`_ signal. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_UNOFFICIAL_RETI=(YES|NO)
Configure the ``ED5Dh``, ``ED6Dh`` and ``ED7Dh`` undocumented instructions as ``reti`` instead of ``retn``. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=(YES|NO)
Build the implementation of the bug affecting the Zilog Z80 NMOS, which causes the P/V flag to be reset when a maskable interrupt is accepted during the execution of the ``ld a,{i|r}`` instructions. |br| |nl|
The default is ``NO``.
Package maintainers should use at least the following options for both shared and static library targets:
.. code-block:: sh
-DZ80_WITH_EXECUTE=YES
-DZ80_WITH_FULL_IM0=YES
-DZ80_WITH_Q=YES
-DZ80_WITH_RESET_SIGNAL=YES
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=YES
Finally, once the build system is configured according to your needs, build and install the package:
.. code-block:: sh
make
make install/strip

View File

@@ -0,0 +1,82 @@
===========
Integration
===========
.. only:: html
.. |br| raw:: html
<br />
.. only:: latex
.. |nl| raw:: latex
\newline
As an external dependency in CMake-based projects
-------------------------------------------------
The Z80 library includes find-modules and a config-file package for integration into CMake-based projects. It is recommended to always copy the ``FindZ80.cmake`` and ``FindZeta.cmake`` files into the CMake modules directory of projects that use the library as an external dependency. This will allow CMake to find the library if the necessary config-file packages are not installed on the system.
Both the config-file package and the find-module support dual installations of the shared and static versions of the Z80 library. You can specify the linking method by using the component mechanism of ``find_package``.
Example:
.. code-block:: cmake
find_package(Z80 REQUIRED [Shared|Static])
target_link_libraries(your-target Z80)
Omitting the linking method will select the ``Shared`` version of the library or, if not installed, the ``Static`` version instead.
As a CMake subproject
---------------------
To embed the library as a CMake subproject, just place its entire source tree into a subdirectory of your project.
It is advisable to configure the library in the ``CMakeLists.txt`` of your project. This will prevent the user from having to specify configuration options of the Z80 subproject through the CMake command line when building the main project. As noted in the Installation section of this document, all package-specific options are prefixed with ``Z80_``, so, in a normal scenario, there should be no risk of name collision with the options and variables of the parent project.
Example:
.. code-block:: cmake
set(Z80_SHARED_LIBS NO CACHE BOOL "")
set(Z80_WITH_Q YES CACHE BOOL "")
set(Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG YES CACHE BOOL "")
add_subdirectory(dependencies/Z80)
target_link_libraries(your-target Z80)
It is important to set the ``Z80_SHARED_LIBS`` option. Otherwise CMake will build the library type indicated by ``BUILD_SHARED_LIBS``, which may not be the desired one.
Manual integration
------------------
There are several macros that can be used to configure the source code of the library. You can define those you need in your build system or at the beginning of the ``Z80.c`` file. The following ones allow you to configure the integration of ``Z80.h`` and ``Z80.c`` into the project:
.. c:macro:: Z80_DEPENDENCIES_HEADER
Specifies the only external header to ``#include``, replacing those of Zeta. |br| |nl|
If used, it must also be defined before including the ``Z80.h`` header.
.. c:macro:: Z80_STATIC
Needed for compiling and/or using the emulator as a static library or as an internal part of other project. |br| |nl|
If used, it must also be defined before including the ``Z80.h`` header.
.. c:macro:: Z80_WITH_LOCAL_HEADER
Tells ``Z80.c`` to ``#include Z80.h`` instead of ``<Z80.h>``.
The second group of package-specific options, explained in the "Installation" section of this document, activates various optional implementations in the source code by predefining the following macros:
.. c:macro:: Z80_WITH_EXECUTE
.. c:macro:: Z80_WITH_FULL_IM0
.. c:macro:: Z80_WITH_Q
.. c:macro:: Z80_WITH_RESET_SIGNAL
.. c:macro:: Z80_WITH_SPECIAL_RESET_SIGNAL
.. c:macro:: Z80_WITH_UNOFFICIAL_RETI
.. c:macro:: Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG
Except for ``Z80_DEPENDENCIES_HEADER``, the above macros do not need to be set to a particular token when used, as the source code only checks whether or not they are defined.

View File

@@ -0,0 +1,9 @@
=======
License
=======
This emulator is `free software <https://www.gnu.org/philosophy/free-sw.html>`_: you can redistribute it and/or modify it under the terms of the `GNU Lesser General Public License <https://www.gnu.org/licenses/lgpl-3.0.en.html>`_ as published by the `Free Software Foundation <https://www.fsf.org>`_, either version 3 of the License, or (at your option) any later version.
This emulator is distributed in the hope that it will be useful, but **WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE**. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this emulator. If not, see <https://www.gnu.org/licenses/>.

20
documentation/Makefile Normal file
View File

@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

2
documentation/TODO.txt Normal file
View File

@@ -0,0 +1,2 @@
ST CMOS Z80 no se comporta igual en los flags de las instrucciones de bloque?
https://stardot.org.uk/forums/viewtopic.php?p=212100#p212100

View File

@@ -0,0 +1,3 @@
=======
Testing
=======

214
documentation/Thanks.rst Normal file
View File

@@ -0,0 +1,214 @@
======
Thanks
======
Many thanks to the following individuals (in alphabetical order):
Akimov, Vadim (lvd)
For testing the library on many different platforms and CPU architectures.
azesmbog
1. For validating tests on real hardware [1].
2. For his research on the unstable flag behavior of the "ccf/scf" instructions.
3. For his invaluable help.
Banks, David (hoglet)
1. For cracking the flag behavior of the block instructions [2,3].
2. For his research on the flag behavior of the "ccf/scf" instructions [3].
Beliansky, Anatoly (Tolik_Trek)
For validating tests on real hardware [4].
Bobrowski, Jan
For fixing the "Z80 Full Instruction Set Exerciser for Spectrum" [5].
boo_boo
For cracking the behavior of the MEMPTR register [6,7,8,9].
Brady, Stuart
For his research on the flag behavior of the "ccf/scf" instructions [10].
Brewer, Tony
1. For his research on the special RESET [11].
2. For sharing information about the RESET signal [12].
3. For helping to crack the flag behavior of the block instructions [2].
4. For performing low-level tests on real hardware [2].
5. For helping me to test different undocumented behaviors of the Zilog Z80.
Bystrov, Dmitry (Alone Coder)
For validating tests on real hardware [4].
Chunin, Roman (CHRV)
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
Conway, Simon (BadBeard)
For validating the "Z80 Test Suite" on several Z80 clones [13].
Cooke, Simon
For finding out how the "out (c),0" instruction behaves on the Zilog Z80 CMOS [14].
Cringle, Frank D.
For writing the "Z80 Instruction Set Exerciser" [15].
Devic, Goran
For his research on undocumented behaviors of the Z80 CPU [16].
Flammenkamp, Achim
For his article on Z80 interrupts [17].
Gimeno Fortea, Pedro
1. For his research work [18].
2. For writing the first-ever ZX Spectrum emulator [19,20].
goodboy
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
Greenway, Ian
For testing the flag behavior of the "ccf/scf" instructions on real hardware [10,21].
Harston, Jonathan Graham
1. For his technical documents about the Zilog Z80 [22,23,24].
2. For porting the "Z80 Instruction Set Exerciser" to the ZX Spectrum [25].
Helcmanovsky, Peter (Ped7g)
1. For helping me to write the "IN-MEMPTR" test.
2. For writing the "Z80 Block Flags Test" [26,27].
3. For writing the "Z80 CCF SCF Outcome Stability" test [27].
4. For writing the "Z80 INT Skip" test [27].
5. For his research on the unstable flag behavior of the "ccf/scf" instructions.
6. For his invaluable help.
icebear
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
Kladov, Vladimir
For cracking the behavior of the MEMPTR register [6,7,8,9].
Krook, Magnus
For validating tests on real hardware [28].
London, Matthew
For validating tests on real hardware.
Molodtsov, Aleksandr
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
Nair, Arjun
For validating tests on real hardware [26].
Nicolás-González, César
For helping me to research the unstable flag behavior of the "ccf/scf" instructions.
Ortega Sosa, Sofía
For her support.
Owen, Simon
For the idea of the hooking method used in this emulator.
Rak, Patrik
1. For improving the "Z80 Instruction Set Exerciser for Spectrum" [29].
2. For cracking the flag behavior of the "ccf/scf" instructions [13,29].
3. For writing the "Zilog Z80 CPU Test Suite" [29,30].
4. For his research on the unstable flag behavior of the "ccf/scf" instructions.
Rodríguez Jódar, Miguel Ángel (mcleod_ideafix)
For his reseach on the state of the registers after POWER/RESET [31].
Rodríguez Palomino, Mario (r-lyeh)
For teaching me how emulators work.
Sainz de Baranda y Romero, Manuel
For teaching me programming and giving me my first computer.
Sánchez Ordiñana, José Ismael (Vaporatorius)
For validating tests on real hardware [32,33].
Stevenson, Dave
1. For testing the special RESET on real hardware [11].
2. For performing low-level tests on real hardware [34].
Weissflog, Andre (Floh)
1. For finding out that the "reti/retn" instructions defer the acceptance of the maskable interrupt [35].
2. For writing the "Visual Z80 Remix" simulator [36].
Wilkinson, Oli (evolutional)
For validating tests on real hardware [26].
Wlodek
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
Woodmass, Mark (Woody)
1. For his invaluable contributions to the emuscene.
2. For writing the "Z80 Test Suite" [13].
3. For his research on the flag behavior of the "ccf/scf" instructions [37].
4. For writing the "HALT2INT" test.
5. For writing the "EIHALT" test.
Young, Sean
1. For his research work.
2. For his technical documents about the Zilog Z80 [18,38].
ZXGuesser
For validating tests on real hardware.
References
==========
1. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83384#p83384
2. https://stardot.org.uk/forums/viewtopic.php?t=15464
* https://stardot.org.uk/forums/viewtopic.php?p=211042#p211042
* https://stardot.org.uk/forums/viewtopic.php?p=212021#p212021
3. Banks, David (2018-08-21). "Undocumented Z80 Flags".
* https://github.com/hoglet67/Z80Decoder/wiki/Undocumented-Flags
* https://stardot.org.uk/forums/download/file.php?id=39831
4. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83041#p83041
5. http://wizard.ae.krakow.pl/~jb/qaop/tests.html
6. https://zxpress.ru/zxnet/zxnet.pc/5909
7. https://zx-pk.ru/threads/2506-komanda-bit-n-(hl).html
8. https://zx-pk.ru/threads/2586-prosba-realshchikam-ot-emulyatorshchikov.html
9. boo_boo; Kladov, Vladimir (2006-03-29). "MEMPTR: esoteric register of the Zilog Z80 CPU".
* http://zx.pk.ru/showpost.php?p=43688
* http://zx.pk.ru/attachment.php?attachmentid=2984
* http://zx.pk.ru/showpost.php?p=43800
* http://zx.pk.ru/attachment.php?attachmentid=2989
10. https://sourceforge.net/p/fuse-emulator/mailman/message/6929573
11. Brewer, Tony (2014-12). "Z80 Special Reset".
* http://primrosebank.net/computers/z80/z80_special_reset.htm
12. https://mtxworld.dk/memorum/viewtopic.php?p=1352#p1352
13. https://worldofspectrum.org/forums/discussion/20345
14. https://groups.google.com/g/comp.os.cpm/c/HfSTFpaIkuU/m/KotvMWu3bZoJ
15. Cringle, Frank D. (1998-01-28). "Yaze - Yet Another Z80 Emulator" v1.10.
* ftp://ftp.ping.de/pub/misc/emulators/yaze-1.10.tar.gz
16. https://baltazarstudios.com/zilog-z80-undocumented-behavior
17. Flammenkamp, Achim. "Interrupt Behaviour of the Z80 CPU".
* http://z80.info/interrup.htm
18. Young, Sean (1998-10). "Z80 Undocumented Features (in Software Behaviour)".
19. https://elmundodelspectrum.com/desenterrando-el-primer-emulador-de-spectrum
20. https://elmundodelspectrum.com/con-vosotros-el-emulador-de-pedro-gimeno-1989
21. https://sourceforge.net/p/fuse-emulator/mailman/message/4502844
22. Harston, Jonathan Graham (1997-09-09). "Z80 Opcode Map".
* https://mdfs.net/Docs/Comp/Z80/OpCodeMap
23. Harston, Jonathan Graham (1997-12-18). "Z80 Microprocessor Undocumented Instructions".
* https://mdfs.net/Docs/Comp/Z80/UnDocOps
24. Harston, Jonathan Graham (1998-04-15). "Full Z80 Opcode List Including Undocumented Opcodes".
* https://mdfs.net/Docs/Comp/Z80/OpList
25. https://mdfs.net/Software/Z80/Exerciser/Spectrum
26. https://spectrumcomputing.co.uk/forums/viewtopic.php?t=6102
27. https://github.com/MrKWatkins/ZXSpectrumNextTests
28. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83157#p83157
29. https://worldofspectrum.org/forums/discussion/41704
* http://zxds.raxoft.cz/taps/misc/zexall2.zip
30. https://worldofspectrum.org/forums/discussion/41834
* http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip
* https://github.com/raxoft/z80test
31. https://worldofspectrum.org/forums/discussion/34574
32. https://worldofspectrum.org/forums/discussion/comment/668760/#Comment_668760
33. https://jisanchez.com/test-a-dos-placas-de-zx-spectrum
34. https://stardot.org.uk/forums/viewtopic.php?p=212360#p212360
35. https://floooh.github.io/2021/12/17/cycle-stepped-z80.html
36. https://github.com/floooh/v6502r
37. http://groups.google.co.uk/group/comp.sys.sinclair/msg/56dd1fd4ccb5fb3b
38. Young, Sean (2005-09-18). "Undocumented Z80 Documented, The".
* http://www.myquest.nl/z80undocumented
* http://www.myquest.nl/z80undocumented/z80-documented-v0.91.pdf

View File

@@ -0,0 +1,71 @@
===============
Version History
===============
v0.2 (2022-XX-XX)
=================
This is an important update that addresses a number of issues and also includes new features. Please note that the changes introduced in this release break the binary compatibility with the previous version.
Changes:
1. Changed the license from GPL to LGPL (by popular request).
2. Moved the public header from ``<emulation/CPU/Z80.h>`` to ``<Z80.h>``.
3. Removed the Xcode project.
4. Switched the build system from Premake to CMake.
5. Switched to Zeta v0.1.
6. Added pkg-config support.
7. Added the ``.vimrc`` dotfile.
8. Added the ``CITATION.cff`` file.
9. Added the ``file_id.diz`` file.
10. Added the ``THANKS`` file.
11. Added detailed documentation.
12. Added tests.
13. Added public macros for checking the library version.
14. Added public macros with bit masks for working with flags.
15. Added public macros for accessing the 16-bit registers.
16. Added the ``z80_execute`` function to run a simplified emulation without RESET and interrupts.
17. Added the ``z80_refresh_address`` function to get the refresh address of the current M1 cycle.
18. Added the ``z80_in_cycle`` and ``z80_out_cycle`` functions to get the clock cycle on which the I/O M-cycle occurs, relative to the start of the instruction.
19. Fixed a bug in the ``sll`` instruction.
20. Fixed a bug in the ``INX`` and ``OUTX`` macros affecting the S and N flags.
21. Fixed a bug in the ``OUTX`` macro affecting the MSByte of the port number.
22. Fixed the clock cycles of the ``dec XY`` and ``in (c)`` instructions.
23. Fixed the ``read_16`` function so that the order in which the compiler evaluates expressions does not affect the order of the memory read operations.
24. Fixed the order in which the memory write operations are performed when the SP register is involved. This affects the NMI response, the INT response in modes 1 and 2, and the following instructions: ``ex (sp),{hl|XY}``, ``push TT``, ``push XY``, ``call WORD``, ``call Z,WORD`` and ``rst N``.
25. Fixed the handling of illegal instructions to avoid stack overflows in long sequences of ``DDh`` / ``FDh`` prefixes.
26. Fixed several implicit conversions to avoid warnings about loss of sign and precision.
27. Fixed some bitwise operations to avoid undefined behavior and arithmetic right shifts on signed integers.
28. Fixed violations of the C standard in several identifiers.
29. Renamed the 8-bit register lists: ``X/Y`` to ``J/K``; ``J/K`` and ``P/Q`` to ``O/P``.
30. Replaced all P/V overflow computation functions with a single, faster macro.
31. Replaced all register resolution functions with macros.
32. Replaced all ``ld {J,K|O,P}`` instructions that have the same destination and source register with NOPs.
33. Reimplemented the HALT state. The emulation should now be fully accurate. HALTskip is also supported.
34. Added optional emulation of the normal and special RESET signals, along with the new ``z80_reset`` and ``z80_special_reset`` functions to emit them. The old ``z80_reset`` function is now called ``z80_instant_reset``.
35. Added emulation of the NMI acknowledge M-cycle through the new ``Z80::nmia`` callback.
36. Added emulation of the INT acknowledge M-cycle through the new ``Z80::inta`` callback, which replaces ``Z80::int_data``.
37. Added optional full emulation of the interrupt mode 0, along with the new ``Z80::int_fetch`` callback to perform bus read operations on instruction data. If not enabled at compile-time, the old simplified emulation is built, which supports only the most typical instructions.
38. Added accurate flag behavior in the following instructions: ``ldir``, ``lddr``, ``cpir``, ``cpdr``, ``inir``, ``indr``, ``otir`` and ``otdr``.
39. Added emulation of the interrupt acceptance deferral that occurs during the ``reti`` and ``retn`` instructions.
40. Added MEMPTR emulation. The ``bit N,(hl)`` instruction now produces a correct value of F.
41. Added optional emulation of the Q "register". If enabled at compile-time, the ``ccf`` and ``scf`` instructions produce a correct value of F.
42. Added emulation options that can be configured at runtime.
43. Added emulation of the ``out (c),255`` instruction (Zilog Z80 CMOS).
44. Added optional emulation of the bug affecting the ``ld a,{i|r}`` instructions (Zilog Z80 NMOS). If enabled at compile-time, the P/V flag is reset when an INT is accepted during the execution of these instructions.
45. Added the ``Z80::fetch_opcode`` and ``Z80::fetch`` callbacks to perform opcode fetch operations and memory read operations on instruction data respectively.
46. Added hooking functionality through the ``ld h,h`` instruction and the new ``Z80::hook`` callback.
47. Added the ``Z80::nop`` callback to perform disregarded opcode fetch operations during internal NOP M-cycles.
48. Added four callbacks to notify the execution of important instructions: ``Z80::ld_i_a``, ``Z80::ld_r_a``, ``Z80::reti`` and ``Z80::retn``.
49. Removed ``Z80::state``. Replaced with individual members for the registers, the interrupt enable flip-flops and the interrupt mode.
50. Removed the superfluous EI flag. The previous opcode is checked instead, which is faster and makes the ``Z80`` object smaller.
51. Removed all module-related stuff.
52. Optimizations in flag computation and condition evaluation.
53. New source code comments and improvements to existing ones.
54. Improved code aesthetics.
55. Other improvements, optimizations and minor changes.
v0.1 (2018-11-10)
=================
Initial public release.

55
documentation/conf.py Normal file
View File

@@ -0,0 +1,55 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'Z80'
copyright = '1999-2022 Manuel Sainz de Baranda y Goñi'
author = 'Manuel Sainz de Baranda y Goñi'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['breathe']
# Breathe Configuration.
breathe_default_project = 'Z80'
breathe_domain_by_extension = {"h": "c"}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'haiku'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

27
documentation/index.rst Normal file
View File

@@ -0,0 +1,27 @@
.. Z80 documentation master file, created by
sphinx-quickstart on Wed Feb 24 06:49:20 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Zilog Z80 CPU Emulator
======================
.. toctree::
:maxdepth: 2
:caption: Contents:
EmulationAccuracy
Installation
Integration
APIReference
Testing
Thanks
VersionHistory
License
Indices and tables
==================
* :ref:`genindex`
* :ref:`search`

35
documentation/make.bat Normal file
View File

@@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd