Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55c6fdd3da | ||
|
|
5bbb3bcf5f | ||
|
|
516426a8c7 | ||
|
|
0ae9764e77 | ||
|
|
32ac09c92e | ||
|
|
6753eec367 | ||
|
|
8ef9652935 | ||
|
|
c0b9a6a5af | ||
|
|
113b836c91 | ||
|
|
2b89372f29 | ||
|
|
2094666e6b | ||
|
|
665b494bd2 |
18
README.ja.md
vendored
18
README.ja.md
vendored
@@ -317,3 +317,21 @@ picoZ80/pico6502 のハードウェア設計、ファームウェア、および
|
||||
**picoZ80**、**pico6502**、**engineers@work** の名称は Philip Smart の商標です。帰属表示、商標、および盗用防止の条項の詳細は [NOTICE](NOTICE) ファイルをご覧ください。
|
||||
|
||||
ライセンス全文: [LICENSE](LICENSE) | [LICENSE-HARDWARE.txt](LICENSE-HARDWARE.txt) | [LICENSE-SOFTWARE.txt](LICENSE-SOFTWARE.txt)
|
||||
|
||||
---
|
||||
|
||||
## 無線規制に関する注意事項
|
||||
|
||||
**本デバイスは 2.4 GHz ISM バンドで送信する ESP32-S3-PICO-1 無線モジュールを搭載しており、世界各国の無線周波数規制(米国の FCC Part 15 Subpart C、欧州連合の無線機器指令 2014/53/EU を含む)において意図的放射器に該当します。**
|
||||
|
||||
ESP32-S3-PICO-1 モジュール自体は既存の規制認証(FCC、CE など)を取得していますが、そのモジュールレベルの認証は、**モジュールを組み込んだ完成品に自動的に適用されるものではありません**。事前認証モジュールの免除規定は、**個人の趣味愛好家**が**個人使用、実験、または教育目的**で少数のデバイスを製作する場合に、個別の機器認可を取得せずに行うことを許可するものです。
|
||||
|
||||
### 重要な制限事項
|
||||
|
||||
- 組み立てられたデバイスは、完成品が独自にテストされ、該当する管轄区域で機器認可(例:FCC ID、認定機関による CE マーキング評価)を取得しない限り、**第三者への販売、販売の申し出、贈与、またはその他の方法での配布を行ってはなりません**。
|
||||
- 個人使用のために少数を製作することは、趣味愛好家および実験使用の規定(例:FCC §15.23)に基づき、デバイスが有害な干渉を引き起こさない限り、一般的に許可されています。
|
||||
- 規制要件は国によって異なります。米国外の製作者は、適用される規則について自国の無線周波数当局に確認してください。
|
||||
|
||||
### 製作者の責任
|
||||
|
||||
本設計に基づいて製作されたデバイスが、管轄区域内の適用されるすべての無線周波数規制に準拠することは、製作者の単独の責任です。著者は本設計を個人使用、教育、および趣味愛好家向けに提供しており、本設計から製作されたデバイスが商業的配布の規制要件を満たすことについて、いかなる表明も行いません。
|
||||
|
||||
18
README.md
vendored
18
README.md
vendored
@@ -317,3 +317,21 @@ The firmware and software are open-source under the GPL v3. The hardware designs
|
||||
The names **picoZ80**, **pico6502**, and **engineers@work** are trademarks of Philip Smart. See the [NOTICE](NOTICE) file for full attribution, trademark, and anti-passing-off terms.
|
||||
|
||||
Full licence texts: [LICENSE](LICENSE) | [LICENSE-HARDWARE.txt](LICENSE-HARDWARE.txt) | [LICENSE-SOFTWARE.txt](LICENSE-SOFTWARE.txt)
|
||||
|
||||
---
|
||||
|
||||
## Wireless Regulatory Notice
|
||||
|
||||
**This device incorporates an ESP32-S3-PICO-1 wireless module that transmits in the 2.4 GHz ISM band, making it an intentional radiator under radio-frequency regulations worldwide (including FCC Part 15 Subpart C in the United States, and the Radio Equipment Directive 2014/53/EU in the European Union).**
|
||||
|
||||
Although the ESP32-S3-PICO-1 module itself carries pre-existing regulatory certifications (FCC, CE, and others), those module-level certifications **do not automatically extend to a finished product** that incorporates the module. The pre-certified module exemption permits **individual hobbyists** to build a limited number of devices for **personal, experimental, or educational use** without obtaining separate equipment authorisation.
|
||||
|
||||
### Important Limitations
|
||||
|
||||
- Assembled devices **must not be sold, offered for sale, gifted, or otherwise distributed** to third parties unless the finished product has been independently tested and granted its own equipment authorisation (e.g. FCC ID, CE marking with a Notified Body assessment) in the relevant jurisdiction.
|
||||
- Building this project for personal use in limited quantities is generally permitted under hobbyist and experimental-use provisions (e.g. FCC §15.23), provided the device does not cause harmful interference.
|
||||
- Regulatory requirements vary by country. Builders outside the United States should consult their national radio-frequency authority for applicable rules.
|
||||
|
||||
### Builder's Responsibility
|
||||
|
||||
It is the builder's sole responsibility to ensure that any device constructed from these designs complies with all applicable radio-frequency regulations in their jurisdiction. The author provides these designs for personal, educational, and hobbyist use and makes no representation that a device built from them satisfies the regulatory requirements for commercial distribution.
|
||||
|
||||
15
WIRELESS.md
vendored
Normal file
15
WIRELESS.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Wireless Regulatory Notice
|
||||
|
||||
**This device incorporates an ESP32-S3-PICO-1 wireless module that transmits in the 2.4 GHz ISM band, making it an intentional radiator under radio-frequency regulations worldwide (including FCC Part 15 Subpart C in the United States, and the Radio Equipment Directive 2014/53/EU in the European Union).**
|
||||
|
||||
Although the ESP32-S3-PICO-1 module itself carries pre-existing regulatory certifications (FCC, CE, and others), those module-level certifications **do not automatically extend to a finished product** that incorporates the module. The pre-certified module exemption permits **individual hobbyists** to build a limited number of devices for **personal, experimental, or educational use** without obtaining separate equipment authorisation.
|
||||
|
||||
## Important Limitations
|
||||
|
||||
- Assembled devices **must not be sold, offered for sale, gifted, or otherwise distributed** to third parties unless the finished product has been independently tested and granted its own equipment authorisation (e.g. FCC ID, CE marking with a Notified Body assessment) in the relevant jurisdiction.
|
||||
- Building this project for personal use in limited quantities is generally permitted under hobbyist and experimental-use provisions (e.g. FCC §15.23), provided the device does not cause harmful interference.
|
||||
- Regulatory requirements vary by country. Builders outside the United States should consult their national radio-frequency authority for applicable rules.
|
||||
|
||||
## Builder's Responsibility
|
||||
|
||||
It is the builder's sole responsibility to ensure that any device constructed from these designs complies with all applicable radio-frequency regulations in their jurisdiction. The author provides these designs for personal, educational, and hobbyist use and makes no representation that a device built from them satisfies the regulatory requirements for commercial distribution.
|
||||
@@ -4,8 +4,8 @@ _Describe your pull request here._
|
||||
|
||||
### Legal notice _(do not delete)_
|
||||
|
||||
It is required that contributors assign copyright to the original author so that he retains full ownership of the project. This makes it easier for other entities to use the software because they only have to deal with one copyright holder. It also gives the original author assurance that he will be able to make decisions in the future without gathering and consulting all contributors.
|
||||
Contributors are required to assign copyright to the original author of the project so that he retains full ownership. This ensures that other entities can use the software more easily, as they only need to deal with a single copyright holder. It also provides the original author with the assurance that he can make decisions in the future without needing to consult or obtain consent from all contributors.
|
||||
|
||||
By submitting this PR, you agree to the following:
|
||||
By submitting this pull request (PR), you agree to the following:
|
||||
|
||||
> You hereby assign copyright in this PR's code to the original author of the Z80 library, Manuel Sainz de Baranda y Goñi, to be licensed under the same terms as the rest of the code. You agree to relinquish any and all copyright interest in the software, to the detriment of your heirs and successors.
|
||||
> You hereby assign the copyright in the code included in this pull request to the original author of the Z80 library, Manuel Sainz de Baranda y Goñi, to be licensed under the same terms as the rest of the code. You also agree to relinquish any and all copyright interest in the software, to the detriment of your heirs and successors.
|
||||
|
||||
@@ -6,8 +6,11 @@ on:
|
||||
- '.github/workflows/build-and-test-library.yml'
|
||||
- 'API/**'
|
||||
- 'CMake/FindZeta.cmake'
|
||||
- 'sources/*.c'
|
||||
- 'sources/*.rc.in'
|
||||
- 'sources/generate-daa-af-table.c'
|
||||
- 'sources/generate-pf-parity-table.c'
|
||||
- 'sources/test-Z80.c'
|
||||
- 'sources/Z80.c'
|
||||
- 'sources/Z80.rc.in'
|
||||
- 'support/*.sha3-512'
|
||||
- 'CMakeLists.txt'
|
||||
pull_request:
|
||||
@@ -15,8 +18,11 @@ on:
|
||||
- '.github/workflows/build-and-test-library.yml'
|
||||
- 'API/**'
|
||||
- 'CMake/FindZeta.cmake'
|
||||
- 'sources/*.c'
|
||||
- 'sources/*.rc.in'
|
||||
- 'sources/generate-daa-af-table.c'
|
||||
- 'sources/generate-pf-parity-table.c'
|
||||
- 'sources/test-Z80.c'
|
||||
- 'sources/Z80.c'
|
||||
- 'sources/Z80.rc.in'
|
||||
- 'support/*.sha3-512'
|
||||
- 'CMakeLists.txt'
|
||||
|
||||
@@ -26,15 +32,20 @@ env:
|
||||
CMAKE_BUILD_TYPE: Release
|
||||
Z80_FETCH_TEST_FILES: YES
|
||||
Z80_NOSTDLIB_FLAGS: Auto
|
||||
Z80_WITH_CMAKE_SUPPORT: NO
|
||||
Z80_OBJECT_LIBS: NO
|
||||
Z80_WITH_CMAKE_SUPPORT: YES
|
||||
Z80_WITH_CODE_GENERATION_TOOLS: YES
|
||||
Z80_WITH_HTML_DOCUMENTATION: NO
|
||||
Z80_WITH_PDF_DOCUMENTATION: NO
|
||||
Z80_WITH_PKGCONFIG_SUPPORT: NO
|
||||
Z80_WITH_PKGCONFIG_SUPPORT: YES
|
||||
Z80_WITH_STANDARD_DOCUMENTS: NO
|
||||
Z80_WITH_TESTS: YES
|
||||
Z80_WITH_STEP_TESTING_TOOL: NO
|
||||
Z80_WITH_TESTING_TOOL: YES
|
||||
Z80_WITH_EXECUTE: YES
|
||||
Z80_WITH_FULL_IM0: YES
|
||||
Z80_WITH_IM0_RETX_NOTIFICATIONS: YES
|
||||
Z80_WITH_PARITY_COMPUTATION: NO
|
||||
Z80_WITH_PRECOMPUTED_DAA: NO
|
||||
Z80_WITH_Q: YES
|
||||
Z80_WITH_SPECIAL_RESET: YES
|
||||
Z80_WITH_UNOFFICIAL_RETI: NO
|
||||
@@ -42,7 +53,7 @@ env:
|
||||
|
||||
jobs:
|
||||
build-and-test-library:
|
||||
runs-on: ${{matrix.os}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -54,42 +65,47 @@ jobs:
|
||||
- name: Install dependencies (POSIX)
|
||||
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
mkdir -p "${{github.workspace}}/build"
|
||||
curl -L "${{env.ZETA_TARBALL_URL}}" | xz -cd | tar -C "${{github.workspace}}/build" --strip-components=2 -xvf - Zeta/API/Z
|
||||
mkdir -p "${{ github.workspace }}/build"
|
||||
curl -L "${{ env.ZETA_TARBALL_URL }}" | xz -cd | tar -C "${{ github.workspace }}/build" --strip-components=2 -xf - Zeta/API/Z
|
||||
|
||||
- name: Install dependencies (Windows)
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
shell: cmd
|
||||
run: |
|
||||
mkdir "${{github.workspace}}\build"
|
||||
curl -L "${{env.ZETA_TARBALL_URL}}" | 7z x -txz -si -so | 7z x -si -ttar -o"${{github.workspace}}\build" Zeta/API/Z
|
||||
mkdir "${{ github.workspace }}\build"
|
||||
curl -L "${{ env.ZETA_TARBALL_URL }}" | 7z x -txz -si -so | 7z x -si -ttar -o"${{ github.workspace }}\build" Zeta/API/Z
|
||||
|
||||
- name: Configure CMake
|
||||
run: >-
|
||||
cmake
|
||||
-DBUILD_SHARED_LIBS=${{env.BUILD_SHARED_LIBS}}
|
||||
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}}
|
||||
-DZ80_FETCH_TEST_FILES=${{env.Z80_FETCH_TEST_FILES}}
|
||||
-DZ80_NOSTDLIB_FLAGS=${{env.Z80_NOSTDLIB_FLAGS}}
|
||||
-DZ80_WITH_CMAKE_SUPPORT=${{env.Z80_WITH_CMAKE_SUPPORT}}
|
||||
-DZ80_WITH_HTML_DOCUMENTATION=${{env.Z80_WITH_HTML_DOCUMENTATION}}
|
||||
-DZ80_WITH_PDF_DOCUMENTATION=${{env.Z80_WITH_PDF_DOCUMENTATION}}
|
||||
-DZ80_WITH_PKGCONFIG_SUPPORT=${{env.Z80_WITH_PKGCONFIG_SUPPORT}}
|
||||
-DZ80_WITH_STANDARD_DOCUMENTS=${{env.Z80_WITH_STANDARD_DOCUMENTS}}
|
||||
-DZ80_WITH_TESTS=${{env.Z80_WITH_TESTS}}
|
||||
-DZ80_WITH_EXECUTE=${{env.Z80_WITH_EXECUTE}}
|
||||
-DZ80_WITH_FULL_IM0=${{env.Z80_WITH_FULL_IM0}}
|
||||
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=${{env.Z80_WITH_IM0_RETX_NOTIFICATIONS}}
|
||||
-DZ80_WITH_Q=${{env.Z80_WITH_Q}}
|
||||
-DZ80_WITH_SPECIAL_RESET=${{env.Z80_WITH_SPECIAL_RESET}}
|
||||
-DZ80_WITH_UNOFFICIAL_RETI=${{env.Z80_WITH_UNOFFICIAL_RETI}}
|
||||
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=${{env.Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG}}
|
||||
-B "${{github.workspace}}/build"
|
||||
-S "${{github.workspace}}"
|
||||
-DBUILD_SHARED_LIBS=${{ env.BUILD_SHARED_LIBS }}
|
||||
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
|
||||
-DZ80_FETCH_TEST_FILES=${{ env.Z80_FETCH_TEST_FILES }}
|
||||
-DZ80_NOSTDLIB_FLAGS=${{ env.Z80_NOSTDLIB_FLAGS }}
|
||||
-DZ80_OBJECT_LIBS=${{ env.Z80_OBJECT_LIBS }}
|
||||
-DZ80_WITH_CMAKE_SUPPORT=${{ env.Z80_WITH_CMAKE_SUPPORT }}
|
||||
-DZ80_WITH_CODE_GENERATION_TOOLS=${{ env.Z80_WITH_CODE_GENERATION_TOOLS }}
|
||||
-DZ80_WITH_HTML_DOCUMENTATION=${{ env.Z80_WITH_HTML_DOCUMENTATION }}
|
||||
-DZ80_WITH_PDF_DOCUMENTATION=${{ env.Z80_WITH_PDF_DOCUMENTATION }}
|
||||
-DZ80_WITH_PKGCONFIG_SUPPORT=${{ env.Z80_WITH_PKGCONFIG_SUPPORT }}
|
||||
-DZ80_WITH_STANDARD_DOCUMENTS=${{ env.Z80_WITH_STANDARD_DOCUMENTS }}
|
||||
-DZ80_WITH_STEP_TESTING_TOOL=${{ env.Z80_WITH_STEP_TESTING_TOOL }}
|
||||
-DZ80_WITH_TESTING_TOOL=${{ env.Z80_WITH_TESTING_TOOL }}
|
||||
-DZ80_WITH_EXECUTE=${{ env.Z80_WITH_EXECUTE }}
|
||||
-DZ80_WITH_FULL_IM0=${{ env.Z80_WITH_FULL_IM0 }}
|
||||
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=${{ env.Z80_WITH_IM0_RETX_NOTIFICATIONS }}
|
||||
-DZ80_WITH_PARITY_COMPUTATION=${{ env.Z80_WITH_PARITY_COMPUTATION }}
|
||||
-DZ80_WITH_PRECOMPUTED_DAA=${{ env.Z80_WITH_PRECOMPUTED_DAA }}
|
||||
-DZ80_WITH_Q=${{ env.Z80_WITH_Q }}
|
||||
-DZ80_WITH_SPECIAL_RESET=${{ env.Z80_WITH_SPECIAL_RESET }}
|
||||
-DZ80_WITH_UNOFFICIAL_RETI=${{ env.Z80_WITH_UNOFFICIAL_RETI }}
|
||||
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=${{ env.Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG }}
|
||||
-B "${{ github.workspace }}/build"
|
||||
-S "${{ github.workspace }}"
|
||||
|
||||
- name: Build
|
||||
run: cmake --build "${{github.workspace}}/build" --config ${{env.CMAKE_BUILD_TYPE}} --verbose
|
||||
run: cmake --build "${{ github.workspace }}/build" --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: ctest --build-config ${{env.CMAKE_BUILD_TYPE}} --output-on-failure
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
run: ctest --build-config ${{ env.CMAKE_BUILD_TYPE }} --output-on-failure
|
||||
|
||||
@@ -22,11 +22,13 @@ env:
|
||||
CMAKE_BUILD_TYPE: Release
|
||||
Z80_FETCH_TEST_FILES: NO
|
||||
Z80_WITH_CMAKE_SUPPORT: NO
|
||||
Z80_WITH_CODE_GENERATION_TOOLS: NO
|
||||
Z80_WITH_HTML_DOCUMENTATION: YES
|
||||
Z80_WITH_PDF_DOCUMENTATION: YES
|
||||
Z80_WITH_PKGCONFIG_SUPPORT: NO
|
||||
Z80_WITH_STANDARD_DOCUMENTS: NO
|
||||
Z80_WITH_TESTS: NO
|
||||
Z80_WITH_STEP_TESTING_TOOL: NO
|
||||
Z80_WITH_TESTING_TOOL: NO
|
||||
|
||||
jobs:
|
||||
build-documentation:
|
||||
@@ -45,26 +47,28 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
mkdir -p "${{github.workspace}}/build"
|
||||
curl -L "${{env.ZETA_TARBALL_URL}}" | xz -cd | tar -C "${{github.workspace}}/build" --strip-components=2 -xvf - Zeta/API/Z
|
||||
mkdir -p "${{ github.workspace }}/build"
|
||||
curl -L "${{ env.ZETA_TARBALL_URL }}" | xz -cd | tar -C "${{ github.workspace }}/build" --strip-components=2 -xf - Zeta/API/Z
|
||||
|
||||
- name: Configure CMake
|
||||
run: >-
|
||||
cmake
|
||||
-DBUILD_SHARED_LIBS=${{env.BUILD_SHARED_LIBS}}
|
||||
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}}
|
||||
-DZ80_FETCH_TEST_FILES=${{env.Z80_FETCH_TEST_FILES}}
|
||||
-DZ80_WITH_CMAKE_SUPPORT=${{env.Z80_WITH_CMAKE_SUPPORT}}
|
||||
-DZ80_WITH_HTML_DOCUMENTATION=${{env.Z80_WITH_HTML_DOCUMENTATION}}
|
||||
-DZ80_WITH_PDF_DOCUMENTATION=${{env.Z80_WITH_PDF_DOCUMENTATION}}
|
||||
-DZ80_WITH_PKGCONFIG_SUPPORT=${{env.Z80_WITH_PKGCONFIG_SUPPORT}}
|
||||
-DZ80_WITH_STANDARD_DOCUMENTS=${{env.Z80_WITH_STANDARD_DOCUMENTS}}
|
||||
-DZ80_WITH_TESTS=${{env.Z80_WITH_TESTS}}
|
||||
-B "${{github.workspace}}/build"
|
||||
-S "${{github.workspace}}"
|
||||
-DBUILD_SHARED_LIBS=${{ env.BUILD_SHARED_LIBS }}
|
||||
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
|
||||
-DZ80_FETCH_TEST_FILES=${{ env.Z80_FETCH_TEST_FILES }}
|
||||
-DZ80_WITH_CMAKE_SUPPORT=${{ env.Z80_WITH_CMAKE_SUPPORT }}
|
||||
-DZ80_WITH_CODE_GENERATION_TOOLS=${{ env.Z80_WITH_CODE_GENERATION_TOOLS }}
|
||||
-DZ80_WITH_HTML_DOCUMENTATION=${{ env.Z80_WITH_HTML_DOCUMENTATION }}
|
||||
-DZ80_WITH_PDF_DOCUMENTATION=${{ env.Z80_WITH_PDF_DOCUMENTATION }}
|
||||
-DZ80_WITH_PKGCONFIG_SUPPORT=${{ env.Z80_WITH_PKGCONFIG_SUPPORT }}
|
||||
-DZ80_WITH_STANDARD_DOCUMENTS=${{ env.Z80_WITH_STANDARD_DOCUMENTS }}
|
||||
-DZ80_WITH_STEP_TESTING_TOOL=${{ env.Z80_WITH_STEP_TESTING_TOOL }}
|
||||
-DZ80_WITH_TESTING_TOOL=${{ env.Z80_WITH_TESTING_TOOL }}
|
||||
-B "${{ github.workspace }}/build"
|
||||
-S "${{ github.workspace }}"
|
||||
|
||||
- name: Build HTML documentation
|
||||
run: cmake --build "${{github.workspace}}/build" --config ${{env.CMAKE_BUILD_TYPE}} --target Z80-Documentation-HTML --verbose
|
||||
run: cmake --build "${{ github.workspace }}/build" --config ${{ env.CMAKE_BUILD_TYPE }} --target Z80-Documentation-HTML --verbose
|
||||
|
||||
- name: Build PDF documentation
|
||||
run: cmake --build "${{github.workspace}}/build" --config ${{env.CMAKE_BUILD_TYPE}} --target Z80-Documentation-PDF --verbose
|
||||
run: cmake --build "${{ github.workspace }}/build" --config ${{ env.CMAKE_BUILD_TYPE }} --target Z80-Documentation-PDF --verbose
|
||||
|
||||
116
projects/Z80/.github/workflows/step-tests.yml
vendored
Normal file
116
projects/Z80/.github/workflows/step-tests.yml
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
name: Step tests
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/step-tests.yml'
|
||||
- 'API/**'
|
||||
- 'CMake/FindZeta.cmake'
|
||||
- 'sources/step-test-Z80.c'
|
||||
- 'sources/Z80.c'
|
||||
- 'CMakeLists.txt'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/step-tests.yml'
|
||||
- 'API/**'
|
||||
- 'CMake/FindZeta.cmake'
|
||||
- 'sources/step-test-Z80.c'
|
||||
- 'sources/Z80.c'
|
||||
- 'CMakeLists.txt'
|
||||
|
||||
env:
|
||||
TEST_FILES_QUERY_URL: 'https://api.github.com/repos/SingleStepTests/z80/releases/latest'
|
||||
TEST_FILES_PATH: '*/v1'
|
||||
BUILD_SHARED_LIBS: YES
|
||||
CMAKE_BUILD_TYPE: Release
|
||||
Z80_FETCH_TEST_FILES: NO
|
||||
Z80_NOSTDLIB_FLAGS: Auto
|
||||
Z80_OBJECT_LIBS: NO
|
||||
Z80_WITH_CMAKE_SUPPORT: NO
|
||||
Z80_WITH_CODE_GENERATION_TOOLS: NO
|
||||
Z80_WITH_HTML_DOCUMENTATION: NO
|
||||
Z80_WITH_PDF_DOCUMENTATION: NO
|
||||
Z80_WITH_PKGCONFIG_SUPPORT: NO
|
||||
Z80_WITH_STANDARD_DOCUMENTS: NO
|
||||
Z80_WITH_STEP_TESTING_TOOL: YES
|
||||
Z80_WITH_TESTING_TOOL: NO
|
||||
Z80_WITH_EXECUTE: YES
|
||||
Z80_WITH_FULL_IM0: YES
|
||||
Z80_WITH_IM0_RETX_NOTIFICATIONS: YES
|
||||
Z80_WITH_PARITY_COMPUTATION: NO
|
||||
Z80_WITH_PRECOMPUTED_DAA: NO
|
||||
Z80_WITH_Q: YES
|
||||
Z80_WITH_SPECIAL_RESET: YES
|
||||
Z80_WITH_UNOFFICIAL_RETI: NO
|
||||
Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG: YES
|
||||
|
||||
jobs:
|
||||
step-tests:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies (macOS)
|
||||
if: startsWith(matrix.os, 'macos')
|
||||
run: |
|
||||
brew install cjson
|
||||
brew install redcode/zxe/z80insnclock
|
||||
|
||||
- name: Install dependencies (Ubuntu)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
curl -L https://zxe.io/scripts/add-zxe-apt-repo.sh | sudo sh
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install libcjson-dev
|
||||
sudo apt-get -y install libz80insnclock-dev
|
||||
|
||||
- name: Fetch test files
|
||||
run: |
|
||||
mkdir -p "${{ github.workspace }}/build/step-tests"
|
||||
curl -L $(curl -sL "${{ env.TEST_FILES_QUERY_URL }}" | jq -r .tarball_url) |
|
||||
gzip -cd |
|
||||
tar -C "${{ github.workspace }}/build/step-tests" --strip-components=2 -xf - $([[ $(tar --version | head -n 1 | cut -d " " -f 1) = tar ]] && echo --wildcards) "${{ env.TEST_FILES_PATH }}"
|
||||
|
||||
- name: Configure CMake
|
||||
run: >-
|
||||
cmake
|
||||
-DBUILD_SHARED_LIBS=${{ env.BUILD_SHARED_LIBS }}
|
||||
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
|
||||
-DZ80_FETCH_TEST_FILES=${{ env.Z80_FETCH_TEST_FILES }}
|
||||
-DZ80_NOSTDLIB_FLAGS=${{ env.Z80_NOSTDLIB_FLAGS }}
|
||||
-DZ80_OBJECT_LIBS=${{ env.Z80_OBJECT_LIBS }}
|
||||
-DZ80_WITH_CMAKE_SUPPORT=${{ env.Z80_WITH_CMAKE_SUPPORT }}
|
||||
-DZ80_WITH_CODE_GENERATION_TOOLS=${{ env.Z80_WITH_CODE_GENERATION_TOOLS }}
|
||||
-DZ80_WITH_HTML_DOCUMENTATION=${{ env.Z80_WITH_HTML_DOCUMENTATION }}
|
||||
-DZ80_WITH_PDF_DOCUMENTATION=${{ env.Z80_WITH_PDF_DOCUMENTATION }}
|
||||
-DZ80_WITH_PKGCONFIG_SUPPORT=${{ env.Z80_WITH_PKGCONFIG_SUPPORT }}
|
||||
-DZ80_WITH_STANDARD_DOCUMENTS=${{ env.Z80_WITH_STANDARD_DOCUMENTS }}
|
||||
-DZ80_WITH_STEP_TESTING_TOOL=${{ env.Z80_WITH_STEP_TESTING_TOOL }}
|
||||
-DZ80_WITH_TESTING_TOOL=${{ env.Z80_WITH_TESTING_TOOL }}
|
||||
-DZ80_WITH_EXECUTE=${{ env.Z80_WITH_EXECUTE }}
|
||||
-DZ80_WITH_FULL_IM0=${{ env.Z80_WITH_FULL_IM0 }}
|
||||
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=${{ env.Z80_WITH_IM0_RETX_NOTIFICATIONS }}
|
||||
-DZ80_WITH_PARITY_COMPUTATION=${{ env.Z80_WITH_PARITY_COMPUTATION }}
|
||||
-DZ80_WITH_PRECOMPUTED_DAA=${{ env.Z80_WITH_PRECOMPUTED_DAA }}
|
||||
-DZ80_WITH_Q=${{ env.Z80_WITH_Q }}
|
||||
-DZ80_WITH_SPECIAL_RESET=${{ env.Z80_WITH_SPECIAL_RESET }}
|
||||
-DZ80_WITH_UNOFFICIAL_RETI=${{ env.Z80_WITH_UNOFFICIAL_RETI }}
|
||||
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=${{ env.Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG }}
|
||||
-B "${{ github.workspace }}/build"
|
||||
-S "${{ github.workspace }}"
|
||||
|
||||
- name: Build
|
||||
run: cmake --build "${{ github.workspace }}/build" --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
run: ./step-test-Z80 step-tests/*.json
|
||||
|
||||
- name: Test with `--run`
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
run: ./step-test-Z80 --run step-tests/*.json
|
||||
91
projects/Z80/API/Z80.h
vendored
91
projects/Z80/API/Z80.h
vendored
@@ -4,7 +4,7 @@
|
||||
____ \/__/ /\_\ __ \\ \/\ \ ________________________________________________
|
||||
| /\_____\\_____\\_____\ |
|
||||
| Zilog \/_____//_____//_____/ CPU Emulator |
|
||||
| Copyright (C) 1999-2024 Manuel Sainz de Baranda y Goñi. |
|
||||
| Copyright (C) 1999-2026 Manuel Sainz de Baranda y Goñi. |
|
||||
| |
|
||||
| This emulator is free software: you can redistribute it and/or modify it |
|
||||
| under the terms of the GNU Lesser General Public License as published by |
|
||||
@@ -30,13 +30,13 @@
|
||||
* of the Zilog Z80 that emulates all that is known to date about this CPU,
|
||||
* including the undocumented behaviors, MEMPTR, Q and the special RESET.
|
||||
*
|
||||
* @version 0.2
|
||||
* @date 2024
|
||||
* @version 0.2-pre-2025-07-02
|
||||
* @date 2025-07-02
|
||||
* @author Manuel Sainz de Baranda y Goñi */
|
||||
|
||||
#ifdef Z80_DEPENDENCIES_HEADER
|
||||
#ifdef Z80_EXTERNAL_HEADER
|
||||
# define Z80_H
|
||||
# include Z80_DEPENDENCIES_HEADER
|
||||
# include Z80_EXTERNAL_HEADER
|
||||
# undef Z80_H
|
||||
#else
|
||||
# include <Z/macros/language.h>
|
||||
@@ -88,11 +88,27 @@
|
||||
|
||||
#define Z80_MINIMUM_CYCLES_PER_STEP 4
|
||||
|
||||
/** @brief Opcode of the @c halt instruction in the Z80 ISA. */
|
||||
|
||||
#define Z80_HALT 0x76
|
||||
|
||||
/** @brief Opcode interpreted as a trap by the Z80 library. It corresponds to
|
||||
* the <tt>ld h,h</tt> instruction in the Z80 ISA. */
|
||||
|
||||
#define Z80_HOOK 0x64
|
||||
|
||||
/** @brief Opcode of the <tt>jp WORD</tt> instruction in the Z80 ISA. */
|
||||
|
||||
#define Z80_JP_WORD 0xC3
|
||||
|
||||
/** @brief Opcode of the @c nop instruction in the Z80 ISA. */
|
||||
|
||||
#define Z80_NOP 0x00
|
||||
|
||||
/** @brief Opcode of the @c ret instruction in the Z80 ISA. */
|
||||
|
||||
#define Z80_RET 0xC9
|
||||
|
||||
#define Z80_SF 128 /**< @brief Bitmask of the Z80 S flag. */
|
||||
#define Z80_ZF 64 /**< @brief Bitmask of the Z80 Z flag. */
|
||||
#define Z80_YF 32 /**< @brief Bitmask of the Z80 Y flag. */
|
||||
@@ -160,10 +176,10 @@ typedef zuint8 (* Z80Illegal)(Z80 *cpu, zuint8 opcode);
|
||||
* in use. */
|
||||
|
||||
struct Z80 {
|
||||
|
||||
/** @brief Number of clock cycles already executed. */
|
||||
|
||||
zusize cycles;
|
||||
# if !defined(__DOXYGEN__) && defined(Z80_WITH_VOLATILE_CYCLES)
|
||||
volatile
|
||||
# endif
|
||||
zusize cycles; /**< @brief Number of clock cycles already executed. */
|
||||
|
||||
/** @brief Maximum number of clock cycles to be executed. */
|
||||
|
||||
@@ -405,12 +421,12 @@ struct Z80 {
|
||||
|
||||
ZInt16 memptr; /**< @brief Register MEMPTR, also known as WZ. */
|
||||
ZInt16 af; /**< @brief Register pair AF (accumulator and flags). */
|
||||
ZInt16 bc; /**< @brief Register pair BC. */
|
||||
ZInt16 de; /**< @brief Register pair DE. */
|
||||
ZInt16 hl; /**< @brief Register pair HL. */
|
||||
ZInt16 af_; /**< @brief Register pair AF'. */
|
||||
ZInt16 bc; /**< @brief Register pair BC. */
|
||||
ZInt16 bc_; /**< @brief Register pair BC'. */
|
||||
ZInt16 de; /**< @brief Register pair DE. */
|
||||
ZInt16 de_; /**< @brief Register pair DE'. */
|
||||
ZInt16 hl; /**< @brief Register pair HL. */
|
||||
ZInt16 hl_; /**< @brief Register pair HL'. */
|
||||
zuint8 r; /**< @brief Register R (memory refresh). */
|
||||
zuint8 i; /**< @brief Register I (interrupt vector base). */
|
||||
@@ -447,7 +463,7 @@ struct Z80 {
|
||||
|
||||
zuint8 iff1; /**< @brief Interrupt enable flip-flop #1 (IFF1). */
|
||||
zuint8 iff2; /**< @brief Interrupt enable flip-flop #2 (IFF2). */
|
||||
zuint8 q; /**< @brief Pseudo-register Q. */
|
||||
zuint8 q; /**< @brief Q factor. */
|
||||
|
||||
/** @brief Emulation options.
|
||||
*
|
||||
@@ -471,6 +487,33 @@ struct Z80 {
|
||||
* <tt>@ref Z80::halt</tt>, not after. */
|
||||
|
||||
zuint8 halt_line;
|
||||
|
||||
# ifdef Z80_WITH_RESET_SIGNAL
|
||||
/** @brief Pointer to a memory-mapped register containing a reset signal.
|
||||
*
|
||||
* If not @c Z_NULL, the emulator reads this register at every
|
||||
* instruction boundary inside @ref z80_run and tests it against
|
||||
* @ref reset_signal_mask. A non-zero result causes the emulation
|
||||
* loop to exit immediately, before the next instruction fetch.
|
||||
* This allows an external hardware reset line to halt the CPU at
|
||||
* the same point a real Z80 would: at the end of the current
|
||||
* instruction.
|
||||
*
|
||||
* Typical usage: point this to a PIO IRQ flag register or a GPIO
|
||||
* input register, with the mask selecting the relevant bit.
|
||||
*
|
||||
* Setting this to @c Z_NULL disables the check (default). */
|
||||
|
||||
zuint32 volatile const *reset_signal;
|
||||
|
||||
/** @brief Bitmask applied to @ref reset_signal.
|
||||
*
|
||||
* The emulator tests <tt>*reset_signal & reset_signal_mask</tt>
|
||||
* at each instruction boundary. A non-zero result indicates that
|
||||
* a reset is active. */
|
||||
|
||||
zuint32 reset_signal_mask;
|
||||
# endif
|
||||
};
|
||||
|
||||
/** @brief <tt>@ref Z80::options</tt> bitmask that enables emulation of the
|
||||
@@ -775,7 +818,7 @@ Z_EXTERN_C_BEGIN
|
||||
* @c Z_TRUE = power on;
|
||||
* @c Z_FALSE = power off. */
|
||||
|
||||
Z80_API void z80_power(Z80 *self, zboolean state);
|
||||
Z80_API void z80_power(Z80 *self, zbool state);
|
||||
|
||||
/** @brief Performs an instantaneous normal RESET on a <tt>@ref Z80</tt>.
|
||||
*
|
||||
@@ -800,7 +843,7 @@ Z80_API void z80_special_reset(Z80 *self);
|
||||
* @c Z_TRUE = set line low;
|
||||
* @c Z_FALSE = set line high. */
|
||||
|
||||
Z80_API void z80_int(Z80 *self, zboolean state);
|
||||
Z80_API void z80_int(Z80 *self, zbool state);
|
||||
|
||||
/** @brief Triggers the NMI line of a <tt>@ref Z80</tt>.
|
||||
*
|
||||
@@ -809,7 +852,8 @@ Z80_API void z80_int(Z80 *self, zboolean state);
|
||||
Z80_API void z80_nmi(Z80 *self);
|
||||
|
||||
/** @brief Runs a <tt>@ref Z80</tt> for a given number of clock @p cycles,
|
||||
* executing only instructions without responding to signals.
|
||||
* executing only instructions without responding to interrupts requests or
|
||||
* special RESET signals.
|
||||
*
|
||||
* @param self Pointer to the object on which the function is called.
|
||||
* @param cycles Number of clock cycles to be emulated.
|
||||
@@ -831,7 +875,7 @@ Z80_API zusize z80_run(Z80 *self, zusize cycles);
|
||||
*
|
||||
* This function should only be used inside callback functions. It zeroes
|
||||
* <tt>@ref Z80::cycle_limit</tt>, thus breaking the emulation loop after the
|
||||
* ongoing emulation step has finished executing.
|
||||
* completion of the ongoing emulation step.
|
||||
*
|
||||
* @param self Pointer to the object on which the function is called. */
|
||||
|
||||
@@ -899,6 +943,19 @@ static inline zuint8 z80_out_cycle(Z80 const *self)
|
||||
}
|
||||
|
||||
|
||||
/** @brief Sends a WAIT signal to a <tt>@ref Z80</tt>.
|
||||
*
|
||||
* This function should only be used inside callback functions. It adds the
|
||||
* given number of clock @p cycles to <tt>@ref Z80::cycles</tt>, thus
|
||||
* lengthening the ongoing emulation step.
|
||||
*
|
||||
* @param self Pointer to the object on which the function is called.
|
||||
* @param cycles Duration of the WAIT signal, in clock cycles. */
|
||||
|
||||
static inline void z80_wait(Z80 *self, zusize cycles)
|
||||
{self->cycles += cycles;}
|
||||
|
||||
|
||||
Z_EXTERN_C_END
|
||||
|
||||
#endif /* Z80_H */
|
||||
|
||||
7
projects/Z80/AUTHORS
vendored
7
projects/Z80/AUTHORS
vendored
@@ -1,6 +1,11 @@
|
||||
Original author:
|
||||
Sainz de Baranda y Goñi, Manuel <manuel@zxe.io>
|
||||
|
||||
Contributors:
|
||||
Collaborators:
|
||||
Ortega Sosa, Sofía <agaxia@zxe.io>
|
||||
|
||||
Contributors:
|
||||
Haubenthal, Stefan
|
||||
Rolandi, Giovan Battista
|
||||
Slayden, Glenn
|
||||
Vučenović, Zoran <zoran_vucenovic@yahoo.com>
|
||||
|
||||
4
projects/Z80/CITATION.cff
vendored
4
projects/Z80/CITATION.cff
vendored
@@ -6,7 +6,7 @@ authors:
|
||||
email: 'manuel@zxe.io'
|
||||
website: 'https://zxe.io'
|
||||
cff-version: '1.2.0'
|
||||
date-released: '2024-04-18'
|
||||
date-released: '2025-07-02'
|
||||
keywords:
|
||||
- CPU
|
||||
- LLE
|
||||
@@ -18,5 +18,5 @@ message: If you use this software, please cite it using these metadata.
|
||||
repository-code: 'https://github.com/redcode/Z80'
|
||||
title: Z80
|
||||
type: software
|
||||
version: '0.2-pre-2024-04-18'
|
||||
version: '0.2-pre-2025-07-02'
|
||||
url: 'https://zxe.io/software/Z80'
|
||||
|
||||
57
projects/Z80/CMake/FindBreathe.cmake
vendored
57
projects/Z80/CMake/FindBreathe.cmake
vendored
@@ -1,31 +1,62 @@
|
||||
# FindBreathe.cmake
|
||||
# Copyright (C) 2021-2023 Manuel Sainz de Baranda y Goñi.
|
||||
# This "find module" is DISTRIBUTED AS PUBLIC DOMAIN. No restrictions apply.
|
||||
# Copyright (C) 2021-2024 Manuel Sainz de Baranda y Goñi.
|
||||
# This "find module" is distributed as public domain software.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindBreathe
|
||||
-----------
|
||||
|
||||
Find Breathe.
|
||||
|
||||
Result variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
``Breathe_FOUND``
|
||||
``TRUE`` if Breathe was found.
|
||||
|
||||
``Breathe_APIDOC_VERSION``
|
||||
The version of the ``breathe-apidoc`` executable that was found.
|
||||
|
||||
``Breathe_VERSION``
|
||||
Same as ``Breathe_APIDOC_VERSION``.
|
||||
|
||||
Cache variables
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Search results are saved persistently in CMake cache entries:
|
||||
|
||||
``Breathe_APIDOC_EXECUTABLE``
|
||||
The full path to the ``breathe-apidoc`` executable.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_program(
|
||||
BREATHE_APIDOC_EXECUTABLE
|
||||
Breathe_APIDOC_EXECUTABLE
|
||||
NAMES breathe-apidoc
|
||||
DOC "Breathe extension for Sphinx")
|
||||
DOC "`breathe-apidoc` executable.")
|
||||
|
||||
if(BREATHE_APIDOC_EXECUTABLE)
|
||||
if(Breathe_APIDOC_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND "${BREATHE_APIDOC_EXECUTABLE}" --version
|
||||
OUTPUT_VARIABLE _output)
|
||||
COMMAND "${Breathe_APIDOC_EXECUTABLE}" --version
|
||||
OUTPUT_VARIABLE _Breathe_output)
|
||||
|
||||
if("${_output}" MATCHES ".* ([^\n]+)\n")
|
||||
set(BREATHE_APIDOC_VERSION "${CMAKE_MATCH_1}")
|
||||
if("${_Breathe_output}" MATCHES ".* ([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?).*\n")
|
||||
set(Breathe_APIDOC_VERSION "${CMAKE_MATCH_1}")
|
||||
set(Breathe_VERSION ${Breathe_APIDOC_VERSION})
|
||||
endif()
|
||||
|
||||
unset(_output)
|
||||
unset(_Breathe_output)
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(
|
||||
Breathe
|
||||
REQUIRED_VARS BREATHE_APIDOC_EXECUTABLE
|
||||
VERSION_VAR BREATHE_APIDOC_VERSION)
|
||||
REQUIRED_VARS Breathe_APIDOC_EXECUTABLE Breathe_APIDOC_VERSION
|
||||
VERSION_VAR Breathe_VERSION)
|
||||
|
||||
mark_as_advanced(BREATHE_APIDOC_EXECUTABLE)
|
||||
mark_as_advanced(Breathe_APIDOC_EXECUTABLE)
|
||||
|
||||
# FindBreathe.cmake EOF
|
||||
|
||||
130
projects/Z80/CMake/FindSphinx.cmake
vendored
130
projects/Z80/CMake/FindSphinx.cmake
vendored
@@ -1,31 +1,117 @@
|
||||
# FindSphinx.cmake
|
||||
# Copyright (C) 2021-2023 Manuel Sainz de Baranda y Goñi.
|
||||
# This "find module" is DISTRIBUTED AS PUBLIC DOMAIN. No restrictions apply.
|
||||
# Copyright (C) 2021-2026 Manuel Sainz de Baranda y Goñi.
|
||||
# This "find module" is distributed as public domain software.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindSphinx
|
||||
----------
|
||||
|
||||
Find the Sphinx documentation tools.
|
||||
|
||||
Optional components
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This module supports 4 optional ``COMPONENTS``:
|
||||
|
||||
``apidoc``
|
||||
Looks for the ``sphinx-apidoc`` executable.
|
||||
|
||||
``autogen``
|
||||
Looks for the ``sphinx-autogen`` executable.
|
||||
|
||||
``build``
|
||||
Looks for the ``sphinx-build`` executable. This component is used by default
|
||||
if no components are specified.
|
||||
|
||||
``quickstart``
|
||||
Looks for the ``sphinx-quickstart`` executable.
|
||||
|
||||
Result variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
``Sphinx_FOUND``
|
||||
``TRUE`` if all requested Sphinx tools were found.
|
||||
|
||||
``Sphinx_<COMPONENT>_VERSION``
|
||||
The version of the ``sphinx-<component>`` executable that was found, where
|
||||
``<COMPONENT>`` and ``<component>`` are the uppercase and lowercase names of
|
||||
the component, respectively.
|
||||
|
||||
``Sphinx_VERSION``
|
||||
The version of Sphinx that was found. It is the same as
|
||||
``Sphinx_BUILD_VERSION`` if the ``build`` component was requested; otherwise,
|
||||
it is the same as the first one requested.
|
||||
|
||||
Cache variables
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Search results are saved persistently in CMake cache entries:
|
||||
|
||||
``Sphinx_<COMPONENT>_EXECUTABLE``
|
||||
The full path to the ``sphinx-<component>`` executable, where ``<COMPONENT>``
|
||||
and ``<component>`` are the uppercase and lowercase names of the component,
|
||||
respectively.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
set(_Sphinx_required_vars)
|
||||
|
||||
if(NOT Sphinx_FIND_COMPONENTS)
|
||||
set(Sphinx_FIND_COMPONENTS build)
|
||||
endif()
|
||||
|
||||
foreach(_Sphinx_tool IN LISTS Sphinx_FIND_COMPONENTS)
|
||||
if(NOT _Sphinx_tool MATCHES "^(apidoc|autogen|build|quickstart)$")
|
||||
message(FATAL_ERROR "Invalid components: ${Sphinx_FIND_COMPONENTS}")
|
||||
endif()
|
||||
|
||||
string(TOUPPER ${_Sphinx_tool} _Sphinx_tool_uppercase)
|
||||
set(_Sphinx_tool_executable_var Sphinx_${_Sphinx_tool_uppercase}_EXECUTABLE)
|
||||
set(_Sphinx_tool_version_var Sphinx_${_Sphinx_tool_uppercase}_VERSION)
|
||||
|
||||
list( APPEND _Sphinx_required_vars
|
||||
${_Sphinx_tool_executable_var} ${_Sphinx_tool_version_var})
|
||||
|
||||
find_program(
|
||||
${_Sphinx_tool_executable_var}
|
||||
NAMES sphinx-${_Sphinx_tool}
|
||||
DOC "`sphinx-${_Sphinx_tool}` executable.")
|
||||
|
||||
if(${_Sphinx_tool_executable_var})
|
||||
execute_process(
|
||||
COMMAND "${${_Sphinx_tool_executable_var}}" --version
|
||||
OUTPUT_VARIABLE _Sphinx_output)
|
||||
|
||||
if("${_Sphinx_output}" MATCHES ".* ([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?).*\n")
|
||||
set(${_Sphinx_tool_version_var} "${CMAKE_MATCH_1}")
|
||||
|
||||
if(NOT DEFINED Sphinx_VERSION)
|
||||
set(Sphinx_VERSION ${${_Sphinx_tool_version_var}})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
unset(_Sphinx_output)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(${_Sphinx_tool_executable_var})
|
||||
unset(_Sphinx_tool_version_var)
|
||||
unset(_Sphinx_tool_executable_var)
|
||||
unset(_Sphinx_tool_uppercase)
|
||||
endforeach()
|
||||
|
||||
if(DEFINED Sphinx_BUILD_VERSION)
|
||||
set(Sphinx_VERSION ${Sphinx_BUILD_VERSION})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_program(
|
||||
SPHINX_BUILD_EXECUTABLE
|
||||
NAMES sphinx-build
|
||||
DOC "Sphinx Documentation Builder")
|
||||
|
||||
if(SPHINX_BUILD_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND "${SPHINX_BUILD_EXECUTABLE}" --version
|
||||
OUTPUT_VARIABLE _output)
|
||||
|
||||
if("${_output}" MATCHES ".* ([^\n]+)\n")
|
||||
set(SPHINX_BUILD_VERSION "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
|
||||
unset(_output)
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(
|
||||
Sphinx
|
||||
REQUIRED_VARS SPHINX_BUILD_EXECUTABLE
|
||||
VERSION_VAR SPHINX_BUILD_VERSION)
|
||||
REQUIRED_VARS ${_Sphinx_required_vars}
|
||||
VERSION_VAR Sphinx_VERSION)
|
||||
|
||||
mark_as_advanced(SPHINX_BUILD_EXECUTABLE)
|
||||
unset(_Sphinx_required_vars)
|
||||
|
||||
# FindSphinx.cmake EOF
|
||||
|
||||
235
projects/Z80/CMake/FindZeta.cmake
vendored
235
projects/Z80/CMake/FindZeta.cmake
vendored
@@ -1,73 +1,191 @@
|
||||
# Zeta - FindZeta.cmake
|
||||
# FindZeta.cmake
|
||||
# ______ ______________ ___
|
||||
# |__ / | ___|___ ___|/ \
|
||||
# / /__| __| | | / - \
|
||||
# /______|_____| |__| /__/ \__\
|
||||
# Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
# This "find module" is DISTRIBUTED AS PUBLIC DOMAIN. No restrictions apply.
|
||||
# This "find module" is distributed as public domain software.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindZeta
|
||||
--------
|
||||
|
||||
Find the Zeta library.
|
||||
|
||||
Search behavior
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
By default, this module will search for Zeta in the directory specified by the
|
||||
``ZETA_DIR`` environment variable. If this variable is not defined, it will
|
||||
search in ``PROJECT_BINARY_DIR`` and the following paths relative to
|
||||
``PROJECT_SOURCE_DIR`` (in the listed order):
|
||||
|
||||
* :file:`.`
|
||||
* :file:`3rd`
|
||||
* :file:`3rd-party`
|
||||
* :file:`3rd-parties`
|
||||
* :file:`3rd_party`
|
||||
* :file:`3rd_parties`
|
||||
* :file:`3rdparty`
|
||||
* :file:`3rdparties`
|
||||
* :file:`third-party`
|
||||
* :file:`third-parties`
|
||||
* :file:`third_party`
|
||||
* :file:`third_parties`
|
||||
* :file:`thirdparty`
|
||||
* :file:`thirdparties`
|
||||
* :file:`dependencies`
|
||||
* :file:`deps`
|
||||
* :file:`extern`
|
||||
* :file:`external`
|
||||
* :file:`externals`
|
||||
* :file:`..`
|
||||
|
||||
Finally, if the relaive search is unsuccessful, the module will search for the
|
||||
headers of the Zeta library in system include directories.
|
||||
|
||||
Input variables
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
The search process can be controlled by using the following variables:
|
||||
|
||||
``Zeta_IGNORE_ZETA_DIR``
|
||||
Set this variable to ``TRUE`` to ignore the ``ZETA_DIR`` environment variable.
|
||||
|
||||
``Zeta_SKIP_RELATIVE_SEARCH``
|
||||
If set to ``TRUE``, the module will not search in ``PROJECT_BINARY_DIR`` and
|
||||
paths relative to ``PROJECT_BINARY_DIR`` before trying system include
|
||||
directories.
|
||||
|
||||
``Zeta_SKIP_SYSTEM_SEARCH``
|
||||
If set to ``TRUE``, the module will not search in system include directories.
|
||||
|
||||
Imported targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module defines the following ``INTERFACE IMPORTED`` target:
|
||||
|
||||
``Zeta``
|
||||
The Zeta library, if found.
|
||||
|
||||
Result variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
``Zeta_FOUND``
|
||||
``TRUE`` if the Zeta library was found.
|
||||
|
||||
``Zeta_INCLUDE_DIRS``
|
||||
The include directory needed to use Zeta.
|
||||
|
||||
``Zeta_VERSION``
|
||||
The version of the Zeta library that was found.
|
||||
|
||||
``Zeta_VERSION_MAJOR``
|
||||
First version number component of the ``Zeta_VERSION`` variable.
|
||||
|
||||
``Zeta_VERSION_MINOR``
|
||||
Second version number component of the ``Zeta_VERSION`` variable.
|
||||
|
||||
``Zeta_VERSION_MICRO``
|
||||
Third version number component of the ``Zeta_VERSION`` variable.
|
||||
|
||||
``Zeta_VERSION_PATCH``
|
||||
Same as ``Zeta_VERSION_MICRO``.
|
||||
|
||||
Cache Variables
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Search results are saved persistently in CMake cache entries:
|
||||
|
||||
``Zeta_INCLUDE_DIR``
|
||||
Same as ``Zeta_INCLUDE_DIRS``.
|
||||
|
||||
Hints
|
||||
^^^^^
|
||||
|
||||
The user can set the ``ZETA_DIR`` environment variable to specify the include
|
||||
directory of the Zeta library or the directory where its tarball has been
|
||||
extracted. However, if this variable is defined and Zeta is not found in the
|
||||
specified directory, the module will fail and will not look anywhere else.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if(NOT DEFINED Zeta_FIND_RELATIVE OR Zeta_FIND_RELATIVE)
|
||||
if( DEFINED ENV{ZETA_DIR} AND
|
||||
(NOT DEFINED Zeta_IGNORE_ZETA_DIR OR NOT Zeta_IGNORE_ZETA_DIR)
|
||||
)
|
||||
find_path(
|
||||
Zeta_INCLUDE_DIR "Z/version.h"
|
||||
PATHS "${PROJECT_BINARY_DIR}/Zeta/API"
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/3rd/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rd"
|
||||
"${PROJECT_SOURCE_DIR}/3rd-party/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rd-party"
|
||||
"${PROJECT_SOURCE_DIR}/3rd-parties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rd-parties"
|
||||
"${PROJECT_SOURCE_DIR}/3rd_party/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rd_party"
|
||||
"${PROJECT_SOURCE_DIR}/3rd_parties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rd_parties"
|
||||
"${PROJECT_SOURCE_DIR}/3rdparty/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rdparty"
|
||||
"${PROJECT_SOURCE_DIR}/3rdparties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rdparties"
|
||||
"${PROJECT_SOURCE_DIR}/third-party/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/third-party"
|
||||
"${PROJECT_SOURCE_DIR}/third-parties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/third-parties"
|
||||
"${PROJECT_SOURCE_DIR}/third_party/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/third_party"
|
||||
"${PROJECT_SOURCE_DIR}/third_parties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/third_parties"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparty/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparty"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparties"
|
||||
"${PROJECT_SOURCE_DIR}/dependencies/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/dependencies"
|
||||
"${PROJECT_SOURCE_DIR}/deps/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/deps"
|
||||
"${PROJECT_SOURCE_DIR}/extern/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/extern"
|
||||
"${PROJECT_SOURCE_DIR}/external/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/external"
|
||||
"${PROJECT_SOURCE_DIR}/externals/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/externals"
|
||||
"${PROJECT_SOURCE_DIR}/../zeta-src/API"
|
||||
"${PROJECT_SOURCE_DIR}/../Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/.."
|
||||
PATHS "$ENV{ZETA_DIR}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
else()
|
||||
if(NOT DEFINED Zeta_SKIP_RELATIVE_SEARCH OR NOT Zeta_SKIP_RELATIVE_SEARCH)
|
||||
find_path(
|
||||
Zeta_INCLUDE_DIR "Z/version.h"
|
||||
PATHS "${PROJECT_BINARY_DIR}/Zeta/API"
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/3rd/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rd"
|
||||
"${PROJECT_SOURCE_DIR}/3rd-party/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rd-party"
|
||||
"${PROJECT_SOURCE_DIR}/3rd-parties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rd-parties"
|
||||
"${PROJECT_SOURCE_DIR}/3rd_party/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rd_party"
|
||||
"${PROJECT_SOURCE_DIR}/3rd_parties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rd_parties"
|
||||
"${PROJECT_SOURCE_DIR}/3rdparty/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rdparty"
|
||||
"${PROJECT_SOURCE_DIR}/3rdparties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/3rdparties"
|
||||
"${PROJECT_SOURCE_DIR}/third-party/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/third-party"
|
||||
"${PROJECT_SOURCE_DIR}/third-parties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/third-parties"
|
||||
"${PROJECT_SOURCE_DIR}/third_party/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/third_party"
|
||||
"${PROJECT_SOURCE_DIR}/third_parties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/third_parties"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparty/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparty"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparties/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparties"
|
||||
"${PROJECT_SOURCE_DIR}/dependencies/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/dependencies"
|
||||
"${PROJECT_SOURCE_DIR}/deps/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/deps"
|
||||
"${PROJECT_SOURCE_DIR}/extern/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/extern"
|
||||
"${PROJECT_SOURCE_DIR}/external/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/external"
|
||||
"${PROJECT_SOURCE_DIR}/externals/Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/externals"
|
||||
"${PROJECT_SOURCE_DIR}/../zeta-src/API"
|
||||
"${PROJECT_SOURCE_DIR}/../Zeta/API"
|
||||
"${PROJECT_SOURCE_DIR}/.."
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED Zeta_SKIP_SYSTEM_SEARCH OR NOT Zeta_SKIP_SYSTEM_SEARCH)
|
||||
find_path(
|
||||
Zeta_INCLUDE_DIR "Z/version.h"
|
||||
HINTS ENV CPATH
|
||||
ENV C_INCLUDE_PATH
|
||||
ENV CPLUS_INCLUDE_PATH
|
||||
ENV OBJC_INCLUDE_PATH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_path(
|
||||
Zeta_INCLUDE_DIR "Z/version.h"
|
||||
HINTS ENV CPATH
|
||||
ENV C_INCLUDE_PATH
|
||||
ENV CPLUS_INCLUDE_PATH
|
||||
ENV OBJC_INCLUDE_PATH)
|
||||
|
||||
if(Zeta_INCLUDE_DIR AND EXISTS "${Zeta_INCLUDE_DIR}/Z/version.h")
|
||||
file(READ "${Zeta_INCLUDE_DIR}/Z/version.h" _)
|
||||
file(READ "${Zeta_INCLUDE_DIR}/Z/version.h" _Zeta_Z_version_h)
|
||||
|
||||
if(_ MATCHES ".*Z_LIBRARY_VERSION_STRING \"([^\n]*)\".*")
|
||||
if(_Zeta_Z_version_h MATCHES ".*Z_LIBRARY_VERSION_STRING \"([^\n]*)\".*")
|
||||
set(Zeta_VERSION ${CMAKE_MATCH_1})
|
||||
|
||||
if(Zeta_VERSION MATCHES "^([0-9]+)\\.([0-9]+)")
|
||||
@@ -75,14 +193,16 @@ if(Zeta_INCLUDE_DIR AND EXISTS "${Zeta_INCLUDE_DIR}/Z/version.h")
|
||||
set(Zeta_VERSION_MINOR ${CMAKE_MATCH_2})
|
||||
|
||||
if(Zeta_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
|
||||
set(Zeta_VERSION_PATCH ${CMAKE_MATCH_3})
|
||||
set(Zeta_VERSION_MICRO ${CMAKE_MATCH_3})
|
||||
set(Zeta_VERSION_PATCH ${Zeta_VERSION_MICRO})
|
||||
else()
|
||||
set(Zeta_VERSION_MICRO 0)
|
||||
set(Zeta_VERSION_PATCH 0)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
unset(_)
|
||||
unset(_Zeta_Z_version_h)
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(
|
||||
@@ -92,6 +212,7 @@ find_package_handle_standard_args(
|
||||
VERSION_VAR Zeta_VERSION)
|
||||
|
||||
if(Zeta_FOUND AND NOT TARGET Zeta)
|
||||
set(Zeta_INCLUDE_DIRS "${Zeta_INCLUDE_DIR}")
|
||||
add_library(Zeta INTERFACE IMPORTED)
|
||||
|
||||
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_LESS 3.11)
|
||||
|
||||
165
projects/Z80/CMakeLists.txt
vendored
165
projects/Z80/CMakeLists.txt
vendored
@@ -4,7 +4,7 @@
|
||||
# \/__/ /\_\ __ \\ \/\ \
|
||||
# /\_____\\_____\\_____\
|
||||
# Zilog \/_____//_____//_____/ CPU Emulator
|
||||
# Copyright (C) 1999-2024 Manuel Sainz de Baranda y Goñi.
|
||||
# Copyright (C) 1999-2026 Manuel Sainz de Baranda y Goñi.
|
||||
# Released under the terms of the GNU Lesser General Public License v3.
|
||||
|
||||
cmake_minimum_required(
|
||||
@@ -24,7 +24,7 @@ add_compile_options(-Wall
|
||||
)
|
||||
|
||||
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/API/Z80.h" _)
|
||||
string(REGEX MATCH ".*Z80_LIBRARY_VERSION_STRING \"([^\n]*)\".*" _ ${_})
|
||||
string(REGEX MATCH ".*Z80_LIBRARY_VERSION_STRING \"([^\"]+)\".*" _ ${_})
|
||||
|
||||
project(Z80
|
||||
VERSION ${CMAKE_MATCH_1}
|
||||
@@ -33,13 +33,13 @@ project(Z80
|
||||
HOMEPAGE_URL "https://zxe.io/software/Z80")
|
||||
|
||||
unset(_)
|
||||
message("${PROJECT_NAME} v${PROJECT_VERSION}")
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E echo
|
||||
"${PROJECT_NAME} v${PROJECT_VERSION}")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -mcpu=cortex-m33 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard")
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -mcpu=cortex-m33 -mthumb")
|
||||
|
||||
set(${PROJECT_NAME}_DEPOT_LOCATION
|
||||
"http://zxe.io/depot" CACHE STRING
|
||||
"${PROJECT_NAME}: \
|
||||
@@ -101,9 +101,15 @@ Install the standard text documents distributed with the package: \
|
||||
AUTHORS, COPYING, COPYING.LESSER, HISTORY, README and THANKS."
|
||||
NO)
|
||||
|
||||
option(${PROJECT_NAME}_WITH_TESTS
|
||||
option(${PROJECT_NAME}_WITH_STEP_TESTING_TOOL
|
||||
"${PROJECT_NAME}: \
|
||||
Build the testing tool."
|
||||
Build `step-test-${PROJECT_NAME}`, a tool for unit tests in JSON format."
|
||||
NO)
|
||||
|
||||
option(${PROJECT_NAME}_WITH_TESTING_TOOL
|
||||
"${PROJECT_NAME}: \
|
||||
Build `test-${PROJECT_NAME}`, a tool that runs various Z80-specific tests for \
|
||||
CP/M and ZX Spectrum."
|
||||
NO)
|
||||
|
||||
option(${PROJECT_NAME}_WITH_EXECUTE
|
||||
@@ -126,8 +132,13 @@ NO)
|
||||
option(${PROJECT_NAME}_WITH_PARITY_COMPUTATION
|
||||
"${PROJECT_NAME}: \
|
||||
Enable actual parity calculation for the P/V flag instead of using a \
|
||||
table of precomputed values (this is for benchmarks, DO NOT ENABLE in \
|
||||
production builds)."
|
||||
table of precomputed values (NOT RECOMMENDED for production builds)."
|
||||
NO)
|
||||
|
||||
option(${PROJECT_NAME}_WITH_PRECOMPUTED_DAA
|
||||
"${PROJECT_NAME}: \
|
||||
Use a table of precomputed values to emulate the `daa` instruction (NOT \
|
||||
RECOMMENDED for production builds)."
|
||||
NO)
|
||||
|
||||
option(${PROJECT_NAME}_WITH_Q
|
||||
@@ -140,6 +151,14 @@ option(${PROJECT_NAME}_WITH_SPECIAL_RESET
|
||||
Build the implementation of the special RESET."
|
||||
NO)
|
||||
|
||||
option(${PROJECT_NAME}_WITH_RESET_SIGNAL
|
||||
"${PROJECT_NAME}: \
|
||||
Build the implementation of the external reset signal check. When enabled, a \
|
||||
pointer to a volatile byte (reset_signal) is checked at every instruction \
|
||||
boundary. A non-zero value causes z80_run to exit immediately, allowing \
|
||||
hardware-in-the-loop emulators to respond to a physical RESET line."
|
||||
NO)
|
||||
|
||||
option(${PROJECT_NAME}_WITH_UNOFFICIAL_RETI
|
||||
"${PROJECT_NAME}: \
|
||||
Configure the undocumented instructions ED5Dh, ED6Dh and ED7Dh as `reti` \
|
||||
@@ -153,6 +172,11 @@ causes the P/V flag to be reset when a maskable interrupt is accepted \
|
||||
during the execution of the `ld a,{i|r}` instructions."
|
||||
NO)
|
||||
|
||||
option(${PROJECT_NAME}_WITH_CODE_GENERATION_TOOLS
|
||||
"${PROJECT_NAME}: \
|
||||
Build the tools that have been used to generate parts of the source code."
|
||||
NO)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
|
||||
find_package(Zeta REQUIRED)
|
||||
|
||||
@@ -195,17 +219,25 @@ else()
|
||||
set(PROJECT_VERSION_PATCH 0)
|
||||
endif()
|
||||
|
||||
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/README" _)
|
||||
string(REGEX MATCH ".*Copyright \\(C\\) ([^ ]+) (([^. \t\n]+ ?)*[^. \t\n]+).*" _ ${_})
|
||||
set(RC_COPYRIGHT_YEAR ${CMAKE_MATCH_1})
|
||||
set(RC_AUTHOR ${CMAKE_MATCH_2})
|
||||
unset(_)
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/sources/Z80.rc.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Z80.rc"
|
||||
@ONLY)
|
||||
|
||||
unset(RC_COPYRIGHT_YEAR)
|
||||
unset(RC_AUTHOR)
|
||||
target_sources(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/Z80.rc")
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_NOSTDLIB_FLAGS STREQUAL "Auto")
|
||||
if(MSVC)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE Z80_WITH_WINDOWS_DLL_MAIN)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE Z80_WITH_DLL_MAIN_CRT_STARTUP)
|
||||
target_link_options(${PROJECT_NAME} PRIVATE "/NODEFAULTLIB")
|
||||
elseif(APPLE)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "^(AppleClang|Clang|GNU)$")
|
||||
@@ -229,7 +261,9 @@ target_compile_definitions(
|
||||
$<$<BOOL:${${PROJECT_NAME}_WITH_FULL_IM0}>:Z80_WITH_FULL_IM0>
|
||||
$<$<BOOL:${${PROJECT_NAME}_WITH_IM0_RETX_NOTIFICATIONS}>:Z80_WITH_IM0_RETX_NOTIFICATIONS>
|
||||
$<$<BOOL:${${PROJECT_NAME}_WITH_PARITY_COMPUTATION}>:Z80_WITH_PARITY_COMPUTATION>
|
||||
$<$<BOOL:${${PROJECT_NAME}_WITH_PRECOMPUTED_DAA}>:Z80_WITH_PRECOMPUTED_DAA>
|
||||
$<$<BOOL:${${PROJECT_NAME}_WITH_Q}>:Z80_WITH_Q>
|
||||
$<$<BOOL:${${PROJECT_NAME}_WITH_RESET_SIGNAL}>:Z80_WITH_RESET_SIGNAL>
|
||||
$<$<BOOL:${${PROJECT_NAME}_WITH_SPECIAL_RESET}>:Z80_WITH_SPECIAL_RESET>
|
||||
$<$<BOOL:${${PROJECT_NAME}_WITH_UNOFFICIAL_RETI}>:Z80_WITH_UNOFFICIAL_RETI>
|
||||
$<$<BOOL:${${PROJECT_NAME}_WITH_ZILOG_NMOS_LD_A_IR_BUG}>:Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG>)
|
||||
@@ -245,12 +279,10 @@ install(TARGETS ${PROJECT_NAME}
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
COMPONENT ${PROJECT_NAME}_Development)
|
||||
|
||||
if( NOT ${PROJECT_NAME}_OBJECT_LIBS AND
|
||||
(${PROJECT_NAME}_WITH_CMAKE_SUPPORT OR ${PROJECT_NAME}_WITH_PKGCONFIG_SUPPORT)
|
||||
)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
if(NOT ${PROJECT_NAME}_OBJECT_LIBS)
|
||||
if(${PROJECT_NAME}_WITH_CMAKE_SUPPORT)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(_type Shared)
|
||||
else()
|
||||
@@ -274,9 +306,8 @@ if( NOT ${PROJECT_NAME}_OBJECT_LIBS AND
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
INSTALL_DESTINATION "${${PROJECT_NAME}_INSTALL_CMAKEDIR}")
|
||||
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
DESTINATION "${${PROJECT_NAME}_INSTALL_CMAKEDIR}"
|
||||
COMPONENT ${PROJECT_NAME}_Development)
|
||||
endif()
|
||||
@@ -308,11 +339,28 @@ if(${PROJECT_NAME}_WITH_HTML_DOCUMENTATION OR ${PROJECT_NAME}_WITH_PDF_DOCUMENTA
|
||||
add_subdirectory(documentation)
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_WITH_TESTS)
|
||||
if(${PROJECT_NAME}_WITH_STEP_TESTING_TOOL)
|
||||
find_package(cJSON REQUIRED)
|
||||
find_package(Z80InsnClock REQUIRED)
|
||||
|
||||
add_executable(step-test-${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/sources/step-test-Z80.c")
|
||||
target_link_libraries(step-test-${PROJECT_NAME} PRIVATE ${PROJECT_NAME} cjson Z80InsnClock)
|
||||
|
||||
target_compile_definitions(
|
||||
step-test-${PROJECT_NAME} PRIVATE
|
||||
$<$<BOOL:${${PROJECT_NAME}_WITH_EXECUTE}>:STEP_TEST_Z80_WITH_EXECUTE>)
|
||||
|
||||
install(TARGETS step-test-${PROJECT_NAME}
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
COMPONENT ${PROJECT_NAME}_Testing
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_WITH_TESTING_TOOL)
|
||||
include(CTest)
|
||||
|
||||
find_package(ZLIB QUIET)
|
||||
find_package(libzip QUIET)
|
||||
find_package(ZLIB QUIET)
|
||||
|
||||
add_executable(test-${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/sources/test-Z80.c")
|
||||
target_link_libraries(test-${PROJECT_NAME} PRIVATE ${PROJECT_NAME})
|
||||
@@ -326,9 +374,14 @@ if(${PROJECT_NAME}_WITH_TESTS)
|
||||
target_compile_definitions(test-${PROJECT_NAME} PRIVATE TEST_Z80_WITH_EXECUTE)
|
||||
endif()
|
||||
|
||||
install(TARGETS test-${PROJECT_NAME}
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
COMPONENT ${PROJECT_NAME}_Testing
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${PROJECT_NAME}_FETCH_TEST_FILES)
|
||||
function(_fetch_files _file_list _location _destination_dir)
|
||||
file(STRINGS "${_file_list}" _lines)
|
||||
function(_fetch_files _list_path _location _destination_dir)
|
||||
file(STRINGS "${_list_path}" _lines)
|
||||
|
||||
if(_location MATCHES ".*://.*")
|
||||
set(_message_action "Downloading")
|
||||
@@ -398,15 +451,15 @@ if(${PROJECT_NAME}_WITH_TESTS)
|
||||
(NOT ZLIB_FOUND OR NOT libzip_FOUND)
|
||||
)
|
||||
message(WARNING
|
||||
"libzip or zlib were not found on your system, which will cause the "
|
||||
"test-Z80 tool to be built without archive extraction support. When "
|
||||
"this happens, the build script extracts those test files that are "
|
||||
"compressed so that test-Z80 can use them later, but this has failed "
|
||||
"because the version of CMake you are using is too old and does not "
|
||||
"support archive extraction.\n"
|
||||
"To fix this, extract all files with `.tar.gz` or `.zip` extension "
|
||||
"located in "
|
||||
"`${CMAKE_CURRENT_BINARY_DIR}/depot/software/**/`")
|
||||
"libzip or zlib could not be found on your system, which causes "
|
||||
"`test-Z80` to be built without archive extraction support. "
|
||||
"In this case, the build system normally extracts compressed test "
|
||||
"files so that `test-Z80` can use them later, but this step has "
|
||||
"failed because the version of CMake you are using is too old and "
|
||||
"does not support archive extraction.\n"
|
||||
"To fix this, extract all archives with the \".tar.gz\" or \".zip\" "
|
||||
"extension located under "
|
||||
"\"${CMAKE_CURRENT_BINARY_DIR}/depot/software/**/\".")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -416,8 +469,14 @@ if(${PROJECT_NAME}_WITH_TESTS)
|
||||
set(_depot_dir "${${PROJECT_NAME}_DEPOT_LOCATION}")
|
||||
endif()
|
||||
|
||||
set(_test_name "Z80 test suites for CP/M and ZX Spectrum")
|
||||
|
||||
if(${PROJECT_NAME}_WITH_EXECUTE)
|
||||
string(APPEND _test_name " (using `z80_execute`)")
|
||||
endif()
|
||||
|
||||
add_test(
|
||||
NAME test-${PROJECT_NAME}
|
||||
NAME "${_test_name}"
|
||||
COMMAND test-${PROJECT_NAME}
|
||||
--path "${_depot_dir}/firmware"
|
||||
--path "${_depot_dir}/software/POSIX"
|
||||
@@ -425,11 +484,49 @@ if(${PROJECT_NAME}_WITH_TESTS)
|
||||
--all
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
unset(_test_name)
|
||||
|
||||
if(${PROJECT_NAME}_WITH_EXECUTE)
|
||||
add_test(
|
||||
NAME "Z80 test suites for CP/M and ZX Spectrum (using `z80_run`)"
|
||||
COMMAND test-${PROJECT_NAME}
|
||||
--run
|
||||
--path "${_depot_dir}/firmware"
|
||||
--path "${_depot_dir}/software/POSIX"
|
||||
--path "${_depot_dir}/software/ZX Spectrum"
|
||||
--all
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endif()
|
||||
|
||||
unset(_depot_dir)
|
||||
endif()
|
||||
|
||||
if(${PROJECT_NAME}_WITH_CODE_GENERATION_TOOLS)
|
||||
add_executable(
|
||||
${PROJECT_NAME}-generate-daa-af-table
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/sources/generate-daa-af-table.c")
|
||||
|
||||
set_target_properties(
|
||||
${PROJECT_NAME}-generate-daa-af-table
|
||||
PROPERTIES OUTPUT_NAME generate-daa-af-table)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}-generate-daa-af-table PRIVATE ${PROJECT_NAME})
|
||||
|
||||
add_executable(
|
||||
${PROJECT_NAME}-generate-pf-parity-table
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/sources/generate-pf-parity-table.c")
|
||||
|
||||
set_target_properties(
|
||||
${PROJECT_NAME}-generate-pf-parity-table
|
||||
PROPERTIES OUTPUT_NAME generate-pf-parity-table)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}-generate-pf-parity-table PRIVATE Zeta)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||
message("${PROJECT_NAME} END")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E echo
|
||||
"${PROJECT_NAME} v${PROJECT_VERSION} END")
|
||||
endif()
|
||||
|
||||
# CMakeLists.txt EOF
|
||||
|
||||
114
projects/Z80/HISTORY
vendored
114
projects/Z80/HISTORY
vendored
@@ -1,4 +1,4 @@
|
||||
Z80 v0.2-pre (2024-04-18)
|
||||
Z80 v0.2-pre (2025-07-02)
|
||||
=========================
|
||||
|
||||
This is an important update that addresses a number of issues and also includes
|
||||
@@ -12,97 +12,107 @@ Changes:
|
||||
4. Switched the build system from Premake to CMake.
|
||||
5. Switched to Zeta v0.1.
|
||||
6. Added pkg-config support.
|
||||
7. Added the following files to the project: .vimrc, CITATION.cff, file_id.diz
|
||||
and THANKS.
|
||||
7. Added the following files to the project: .vimrc, CITATION.cff and THANKS.
|
||||
8. Added detailed documentation.
|
||||
9. Added Pascal binding, courtesy of Zoran Vučenović.
|
||||
10. Added tests.
|
||||
11. Added public macros for checking the library version, working with flags,
|
||||
10. Added `test-Z80`, a tool that runs various Z80-specific tests for CP/M and
|
||||
ZX Spectrum.
|
||||
11. Added `step-test-Z80`, a tool for unit tests in JSON format.
|
||||
12. Renamed the macros `CPU_Z80_DEPENDENCIES_H` and `CPU_Z80_STATIC` to
|
||||
`Z80_EXTERNAL_HEADER` and `Z80_STATIC`, respectively.
|
||||
13. Added public macros for checking the library version, working with flags,
|
||||
accessing the 16-bit registers and other purposes.
|
||||
12. Added the ability to end the emulation loop immediately, and the `z80_break`
|
||||
14. Added the ability to end the emulation loop immediately, and the `z80_break`
|
||||
function.
|
||||
13. Added the `z80_execute` function for running a simplified emulation without
|
||||
15. Added the `z80_execute` function for running a simplified emulation without
|
||||
RESET and interrupts.
|
||||
14. Added the `z80_refresh_address` function for getting the refresh address of
|
||||
the current M1 cycle.
|
||||
15. Added the `z80_in_cycle` and `z80_out_cycle` functions for obtaining the
|
||||
16. Added the `z80_in_cycle` and `z80_out_cycle` functions for obtaining the
|
||||
clock cycle at which the I/O M-cycle begins, relative to the start of the
|
||||
instruction.
|
||||
16. Renamed the `z80_reset` function to `z80_instant_reset`.
|
||||
17. Added optional emulation of the special RESET, and the `z80_special_reset`
|
||||
17. Added the `z80_r` function for getting the current value of the R register.
|
||||
18. Added the `z80_refresh_address` function for getting the refresh address of
|
||||
the current M1 cycle.
|
||||
19. Added the `z80_wait` function for inserting wait states.
|
||||
20. Renamed the `z80_reset` function to `z80_instant_reset`.
|
||||
21. Added optional emulation of the special RESET, and the `z80_special_reset`
|
||||
function.
|
||||
18. Added the `Z80::fetch_opcode` and `Z80::fetch` callbacks for performing
|
||||
opcode fetch operations and memory read operations on instruction data
|
||||
respectively.
|
||||
19. Added the `Z80::nop` callback for performing disregarded opcode fetch
|
||||
22. Added the `Z80::fetch_opcode` and `Z80::fetch` callbacks for performing,
|
||||
respectively, opcode fetch operations and memory read operations on
|
||||
instruction data.
|
||||
23. Added the `Z80::nop` callback for performing disregarded opcode fetch
|
||||
operations during internal NOP M-cycles.
|
||||
20. Added emulation of the NMI acknowledge M-cycle through the new `Z80::nmia`
|
||||
24. Added emulation of the NMI acknowledge M-cycle through the new `Z80::nmia`
|
||||
callback.
|
||||
21. Added emulation of the INT acknowledge M-cycle through the new `Z80::inta`
|
||||
25. Added emulation of the INT acknowledge M-cycle through the new `Z80::inta`
|
||||
callback, which replaces `Z80::int_data`.
|
||||
22. Added optional full emulation of the interrupt mode 0, along with the new
|
||||
26. Added optional full emulation of the interrupt mode 0, along with the new
|
||||
`Z80::int_fetch` callback for performing 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.
|
||||
23. Added four callbacks for notifying the execution of important instructions:
|
||||
27. Added four callbacks for notifying the execution of important instructions:
|
||||
`Z80::ld_i_a`, `Z80::ld_r_a`, `Z80::reti` and `Z80::retn`.
|
||||
24. Added hooking functionality through the `ld h,h` instruction and the new
|
||||
28. Added hooking functionality through the `ld h,h` instruction and the new
|
||||
`Z80::hook` callback.
|
||||
25. Added the `Z80::illegal` callback for delegating the emulation of illegal
|
||||
29. Added the `Z80::illegal` callback for delegating the emulation of illegal
|
||||
instructions.
|
||||
26. Added emulation options that can be configured at runtime.
|
||||
27. Removed `Z80::state`. Replaced with individual members for the registers,
|
||||
30. Added emulation options that can be configured at runtime.
|
||||
31. Removed `Z80::state`. Replaced with individual members for the registers,
|
||||
the interrupt enable flip-flops and the interrupt mode.
|
||||
28. Removed the superfluous EI flag. The previous opcode is checked instead,
|
||||
32. Removed the superfluous EI flag. The previous opcode is checked instead,
|
||||
which is faster and makes the `Z80` object smaller.
|
||||
29. Removed all module-related stuff.
|
||||
30. Added emulation of the additional flag changes performed during the extra 5
|
||||
33. Removed all module-related stuff.
|
||||
34. Added emulation of the additional flag changes performed during the extra 5
|
||||
clock cycles of the following instructions: `ldir`, `lddr`, `cpir`, `cpdr`,
|
||||
`inir`, `indr`, `otir` and `otdr`.
|
||||
31. Added emulation of the interrupt acceptance deferral that occurs during the
|
||||
35. Added emulation of the interrupt acceptance deferral that occurs during the
|
||||
`reti` and `retn` instructions.
|
||||
32. Added MEMPTR emulation. The `bit N,(hl)` instruction now produces a correct
|
||||
36. Added MEMPTR emulation. The `bit N,(hl)` instruction now produces a correct
|
||||
value of F.
|
||||
33. Added optional emulation of Q. If enabled at compile-time, the `ccf` and
|
||||
37. Added optional emulation of Q. If enabled at compile-time, the `ccf` and
|
||||
`scf` instructions will produce a correct value of F.
|
||||
34. Added emulation of the `out (c),255` instruction (Zilog Z80 CMOS).
|
||||
35. Added optional emulation of the bug affecting the `ld a,{i|r}` instructions
|
||||
38. Added emulation of the `out (c),255` instruction (Zilog Z80 CMOS).
|
||||
39. Added optional emulation of the bug affecting the `ld a,{i|r}` instructions
|
||||
(Zilog Z80 NMOS). If enabled at compile-time and configured at runtime, the
|
||||
P/V flag will be reset if an INT is accepted during the execution of these
|
||||
instructions.
|
||||
36. Increased granularity. The emulator can now stop directly after fetching a
|
||||
40. Added an optional implementation of the parity calculation for the P/V flag
|
||||
that performs the actual computation instead of using a table of precomputed
|
||||
values.
|
||||
41. Added an optional implementation of the `daa` instruction that uses a table
|
||||
of precomputed values.
|
||||
42. Increased granularity. The emulator can now stop directly after fetching a
|
||||
prefix DDh or FDh if it runs out of clock cycles. This also works during the
|
||||
INT response in mode 0.
|
||||
37. Reimplemented the HALT state. The emulation should now be fully accurate.
|
||||
43. Reimplemented the HALT state. The emulation should now be fully accurate.
|
||||
HALTskip optimization is also supported.
|
||||
38. Fixed a bug in the `sll` instruction.
|
||||
39. Fixed a bug in the `INX` and `OUTX` macros affecting the S and N flags.
|
||||
40. Fixed a bug in the `OUTX` macro affecting the MSByte of the port number.
|
||||
41. Fixed the clock cycles of the `dec XY` and `in (c)` instructions.
|
||||
42. Fixed the `read_16` function so that the order of the memory read operations
|
||||
44. Fixed a bug in the `sll` instruction.
|
||||
45. Fixed a bug in the `INX` and `OUTX` macros affecting the S and N flags.
|
||||
46. Fixed a bug in the `OUTX` macro affecting the MSByte of the port number.
|
||||
47. Fixed the clock cycles of the `dec XY` and `in (c)` instructions.
|
||||
48. Fixed the `read_16` function so that the order of the memory read operations
|
||||
is not determined by the order in which the compiler evaluates expressions.
|
||||
43. Fixed the order in which the memory write operations are performed when the
|
||||
49. 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`.
|
||||
44. Fixed the handling of illegal instructions to avoid stack overflows in long
|
||||
50. Fixed the handling of illegal instructions to avoid stack overflows in long
|
||||
sequences of DDh/FDh prefixes.
|
||||
45. Fixed several implicit conversions to avoid warnings about loss of sign and
|
||||
51. Fixed several implicit conversions to avoid warnings about loss of sign and
|
||||
precision.
|
||||
46. Fixed some bitwise operations to avoid undefined behavior and arithmetic
|
||||
52. Fixed some bitwise operations to avoid undefined behavior and arithmetic
|
||||
right shifts on signed integers.
|
||||
47. Fixed violations of the C standard in several identifiers.
|
||||
48. Renamed the 8-bit register lists: X/Y to J/K; J/K and P/Q to O/P.
|
||||
49. Replaced all P/V overflow computation functions with a single, faster macro.
|
||||
50. Replaced all register resolution functions with macros.
|
||||
51. Replaced all `ld {J,K|O,P}` instructions that have the same destination and
|
||||
53. Fixed violations of the C standard in several identifiers.
|
||||
54. Renamed the 8-bit register lists: X/Y to J/K; J/K and P/Q to O/P.
|
||||
55. Replaced all P/V overflow computation functions with a single, faster macro.
|
||||
56. Replaced all register resolution functions with macros.
|
||||
57. Replaced all `ld {J,K|O,P}` instructions that have the same destination and
|
||||
source register with NOPs. In addition, the "illegal" forms of the following
|
||||
instructions are now executed without using the illegal instruction handler:
|
||||
`ld O,P`, `ld O,BYTE`, `U [a,]P` and `V O`.
|
||||
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.
|
||||
58. Optimizations in flag computation and condition evaluation.
|
||||
59. New source code comments and improvements to existing ones.
|
||||
60. Improved code aesthetics.
|
||||
61. Other improvements, optimizations and minor changes.
|
||||
|
||||
|
||||
Z80 v0.1 (2018-11-10)
|
||||
|
||||
118
projects/Z80/README
vendored
118
projects/Z80/README
vendored
@@ -15,7 +15,7 @@
|
||||
| Zilog Z80 CPU Emulator |
|
||||
| version 0.2 |
|
||||
| |
|
||||
| Copyright (C) 1999-2024 Manuel Sainz de Baranda y Goñi |
|
||||
| Copyright (C) 1999-2026 Manuel Sainz de Baranda y Goñi |
|
||||
| Released under the terms of the GNU Lesser General Public License v3 |
|
||||
| |
|
||||
| https://zxe.io/software/Z80 |
|
||||
@@ -41,7 +41,7 @@ need for major changes.
|
||||
============
|
||||
|
||||
This Z80 CPU emulator has a classic design with instruction-level granularity
|
||||
that delivers the best performance, whilst offering a reasonable flexibility to
|
||||
that delivers high performance, whilst offering reasonable flexibility to
|
||||
achieve precision down to the T-state level.
|
||||
|
||||
Instruction-level granularity implies that, except in a few well-defined cases,
|
||||
@@ -59,33 +59,41 @@ Test Suite", Patrik Rak's "Zilog Z80 CPU Test Suite" and Peter Helcmanovsky's
|
||||
"Z80 Block Flags Test", to name a few.
|
||||
|
||||
|
||||
3. Installation
|
||||
================
|
||||
3. Installation from source code
|
||||
=================================
|
||||
|
||||
3.1. Prerequisites
|
||||
|
||||
You will need CMake v3.14 or later to build the package and, optionally, recent
|
||||
versions of Doxygen, Sphinx and Breathe to compile the documentation. Also, make
|
||||
sure that you have LaTeX with PDF support installed on your system if 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 library used to retain compatibility with most C
|
||||
compilers. Install Zeta or extract its source code tarball to the root 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
|
||||
The Z80 library requires some types and macros included in Zeta, a header-only,
|
||||
dependency-free library used for portability reasons. Install Zeta or extract
|
||||
its source code tarball to the root directory of the Z80 project or its parent
|
||||
directory. Zeta is the sole dependency; the emulator does not depend on the C
|
||||
standard library.
|
||||
|
||||
Once the prerequisites are met, create a directory and run cmake from there to
|
||||
Lastly, the package includes two testing tools, which are optional to build.
|
||||
The first one runs various Z80-specific tests for CP/M and ZX Spectrum, and will
|
||||
use libzip and zlib if they are available on your system. The second tool is for
|
||||
unit tests in JSON format and requires the cJSON and Z80InsnClock libraries.
|
||||
|
||||
3.2. Configure
|
||||
|
||||
Once the prerequisites are met, create a directory and run `cmake` from there to
|
||||
prepare the build system:
|
||||
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake [options] <Z80-project-directory>
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
$ cmake -LAH
|
||||
$ cmake -LAH -N -B .
|
||||
|
||||
If in doubt, read the CMake documentation for more information on configuration
|
||||
options. The following are some of the most relevant standard options of CMake:
|
||||
@@ -98,6 +106,11 @@ options. The following are some of the most relevant standard options of CMake:
|
||||
Choose the type of build (configuration) to generate.
|
||||
The default is `Release`.
|
||||
|
||||
-DCMAKE_INSTALL_NAME_DIR="<path>"
|
||||
Specify the directory portion of the dynamic library install name on
|
||||
Apple platforms (for installed shared libraries).
|
||||
Not defined by default.
|
||||
|
||||
-DCMAKE_INSTALL_PREFIX="<path>"
|
||||
Specify the installation prefix.
|
||||
The default is `/usr/local` (on UNIX and UNIX-like operating systems).
|
||||
@@ -108,11 +121,12 @@ library:
|
||||
|
||||
-DZ80_DEPOT_LOCATION="<location>"
|
||||
Specify the directory or URL of the depot containing the test files
|
||||
(i.e., the firmware and software required by the testing tool).
|
||||
(i.e., the firmware and software required by the `test-Z80` tool).
|
||||
The default is `http://zxe.io/depot`.
|
||||
|
||||
-DZ80_FETCH_TEST_FILES=(YES|NO)
|
||||
Copy or download the test files from the depot to the build directory.
|
||||
If `Z80_WITH_TESTING_TOOL` is `YES`, copy or download the test files
|
||||
from the depot to the build directory.
|
||||
The default is `NO`.
|
||||
|
||||
-DZ80_INSTALL_CMAKEDIR="<path>"
|
||||
@@ -168,8 +182,14 @@ library:
|
||||
AUTHORS, COPYING, COPYING.LESSER, HISTORY, README and THANKS.
|
||||
The default is `NO`.
|
||||
|
||||
-DZ80_WITH_TESTS=(YES|NO)
|
||||
Build the testing tool.
|
||||
-DZ80_WITH_STEP_TESTING_TOOL=(YES|NO)
|
||||
Build `step-test-Z80`, a tool for unit tests in JSON format.
|
||||
It requires cJSON and Z80InsnClock.
|
||||
The default is `NO`.
|
||||
|
||||
-DZ80_WITH_TESTING_TOOL=(YES|NO)
|
||||
Build `test-Z80`, a tool that runs various Z80-specific tests for CP/M
|
||||
and ZX Spectrum.
|
||||
The default is `NO`.
|
||||
|
||||
The second group of package-specific options configures the source code of the
|
||||
@@ -189,6 +209,16 @@ library by predefining macros that enable optional features:
|
||||
executed during the interrupt mode 0 response.
|
||||
The default is `NO`.
|
||||
|
||||
-DZ80_WITH_PARITY_COMPUTATION=(YES|NO)
|
||||
Enable actual parity calculation for the P/V flag instead of using a
|
||||
table of precomputed values (NOT RECOMMENDED for production builds).
|
||||
The default is `NO`.
|
||||
|
||||
-DZ80_WITH_PRECOMPUTED_DAA=(YES|NO)
|
||||
Use a table of precomputed values to emulate the `daa` instruction (NOT
|
||||
RECOMMENDED for production builds).
|
||||
The default is `NO`.
|
||||
|
||||
-DZ80_WITH_Q=(YES|NO)
|
||||
Build the implementation of Q.
|
||||
The default is `NO`.
|
||||
@@ -217,6 +247,8 @@ shared library:
|
||||
-DZ80_WITH_Q=YES
|
||||
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=YES
|
||||
|
||||
3.3. Build and install
|
||||
|
||||
Finally, once the build system is configured according to your needs, build and
|
||||
install the package:
|
||||
|
||||
@@ -253,14 +285,16 @@ the static versions, `BUILD_SHARED_LIBS` determines which one to link against.
|
||||
4.2. As a CMake subproject
|
||||
|
||||
To embed the Z80 library as a CMake subproject, extract the source code tarballs
|
||||
of Zeta (https://zeta.st) and Z80 (or clone their respective repositories) into
|
||||
a subdirectory of another project. Then use `add_subdirectory` in the parent
|
||||
project to add the Z80 source code tree to the build process (N.B., the Z80
|
||||
subproject will automatically find Zeta and import it as an interface library).
|
||||
of Zeta and Z80 (or clone their respective repositories) into a subdirectory of
|
||||
another project. Then use `add_subdirectory` in the parent project to add the
|
||||
Z80 source code tree to the build process (N.B., the Z80 subproject will
|
||||
automatically find Zeta and import it as an interface library).
|
||||
|
||||
It is advisable to configure the Z80 library in the CMakeLists.txt of the parent
|
||||
project. This will prevent the user from having to specify configuration options
|
||||
for the Z80 subproject through the command line when building the main project.
|
||||
project. This will eliminate the need for the user to specify configuration
|
||||
options for the Z80 subproject through the command line when building the main
|
||||
project. See section 3.2 of this document for a list of available configuration
|
||||
options.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -281,39 +315,42 @@ The source code of the emulator can be configured at compile time by predefining
|
||||
a series of macros. Both Z80.h and Z80.c obey the first two explained below. The
|
||||
rest of the macros are only relevant when compiling Z80.c:
|
||||
|
||||
#define Z80_DEPENDENCIES_HEADER "header-name.h"
|
||||
#define Z80_EXTERNAL_HEADER "header-name.h"
|
||||
Specifies the only external header to `#include`, replacing all others.
|
||||
Predefine this macro to provide a header file that defines the external
|
||||
types and macros used by the emulator, thus preventing your project from
|
||||
depending on Zeta. You can use this when compiling Z80.c as a part of
|
||||
your project or (if your types do not break the binary compatibility)
|
||||
when including `<Z80.h>` and linking against a pre-built Z80 library.
|
||||
depending on Zeta. You can use this when compiling Z80.c within your
|
||||
project or (if your types do not break the binary compatibility) when
|
||||
including `<Z80.h>` and linking against a pre-built Z80 library.
|
||||
|
||||
#define Z80_STATIC
|
||||
Restricts the visibility of public symbols.
|
||||
This macro is required if you are building Z80.c as a static library,
|
||||
compiling it directly as a part of your project, or linking your program
|
||||
against the static version of the Z80 library. In either of these cases,
|
||||
make sure this macro is defined before including `"Z80.h"` or `<Z80.h>`.
|
||||
Indicates that the emulator is a static library.
|
||||
This macro must be predefined when building Z80.c as a static library.
|
||||
Additionally, if you compile Z80.c directly within your project or link
|
||||
your program against the static version of the Z80 library, ensure that
|
||||
this macro is defined before including `"Z80.h"` or `<Z80.h>`.
|
||||
|
||||
#define Z80_WITH_LOCAL_HEADER
|
||||
Tells Z80.c to `#include "Z80.h"` instead of `<Z80.h>`.
|
||||
|
||||
The optional features of the emulator mentioned in section 3 of this document
|
||||
are disabled by default. If you compile Z80.c as a part of your project, enable
|
||||
those features you need by predefining their respective activation macros. They
|
||||
have the same name as their CMake equivalents:
|
||||
The optional features of the emulator mentioned in section 3.2 of this document
|
||||
are disabled by default. If you compile Z80.c within your project, enable those
|
||||
features you need by predefining their respective activation macros. They have
|
||||
the same name as their CMake equivalents:
|
||||
|
||||
#define Z80_WITH_EXECUTE
|
||||
#define Z80_WITH_FULL_IM0
|
||||
#define Z80_WITH_IM0_RETX_NOTIFICATIONS
|
||||
#define Z80_WITH_PARITY_COMPUTATION
|
||||
#define Z80_WITH_PRECOMPUTED_DAA
|
||||
#define Z80_WITH_Q
|
||||
#define Z80_WITH_SPECIAL_RESET
|
||||
#define Z80_WITH_UNOFFICIAL_RETI
|
||||
#define Z80_WITH_VOLATILE_CYCLES
|
||||
#define Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG
|
||||
|
||||
Except for `Z80_DEPENDENCIES_HEADER`, the above macros can be empty; the source
|
||||
code only checks whether they are defined.
|
||||
Except for `Z80_EXTERNAL_HEADER`, the above macros can be empty; the source code
|
||||
only checks whether they are defined.
|
||||
|
||||
Please note that the activation of some of the optional features affects the
|
||||
speed of the emulator due to various factors (read the documentation for more
|
||||
@@ -335,5 +372,6 @@ 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 library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
________________________________________________________________________________
|
||||
Last update: 2023-12-31 README EOF
|
||||
Last update: 2026-01-01 README EOF
|
||||
|
||||
423
projects/Z80/README.md
vendored
423
projects/Z80/README.md
vendored
@@ -1,14 +1,15 @@
|
||||
# Zilog Z80 CPU Emulator
|
||||
|
||||
[](https://zxe.io/software/Z80/documentation/latest)
|
||||
[](https://zxe.io/software/Z80/documentation/latest)
|
||||
[](https://github.com/redcode/Z80/actions/workflows/build-and-test-library.yml)
|
||||
[](https://github.com/redcode/Z80/actions/workflows/build-documentation.yml)
|
||||
[](https://zxe.io/software/Z80/chat)
|
||||
[](https://github.com/redcode/Z80/actions/workflows/step-tests.yml)
|
||||
[](https://zxe.io/software/Z80/chat)
|
||||

|
||||
|
||||
## Introduction
|
||||
|
||||
<img src="https://zxe.io/software/Z80/assets/images/Z80.svg" width="256" align="right">
|
||||
<img src="https://zxe.io/software/Z80/assets/images/Z80.svg" height="72" width="256" align="right">
|
||||
|
||||
The [Z80 library](https://zxe.io/software/Z80) implements a fast, small and accurate [emulator](https://en.wikipedia.org/wiki/Emulator) of the [Zilog Z80](https://en.wikipedia.org/wiki/Zilog_Z80). It emulates all that is known to date about this CPU, including the undocumented behaviors, [MEMPTR](https://zxpress.ru/zxnet/zxnet.pc/5909), [Q](https://worldofspectrum.org/forums/discussion/41704) and the [special RESET](http://www.primrosebank.net/computers/z80/z80_special_reset.htm). It also has the honor of having been the first open-source project to provide full emulation of the interrupt mode 0.
|
||||
|
||||
@@ -16,9 +17,9 @@ The source code is written in [ANSI C](https://en.wikipedia.org/wiki/ANSI_C) for
|
||||
|
||||
## Accuracy
|
||||
|
||||
This Z80 CPU emulator has a classic design with instruction-level granularity that delivers the best performance, whilst offering a reasonable flexibility to achieve [precision down to the T-state level](https://github.com/agaxia/Z80InsnClock).
|
||||
This Z80 CPU emulator has a classic design with instruction-level granularity that delivers high performance, whilst offering reasonable flexibility to achieve [precision down to the T-state level](https://github.com/agaxia/Z80InsnClock).
|
||||
|
||||
Instruction-level granularity implies that, except in a few well-defined cases, the execution of a given instruction cannot stop until all its internal M-cycles have been processed (i.e., instructions are not divided into micro-operations). Moreover, registers are modified only once per instruction and the [T-state counter](https://zxe.io/software/Z80/documentation/latest/APIReference.html#c.Z80.cycles) is normally updated after a full instruction has been executed.
|
||||
Instruction-level granularity implies that, except in a few well-defined cases, the execution of a given instruction cannot stop until all its internal M-cycles have been processed (i.e., instructions are not divided into micro-operations). Moreover, registers are modified only once per instruction and the [T-state counter](https://zxe.io/software/Z80/documentation/latest/api-reference.html#c.Z80.cycles) is normally updated after a full instruction has been executed.
|
||||
|
||||
That said, instructions, flags, memory accesses, interrupts, clock cycles, etc., are accurately emulated according to the available [technical documentation](https://github.com/redcode/Z80/wiki/Technical-literature), the findings made after decades of research on the Z80 and [electronic simulations](https://github.com/redcode/Z80/wiki/Simulators). And, of course, the emulator passes the most exhaustive [tests](https://github.com/redcode/Z80/wiki/Tests) written to date, including all three major test suites:
|
||||
|
||||
@@ -306,60 +307,19 @@ Frank Cringle's _Z80 Instruction Set Exerciser_ attempts to execute every Z80 op
|
||||
|
||||
## Installation
|
||||
|
||||
### <sub><img src="https://zxe.io/software/Z80/assets/images/debian-icon.svg" height="24"></sub> Debian, <sub><img src="https://zxe.io/software/Z80/assets/images/ubuntu-icon.svg" height="24"></sub> Ubuntu and other Debian-based Linux distributions
|
||||
The Z80 library is available through various package managers. For an up-to-date list and installation instructions, see the "[Installation](https://github.com/redcode/Z80/wiki/Installation)" page on the repository wiki.
|
||||
|
||||
First, add the `zxe` repository and update the package index:
|
||||
## Installation from source code
|
||||
|
||||
```shell
|
||||
sudo mkdir -pm700 /root/.gnupg
|
||||
sudo mkdir -pm755 /etc/apt/keyrings
|
||||
sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/zxe-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys FE214A38D6A0C01D9AF514EE841EA3BD3A7E1487
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/zxe-archive-keyring.gpg] https://zxe.io/repos/apt stable main" | sudo tee /etc/apt/sources.list.d/zxe.list
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
Next, install the library package:
|
||||
|
||||
```shell
|
||||
sudo apt install libz80
|
||||
```
|
||||
|
||||
In case you need to build software that requires the Z80 library, install the development package too:
|
||||
|
||||
```shell
|
||||
sudo apt install libz80-dev
|
||||
```
|
||||
|
||||
### <sub><img src="https://zxe.io/software/Z80/assets/images/gentoo-icon.svg" height="24"></sub> Gentoo
|
||||
|
||||
First, add and sync the [`zxe`](https://github.com/redcode/zxe-gentoo-overlay) overlay:
|
||||
|
||||
```shell
|
||||
eselect repository add zxe git https://github.com/redcode/zxe-gentoo-overlay.git
|
||||
emaint sync --repo zxe
|
||||
```
|
||||
|
||||
Then install the library:
|
||||
|
||||
```shell
|
||||
emerge emulation-libs/z80
|
||||
```
|
||||
|
||||
### <sub><img src="https://zxe.io/software/Z80/assets/images/homebrew-icon.svg" height="24"></sub> Homebrew
|
||||
|
||||
```shell
|
||||
brew install redcode/zxe/z80
|
||||
```
|
||||
|
||||
### <sub><img src="https://zxe.io/software/Z80/assets/images/windows-icon.png" height="24"></sub> Windows
|
||||
|
||||
Pre-built binaries for Windows are available on the [download](https://zxe.io/software/Z80/download) page.
|
||||
|
||||
## Installation from sources
|
||||
### Prerequisites
|
||||
|
||||
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://www.breathe-doc.org) to compile the documentation. Also, make sure that you have [LaTeX](https://www.latex-project.org) with PDF support installed on your system if 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 [source code tarball](https://zeta.st/download) to the root 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).
|
||||
The Z80 library requires some types and macros included in [Zeta](https://zxe.io/software/Zeta), a [header-only](https://en.wikipedia.org/wiki/Header-only), dependency-free library used for portability reasons. Install Zeta or extract its [source code tarball](https://zxe.io/software/Zeta/download) to the root directory of the Z80 project or its parent directory. Zeta is the sole dependency; the emulator does not depend on the [C standard library](https://en.wikipedia.org/wiki/C_standard_library).
|
||||
|
||||
Lastly, the package includes two testing tools, which are optional to build. The first one runs various Z80-specific tests for [CP/M](https://en.wikipedia.org/wiki/CP/M) and [ZX Spectrum](https://en.wikipedia.org/wiki/ZX_Spectrum), and will use [libzip](https://libzip.org) and [zlib](https://zlib.net) if they are available on your system. The second tool is for [unit tests in JSON format](https://github.com/SingleStepTests/z80) and requires the [cJSON](https://github.com/DaveGamble/cJSON) and [Z80InsnClock](https://zxe.io/software/Z80InsnClock) libraries.
|
||||
|
||||
### Configure
|
||||
|
||||
Once the prerequisites are met, create a directory and run `cmake` from there to prepare the build system:
|
||||
|
||||
@@ -372,7 +332,7 @@ cmake [options] <Z80-project-directory>
|
||||
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:
|
||||
|
||||
```shell
|
||||
cmake -LAH
|
||||
cmake -LAH -N -B .
|
||||
```
|
||||
|
||||
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:
|
||||
@@ -385,6 +345,10 @@ If in doubt, read the [CMake documentation](https://cmake.org/documentation/) fo
|
||||
Choose the type of build (configuration) to generate.
|
||||
The default is `Release`.
|
||||
|
||||
* <span id="cmake_option_cmake_install_name_dir">**<code>-D[CMAKE_INSTALL_NAME_DIR](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_NAME_DIR.html)="\<path\>"</code>**</span>
|
||||
Specify the [directory portion](https://developer.apple.com/documentation/xcode/build-settings-reference#Dynamic-Library-Install-Name-Base) of the [dynamic library install name](https://developer.apple.com/documentation/xcode/build-settings-reference#Dynamic-Library-Install-Name) on Apple platforms (for installed shared libraries).
|
||||
Not defined by default.
|
||||
|
||||
* <span id="cmake_option_cmake_install_prefix">**<code>-D[CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)="\<path\>"</code>**</span>
|
||||
Specify the installation prefix.
|
||||
The default is `"/usr/local"` (on [UNIX](https://en.wikipedia.org/wiki/Unix) and [UNIX-like](https://en.wikipedia.org/wiki/Unix-like) operating systems).
|
||||
@@ -392,11 +356,11 @@ If in doubt, read the [CMake documentation](https://cmake.org/documentation/) fo
|
||||
<span id="cmake_package_options">Package-specific options</span> 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:
|
||||
|
||||
* <span id="cmake_option_z80_depot_location">**`-DZ80_DEPOT_LOCATION="<location>"`**</span>
|
||||
Specify the directory or URL of the depot containing the test files (i.e., the firmware and software required by the [testing tool](#running-the-tests)).
|
||||
Specify the directory or URL of the depot containing the test files (i.e., the firmware and software required by the [`test-Z80`](#running-the-tests) tool).
|
||||
The default is `"http://zxe.io/depot"`.
|
||||
|
||||
* <span id="cmake_option_z80_fetch_test_files">**`-DZ80_FETCH_TEST_FILES=(YES|NO)`**</span>
|
||||
Copy or download the test files from the depot to the build directory.
|
||||
If [`Z80_WITH_TESTING_TOOL`](#cmake_option_z80_with_testing_tool) is `YES`, copy or download the test files from the depot to the build directory.
|
||||
The default is `NO`.
|
||||
|
||||
* <span id="cmake_option_z80_install_cmakedir">**`-DZ80_INSTALL_CMAKEDIR="<path>"`**</span>
|
||||
@@ -447,14 +411,19 @@ If in doubt, read the [CMake documentation](https://cmake.org/documentation/) fo
|
||||
Install the standard text documents distributed with the package: [`AUTHORS`](AUTHORS), [`COPYING`](COPYING), [`COPYING.LESSER`](COPYING.LESSER), [`HISTORY`](HISTORY), [`README`](README) and [`THANKS`](THANKS).
|
||||
The default is `NO`.
|
||||
|
||||
* <span id="cmake_option_z80_with_tests">**`-DZ80_WITH_TESTS=(YES|NO)`**</span>
|
||||
Build the [testing tool](#running-the-tests).
|
||||
* <span id="cmake_option_z80_with_step_testing_tool">**`-DZ80_WITH_STEP_TESTING_TOOL=(YES|NO)`**</span>
|
||||
Build `step-test-Z80`, a tool for [unit tests in JSON format](https://github.com/SingleStepTests/z80).
|
||||
It requires cJSON and Z80InsnClock.
|
||||
The default is `NO`.
|
||||
|
||||
<span id="cmake_package_source_code_options">The second group of package-specific options</span> configures the source code of the library by predefining macros that enable [optional features](https://zxe.io/software/Z80/documentation/latest/Introduction.html#optional-features):
|
||||
* <span id="cmake_option_z80_with_testing_tool">**`-DZ80_WITH_TESTING_TOOL=(YES|NO)`**</span>
|
||||
Build `test-Z80`, a tool that runs various Z80-specific tests for [CP/M](https://en.wikipedia.org/wiki/CP/M) and [ZX Spectrum](https://en.wikipedia.org/wiki/ZX_Spectrum).
|
||||
The default is `NO`.
|
||||
|
||||
<span id="cmake_package_source_code_options">The second group of package-specific options</span> configures the source code of the library by predefining macros that enable [optional features](https://zxe.io/software/Z80/documentation/latest/introduction.html#optional-features):
|
||||
|
||||
* <span id="cmake_option_z80_with_execute">**`-DZ80_WITH_EXECUTE=(YES|NO)`**</span>
|
||||
Build the implementation of the [`z80_execute`](https://zxe.io/software/Z80/documentation/latest/APIReference.html#c.z80_execute) function.
|
||||
Build the implementation of the [`z80_execute`](https://zxe.io/software/Z80/documentation/latest/api-reference.html#c.z80_execute) function.
|
||||
The default is `NO`.
|
||||
|
||||
* <span id="cmake_option_z80_with_full_im0">**`-DZ80_WITH_FULL_IM0=(YES|NO)`**</span>
|
||||
@@ -465,6 +434,14 @@ If in doubt, read the [CMake documentation](https://cmake.org/documentation/) fo
|
||||
Enable optional notifications for any `reti` or `retn` instruction executed during the interrupt mode 0 response.
|
||||
The default is `NO`.
|
||||
|
||||
* <span id="cmake_option_z80_with_parity_computation">**`-DZ80_WITH_PARITY_COMPUTATION=(YES|NO)`**</span>
|
||||
Enable actual parity calculation for the P/V flag instead of using a table of precomputed values (NOT RECOMMENDED for production builds).
|
||||
The default is `NO`.
|
||||
|
||||
* <span id="cmake_option_z80_with_precomputed_daa">**`-DZ80_WITH_PRECOMPUTED_DAA=(YES|NO)`**</span>
|
||||
Use a table of precomputed values to emulate the `daa` instruction (NOT RECOMMENDED for production builds).
|
||||
The default is `NO`.
|
||||
|
||||
* <span id="cmake_option_z80_with_q">**`-DZ80_WITH_Q=(YES|NO)`**</span>
|
||||
Build the implementation of [Q](https://worldofspectrum.org/forums/discussion/41704).
|
||||
The default is `NO`.
|
||||
@@ -491,6 +468,8 @@ Package maintainers are encouraged to use at least the following options for the
|
||||
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=YES
|
||||
```
|
||||
|
||||
### Build and install
|
||||
|
||||
Finally, once the build system is configured according to your needs, build and install the package:
|
||||
|
||||
```shell
|
||||
@@ -512,7 +491,7 @@ cd Zeta
|
||||
mkdir build && cd build
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
|
||||
-DCMAKE_INSTALL_PREFIX="$HOME/.local" \
|
||||
-DZeta_WITH_CMAKE_SUPPORT=YES \
|
||||
-DZeta_WITH_PKGCONFIG_SUPPORT=YES \
|
||||
..
|
||||
@@ -522,7 +501,8 @@ mkdir build && cd build
|
||||
cmake \
|
||||
-DBUILD_SHARED_LIBS=YES \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
|
||||
-DCMAKE_INSTALL_NAME_DIR="$HOME/.local/lib" \
|
||||
-DCMAKE_INSTALL_PREFIX="$HOME/.local" \
|
||||
-DZ80_WITH_CMAKE_SUPPORT=YES \
|
||||
-DZ80_WITH_PKGCONFIG_SUPPORT=YES \
|
||||
-DZ80_WITH_EXECUTE=YES \
|
||||
@@ -535,11 +515,11 @@ cmake --build . --config Release
|
||||
cmake --install . --config Release --strip
|
||||
```
|
||||
|
||||
<sup>**[<sub><img src="https://zxe.io/software/Z80/assets/images/sh.svg" height="14"></sub> build-and-install-Z80.sh](https://zxe.io/software/Z80/scripts/build-and-install-Z80.sh)**</sup>
|
||||
<sup>**[<sub><img src="https://zxe.io/software/Z80/assets/images/sh.svg" height="14" width="19"></sub> build-and-install-Z80.sh](https://zxe.io/software/Z80/scripts/build-and-install-Z80.sh)**</sup>
|
||||
|
||||
## Running the tests
|
||||
|
||||
The package includes a tool called [`test-Z80`](sources/test-Z80.c) capable of running the most relevant [CP/M](https://en.wikipedia.org/wiki/CP/M) and [ZX Spectrum](https://en.wikipedia.org/wiki/ZX_Spectrum) versions of the [major test suites](#major_test_suites). Configure the build system with <code>-D[Z80_WITH_TESTS](#cmake_option_z80_with_tests)=YES</code> to enable its compilation and <code>-D[Z80_FETCH_TEST_FILES](#cmake_option_z80_fetch_test_files)=YES</code> to download the firmware and software required. Also note that the Z80 library must be built with <code>-D[Z80_WITH_Q](#cmake_option_z80_with_q)=YES</code> to be able to pass [Patrik Rak's tests](#zilog-z80-cpu-test-suite-by-patrik-rak).
|
||||
The package includes a tool called [`test-Z80`](sources/test-Z80.c) that runs the most relevant [CP/M](https://en.wikipedia.org/wiki/CP/M) and [ZX Spectrum](https://en.wikipedia.org/wiki/ZX_Spectrum) versions of the [major test suites](#major_test_suites). Configure the build system with <code>-D[Z80_WITH_TESTING_TOOL](#cmake_option_z80_with_testing_tool)=YES</code> to enable its compilation and <code>-D[Z80_FETCH_TEST_FILES](#cmake_option_z80_fetch_test_files)=YES</code> to download the firmware and software required. Also note that the Z80 library must be built with <code>-D[Z80_WITH_Q](#cmake_option_z80_with_q)=YES</code> to be able to pass [Patrik Rak's tests](#zilog-z80-cpu-test-suite-by-patrik-rak).
|
||||
|
||||
Once you have built the package, type the following to run all tests:
|
||||
|
||||
@@ -547,21 +527,16 @@ Once you have built the package, type the following to run all tests:
|
||||
./test-Z80 -p depot/firmware -p depot/software/POSIX -p "depot/software/ZX Spectrum" -a
|
||||
```
|
||||
|
||||
The tool supports options and can run the tests individually (type <code>./test-Z80 -h</code> for help). If you prefer to run all tests through [CTest](https://cmake.org/cmake/help/latest/manual/ctest.1.html), use this command:
|
||||
The tool supports options and can run the tests individually (type <code>./test-Z80 -h</code> for help).
|
||||
|
||||
If you prefer to run all tests through [CTest](https://cmake.org/cmake/help/latest/manual/ctest.1.html), use this:
|
||||
|
||||
```shell
|
||||
ctest --verbose --build-config (Debug|Release|RelWithDebInfo|MinSizeRel)
|
||||
ctest -N # List available tests
|
||||
ctest --verbose --build-config (Debug|Release|RelWithDebInfo|MinSizeRel) [-I <test-index>,<test-index>]
|
||||
```
|
||||
|
||||
The complete logs generated by `test-Z80` emulating different CPU variants are available here:
|
||||
|
||||
* [Zilog NMOS](https://zxe.io/software/Z80/tests/logs/test-Z80%20v0.2%20Results%20-%20Zilog%20NMOS.txt)
|
||||
* [Zilog CMOS](https://zxe.io/software/Z80/tests/logs/test-Z80%20v0.2%20Results%20-%20Zilog%20CMOS.txt)
|
||||
* [NEC NMOS](https://zxe.io/software/Z80/tests/logs/test-Z80%20v0.2%20Results%20-%20NEC%20NMOS.txt)
|
||||
* [ST CMOS](https://zxe.io/software/Z80/tests/logs/test-Z80%20v0.2%20Results%20-%20ST%20CMOS.txt)
|
||||
|
||||
> [!NOTE]
|
||||
> The CRC errors in the logs of the NEC NMOS variant **are normal** and match the [values obtained on real hardware](https://jisanchez.com/test-a-dos-placas-de-zx-spectrum). The ST CMOS variant is currently [under investigation](https://github.com/redcode/Z80_XCF_Flavor/issues/2).
|
||||
By default, if the build system has been configured with <code>-D[Z80_WITH_EXECUTE](#cmake_option_z80_with_execute)=YES</code>, CTest will run the tests twice to increase coverage. Using [`-I`](https://cmake.org/cmake/help/latest/manual/ctest.1.html#cmdoption-ctest-I) allows you to run only the test corresponding to the specified index.
|
||||
|
||||
### TL;DR
|
||||
|
||||
@@ -576,7 +551,7 @@ mkdir build && cd build
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DZ80_FETCH_TEST_FILES=YES \
|
||||
-DZ80_WITH_TESTS=YES \
|
||||
-DZ80_WITH_TESTING_TOOL=YES \
|
||||
-DZ80_WITH_EXECUTE=YES \
|
||||
-DZ80_WITH_FULL_IM0=YES \
|
||||
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=YES \
|
||||
@@ -587,7 +562,19 @@ cmake --build . --config Release
|
||||
ctest --verbose --build-config Release
|
||||
```
|
||||
|
||||
<sup>**[<sub><img src="https://zxe.io/software/Z80/assets/images/sh.svg" height="14"></sub> build-and-test-Z80.sh](https://zxe.io/software/Z80/scripts/build-and-test-Z80.sh) [<sub><img src="https://zxe.io/software/Z80/assets/images/bat.svg" height="14"></sub> build-and-test-Z80.bat](https://zxe.io/software/Z80/scripts/build-and-test-Z80.bat)**</sup>
|
||||
<sup>**[<sub><img src="https://zxe.io/software/Z80/assets/images/sh.svg" height="14" width="19"></sub> build-and-test-Z80.sh](https://zxe.io/software/Z80/scripts/build-and-test-Z80.sh) [<sub><img src="https://zxe.io/software/Z80/assets/images/bat.svg" height="14" width="19"></sub> build-and-test-Z80.bat](https://zxe.io/software/Z80/scripts/build-and-test-Z80.bat)**</sup>
|
||||
|
||||
### Results
|
||||
|
||||
The complete logs generated by `test-Z80` emulating different CPU variants are available here:
|
||||
|
||||
* [Zilog NMOS](https://zxe.io/software/Z80/tests/logs/test-Z80%20v0.2%20Results%20-%20Zilog%20NMOS.txt)
|
||||
* [Zilog CMOS](https://zxe.io/software/Z80/tests/logs/test-Z80%20v0.2%20Results%20-%20Zilog%20CMOS.txt)
|
||||
* [NEC NMOS](https://zxe.io/software/Z80/tests/logs/test-Z80%20v0.2%20Results%20-%20NEC%20NMOS.txt)
|
||||
* [ST CMOS](https://zxe.io/software/Z80/tests/logs/test-Z80%20v0.2%20Results%20-%20ST%20CMOS.txt)
|
||||
|
||||
> [!IMPORTANT]
|
||||
> The CRC errors in the logs of the NEC NMOS variant **are normal** and match the [values obtained on real hardware](https://jisanchez.com/test-a-dos-placas-de-zx-spectrum). The ST CMOS variant is currently [under investigation](https://github.com/redcode/Z80_XCF_Flavor/issues/2).
|
||||
|
||||
## Integration
|
||||
|
||||
@@ -606,9 +593,9 @@ When not specified as a component, the linking method is selected according to [
|
||||
|
||||
### As a CMake subproject
|
||||
|
||||
To embed the Z80 library as a CMake subproject, extract the source code tarballs of [Zeta](https://zeta.st/download) and [Z80](https://zxe.io/software/Z80/download) (or clone their respective repositories) into a subdirectory of another project. Then use [`add_subdirectory`](https://cmake.org/cmake/help/latest/command/add_subdirectory.html) in the parent project to add the Z80 source code tree to the build process (N.B., the Z80 subproject will automatically find Zeta and import it as an [interface library](https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#interface-libraries)).
|
||||
To embed the Z80 library as a CMake subproject, extract the source code tarballs of [Zeta](https://zxe.io/software/Zeta/download) and [Z80](https://zxe.io/software/Z80/download) (or clone their respective repositories) into a subdirectory of another project. Then use [`add_subdirectory`](https://cmake.org/cmake/help/latest/command/add_subdirectory.html) in the parent project to add the Z80 source code tree to the build process (N.B., the Z80 subproject will automatically find Zeta and import it as an [interface library](https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#interface-libraries)).
|
||||
|
||||
It is advisable to configure the Z80 library in the `CMakeLists.txt` of the parent project. This will prevent the user from having to specify [configuration options for the Z80 subproject](#cmake_package_options) through the command line when building the main project.
|
||||
It is advisable to configure the Z80 library in the `CMakeLists.txt` of the parent project. This will eliminate the need for the user to specify [configuration options for the Z80 subproject](#cmake_package_options) through the command line when building the main project.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -627,45 +614,59 @@ It is important to set the [`Z80_SHARED_LIBS`](#cmake_option_z80_shared_libs) op
|
||||
|
||||
The source code of the emulator can be configured at compile time by predefining a series of macros. Both [`Z80.h`](API/Z80.h) and [`Z80.c`](sources/Z80.c) obey the first two explained below. The rest of the macros are only relevant when compiling `Z80.c`:
|
||||
|
||||
* <span id="macro_z80_dependencies_header">**`#define Z80_DEPENDENCIES_HEADER "header-name.h"`**</span>
|
||||
* <span id="macro_z80_external_header">**`#define Z80_EXTERNAL_HEADER "header-name.h"`**</span>
|
||||
Specifies the only external header to `#include`, replacing all others.
|
||||
Predefine this macro to provide a header file that defines the external types and macros used by the emulator, thus preventing your project from depending on [Zeta](https://zeta.st). You can use this when compiling `Z80.c` as a part of your project or (if your types do not break the binary compatibility) when including `<Z80.h>` and linking against a pre-built Z80 library.
|
||||
Predefine this macro to provide a header file that defines the external types and macros used by the emulator, thus preventing your project from depending on [Zeta](https://zxe.io/software/Zeta). You can use this when compiling `Z80.c` within your project or (if your types do not break the binary compatibility) when including `<Z80.h>` and linking against a pre-built Z80 library.
|
||||
|
||||
* <span id="macro_z80_static">**`#define Z80_STATIC`**</span>
|
||||
Restricts the visibility of public symbols.
|
||||
This macro is required if you are building `Z80.c` as a static library, compiling it directly as a part of your project, or linking your program against the static version of the Z80 library. In either of these cases, make sure this macro is defined before including `"Z80.h"` or `<Z80.h>`.
|
||||
Indicates that the emulator is a static library.
|
||||
This macro must be predefined when building `Z80.c` as a static library. Additionally, if you compile `Z80.c` directly within your project or link your program against the static version of the Z80 library, ensure that this macro is defined before including `"Z80.h"` or `<Z80.h>`.
|
||||
|
||||
* <span id="macro_z80_with_local_header">**`#define Z80_WITH_LOCAL_HEADER`**</span>
|
||||
Tells `Z80.c` to <code>#include "Z80.h"</code> instead of `<Z80.h>`.
|
||||
|
||||
The optional features of the emulator mentioned in "[Installation from sources](#installation-from-sources)" are disabled by default. If you compile `Z80.c` as a part of your project, enable those features you need by predefining their respective activation macros. They have the same name as their [CMake equivalents](#cmake_package_source_code_options):
|
||||
The optional features of the emulator mentioned in the "[Configure](#configure)" section of "[Installation from source code](#installation-from-source-code)" are disabled by default. If you compile `Z80.c` within your project, enable those features you need by predefining their respective activation macros. They have the same name as their [CMake equivalents](#cmake_package_source_code_options):
|
||||
|
||||
* **<code>#define [Z80_WITH_EXECUTE](#cmake_option_z80_with_execute)</code>**
|
||||
* **<code>#define [Z80_WITH_FULL_IM0](#cmake_option_z80_with_full_im0)</code>**
|
||||
* **<code>#define [Z80_WITH_IM0_RETX_NOTIFICATIONS](#cmake_option_z80_with_im0_retx_notifications)</code>**
|
||||
* **<code>#define [Z80_WITH_PARITY_COMPUTATION](#cmake_option_z80_with_parity_computation)</code>**
|
||||
* **<code>#define [Z80_WITH_PRECOMPUTED_DAA](#cmake_option_z80_with_precomputed_daa)</code>**
|
||||
* **<code>#define [Z80_WITH_Q](#cmake_option_z80_with_q)</code>**
|
||||
* **<code>#define [Z80_WITH_SPECIAL_RESET](#cmake_option_z80_with_special_reset)</code>**
|
||||
* **<code>#define [Z80_WITH_UNOFFICIAL_RETI](#cmake_option_z80_with_unofficial_reti)</code>**
|
||||
* **<code>#define [Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG](#cmake_option_z80_with_zilog_nmos_ld_a_ir_bug)</code>**
|
||||
|
||||
Except for [`Z80_DEPENDENCIES_HEADER`](#macro_z80_dependencies_header), the above macros can be empty; the source code only checks whether they are defined.
|
||||
Except for [`Z80_EXTERNAL_HEADER`](#macro_z80_external_header), the above macros can be empty; the source code only checks whether they are defined.
|
||||
|
||||
> [!NOTE]
|
||||
> The activation of some of the optional features affects the speed of the emulator due to various factors (read the [documentation](https://zxe.io/software/Z80/documentation/latest/Introduction.html#optional-features) for more details).
|
||||
> [!IMPORTANT]
|
||||
> The activation of some of the optional features affects the speed of the emulator due to various factors (read the [documentation](https://zxe.io/software/Z80/documentation/latest/introduction.html#optional-features) for more details).
|
||||
|
||||
## Showcase
|
||||
|
||||
This emulator has been used by the following projects (listed in alphabetical order):
|
||||
|
||||
* **[Augmentinel](https://simonowen.com/spectrum/augmentinel/)** <sub>_by [Simon Owen](https://simonowen.com)_</sub> ⟩ [GitHub](https://github.com/simonowen/augmentinel)
|
||||
* **ceda-cemu** <sub>_by [Retrofficina GLG Programs](https://retrofficina.glgprograms.it)_</sub> ⟩ [GitHub](https://github.com/GLGPrograms/ceda-cemu)
|
||||
* **CPM-Emulator** <sub>_by [Marc Sibert](https://github.com/Marcussacapuces91)_</sub> ⟩ [GitHub](https://github.com/Marcussacapuces91/CPM-Emulator)
|
||||
* **F80: simple Z80 system running on an FPGA** <sub>_by [Richard J. Prinz](https://www.min.at/prinz)_</sub> ⟩ [GitHub](https://github.com/rprinz08/f80)
|
||||
* **f80** <sub>_by [Richard J. Prinz](https://www.min.at/prinz)_</sub> ⟩ [GitHub](https://github.com/rprinz08/f80)
|
||||
* **[Google Capture the Flag (2021)](https://capturetheflag.withgoogle.com)** <sub>_by [Google](https://www.google.com)_</sub> ⟩ [GitHub](https://github.com/google/google-ctf)
|
||||
* **[King of the Grid](https://kingofthegrid.com)** <sub>_by [Alex Siryi](https://github.com/desertkun)_</sub> ⟩ [GitHub](https://github.com/kingofthegrid/king-of-the-grid)
|
||||
* **MSX1 Emulator for Raspberry Pi Pico** <sub>_by [shippoiincho](https://github.com/shippoiincho)_</sub> ⟩ [GitHub](https://github.com/shippoiincho/msxemulator)
|
||||
* **MZ-1500 Emulator for Raspberry Pi Pico** <sub>_by [shippoiincho](https://github.com/shippoiincho)_</sub> ⟩ [GitHub](https://github.com/shippoiincho/mz1500emulator)
|
||||
* **MZ-2000/80B Emulator for Raspberry Pi Pico** <sub>_by [shippoiincho](https://github.com/shippoiincho)_</sub> ⟩ [GitHub](https://github.com/shippoiincho/mz2000emulator)
|
||||
* **PASOPIA/PASOPIA 7 Emulator for Raspberry Pi Pico** <sub>_by [shippoiincho](https://github.com/shippoiincho)_</sub> ⟩ [GitHub](https://github.com/shippoiincho/pasopiaemulator)
|
||||
* **PC-6001mkII Emulator for Raspberry Pi Pico** <sub>_by [shippoiincho](https://github.com/shippoiincho)_</sub> ⟩ [GitHub](https://github.com/shippoiincho/p6mk2emulator)
|
||||
* **pico-sorcerer-2** <sub>_by [fruit-bat](https://github.com/fruit-bat)_</sub> ⟩ [GitHub](https://github.com/fruit-bat/pico-sorcerer-2)
|
||||
* **pico-zxspectrum** <sub>_by [fruit-bat](https://github.com/fruit-bat)_</sub> ⟩ [GitHub](https://github.com/fruit-bat/pico-zxspectrum)
|
||||
* **[tihle: a unique TI calculator emulator](https://www.taricorp.net/2020/introducing-tihle/)** <sub>_by [Peter Marheine](https://www.taricorp.net/about/)_</sub> ⟩ [GitHub](https://github.com/tari/tihle) · [GitLab](https://gitlab.com/taricorp/tihle)
|
||||
* **[picoZ80](https://eaw.app/picoz80)** <sub>_by [Philip Smart](https://eaw.app/contact)_</sub>
|
||||
* **RadZ80** <sub>_by [RadAd](https://github.com/RadAd)_</sub> ⟩ [GitHub](https://github.com/RadAd/RadZ80)
|
||||
* **SEGA SC-3000 Emulator for Raspberry Pi Pico** <sub>_by [shippoiincho](https://github.com/shippoiincho)_</sub> ⟩ [GitHub](https://github.com/shippoiincho/sc3000emulator)
|
||||
* **[SpeccyP](https://t.me/c/ZX_MURMULATOR/241406)** <sub>_by [Constantin](https://github.com/billgilbert7000)_</sub> ⟩ [GitHub](https://github.com/billgilbert7000/SpeccyP)
|
||||
* **[The Second-Worst ZX Spectrum Emulator in the World](https://fuzzix.org/building-the-secondworst-zx-spectrum-emulator-in-the-world-with-perl)** <sub>_by [John Barrett](https://fuzzix.org/about)_</sub> ⟩ [GitHub Gist](https://gist.github.com/jbarrett/1dbcbd92d08af2f089bf6baff5cf065b)
|
||||
* **[tihle](https://www.taricorp.net/2020/introducing-tihle/)** <sub>_by [Peter Marheine](https://www.taricorp.net/about/)_</sub> ⟩ [GitHub](https://github.com/tari/tihle) · [GitLab](https://gitlab.com/taricorp/tihle)
|
||||
* **[TileMap](https://simonowen.com/spectrum/tilemap/)** <sub>_by [Simon Owen](https://simonowen.com/)_</sub> ⟩ [GitHub](https://github.com/simonowen/tilemap)
|
||||
* **<a href="https://eaw.app/tranzputer-fusionx">tranZPUter<sup>FusionX</sup></a>** <sub>_by [Philip Smart](https://eaw.app/about/)_</sub> ⟩ [GitHub](https://github.com/pdsmart/tzpuFusionX)
|
||||
* **<a href="https://eaw.app/tranzputer-fusionx">tranZPUter<sup>FusionX</sup></a>** <sub>_by [Philip Smart](https://eaw.app/contact)_</sub>
|
||||
* **Zemu** <sub>_by [Jay Valentine](https://jayvalentine.github.io/)_</sub> ⟩ [GitHub](https://github.com/jayvalentine/zemu) · [RubyGems](https://rubygems.org/gems/zemu)
|
||||
|
||||
## Thanks
|
||||
@@ -674,201 +675,231 @@ Many thanks to the following individuals (in alphabetical order):
|
||||
|
||||
* **Akimov, Vadim (lvd)**
|
||||
* For testing the library on many different platforms and CPU architectures.
|
||||
* **Anisimov, Alexey (SoftLight)**
|
||||
* For testing the `ccf/scf` instructions on real hardware. <sup>[1](#r_1)</sup>
|
||||
* **azesmbog** <sup>:trophy:</sup>
|
||||
1. For validating tests on real hardware. <sup>[1](#r1)</sup>
|
||||
1. For validating tests on real hardware. <sup>[2.1](#r_2_1)</sup>
|
||||
2. For discovering the unstable behavior of the `ccf/scf` instructions.
|
||||
3. For his invaluable help.
|
||||
3. For testing the `ccf/scf` instructions on real hardware. <sup>[1](#r_1), [3](#r_3)</sup>
|
||||
4. For his invaluable help.
|
||||
* **Banks, David (hoglet)** <sup>:trophy:</sup>
|
||||
1. For cracking the flag behavior of the block instructions. <sup>[2](#r2), [3](#r3)</sup>
|
||||
2. For his research on the behavior of the `ccf/scf` instructions. <sup>[3](#r3)</sup>
|
||||
1. For deciphering the additional flag changes of the block instructions. <sup>[4.1](#r_4_1), [4.2](#r_4_2), [5](#r_5)</sup>
|
||||
2. For his research on the `ccf/scf` instructions. <sup>[5](#r_5), [6](#r_6)</sup>
|
||||
* **Beliansky, Anatoly (Tolik_Trek)**
|
||||
* For validating tests on real hardware. <sup>[4](#r4)</sup>
|
||||
* **Bobrowski, Jan**
|
||||
* For fixing the _"Z80 Full Instruction Set Exerciser for Spectrum"_. <sup>[5](#r5)</sup>
|
||||
* For validating tests on real hardware. <sup>[2.2](#r_2_2)</sup>
|
||||
* **Bobrowski, Jan**
|
||||
* For fixing _"Z80 Full Instruction Set Exerciser for Spectrum"_. <sup>[7](#r_7)</sup>
|
||||
* **boo_boo** <sup>:trophy:</sup>
|
||||
* For cracking the behavior of the MEMPTR register. <sup>[6](#r6), [7](#r7), [8](#r8), [9](#r9)</sup>
|
||||
* For deciphering the behavior of MEMPTR. <sup>[8](#r_8), [9](#r_9), [10](#r_10), [11](#r_11)</sup>
|
||||
* **Brady, Stuart**
|
||||
* For his research on the behavior of the `ccf/scf` instructions. <sup>[10](#r10)</sup>
|
||||
* For his research on the `ccf/scf` instructions. <sup>[12](#r_12)</sup>
|
||||
* **Brewer, Tony** <sup>:trophy:</sup>
|
||||
1. For his research on the special RESET. <sup>[11](#r11), [12](#r12)</sup>
|
||||
2. For helping to crack the flag behavior of the block instructions. <sup>[2](#r2)</sup>
|
||||
3. For conducting low-level tests on real hardware. <sup>[2](#r2)</sup>
|
||||
1. For his research on the special RESET. <sup>[4.3](#r_4_3), [13](#r_13)</sup>
|
||||
2. For helping to decipher the additional flag changes of the block instructions. <sup>[4](#r_4)</sup>
|
||||
3. For conducting low-level tests on real hardware. <sup>[4](#r_4)</sup>
|
||||
4. For helping me to test different undocumented behaviors of the Zilog Z80.
|
||||
5. For discovering that the `DD/FD` prefixes affect the behavior of the `ccf/scf` instructions. <sup>[4.4](#r_4_4)</sup>
|
||||
* **Bystrov, Dmitry (Alone Coder)**
|
||||
* For validating tests on real hardware. <sup>[4](#r4)</sup>
|
||||
* For validating tests on real hardware. <sup>[2.2](#r_2_2)</sup>
|
||||
* **Chaikin, Mikhail (P321)**
|
||||
* For testing the `ccf/scf` instructions on real hardware. <sup>[1](#r_1)</sup>
|
||||
* **Chandler, Richard**
|
||||
1. For his corrections to the documentation.
|
||||
2. For validating tests on real hardware. <sup>[13](#r13)</sup>
|
||||
2. For validating tests on real hardware. <sup>[14](#r_14)</sup>
|
||||
* **Chunin, Roman (CHRV)**
|
||||
* For testing the behavior of the MEMPTR register on real Z80 chips. <sup>[6](#r6), [7](#r7), [8](#r8), [9](#r9)</sup>
|
||||
* For testing the behavior of MEMPTR on real hardware. <sup>[8](#r_8), [9](#r_9), [10](#r_10), [11](#r_11)</sup>
|
||||
* **Conway, Simon (BadBeard)**
|
||||
* For validating the _"Z80 Test Suite"_ on several Z80 clones. <sup>[14](#r14)</sup>
|
||||
* For validating _"Z80 Test Suite"_ on several Z80 clones. <sup>[15](#r_15)</sup>
|
||||
* **Cooke, Simon** <sup>:trophy:</sup>
|
||||
* For discovering how the <code>out (c),0</code> instruction behaves on the Zilog Z80 CMOS. <sup>[15](#r15)</sup>
|
||||
* For discovering how the <code>out (c),0</code> instruction behaves on the Zilog Z80 CMOS. <sup>[16](#r_16)</sup>
|
||||
* **Cringle, Frank D.**
|
||||
* For writing the _"Z80 Instruction Set Exerciser"_. <sup>[16](#r16)</sup>
|
||||
* For writing _"Z80 Instruction Set Exerciser"_. <sup>[17](#r_17)</sup>
|
||||
* **Devic, Goran**
|
||||
* For his research on undocumented behaviors of the Z80 CPU. <sup>[17](#r17)</sup>
|
||||
* For his research on undocumented behaviors of the Z80 CPU. <sup>[18](#r_18)</sup>
|
||||
* **Dmitriev, Dmitry (DDp)**
|
||||
* For testing the `ccf/scf` instructions on real hardware. <sup>[3](#r_3)</sup>
|
||||
* **Dunn, Paul (ZXDunny)**
|
||||
* For his corrections to the documentation.
|
||||
* **Equinox**
|
||||
* For his corrections to the documentation.
|
||||
* **Flammenkamp, Achim**
|
||||
* For his article on Z80 interrupts. <sup>[18](#r18)</sup>
|
||||
* For his article on Z80 interrupts. <sup>[19](#r_19)</sup>
|
||||
* **Gimeno Fortea, Pedro** <sup>:trophy:</sup>
|
||||
1. For his research work. <sup>[19](#r19)</sup>
|
||||
2. For writing the first-ever ZX Spectrum emulator. <sup>[20](#r20), [21](#r21)</sup>
|
||||
* **goodboy**
|
||||
* For testing the behavior of the MEMPTR register on real Z80 chips. <sup>[6](#r6), [7](#r7), [8](#r8), [9](#r9)</sup>
|
||||
1. For his research work. <sup>[20](#r_20)</sup>
|
||||
2. For writing the first-ever ZX Spectrum emulator. <sup>[21](#r_21), [22](#r_22)</sup>
|
||||
* **Greenway, Ian**
|
||||
* For testing the behavior of the `ccf/scf` instructions on real hardware. <sup>[10](#r10), [22](#r22)</sup>
|
||||
* For testing the `ccf/scf` instructions on real hardware. <sup>[12](#r_12), [23](#r_23)</sup>
|
||||
* **Harston, Jonathan Graham**
|
||||
1. For his research work.
|
||||
2. For his technical documents about the Zilog Z80. <sup>[23](#r23), [24](#r24), [25](#r25)</sup>
|
||||
3. For porting the _"Z80 Instruction Set Exerciser"_ to the ZX Spectrum. <sup>[26](#r26)</sup>
|
||||
2. For his technical documents about the Zilog Z80. <sup>[24](#r_24), [25](#r_25), [26](#r_26)</sup>
|
||||
3. For porting _"Z80 Instruction Set Exerciser"_ to the ZX Spectrum. <sup>[27](#r_27)</sup>
|
||||
* **Helcmanovsky, Peter (Ped7g)** <sup>:medal_military:</sup>
|
||||
1. For helping me to write the _"IN-MEMPTR"_ test.
|
||||
2. For writing the _"Z80 Block Flags Test"_. <sup>[27](#r27), [28](#r28)</sup>
|
||||
3. For writing the _"Z80 CCF SCF Outcome Stability"_ test. <sup>[28](#r28)</sup>
|
||||
4. For writing the _"Z80 INT Skip"_ test. <sup>[28](#r28)</sup>
|
||||
5. For his research on the unstable behavior of the `ccf/scf` instructions.
|
||||
6. For his invaluable help.
|
||||
1. For helping me to write _"IN-MEMPTR"_.
|
||||
2. For writing _"Z80 Block Flags Test"_. <sup>[2](#r_2), [28](#r_28)</sup>
|
||||
3. For writing _"Z80 CCF SCF Outcome Stability"_. <sup>[28](#r_28)</sup>
|
||||
4. For writing _"Z80 INT Skip"_. <sup>[28](#r_28)</sup>
|
||||
5. For writing _"FDDD2"_, _"Z80 DDFD3"_, _"Z80 IM1 vs JR"_ and many other tests.
|
||||
6. For his research on the unstable behavior of the `ccf/scf` instructions.
|
||||
7. For his invaluable help.
|
||||
* **Iborra Debón, Víctor (Eremus)**
|
||||
* For validating tests on real hardware.
|
||||
* **icebear**
|
||||
* For testing the behavior of the MEMPTR register on real Z80 chips. <sup>[6](#r6), [7](#r7), [8](#r8), [9](#r9)</sup>
|
||||
* For testing the behavior of MEMPTR on real hardware. <sup>[8](#r_8), [9](#r_9), [10](#r_10), [11](#r_11)</sup>
|
||||
* **ICEknight**
|
||||
* For validating tests on real hardware.
|
||||
* **Ilyichev, Ivan (ivang78)**
|
||||
* For testing the behavior of MEMPTR on real hardware. <sup>[29](#r_29)</sup>
|
||||
* **Kladov, Vladimir** <sup>:trophy:</sup>
|
||||
* For cracking the behavior of the MEMPTR register. <sup>[6](#r6), [7](#r7), [8](#r8), [9](#r9)</sup>
|
||||
* For deciphering the behavior of MEMPTR. <sup>[8](#r_8), [9](#r_9), [10](#r_10), [11](#r_11)</sup>
|
||||
* **Kovrigin, Alexey (creator)**
|
||||
* For testing the `ccf/scf` instructions on real hardware. <sup>[1](#r_1), [3](#r_3)</sup>
|
||||
* **Krook, Magnus**
|
||||
* For validating tests on real hardware. <sup>[29](#r29)</sup>
|
||||
* For validating tests on real hardware. <sup>[2.3](#r_2_3)</sup>
|
||||
* **London, Matthew (mattinx)**
|
||||
* For validating tests on real hardware.
|
||||
* **Martínez Cantero, Ricardo (Kyp)**
|
||||
* For validating tests on real hardware.
|
||||
* **Molodtsov, Aleksandr**
|
||||
* For testing the behavior of the MEMPTR register on real Z80 chips. <sup>[6](#r6), [7](#r7), [8](#r8), [9](#r9)</sup>
|
||||
* For testing the behavior of MEMPTR on real hardware. <sup>[8](#r_8), [9](#r_9), [10](#r_10), [11](#r_11)</sup>
|
||||
* **Nair, Arjun**
|
||||
* For validating tests on real hardware. <sup>[27](#r27)</sup>
|
||||
* For validating tests on real hardware. <sup>[2](#r_2)</sup>
|
||||
* **Nicolás-González, César**
|
||||
* For helping me to investigate the unstable behavior of the `ccf/scf` instructions.
|
||||
* **Ortega Sosa, Sofía**
|
||||
1. For optimizing the emulator.
|
||||
2. For her support.
|
||||
2. For her help and support.
|
||||
* **Owen, Simon**
|
||||
* For the idea of the hooking method used in this emulator.
|
||||
* **Ownby, Matthew P.**
|
||||
* For his research on the state of the registers after POWER-ON. <sup>[30](#r30)</sup>
|
||||
* For his research on the state of the registers after POWER-ON. <sup>[30](#r_30)</sup>
|
||||
* **Rak, Patrik** <sup>:trophy:</sup>
|
||||
1. For improving the _"Z80 Instruction Set Exerciser for Spectrum"_. <sup>[31](#r31)</sup>
|
||||
2. For cracking the behavior of the `ccf/scf` instructions. <sup>[14](#r14), [31](#r31)</sup>
|
||||
3. For writing the _"Zilog Z80 CPU Test Suite"_. <sup>[31](#r31), [32](#r32)</sup>
|
||||
1. For improving _"Z80 Instruction Set Exerciser for Spectrum"_. <sup>[31](#r_31)</sup>
|
||||
2. For deciphering the behavior of the `ccf/scf` instructions. <sup>[15](#r_15), [31](#r_31)</sup>
|
||||
3. For writing _"Zilog Z80 CPU Test Suite"_. <sup>[31](#r_31), [32](#r_32)</sup>
|
||||
4. For his research on the unstable behavior of the `ccf/scf` instructions.
|
||||
* **Rodríguez Jódar, Miguel Ángel (mcleod_ideafix)**
|
||||
* For his research on the state of the registers after POWER-ON/RESET. <sup>[33](#r33)</sup>
|
||||
1. For his research on the state of the registers after POWER-ON/RESET. <sup>[33](#r_33)</sup>
|
||||
2. For writing _"Z80 Initial Condition Retriever"_. <sup>[33.1](#r_33_1)</sup>
|
||||
* **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.
|
||||
* **Sanarin, Dmitry (haywire)**
|
||||
* For testing the `ccf/scf` instructions on real hardware. <sup>[3](#r_3)</sup>
|
||||
* **Sánchez Ordiñana, José Ismael (Vaporatorius)**
|
||||
* For validating tests on real hardware. <sup>[34](#r34), [35](#r35)</sup>
|
||||
* For validating tests on real hardware. <sup>[32.1](#r_32_1), [34](#r_34)</sup>
|
||||
* **Sapach, Michael (cafedead)**
|
||||
* For writing _"CPD-Test"_. <sup>[29](#r_29)</sup>
|
||||
* **Sevillano Mancilla, Marta (TheMartian)**
|
||||
* For validating tests on real hardware. <sup>[13](#r13)</sup>
|
||||
* For validating tests on real hardware. <sup>[14.1](#r_14_1)</sup>
|
||||
* **Stevenson, Dave**
|
||||
1. For testing the special RESET on real hardware. <sup>[11](#r11)</sup>
|
||||
2. For conducting low-level tests on real hardware. <sup>[36](#r36)</sup>
|
||||
1. For testing the special RESET on real hardware. <sup>[13](#r_13)</sup>
|
||||
2. For conducting low-level tests on real hardware. <sup>[4.5](#r_4_5)</sup>
|
||||
* **Titov, Andrey (Titus)**
|
||||
* For his research on the `ccf/scf` instructions. <sup>[1](#r_1), [3](#r_3)</sup>
|
||||
* **Vasin, Yuriy (goodboy)**
|
||||
1. For testing the behavior of MEMPTR on real hardware. <sup>[8](#r_8), [9](#r_9), [10](#r_10), [11](#r_11), [29](#r_29)</sup>
|
||||
2. For testing the `ccf/scf` instructions on real hardware. <sup>[1](#r_1), [29](#r_29)</sup>
|
||||
* **Vučenović, Zoran**
|
||||
* For writing the [Pascal binding](sources/Z80.pas).
|
||||
* **Weissflog, Andre (Floh)** <sup>:trophy:</sup>
|
||||
1. For discovering that the `reti/retn` instructions defer the acceptance of the maskable interrupt. <sup>[37](#r37)</sup>
|
||||
2. For writing the _"Visual Z80 Remix"_ simulator. <sup>[38](#r38)</sup>
|
||||
1. For discovering that the `reti/retn` instructions defer the acceptance of the maskable interrupt. <sup>[35](#r_35)</sup>
|
||||
2. For writing the _"Visual Z80 Remix"_ simulator. <sup>[36](#r_36)</sup>
|
||||
* **Wilkinson, Oli (evolutional)**
|
||||
* For validating tests on real hardware. <sup>[27](#r27)</sup>
|
||||
* For validating tests on real hardware. <sup>[2](#r_2)</sup>
|
||||
* **Wlodek**
|
||||
* For testing the behavior of the MEMPTR register on real Z80 chips. <sup>[6](#r6), [7](#r7), [8](#r8), [9](#r9)</sup>
|
||||
* For testing the behavior of MEMPTR on real hardware. <sup>[8](#r_8), [9](#r_9), [10](#r_10), [11](#r_11)</sup>
|
||||
* **Woodmass, Mark (Woody)** <sup>:medal_military:</sup>
|
||||
1. For his invaluable contributions to the emuscene.
|
||||
2. For writing the _"Z80 Test Suite"_. <sup>[14](#r14)</sup>
|
||||
3. For his research on the behavior of the `ccf/scf` instructions. <sup>[39](#r39)</sup>
|
||||
4. For writing the _"HALT2INT"_ test.
|
||||
5. For writing the _"EIHALT"_ test.
|
||||
2. For writing _"Z80 Test Suite"_. <sup>[15](#r_15)</sup>
|
||||
3. For writing _"ED777F"_, _"FDDD"_, _"EI48K"_, _"EIHALT"_, _"HALT2INT"_, _"IFF2 Bug"_, _"Super HALT Invaders Test"_ and many other tests.
|
||||
4. For his research on the `ccf/scf` instructions. <sup>[37](#r_37)</sup>
|
||||
* **Young, Sean** <sup>:trophy:</sup>
|
||||
1. For his research work.
|
||||
2. For his technical documents about the Zilog Z80. <sup>[19](#r19), [30](#r30), [40](#r40)</sup>
|
||||
2. For his technical documents about the Zilog Z80. <sup>[20](#r_20), [30](#r_30), [38](#r_38)</sup>
|
||||
* **Zarubin, Stanislav (JeRrS)**
|
||||
* For testing the `ccf/scf` instructions on real hardware. <sup>[3](#r_3), [29](#r_29)</sup>
|
||||
* **ZXGuesser**
|
||||
* For validating tests on real hardware.
|
||||
|
||||
### References
|
||||
|
||||
1. <span id="r1">https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83384#p83384</span>
|
||||
2. <span id="r2">https://stardot.org.uk/forums/viewtopic.php?t=15464</span>
|
||||
* https://stardot.org.uk/forums/viewtopic.php?p=211042#p211042
|
||||
* https://stardot.org.uk/forums/viewtopic.php?p=212021#p212021
|
||||
3. <span id="r3">Banks, David (2018-08-21). _"Undocumented Z80 Flags"_ rev. 1.0.</span>
|
||||
* https://github.com/hoglet67/Z80Decoder/wiki/Undocumented-Flags
|
||||
1. <span id="r_1">https://zx-pk.ru/threads/34173-revers-inzhiniring-z80.html</span>
|
||||
2. <span id="r_2">https://spectrumcomputing.co.uk/forums/viewtopic.php?t=6102</span>
|
||||
1. <span id="r_2_1">https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83384#p83384</span>
|
||||
2. <span id="r_2_2">https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83041#p83041</span>
|
||||
3. <span id="r_2_3">https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83157#p83157</span>
|
||||
3. <span id="r_3">https://zx-pk.ru/threads/35936-zagadka-plavayushchikh-flagov-scf-ccf-raskryta!.html</span>
|
||||
4. <span id="r_4">https://stardot.org.uk/forums/viewtopic.php?t=15464</span>
|
||||
1. <span id="r_4_1">https://stardot.org.uk/forums/viewtopic.php?p=211042#p211042</span>
|
||||
2. <span id="r_4_2">https://stardot.org.uk/forums/viewtopic.php?p=212021#p212021</span>
|
||||
3. <span id="r_4_3">https://stardot.org.uk/forums/viewtopic.php?p=357136#p357136</span>
|
||||
4. <span id="r_4_4">https://stardot.org.uk/forums/viewtopic.php?p=481595#p481595</span>
|
||||
5. <span id="r_4_5">https://stardot.org.uk/forums/viewtopic.php?p=212360#p212360</span>
|
||||
5. <span id="r_5">Banks, David (2018-08-21). _"Undocumented Z80 Flags"_ rev. 1.0.</span>
|
||||
* https://stardot.org.uk/forums/download/file.php?id=39831
|
||||
4. <span id="r4">https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83041#p83041</span>
|
||||
5. <span id="r5">http://wizard.ae.krakow.pl/~jb/qaop/tests.html</span>
|
||||
6. <span id="r6">https://zxpress.ru/zxnet/zxnet.pc/5909</span>
|
||||
7. <span id="r7">https://zx-pk.ru/threads/2506-komanda-bit-n-(hl).html</span>
|
||||
8. <span id="r8">https://zx-pk.ru/threads/2586-prosba-realshchikam-ot-emulyatorshchikov.html</span>
|
||||
9. <span id="r9">boo_boo; Kladov, Vladimir (2006-03-29). _"MEMPTR, Esoteric Register of the Zilog Z80 CPU"_.</span>
|
||||
* https://github.com/hoglet67/Z80Decoder/wiki/Undocumented-Flags
|
||||
6. <span id="r_6">https://github.com/hoglet67/Z80Decoder/wiki/Unstable-CCF-SCF-Behaviour</span>
|
||||
7. <span id="r_7">http://wizard.ae.krakow.pl/~jb/qaop/tests.html</span>
|
||||
8. <span id="r_8">https://zxpress.ru/zxnet/zxnet.pc/5909</span>
|
||||
9. <span id="r_9">https://zx-pk.ru/threads/2506-komanda-bit-n-(hl).html</span>
|
||||
10. <span id="r_10">https://zx-pk.ru/threads/2586-prosba-realshchikam-ot-emulyatorshchikov.html</span>
|
||||
11. <span id="r_11">boo_boo; Kladov, Vladimir (2006-03-29). _"MEMPTR, Esoteric Register of the Zilog Z80 CPU"_.</span>
|
||||
* https://zx-pk.ru/showpost.php?p=43688
|
||||
* https://zx-pk.ru/attachment.php?attachmentid=2984
|
||||
* https://zx-pk.ru/showpost.php?p=43800
|
||||
* https://zx-pk.ru/attachment.php?attachmentid=2989
|
||||
10. <span id="r10">https://sourceforge.net/p/fuse-emulator/mailman/message/6929573</span>
|
||||
11. <span id="r11">Brewer, Tony (2014-12). _"Z80 Special Reset"_.</span>
|
||||
12. <span id="r_12">https://sourceforge.net/p/fuse-emulator/mailman/message/6929573</span>
|
||||
13. <span id="r_13">Brewer, Tony (2014-12). _"Z80 Special Reset"_.</span>
|
||||
* http://primrosebank.net/computers/z80/z80_special_reset.htm
|
||||
12. <span id="r12">https://stardot.org.uk/forums/viewtopic.php?p=357136#p357136</span>
|
||||
13. <span id="r13">https://spectrumcomputing.co.uk/forums/viewtopic.php?t=10555</span>
|
||||
14. <span id="r14">https://worldofspectrum.org/forums/discussion/20345</span>
|
||||
15. <span id="r15">https://groups.google.com/g/comp.os.cpm/c/HfSTFpaIkuU/m/KotvMWu3bZoJ</span>
|
||||
16. <span id="r16">Cringle, Frank D. (1998-01-28). _"Yaze - Yet Another Z80 Emulator"_ v1.10.</span>
|
||||
14. <span id="r_14">https://spectrumcomputing.co.uk/forums/viewtopic.php?t=10555</span>
|
||||
1. <span id="r_14_1">https://spectrumcomputing.co.uk/forums/viewtopic.php?p=132144#p132144</span>
|
||||
15. <span id="r_15">https://worldofspectrum.org/forums/discussion/20345</span>
|
||||
16. <span id="r_16">https://groups.google.com/g/comp.os.cpm/c/HfSTFpaIkuU/m/KotvMWu3bZoJ</span>
|
||||
17. <span id="r_17">Cringle, Frank D. (1998-01-28). _"Yaze - Yet Another Z80 Emulator"_ v1.10.</span>
|
||||
* ftp://ftp.ping.de/pub/misc/emulators/yaze-1.10.tar.gz
|
||||
17. <span id="r17">https://baltazarstudios.com/zilog-z80-undocumented-behavior</span>
|
||||
18. <span id="r18">Flammenkamp, Achim. _"Interrupt Behaviour of the Z80 CPU"_.</span>
|
||||
18. <span id="r_18">https://baltazarstudios.com/zilog-z80-undocumented-behavior</span>
|
||||
19. <span id="r_19">Flammenkamp, Achim. _"Interrupt Behaviour of the Z80 CPU"_.</span>
|
||||
* http://z80.info/interrup.htm
|
||||
19. <span id="r19">Young, Sean (1998-10). _"Z80 Undocumented Features (in Software Behaviour)"_ v0.3.</span>
|
||||
20. <span id="r_20">Young, Sean (1998-10). _"Z80 Undocumented Features (in Software Behaviour)"_ v0.3.</span>
|
||||
* http://www.msxnet.org/tech/Z80/z80undoc.txt
|
||||
20. <span id="r20">https://elmundodelspectrum.com/desenterrando-el-primer-emulador-de-spectrum</span>
|
||||
21. <span id="r21">https://elmundodelspectrum.com/con-vosotros-el-emulador-de-pedro-gimeno-1989</span>
|
||||
22. <span id="r22">https://sourceforge.net/p/fuse-emulator/mailman/message/4502844</span>
|
||||
23. <span id="r23">Harston, Jonathan Graham (2008). _"Full Z80 Opcode List Including Undocumented Opcodes"_ v0.11 (revised).</span>
|
||||
* https://mdfs.net/Docs/Comp/Z80/OpList
|
||||
24. <span id="r24">Harston, Jonathan Graham (2012). _"Z80 Microprocessor Undocumented Instructions"_ v0.15.</span>
|
||||
* https://mdfs.net/Docs/Comp/Z80/UnDocOps
|
||||
25. <span id="r25">Harston, Jonathan Graham (2014). _"Z80 Opcode Map"_ v0.10 (revised).</span>
|
||||
* https://mdfs.net/Docs/Comp/Z80/OpCodeMap
|
||||
26. <span id="r26">https://mdfs.net/Software/Z80/Exerciser/Spectrum</span>
|
||||
27. <span id="r27">https://spectrumcomputing.co.uk/forums/viewtopic.php?t=6102</span>
|
||||
28. <span id="r28">https://github.com/MrKWatkins/ZXSpectrumNextTests</span>
|
||||
29. <span id="r29">https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83157#p83157</span>
|
||||
30. <span id="r30">Young, Sean (2005-09-18). _"Undocumented Z80 Documented, The"_ v0.91.</span>
|
||||
21. <span id="r_21">https://elmundodelspectrum.com/desenterrando-el-primer-emulador-de-spectrum</span>
|
||||
22. <span id="r_22">https://elmundodelspectrum.com/con-vosotros-el-emulador-de-pedro-gimeno-1989</span>
|
||||
23. <span id="r_23">https://sourceforge.net/p/fuse-emulator/mailman/message/4502844</span>
|
||||
24. <span id="r_24">Harston, Jonathan Graham (2008). _"Full Z80 Opcode List Including Undocumented Opcodes"_ v0.11 (revised).</span>
|
||||
* http://www.mdfsnet.f9.co.uk/Docs/Comp/Z80/OpList
|
||||
25. <span id="r_25">Harston, Jonathan Graham (2012). _"Z80 Microprocessor Undocumented Instructions"_ v0.15.</span>
|
||||
* http://mdfs.net/Docs/Comp/Z80/UnDocOps
|
||||
26. <span id="r_26">Harston, Jonathan Graham (2014). _"Z80 Opcode Map"_ v0.10 (revised).</span>
|
||||
* http://mdfs.net/Docs/Comp/Z80/OpCodeMap
|
||||
27. <span id="r_27">http://mdfs.net/Software/Z80/Exerciser/Spectrum</span>
|
||||
28. <span id="r_28">https://github.com/MrKWatkins/ZXSpectrumNextTests</span>
|
||||
29. <span id="r_29">https://zx-pk.ru/threads/36139-cpd-test-dlya-proverki-izmeneniya-registra-memptr-instruktsiyami-proverte-na-reale-plz.html</span>
|
||||
30. <span id="r_30">Young, Sean (2005-09-18). _"Undocumented Z80 Documented, The"_ v0.91.</span>
|
||||
* http://www.myquest.nl/z80undocumented
|
||||
* http://www.myquest.nl/z80undocumented/z80-documented-v0.91.pdf
|
||||
31. <span id="r31">https://worldofspectrum.org/forums/discussion/41704</span>
|
||||
31. <span id="r_31">https://worldofspectrum.org/forums/discussion/41704</span>
|
||||
* http://zxds.raxoft.cz/taps/misc/zexall2.zip
|
||||
32. <span id="r32">https://worldofspectrum.org/forums/discussion/41834</span>
|
||||
32. <span id="r_32">https://worldofspectrum.org/forums/discussion/41834</span>
|
||||
* http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip
|
||||
* https://github.com/raxoft/z80test
|
||||
33. <span id="r33">https://worldofspectrum.org/forums/discussion/34574</span>
|
||||
34. <span id="r34">https://worldofspectrum.org/forums/discussion/comment/668760/#Comment_668760</span>
|
||||
35. <span id="r35">https://jisanchez.com/test-a-dos-placas-de-zx-spectrum</span>
|
||||
36. <span id="r36">https://stardot.org.uk/forums/viewtopic.php?p=212360#p212360</span>
|
||||
37. <span id="r37">Weissflog, Andre (2021-12-17). _"New Cycle-Stepped Z80 Emulator, A"_.</span>
|
||||
1. <span id="r_32_1">https://worldofspectrum.org/forums/discussion/comment/668760/#Comment_668760</span>
|
||||
33. <span id="r_33">https://worldofspectrum.org/forums/discussion/34574</span>
|
||||
1. <span id="r_33_1">https://worldofspectrum.org/forums/discussion/comment/539714/#Comment_539714</span>
|
||||
* http://zxprojects.com/images/stories/z80_startup/reg_start_value.zip
|
||||
34. <span id="r_34">https://jisanchez.com/test-a-dos-placas-de-zx-spectrum</span>
|
||||
35. <span id="r_35">Weissflog, Andre (2021-12-17). _"New Cycle-Stepped Z80 Emulator, A"_.</span>
|
||||
* https://floooh.github.io/2021/12/17/cycle-stepped-z80.html
|
||||
38. <span id="r38">https://github.com/floooh/v6502r</span>
|
||||
39. <span id="r39">https://groups.google.com/g/comp.sys.sinclair/c/WPsPr6j6w5k/m/O_u1zNQf3VYJ</span>
|
||||
40. <span id="r40">Young, Sean (1997-09-21). _"Zilog Z80 CPU Specifications"_.
|
||||
36. <span id="r_36">https://github.com/floooh/v6502r</span>
|
||||
37. <span id="r_37">https://groups.google.com/g/comp.sys.sinclair/c/WPsPr6j6w5k/m/O_u1zNQf3VYJ</span>
|
||||
38. <span id="r_38">Young, Sean (1997-09-21). _"Zilog Z80 CPU Specifications"_.</span>
|
||||
* http://www.msxnet.org/tech/Z80/z80.zip
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 1999-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright © 1999-2026 Manuel Sainz de Baranda y Goñi.
|
||||
|
||||
<img src="https://zxe.io/software/Z80/assets/images/lgplv3.svg" width="160" align="right">
|
||||
<img src="https://zxe.io/software/Z80/assets/images/lgplv3.svg" height="70" width="160" align="right">
|
||||
|
||||
This library 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.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.
|
||||
|
||||
|
||||
229
projects/Z80/THANKS
vendored
229
projects/Z80/THANKS
vendored
@@ -2,85 +2,98 @@ Many thanks to the following individuals (in alphabetical order):
|
||||
|
||||
* Akimov, Vadim (lvd)
|
||||
For testing the library on many different platforms and CPU architectures.
|
||||
* Anisimov, Alexey (SoftLight)
|
||||
For testing the `ccf/scf` instructions on real hardware [1].
|
||||
* azesmbog
|
||||
1. For validating tests on real hardware [1].
|
||||
1. For validating tests on real hardware [2.1].
|
||||
2. For discovering the unstable behavior of the `ccf/scf` instructions.
|
||||
3. For his invaluable help.
|
||||
3. For testing the `ccf/scf` instructions on real hardware [1, 3].
|
||||
4. 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 behavior of the `ccf/scf` instructions [3].
|
||||
1. For deciphering the additional flag changes of the block instructions
|
||||
[4.1, 4.2, 5].
|
||||
2. For his research on the `ccf/scf` instructions [5, 6].
|
||||
* Beliansky, Anatoly (Tolik_Trek)
|
||||
For validating tests on real hardware [4].
|
||||
For validating tests on real hardware [2.2].
|
||||
* Bobrowski, Jan
|
||||
For fixing the "Z80 Full Instruction Set Exerciser for Spectrum" [5].
|
||||
For fixing "Z80 Full Instruction Set Exerciser for Spectrum" [7].
|
||||
* boo_boo
|
||||
For cracking the behavior of the MEMPTR register [6,7,8,9].
|
||||
For deciphering the behavior of MEMPTR [8, 9, 10, 11].
|
||||
* Brady, Stuart
|
||||
For his research on the behavior of the `ccf/scf` instructions [10].
|
||||
For his research on the `ccf/scf` instructions [12].
|
||||
* Brewer, Tony
|
||||
1. For his research on the special RESET [11,12].
|
||||
2. For helping to crack the flag behavior of the block instructions [2].
|
||||
3. For conducting low-level tests on real hardware [2].
|
||||
1. For his research on the special RESET [4.3, 13].
|
||||
2. For helping to decipher the additional flag changes of the block
|
||||
instructions [4].
|
||||
3. For conducting low-level tests on real hardware [4].
|
||||
4. For helping me to test different undocumented behaviors of the Zilog Z80.
|
||||
5. For discovering that the `DD/FD` prefixes affect the behavior of the
|
||||
`ccf/scf` instructions [4.4].
|
||||
* Bystrov, Dmitry (Alone Coder)
|
||||
For validating tests on real hardware [4].
|
||||
For validating tests on real hardware [2.2].
|
||||
* Chaikin, Mikhail (P321)
|
||||
For testing the `ccf/scf` instructions on real hardware [1].
|
||||
* Chandler, Richard
|
||||
1. For his corrections to the documentation.
|
||||
2. For validating tests on real hardware [13].
|
||||
2. For validating tests on real hardware [14].
|
||||
* Chunin, Roman (CHRV)
|
||||
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
|
||||
For testing the behavior of MEMPTR on real hardware [8, 9, 10, 11].
|
||||
* Conway, Simon (BadBeard)
|
||||
For validating the "Z80 Test Suite" on several Z80 clones [14].
|
||||
For validating "Z80 Test Suite" on several Z80 clones [15].
|
||||
* Cooke, Simon
|
||||
For discovering how the `out (c),0` instruction behaves on the Zilog Z80
|
||||
CMOS [15].
|
||||
CMOS [16].
|
||||
* Cringle, Frank D.
|
||||
For writing the "Z80 Instruction Set Exerciser" [16].
|
||||
For writing "Z80 Instruction Set Exerciser" [17].
|
||||
* Devic, Goran
|
||||
For his research on undocumented behaviors of the Z80 CPU [17].
|
||||
For his research on undocumented behaviors of the Z80 CPU [18].
|
||||
* Dmitriev, Dmitry (DDp)
|
||||
For testing the `ccf/scf` instructions on real hardware [3].
|
||||
* Dunn, Paul (ZXDunny)
|
||||
For his corrections to the documentation.
|
||||
* Equinox
|
||||
For his corrections to the documentation.
|
||||
* Flammenkamp, Achim
|
||||
For his article on Z80 interrupts [18].
|
||||
For his article on Z80 interrupts [19].
|
||||
* Gimeno Fortea, Pedro
|
||||
1. For his research work [19].
|
||||
2. For writing the first-ever ZX Spectrum emulator [20,21].
|
||||
* goodboy
|
||||
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
|
||||
1. For his research work [20].
|
||||
2. For writing the first-ever ZX Spectrum emulator [21, 22].
|
||||
* Greenway, Ian
|
||||
For testing the behavior of the `ccf/scf` instructions on real hardware [10,
|
||||
22].
|
||||
For testing the `ccf/scf` instructions on real hardware [12, 23].
|
||||
* Harston, Jonathan Graham
|
||||
1. For his research work.
|
||||
2. For his technical documents about the Zilog Z80 [23,24,25].
|
||||
3. For porting the "Z80 Instruction Set Exerciser" to the ZX Spectrum [26].
|
||||
2. For his technical documents about the Zilog Z80 [24, 25, 26].
|
||||
3. For porting "Z80 Instruction Set Exerciser" to the ZX Spectrum [27].
|
||||
* Helcmanovsky, Peter (Ped7g)
|
||||
1. For helping me to write the "IN-MEMPTR" test.
|
||||
2. For writing the "Z80 Block Flags Test" [27,28].
|
||||
3. For writing the "Z80 CCF SCF Outcome Stability" test [28].
|
||||
4. For writing the "Z80 INT Skip" test [28].
|
||||
5. For his research on the unstable behavior of the `ccf/scf` instructions.
|
||||
6. For his invaluable help.
|
||||
1. For helping me to write "IN-MEMPTR".
|
||||
2. For writing "Z80 Block Flags Test" [2, 28].
|
||||
3. For writing "Z80 CCF SCF Outcome Stability" [28].
|
||||
4. For writing "Z80 INT Skip" [28].
|
||||
5. For writing "FDDD2", "Z80 DDFD3", "Z80 IM1 vs JR" and many other tests.
|
||||
6. For his research on the unstable behavior of the `ccf/scf` instructions.
|
||||
7. For his invaluable help.
|
||||
* Iborra Debón, Víctor (Eremus)
|
||||
For validating tests on real hardware.
|
||||
* icebear
|
||||
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
|
||||
For testing the behavior of MEMPTR on real hardware [8, 9, 10, 11].
|
||||
* ICEknight
|
||||
For validating tests on real hardware.
|
||||
* Ilyichev, Ivan (ivang78)
|
||||
For testing the behavior of MEMPTR on real hardware [29].
|
||||
* Kladov, Vladimir
|
||||
For cracking the behavior of the MEMPTR register [6,7,8,9].
|
||||
For deciphering the behavior of MEMPTR [8, 9, 10, 11].
|
||||
* Kovrigin, Alexey (creator)
|
||||
For testing the `ccf/scf` instructions on real hardware [1, 3].
|
||||
* Krook, Magnus
|
||||
For validating tests on real hardware [29].
|
||||
For validating tests on real hardware [2.3].
|
||||
* London, Matthew (mattinx)
|
||||
For validating tests on real hardware.
|
||||
* Martínez Cantero, Ricardo (Kyp)
|
||||
For validating tests on real hardware.
|
||||
* Molodtsov, Aleksandr
|
||||
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
|
||||
For testing the behavior of MEMPTR on real hardware [8, 9, 10, 11].
|
||||
* Nair, Arjun
|
||||
For validating tests on real hardware [27].
|
||||
For validating tests on real hardware [2].
|
||||
* Nicolás-González, César
|
||||
For helping me to investigate the unstable behavior of the `ccf/scf`
|
||||
instructions.
|
||||
@@ -92,42 +105,54 @@ Many thanks to the following individuals (in alphabetical order):
|
||||
* Ownby, Matthew P.
|
||||
For his research on the state of the registers after POWER-ON [30].
|
||||
* Rak, Patrik
|
||||
1. For improving the "Z80 Instruction Set Exerciser for Spectrum" [31].
|
||||
2. For cracking the behavior of the `ccf/scf` instructions [14,31].
|
||||
3. For writing the "Zilog Z80 CPU Test Suite" [31,32].
|
||||
1. For improving "Z80 Instruction Set Exerciser for Spectrum" [31].
|
||||
2. For deciphering the behavior of the `ccf/scf` instructions [15, 31].
|
||||
3. For writing "Zilog Z80 CPU Test Suite" [31, 32].
|
||||
4. For his research on the unstable behavior of the `ccf/scf` instructions.
|
||||
* Rodríguez Jódar, Miguel Ángel (mcleod_ideafix)
|
||||
For his research on the state of the registers after POWER-ON/RESET [33].
|
||||
1. For his research on the state of the registers after POWER-ON/RESET [33].
|
||||
2. For writing "Z80 Initial Condition Retriever" [33.1].
|
||||
* 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.
|
||||
* Sanarin, Dmitry (haywire)
|
||||
For testing the `ccf/scf` instructions on real hardware [3].
|
||||
* Sánchez Ordiñana, José Ismael (Vaporatorius)
|
||||
For validating tests on real hardware [34,35].
|
||||
For validating tests on real hardware [32.1, 34].
|
||||
* Sapach, Michael (cafedead)
|
||||
For writing "CPD-Test" [29].
|
||||
* Sevillano Mancilla, Marta (TheMartian)
|
||||
For validating tests on real hardware [13].
|
||||
For validating tests on real hardware [14.1].
|
||||
* Stevenson, Dave
|
||||
1. For testing the special RESET on real hardware [11].
|
||||
2. For conducting low-level tests on real hardware [36].
|
||||
1. For testing the special RESET on real hardware [13].
|
||||
2. For conducting low-level tests on real hardware [4.5].
|
||||
* Titov, Andrey (Titus)
|
||||
For his research on the `ccf/scf` instructions [1, 3].
|
||||
* Vasin, Yuriy (goodboy)
|
||||
1. For testing the behavior of MEMPTR on real hardware [8, 9, 10, 11, 29].
|
||||
2. For testing the `ccf/scf` instructions on real hardware [1, 29].
|
||||
* Vučenović, Zoran
|
||||
For writing the Pascal binding.
|
||||
* Weissflog, Andre (Floh)
|
||||
1. For discovering that the `reti/retn` instructions defer the acceptance of
|
||||
the maskable interrupt [37].
|
||||
2. For writing the "Visual Z80 Remix" simulator [38].
|
||||
the maskable interrupt [35].
|
||||
2. For writing the "Visual Z80 Remix" simulator [36].
|
||||
* Wilkinson, Oli (evolutional)
|
||||
For validating tests on real hardware [27].
|
||||
For validating tests on real hardware [2].
|
||||
* Wlodek
|
||||
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
|
||||
For testing the behavior of MEMPTR on real hardware [8, 9, 10, 11].
|
||||
* Woodmass, Mark (Woody)
|
||||
1. For his invaluable contributions to the emuscene.
|
||||
2. For writing the "Z80 Test Suite" [14].
|
||||
3. For his research on the behavior of the `ccf/scf` instructions [39].
|
||||
4. For writing the "HALT2INT" test.
|
||||
5. For writing the "EIHALT" test.
|
||||
2. For writing "Z80 Test Suite" [15].
|
||||
3. For writing "ED777F", "FDDD", "EI48K", "EIHALT", "HALT2INT", "IFF2 Bug",
|
||||
"Super HALT Invaders Test" and many other tests.
|
||||
4. For his research on the `ccf/scf` instructions [37].
|
||||
* Young, Sean
|
||||
1. For his research work.
|
||||
2. For his technical documents about the Zilog Z80 [19,30,40].
|
||||
2. For his technical documents about the Zilog Z80 [20, 30, 38].
|
||||
* Zarubin, Stanislav (JeRrS)
|
||||
For testing the `ccf/scf` instructions on real hardware [3, 29].
|
||||
* ZXGuesser
|
||||
For validating tests on real hardware.
|
||||
|
||||
@@ -135,54 +160,63 @@ Many thanks to the following individuals (in alphabetical order):
|
||||
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" rev. 1.0.
|
||||
* https://github.com/hoglet67/Z80Decoder/wiki/Undocumented-Flags
|
||||
1. https://zx-pk.ru/threads/34173-revers-inzhiniring-z80.html
|
||||
2. https://spectrumcomputing.co.uk/forums/viewtopic.php?t=6102
|
||||
1. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83384#p83384
|
||||
2. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83041#p83041
|
||||
3. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83157#p83157
|
||||
3. https://zx-pk.ru/threads/35936-zagadka-plavayushchikh-flagov-scf-ccf-raskryt
|
||||
a!.html
|
||||
4. https://stardot.org.uk/forums/viewtopic.php?t=15464
|
||||
1. https://stardot.org.uk/forums/viewtopic.php?p=211042#p211042
|
||||
2. https://stardot.org.uk/forums/viewtopic.php?p=212021#p212021
|
||||
3. https://stardot.org.uk/forums/viewtopic.php?p=357136#p357136
|
||||
4. https://stardot.org.uk/forums/viewtopic.php?p=481595#p481595
|
||||
5. https://stardot.org.uk/forums/viewtopic.php?p=212360#p212360
|
||||
5. Banks, David (2018-08-21). "Undocumented Z80 Flags" rev. 1.0.
|
||||
* 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
|
||||
* https://github.com/hoglet67/Z80Decoder/wiki/Undocumented-Flags
|
||||
6. https://github.com/hoglet67/Z80Decoder/wiki/Unstable-CCF-SCF-Behaviour
|
||||
7. http://wizard.ae.krakow.pl/~jb/qaop/tests.html
|
||||
8. https://zxpress.ru/zxnet/zxnet.pc/5909
|
||||
9. https://zx-pk.ru/threads/2506-komanda-bit-n-(hl).html
|
||||
10. https://zx-pk.ru/threads/2586-prosba-realshchikam-ot-emulyatorshchikov.html
|
||||
11. boo_boo; Kladov, Vladimir (2006-03-29). "MEMPTR, Esoteric Register of the
|
||||
Zilog Z80 CPU".
|
||||
* https://zx-pk.ru/showpost.php?p=43688
|
||||
* https://zx-pk.ru/attachment.php?attachmentid=2984
|
||||
* https://zx-pk.ru/showpost.php?p=43800
|
||||
* https://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".
|
||||
12. https://sourceforge.net/p/fuse-emulator/mailman/message/6929573
|
||||
13. Brewer, Tony (2014-12). "Z80 Special Reset".
|
||||
* http://primrosebank.net/computers/z80/z80_special_reset.htm
|
||||
12. https://stardot.org.uk/forums/viewtopic.php?p=357136#p357136
|
||||
13. https://spectrumcomputing.co.uk/forums/viewtopic.php?t=10555
|
||||
14. https://worldofspectrum.org/forums/discussion/20345
|
||||
15. https://groups.google.com/g/comp.os.cpm/c/HfSTFpaIkuU/m/KotvMWu3bZoJ
|
||||
16. Cringle, Frank D. (1998-01-28). "Yaze - Yet Another Z80 Emulator" v1.10.
|
||||
14. https://spectrumcomputing.co.uk/forums/viewtopic.php?t=10555
|
||||
1. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=132144#p132144
|
||||
15. https://worldofspectrum.org/forums/discussion/20345
|
||||
16. https://groups.google.com/g/comp.os.cpm/c/HfSTFpaIkuU/m/KotvMWu3bZoJ
|
||||
17. 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
|
||||
17. https://baltazarstudios.com/zilog-z80-undocumented-behavior
|
||||
18. Flammenkamp, Achim. "Interrupt Behaviour of the Z80 CPU".
|
||||
18. https://baltazarstudios.com/zilog-z80-undocumented-behavior
|
||||
19. Flammenkamp, Achim. "Interrupt Behaviour of the Z80 CPU".
|
||||
* http://z80.info/interrup.htm
|
||||
19. Young, Sean (1998-10). "Z80 Undocumented Features (in Software Behaviour)"
|
||||
20. Young, Sean (1998-10). "Z80 Undocumented Features (in Software Behaviour)"
|
||||
v0.3.
|
||||
* http://www.msxnet.org/tech/Z80/z80undoc.txt
|
||||
20. https://elmundodelspectrum.com/desenterrando-el-primer-emulador-de-spectrum
|
||||
21. https://elmundodelspectrum.com/con-vosotros-el-emulador-de-pedro-gimeno-1989
|
||||
22. https://sourceforge.net/p/fuse-emulator/mailman/message/4502844
|
||||
23. Harston, Jonathan Graham (2008). "Full Z80 Opcode List Including
|
||||
21. https://elmundodelspectrum.com/desenterrando-el-primer-emulador-de-spectrum
|
||||
22. https://elmundodelspectrum.com/con-vosotros-el-emulador-de-pedro-gimeno-1989
|
||||
23. https://sourceforge.net/p/fuse-emulator/mailman/message/4502844
|
||||
24. Harston, Jonathan Graham (2008). "Full Z80 Opcode List Including
|
||||
Undocumented Opcodes" v0.11 (revised).
|
||||
* https://mdfs.net/Docs/Comp/Z80/OpList
|
||||
24. Harston, Jonathan Graham (2012). "Z80 Microprocessor Undocumented
|
||||
* http://www.mdfsnet.f9.co.uk/Docs/Comp/Z80/OpList
|
||||
25. Harston, Jonathan Graham (2012). "Z80 Microprocessor Undocumented
|
||||
Instructions" v0.15.
|
||||
* https://mdfs.net/Docs/Comp/Z80/UnDocOps
|
||||
25. Harston, Jonathan Graham (2014). "Z80 Opcode Map" v0.10 (revised).
|
||||
* https://mdfs.net/Docs/Comp/Z80/OpCodeMap
|
||||
26. https://mdfs.net/Software/Z80/Exerciser/Spectrum
|
||||
27. https://spectrumcomputing.co.uk/forums/viewtopic.php?t=6102
|
||||
* http://mdfs.net/Docs/Comp/Z80/UnDocOps
|
||||
26. Harston, Jonathan Graham (2014). "Z80 Opcode Map" v0.10 (revised).
|
||||
* http://mdfs.net/Docs/Comp/Z80/OpCodeMap
|
||||
27. http://mdfs.net/Software/Z80/Exerciser/Spectrum
|
||||
28. https://github.com/MrKWatkins/ZXSpectrumNextTests
|
||||
29. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83157#p83157
|
||||
29. https://zx-pk.ru/threads/36139-cpd-test-dlya-proverki-izmeneniya-registra-me
|
||||
mptr-instruktsiyami-proverte-na-reale-plz.html
|
||||
30. Young, Sean (2005-09-18). "Undocumented Z80 Documented, The" v0.91.
|
||||
* http://www.myquest.nl/z80undocumented
|
||||
* http://www.myquest.nl/z80undocumented/z80-documented-v0.91.pdf
|
||||
@@ -191,13 +225,16 @@ References
|
||||
32. https://worldofspectrum.org/forums/discussion/41834
|
||||
* http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip
|
||||
* https://github.com/raxoft/z80test
|
||||
1. https://worldofspectrum.org/forums/discussion/comment/668760/#Comment_668
|
||||
760
|
||||
33. https://worldofspectrum.org/forums/discussion/34574
|
||||
34. https://worldofspectrum.org/forums/discussion/comment/668760/#Comment_668760
|
||||
35. https://jisanchez.com/test-a-dos-placas-de-zx-spectrum
|
||||
36. https://stardot.org.uk/forums/viewtopic.php?p=212360#p212360
|
||||
37. Weissflog, Andre (2021-12-17). "New Cycle-Stepped Z80 Emulator, A".
|
||||
1. https://worldofspectrum.org/forums/discussion/comment/539714/#Comment_539
|
||||
714
|
||||
* http://zxprojects.com/images/stories/z80_startup/reg_start_value.zip
|
||||
34. https://jisanchez.com/test-a-dos-placas-de-zx-spectrum
|
||||
35. Weissflog, Andre (2021-12-17). "New Cycle-Stepped Z80 Emulator, A".
|
||||
* https://floooh.github.io/2021/12/17/cycle-stepped-z80.html
|
||||
38. https://github.com/floooh/v6502r
|
||||
39. https://groups.google.com/g/comp.sys.sinclair/c/WPsPr6j6w5k/m/O_u1zNQf3VYJ
|
||||
40. Young, Sean (1997-09-21). "Zilog Z80 CPU Specifications".
|
||||
36. https://github.com/floooh/v6502r
|
||||
37. https://groups.google.com/g/comp.sys.sinclair/c/WPsPr6j6w5k/m/O_u1zNQf3VYJ
|
||||
38. Young, Sean (1997-09-21). "Zilog Z80 CPU Specifications".
|
||||
* http://www.msxnet.org/tech/Z80/z80.zip
|
||||
|
||||
37
projects/Z80/documentation/CMakeLists.txt
vendored
37
projects/Z80/documentation/CMakeLists.txt
vendored
@@ -4,7 +4,7 @@
|
||||
# \/__/ /\_\ __ \\ \/\ \
|
||||
# /\_____\\_____\\_____\
|
||||
# Zilog \/_____//_____//_____/ CPU Emulator
|
||||
# Copyright (C) 1999-2024 Manuel Sainz de Baranda y Goñi.
|
||||
# Copyright (C) 1999-2026 Manuel Sainz de Baranda y Goñi.
|
||||
# Released under the terms of the GNU Lesser General Public License v3.
|
||||
|
||||
find_package(Doxygen REQUIRED)
|
||||
@@ -43,6 +43,12 @@ set(DOXYGEN_XML_PROGRAMLISTING YES )
|
||||
|
||||
get_target_property(DOXYGEN_INCLUDE_PATH Zeta INTERFACE_INCLUDE_DIRECTORIES)
|
||||
|
||||
file(READ "${PROJECT_SOURCE_DIR}/README" _)
|
||||
string(REGEX MATCH ".*Copyright \\(C\\) ([^ ]+) (([^. \t\n]+ ?)*[^. \t\n]+).*" _ ${_})
|
||||
set(_copyright_year ${CMAKE_MATCH_1})
|
||||
set(_author ${CMAKE_MATCH_2})
|
||||
unset(_)
|
||||
|
||||
doxygen_add_docs(
|
||||
${PROJECT_NAME}-API-XML
|
||||
"${PROJECT_SOURCE_DIR}/API"
|
||||
@@ -59,11 +65,18 @@ if(${PROJECT_NAME}_WITH_HTML_DOCUMENTATION)
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${_html_documentation_output}"
|
||||
COMMAND "${SPHINX_BUILD_EXECUTABLE}"
|
||||
OUTPUT "${_html_documentation_output}"
|
||||
COMMAND "${Sphinx_BUILD_EXECUTABLE}"
|
||||
-b html
|
||||
"-Dproject=${PROJECT_NAME}"
|
||||
"-Dversion=${PROJECT_VERSION}"
|
||||
"-Drelease=${PROJECT_VERSION}"
|
||||
"-Dauthor=${_author}"
|
||||
"-Dcopyright=${_copyright_year} ${_author}"
|
||||
${_html_theme_option}
|
||||
-Dbreathe_projects.${PROJECT_NAME}="${_api_xml_output}"
|
||||
"-Dhtml_title=${PROJECT_NAME} Documentation"
|
||||
"-Dbreathe_default_project=${PROJECT_NAME}"
|
||||
"-Dbreathe_projects.${PROJECT_NAME}=${_api_xml_output}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${_html_documentation_output}"
|
||||
DEPENDS ${PROJECT_NAME}-API-XML
|
||||
@@ -87,10 +100,16 @@ if(${PROJECT_NAME}_WITH_PDF_DOCUMENTATION)
|
||||
set(_latex_documentation_output "${CMAKE_CURRENT_BINARY_DIR}/LaTeX")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${_latex_documentation_output}"
|
||||
COMMAND "${SPHINX_BUILD_EXECUTABLE}"
|
||||
OUTPUT "${_latex_documentation_output}"
|
||||
COMMAND "${Sphinx_BUILD_EXECUTABLE}"
|
||||
-b latex
|
||||
-Dbreathe_projects.${PROJECT_NAME}="${_api_xml_output}"
|
||||
"-Dproject=${PROJECT_NAME}"
|
||||
"-Dversion=${PROJECT_VERSION}"
|
||||
"-Drelease=${PROJECT_VERSION}"
|
||||
"-Dauthor=${_author}"
|
||||
"-Dcopyright=${_copyright_year} ${_author}"
|
||||
"-Dbreathe_default_project=${PROJECT_NAME}"
|
||||
"-Dbreathe_projects.${PROJECT_NAME}=${_api_xml_output}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${_latex_documentation_output}"
|
||||
DEPENDS ${PROJECT_NAME}-API-XML
|
||||
@@ -107,7 +126,7 @@ if(${PROJECT_NAME}_WITH_PDF_DOCUMENTATION)
|
||||
set(_pdf_documentation_output "${_latex_documentation_output}/${_pdf_documentation_output}.pdf")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${_pdf_documentation_output}"
|
||||
OUTPUT "${_pdf_documentation_output}"
|
||||
COMMAND "${CMAKE_MAKE_PROGRAM}"
|
||||
MAIN_DEPENDENCY "${_latex_documentation_output}"
|
||||
WORKING_DIRECTORY "${_latex_documentation_output}"
|
||||
@@ -121,7 +140,7 @@ if(${PROJECT_NAME}_WITH_PDF_DOCUMENTATION)
|
||||
|
||||
install(FILES "${_pdf_documentation_output}"
|
||||
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
|
||||
RENAME "${PROJECT_NAME} v${PROJECT_VERSION}.pdf"
|
||||
RENAME "${PROJECT_NAME}-${PROJECT_VERSION}-documentation.pdf"
|
||||
COMPONENT ${PROJECT_NAME}_Documentation)
|
||||
endif()
|
||||
|
||||
|
||||
20
projects/Z80/documentation/Makefile
vendored
20
projects/Z80/documentation/Makefile
vendored
@@ -1,20 +0,0 @@
|
||||
# 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)
|
||||
532
projects/Z80/documentation/Thanks.rst
vendored
532
projects/Z80/documentation/Thanks.rst
vendored
@@ -1,532 +0,0 @@
|
||||
======
|
||||
Thanks
|
||||
======
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. |re| raw:: html
|
||||
|
||||
<sup>
|
||||
|
||||
.. |ren| raw:: html
|
||||
|
||||
</sup>
|
||||
|
||||
.. only:: latex
|
||||
|
||||
.. |fe| raw:: latex
|
||||
|
||||
\textsuperscript{
|
||||
|
||||
.. |ces| raw:: latex
|
||||
|
||||
}
|
||||
|
||||
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. |re| |fe| :ref:`1<r1>` |ren| |ces|
|
||||
2. For discovering the unstable behavior of the ``ccf/scf`` instructions.
|
||||
3. For his invaluable help.
|
||||
|
||||
* **Banks, David (hoglet)**
|
||||
|
||||
1. For cracking the flag behavior of the block instructions. |re| |fe| :ref:`2<r2>`, :ref:`3<r3>` |ren| |ces|
|
||||
2. For his research on the behavior of the ``ccf/scf`` instructions. |re| |fe| :ref:`3<r3>` |ren| |ces|
|
||||
|
||||
* **Beliansky, Anatoly (Tolik_Trek)**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`4<r4>` |ren| |ces|
|
||||
|
||||
* **Bobrowski, Jan**
|
||||
|
||||
* For fixing the *"Z80 Full Instruction Set Exerciser for Spectrum"*. |re| |fe| :ref:`5<r5>` |ren| |ces|
|
||||
|
||||
* **boo_boo**
|
||||
|
||||
* For cracking the behavior of the MEMPTR register. |re| |fe| :ref:`6<r6>`, :ref:`7<r7>`, :ref:`8<r8>`, :ref:`9<r9>` |ren| |ces|
|
||||
|
||||
* **Brady, Stuart**
|
||||
|
||||
* For his research on the behavior of the ``ccf/scf`` instructions. |re| |fe| :ref:`10<r10>` |ren| |ces|
|
||||
|
||||
* **Brewer, Tony**
|
||||
|
||||
1. For his research on the special RESET. |re| |fe| :ref:`11<r11>`, :ref:`12<r12>` |ren| |ces|
|
||||
2. For helping to crack the flag behavior of the block instructions. |re| |fe| :ref:`2<r2>` |ren| |ces|
|
||||
3. For conducting low-level tests on real hardware. |re| |fe| :ref:`2<r2>` |ren| |ces|
|
||||
4. For helping me to test different undocumented behaviors of the Zilog Z80.
|
||||
|
||||
* **Bystrov, Dmitry (Alone Coder)**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`4<r4>` |ren| |ces|
|
||||
|
||||
* **Chandler, Richard**
|
||||
|
||||
1. For his corrections to the documentation.
|
||||
2. For validating tests on real hardware. |re| |fe| :ref:`13<r13>` |ren| |ces|
|
||||
|
||||
* **Chunin, Roman (CHRV)**
|
||||
|
||||
* For testing the behavior of the MEMPTR register on real Z80 chips. |re| |fe| :ref:`6<r6>`, :ref:`7<r7>`, :ref:`8<r8>`, :ref:`9<r9>` |ren| |ces|
|
||||
|
||||
* **Conway, Simon (BadBeard)**
|
||||
|
||||
* For validating the *"Z80 Test Suite"* on several Z80 clones. |re| |fe| :ref:`14<r14>` |ren| |ces|
|
||||
|
||||
* **Cooke, Simon**
|
||||
|
||||
* For discovering how the ``out (c),0`` instruction behaves on the Zilog Z80 CMOS. |re| |fe| :ref:`15<r15>` |ren| |ces|
|
||||
|
||||
* **Cringle, Frank D.**
|
||||
|
||||
* For writing the *"Z80 Instruction Set Exerciser"*. |re| |fe| :ref:`16<r16>` |ren| |ces|
|
||||
|
||||
* **Devic, Goran**
|
||||
|
||||
* For his research on undocumented behaviors of the Z80 CPU. |re| |fe| :ref:`17<r17>` |ren| |ces|
|
||||
|
||||
* **Dunn, Paul (ZXDunny)**
|
||||
|
||||
* For his corrections to the documentation.
|
||||
|
||||
* **Equinox**
|
||||
|
||||
* For his corrections to the documentation.
|
||||
|
||||
* **Flammenkamp, Achim**
|
||||
|
||||
* For his article on Z80 interrupts. |re| |fe| :ref:`18<r18>` |ren| |ces|
|
||||
|
||||
* **Gimeno Fortea, Pedro**
|
||||
|
||||
1. For his research work. |re| |fe| :ref:`19<r19>` |ren| |ces|
|
||||
2. For writing the first-ever ZX Spectrum emulator. |re| |fe| :ref:`20<r20>`, :ref:`21<r21>` |ren| |ces|
|
||||
|
||||
* **goodboy**
|
||||
|
||||
* For testing the behavior of the MEMPTR register on real Z80 chips. |re| |fe| :ref:`6<r6>`, :ref:`7<r7>`, :ref:`8<r8>`, :ref:`9<r9>` |ren| |ces|
|
||||
|
||||
* **Greenway, Ian**
|
||||
|
||||
* For testing the behavior of the ``ccf/scf`` instructions on real hardware. |re| |fe| :ref:`10<r10>`, :ref:`22<r22>` |ren| |ces|
|
||||
|
||||
* **Harston, Jonathan Graham**
|
||||
|
||||
1. For his research work.
|
||||
2. For his technical documents about the Zilog Z80. |re| |fe| :ref:`23<r23>`, :ref:`24<r24>`, :ref:`25<r25>` |ren| |ces|
|
||||
3. For porting the *"Z80 Instruction Set Exerciser"* to the ZX Spectrum. |re| |fe| :ref:`26<r26>` |ren| |ces|
|
||||
|
||||
* **Helcmanovsky, Peter (Ped7g)**
|
||||
|
||||
1. For helping me to write the *"IN-MEMPTR"* test.
|
||||
2. For writing the *"Z80 Block Flags Test"*. |re| |fe| :ref:`27<r27>`, :ref:`28<r28>` |ren| |ces|
|
||||
3. For writing the *"Z80 CCF SCF Outcome Stability"* test. |re| |fe| :ref:`28<r28>` |ren| |ces|
|
||||
4. For writing the *"Z80 INT Skip"* test. |re| |fe| :ref:`28<r28>` |ren| |ces|
|
||||
5. For his research on the unstable behavior of the ``ccf/scf`` instructions.
|
||||
6. For his invaluable help.
|
||||
|
||||
* **Iborra Debón, Víctor (Eremus)**
|
||||
|
||||
* For validating tests on real hardware.
|
||||
|
||||
* **icebear**
|
||||
|
||||
* For testing the behavior of the MEMPTR register on real Z80 chips. |re| |fe| :ref:`6<r6>`, :ref:`7<r7>`, :ref:`8<r8>`, :ref:`9<r9>` |ren| |ces|
|
||||
|
||||
* **ICEknight**
|
||||
|
||||
* For validating tests on real hardware.
|
||||
|
||||
* **Kladov, Vladimir**
|
||||
|
||||
* For cracking the behavior of the MEMPTR register. |re| |fe| :ref:`6<r6>`, :ref:`7<r7>`, :ref:`8<r8>`, :ref:`9<r9>` |ren| |ces|
|
||||
|
||||
* **Krook, Magnus**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`29<r29>` |ren| |ces|
|
||||
|
||||
* **London, Matthew (mattinx)**
|
||||
|
||||
* For validating tests on real hardware.
|
||||
|
||||
* **Martínez Cantero, Ricardo (Kyp)**
|
||||
|
||||
* For validating tests on real hardware.
|
||||
|
||||
* **Molodtsov, Aleksandr**
|
||||
|
||||
* For testing the behavior of the MEMPTR register on real Z80 chips. |re| |fe| :ref:`6<r6>`, :ref:`7<r7>`, :ref:`8<r8>`, :ref:`9<r9>` |ren| |ces|
|
||||
|
||||
* **Nair, Arjun**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`27<r27>` |ren| |ces|
|
||||
|
||||
* **Nicolás-González, César**
|
||||
|
||||
* For helping me to investigate the unstable behavior of the ``ccf/scf`` instructions.
|
||||
|
||||
* **Ortega Sosa, Sofía**
|
||||
|
||||
1. For optimizing the emulator.
|
||||
2. For her help and support.
|
||||
|
||||
* **Owen, Simon**
|
||||
|
||||
* For the idea of the hooking method used in this emulator.
|
||||
|
||||
* **Ownby, Matthew P.**
|
||||
|
||||
* For his research on the state of the registers after POWER-ON. |re| |fe| :ref:`30<r30>` |ren| |ces|
|
||||
|
||||
* **Rak, Patrik**
|
||||
|
||||
1. For improving the *"Z80 Instruction Set Exerciser for Spectrum"*. |re| |fe| :ref:`31<r31>` |ren| |ces|
|
||||
2. For cracking the behavior of the ``ccf/scf`` instructions. |re| |fe| :ref:`14<r14>`, :ref:`31<r31>` |ren| |ces|
|
||||
3. For writing the *"Zilog Z80 CPU Test Suite"*. |re| |fe| :ref:`31<r31>`, :ref:`32<r32>` |ren| |ces|
|
||||
4. For his research on the unstable behavior of the ``ccf/scf`` instructions.
|
||||
|
||||
* **Rodríguez Jódar, Miguel Ángel (mcleod_ideafix)**
|
||||
|
||||
* For his research on the state of the registers after POWER-ON/RESET. |re| |fe| :ref:`33<r33>` |ren| |ces|
|
||||
|
||||
* **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. |re| |fe| :ref:`34<r34>`, :ref:`35<r35>` |ren| |ces|
|
||||
|
||||
* **Sevillano Mancilla, Marta (TheMartian)**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`13<r13>` |ren| |ces|
|
||||
|
||||
* **Stevenson, Dave**
|
||||
|
||||
1. For testing the special RESET on real hardware. |re| |fe| :ref:`11<r11>` |ren| |ces|
|
||||
2. For conducting low-level tests on real hardware. |re| |fe| :ref:`36<r36>` |ren| |ces|
|
||||
|
||||
* **Vučenović, Zoran**
|
||||
|
||||
* For writing the Pascal binding.
|
||||
|
||||
* **Weissflog, Andre (Floh)**
|
||||
|
||||
1. For discovering that the ``reti/retn`` instructions defer the acceptance of the maskable interrupt. |re| |fe| :ref:`37<r37>` |ren| |ces|
|
||||
2. For writing the *"Visual Z80 Remix"* simulator. |re| |fe| :ref:`38<r38>` |ren| |ces|
|
||||
|
||||
* **Wilkinson, Oli (evolutional)**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`27<r27>` |ren| |ces|
|
||||
|
||||
* **Wlodek**
|
||||
|
||||
* For testing the behavior of the MEMPTR register on real Z80 chips. |re| |fe| :ref:`6<r6>`, :ref:`7<r7>`, :ref:`8<r8>`, :ref:`9<r9>` |ren| |ces|
|
||||
|
||||
* **Woodmass, Mark (Woody)**
|
||||
|
||||
1. For his invaluable contributions to the emuscene.
|
||||
2. For writing the *"Z80 Test Suite"*. |re| |fe| :ref:`14<r14>` |ren| |ces|
|
||||
3. For his research on the behavior of the `ccf/scf` instructions. |re| |fe| :ref:`39<r39>` |ren| |ces|
|
||||
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. |re| |fe| :ref:`19<r19>`, :ref:`30<r30>`, :ref:`40<r40>` |ren| |ces|
|
||||
|
||||
* **ZXGuesser**
|
||||
|
||||
* For validating tests on real hardware.
|
||||
|
||||
|
||||
References
|
||||
==========
|
||||
|
||||
1.
|
||||
|
||||
.. _r1:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83384#p83384
|
||||
|
||||
2.
|
||||
|
||||
.. _r2:
|
||||
|
||||
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.
|
||||
|
||||
.. _r3:
|
||||
|
||||
Banks, David (2018-08-21). *"Undocumented Z80 Flags"* rev. 1.0.
|
||||
|
||||
* https://github.com/hoglet67/Z80Decoder/wiki/Undocumented-Flags
|
||||
* https://stardot.org.uk/forums/download/file.php?id=39831
|
||||
|
||||
4.
|
||||
|
||||
.. _r4:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83041#p83041
|
||||
|
||||
5.
|
||||
|
||||
.. _r5:
|
||||
|
||||
http://wizard.ae.krakow.pl/~jb/qaop/tests.html
|
||||
|
||||
6.
|
||||
|
||||
.. _r6:
|
||||
|
||||
https://zxpress.ru/zxnet/zxnet.pc/5909
|
||||
|
||||
7.
|
||||
|
||||
.. _r7:
|
||||
|
||||
https://zx-pk.ru/threads/2506-komanda-bit-n-(hl).html
|
||||
|
||||
8.
|
||||
|
||||
.. _r8:
|
||||
|
||||
https://zx-pk.ru/threads/2586-prosba-realshchikam-ot-emulyatorshchikov.html
|
||||
|
||||
9.
|
||||
|
||||
.. _r9:
|
||||
|
||||
boo_boo; Kladov, Vladimir (2006-03-29). *"MEMPTR, Esoteric Register of the Zilog Z80 CPU"*.
|
||||
|
||||
* https://zx-pk.ru/showpost.php?p=43688
|
||||
* https://zx-pk.ru/attachment.php?attachmentid=2984
|
||||
* https://zx-pk.ru/showpost.php?p=43800
|
||||
* https://zx-pk.ru/attachment.php?attachmentid=2989
|
||||
|
||||
10.
|
||||
|
||||
.. _r10:
|
||||
|
||||
https://sourceforge.net/p/fuse-emulator/mailman/message/6929573
|
||||
|
||||
11.
|
||||
|
||||
.. _r11:
|
||||
|
||||
Brewer, Tony (2014-12). *"Z80 Special Reset"*.
|
||||
|
||||
* http://primrosebank.net/computers/z80/z80_special_reset.htm
|
||||
|
||||
12.
|
||||
|
||||
.. _r12:
|
||||
|
||||
https://stardot.org.uk/forums/viewtopic.php?p=357136#p357136
|
||||
|
||||
13.
|
||||
|
||||
.. _r13:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?t=10555
|
||||
|
||||
14.
|
||||
|
||||
.. _r14:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/20345
|
||||
|
||||
15.
|
||||
|
||||
.. _r15:
|
||||
|
||||
https://groups.google.com/g/comp.os.cpm/c/HfSTFpaIkuU/m/KotvMWu3bZoJ
|
||||
|
||||
16.
|
||||
|
||||
.. _r16:
|
||||
|
||||
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
|
||||
|
||||
17.
|
||||
|
||||
.. _r17:
|
||||
|
||||
https://baltazarstudios.com/zilog-z80-undocumented-behavior
|
||||
|
||||
18.
|
||||
|
||||
.. _r18:
|
||||
|
||||
Flammenkamp, Achim. *"Interrupt Behaviour of the Z80 CPU"*.
|
||||
|
||||
* http://z80.info/interrup.htm
|
||||
|
||||
19.
|
||||
|
||||
.. _r19:
|
||||
|
||||
Young, Sean (1998-10). *"Z80 Undocumented Features (in Software Behaviour)"* v0.3.
|
||||
|
||||
* http://www.msxnet.org/tech/Z80/z80undoc.txt
|
||||
|
||||
20.
|
||||
|
||||
.. _r20:
|
||||
|
||||
https://elmundodelspectrum.com/desenterrando-el-primer-emulador-de-spectrum
|
||||
|
||||
21.
|
||||
|
||||
.. _r21:
|
||||
|
||||
https://elmundodelspectrum.com/con-vosotros-el-emulador-de-pedro-gimeno-1989
|
||||
|
||||
22.
|
||||
|
||||
.. _r22:
|
||||
|
||||
https://sourceforge.net/p/fuse-emulator/mailman/message/4502844
|
||||
|
||||
23.
|
||||
|
||||
.. _r23:
|
||||
|
||||
Harston, Jonathan Graham (2008). *"Full Z80 Opcode List Including Undocumented Opcodes"* v0.11 (revised).
|
||||
|
||||
* https://mdfs.net/Docs/Comp/Z80/OpList
|
||||
|
||||
24.
|
||||
|
||||
.. _r24:
|
||||
|
||||
Harston, Jonathan Graham (2012). *"Z80 Microprocessor Undocumented Instructions"* v0.15.
|
||||
|
||||
* https://mdfs.net/Docs/Comp/Z80/UnDocOps
|
||||
|
||||
25.
|
||||
|
||||
.. _r25:
|
||||
|
||||
Harston, Jonathan Graham (2014). *"Z80 Opcode Map"* v0.10 (revised).
|
||||
|
||||
* https://mdfs.net/Docs/Comp/Z80/OpCodeMap
|
||||
|
||||
26.
|
||||
|
||||
.. _r26:
|
||||
|
||||
https://mdfs.net/Software/Z80/Exerciser/Spectrum
|
||||
|
||||
27.
|
||||
|
||||
.. _r27:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?t=6102
|
||||
|
||||
28.
|
||||
|
||||
.. _r28:
|
||||
|
||||
https://github.com/MrKWatkins/ZXSpectrumNextTests
|
||||
|
||||
29.
|
||||
|
||||
.. _r29:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83157#p83157
|
||||
|
||||
30.
|
||||
|
||||
.. _r30:
|
||||
|
||||
Young, Sean (2005-09-18). *"Undocumented Z80 Documented, The"* v0.91.
|
||||
|
||||
* http://www.myquest.nl/z80undocumented
|
||||
* http://www.myquest.nl/z80undocumented/z80-documented-v0.91.pdf
|
||||
|
||||
31.
|
||||
|
||||
.. _r31:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/41704
|
||||
|
||||
* http://zxds.raxoft.cz/taps/misc/zexall2.zip
|
||||
|
||||
32.
|
||||
|
||||
.. _r32:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/41834
|
||||
|
||||
* http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip
|
||||
* https://github.com/raxoft/z80test
|
||||
|
||||
33.
|
||||
|
||||
.. _r33:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/34574
|
||||
|
||||
34.
|
||||
|
||||
.. _r34:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/comment/668760/#Comment_668760
|
||||
|
||||
35.
|
||||
|
||||
.. _r35:
|
||||
|
||||
https://jisanchez.com/test-a-dos-placas-de-zx-spectrum
|
||||
|
||||
36.
|
||||
|
||||
.. _r36:
|
||||
|
||||
https://stardot.org.uk/forums/viewtopic.php?p=212360#p212360
|
||||
|
||||
37.
|
||||
|
||||
.. _r37:
|
||||
|
||||
Weissflog, Andre (2021-12-17). *"New Cycle-Stepped Z80 Emulator, A"*.
|
||||
|
||||
* https://floooh.github.io/2021/12/17/cycle-stepped-z80.html
|
||||
|
||||
38.
|
||||
|
||||
.. _r38:
|
||||
|
||||
https://github.com/floooh/v6502r
|
||||
|
||||
39.
|
||||
|
||||
.. _r39:
|
||||
|
||||
https://groups.google.com/g/comp.sys.sinclair/c/WPsPr6j6w5k/m/O_u1zNQf3VYJ
|
||||
|
||||
40.
|
||||
|
||||
.. _r40:
|
||||
|
||||
Young, Sean (1997-09-21). *"Zilog Z80 CPU Specifications"*.
|
||||
|
||||
* http://www.msxnet.org/tech/Z80/z80.zip
|
||||
75
projects/Z80/documentation/VersionHistory.rst
vendored
75
projects/Z80/documentation/VersionHistory.rst
vendored
@@ -1,75 +0,0 @@
|
||||
===============
|
||||
Version history
|
||||
===============
|
||||
|
||||
Z80 v0.2-pre
|
||||
============
|
||||
|
||||
*Released on 2024-04-18*
|
||||
|
||||
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 :doc:`license <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 <https://cmake.org>`_.
|
||||
5. Switched to `Zeta <https://zeta.st>`_ v0.1.
|
||||
6. Added `pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config>`_ support.
|
||||
7. Added the following files to the project: :file:`.vimrc`, :file:`CITATION.cff`, :file:`file_id.diz` and :file:`THANKS`.
|
||||
8. Added detailed documentation.
|
||||
9. Added Pascal binding, courtesy of Zoran Vučenović.
|
||||
10. Added tests.
|
||||
11. Added :ref:`public macros <APIReference:Macros>` for checking the library version, working with flags, accessing the 16-bit registers and other purposes.
|
||||
12. Added the ability to end the emulation loop immediately, and the :c:func:`z80_break` function.
|
||||
13. Added the :c:func:`z80_execute` function for running a simplified emulation without RESET and interrupts.
|
||||
14. Added the :c:func:`z80_refresh_address` function for getting the refresh address of the current M1 cycle.
|
||||
15. Added the :c:func:`z80_in_cycle` and :c:func:`z80_out_cycle` functions for obtaining the clock cycle at which the I/O M-cycle begins, relative to the start of the instruction.
|
||||
16. Renamed the ``z80_reset`` function to :c:func:`z80_instant_reset`.
|
||||
17. Added optional emulation of the special RESET, and the :c:func:`z80_special_reset` function.
|
||||
18. Added the :c:data:`Z80::fetch_opcode<Z80.fetch_opcode>` and :c:data:`Z80::fetch<Z80.fetch>` callbacks for performing opcode fetch operations and memory read operations on instruction data, respectively.
|
||||
19. Added the :c:data:`Z80::nop<Z80.nop>` callback for performing disregarded opcode fetch operations during internal NOP M-cycles.
|
||||
20. Added emulation of the NMI acknowledge M-cycle through the new :c:data:`Z80::nmia<Z80.nmia>` callback.
|
||||
21. Added emulation of the INT acknowledge M-cycle through the new :c:data:`Z80::inta<Z80.inta>` callback, which replaces ``Z80::int_data``.
|
||||
22. Added optional full emulation of the interrupt mode 0, along with the new :c:data:`Z80::int_fetch<Z80.int_fetch>` callback for performing 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.
|
||||
23. Added four callbacks for notifying the execution of important instructions: :c:data:`Z80::ld_i_a<Z80.ld_i_a>`, :c:data:`Z80::ld_r_a<Z80.ld_r_a>`, :c:data:`Z80::reti<Z80.reti>` and :c:data:`Z80::retn<Z80.retn>`.
|
||||
24. Added hooking functionality through the ``ld h,h`` instruction and the new :c:data:`Z80::hook<Z80.hook>` callback.
|
||||
25. Added the :c:data:`Z80::illegal<Z80.illegal>` callback for delegating the emulation of illegal instructions.
|
||||
26. Added :ref:`emulation options <APIReference:Configuration>` that can be configured at runtime.
|
||||
27. Removed ``Z80::state``. Replaced with individual members for the registers, the interrupt enable flip-flops and the interrupt mode.
|
||||
28. Removed the superfluous EI flag. The previous opcode is checked instead, which is faster and makes the :c:type:`Z80` object smaller.
|
||||
29. Removed all module-related stuff.
|
||||
30. Added emulation of the additional flag changes performed during the extra 5 clock cycles of the following instructions: ``ldir``, ``lddr``, ``cpir``, ``cpdr``, ``inir``, ``indr``, ``otir`` and ``otdr``.
|
||||
31. Added emulation of the interrupt acceptance deferral that occurs during the ``reti`` and ``retn`` instructions.
|
||||
32. Added MEMPTR emulation. The ``bit N,(hl)`` instruction now produces a correct value of F.
|
||||
33. Added optional emulation of Q. If enabled at compile-time, the ``ccf`` and ``scf`` instructions will produce a correct value of F.
|
||||
34. Added emulation of the ``out (c),255`` instruction (Zilog Z80 CMOS).
|
||||
35. Added optional emulation of the bug affecting the ``ld a,{i|r}`` instructions (Zilog Z80 NMOS). If enabled at compile-time and configured at runtime, the P/V flag will be reset if an INT is accepted during the execution of these instructions.
|
||||
36. Increased granularity. The emulator can now stop directly after fetching a prefix ``DDh`` or ``FDh`` if it runs out of clock cycles. This also works during the INT response in mode 0.
|
||||
37. Reimplemented the HALT state. The emulation should now be fully accurate. HALTskip optimization is also supported.
|
||||
38. Fixed a bug in the ``sll`` instruction.
|
||||
39. Fixed a bug in the ``INX`` and ``OUTX`` macros affecting the S and N flags.
|
||||
40. Fixed a bug in the ``OUTX`` macro affecting the MSByte of the port number.
|
||||
41. Fixed the clock cycles of the ``dec XY`` and ``in (c)`` instructions.
|
||||
42. Fixed the ``read_16`` function so that the order of the memory read operations is not determined by the order in which the compiler evaluates expressions.
|
||||
43. 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``.
|
||||
44. Fixed the handling of illegal instructions to avoid stack overflows in long sequences of ``DDh/FDh`` prefixes.
|
||||
45. Fixed several implicit conversions to avoid warnings about loss of sign and precision.
|
||||
46. Fixed some bitwise operations to avoid undefined behavior and arithmetic right shifts on signed integers.
|
||||
47. Fixed violations of the C standard in several identifiers.
|
||||
48. Renamed the 8-bit register lists: ``X/Y`` to ``J/K``; ``J/K`` and ``P/Q`` to ``O/P``.
|
||||
49. Replaced all P/V overflow computation functions with a single, faster macro.
|
||||
50. Replaced all register resolution functions with macros.
|
||||
51. Replaced all ``ld {J,K|O,P}`` instructions that have the same destination and source register with NOPs. In addition, the "illegal" forms of the following instructions are now executed without using the illegal instruction handler: ``ld O,P``, ``ld O,BYTE``, ``U [a,]P`` and ``V O``.
|
||||
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.
|
||||
|
||||
Z80 v0.1
|
||||
========
|
||||
|
||||
*Released on 2018-11-10*
|
||||
|
||||
Initial public release.
|
||||
@@ -43,13 +43,14 @@ Stopping the emulation
|
||||
|
||||
.. doxygenfunction:: z80_break
|
||||
|
||||
Requesting interrupts
|
||||
---------------------
|
||||
Sending signals
|
||||
---------------
|
||||
|
||||
.. doxygenfunction:: z80_int
|
||||
.. doxygenfunction:: z80_nmi
|
||||
.. doxygenfunction:: z80_instant_reset
|
||||
.. doxygenfunction:: z80_special_reset
|
||||
.. doxygenfunction:: z80_wait
|
||||
|
||||
Obtaining information
|
||||
---------------------
|
||||
@@ -80,7 +81,11 @@ Limits
|
||||
Opcodes
|
||||
-------
|
||||
|
||||
.. doxygendefine:: Z80_HALT
|
||||
.. doxygendefine:: Z80_HOOK
|
||||
.. doxygendefine:: Z80_JP_WORD
|
||||
.. doxygendefine:: Z80_NOP
|
||||
.. doxygendefine:: Z80_RET
|
||||
|
||||
Flags
|
||||
-----
|
||||
53
projects/Z80/documentation/conf.py
vendored
53
projects/Z80/documentation/conf.py
vendored
@@ -1,56 +1,13 @@
|
||||
# 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:
|
||||
# For the full list of built-in configuration values, 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 = u'1999-2024 Manuel Sainz de Baranda y Goñi'
|
||||
author = u'Manuel Sainz de Baranda y Goñi'
|
||||
version = '0.2'
|
||||
|
||||
# -- 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 = ['sphinx.ext.autosectionlabel', 'breathe']
|
||||
|
||||
# sphinx.ext.autosectionlabel
|
||||
autosectionlabel_prefix_document = True
|
||||
|
||||
# Breathe
|
||||
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.
|
||||
#
|
||||
autosectionlabel_prefix_document = True
|
||||
breathe_domain_by_extension = {'h': 'c'}
|
||||
#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']
|
||||
html_static_path = []
|
||||
latex_elements = {'releasename': 'Version'}
|
||||
|
||||
35
projects/Z80/documentation/index.rst
vendored
35
projects/Z80/documentation/index.rst
vendored
@@ -3,32 +3,21 @@
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
===
|
||||
Z80
|
||||
===
|
||||
========
|
||||
Contents
|
||||
========
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Contents
|
||||
|
||||
Introduction
|
||||
Installation
|
||||
Tests
|
||||
Integration
|
||||
Usage
|
||||
APIReference
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Project
|
||||
|
||||
Thanks
|
||||
VersionHistory
|
||||
License
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Indices and tables
|
||||
|
||||
introduction
|
||||
installation-from-source-code
|
||||
tests
|
||||
integration
|
||||
usage
|
||||
api-reference
|
||||
thanks
|
||||
version-history
|
||||
license
|
||||
genindex
|
||||
search
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
============
|
||||
Installation
|
||||
============
|
||||
=============================
|
||||
Installation from source code
|
||||
=============================
|
||||
|
||||
.. only:: html
|
||||
|
||||
@@ -14,21 +14,30 @@ Installation
|
||||
|
||||
\newline
|
||||
|
||||
.. |cmake_option_install_component| replace:: ``--component``
|
||||
.. _cmake_option_install_component: https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-install-component
|
||||
|
||||
.. |cmake_option_build_config| replace:: ``--config``
|
||||
.. _cmake_option_build_config: https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-build-config
|
||||
|
||||
.. |cmake_option_install_strip| replace:: ``--strip``
|
||||
.. _cmake_option_install_strip: https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-install-strip
|
||||
|
||||
.. |cmake_option_install_component| replace:: ``--component``
|
||||
.. _cmake_option_install_component: https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-install-component
|
||||
.. _config-file package: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#config-file-packages
|
||||
.. _CP/M: https://en.wikipedia.org/wiki/CP/M
|
||||
.. _file: https://people.freedesktop.org/~dbn/pkg-config-guide.html
|
||||
.. _pkg-config: https://www.freedesktop.org/wiki/Software/pkg-config
|
||||
.. _unit tests in JSON format: https://github.com/SingleStepTests/z80
|
||||
.. _ZX Spectrum: https://en.wikipedia.org/wiki/ZX_Spectrum
|
||||
|
||||
Prerequisites
|
||||
=============
|
||||
|
||||
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://www.breathe-doc.org>`_ to compile the documentation. Also, make sure that you have `LaTeX <https://www.latex-project.org>`_ with PDF support installed on your system if 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 `source code tarball <https://zeta.st/download>`_ to the root 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>`_.
|
||||
The Z80 library requires some types and macros included in `Zeta <https://zxe.io/software/Zeta>`_, a `header-only <https://en.wikipedia.org/wiki/Header-only>`_, dependency-free library used for portability reasons. Install Zeta or extract its `source code tarball <https://zxe.io/software/Zeta/download>`_ to the root directory of the Z80 project or its parent directory. Zeta is the sole dependency; the emulator does not depend on the `C standard library <https://en.wikipedia.org/wiki/C_standard_library>`_.
|
||||
|
||||
Lastly, the package includes two testing tools, which are optional to build. The first one runs various Z80-specific tests for `CP/M`_ and `ZX Spectrum`_, and will use `libzip <https://libzip.org>`_ and `zlib <https://zlib.net>`_ if they are available on your system. The second tool is for `unit tests in JSON format`_ and requires the `cJSON <https://github.com/DaveGamble/cJSON>`_ and `Z80InsnClock <https://zxe.io/software/Z80InsnClock>`_ libraries.
|
||||
|
||||
Configure
|
||||
=========
|
||||
@@ -45,7 +54,7 @@ The resulting build files can be configured by passing options to ``cmake``. To
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
cmake -LAH
|
||||
cmake -LAH -N -B .
|
||||
|
||||
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:
|
||||
|
||||
@@ -59,6 +68,11 @@ If in doubt, read the `CMake documentation <https://cmake.org/documentation/>`_
|
||||
Choose the type of build (configuration) to generate. |br| |nl|
|
||||
The default is ``Release``.
|
||||
|
||||
.. option:: -DCMAKE_INSTALL_NAME_DIR="<path>"
|
||||
|
||||
Specify the `directory portion <https://developer.apple.com/documentation/xcode/build-settings-reference#Dynamic-Library-Install-Name-Base>`_ of the `dynamic library install name <https://developer.apple.com/documentation/xcode/build-settings-reference#Dynamic-Library-Install-Name>`_ on Apple platforms (for installed shared libraries). |br| |nl|
|
||||
Not defined by default.
|
||||
|
||||
.. option:: -DCMAKE_INSTALL_PREFIX="<path>"
|
||||
|
||||
Specify the installation prefix. |br| |nl|
|
||||
@@ -70,22 +84,22 @@ Package-specific options are prefixed with ``Z80_`` and can be divided into two
|
||||
|
||||
.. option:: -DZ80_DEPOT_LOCATION="<location>"
|
||||
|
||||
Specify the directory or URL of the depot containing the test files (i.e., the firmware and software required by the :doc:`testing tool <Tests>`). |br| |nl|
|
||||
Specify the directory or URL of the depot containing the test files (i.e., the firmware and software required by the :file:`test-Z80` tool). |br| |nl|
|
||||
The default is ``"http://zxe.io/depot"``.
|
||||
|
||||
.. option:: -DZ80_FETCH_TEST_FILES=(YES|NO)
|
||||
|
||||
Copy or download the test files from the depot to the build directory. |br| |nl|
|
||||
If :option:`Z80_WITH_TESTING_TOOL<-DZ80_WITH_TESTING_TOOL>` is ``YES``, copy or download the test files from the depot to the build directory. |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|
|
||||
Specify the directory in which to install the CMake `config-file package`_. |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|
|
||||
Specify the directory in which to install the `pkg-config`_ `file`_. |br| |nl|
|
||||
The default is ``"${CMAKE_INSTALL_LIBDIR}/pkgconfig"``.
|
||||
|
||||
.. option:: -DZ80_NOSTDLIB_FLAGS=(Auto|"[<flag>[;<flag>...]]")
|
||||
@@ -112,7 +126,7 @@ Package-specific options are prefixed with ``Z80_`` and can be divided into two
|
||||
|
||||
.. 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|
|
||||
Generate and install the CMake `config-file package`_. |br| |nl|
|
||||
The default is ``NO``.
|
||||
|
||||
.. option:: -DZ80_WITH_HTML_DOCUMENTATION=(YES|NO)
|
||||
@@ -129,7 +143,7 @@ Package-specific options are prefixed with ``Z80_`` and can be divided into two
|
||||
|
||||
.. 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|
|
||||
Generate and install the `pkg-config`_ `file`_. |br| |nl|
|
||||
The default is ``NO``.
|
||||
|
||||
.. option:: -DZ80_WITH_STANDARD_DOCUMENTS=(YES|NO)
|
||||
@@ -137,14 +151,20 @@ Package-specific options are prefixed with ``Z80_`` and can be divided into two
|
||||
Install the standard text documents distributed with the package: :file:`AUTHORS`, :file:`COPYING`, :file:`COPYING.LESSER`, :file:`HISTORY`, :file:`README` and :file:`THANKS`. |br| |nl|
|
||||
The default is ``NO``.
|
||||
|
||||
.. option:: -DZ80_WITH_TESTS=(YES|NO)
|
||||
.. option:: -DZ80_WITH_STEP_TESTING_TOOL=(YES|NO)
|
||||
|
||||
Build the :doc:`testing tool <Tests>`. |br| |nl|
|
||||
Build :file:`step-test-Z80`, a tool for `unit tests in JSON format`_. |br| |nl|
|
||||
It requires cJSON and Z80InsnClock. |br| |nl|
|
||||
The default is ``NO``.
|
||||
|
||||
.. option:: -DZ80_WITH_TESTING_TOOL=(YES|NO)
|
||||
|
||||
Build :file:`test-Z80`, a tool that runs various Z80-specific tests for `CP/M`_ and `ZX Spectrum`_. |br| |nl|
|
||||
The default is ``NO``.
|
||||
|
||||
.. _cmake_package_source_code_options:
|
||||
|
||||
The second group of package-specific options configures the source code of the library by predefining macros that enable :ref:`optional features <Introduction:Optional features>`:
|
||||
The second group of package-specific options configures the source code of the library by predefining macros that enable :ref:`optional features <introduction:Optional features>`:
|
||||
|
||||
.. option:: -DZ80_WITH_EXECUTE=(YES|NO)
|
||||
|
||||
@@ -161,6 +181,16 @@ The second group of package-specific options configures the source code of the l
|
||||
Enable optional notifications for any ``reti`` or ``retn`` instruction executed during the interrupt mode 0 response. |br| |nl|
|
||||
The default is ``NO``.
|
||||
|
||||
.. option:: -DZ80_WITH_PARITY_COMPUTATION=(YES|NO)
|
||||
|
||||
Enable actual parity calculation for the P/V flag instead of using a table of precomputed values (NOT RECOMMENDED for production builds). |br| |nl|
|
||||
The default is ``NO``.
|
||||
|
||||
.. option:: -DZ80_WITH_PRECOMPUTED_DAA=(YES|NO)
|
||||
|
||||
Use a table of precomputed values to emulate the ``daa`` instruction (NOT RECOMMENDED for production builds). |br| |nl|
|
||||
The default is ``NO``.
|
||||
|
||||
.. option:: -DZ80_WITH_Q=(YES|NO)
|
||||
|
||||
Build the implementation of `Q <https://worldofspectrum.org/forums/discussion/41704>`_. |br| |nl|
|
||||
@@ -201,7 +231,9 @@ Finally, once the build system is configured according to your needs, build and
|
||||
cmake --build . [--config (Debug|Release|RelWithDebInfo|MinSizeRel)]
|
||||
cmake --install . [--config <configuration>] [--strip] [--component <component>]
|
||||
|
||||
The |cmake_option_build_config|_ option is only necessary for those `CMake generators <https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html>`_ that ignore :option:`CMAKE_BUILD_TYPE<-DCMAKE_BUILD_TYPE>` (e.g., Xcode and Visual Studio). Use |cmake_option_install_strip|_ to remove debugging information and non-public symbols when installing non-debug builds of the shared library. To install only a specific component of the package, use the |cmake_option_install_component|_ option. The project defines the following components:
|
||||
The |cmake_option_build_config|_ option is only necessary for those `CMake generators <https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html>`_ that ignore :option:`CMAKE_BUILD_TYPE<-DCMAKE_BUILD_TYPE>` (e.g., Xcode and Visual Studio). Use |cmake_option_install_strip|_ to remove debugging information and non-public symbols when installing non-debug builds of the shared library. To install only a specific component of the package, use the |cmake_option_install_component|_ option.
|
||||
|
||||
The project defines the following components:
|
||||
|
||||
.. option:: Z80_Runtime
|
||||
|
||||
@@ -221,3 +253,9 @@ The |cmake_option_build_config|_ option is only necessary for those `CMake gener
|
||||
|
||||
* Documentation in HTML format.
|
||||
* Documentation in PDF format.
|
||||
|
||||
.. option:: Z80_Testing
|
||||
|
||||
* Testing tools.
|
||||
|
||||
By default, the build system will install ``Z80_Runtime``, ``Z80_Development`` and ``Z80_Documentation``. The ``Z80_Testing`` component can only be installed explicitly.
|
||||
@@ -28,9 +28,9 @@ When not specified as a component, the linking method is selected according to :
|
||||
As a CMake subproject
|
||||
=====================
|
||||
|
||||
To embed the Z80 library as a CMake subproject, extract the source code tarballs of `Zeta <https://zeta.st/download>`_ and `Z80 <https://zxe.io/software/Z80/download>`_ (or clone their respective repositories) into a subdirectory of another project. Then use |add_subdirectory|_ in the parent project to add the Z80 source code tree to the build process (N.B., the Z80 subproject will automatically find Zeta and import it as an `interface library <https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#interface-libraries>`_).
|
||||
To embed the Z80 library as a CMake subproject, extract the source code tarballs of `Zeta <https://zxe.io/software/Zeta/download>`__ and `Z80 <https://zxe.io/software/Z80/download>`_ (or clone their respective repositories) into a subdirectory of another project. Then use |add_subdirectory|_ in the parent project to add the Z80 source code tree to the build process (N.B., the Z80 subproject will automatically find Zeta and import it as an `interface library <https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#interface-libraries>`_).
|
||||
|
||||
It is advisable to configure the Z80 library in the :file:`CMakeLists.txt` of the parent project. This will prevent the user from having to specify :ref:`configuration options for the Z80 subproject <cmake_package_options>` through the command line when building the main project.
|
||||
It is advisable to configure the Z80 library in the :file:`CMakeLists.txt` of the parent project. This will eliminate the need for the user to specify :ref:`configuration options for the Z80 subproject <cmake_package_options>` through the command line when building the main project.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -50,29 +50,29 @@ Non-CMake-based projects
|
||||
|
||||
The source code of the emulator can be configured at compile time by predefining a series of macros. Both :file:`Z80.h` and :file:`Z80.c` obey the first two explained below. The rest of the macros are only relevant when compiling :file:`Z80.c`:
|
||||
|
||||
.. c:macro:: Z80_DEPENDENCIES_HEADER
|
||||
.. c:macro:: Z80_EXTERNAL_HEADER
|
||||
|
||||
Specifies the only external header to ``#include``, replacing all others.
|
||||
|
||||
Predefine this macro to provide a header file that defines the external types and macros used by the emulator, thus preventing your project from depending on `Zeta <https://zeta.st>`_:
|
||||
Predefine this macro to provide a header file that defines the external types and macros used by the emulator, thus preventing your project from depending on `Zeta <https://zxe.io/software/Zeta>`__:
|
||||
|
||||
* Macros: ``Z_ALWAYS_INLINE``, ``Z_API_EXPORT``, ``Z_API_IMPORT``, ``Z_CAST``, ``Z_EMPTY``, ``Z_EXTERN_C_BEGIN``, ``Z_EXTERN_C_END``, ``Z_MEMBER_OFFSET``, ``Z_NULL``, ``Z_UINT8_ROTATE_LEFT``, ``Z_UINT8_ROTATE_RIGHT``, ``Z_UINT16``, ``Z_UINT16_BIG_ENDIAN``, ``Z_UINT32``, ``Z_UINT32_BIG_ENDIAN``, ``Z_UNUSED``, ``Z_USIZE`` and ``Z_USIZE_MAXIMUM``.
|
||||
|
||||
* Types: ``zboolean``, ``zchar``, ``zsint``, ``zsint8``, ``zuint``, ``zuint8``, ``zuint16``, ``zuint32``, ``zusize``, ``ZInt16`` and ``ZInt32``.
|
||||
* Types: ``zbool``, ``zchar``, ``zsint``, ``zsint8``, ``zuint``, ``zuint8``, ``zuint16``, ``zuint32``, ``zusize``, ``ZInt16`` and ``ZInt32``.
|
||||
|
||||
You can use this macro when compiling :file:`Z80.c` as a part of your project or (if your types do not break the binary compatibility) when including ``<Z80.h>`` and linking against a pre-built Z80 library.
|
||||
You can use this macro when compiling :file:`Z80.c` within your project or (if your types do not break the binary compatibility) when including ``<Z80.h>`` and linking against a pre-built Z80 library.
|
||||
|
||||
.. c:macro:: Z80_STATIC
|
||||
|
||||
Restricts the visibility of public symbols.
|
||||
Indicates that the emulator is a static library.
|
||||
|
||||
This macro is required if you are building :file:`Z80.c` as a static library, compiling it directly as a part of your project, or linking your program against the static version of the Z80 library. In either of these cases, make sure this macro is defined before including ``"Z80.h"`` or ``<Z80.h>``.
|
||||
This macro must be predefined when building :file:`Z80.c` as a static library. Additionally, if you compile :file:`Z80.c` directly within your project or link your program against the static version of the Z80 library, ensure that this macro is defined before including ``"Z80.h"`` or ``<Z80.h>``.
|
||||
|
||||
.. c:macro:: Z80_WITH_LOCAL_HEADER
|
||||
|
||||
Tells :file:`Z80.c` to ``#include "Z80.h"`` instead of ``<Z80.h>``.
|
||||
|
||||
The :ref:`optional features <Introduction:Optional features>` of the emulator mentioned in the ":doc:`Installation`" section are disabled by default. If you compile :file:`Z80.c` as a part of your project, enable those features you need by predefining their respective activation macros. They have the same name as their :ref:`CMake equivalents <cmake_package_source_code_options>`:
|
||||
The :ref:`optional features <introduction:Optional features>` of the emulator mentioned in the ":ref:`Configure <installation-from-source-code:Configure>`" section of ":doc:`installation-from-source-code`" are disabled by default. If you compile :file:`Z80.c` within your project, enable those features you need by predefining their respective activation macros. They have the same name as their :ref:`CMake equivalents <cmake_package_source_code_options>`:
|
||||
|
||||
.. c:macro:: Z80_WITH_EXECUTE
|
||||
|
||||
@@ -86,6 +86,14 @@ The :ref:`optional features <Introduction:Optional features>` of the emulator me
|
||||
|
||||
Enables optional notifications for any ``reti`` or ``retn`` instruction executed during the interrupt mode 0 response.
|
||||
|
||||
.. c:macro:: Z80_WITH_PARITY_COMPUTATION
|
||||
|
||||
Enables actual parity calculation for the P/V flag instead of using a table of precomputed values.
|
||||
|
||||
.. c:macro:: Z80_WITH_PRECOMPUTED_DAA
|
||||
|
||||
Enables the use of a table of precomputed values to emulate the ``daa`` instruction.
|
||||
|
||||
.. c:macro:: Z80_WITH_Q
|
||||
|
||||
Enables the implementation of `Q <https://worldofspectrum.org/forums/discussion/41704>`_.
|
||||
@@ -102,4 +110,4 @@ The :ref:`optional features <Introduction:Optional features>` of the emulator me
|
||||
|
||||
Enables 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.
|
||||
|
||||
Except for :c:macro:`Z80_DEPENDENCIES_HEADER`, the above macros can be empty; the source code only checks whether they are defined.
|
||||
Except for :c:macro:`Z80_EXTERNAL_HEADER`, the above macros can be empty; the source code only checks whether they are defined.
|
||||
@@ -2,7 +2,7 @@
|
||||
License
|
||||
=======
|
||||
|
||||
Copyright © 1999-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright © 1999-2026 Manuel Sainz de Baranda y Goñi.
|
||||
|
||||
This library 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.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.
|
||||
|
||||
35
projects/Z80/documentation/make.bat
vendored
35
projects/Z80/documentation/make.bat
vendored
@@ -1,35 +0,0 @@
|
||||
@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
|
||||
623
projects/Z80/documentation/thanks.rst
vendored
Normal file
623
projects/Z80/documentation/thanks.rst
vendored
Normal file
@@ -0,0 +1,623 @@
|
||||
======
|
||||
Thanks
|
||||
======
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. |re| raw:: html
|
||||
|
||||
<sup>
|
||||
|
||||
.. |ren| raw:: html
|
||||
|
||||
</sup>
|
||||
|
||||
.. only:: latex
|
||||
|
||||
.. |fe| raw:: latex
|
||||
|
||||
\textsuperscript{
|
||||
|
||||
.. |ces| raw:: latex
|
||||
|
||||
}
|
||||
|
||||
Many thanks to the following individuals (in alphabetical order):
|
||||
|
||||
* **Akimov, Vadim (lvd)**
|
||||
|
||||
* For testing the library on many different platforms and CPU architectures.
|
||||
|
||||
* **Anisimov, Alexey (SoftLight)**
|
||||
|
||||
* For testing the ``ccf/scf`` instructions on real hardware. |re| |fe| :ref:`1<r_1>` |ren| |ces|
|
||||
|
||||
* **azesmbog**
|
||||
|
||||
1. For validating tests on real hardware. |re| |fe| :ref:`2.1<r_2_1>` |ren| |ces|
|
||||
2. For discovering the unstable behavior of the ``ccf/scf`` instructions.
|
||||
3. For testing the ``ccf/scf`` instructions on real hardware. |re| |fe| :ref:`1<r_1>`, :ref:`3<r_3>` |ren| |ces|
|
||||
4. For his invaluable help.
|
||||
|
||||
* **Banks, David (hoglet)**
|
||||
|
||||
1. For deciphering the additional flag changes of the block instructions. |re| |fe| :ref:`4.1<r_4_1>`, :ref:`4.2<r_4_2>`, :ref:`5<r_5>` |ren| |ces|
|
||||
2. For his research on the ``ccf/scf`` instructions. |re| |fe| :ref:`5<r_5>`, :ref:`6<r_6>` |ren| |ces|
|
||||
|
||||
* **Beliansky, Anatoly (Tolik_Trek)**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`2.2<r_2_2>` |ren| |ces|
|
||||
|
||||
* **Bobrowski, Jan**
|
||||
|
||||
* For fixing *"Z80 Full Instruction Set Exerciser for Spectrum"*. |re| |fe| :ref:`7<r_7>` |ren| |ces|
|
||||
|
||||
* **boo_boo**
|
||||
|
||||
* For deciphering the behavior of MEMPTR. |re| |fe| :ref:`8<r_8>`, :ref:`9<r_9>`, :ref:`10<r_10>`, :ref:`11<r_11>` |ren| |ces|
|
||||
|
||||
* **Brady, Stuart**
|
||||
|
||||
* For his research on the ``ccf/scf`` instructions. |re| |fe| :ref:`12<r_12>` |ren| |ces|
|
||||
|
||||
* **Brewer, Tony**
|
||||
|
||||
1. For his research on the special RESET. |re| |fe| :ref:`4.3<r_4_3>`, :ref:`13<r_13>` |ren| |ces|
|
||||
2. For helping to decipher the additional flag changes of the block instructions. |re| |fe| :ref:`4<r_4>` |ren| |ces|
|
||||
3. For conducting low-level tests on real hardware. |re| |fe| :ref:`4<r_4>` |ren| |ces|
|
||||
4. For helping me to test different undocumented behaviors of the Zilog Z80.
|
||||
5. For discovering that the ``DD/FD`` prefixes affect the behavior of the ``ccf/scf`` instructions. |re| |fe| :ref:`4.4<r_4_4>` |ren| |ces|
|
||||
|
||||
* **Bystrov, Dmitry (Alone Coder)**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`2.2<r_2_2>` |ren| |ces|
|
||||
|
||||
* **Chaikin, Mikhail (P321)**
|
||||
|
||||
* For testing the ``ccf/scf`` instructions on real hardware. |re| |fe| :ref:`1<r_1>` |ren| |ces|
|
||||
|
||||
* **Chandler, Richard**
|
||||
|
||||
1. For his corrections to the documentation.
|
||||
2. For validating tests on real hardware. |re| |fe| :ref:`14<r_14>` |ren| |ces|
|
||||
|
||||
* **Chunin, Roman (CHRV)**
|
||||
|
||||
* For testing the behavior of MEMPTR on real hardware. |re| |fe| :ref:`8<r_8>`, :ref:`9<r_9>`, :ref:`10<r_10>`, :ref:`11<r_11>` |ren| |ces|
|
||||
|
||||
* **Conway, Simon (BadBeard)**
|
||||
|
||||
* For validating *"Z80 Test Suite"* on several Z80 clones. |re| |fe| :ref:`15<r_15>` |ren| |ces|
|
||||
|
||||
* **Cooke, Simon**
|
||||
|
||||
* For discovering how the ``out (c),0`` instruction behaves on the Zilog Z80 CMOS. |re| |fe| :ref:`16<r_16>` |ren| |ces|
|
||||
|
||||
* **Cringle, Frank D.**
|
||||
|
||||
* For writing *"Z80 Instruction Set Exerciser"*. |re| |fe| :ref:`17<r_17>` |ren| |ces|
|
||||
|
||||
* **Devic, Goran**
|
||||
|
||||
* For his research on undocumented behaviors of the Z80 CPU. |re| |fe| :ref:`18<r_18>` |ren| |ces|
|
||||
|
||||
* **Dmitriev, Dmitry (DDp)**
|
||||
|
||||
* For testing the ``ccf/scf`` instructions on real hardware. |re| |fe| :ref:`3<r_3>` |ren| |ces|
|
||||
|
||||
* **Dunn, Paul (ZXDunny)**
|
||||
|
||||
* For his corrections to the documentation.
|
||||
|
||||
* **Equinox**
|
||||
|
||||
* For his corrections to the documentation.
|
||||
|
||||
* **Flammenkamp, Achim**
|
||||
|
||||
* For his article on Z80 interrupts. |re| |fe| :ref:`19<r_19>` |ren| |ces|
|
||||
|
||||
* **Gimeno Fortea, Pedro**
|
||||
|
||||
1. For his research work. |re| |fe| :ref:`20<r_20>` |ren| |ces|
|
||||
2. For writing the first-ever ZX Spectrum emulator. |re| |fe| :ref:`21<r_21>`, :ref:`22<r_22>` |ren| |ces|
|
||||
|
||||
* **Greenway, Ian**
|
||||
|
||||
* For testing the ``ccf/scf`` instructions on real hardware. |re| |fe| :ref:`12<r_12>`, :ref:`23<r_23>` |ren| |ces|
|
||||
|
||||
* **Harston, Jonathan Graham**
|
||||
|
||||
1. For his research work.
|
||||
2. For his technical documents about the Zilog Z80. |re| |fe| :ref:`24<r_24>`, :ref:`25<r_25>`, :ref:`26<r_26>` |ren| |ces|
|
||||
3. For porting *"Z80 Instruction Set Exerciser"* to the ZX Spectrum. |re| |fe| :ref:`27<r_27>` |ren| |ces|
|
||||
|
||||
* **Helcmanovsky, Peter (Ped7g)**
|
||||
|
||||
1. For helping me to write *"IN-MEMPTR"*.
|
||||
2. For writing *"Z80 Block Flags Test"*. |re| |fe| :ref:`2<r_2>`, :ref:`28<r_28>` |ren| |ces|
|
||||
3. For writing *"Z80 CCF SCF Outcome Stability"*. |re| |fe| :ref:`28<r_28>` |ren| |ces|
|
||||
4. For writing *"Z80 INT Skip"*. |re| |fe| :ref:`28<r_28>` |ren| |ces|
|
||||
5. For writing *"FDDD2"*, *"Z80 DDFD3"*, *"Z80 IM1 vs JR"* and many other tests.
|
||||
6. For his research on the unstable behavior of the ``ccf/scf`` instructions.
|
||||
7. For his invaluable help.
|
||||
|
||||
* **Iborra Debón, Víctor (Eremus)**
|
||||
|
||||
* For validating tests on real hardware.
|
||||
|
||||
* **icebear**
|
||||
|
||||
* For testing the behavior of MEMPTR on real hardware. |re| |fe| :ref:`8<r_8>`, :ref:`9<r_9>`, :ref:`10<r_10>`, :ref:`11<r_11>` |ren| |ces|
|
||||
|
||||
* **ICEknight**
|
||||
|
||||
* For validating tests on real hardware.
|
||||
|
||||
* **Ilyichev, Ivan (ivang78)**
|
||||
|
||||
* For testing the behavior of MEMPTR on real hardware. |re| |fe| :ref:`29<r_29>` |ren| |ces|
|
||||
|
||||
* **Kladov, Vladimir**
|
||||
|
||||
* For deciphering the behavior of MEMPTR. |re| |fe| :ref:`8<r_8>`, :ref:`9<r_9>`, :ref:`10<r_10>`, :ref:`11<r_11>` |ren| |ces|
|
||||
|
||||
* **Kovrigin, Alexey (creator)**
|
||||
|
||||
* For testing the ``ccf/scf`` instructions on real hardware. |re| |fe| :ref:`1<r_1>`, :ref:`3<r_3>` |ren| |ces|
|
||||
|
||||
* **Krook, Magnus**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`2.3<r_2_3>` |ren| |ces|
|
||||
|
||||
* **London, Matthew (mattinx)**
|
||||
|
||||
* For validating tests on real hardware.
|
||||
|
||||
* **Martínez Cantero, Ricardo (Kyp)**
|
||||
|
||||
* For validating tests on real hardware.
|
||||
|
||||
* **Molodtsov, Aleksandr**
|
||||
|
||||
* For testing the behavior of MEMPTR on real hardware. |re| |fe| :ref:`8<r_8>`, :ref:`9<r_9>`, :ref:`10<r_10>`, :ref:`11<r_11>` |ren| |ces|
|
||||
|
||||
* **Nair, Arjun**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`2<r_2>` |ren| |ces|
|
||||
|
||||
* **Nicolás-González, César**
|
||||
|
||||
* For helping me to investigate the unstable behavior of the ``ccf/scf`` instructions.
|
||||
|
||||
* **Ortega Sosa, Sofía**
|
||||
|
||||
1. For optimizing the emulator.
|
||||
2. For her help and support.
|
||||
|
||||
* **Owen, Simon**
|
||||
|
||||
* For the idea of the hooking method used in this emulator.
|
||||
|
||||
* **Ownby, Matthew P.**
|
||||
|
||||
* For his research on the state of the registers after POWER-ON. |re| |fe| :ref:`30<r_30>` |ren| |ces|
|
||||
|
||||
* **Rak, Patrik**
|
||||
|
||||
1. For improving *"Z80 Instruction Set Exerciser for Spectrum"*. |re| |fe| :ref:`31<r_31>` |ren| |ces|
|
||||
2. For deciphering the behavior of the ``ccf/scf`` instructions. |re| |fe| :ref:`15<r_15>`, :ref:`31<r_31>` |ren| |ces|
|
||||
3. For writing *"Zilog Z80 CPU Test Suite"*. |re| |fe| :ref:`31<r_31>`, :ref:`32<r_32>` |ren| |ces|
|
||||
4. For his research on the unstable behavior of the ``ccf/scf`` instructions.
|
||||
|
||||
* **Rodríguez Jódar, Miguel Ángel (mcleod_ideafix)**
|
||||
|
||||
1. For his research on the state of the registers after POWER-ON/RESET. |re| |fe| :ref:`33<r_33>` |ren| |ces|
|
||||
2. For writing *"Z80 Initial Condition Retriever"*. |re| |fe| :ref:`33.1<r_33_1>` |ren| |ces|
|
||||
|
||||
* **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.
|
||||
|
||||
* **Sanarin, Dmitry (haywire)**
|
||||
|
||||
* For testing the ``ccf/scf`` instructions on real hardware. |re| |fe| :ref:`3<r_3>` |ren| |ces|
|
||||
|
||||
* **Sánchez Ordiñana, José Ismael (Vaporatorius)**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`32.1<r_32_1>`, :ref:`34<r_34>` |ren| |ces|
|
||||
|
||||
* **Sapach, Michael (cafedead)**
|
||||
|
||||
* For writing *"CPD-Test"*. |re| |fe| :ref:`29<r_29>` |ren| |ces|
|
||||
|
||||
* **Sevillano Mancilla, Marta (TheMartian)**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`14.1<r_14_1>` |ren| |ces|
|
||||
|
||||
* **Stevenson, Dave**
|
||||
|
||||
1. For testing the special RESET on real hardware. |re| |fe| :ref:`13<r_13>` |ren| |ces|
|
||||
2. For conducting low-level tests on real hardware. |re| |fe| :ref:`4.5<r_4_5>` |ren| |ces|
|
||||
|
||||
* **Titov, Andrey (Titus)**
|
||||
|
||||
* For his research on the ``ccf/scf`` instructions. |re| |fe| :ref:`1<r_1>`, :ref:`3<r_3>` |ren| |ces|
|
||||
|
||||
* **Vasin, Yuriy (goodboy)**
|
||||
|
||||
1. For testing the behavior of MEMPTR on real hardware. |re| |fe| :ref:`8<r_8>`, :ref:`9<r_9>`, :ref:`10<r_10>`, :ref:`11<r_11>`, :ref:`29<r_29>` |ren| |ces|
|
||||
2. For testing the ``ccf/scf`` instructions on real hardware. |re| |fe| :ref:`1<r_1>`, :ref:`29<r_29>` |ren| |ces|
|
||||
|
||||
* **Vučenović, Zoran**
|
||||
|
||||
* For writing the Pascal binding.
|
||||
|
||||
* **Weissflog, Andre (Floh)**
|
||||
|
||||
1. For discovering that the ``reti/retn`` instructions defer the acceptance of the maskable interrupt. |re| |fe| :ref:`35<r_35>` |ren| |ces|
|
||||
2. For writing the *"Visual Z80 Remix"* simulator. |re| |fe| :ref:`36<r_36>` |ren| |ces|
|
||||
|
||||
* **Wilkinson, Oli (evolutional)**
|
||||
|
||||
* For validating tests on real hardware. |re| |fe| :ref:`2<r_2>` |ren| |ces|
|
||||
|
||||
* **Wlodek**
|
||||
|
||||
* For testing the behavior of MEMPTR on real hardware. |re| |fe| :ref:`8<r_8>`, :ref:`9<r_9>`, :ref:`10<r_10>`, :ref:`11<r_11>` |ren| |ces|
|
||||
|
||||
* **Woodmass, Mark (Woody)**
|
||||
|
||||
1. For his invaluable contributions to the emuscene.
|
||||
2. For writing *"Z80 Test Suite"*. |re| |fe| :ref:`15<r_15>` |ren| |ces|
|
||||
3. For writing *"ED777F"*, *"FDDD"*, *"EI48K"*, *"EIHALT"*, *"HALT2INT"*, *"IFF2 Bug"*, *"Super HALT Invaders Test"* and many other tests.
|
||||
4. For his research on the ``ccf/scf`` instructions. |re| |fe| :ref:`37<r_37>` |ren| |ces|
|
||||
|
||||
* **Young, Sean**
|
||||
|
||||
1. For his research work.
|
||||
2. For his technical documents about the Zilog Z80. |re| |fe| :ref:`20<r_20>`, :ref:`30<r_30>`, :ref:`38<r_38>` |ren| |ces|
|
||||
|
||||
* **Zarubin, Stanislav (JeRrS)**
|
||||
|
||||
* For testing the ``ccf/scf`` instructions on real hardware. |re| |fe| :ref:`3<r_3>`, :ref:`29<r_29>` |ren| |ces|
|
||||
|
||||
* **ZXGuesser**
|
||||
|
||||
* For validating tests on real hardware.
|
||||
|
||||
References
|
||||
==========
|
||||
|
||||
1.
|
||||
|
||||
.. _r_1:
|
||||
|
||||
https://zx-pk.ru/threads/34173-revers-inzhiniring-z80.html
|
||||
|
||||
2.
|
||||
|
||||
.. _r_2:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?t=6102
|
||||
|
||||
1.
|
||||
|
||||
.. _r_2_1:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83384#p83384
|
||||
|
||||
2.
|
||||
|
||||
.. _r_2_2:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83041#p83041
|
||||
|
||||
3.
|
||||
|
||||
.. _r_2_3:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83157#p83157
|
||||
3.
|
||||
|
||||
.. _r_3:
|
||||
|
||||
https://zx-pk.ru/threads/35936-zagadka-plavayushchikh-flagov-scf-ccf-raskryta!.html
|
||||
|
||||
4.
|
||||
|
||||
.. _r_4:
|
||||
|
||||
https://stardot.org.uk/forums/viewtopic.php?t=15464
|
||||
|
||||
1.
|
||||
|
||||
.. _r_4_1:
|
||||
|
||||
https://stardot.org.uk/forums/viewtopic.php?p=211042#p211042
|
||||
|
||||
2.
|
||||
|
||||
.. _r_4_2:
|
||||
|
||||
https://stardot.org.uk/forums/viewtopic.php?p=212021#p212021
|
||||
|
||||
3.
|
||||
|
||||
.. _r_4_3:
|
||||
|
||||
https://stardot.org.uk/forums/viewtopic.php?p=357136#p357136
|
||||
|
||||
4.
|
||||
|
||||
.. _r_4_4:
|
||||
|
||||
https://stardot.org.uk/forums/viewtopic.php?p=481595#p481595
|
||||
|
||||
5.
|
||||
|
||||
.. _r_4_5:
|
||||
|
||||
https://stardot.org.uk/forums/viewtopic.php?p=212360#p212360
|
||||
|
||||
5.
|
||||
|
||||
.. _r_5:
|
||||
|
||||
Banks, David (2018-08-21). *"Undocumented Z80 Flags"* rev. 1.0.
|
||||
|
||||
* https://stardot.org.uk/forums/download/file.php?id=39831
|
||||
* https://github.com/hoglet67/Z80Decoder/wiki/Undocumented-Flags
|
||||
|
||||
6.
|
||||
|
||||
.. _r_6:
|
||||
|
||||
https://github.com/hoglet67/Z80Decoder/wiki/Unstable-CCF-SCF-Behaviour
|
||||
|
||||
7.
|
||||
|
||||
.. _r_7:
|
||||
|
||||
http://wizard.ae.krakow.pl/~jb/qaop/tests.html
|
||||
|
||||
8.
|
||||
|
||||
.. _r_8:
|
||||
|
||||
https://zxpress.ru/zxnet/zxnet.pc/5909
|
||||
|
||||
9.
|
||||
|
||||
.. _r_9:
|
||||
|
||||
https://zx-pk.ru/threads/2506-komanda-bit-n-(hl).html
|
||||
|
||||
10.
|
||||
|
||||
.. _r_10:
|
||||
|
||||
https://zx-pk.ru/threads/2586-prosba-realshchikam-ot-emulyatorshchikov.html
|
||||
|
||||
11.
|
||||
|
||||
.. _r_11:
|
||||
|
||||
boo_boo; Kladov, Vladimir (2006-03-29). *"MEMPTR, Esoteric Register of the Zilog Z80 CPU"*.
|
||||
|
||||
* https://zx-pk.ru/showpost.php?p=43688
|
||||
* https://zx-pk.ru/attachment.php?attachmentid=2984
|
||||
* https://zx-pk.ru/showpost.php?p=43800
|
||||
* https://zx-pk.ru/attachment.php?attachmentid=2989
|
||||
|
||||
12.
|
||||
|
||||
.. _r_12:
|
||||
|
||||
https://sourceforge.net/p/fuse-emulator/mailman/message/6929573
|
||||
|
||||
13.
|
||||
|
||||
.. _r_13:
|
||||
|
||||
Brewer, Tony (2014-12). *"Z80 Special Reset"*.
|
||||
|
||||
* http://primrosebank.net/computers/z80/z80_special_reset.htm
|
||||
|
||||
14.
|
||||
|
||||
.. _r_14:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?t=10555
|
||||
|
||||
1.
|
||||
|
||||
.. _r_14_1:
|
||||
|
||||
https://spectrumcomputing.co.uk/forums/viewtopic.php?p=132144#p132144
|
||||
|
||||
15.
|
||||
|
||||
.. _r_15:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/20345
|
||||
|
||||
16.
|
||||
|
||||
.. _r_16:
|
||||
|
||||
https://groups.google.com/g/comp.os.cpm/c/HfSTFpaIkuU/m/KotvMWu3bZoJ
|
||||
|
||||
17.
|
||||
|
||||
.. _r_17:
|
||||
|
||||
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
|
||||
|
||||
18.
|
||||
|
||||
.. _r_18:
|
||||
|
||||
https://baltazarstudios.com/zilog-z80-undocumented-behavior
|
||||
|
||||
19.
|
||||
|
||||
.. _r_19:
|
||||
|
||||
Flammenkamp, Achim. *"Interrupt Behaviour of the Z80 CPU"*.
|
||||
|
||||
* http://z80.info/interrup.htm
|
||||
|
||||
20.
|
||||
|
||||
.. _r_20:
|
||||
|
||||
Young, Sean (1998-10). *"Z80 Undocumented Features (in Software Behaviour)"* v0.3.
|
||||
|
||||
* http://www.msxnet.org/tech/Z80/z80undoc.txt
|
||||
|
||||
21.
|
||||
|
||||
.. _r_21:
|
||||
|
||||
https://elmundodelspectrum.com/desenterrando-el-primer-emulador-de-spectrum
|
||||
|
||||
22.
|
||||
|
||||
.. _r_22:
|
||||
|
||||
https://elmundodelspectrum.com/con-vosotros-el-emulador-de-pedro-gimeno-1989
|
||||
|
||||
23.
|
||||
|
||||
.. _r_23:
|
||||
|
||||
https://sourceforge.net/p/fuse-emulator/mailman/message/4502844
|
||||
|
||||
24.
|
||||
|
||||
.. _r_24:
|
||||
|
||||
Harston, Jonathan Graham (2008). *"Full Z80 Opcode List Including Undocumented Opcodes"* v0.11 (revised).
|
||||
|
||||
* http://www.mdfsnet.f9.co.uk/Docs/Comp/Z80/OpList
|
||||
|
||||
25.
|
||||
|
||||
.. _r_25:
|
||||
|
||||
Harston, Jonathan Graham (2012). *"Z80 Microprocessor Undocumented Instructions"* v0.15.
|
||||
|
||||
* http://mdfs.net/Docs/Comp/Z80/UnDocOps
|
||||
|
||||
26.
|
||||
|
||||
.. _r_26:
|
||||
|
||||
Harston, Jonathan Graham (2014). *"Z80 Opcode Map"* v0.10 (revised).
|
||||
|
||||
* http://mdfs.net/Docs/Comp/Z80/OpCodeMap
|
||||
|
||||
27.
|
||||
|
||||
.. _r_27:
|
||||
|
||||
http://mdfs.net/Software/Z80/Exerciser/Spectrum
|
||||
|
||||
28.
|
||||
|
||||
.. _r_28:
|
||||
|
||||
https://github.com/MrKWatkins/ZXSpectrumNextTests
|
||||
|
||||
29.
|
||||
|
||||
.. _r_29:
|
||||
|
||||
https://zx-pk.ru/threads/36139-cpd-test-dlya-proverki-izmeneniya-registra-memptr-instruktsiyami-proverte-na-reale-plz.html
|
||||
|
||||
30.
|
||||
|
||||
.. _r_30:
|
||||
|
||||
Young, Sean (2005-09-18). *"Undocumented Z80 Documented, The"* v0.91.
|
||||
|
||||
* http://www.myquest.nl/z80undocumented
|
||||
* http://www.myquest.nl/z80undocumented/z80-documented-v0.91.pdf
|
||||
|
||||
31.
|
||||
|
||||
.. _r_31:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/41704
|
||||
|
||||
* http://zxds.raxoft.cz/taps/misc/zexall2.zip
|
||||
|
||||
32.
|
||||
|
||||
.. _r_32:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/41834
|
||||
|
||||
* http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip
|
||||
* https://github.com/raxoft/z80test
|
||||
|
||||
1.
|
||||
|
||||
.. _r_32_1:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/comment/668760/#Comment_668760
|
||||
|
||||
33.
|
||||
|
||||
.. _r_33:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/34574
|
||||
|
||||
1.
|
||||
|
||||
.. _r_33_1:
|
||||
|
||||
https://worldofspectrum.org/forums/discussion/comment/539714/#Comment_539714
|
||||
|
||||
* http://zxprojects.com/images/stories/z80_startup/reg_start_value.zip
|
||||
|
||||
34.
|
||||
|
||||
.. _r_34:
|
||||
|
||||
https://jisanchez.com/test-a-dos-placas-de-zx-spectrum
|
||||
|
||||
35.
|
||||
|
||||
.. _r_35:
|
||||
|
||||
Weissflog, Andre (2021-12-17). *"New Cycle-Stepped Z80 Emulator, A"*.
|
||||
|
||||
* https://floooh.github.io/2021/12/17/cycle-stepped-z80.html
|
||||
|
||||
36.
|
||||
|
||||
.. _r_36:
|
||||
|
||||
https://github.com/floooh/v6502r
|
||||
|
||||
37.
|
||||
|
||||
.. _r_37:
|
||||
|
||||
https://groups.google.com/g/comp.sys.sinclair/c/WPsPr6j6w5k/m/O_u1zNQf3VYJ
|
||||
|
||||
38.
|
||||
|
||||
.. _r_38:
|
||||
|
||||
Young, Sean (1997-09-21). *"Zilog Z80 CPU Specifications"*.
|
||||
|
||||
* http://www.msxnet.org/tech/Z80/z80.zip
|
||||
@@ -96,7 +96,7 @@ Usage
|
||||
}
|
||||
|
||||
|
||||
void machine_power(Machine *self, zboolean state)
|
||||
void machine_power(Machine *self, zbool state)
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
81
projects/Z80/documentation/version-history.rst
vendored
Normal file
81
projects/Z80/documentation/version-history.rst
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
===============
|
||||
Version history
|
||||
===============
|
||||
|
||||
Z80 v0.2-pre
|
||||
============
|
||||
|
||||
*Released on 2025-07-02*
|
||||
|
||||
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 :doc:`license <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 <https://cmake.org>`_.
|
||||
5. Switched to `Zeta <https://zxe.io/software/Zeta>`_ v0.1.
|
||||
6. Added `pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config>`_ support.
|
||||
7. Added the following files to the project: :file:`.vimrc`, :file:`CITATION.cff` and :file:`THANKS`.
|
||||
8. Added detailed documentation.
|
||||
9. Added Pascal binding, courtesy of Zoran Vučenović.
|
||||
10. Added :file:`test-Z80`, a tool that runs various Z80-specific tests for CP/M and ZX Spectrum.
|
||||
11. Added :file:`step-test-Z80`, a tool for unit tests in JSON format.
|
||||
12. Renamed the macros ``CPU_Z80_DEPENDENCIES_H`` and ``CPU_Z80_STATIC`` to :c:macro:`Z80_EXTERNAL_HEADER` and :c:macro:`Z80_STATIC`, respectively.
|
||||
13. Added :ref:`public macros <api-reference:Macros>` for checking the library version, working with flags, accessing the 16-bit registers and other purposes.
|
||||
14. Added the ability to end the emulation loop immediately, and the :c:func:`z80_break` function.
|
||||
15. Added the :c:func:`z80_execute` function for running a simplified emulation without RESET and interrupts.
|
||||
16. Added the :c:func:`z80_in_cycle` and :c:func:`z80_out_cycle` functions for obtaining the clock cycle at which the I/O M-cycle begins, relative to the start of the instruction.
|
||||
17. Added the :c:func:`z80_r` function for getting the current value of the R register.
|
||||
18. Added the :c:func:`z80_refresh_address` function for getting the refresh address of the current M1 cycle.
|
||||
19. Added the :c:func:`z80_wait` function for inserting wait states.
|
||||
20. Renamed the ``z80_reset`` function to :c:func:`z80_instant_reset`.
|
||||
21. Added optional emulation of the special RESET, and the :c:func:`z80_special_reset` function.
|
||||
22. Added the :c:data:`Z80::fetch_opcode<Z80.fetch_opcode>` and :c:data:`Z80::fetch<Z80.fetch>` callbacks for performing, respectively, opcode fetch operations and memory read operations on instruction data.
|
||||
23. Added the :c:data:`Z80::nop<Z80.nop>` callback for performing disregarded opcode fetch operations during internal NOP M-cycles.
|
||||
24. Added emulation of the NMI acknowledge M-cycle through the new :c:data:`Z80::nmia<Z80.nmia>` callback.
|
||||
25. Added emulation of the INT acknowledge M-cycle through the new :c:data:`Z80::inta<Z80.inta>` callback, which replaces ``Z80::int_data``.
|
||||
26. Added optional full emulation of the interrupt mode 0, along with the new :c:data:`Z80::int_fetch<Z80.int_fetch>` callback for performing 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.
|
||||
27. Added four callbacks for notifying the execution of important instructions: :c:data:`Z80::ld_i_a<Z80.ld_i_a>`, :c:data:`Z80::ld_r_a<Z80.ld_r_a>`, :c:data:`Z80::reti<Z80.reti>` and :c:data:`Z80::retn<Z80.retn>`.
|
||||
28. Added hooking functionality through the ``ld h,h`` instruction and the new :c:data:`Z80::hook<Z80.hook>` callback.
|
||||
29. Added the :c:data:`Z80::illegal<Z80.illegal>` callback for delegating the emulation of illegal instructions.
|
||||
30. Added :ref:`emulation options <api-reference:Configuration>` that can be configured at runtime.
|
||||
31. Removed ``Z80::state``. Replaced with individual members for the registers, the interrupt enable flip-flops and the interrupt mode.
|
||||
32. Removed the superfluous EI flag. The previous opcode is checked instead, which is faster and makes the :c:type:`Z80` object smaller.
|
||||
33. Removed all module-related stuff.
|
||||
34. Added emulation of the additional flag changes performed during the extra 5 clock cycles of the following instructions: ``ldir``, ``lddr``, ``cpir``, ``cpdr``, ``inir``, ``indr``, ``otir`` and ``otdr``.
|
||||
35. Added emulation of the interrupt acceptance deferral that occurs during the ``reti`` and ``retn`` instructions.
|
||||
36. Added MEMPTR emulation. The ``bit N,(hl)`` instruction now produces a correct value of F.
|
||||
37. Added optional emulation of Q. If enabled at compile-time, the ``ccf`` and ``scf`` instructions will produce a correct value of F.
|
||||
38. Added emulation of the ``out (c),255`` instruction (Zilog Z80 CMOS).
|
||||
39. Added optional emulation of the bug affecting the ``ld a,{i|r}`` instructions (Zilog Z80 NMOS). If enabled at compile-time and configured at runtime, the P/V flag will be reset if an INT is accepted during the execution of these instructions.
|
||||
40. Added an optional implementation of the parity calculation for the P/V flag that performs the actual computation instead of using a table of precomputed values.
|
||||
41. Added an optional implementation of the ``daa`` instruction that uses a table of precomputed values.
|
||||
42. Increased granularity. The emulator can now stop directly after fetching a prefix ``DDh`` or ``FDh`` if it runs out of clock cycles. This also works during the INT response in mode 0.
|
||||
43. Reimplemented the HALT state. The emulation should now be fully accurate. HALTskip optimization is also supported.
|
||||
44. Fixed a bug in the ``sll`` instruction.
|
||||
45. Fixed a bug in the ``INX`` and ``OUTX`` macros affecting the S and N flags.
|
||||
46. Fixed a bug in the ``OUTX`` macro affecting the MSByte of the port number.
|
||||
47. Fixed the clock cycles of the ``dec XY`` and ``in (c)`` instructions.
|
||||
48. Fixed the ``read_16`` function so that the order of the memory read operations is not determined by the order in which the compiler evaluates expressions.
|
||||
49. 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``.
|
||||
50. Fixed the handling of illegal instructions to avoid stack overflows in long sequences of ``DDh/FDh`` prefixes.
|
||||
51. Fixed several implicit conversions to avoid warnings about loss of sign and precision.
|
||||
52. Fixed some bitwise operations to avoid undefined behavior and arithmetic right shifts on signed integers.
|
||||
53. Fixed violations of the C standard in several identifiers.
|
||||
54. Renamed the 8-bit register lists: ``X/Y`` to ``J/K``; ``J/K`` and ``P/Q`` to ``O/P``.
|
||||
55. Replaced all P/V overflow computation functions with a single, faster macro.
|
||||
56. Replaced all register resolution functions with macros.
|
||||
57. Replaced all ``ld {J,K|O,P}`` instructions that have the same destination and source register with NOPs. In addition, the "illegal" forms of the following instructions are now executed without using the illegal instruction handler: ``ld O,P``, ``ld O,BYTE``, ``U [a,]P`` and ``V O``.
|
||||
58. Optimizations in flag computation and condition evaluation.
|
||||
59. New source code comments and improvements to existing ones.
|
||||
60. Improved code aesthetics.
|
||||
61. Other improvements, optimizations and minor changes.
|
||||
|
||||
Z80 v0.1
|
||||
========
|
||||
|
||||
*Released on 2018-11-10*
|
||||
|
||||
Initial public release.
|
||||
File diff suppressed because it is too large
Load Diff
18
projects/Z80/sources/Z80.pas
vendored
18
projects/Z80/sources/Z80.pas
vendored
@@ -47,7 +47,11 @@ const
|
||||
Z80_MAXIMUM_CYCLES = SizeUInt(SizeUInt(SizeUInt.MaxValue) - 30);
|
||||
Z80_MAXIMUM_CYCLES_PER_STEP = 23;
|
||||
|
||||
Z80_HOOK = $64;
|
||||
Z80_HALT = $76;
|
||||
Z80_HOOK = $64;
|
||||
Z80_JP_WORD = $C3;
|
||||
Z80_NOP = $00;
|
||||
Z80_RET = $C9;
|
||||
|
||||
Z80_SF = 128;
|
||||
Z80_ZF = 64;
|
||||
@@ -105,12 +109,12 @@ type
|
||||
xy: TZ80RegisterPair;
|
||||
memptr: TZ80RegisterPair;
|
||||
af: TZ80RegisterPair;
|
||||
bc: TZ80RegisterPair;
|
||||
de: TZ80RegisterPair;
|
||||
hl: TZ80RegisterPair;
|
||||
af_: TZ80RegisterPair;
|
||||
bc: TZ80RegisterPair;
|
||||
bc_: TZ80RegisterPair;
|
||||
de: TZ80RegisterPair;
|
||||
de_: TZ80RegisterPair;
|
||||
hl: TZ80RegisterPair;
|
||||
hl_: TZ80RegisterPair;
|
||||
r: UInt8;
|
||||
i: UInt8;
|
||||
@@ -213,6 +217,12 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure z80_wait(self: PZ80; cycles: SizeUInt);
|
||||
begin
|
||||
self^.cycles := self^.cycles + cycles;
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
LibHandle: TLibHandle;
|
||||
|
||||
|
||||
4
projects/Z80/sources/Z80.rc.in
vendored
4
projects/Z80/sources/Z80.rc.in
vendored
@@ -17,11 +17,11 @@ BEGIN
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Manuel Sainz de Baranda y Goñi"
|
||||
VALUE "CompanyName", "@RC_AUTHOR@"
|
||||
VALUE "FileDescription", "@PROJECT_DESCRIPTION@"
|
||||
VALUE "FileVersion", "@PROJECT_VERSION@"
|
||||
VALUE "InternalName", "@PROJECT_NAME@"
|
||||
VALUE "LegalCopyright", "Copyright © 1999-2024 Manuel Sainz de Baranda y Goñi"
|
||||
VALUE "LegalCopyright", "Copyright © @RC_COPYRIGHT_YEAR@ @RC_AUTHOR@"
|
||||
VALUE "OriginalFilename", "@PROJECT_NAME@.dll"
|
||||
VALUE "ProductName", "@PROJECT_NAME@"
|
||||
VALUE "ProductVersion", "@PROJECT_VERSION@"
|
||||
|
||||
81
projects/Z80/sources/generate-daa-af-table.c
Normal file
81
projects/Z80/sources/generate-daa-af-table.c
Normal file
@@ -0,0 +1,81 @@
|
||||
/* generate-daa-af-table
|
||||
______ ______ ______
|
||||
/\___ \/\ __ \\ __ \
|
||||
____ \/__/ /\_\ __ \\ \/\ \ ________________________________________________
|
||||
| /\_____\\_____\\_____\ |
|
||||
| Zilog \/_____//_____//_____/ CPU Emulator - `daa` AF Table Generator |
|
||||
| Copyright (C) 2024-2025 Manuel Sainz de Baranda y Goñi. |
|
||||
| |
|
||||
| This program is free software: you can redistribute it and/or modify it |
|
||||
| under the terms of the GNU General Public License as published by the Free |
|
||||
| Software Foundation, either version 3 of the License, or (at your option) |
|
||||
| any later version. |
|
||||
| |
|
||||
| This program 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 General Public License |
|
||||
| for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public License along |
|
||||
| with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||
| |
|
||||
'=============================================================================*/
|
||||
|
||||
#include <Z80.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
static zuint8 cpu_fetch_opcode(void *context, zuint16 address)
|
||||
{
|
||||
Z_UNUSED(context) Z_UNUSED(address)
|
||||
return 0x27; /* `daa` */
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
Z80 cpu;
|
||||
zuint8 hnc, f, x, y;
|
||||
|
||||
Z_UNUSED(argc) Z_UNUSED(argv)
|
||||
cpu.fetch_opcode = cpu_fetch_opcode;
|
||||
puts("static zuint16 const daa_af_table[2048] = {");
|
||||
|
||||
for (hnc = 0; hnc < 8; hnc++)
|
||||
{
|
||||
printf( "/* HNC */\n/* %u%u%u\t"
|
||||
"0\t 1\t 2\t 3\t 4\t 5\t 6\t 7\t"
|
||||
"8\t 9\t A\t B\t C\t D\t E\t F"
|
||||
" */\n",
|
||||
(zuint)( hnc >> 2 ),
|
||||
(zuint)((hnc >> 1) & 1),
|
||||
(zuint)( hnc & 1));
|
||||
|
||||
f = ((hnc << 2) | hnc) & (Z80_HF | Z80_NF | Z80_CF);
|
||||
|
||||
for (y = 0; y < 16; y++)
|
||||
{
|
||||
printf("/* %X */", (zuint)y);
|
||||
|
||||
for (x = 0; x < 16; x++)
|
||||
{
|
||||
z80_power(&cpu, Z_TRUE);
|
||||
Z80_F(cpu) = f;
|
||||
Z80_A(cpu) = y * 16 + x;
|
||||
z80_execute(&cpu, 1);
|
||||
|
||||
printf( " H(%04X)%s",
|
||||
(zuint)Z80_AF(cpu),
|
||||
x == 15 && y == 15 && hnc == 7
|
||||
? "};" : ",");
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* generate-daa-af-table.c EOF */
|
||||
58
projects/Z80/sources/generate-pf-parity-table.c
Normal file
58
projects/Z80/sources/generate-pf-parity-table.c
Normal file
@@ -0,0 +1,58 @@
|
||||
/* generate-pf-parity-table
|
||||
______ ______ ______
|
||||
/\___ \/\ __ \\ __ \
|
||||
____ \/__/ /\_\ __ \\ \/\ \ ________________________________________________
|
||||
| /\_____\\_____\\_____\ |
|
||||
| Zilog \/_____//_____//_____/ CPU Emulator - PF Parity Table Generator |
|
||||
| Copyright (C) 2024-2025 Manuel Sainz de Baranda y Goñi. |
|
||||
| |
|
||||
| This program is free software: you can redistribute it and/or modify it |
|
||||
| under the terms of the GNU General Public License as published by the Free |
|
||||
| Software Foundation, either version 3 of the License, or (at your option) |
|
||||
| any later version. |
|
||||
| |
|
||||
| This program 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 General Public License |
|
||||
| for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public License along |
|
||||
| with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||
| |
|
||||
'=============================================================================*/
|
||||
|
||||
#include <Z/macros/language.h>
|
||||
#include <Z/types/integral.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
static Z_ALWAYS_INLINE zuint8 pf_parity(zuint8 value)
|
||||
{return (zuint8)(((0x9669U >> ((value ^ (value >> 4)) & 0xF)) & 1) << 2);}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
zuint8 x, y;
|
||||
|
||||
Z_UNUSED(argc) Z_UNUSED(argv)
|
||||
|
||||
puts( "static zuint8 const pf_parity_table[256] = {\n"
|
||||
"/*\t0 1 2 3 4 5 6 7\t8 9 A B C D E F */");
|
||||
|
||||
for (y = 0; y < 16; y++)
|
||||
{
|
||||
printf("/* %X */", (zuint)y);
|
||||
|
||||
for (x = 0; x < 16; x++)
|
||||
printf(" %u%s",
|
||||
(zuint)pf_parity(y * 16 + x),
|
||||
x == 15 && y == 15 ? "};" : ",");
|
||||
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* generate-pf-parity-table.c EOF */
|
||||
1125
projects/Z80/sources/step-test-Z80.c
Normal file
1125
projects/Z80/sources/step-test-Z80.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
____ \/__/ /\_\ __ \\ \/\ \ ________________________________________________
|
||||
| /\_____\\_____\\_____\ |
|
||||
| Zilog \/_____//_____//_____/ CPU Emulator - Testing Tool |
|
||||
| Copyright (C) 2021-2024 Manuel Sainz de Baranda y Goñi. |
|
||||
| Copyright (C) 2021-2026 Manuel Sainz de Baranda y Goñi. |
|
||||
| |
|
||||
| This program is free software: you can redistribute it and/or modify it |
|
||||
| under the terms of the GNU General Public License as published by the Free |
|
||||
@@ -36,44 +36,26 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/* MARK: - Macros */
|
||||
|
||||
#ifdef TEST_Z80_WITH_EXECUTE
|
||||
# define RUN z80_execute
|
||||
#else
|
||||
# define RUN z80_run
|
||||
#endif
|
||||
|
||||
#define OPCODE_NOP 0x00
|
||||
#define OPCODE_RET 0xC9
|
||||
#define OPCODE_HALT 0x76
|
||||
#define OPCODE_CALL_WORD 0xCD
|
||||
#define OPCODE_JP_WORD 0xC3
|
||||
|
||||
#define TEST_FORMAT_CPM 0 /* CP/M program in COM format. */
|
||||
#define TEST_FORMAT_HARSTON 1 /* Z80 Instruction Set Exerciser for Spectrum. */
|
||||
#define TEST_FORMAT_RAK 2 /* Patrik Rak's Zilog Z80 CPU Test Suite. */
|
||||
#define TEST_FORMAT_WOODMASS 3 /* Mark Woodmass' Z80 Test Suite. */
|
||||
|
||||
|
||||
/* MARK: - Types */
|
||||
|
||||
typedef struct {
|
||||
/* Name of the archive if the file is compressed; `Z_NULL` otherwise. */
|
||||
char const* archive_name;
|
||||
char const *archive_name;
|
||||
|
||||
/* Name of the file, or path to the file inside the archive if the file
|
||||
is compressed. */
|
||||
char const* file_path;
|
||||
* is compressed. */
|
||||
char const *file_path;
|
||||
|
||||
/* Total number of clock cycles executed when the test passes. */
|
||||
zusize cycles[1 + (Z_USIZE_WIDTH < 64)];
|
||||
|
||||
/* FNV-1 hash of the entire text output when the test passes
|
||||
(i.e., of all bytes sent by the program to the print routine). */
|
||||
* (i.e., of all bytes sent by the program to the print routine). */
|
||||
zuint32 hash;
|
||||
|
||||
/* Memory address to jump to in order to start executing the program. */
|
||||
/* Memory address to jump to in order to start executing the program.
|
||||
* The lower byte is zeroed to obtain the address where to load the
|
||||
* executable code. */
|
||||
zuint16 start_address;
|
||||
|
||||
/* Value of the PC register once the program completes. */
|
||||
@@ -98,6 +80,11 @@ typedef struct {
|
||||
zuint8 columns;
|
||||
} Test;
|
||||
|
||||
#define TEST_FORMAT_CPM 0 /* CP/M program in COM format. */
|
||||
#define TEST_FORMAT_HARSTON 1 /* Z80 Instruction Set Exerciser for Spectrum. */
|
||||
#define TEST_FORMAT_RAK 2 /* Patrik Rak's Zilog Z80 CPU Test Suite. */
|
||||
#define TEST_FORMAT_WOODMASS 3 /* Mark Woodmass' Z80 Test Suite. */
|
||||
|
||||
|
||||
/* MARK: - Global Variables */
|
||||
|
||||
@@ -118,18 +105,18 @@ static Test const tests[22] = {
|
||||
{"Z80 Instruction Set Exerciser for Spectrum 2 v0.1 (2012-11-27)(Rak, Patrik)[!].zip", "zexall2-0.1/zexall2.tap", CYCLES(C, 18A43876) /* 51,953,023,094 */, Z_UINT32(0x05C746F7), Z_UINT16(0x8000), Z_UINT16(0x8040), 9316, 9228, 87, TEST_FORMAT_HARSTON, 76, 31},
|
||||
{Z_NULL, "Z80 Test Suite (2008)(Woodmass, Mark)[!].tap", CYCLES(0, 9C3040EF) /* 2,620,408,047 */, Z_UINT32(0xF787CA8E), Z_UINT16(0x8057), Z_UINT16(0x80E6), 5573, 5452, 120, TEST_FORMAT_WOODMASS, 50, 32},
|
||||
{Z_NULL, "Z80 Test Suite (2008)(Woodmass, Mark)[!].tap", CYCLES(0, 0308BF63) /* 50,904,931 */, Z_UINT32(0xF5AE5140), Z_UINT16(0x8049), Z_UINT16(0x80E6), 5573, 5452, 120, TEST_FORMAT_WOODMASS, 61, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80full.tap", CYCLES(0, 4303ABF1) /* 1,124,314,097 */, Z_UINT32(0xB8707D12), Z_UINT16(0x8000), Z_UINT16(0x7003), 13758, 13666, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80doc.tap", CYCLES(0, 436E8265) /* 1,131,315,813 */, Z_UINT32(0x9E9DD1F5), Z_UINT16(0x8000), Z_UINT16(0x7003), 13758, 13666, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80flags.tap", CYCLES(0, 20ED11DC) /* 552,407,516 */, Z_UINT32(0x27CB27A2), Z_UINT16(0x8000), Z_UINT16(0x7003), 13758, 13666, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80docflags.tap", CYCLES(0, 2110B9B1) /* 554,744,241 */, Z_UINT32(0x3966C46C), Z_UINT16(0x8000), Z_UINT16(0x7003), 13758, 13666, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80ccf.tap", CYCLES(0, 23AB74CA) /* 598,439,114 */, Z_UINT32(0xB34ED107), Z_UINT16(0x8000), Z_UINT16(0x7003), 14219, 14127, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80memptr.tap", CYCLES(0, 215CF3BD) /* 559,739,837 */, Z_UINT32(0x840ACD96), Z_UINT16(0x8000), Z_UINT16(0x7003), 13758, 13666, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80full.tap", CYCLES(0, 4382DC6A) /* 1,132,649,578 */, Z_UINT32(0x4C578BC6), Z_UINT16(0x8000), Z_UINT16(0x7003), 14390, 14298, 91, TEST_FORMAT_RAK, 164, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80doc.tap", CYCLES(0, 43EE72CE) /* 1,139,700,430 */, Z_UINT32(0x02114A09), Z_UINT16(0x8000), Z_UINT16(0x7003), 14390, 14298, 91, TEST_FORMAT_RAK, 164, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80flags.tap", CYCLES(0, 212F17D5) /* 556,734,421 */, Z_UINT32(0x91826856), Z_UINT16(0x8000), Z_UINT16(0x7003), 14390, 14298, 91, TEST_FORMAT_RAK, 164, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80docflags.tap", CYCLES(0, 2152FFDA) /* 559,087,578 */, Z_UINT32(0x408190F0), Z_UINT16(0x8000), Z_UINT16(0x7003), 14390, 14298, 91, TEST_FORMAT_RAK, 164, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80ccf.tap", CYCLES(0, 23F34E43) /* 603,147,843 */, Z_UINT32(0x27FF6693), Z_UINT16(0x8000), Z_UINT16(0x7003), 14875, 14783, 91, TEST_FORMAT_RAK, 164, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80memptr.tap", CYCLES(0, 219FC276) /* 564,118,134 */, Z_UINT32(0xDB7B18AA), Z_UINT16(0x8000), Z_UINT16(0x7003), 14390, 14298, 91, TEST_FORMAT_RAK, 164, 32}};
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80full.tap", CYCLES(0, 4303ABE0) /* 1,124,314,097 */, Z_UINT32(0xB8707D12), Z_UINT16(0x8000), Z_UINT16( 0), 13758, 13666, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80doc.tap", CYCLES(0, 436E8254) /* 1,131,315,813 */, Z_UINT32(0x9E9DD1F5), Z_UINT16(0x8000), Z_UINT16( 0), 13758, 13666, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80flags.tap", CYCLES(0, 20ED11CB) /* 552,407,516 */, Z_UINT32(0x27CB27A2), Z_UINT16(0x8000), Z_UINT16( 0), 13758, 13666, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80docflags.tap", CYCLES(0, 2110B9A0) /* 554,744,241 */, Z_UINT32(0x3966C46C), Z_UINT16(0x8000), Z_UINT16( 0), 13758, 13666, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80ccf.tap", CYCLES(0, 23AB74B9) /* 598,439,114 */, Z_UINT32(0xB34ED107), Z_UINT16(0x8000), Z_UINT16( 0), 14219, 14127, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip", "z80test-1.0/z80memptr.tap", CYCLES(0, 215CF3AC) /* 559,739,837 */, Z_UINT32(0x840ACD96), Z_UINT16(0x8000), Z_UINT16( 0), 13758, 13666, 91, TEST_FORMAT_RAK, 156, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80full.tap", CYCLES(0, 4382DC59) /* 1,132,649,578 */, Z_UINT32(0x4C578BC6), Z_UINT16(0x8000), Z_UINT16( 0), 14390, 14298, 91, TEST_FORMAT_RAK, 164, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80doc.tap", CYCLES(0, 43EE72BD) /* 1,139,700,430 */, Z_UINT32(0x02114A09), Z_UINT16(0x8000), Z_UINT16( 0), 14390, 14298, 91, TEST_FORMAT_RAK, 164, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80flags.tap", CYCLES(0, 212F17C4) /* 556,734,421 */, Z_UINT32(0x91826856), Z_UINT16(0x8000), Z_UINT16( 0), 14390, 14298, 91, TEST_FORMAT_RAK, 164, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80docflags.tap", CYCLES(0, 2152FFC9) /* 559,087,578 */, Z_UINT32(0x408190F0), Z_UINT16(0x8000), Z_UINT16( 0), 14390, 14298, 91, TEST_FORMAT_RAK, 164, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80ccf.tap", CYCLES(0, 23F34E32) /* 603,147,843 */, Z_UINT32(0x27FF6693), Z_UINT16(0x8000), Z_UINT16( 0), 14875, 14783, 91, TEST_FORMAT_RAK, 164, 32},
|
||||
{"Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip", "z80test-1.2a/z80memptr.tap", CYCLES(0, 219FC265) /* 564,118,134 */, Z_UINT32(0xDB7B18AA), Z_UINT16(0x8000), Z_UINT16( 0), 14390, 14298, 91, TEST_FORMAT_RAK, 164, 32}};
|
||||
|
||||
#undef CYCLES
|
||||
|
||||
@@ -141,32 +128,36 @@ static struct {char const *key; zuint8 options;} const cpu_models[4] = {
|
||||
|
||||
static char const new_line[2] = "\n";
|
||||
|
||||
/*----------------------------------------------------------------------------.
|
||||
| `in_values` holds the bytes returned when reading from I/O ports: |
|
||||
| [0]: Byte read from even I/O ports (specified with the `--in-even` option). |
|
||||
| [1]: Byte read from odd I/O ports (specified with the `--in-odd` option). |
|
||||
| The default values correspond to those of a Sinclair ZX Spectrum 48K with |
|
||||
| no devices connected. |
|
||||
'============================================================================*/
|
||||
|
||||
static zuint8 in_values[2] = {191, 255};
|
||||
|
||||
/*---------------------------------------------------------------------------.
|
||||
| The search paths specified by using the `-p` option are collected into the |
|
||||
| The search paths specified with the `--path` option are collected into the |
|
||||
| `search_paths` array of size `search_path_count`. `path_buffer` is used to |
|
||||
| compose a complete file path consisting of "<search-path>/<filename>". |
|
||||
| compose complete file paths in the format "<search-path>/<filename>". |
|
||||
'===========================================================================*/
|
||||
|
||||
static char* path_buffer = Z_NULL;
|
||||
static char** search_paths = Z_NULL;
|
||||
static zuint search_path_count = 0;
|
||||
|
||||
/*-----------------------------------------------------------------------------.
|
||||
| `verbosity` contains the verbosity level specified by using the `-v` option; |
|
||||
| `show_test_output` indicates whether to print the text output of the tests. |
|
||||
'=============================================================================*/
|
||||
/*--------------------------------------------------------------------------.
|
||||
| `verbosity` contains the verbosity level specified with the `--verbosity` |
|
||||
| option; `show_test_output` indicates whether the text output of the tests |
|
||||
| should be printed; `test_spacing` points to the string to print between |
|
||||
| each test: either "\n" or "". |
|
||||
'==========================================================================*/
|
||||
|
||||
static zuint8 verbosity = 4;
|
||||
static zboolean show_test_output;
|
||||
|
||||
/*-----------------------------------------------------------------------------.
|
||||
| [0]: The byte read from even I/O ports (specified by using the `-0` option). |
|
||||
| [1]: The byte read from odd I/O ports (specified by using the `-1` option). |
|
||||
| The default values are those of a Sinclair ZX Spectrum 48K with no devices |
|
||||
| connected. |
|
||||
'=============================================================================*/
|
||||
|
||||
static zuint8 in_values[2] = {191, 255};
|
||||
static zuint8 verbosity = 4;
|
||||
static zbool show_test_output;
|
||||
static char const* test_spacing;
|
||||
|
||||
/*---------------------------------------------------.
|
||||
| Instance of the Z80 emulator and 64 KiB of memory. |
|
||||
@@ -175,25 +166,37 @@ static zuint8 in_values[2] = {191, 255};
|
||||
static Z80 cpu;
|
||||
static zuint8 memory[Z_USIZE(65536)];
|
||||
|
||||
/*----------------------------------------------------------------------------.
|
||||
| `run` points to the function used to run the emulator: either `z80_execute` |
|
||||
| or `z80_run`, depending on whether the `--run` option was specified. |
|
||||
'============================================================================*/
|
||||
|
||||
#ifdef TEST_Z80_WITH_EXECUTE
|
||||
static zusize (* run)(Z80 *self, zusize cycles) = z80_execute;
|
||||
# define RUN run
|
||||
#else
|
||||
# define RUN z80_run
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------------.
|
||||
| `completed` indicates whether the test has reached its exit address; `lines` |
|
||||
| is incremented every time the test prints a new line; `cursor_x` holds the X |
|
||||
| position of the cursor in the current line; `columns` contains the rightmost |
|
||||
| position reached by the cursor throughout the test; and `hash` keeps a FNV-1 |
|
||||
| is incremented each time the test prints a new line; `cursor_x` holds the X |
|
||||
| position of the cursor in the current line; `columns` tracks the rightmost |
|
||||
| position reached by the cursor during the test; and `hash` stores the FNV-1 |
|
||||
| hash of all bytes sent by the test to the print routine. |
|
||||
'=============================================================================*/
|
||||
|
||||
static zboolean completed;
|
||||
static zusize lines, cursor_x, columns;
|
||||
static zuint32 hash;
|
||||
static zbool completed;
|
||||
static zusize lines, cursor_x, columns;
|
||||
static zuint32 hash;
|
||||
|
||||
/*-----------------------------------------------------------------------------.
|
||||
| `zx_spectrum_print_hook_address` contains the address of the hook that |
|
||||
| intercepts the routine called by the test to print characters. When a <TAB> |
|
||||
| character (17h) is printed, the `zx_spectrum_tab` counter is set to 2 to |
|
||||
| indicate that it is necessary to process the incoming <TAB n> and <TAB STOP> |
|
||||
| bytes before continuing to print characters. `zx_spectrum_bad_character` is |
|
||||
| set to `Z_TRUE` if the test prints any unsupported control characters. |
|
||||
| indicate that the incoming <TAB n> and <TAB STOP> bytes must be processed |
|
||||
| before continuing to print characters. `zx_spectrum_bad_character` is set to |
|
||||
| `Z_TRUE` if the test prints any unsupported control characters. |
|
||||
| |
|
||||
| For more information about the TAB control sequence of the ZX Spectrum, see: |
|
||||
| * Sinclair Research (1983). "Sinclair ZX Spectrum BASIC Programming" 2nd |
|
||||
@@ -201,12 +204,23 @@ static zuint32 hash;
|
||||
| * Ardley, Neil (1984). "ZX Spectrum + User Guide" (Dorling Kindersley; |
|
||||
| Sinclair Research. ISBN 0863180809), pp. 67-68. |
|
||||
| |
|
||||
| These three variables are only used for ZX Spectrum tests. |
|
||||
| These three variables are used exclusively for ZX Spectrum tests. |
|
||||
'=============================================================================*/
|
||||
|
||||
static zuint16 zx_spectrum_print_hook_address;
|
||||
static zuint zx_spectrum_tab;
|
||||
static zboolean zx_spectrum_bad_character;
|
||||
static zuint16 zx_spectrum_print_hook_address;
|
||||
static zuint zx_spectrum_tab;
|
||||
static zbool zx_spectrum_bad_character;
|
||||
|
||||
|
||||
/* MARK: - CPU Callbacks: Auxiliary Functions */
|
||||
|
||||
static void lf(void)
|
||||
{
|
||||
if (show_test_output) putchar('\n');
|
||||
if (cursor_x > columns) columns = cursor_x;
|
||||
cursor_x = 0;
|
||||
lines++;
|
||||
}
|
||||
|
||||
|
||||
/* MARK: - CPU Callbacks: Common */
|
||||
@@ -237,17 +251,6 @@ static void cpu_halt(void *context, zuint8 state)
|
||||
}
|
||||
|
||||
|
||||
/* MARK: - CPU Callbacks: Auxiliary Functions */
|
||||
|
||||
static void cr(void)
|
||||
{
|
||||
if (show_test_output) putchar('\n');
|
||||
if (cursor_x > columns) columns = cursor_x;
|
||||
cursor_x = 0;
|
||||
lines++;
|
||||
}
|
||||
|
||||
|
||||
/* MARK: - CPU Callbacks: CP/M */
|
||||
|
||||
static void cpm_cpu_write(void *context, zuint16 address, zuint8 value)
|
||||
@@ -262,16 +265,16 @@ static zuint8 cpm_cpu_hook(void *context, zuint16 address)
|
||||
zuint8 character;
|
||||
|
||||
Z_UNUSED(context)
|
||||
if (address != 5) return OPCODE_NOP;
|
||||
if (address != 5) return Z80_NOP;
|
||||
|
||||
/* BDOS function 2 (C_WRITE) - Console output */
|
||||
if (Z80_C(cpu) == 2)
|
||||
{
|
||||
hash = Z_FNV1_32_UPDATE(hash, (character = Z80_E(cpu)));
|
||||
hash = Z_FNV1_32_UPDATE(hash, character = Z80_E(cpu));
|
||||
|
||||
switch (character)
|
||||
{
|
||||
case 0x0A: /* LF */ cr();
|
||||
case 0x0A: /* LF */ lf();
|
||||
case 0x0D: /* CR */ break;
|
||||
|
||||
default:
|
||||
@@ -288,12 +291,12 @@ static zuint8 cpm_cpu_hook(void *context, zuint16 address)
|
||||
|
||||
while (c--)
|
||||
{
|
||||
hash = Z_FNV1_32_UPDATE(hash, (character = memory[i++]));
|
||||
hash = Z_FNV1_32_UPDATE(hash, character = memory[i++]);
|
||||
|
||||
switch (character)
|
||||
{
|
||||
case 0x24: /* $ */ return OPCODE_RET;
|
||||
case 0x0A: /* LF */ cr();
|
||||
case 0x24: /* $ */ return Z80_RET;
|
||||
case 0x0A: /* LF */ lf();
|
||||
case 0x0D: /* CR */ break;
|
||||
|
||||
default:
|
||||
@@ -305,7 +308,7 @@ static zuint8 cpm_cpu_hook(void *context, zuint16 address)
|
||||
if (show_test_output) puts(" [TRUNCATED]");
|
||||
}
|
||||
|
||||
return OPCODE_RET;
|
||||
return Z80_RET;
|
||||
}
|
||||
|
||||
|
||||
@@ -323,13 +326,13 @@ static zuint8 zx_spectrum_cpu_hook(void *context, zuint16 address)
|
||||
zuint8 character;
|
||||
|
||||
Z_UNUSED(context)
|
||||
if (address != zx_spectrum_print_hook_address) return OPCODE_NOP;
|
||||
hash = Z_FNV1_32_UPDATE(hash, (character = Z80_A(cpu)));
|
||||
if (address != zx_spectrum_print_hook_address) return Z80_NOP;
|
||||
hash = Z_FNV1_32_UPDATE(hash, character = Z80_A(cpu));
|
||||
|
||||
if (!zx_spectrum_tab) switch (character)
|
||||
{
|
||||
case 0x0D: /* CR */
|
||||
cr();
|
||||
case 0x0D: /* ENTER */
|
||||
lf();
|
||||
break;
|
||||
|
||||
case 0x17: /* TAB */
|
||||
@@ -355,12 +358,12 @@ static zuint8 zx_spectrum_cpu_hook(void *context, zuint16 address)
|
||||
{
|
||||
zuint c = character & (32 - 1), x = cursor_x & (32 - 1);
|
||||
|
||||
if (c < x) cr();
|
||||
if (c < x) lf();
|
||||
else cursor_x += (c -= x);
|
||||
if (show_test_output) while (c--) putchar(' ');
|
||||
}
|
||||
|
||||
return OPCODE_RET;
|
||||
return Z80_RET;
|
||||
}
|
||||
|
||||
|
||||
@@ -369,9 +372,8 @@ static zuint8 zx_spectrum_cpu_fetch_opcode(void *context, zuint16 address)
|
||||
{
|
||||
Z_UNUSED(context)
|
||||
|
||||
return address == 0x0D6B /* THE 'CLS' COMMAND ROUTINE */ ||
|
||||
address == 0x1601 /* THE 'CHAN_OPEN' SUBROUTINE */
|
||||
? OPCODE_RET : memory[address];
|
||||
return address == 0x1601 /* 1601: THE 'CHAN_OPEN' SUBROUTINE */
|
||||
? Z80_RET : memory[address];
|
||||
}
|
||||
|
||||
|
||||
@@ -390,23 +392,23 @@ static char const *compose_path(char const *base_path, char const *file_path)
|
||||
}
|
||||
|
||||
|
||||
static zboolean load_file(
|
||||
char const* search_path,
|
||||
static zbool load_file(
|
||||
char const* base_path,
|
||||
char const* file_path,
|
||||
zuint32 file_size,
|
||||
zuint16 file_size,
|
||||
zuint16 offset,
|
||||
zuint16 size,
|
||||
void* buffer
|
||||
)
|
||||
{
|
||||
zboolean success = Z_FALSE;
|
||||
FILE *file = fopen(compose_path(search_path, file_path), "rb");
|
||||
zbool success = Z_FALSE;
|
||||
FILE *file = fopen(compose_path(base_path, file_path), "rb");
|
||||
|
||||
if (file != Z_NULL)
|
||||
{
|
||||
if ( !fseek(file, 0, SEEK_END) &&
|
||||
ftell(file) == file_size &&
|
||||
!fseek(file, offset, SEEK_SET) &&
|
||||
if ( !fseek(file, 0, SEEK_END) &&
|
||||
(zulong)ftell(file) == file_size &&
|
||||
!fseek(file, offset, SEEK_SET) &&
|
||||
fread(buffer, size, 1, file) == 1
|
||||
)
|
||||
success = Z_TRUE;
|
||||
@@ -418,10 +420,10 @@ static zboolean load_file(
|
||||
}
|
||||
|
||||
|
||||
static zboolean load_test(char const *search_path, Test const *test, void *buffer)
|
||||
static zbool load_test(char const *search_path, Test const *test, void *buffer)
|
||||
{
|
||||
# ifdef TEST_Z80_WITH_ARCHIVE_EXTRACTION
|
||||
zboolean success = load_file(
|
||||
zbool success = load_file(
|
||||
search_path, test->file_path, test->file_size,
|
||||
test->code_offset, test->code_size, buffer);
|
||||
|
||||
@@ -436,35 +438,41 @@ static zboolean load_test(char const *search_path, Test const *test, void *buffe
|
||||
|
||||
if (gz != Z_NULL)
|
||||
{
|
||||
union {zuint8 data[Z_TAR_BLOCK_SIZE]; Z_TARPOSIXHeader fields;} header;
|
||||
union {zuint8 data[Z_TAR_BLOCK_SIZE]; Z_TARPOSIXHeader header;} block;
|
||||
|
||||
while (!gzeof(gz))
|
||||
{
|
||||
char *end;
|
||||
zulong file_size, block_tail_size;
|
||||
zulong file_size;
|
||||
|
||||
if (gzread(gz, header.data, Z_TAR_BLOCK_SIZE) != Z_TAR_BLOCK_SIZE) break;
|
||||
header.fields.size[Z_ARRAY_SIZE(header.fields.size) - 1] = 0;
|
||||
file_size = strtoul((char const *)header.fields.size, &end, 8);
|
||||
if ((zuint8 *)end == header.fields.size || *end) break;
|
||||
if (gzread(gz, block.data, Z_TAR_BLOCK_SIZE) != Z_TAR_BLOCK_SIZE) break;
|
||||
block.header.size[Z_ARRAY_SIZE(block.header.size) - 1] = 0;
|
||||
file_size = strtoul((char const *)block.header.size, &end, 8);
|
||||
if ((zuint8 *)end == block.header.size || *end) break;
|
||||
|
||||
if (!strcmp(test->file_path, (char const *)header.fields.name))
|
||||
if (!strcmp(test->file_path, (char const *)block.header.name))
|
||||
{
|
||||
success =
|
||||
file_size == test->file_size &&
|
||||
gzseek(gz, test->code_offset, SEEK_CUR) != -1 &&
|
||||
gzread(gz, buffer, test->code_size) == test->code_size;
|
||||
file_size == test->file_size &&
|
||||
gzseek(gz, (z_off_t)test->code_offset, SEEK_CUR) != -1 &&
|
||||
(zuint)gzread(gz, buffer, test->code_size) == test->code_size;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (-1 == gzseek(gz, (block_tail_size = (file_size % Z_TAR_BLOCK_SIZE))
|
||||
? file_size + (Z_TAR_BLOCK_SIZE - block_tail_size)
|
||||
: file_size, SEEK_CUR)
|
||||
if (file_size % Z_TAR_BLOCK_SIZE)
|
||||
file_size += Z_TAR_BLOCK_SIZE - (file_size % Z_TAR_BLOCK_SIZE);
|
||||
|
||||
for (; file_size > (zulong)(Z_SINT_MAXIMUM / 2);
|
||||
file_size -= (zulong)(Z_SINT_MAXIMUM / 2)
|
||||
)
|
||||
break;
|
||||
if (gzseek(gz, (z_off_t)(Z_SINT_MAXIMUM / 2), SEEK_CUR) == -1)
|
||||
goto close_gz;
|
||||
|
||||
if (gzseek(gz, (z_off_t)file_size, SEEK_CUR) == -1) break;
|
||||
}
|
||||
|
||||
close_gz:
|
||||
gzclose(gz);
|
||||
}
|
||||
}
|
||||
@@ -485,7 +493,7 @@ static zboolean load_test(char const *search_path, Test const *test, void *buffe
|
||||
)
|
||||
{
|
||||
if ( zip_fread(file, buffer, test->code_offset) == test->code_offset &&
|
||||
zip_fread(file, buffer, test->code_size) == test->code_size
|
||||
zip_fread(file, buffer, test->code_size ) == test->code_size
|
||||
)
|
||||
success = Z_TRUE;
|
||||
|
||||
@@ -509,14 +517,14 @@ static zboolean load_test(char const *search_path, Test const *test, void *buffe
|
||||
|
||||
static zuint8 run_test(int test_index)
|
||||
{
|
||||
char const *failure = Z_NULL;
|
||||
char const *failure;
|
||||
Test const *test = &tests[test_index];
|
||||
zuint16 start_address = test->start_address;
|
||||
zusize cycles = 0;
|
||||
zuint i = 0;
|
||||
zusize cycles;
|
||||
zuint i;
|
||||
|
||||
# if Z_USIZE_WIDTH < 64
|
||||
zuint32 j = 0;
|
||||
zuint32 j;
|
||||
# endif
|
||||
|
||||
if (verbosity)
|
||||
@@ -533,20 +541,17 @@ static zuint8 run_test(int test_index)
|
||||
|
||||
memset(memory, 0, Z_USIZE(65536));
|
||||
|
||||
for (; i < search_path_count &&
|
||||
!load_test(search_paths[i], test, memory + (start_address & Z_UINT16(0xFF00)));
|
||||
i++
|
||||
for ( i = search_path_count;
|
||||
i && !load_test(search_paths[i - 1], test, &memory[start_address & Z_UINT16(0xFF00)]);
|
||||
i--
|
||||
);
|
||||
|
||||
if ( i == search_path_count &&
|
||||
!load_test(Z_NULL, test, memory + (start_address & Z_UINT16(0xFF00)))
|
||||
)
|
||||
if (!i && !load_test(Z_NULL, test, &memory[start_address & Z_UINT16(0xFF00)]))
|
||||
{
|
||||
failure = "program";
|
||||
error_loading_file:
|
||||
if (verbosity) puts(show_test_output
|
||||
? "error, test skipped\n"
|
||||
: "error, test skipped");
|
||||
|
||||
if (verbosity > 2) printf("Error\n%s", test_spacing);
|
||||
else if (verbosity) printf("Error: Cannot load %s\n%s", failure, test_spacing);
|
||||
return Z_FALSE;
|
||||
}
|
||||
|
||||
@@ -558,39 +563,34 @@ static zuint8 run_test(int test_index)
|
||||
cpu.fetch_opcode = cpu_read;
|
||||
cpu.write = cpm_cpu_write;
|
||||
cpu.hook = cpm_cpu_hook;
|
||||
memory[0] = OPCODE_HALT;
|
||||
memory[0] = Z80_HALT;
|
||||
memory[5] = Z80_HOOK; /* PRINT */
|
||||
}
|
||||
|
||||
else {
|
||||
cpu.write = zx_spectrum_cpu_write;
|
||||
cpu.hook = zx_spectrum_cpu_hook;
|
||||
cpu.im = 1;
|
||||
cpu.i = 0x3F;
|
||||
|
||||
if (test->format == TEST_FORMAT_WOODMASS)
|
||||
{
|
||||
if (verbosity >= 3) printf("* Loading firmware... ");
|
||||
|
||||
for ( i = 0;
|
||||
i < search_path_count &&
|
||||
!load_file(search_paths[i], "ZX Spectrum.rom", 16384, 0, 16384, memory);
|
||||
i++
|
||||
for ( i = search_path_count;
|
||||
i && !load_file(search_paths[i - 1], "ZX Spectrum.rom", 16384, 0, 16384, memory);
|
||||
i--
|
||||
);
|
||||
|
||||
if ( i == search_path_count &&
|
||||
!load_file(Z_NULL, "ZX Spectrum.rom", 16384, 0, 16384, memory)
|
||||
)
|
||||
if (!i && !load_file(Z_NULL, "ZX Spectrum.rom", 16384, 0, 16384, memory))
|
||||
{
|
||||
failure = "firmware";
|
||||
goto error_loading_file;
|
||||
}
|
||||
|
||||
if (verbosity >= 3) puts("OK");
|
||||
|
||||
cpu.fetch_opcode = zx_spectrum_cpu_fetch_opcode;
|
||||
Z80_SP(cpu) = 0x7FE8;
|
||||
Z80_AF(cpu) = 0x3222;
|
||||
|
||||
cpu.fetch_opcode = zx_spectrum_cpu_fetch_opcode;
|
||||
|
||||
/* 0010: THE 'PRINT A CHARACTER' RESTART */
|
||||
memory[0x0010] = OPCODE_JP_WORD; /* jp PRINT */
|
||||
memory[0x0010] = Z80_JP_WORD; /* jp PRINT */
|
||||
memory[0x0011] = 0xF2;
|
||||
memory[0x0012] = 0x70;
|
||||
|
||||
@@ -600,29 +600,24 @@ static zuint8 run_test(int test_index)
|
||||
|
||||
else {
|
||||
cpu.fetch_opcode = cpu_read;
|
||||
if (test->format == TEST_FORMAT_RAK) Z80_SP(cpu) -= 2;
|
||||
|
||||
/* 0010: THE 'PRINT A CHARACTER' RESTART */
|
||||
memory[zx_spectrum_print_hook_address = 0x0010] = Z80_HOOK;
|
||||
|
||||
/* 0D6B: THE 'CLS' COMMAND ROUTINE */
|
||||
memory[0x0D6B] = OPCODE_RET;
|
||||
|
||||
/* 1601: THE 'CHAN_OPEN' SUBROUTINE */
|
||||
memory[0x1601] = OPCODE_RET;
|
||||
|
||||
if (test->format == TEST_FORMAT_RAK)
|
||||
{
|
||||
/* 7000: START */
|
||||
memory[0x7000] = OPCODE_CALL_WORD;
|
||||
memory[0x7001] = (zuint8)start_address;
|
||||
memory[0x7002] = (zuint8)(start_address >> 8);
|
||||
/*memory[0x7003] = HALT;*/
|
||||
start_address = 0x7000;
|
||||
}
|
||||
memory[0x1601] = Z80_RET;
|
||||
}
|
||||
|
||||
cpu.write = zx_spectrum_cpu_write;
|
||||
cpu.hook = zx_spectrum_cpu_hook;
|
||||
cpu.i = 0x3F;
|
||||
|
||||
/* 0D6B: THE 'CLS' COMMAND ROUTINE */
|
||||
memory[0x0D6B] = Z80_RET;
|
||||
}
|
||||
|
||||
memory[test->exit_address] = OPCODE_HALT;
|
||||
memory[test->exit_address] = Z80_HALT;
|
||||
Z80_PC(cpu) = start_address;
|
||||
hash = Z_FNV1_32_INITIALIZER;
|
||||
lines =
|
||||
@@ -635,6 +630,8 @@ static zuint8 run_test(int test_index)
|
||||
if (verbosity >= 3) printf("* Running program%s", show_test_output ? ":\n\n" : "... ");
|
||||
|
||||
# if Z_USIZE_WIDTH < 64
|
||||
j = 0;
|
||||
|
||||
for (i = 0; i < test->cycles[1];)
|
||||
{
|
||||
cycles = RUN(&cpu, Z_UINT32_MAXIMUM / 2);
|
||||
@@ -660,10 +657,10 @@ static zuint8 run_test(int test_index)
|
||||
/*--------------------------------------------------------------------.
|
||||
| The test is considered passed if it has reached its exit address at |
|
||||
| the correct clock cycle, has not printed any unsupported characters |
|
||||
| and has printed the expected output within the correct margins. |
|
||||
| and has produced the expected output within the correct margins. |
|
||||
'====================================================================*/
|
||||
|
||||
if (!completed) failure = "clock cycle limit exceeded; program aborted";
|
||||
if (!completed) failure = "Aborted due to exceeding the clock cycle limit";
|
||||
|
||||
else if (
|
||||
zx_spectrum_bad_character ||
|
||||
@@ -671,7 +668,7 @@ static zuint8 run_test(int test_index)
|
||||
lines != test->lines ||
|
||||
columns != test->columns
|
||||
)
|
||||
failure = "incorrect behavior detected";
|
||||
failure = "Incorrect behavior detected";
|
||||
|
||||
else if (
|
||||
# if Z_USIZE_WIDTH < 64
|
||||
@@ -679,7 +676,9 @@ static zuint8 run_test(int test_index)
|
||||
# endif
|
||||
cycles != test->cycles[0]
|
||||
)
|
||||
failure = "incorrect number of clock cycles";
|
||||
failure = "Incorrect number of clock cycles";
|
||||
|
||||
else failure = Z_NULL;
|
||||
|
||||
if (verbosity)
|
||||
{
|
||||
@@ -690,14 +689,14 @@ static zuint8 run_test(int test_index)
|
||||
if (failure == Z_NULL) puts(&new_line[has_final_new_line]);
|
||||
|
||||
else printf(
|
||||
"%s>>> Test failed: %s.\n\n",
|
||||
"%s> Test failed: %s.\n\n",
|
||||
&new_line[!lines || (completed && has_final_new_line)],
|
||||
failure);
|
||||
}
|
||||
|
||||
else {
|
||||
if (failure == Z_NULL) puts ("passed");
|
||||
else printf("failed: %s\n", failure);
|
||||
if (failure == Z_NULL) printf("Passed\n%s", test_spacing);
|
||||
else printf("Failed: %s\n%s", failure, test_spacing);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,11 +704,11 @@ static zuint8 run_test(int test_index)
|
||||
}
|
||||
|
||||
|
||||
static zboolean string_is_option(char const* string, char const* short_option, char const* long_option)
|
||||
{return !strcmp(string, short_option) || !strcmp(string, long_option);}
|
||||
static zbool string_is_option(char const *string, char const *option)
|
||||
{return (*string == *option && string[1] == '\0') || !strcmp(string, &option[1]);}
|
||||
|
||||
|
||||
static zboolean string_to_uint8(char const* string, zuint8 maximum, zuint8 *value)
|
||||
static zbool string_to_uint8(char const *string, zuint8 maximum, zuint8 *value)
|
||||
{
|
||||
char *end;
|
||||
zulong parsed = strtoul(string, &end, 0);
|
||||
@@ -722,52 +721,52 @@ static zboolean string_to_uint8(char const* string, zuint8 maximum, zuint8 *valu
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
zboolean all = Z_FALSE;
|
||||
zuint32 tests_run = 0;
|
||||
zbool all = Z_FALSE;
|
||||
zusize maximum_search_path_size = 0;
|
||||
zuint32 tests_run;
|
||||
int j, i = 0;
|
||||
char const *string;
|
||||
|
||||
/*--------------------------------------------.
|
||||
| String specifying what has been detected as |
|
||||
| invalid when parsing the command line. |
|
||||
'============================================*/
|
||||
char const *invalid;
|
||||
# define option string
|
||||
# define invalid string
|
||||
|
||||
/*------------------------------.
|
||||
| [0] = Number of tests failed. |
|
||||
| [1] = Number of tests passed. |
|
||||
'==============================*/
|
||||
/* [0] = Number of tests failed. [1] = Number of tests passed. */
|
||||
zuint results[2] = {0, 0};
|
||||
|
||||
/*--------------------------------------------.
|
||||
| The emulator will behave as a Zilog NMOS if |
|
||||
| the user does not specify a CPU model. |
|
||||
'============================================*/
|
||||
/* The default CPU model to emulate is Zilog NMOS. */
|
||||
cpu.options = Z80_MODEL_ZILOG_NMOS;
|
||||
|
||||
/* Parse command line arguments. */
|
||||
while (++i < argc && *argv[i] == '-')
|
||||
{
|
||||
if (string_is_option(argv[i], "-V", "--version"))
|
||||
option = &argv[i][1];
|
||||
|
||||
if (string_is_option(option, "V-version"))
|
||||
{
|
||||
puts( "test-Z80 v" Z80_LIBRARY_VERSION_STRING "\n"
|
||||
"Copyright (C) 2021-2024 Manuel Sainz de Baranda y Goñi.\n"
|
||||
"Copyright (C) 2021-2026 Manuel Sainz de Baranda y Goñi.\n"
|
||||
"Released under the terms of the GNU General Public License v3.");
|
||||
|
||||
goto exit_without_error;
|
||||
}
|
||||
|
||||
else if (string_is_option(argv[i], "-h", "--help"))
|
||||
else if (string_is_option(option, "h-help"))
|
||||
{
|
||||
puts( "Usage: test-Z80 [options] (--all|<test>...)\n"
|
||||
puts( "Usage:\n"
|
||||
" test-Z80 [options] --all [<test>...]\n"
|
||||
" test-Z80 [options] <test>...\n"
|
||||
"\n"
|
||||
"Options:\n"
|
||||
" -V, --version Print version information and exit.\n"
|
||||
" -0, --even-in (0..255) Set the byte read from even I/O ports [default: 191].\n"
|
||||
" -1, --odd-in (0..255) Set the byte read from odd I/O ports [default: 255].\n"
|
||||
" -0, --in-even (0..255) Set the byte read from even I/O ports [default: 191].\n"
|
||||
" -1, --in-odd (0..255) Set the byte read from odd I/O ports [default: 255].\n"
|
||||
" -a, --all Run all tests.\n"
|
||||
" -h, --help Print this help message and exit.\n"
|
||||
" -m, --model <model> Specify the CPU model to emulate.\n"
|
||||
" -p, --path <path> Add a path where to look for the required files.\n"
|
||||
# ifdef TEST_Z80_WITH_EXECUTE
|
||||
" -r, --run Emulate using `z80_run` instead of `z80_execute`.\n"
|
||||
# endif
|
||||
" -v, --verbosity (0..4) Set the verbosity level [default: 4].\n"
|
||||
"\n"
|
||||
"CPU models:\n"
|
||||
@@ -805,28 +804,28 @@ int main(int argc, char **argv)
|
||||
" 20 Tests all flags after executing `ccf` after each instruction.\n"
|
||||
" 21 Tests all flags after executing `bit N,(hl)` after each instruction.\n"
|
||||
"\n"
|
||||
"Email bug reports and questions to <manuel@zxe.io>\n"
|
||||
"Email bug reports to <manuel@zxe.io>\n"
|
||||
"Open issues at <https://github.com/redcode/Z80>");
|
||||
|
||||
goto exit_without_error;
|
||||
}
|
||||
|
||||
else if (string_is_option(argv[i], "-0", "--even-in"))
|
||||
else if (string_is_option(option, "0-in-even"))
|
||||
{
|
||||
if (++i == argc) goto incomplete_option;
|
||||
if (!string_to_uint8(argv[i], 255, &in_values[0])) goto invalid_io_value;
|
||||
}
|
||||
|
||||
else if (string_is_option(argv[i], "-1", "--odd-in"))
|
||||
else if (string_is_option(option, "1-in-odd"))
|
||||
{
|
||||
if (++i == argc) goto incomplete_option;
|
||||
if (!string_to_uint8(argv[i], 255, &in_values[1])) goto invalid_io_value;
|
||||
}
|
||||
|
||||
else if (string_is_option(argv[i], "-a", "--all"))
|
||||
else if (string_is_option(option, "a-all"))
|
||||
all = Z_TRUE;
|
||||
|
||||
else if (string_is_option(argv[i], "-m", "--model"))
|
||||
else if (string_is_option(option, "m-model"))
|
||||
{
|
||||
if (++i == argc) goto incomplete_option;
|
||||
|
||||
@@ -842,10 +841,10 @@ int main(int argc, char **argv)
|
||||
cpu_model_found: continue;
|
||||
}
|
||||
|
||||
else if (string_is_option(argv[i], "-p", "--path"))
|
||||
else if (string_is_option(option, "p-path"))
|
||||
{
|
||||
zusize s;
|
||||
char **p;
|
||||
zusize s;
|
||||
|
||||
if (++i == argc) goto incomplete_option;
|
||||
|
||||
@@ -864,7 +863,12 @@ int main(int argc, char **argv)
|
||||
search_paths[search_path_count++] = argv[i];
|
||||
}
|
||||
|
||||
else if (string_is_option(argv[i], "-v", "--verbosity"))
|
||||
# ifdef TEST_Z80_WITH_EXECUTE
|
||||
else if (string_is_option(option, "r-run"))
|
||||
run = z80_run;
|
||||
# endif
|
||||
|
||||
else if (string_is_option(option, "v-verbosity"))
|
||||
{
|
||||
if (++i == argc) goto incomplete_option;
|
||||
|
||||
@@ -881,25 +885,25 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------.
|
||||
| The user must specify at least one test number, |
|
||||
| or the `-a` option in its absence. |
|
||||
'================================================*/
|
||||
/*---------------------------------------------------.
|
||||
| The user must specify at least one test number or, |
|
||||
| alternatively, pass the `--all` option. |
|
||||
'===================================================*/
|
||||
if (i == argc && !all)
|
||||
{
|
||||
fputs("test-Z80: No test specified.\n", stderr);
|
||||
goto bad_syntax;
|
||||
}
|
||||
|
||||
/*------------------------------------------.
|
||||
| All test numbers specified must be valid. |
|
||||
'==========================================*/
|
||||
/*-----------------------------------------------------.
|
||||
| All test numbers specified by the user must be valid |
|
||||
| and must be decimal. Leading zeros are allowed. |
|
||||
'=====================================================*/
|
||||
for (j = i; i < argc; i++)
|
||||
{
|
||||
char const *string = argv[i];
|
||||
char *end;
|
||||
|
||||
if (strtoul(string, &end, 10) >= Z_ARRAY_SIZE(tests) || end == string || *end)
|
||||
if (strtoul(argv[i], &end, 10) >= Z_ARRAY_SIZE(tests) || end == argv[i] || *end)
|
||||
{
|
||||
invalid = "test number";
|
||||
goto invalid_argument;
|
||||
@@ -911,27 +915,44 @@ int main(int argc, char **argv)
|
||||
)
|
||||
{
|
||||
cannot_allocate_memory:
|
||||
fputs("test-Z80: Cannot allocate memory.", stderr);
|
||||
fputs("test-Z80: Cannot allocate memory.\n", stderr);
|
||||
goto exit_with_error;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------.
|
||||
| Disable output buffering if verbosity is enabled, so that the |
|
||||
| messages are visible immediately rather than after each ENTER. |
|
||||
'===============================================================*/
|
||||
/*----------------------------------------------------------------.
|
||||
| Disable buffering on stdout when the verbosity level is greater |
|
||||
| than 0 to ensure progress messages are displayed immediately. |
|
||||
'================================================================*/
|
||||
if (verbosity) setvbuf(stdout, Z_NULL, _IONBF, 0);
|
||||
|
||||
/*--------------------------------------------------------------.
|
||||
| The output of the test programs is only printed at verbosity |
|
||||
| level 4. For levels 3 and 4, an additional line feed is added |
|
||||
| between tests to ensure proper formatting. |
|
||||
'==============================================================*/
|
||||
show_test_output = verbosity == 4;
|
||||
test_spacing = &new_line[verbosity < 3];
|
||||
|
||||
/* Configure the Z80 CPU emulator. */
|
||||
|
||||
/*---------------------------------------------------------------.
|
||||
| No CPU context is needed, since we are using global variables. |
|
||||
'===============================================================*/
|
||||
cpu.context = Z_NULL;
|
||||
|
||||
/*---------------------------------------------------.
|
||||
| No test program requires these optional callbacks. |
|
||||
'===================================================*/
|
||||
/*---------------------------------------------------------------------.
|
||||
| Initialize the Z80 emulator: |
|
||||
| * `context` is not needed, as global variables are used. |
|
||||
| * `fetch` and `read` use the same function because it is unnecessary |
|
||||
| to distinguish between different types of M-cycles when reading |
|
||||
| memory, as the test programs do not require precision down to the |
|
||||
| T-state level. |
|
||||
| * `nmia`, `inta`, and `int_fetch` will never be called because the |
|
||||
| test programs do not require interrupts. |
|
||||
| * `nop`, `ld_i_a`, `ld_r_a`, `reti`, `retn`, and `illegal` are also |
|
||||
| not needed. |
|
||||
| * `fetch_opcode`, `write`, and `hook` will be set by `run_test`. |
|
||||
'=====================================================================*/
|
||||
cpu.context = Z_NULL;
|
||||
cpu.fetch =
|
||||
cpu.read = cpu_read;
|
||||
cpu.in = cpu_in;
|
||||
cpu.out = cpu_out;
|
||||
cpu.halt = cpu_halt;
|
||||
cpu.nop =
|
||||
cpu.nmia =
|
||||
cpu.inta =
|
||||
cpu.int_fetch = Z_NULL;
|
||||
@@ -941,44 +962,22 @@ int main(int argc, char **argv)
|
||||
cpu.retn = Z_NULL;
|
||||
cpu.illegal = Z_NULL;
|
||||
|
||||
/*------------------------------------------------------------------.
|
||||
| It is not necessary to distinguish between opcode fetch, internal |
|
||||
| NOP and memory read, as the test programs require neither precise |
|
||||
| timing nor memory contention. |
|
||||
'==================================================================*/
|
||||
cpu.fetch =
|
||||
cpu.read =
|
||||
cpu.nop = cpu_read;
|
||||
|
||||
cpu.in = cpu_in;
|
||||
cpu.out = cpu_out;
|
||||
|
||||
/*-------------------------------------------------------------------.
|
||||
| Entering the HALT state means that the test program has completed. |
|
||||
'===================================================================*/
|
||||
cpu.halt = cpu_halt;
|
||||
|
||||
/*------------------------------------------------------------.
|
||||
| Run the tests whose numbers have been explicitly specified. |
|
||||
| Run the tests whose numbers have been specified. Then, if |
|
||||
| the user has passed the `--all` option, run all the others. |
|
||||
'============================================================*/
|
||||
while (j < argc)
|
||||
for (tests_run = 0; j < argc;)
|
||||
{
|
||||
tests_run |= Z_UINT32(1) << (i = atoi(argv[j++]));
|
||||
results[run_test(i)]++;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------.
|
||||
| If the `-a` option has been specified, run all tests |
|
||||
| without repeating those that have already been run. |
|
||||
'=====================================================*/
|
||||
if (all) for (i = 0; i < (int)Z_ARRAY_SIZE(tests); i++)
|
||||
if (!(tests_run & (Z_UINT32(1) << i))) results[run_test(i)]++;
|
||||
|
||||
/*---------------------------.
|
||||
| Print the results summary. |
|
||||
'===========================*/
|
||||
/* Print the results. */
|
||||
printf( "%sResults%s: %u test%s passed, %u failed.\n",
|
||||
&new_line[!verbosity || show_test_output],
|
||||
&new_line[!verbosity || *test_spacing],
|
||||
show_test_output ? " summary" : "",
|
||||
results[1],
|
||||
results[1] == 1 ? "" : "s",
|
||||
@@ -990,14 +989,15 @@ int main(int argc, char **argv)
|
||||
return results[0] ? -1 : 0;
|
||||
|
||||
incomplete_option:
|
||||
fprintf(stderr, "test-Z80: Incomplete option: '%s'\n", argv[i - 1]);
|
||||
fprintf(stderr, "test-Z80: Incomplete option: %s\n", argv[i - 1]);
|
||||
goto bad_syntax;
|
||||
|
||||
invalid_io_value:
|
||||
invalid = "I/O value";
|
||||
|
||||
invalid_argument:
|
||||
fprintf(stderr, "test-Z80: Invalid %s: '%s'\n", invalid, argv[i]);
|
||||
if (*argv[i] != '\0') fprintf(stderr, "test-Z80: Invalid %s: %s\n", invalid, argv[i]);
|
||||
else fprintf(stderr, "test-Z80: Bad syntax: Empty %s.\n", invalid);
|
||||
|
||||
bad_syntax:
|
||||
fputs("test-Z80: Type 'test-Z80 -h' for help.\n", stderr);
|
||||
|
||||
8
projects/Z80/support/Z80Config.cmake.in
vendored
8
projects/Z80/support/Z80Config.cmake.in
vendored
@@ -1,13 +1,9 @@
|
||||
cmake_minimum_required(
|
||||
# 3.3: IN_LIST
|
||||
VERSION 3.3...${CMAKE_VERSION})
|
||||
|
||||
set(@PROJECT_NAME@_known_components Static Shared)
|
||||
cmake_minimum_required(VERSION 3.0...${CMAKE_VERSION})
|
||||
set(@PROJECT_NAME@_component_Static NO)
|
||||
set(@PROJECT_NAME@_component_Shared NO)
|
||||
|
||||
foreach(@PROJECT_NAME@_component IN LISTS ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
|
||||
if(@PROJECT_NAME@_component IN_LIST @PROJECT_NAME@_known_components)
|
||||
if(@PROJECT_NAME@_component MATCHES "^(Static|Shared)$")
|
||||
set(@PROJECT_NAME@_component_${@PROJECT_NAME@_component} YES)
|
||||
else()
|
||||
set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
|
||||
|
||||
2
projects/Zeta/API/Z/classes/Empty.hpp
vendored
2
projects/Zeta/API/Z/classes/Empty.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Empty_HPP
|
||||
|
||||
21
projects/Zeta/API/Z/classes/Functor.hpp
vendored
21
projects/Zeta/API/Z/classes/Functor.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Functor_HPP
|
||||
@@ -19,13 +19,10 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
# define Z_HAS_Functor 1
|
||||
|
||||
|
||||
namespace Zeta {
|
||||
|
||||
template <class f> class Functor;
|
||||
|
||||
template <class r, class... p> class Functor<r(p...)> {
|
||||
|
||||
private:
|
||||
typedef r (* Call)(const Functor *, typename Type<p>::to_forwardable...);
|
||||
typedef void (* Destroy)(Functor *);
|
||||
@@ -46,9 +43,9 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
# endif
|
||||
} target;
|
||||
|
||||
|
||||
struct Callers {
|
||||
|
||||
|
||||
static Z_INLINE Call function() Z_NOTHROW
|
||||
{
|
||||
return [](const Functor *functor, typename Type<p>::to_forwardable... arguments) -> r
|
||||
@@ -79,11 +76,13 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
};
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Z_CT(CPP11) Functor() Z_NOTHROW
|
||||
: call(Z_NULL), destroy(Z_NULL) {}
|
||||
|
||||
@@ -134,7 +133,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
|
||||
# if Z_HAS(TypeIsConvertible)
|
||||
|
||||
template <class o, class e = typename TypeIf<
|
||||
Type<o>::is_class &&
|
||||
TypeIsConvertible<o, r(*)(p...)>::value
|
||||
@@ -142,12 +140,10 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
Z_INLINE Functor(const o &object) Z_NOTHROW
|
||||
: call(Callers::function()), destroy(Z_NULL)
|
||||
{target.function = (r(*)(p...))object;} // TODO: cast
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
# if Z_HAS(ObjectSelector)
|
||||
|
||||
Z_INLINE Functor(id object, SEL selector) Z_NOTHROW
|
||||
: call(Callers::object_selector()), destroy(Z_NULL)
|
||||
{
|
||||
@@ -162,7 +158,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
target.object_selector.selector = object_selector.selector;
|
||||
target.object_selector.object = object_selector.object;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
@@ -170,16 +165,16 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
{if (destroy) destroy(this);}
|
||||
|
||||
|
||||
Z_CT(CPP11) operator Boolean() const Z_NOTHROW
|
||||
Z_CT(CPP11) operator Bool() const Z_NOTHROW
|
||||
{return call != Z_NULL;}
|
||||
|
||||
|
||||
Z_INLINE r operator ()(typename Type<p>::to_forwardable... arguments) const
|
||||
{return call(this, arguments...);}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif // Z_classes_Functor_HPP
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_InitializerList_HPP
|
||||
@@ -18,7 +18,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
# define Z_HAS_InitializerList 1
|
||||
|
||||
|
||||
namespace Zeta {template <class t> class InitializerList {
|
||||
public:
|
||||
typedef t value_type;
|
||||
|
||||
8
projects/Zeta/API/Z/classes/Iterator.hpp
vendored
8
projects/Zeta/API/Z/classes/Iterator.hpp
vendored
@@ -3,13 +3,12 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Iterator_HPP
|
||||
#define Z_classes_Iterator_HPP
|
||||
|
||||
|
||||
namespace Zeta{template <class t> struct Iterator {
|
||||
t& data_source;
|
||||
typename t::size_type index;
|
||||
@@ -19,7 +18,7 @@ namespace Zeta{template <class t> struct Iterator {
|
||||
: data_source(data_source_), index(index_) {}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const Iterator &lhs, const Iterator &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const Iterator &lhs, const Iterator &rhs) Z_NOTHROW
|
||||
{return lhs.index != rhs.index;}
|
||||
|
||||
|
||||
@@ -32,7 +31,8 @@ namespace Zeta{template <class t> struct Iterator {
|
||||
index++;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_Iterator_HPP
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_MemberFunction_HPP
|
||||
@@ -20,7 +20,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
# include <Z/constants/pointer.h>
|
||||
# include <Z/traits/type.hpp>
|
||||
|
||||
|
||||
namespace Zeta {
|
||||
template <class f> struct MemberFunction;
|
||||
|
||||
@@ -46,7 +45,7 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
: function(reinterpret_cast<r (NaT::*)(p...)>(function)) {}
|
||||
|
||||
|
||||
Z_CT(CPP11) operator Boolean() const Z_NOTHROW
|
||||
Z_CT(CPP11) operator Bool() const Z_NOTHROW
|
||||
{return function != Z_NULL;}
|
||||
|
||||
|
||||
@@ -78,6 +77,8 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
template <class o>
|
||||
Z_INLINE r operator ()(const o &object, typename Type<p>::to_forwardable... arguments) const
|
||||
{return (const_cast<NaT *>(reinterpret_cast<const NaT *>(&object))->*function)(arguments...);}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
4
projects/Zeta/API/Z/classes/NaT.hpp
vendored
4
projects/Zeta/API/Z/classes/NaT.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_NaT_HPP
|
||||
@@ -11,7 +11,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#include <Z/macros/language.hpp>
|
||||
|
||||
|
||||
namespace Zeta {struct NaT Z_FINAL {
|
||||
# if Z_DIALECT_HAS(CPP11, DELETED_FUNCTION)
|
||||
NaT() = delete;
|
||||
@@ -26,5 +25,4 @@ namespace Zeta {struct NaT Z_FINAL {
|
||||
# endif
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_NaT_HPP
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_ObjectMemberFunction_HPP
|
||||
@@ -15,7 +15,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
#if Z_HAS(MemberFunction)
|
||||
# define Z_HAS_ObjectMemberFunction 1
|
||||
|
||||
|
||||
namespace Zeta {
|
||||
template <class f> struct ObjectMemberFunction;
|
||||
|
||||
@@ -141,6 +140,8 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
this->object = const_cast<NaT *>(reinterpret_cast<const NaT *>(&object));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_ObjectSelector_HPP
|
||||
@@ -15,7 +15,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
#if Z_HAS(Selector)
|
||||
# define Z_HAS_ObjectSelector 1
|
||||
|
||||
|
||||
namespace Zeta {
|
||||
template <class f> struct ObjectSelector;
|
||||
|
||||
@@ -87,6 +86,8 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
this->object = object;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_OpaqueMemberFunctionPointer_HPP
|
||||
@@ -11,7 +11,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#include <Z/classes/NaT.hpp>
|
||||
|
||||
|
||||
namespace Zeta {struct OpaqueMemberFunctionPointer {
|
||||
void (NaT::* value)();
|
||||
|
||||
@@ -24,7 +23,8 @@ namespace Zeta {struct OpaqueMemberFunctionPointer {
|
||||
template <class m>
|
||||
Z_INLINE operator m() const Z_NOTHROW
|
||||
{return reinterpret_cast<m>(value);}
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_OpaqueMemberFunctionPointer_HPP
|
||||
|
||||
12
projects/Zeta/API/Z/classes/Pair.hpp
vendored
12
projects/Zeta/API/Z/classes/Pair.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Pair_HPP
|
||||
@@ -12,7 +12,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
#include <Z/macros/language.hpp>
|
||||
#include <Z/types/integral.hpp>
|
||||
|
||||
|
||||
namespace Zeta {template <class t1, class t2 = t1> struct Pair {
|
||||
typedef t1 First;
|
||||
typedef t2 Second;
|
||||
@@ -20,19 +19,21 @@ namespace Zeta {template <class t1, class t2 = t1> struct Pair {
|
||||
t1 first;
|
||||
t2 second;
|
||||
|
||||
|
||||
Z_INLINE Pair() Z_DEFAULTED({})
|
||||
|
||||
|
||||
Z_CT(CPP11) Pair(
|
||||
typename Type<t1>::to_forwardable first,
|
||||
typename Type<t2>::to_forwardable second
|
||||
) : first(first), second(second) {}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean operator ==(const Pair &pair) const
|
||||
Z_CT(CPP11) Bool operator ==(const Pair &pair) const
|
||||
{return first == pair.first && second == pair.second;}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean operator !=(const Pair &pair) const
|
||||
Z_CT(CPP11) Bool operator !=(const Pair &pair) const
|
||||
{return first != pair.first || second != pair.second;}
|
||||
|
||||
|
||||
@@ -42,7 +43,8 @@ namespace Zeta {template <class t1, class t2 = t1> struct Pair {
|
||||
reinterpret_cast<typename Type<Pair>::to_opaque *>(this),
|
||||
reinterpret_cast<typename Type<Pair>::to_opaque *>(&pair));
|
||||
}*/
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_Pair_HPP
|
||||
|
||||
23
projects/Zeta/API/Z/classes/Range.hpp
vendored
23
projects/Zeta/API/Z/classes/Range.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Range_HPP
|
||||
@@ -15,7 +15,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
# import <Foundation/NSRange.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace Zeta {template <class t> struct Range {
|
||||
t index, size;
|
||||
|
||||
@@ -32,15 +31,15 @@ namespace Zeta {template <class t> struct Range {
|
||||
: index(index_), size(size_) {}
|
||||
|
||||
|
||||
Z_CT(CPP11) operator Boolean() const Z_NOTHROW
|
||||
Z_CT(CPP11) operator Bool() const Z_NOTHROW
|
||||
{return !!size;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(const Range &lhs, const Range &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(const Range &lhs, const Range &rhs) Z_NOTHROW
|
||||
{return lhs.index == rhs.index && lhs.size == rhs.size;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const Range &lhs, const Range &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const Range &lhs, const Range &rhs) Z_NOTHROW
|
||||
{return lhs.index != rhs.index || lhs.size != rhs.size;}
|
||||
|
||||
|
||||
@@ -89,11 +88,11 @@ namespace Zeta {template <class t> struct Range {
|
||||
Z_CT(CPP11) t operator [](t index_) const Z_NOTHROW {return index + index_;}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean contains(const Range &other) const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool contains(const Range &other) const Z_NOTHROW
|
||||
{return other.index >= index && other.end() <= end();}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean contains(t index_) const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool contains(t index_) const Z_NOTHROW
|
||||
{return index_ >= index && index_ < end();}
|
||||
|
||||
|
||||
@@ -101,25 +100,22 @@ namespace Zeta {template <class t> struct Range {
|
||||
{return index + size;}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean intersects(const Range &other) const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool intersects(const Range &other) const Z_NOTHROW
|
||||
{return index < other.end() && other.index < end();}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_zero() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_zero() const Z_NOTHROW
|
||||
{return !index && !size;}
|
||||
|
||||
|
||||
# if defined(Z_WITH_FOUNDATION) && Z_LANGUAGE_INCLUDES(OBJECTIVE_CPP)
|
||||
|
||||
Z_CT(CPP11) Range(const NSRange &range) Z_NOTHROW
|
||||
: index(t(range.location)), size(t(range.length)) {}
|
||||
|
||||
|
||||
# if Z_DIALECT_HAS(CPP11, COPY_LIST_INITIALIZATION)
|
||||
|
||||
Z_CT(CPP11) operator NSRange() const Z_NOTHROW
|
||||
{return {NSUInteger(index), NSUInteger(size)};}
|
||||
|
||||
# else
|
||||
Z_CT(CPP14) operator NSRange() const Z_NOTHROW
|
||||
{
|
||||
@@ -127,8 +123,9 @@ namespace Zeta {template <class t> struct Range {
|
||||
return result;
|
||||
}
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
|
||||
27
projects/Zeta/API/Z/classes/Rectangle.hpp
vendored
27
projects/Zeta/API/Z/classes/Rectangle.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Rectangle_HPP
|
||||
@@ -27,7 +27,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
# include <QRect>
|
||||
#endif
|
||||
|
||||
|
||||
namespace Zeta {template <class t> struct Rectangle {
|
||||
XY<t> point, size;
|
||||
|
||||
@@ -93,15 +92,15 @@ namespace Zeta {template <class t> struct Rectangle {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) operator Boolean() const Z_NOTHROW
|
||||
Z_CT(CPP11) operator Bool() const Z_NOTHROW
|
||||
{return point || size;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(const Rectangle &lhs, const Rectangle &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(const Rectangle &lhs, const Rectangle &rhs) Z_NOTHROW
|
||||
{return lhs.point == rhs.point && lhs.size == rhs.size;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const Rectangle &lhs, const Rectangle &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const Rectangle &lhs, const Rectangle &rhs) Z_NOTHROW
|
||||
{return lhs.point != rhs.point || lhs.size != rhs.size;}
|
||||
|
||||
|
||||
@@ -348,7 +347,7 @@ namespace Zeta {template <class t> struct Rectangle {
|
||||
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean contains(const Rectangle &other) const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool contains(const Rectangle &other) const Z_NOTHROW
|
||||
{
|
||||
return !other.size.has_zero() &&
|
||||
other.point >= point &&
|
||||
@@ -356,7 +355,7 @@ namespace Zeta {template <class t> struct Rectangle {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean contains(const XY<t> &point_) const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool contains(const XY<t> &point_) const Z_NOTHROW
|
||||
{return point_ >= point && point_ < point + size;}
|
||||
|
||||
|
||||
@@ -502,7 +501,7 @@ namespace Zeta {template <class t> struct Rectangle {
|
||||
{return Rectangle(point.x, point.y - delta, size.x, size.y + delta);}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean intersects(const Rectangle &other) const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool intersects(const Rectangle &other) const Z_NOTHROW
|
||||
{
|
||||
return !size.has_zero() &&
|
||||
!other.size.has_zero() &&
|
||||
@@ -511,7 +510,7 @@ namespace Zeta {template <class t> struct Rectangle {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_zero() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_zero() const Z_NOTHROW
|
||||
{return point.is_zero() && size.is_zero();}
|
||||
|
||||
|
||||
@@ -638,21 +637,17 @@ namespace Zeta {template <class t> struct Rectangle {
|
||||
{return point + point_ * size;}
|
||||
|
||||
|
||||
|
||||
# ifdef Z_WITH_COCOS2D_X
|
||||
|
||||
Z_INLINE Rectangle(const cocos2d::Rect &rectangle)
|
||||
: point(rectangle.origin), size(rectangle.size) {}
|
||||
|
||||
|
||||
Z_INLINE operator cocos2d::Rect() const
|
||||
{return cocos2d::Rect(float(point.x), float(point.y), float(size.x), float(size.y));}
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
# if defined(Z_WITH_CORE_FOUNDATION) || defined(Z_WITH_FOUNDATION)
|
||||
|
||||
# define Z_z_APPLE_CONSTRUCTORS(Prefix) \
|
||||
\
|
||||
Z_CT(CPP11) Rectangle(const Prefix##Rect &rectangle) Z_NOTHROW \
|
||||
@@ -708,12 +703,10 @@ namespace Zeta {template <class t> struct Rectangle {
|
||||
|
||||
# undef Z_z_APPLE_CONSTRUCTORS
|
||||
# undef Z_z_APPLE_OPERATORS
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
# ifdef Z_WITH_QT
|
||||
|
||||
Z_CT(CPP11) Rectangle(const QRect &rectangle) Z_NOTHROW
|
||||
: point(rectangle.topLeft()), size(rectangle.size()) {}
|
||||
|
||||
@@ -728,9 +721,9 @@ namespace Zeta {template <class t> struct Rectangle {
|
||||
|
||||
Z_CT(CPP11) operator QRect() const Z_NOTHROW
|
||||
{return QRect(int(point.x), int(point.y), int(size.x), int(size.y));}
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_Rectangle_HPP
|
||||
|
||||
6
projects/Zeta/API/Z/classes/Reference.hpp
vendored
6
projects/Zeta/API/Z/classes/Reference.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Reference_HPP
|
||||
@@ -11,7 +11,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#include <Z/macros/language.hpp>
|
||||
|
||||
|
||||
namespace Zeta {template <class t> struct Reference {
|
||||
typedef t type;
|
||||
|
||||
@@ -33,7 +32,8 @@ namespace Zeta {template <class t> struct Reference {
|
||||
|
||||
Z_CT(CPP11) t &get() const Z_NOTHROW
|
||||
{return *value;}
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_Span_HPP
|
||||
|
||||
11
projects/Zeta/API/Z/classes/Selector.hpp
vendored
11
projects/Zeta/API/Z/classes/Selector.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Selector_HPP
|
||||
@@ -24,11 +24,9 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
# define Z_HAS_Selector 1
|
||||
|
||||
|
||||
namespace Zeta {
|
||||
template <class f> struct Selector;
|
||||
|
||||
|
||||
template <class r, class... p>
|
||||
struct Selector<r(p...)> {
|
||||
typedef r (* Send )(id, SEL, p...);
|
||||
@@ -70,9 +68,10 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
return (SendSuper(ObjectiveC::send_super<r>()))
|
||||
(const_cast<objc_super *>(&object_super), selector, arguments...);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
# if Z_DIALECT_HAS(CPP11, RVALUE_REFERENCE)
|
||||
template <class r, class... p>
|
||||
struct Selector<r(p..., ...)> {
|
||||
@@ -118,11 +117,11 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
return (SendSuper(ObjectiveC::send_super<r>()))
|
||||
(const_cast<objc_super *>(&object_super), selector, forwardable<pp>(arguments)...);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif // Z_classes_Selector_HPP
|
||||
|
||||
28
projects/Zeta/API/Z/classes/Shared.hpp
vendored
28
projects/Zeta/API/Z/classes/Shared.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Shared_HPP
|
||||
@@ -14,9 +14,7 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
#include <Z/types/integral.hpp>
|
||||
#include <Z/types/pointer.hpp>
|
||||
|
||||
|
||||
namespace Zeta {template <class t> struct Shared {
|
||||
|
||||
struct Owned {
|
||||
t* data;
|
||||
USize owner_count;
|
||||
@@ -29,6 +27,7 @@ namespace Zeta {template <class t> struct Shared {
|
||||
Z_INLINE ~Owned()
|
||||
{delete data;}
|
||||
|
||||
|
||||
};
|
||||
|
||||
Owned *owned;
|
||||
@@ -50,8 +49,8 @@ namespace Zeta {template <class t> struct Shared {
|
||||
{if (owned && !--owned->owner_count) delete owned;}
|
||||
|
||||
|
||||
Z_INLINE operator Boolean() const Z_NOTHROW
|
||||
{return Boolean(owned);}
|
||||
Z_INLINE operator Bool() const Z_NOTHROW
|
||||
{return Bool(owned);}
|
||||
|
||||
|
||||
Z_INLINE Shared &operator =(const Shared &rhs)
|
||||
@@ -79,11 +78,11 @@ namespace Zeta {template <class t> struct Shared {
|
||||
}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator ==(const Shared &lhs, const Shared &rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator ==(const Shared &lhs, const Shared &rhs) Z_NOTHROW
|
||||
{return lhs.owned == rhs.owned;}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator !=(const Shared &lhs, const Shared &rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator !=(const Shared &lhs, const Shared &rhs) Z_NOTHROW
|
||||
{return lhs.owned != rhs.owned;}
|
||||
|
||||
|
||||
@@ -120,7 +119,6 @@ namespace Zeta {template <class t> struct Shared {
|
||||
|
||||
|
||||
# ifdef Z_NULLPTR
|
||||
|
||||
Z_CT(CPP11) Shared(NullPtr) Z_NOTHROW
|
||||
: owned(nullptr) {}
|
||||
|
||||
@@ -133,26 +131,24 @@ namespace Zeta {template <class t> struct Shared {
|
||||
}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator ==(const Shared &lhs, NullPtr) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator ==(const Shared &lhs, NullPtr) Z_NOTHROW
|
||||
{return !lhs.owned;}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator ==(NullPtr, const Shared &rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator ==(NullPtr, const Shared &rhs) Z_NOTHROW
|
||||
{return !rhs.owned;}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator !=(const Shared &lhs, NullPtr) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator !=(const Shared &lhs, NullPtr) Z_NOTHROW
|
||||
{return !!lhs.owned;}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator !=(NullPtr, const Shared &rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator !=(NullPtr, const Shared &rhs) Z_NOTHROW
|
||||
{return !!rhs.owned;}
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
# if Z_DIALECT_HAS(CPP11, RVALUE_REFERENCE)
|
||||
|
||||
Z_INLINE Shared(Shared &&other) Z_NOTHROW
|
||||
: owned(other.owned)
|
||||
{other.owned = Z_NULL;}
|
||||
@@ -169,9 +165,9 @@ namespace Zeta {template <class t> struct Shared {
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_Shared_HPP
|
||||
|
||||
12
projects/Zeta/API/Z/classes/SizedString.hpp
vendored
12
projects/Zeta/API/Z/classes/SizedString.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_SizedString_HPP
|
||||
@@ -12,12 +12,9 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
#include <Z/classes/StringView.hpp>
|
||||
#include <utility>
|
||||
|
||||
|
||||
namespace Zeta{namespace ZetaDetail {
|
||||
|
||||
template <class t, USize s, class = std::make_index_sequence<s - 1> > struct SizedString;
|
||||
|
||||
|
||||
template <class t, USize s, std::size_t... i>
|
||||
struct SizedString<t, s, std::index_sequence<i...> > {
|
||||
t data[s];
|
||||
@@ -29,12 +26,14 @@ namespace Zeta{namespace ZetaDetail {
|
||||
|
||||
Z_CT(CPP11) SizedString(const StringView<t> &string_view) Z_NOTHROW
|
||||
: data{string_view.data[i]..., 0} {}
|
||||
|
||||
|
||||
};
|
||||
}}
|
||||
|
||||
|
||||
namespace Zeta{template <class t, USize s> struct SizedString : ZetaDetail::SizedString<t, s> {
|
||||
|
||||
|
||||
Z_CT(CPP11) SizedString(const t (&string)[s]) Z_NOTHROW
|
||||
: ZetaDetail::SizedString<t, s>(string) {}
|
||||
|
||||
@@ -49,7 +48,8 @@ namespace Zeta{template <class t, USize s> struct SizedString : ZetaDetail::Size
|
||||
|
||||
Z_CT(CPP11) const t &operator [](USize index) const Z_NOTHROW
|
||||
{return this->data[index];}
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_SizedString_HPP
|
||||
|
||||
6
projects/Zeta/API/Z/classes/Span.hpp
vendored
6
projects/Zeta/API/Z/classes/Span.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Span_HPP
|
||||
@@ -13,7 +13,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
#include <Z/classes/Range.hpp>
|
||||
#include <Z/classes/Iterator.hpp>
|
||||
|
||||
|
||||
namespace Zeta {template <class t> struct Span {
|
||||
typedef const t* const_pointer;
|
||||
typedef const t& const_reference;
|
||||
@@ -72,7 +71,8 @@ namespace Zeta {template <class t> struct Span {
|
||||
|
||||
Z_CT(CPP11) Iterator<Span> end() const Z_NOTHROW
|
||||
{return Iterator<Span>(*this, size);}*/
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_Span_HPP
|
||||
|
||||
18
projects/Zeta/API/Z/classes/Strid.hpp
vendored
18
projects/Zeta/API/Z/classes/Strid.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Strid_HPP
|
||||
@@ -11,7 +11,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#include <Z/functions/hash.hpp>
|
||||
|
||||
|
||||
namespace Zeta {struct Strid {
|
||||
UInt64 hash;
|
||||
|
||||
@@ -32,29 +31,30 @@ namespace Zeta {struct Strid {
|
||||
{return hash;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(const Strid &lhs, const Strid &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(const Strid &lhs, const Strid &rhs) Z_NOTHROW
|
||||
{return lhs.hash == rhs.hash;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(const Strid &lhs, UInt64 rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(const Strid &lhs, UInt64 rhs) Z_NOTHROW
|
||||
{return lhs.hash == rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(UInt64 lhs, const Strid &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(UInt64 lhs, const Strid &rhs) Z_NOTHROW
|
||||
{return lhs == rhs.hash;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const Strid &lhs, const Strid &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const Strid &lhs, const Strid &rhs) Z_NOTHROW
|
||||
{return lhs.hash != rhs.hash;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const Strid &lhs, UInt64 rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const Strid &lhs, UInt64 rhs) Z_NOTHROW
|
||||
{return lhs.hash != rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(UInt64 lhs, const Strid &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(UInt64 lhs, const Strid &rhs) Z_NOTHROW
|
||||
{return lhs != rhs.hash;}
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_Strid_HPP
|
||||
|
||||
27
projects/Zeta/API/Z/classes/StringView.hpp
vendored
27
projects/Zeta/API/Z/classes/StringView.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_StringView_HPP
|
||||
@@ -61,52 +61,51 @@ namespace Zeta {template <class t = Char> struct StringView {
|
||||
|
||||
|
||||
# ifdef Z_WITH_STDCPP
|
||||
|
||||
friend Z_INLINE Boolean operator ==(const StringView &lhs, const StringView &rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator ==(const StringView &lhs, const StringView &rhs) Z_NOTHROW
|
||||
{return lhs.size == rhs.size && !std::memcmp(lhs.data, rhs.data, lhs.size * sizeof(t));}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator !=(const StringView &lhs, const StringView &rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator !=(const StringView &lhs, const StringView &rhs) Z_NOTHROW
|
||||
{return lhs.size != rhs.size || std::memcmp(lhs.data, rhs.data, lhs.size * sizeof(t));}
|
||||
|
||||
|
||||
template <USize s>
|
||||
friend Z_INLINE Boolean operator ==(const StringView &lhs, const t (&rhs)[s]) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator ==(const StringView &lhs, const t (&rhs)[s]) Z_NOTHROW
|
||||
{return lhs.size == (s - 1) && !std::memcmp(lhs.data, rhs, (s - 1) * sizeof(t));}
|
||||
|
||||
|
||||
template <USize s>
|
||||
friend Z_INLINE Boolean operator !=(const StringView &lhs, const t (&rhs)[s]) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator !=(const StringView &lhs, const t (&rhs)[s]) Z_NOTHROW
|
||||
{return lhs.size != (s - 1) || std::memcmp(lhs.data, rhs, (s - 1) * sizeof(t));}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator ==(const StringView &lhs, const t *rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator ==(const StringView &lhs, const t *rhs) Z_NOTHROW
|
||||
{return lhs.size * sizeof(t) == std::strlen(rhs) && !std::memcmp(lhs.data, rhs, lhs.size * sizeof(t));}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator !=(const StringView &lhs, const t *rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator !=(const StringView &lhs, const t *rhs) Z_NOTHROW
|
||||
{return lhs.size * sizeof(t) != std::strlen(rhs) || std::memcmp(lhs.data, rhs, lhs.size * sizeof(t));}
|
||||
|
||||
|
||||
template <USize s>
|
||||
friend Z_INLINE Boolean operator ==(const t (&lhs)[s], const StringView &rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator ==(const t (&lhs)[s], const StringView &rhs) Z_NOTHROW
|
||||
{return rhs.size == (s - 1) && !std::memcmp(rhs.data, lhs, (s - 1) * sizeof(t));}
|
||||
|
||||
|
||||
template <USize s>
|
||||
friend Z_INLINE Boolean operator !=(const t (&lhs)[s], const StringView &rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator !=(const t (&lhs)[s], const StringView &rhs) Z_NOTHROW
|
||||
{return rhs.size != (s - 1) || std::memcmp(rhs.data, lhs, (s - 1) * sizeof(t));}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator ==(const t *lhs, const StringView &rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator ==(const t *lhs, const StringView &rhs) Z_NOTHROW
|
||||
{return rhs.size * sizeof(t) == std::strlen(lhs) && !std::memcmp(rhs.data, lhs, rhs.size * sizeof(t));}
|
||||
|
||||
|
||||
friend Z_INLINE Boolean operator !=(const t *lhs, const StringView &rhs) Z_NOTHROW
|
||||
friend Z_INLINE Bool operator !=(const t *lhs, const StringView &rhs) Z_NOTHROW
|
||||
{return rhs.size * sizeof(t) != std::strlen(lhs) || std::memcmp(rhs.data, lhs, rhs.size * sizeof(t));}
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_StringView_HPP
|
||||
|
||||
7
projects/Zeta/API/Z/classes/TripleBuffer.hpp
vendored
7
projects/Zeta/API/Z/classes/TripleBuffer.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_TripleBuffer_HPP
|
||||
@@ -15,9 +15,9 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
#include <Z/types/integral.hpp>
|
||||
#include <Z/functions/atomic.h>
|
||||
|
||||
|
||||
namespace Zeta {struct TripleBuffer : ZTripleBuffer {
|
||||
|
||||
|
||||
Z_INLINE TripleBuffer() Z_NOTHROW
|
||||
Z_DEFAULTED({})
|
||||
|
||||
@@ -101,7 +101,8 @@ namespace Zeta {struct TripleBuffer : ZTripleBuffer {
|
||||
|
||||
Z_CT(CPP11) UChar production_index() const Z_NOTHROW
|
||||
{return (f & 48) >> 4;}
|
||||
|
||||
|
||||
};}
|
||||
|
||||
|
||||
#endif // Z_classes_TripleBuffer_HPP
|
||||
|
||||
23
projects/Zeta/API/Z/classes/Tuple.hpp
vendored
23
projects/Zeta/API/Z/classes/Tuple.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_Tuple_HPP
|
||||
@@ -16,38 +16,37 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
# define Z_HAS_Tuple 1
|
||||
|
||||
|
||||
namespace Zeta {namespace ZetaDetail {namespace Tuple {
|
||||
|
||||
template <class type_list> struct Element;
|
||||
|
||||
|
||||
template <class... t> struct Super {
|
||||
typedef Element<typename TypeListRotateRight<TypeList<t...>, 1>::type> type;
|
||||
};
|
||||
|
||||
|
||||
template <class t0>
|
||||
struct Element<TypeList<t0> > {
|
||||
typedef t0 type;
|
||||
|
||||
type value;
|
||||
|
||||
|
||||
Z_INLINE Element()
|
||||
Z_DEFAULTED({})
|
||||
|
||||
|
||||
Z_CT(CPP11) Element(typename Zeta::Type<t0>::to_forwardable value)
|
||||
: value(value) {}
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
template <class tn, class... t>
|
||||
struct Element<TypeList<tn, t...> > : Super<t...>::type {
|
||||
typedef tn type;
|
||||
|
||||
type value;
|
||||
|
||||
|
||||
Z_INLINE Element()
|
||||
Z_DEFAULTED({})
|
||||
|
||||
@@ -56,17 +55,17 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
typename Zeta::Type<t >::to_forwardable... previous,
|
||||
typename Zeta::Type<tn>::to_forwardable value
|
||||
) : Super<t...>::type(previous...), value(value) {}
|
||||
|
||||
|
||||
};
|
||||
}}}
|
||||
|
||||
|
||||
namespace Zeta {template <class... t> class Tuple : public ZetaDetail::Tuple::Super<t...>::type {
|
||||
private:
|
||||
typedef typename ZetaDetail::Tuple::Super<t...>::type Super;
|
||||
|
||||
public:
|
||||
template <UInt i> class At {
|
||||
|
||||
private:
|
||||
enum {tail_size = TypeCount<t...>::value - (i + 1)};
|
||||
|
||||
@@ -78,10 +77,10 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
typedef typename Element::type type;
|
||||
};
|
||||
|
||||
|
||||
# if !Z_DIALECT_HAS(CPP11, INHERITING_CONSTRUCTORS)
|
||||
using Super::Super;
|
||||
|
||||
|
||||
# else
|
||||
Z_INLINE Tuple()
|
||||
Z_DEFAULTED({})
|
||||
@@ -108,9 +107,10 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
At<index>::Element::value = value;
|
||||
return *this;
|
||||
}
|
||||
};}
|
||||
|
||||
|
||||
};}
|
||||
|
||||
# if defined(Z_WITH_STD) && \
|
||||
Z_DIALECT_HAS(CPP17, STRUCTURED_BINDING) && \
|
||||
defined(__has_include) && \
|
||||
@@ -118,6 +118,7 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
# include <tuple>
|
||||
|
||||
|
||||
# define Z_z_IMPLEMENTATION(qualifiers) \
|
||||
\
|
||||
template <class... t> \
|
||||
@@ -130,6 +131,7 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
typedef typename Zeta::Type<typename Zeta::Tuple<t...>::template At<i>::type>::add_const type; \
|
||||
};
|
||||
|
||||
|
||||
Z_z_IMPLEMENTATION(Z_EMPTY )
|
||||
Z_z_IMPLEMENTATION(const )
|
||||
Z_z_IMPLEMENTATION(const volatile)
|
||||
@@ -137,7 +139,6 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
# undef Z_z_IMPLEMENTATION
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif // Z_classes_Tuple_HPP
|
||||
|
||||
87
projects/Zeta/API/Z/classes/XY.hpp
vendored
87
projects/Zeta/API/Z/classes/XY.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_XY_HPP
|
||||
@@ -31,12 +31,13 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
namespace Zeta {template <class t> struct XYZ;}
|
||||
|
||||
|
||||
namespace Zeta {template <class t> struct XY {
|
||||
t x, y;
|
||||
|
||||
|
||||
Z_INLINE XY() Z_NOTHROW Z_DEFAULTED({})
|
||||
|
||||
|
||||
Z_CT(CPP11) XY(t x_, t y_) Z_NOTHROW
|
||||
: x(x_), y(y_) {}
|
||||
|
||||
@@ -58,31 +59,31 @@ namespace Zeta {template <class t> struct XY {
|
||||
# endif
|
||||
|
||||
|
||||
Z_CT(CPP11) operator Boolean() const Z_NOTHROW
|
||||
Z_CT(CPP11) operator Bool() const Z_NOTHROW
|
||||
{return x != t(0) || y != t(0);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs.x == rhs.x && lhs.y == rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs.x != rhs.x || lhs.y != rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >=(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >=(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs.x >= rhs.x && lhs.y >= rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <=(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <=(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs.x <= rhs.x && lhs.y <= rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs.x > rhs.x && lhs.y > rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <(const XY &lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs.x < rhs.x && lhs.y < rhs.y;}
|
||||
|
||||
|
||||
@@ -102,27 +103,27 @@ namespace Zeta {template <class t> struct XY {
|
||||
{return XY(lhs.x / rhs.x, lhs.y / rhs.y);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(const XY &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(const XY &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x == rhs && lhs.y == rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const XY &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const XY &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x != rhs || lhs.y != rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >=(const XY &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >=(const XY &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x >= rhs && lhs.y >= rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <=(const XY &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <=(const XY &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x <= rhs && lhs.y <= rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >(const XY &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >(const XY &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x > rhs && lhs.y > rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <(const XY &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <(const XY &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x < rhs && lhs.y < rhs;}
|
||||
|
||||
|
||||
@@ -142,27 +143,27 @@ namespace Zeta {template <class t> struct XY {
|
||||
{return XY(lhs.x / rhs, lhs.y / rhs);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(t lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(t lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs == rhs.x && lhs == rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(t lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(t lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs != rhs.x || lhs != rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >=(t lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >=(t lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs >= rhs.x && lhs >= rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <=(t lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <=(t lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs <= rhs.x && lhs <= rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >(t lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >(t lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs > rhs.x && lhs > rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <(t lhs, const XY &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <(t lhs, const XY &rhs) Z_NOTHROW
|
||||
{return lhs < rhs.x && lhs < rhs.y;}
|
||||
|
||||
|
||||
@@ -232,7 +233,7 @@ namespace Zeta {template <class t> struct XY {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_zero() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_zero() const Z_NOTHROW
|
||||
{return x == t(0) || y == t(0);}
|
||||
|
||||
|
||||
@@ -256,7 +257,7 @@ namespace Zeta {template <class t> struct XY {
|
||||
{return x + y;}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_zero() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_zero() const Z_NOTHROW
|
||||
{return x == t(0) && y == t(0);}
|
||||
|
||||
|
||||
@@ -278,16 +279,15 @@ namespace Zeta {template <class t> struct XY {
|
||||
|
||||
// MARK: - Signed
|
||||
|
||||
|
||||
Z_CT(CPP11) XY absolute() const Z_NOTHROW
|
||||
{return XY(Zeta::absolute<t>(x), Zeta::absolute<t>(y));}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_negative() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_negative() const Z_NOTHROW
|
||||
{return x < t(0) || y < t(0);}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_negative() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_negative() const Z_NOTHROW
|
||||
{return x < t(0) && y < t(0);}
|
||||
|
||||
|
||||
@@ -297,31 +297,29 @@ namespace Zeta {template <class t> struct XY {
|
||||
|
||||
// MARK: - Integer
|
||||
|
||||
|
||||
// Z_CT(CPP11) Boolean is_perpendicular(const XY &other) const Z_NOTHROW
|
||||
// Z_CT(CPP11) Bool is_perpendicular(const XY &other) const Z_NOTHROW
|
||||
// {return !Zeta::absolute<t>(dot_product(other));}
|
||||
|
||||
|
||||
// MARK: - Real
|
||||
|
||||
|
||||
Z_CT(CPP11) XY clamp_01() const Z_NOTHROW
|
||||
{return XY(Zeta::clamp_01<t>(x), Zeta::clamp_01<t>(y));}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_almost_zero() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_almost_zero() const Z_NOTHROW
|
||||
{return Zeta::is_almost_zero<t>(x) || Zeta::is_almost_zero<t>(y);}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_finite() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_finite() const Z_NOTHROW
|
||||
{return Zeta::is_finite<t>(x) || Zeta::is_finite<t>(y);}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_infinity() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_infinity() const Z_NOTHROW
|
||||
{return Zeta::is_infinity<t>(x) || Zeta::is_infinity<t>(y);}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_nan() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_nan() const Z_NOTHROW
|
||||
{return Zeta::is_nan<t>(x) || Zeta::is_nan<t>(y);}
|
||||
|
||||
|
||||
@@ -333,30 +331,30 @@ namespace Zeta {template <class t> struct XY {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_almost_equal(const XY &other) const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_almost_equal(const XY &other) const Z_NOTHROW
|
||||
{
|
||||
return Zeta::are_almost_equal<t>(x, other.x) &&
|
||||
Zeta::are_almost_equal<t>(y, other.y);
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_almost_zero() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_almost_zero() const Z_NOTHROW
|
||||
{return Zeta::is_almost_zero<t>(x) && Zeta::is_almost_zero<t>(y);}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_finite() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_finite() const Z_NOTHROW
|
||||
{return Zeta::is_finite<t>(x) && Zeta::is_finite<t>(y);}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_infinity() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_infinity() const Z_NOTHROW
|
||||
{return Zeta::is_infinity<t>(x) && Zeta::is_infinity<t>(y);}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_nan() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_nan() const Z_NOTHROW
|
||||
{return Zeta::is_nan<t>(x) && Zeta::is_nan<t>(y);}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_perpendicular(const XY &other) const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_perpendicular(const XY &other) const Z_NOTHROW
|
||||
{return Zeta::absolute<t>(dot_product(other)) <= Type<t>::epsilon();}
|
||||
|
||||
|
||||
@@ -373,7 +371,6 @@ namespace Zeta {template <class t> struct XY {
|
||||
|
||||
|
||||
# if defined(Z_WITH_CORE_FOUNDATION) || defined(Z_WITH_FOUNDATION)
|
||||
|
||||
# define Z_z_APPLE_CONSTRUCTORS(Prefix) \
|
||||
\
|
||||
Z_CT(CPP11) XY(const Prefix##Point &point) Z_NOTHROW \
|
||||
@@ -385,7 +382,6 @@ namespace Zeta {template <class t> struct XY {
|
||||
|
||||
|
||||
# if Z_DIALECT_HAS(CPP11, COPY_LIST_INITIALIZATION)
|
||||
|
||||
# define Z_z_APPLE_OPERATORS(Prefix) \
|
||||
\
|
||||
Z_CT(CPP11) operator Prefix##Point() const Z_NOTHROW \
|
||||
@@ -399,6 +395,7 @@ namespace Zeta {template <class t> struct XY {
|
||||
Z_CT(CPP11) operator Prefix##Rect() const Z_NOTHROW \
|
||||
{return {{0.0, 0.0}, {CGFloat(x), CGFloat(y)}};}
|
||||
|
||||
|
||||
# else
|
||||
# define Z_z_APPLE_OPERATORS(Prefix) \
|
||||
\
|
||||
@@ -441,12 +438,10 @@ namespace Zeta {template <class t> struct XY {
|
||||
|
||||
# undef Z_z_APPLE_CONSTRUCTORS
|
||||
# undef Z_z_APPLE_OPERATORS
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
# ifdef Z_WITH_COCOS2D_X
|
||||
|
||||
Z_CT(CPP11) XY(const cocos2d::Vec2 &point) Z_NOTHROW
|
||||
: x(point.x), y(point.y) {}
|
||||
|
||||
@@ -465,12 +460,10 @@ namespace Zeta {template <class t> struct XY {
|
||||
|
||||
Z_INLINE operator cocos2d::Rect() const Z_NOTHROW
|
||||
{return cocos2d::Rect(0.0f, 0.0f, float(x), float(y));}
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
# ifdef Z_WITH_QT
|
||||
|
||||
Z_CT(CPP11) XY(const QPoint &point) Z_NOTHROW
|
||||
: x(t(point.x())), y(t(point.y())) {}
|
||||
|
||||
@@ -489,11 +482,11 @@ namespace Zeta {template <class t> struct XY {
|
||||
|
||||
Z_CT(CPP11) operator QRect() const Z_NOTHROW
|
||||
{return QRect(0, 0, int(x), int(y));}
|
||||
|
||||
# endif
|
||||
};}
|
||||
|
||||
|
||||
};}
|
||||
|
||||
#ifndef Z_classes_XYZ_HPP
|
||||
# include <Z/classes/XYZ.hpp>
|
||||
#endif
|
||||
|
||||
103
projects/Zeta/API/Z/classes/XYZ.hpp
vendored
103
projects/Zeta/API/Z/classes/XYZ.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_classes_XYZ_HPP
|
||||
@@ -13,13 +13,13 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
# include <Z/classes/XY.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
namespace Zeta {template <class t> struct XYZ {
|
||||
t x, y, z;
|
||||
|
||||
|
||||
Z_INLINE XYZ() Z_NOTHROW Z_DEFAULTED({})
|
||||
|
||||
|
||||
Z_CT(CPP11) XYZ(t x_, t y_, t z_) Z_NOTHROW
|
||||
: x(x_), y(y_), z(z_) {}
|
||||
|
||||
@@ -53,31 +53,31 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
# endif
|
||||
|
||||
|
||||
Z_CT(CPP11) operator Boolean() const Z_NOTHROW
|
||||
Z_CT(CPP11) operator Bool() const Z_NOTHROW
|
||||
{return x != t(0) || y != t(0) || z != t(0);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x != rhs.x || lhs.y != rhs.y || lhs.z != rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >=(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >=(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x >= rhs.x && lhs.y >= rhs.y && lhs.z >= rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <=(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <=(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x <= rhs.x && lhs.y <= rhs.y && lhs.z <= rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x > rhs.x && lhs.y > rhs.y && lhs.z > rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x < rhs.x && lhs.y < rhs.y && lhs.z < rhs.z;}
|
||||
|
||||
|
||||
@@ -97,27 +97,27 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
{return XYZ(lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x == rhs && lhs.y == rhs && lhs.z == rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x != rhs || lhs.y != rhs || lhs.z != rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >=(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >=(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x >= rhs && lhs.y >= rhs && lhs.z >= rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <=(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <=(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x <= rhs && lhs.y <= rhs && lhs.z <= rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x > rhs && lhs.y > rhs && lhs.z > rhs;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <(const XYZ &lhs, t rhs) Z_NOTHROW
|
||||
{return lhs.x < rhs && lhs.y < rhs && lhs.z < rhs;}
|
||||
|
||||
|
||||
@@ -137,27 +137,27 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
{return XYZ(lhs.x / rhs, lhs.y / rhs, lhs.z / rhs);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs == rhs.x && lhs == rhs.y && lhs == rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs != rhs.x || lhs != rhs.y || lhs != rhs.y;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >=(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >=(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs >= rhs.x && lhs >= rhs.y && lhs >= rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <=(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <=(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs <= rhs.x && lhs <= rhs.y && lhs <= rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs > rhs.x && lhs > rhs.y && lhs > rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <(t lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs < rhs.x && lhs < rhs.y && lhs < rhs.z;}
|
||||
|
||||
|
||||
@@ -169,27 +169,27 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
{return XYZ(lhs * rhs.x, lhs * rhs.y, lhs * rhs.z);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
{return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == t(0);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
{return lhs.x != rhs.x || lhs.y != rhs.y || lhs.z != t(0);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >=(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >=(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
{return lhs.x >= rhs.x && lhs.y >= rhs.y && lhs.z >= t(0);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <=(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <=(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
{return lhs.x <= rhs.x && lhs.y <= rhs.y && lhs.z <= t(0);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
{return lhs.x > rhs.x && lhs.y > rhs.y && lhs.z > t(0);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
|
||||
{return lhs.x < rhs.x && lhs.y < rhs.y && lhs.z < t(0);}
|
||||
|
||||
|
||||
@@ -205,27 +205,27 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
{return XYZ(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z, t(0));}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator ==(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator ==(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x == rhs.x && lhs.y == rhs.y && rhs.z == t(0);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator !=(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator !=(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x != rhs.x || lhs.y != rhs.y || rhs.z != t(0);}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >=(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >=(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x >= rhs.x && lhs.y >= rhs.y && t(0) >= rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <=(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <=(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x <= rhs.x && lhs.y <= rhs.y && t(0) <= rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator >(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator >(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x > rhs.x && lhs.y > rhs.y && t(0) > rhs.z;}
|
||||
|
||||
|
||||
friend Z_CT(CPP11) Boolean operator <(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
friend Z_CT(CPP11) Bool operator <(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
|
||||
{return lhs.x < rhs.x && lhs.y < rhs.y && t(0) < rhs.z;}
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
{return XYZ(t(0));} /* TODO */
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_zero() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_zero() const Z_NOTHROW
|
||||
{return x == t(0) || y == t(0) || z == t(0);}
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
{return x + y + z;}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_zero() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_zero() const Z_NOTHROW
|
||||
{return x == t(0) && y == t(0) && z == t(0);}
|
||||
|
||||
|
||||
@@ -378,7 +378,6 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
|
||||
// MARK: - Signed
|
||||
|
||||
|
||||
Z_CT(CPP11) XYZ absolute() const Z_NOTHROW
|
||||
{
|
||||
return XYZ(
|
||||
@@ -388,11 +387,11 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_negative() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_negative() const Z_NOTHROW
|
||||
{return x < t(0) || y < t(0) || z < t(0);}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_negative() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_negative() const Z_NOTHROW
|
||||
{return x < t(0) && y < t(0) && z < t(0);}
|
||||
|
||||
|
||||
@@ -402,14 +401,12 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
|
||||
// MARK: - Integer
|
||||
|
||||
|
||||
//Z_CT(CPP11) Boolean is_perpendicular(const XYZ &other) const
|
||||
//Z_CT(CPP11) Bool is_perpendicular(const XYZ &other) const
|
||||
// {return !Zeta::absolute<t>(dot_product(other));}
|
||||
|
||||
|
||||
// MARK: - Real
|
||||
|
||||
|
||||
Z_CT(CPP11) XYZ clamp_01() const Z_NOTHROW
|
||||
{
|
||||
return XYZ(
|
||||
@@ -419,7 +416,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_almost_zero() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_almost_zero() const Z_NOTHROW
|
||||
{
|
||||
return Zeta::is_almost_zero<t>(x) ||
|
||||
Zeta::is_almost_zero<t>(y) ||
|
||||
@@ -427,7 +424,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_finite() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_finite() const Z_NOTHROW
|
||||
{
|
||||
return Zeta::is_finite<t>(x) ||
|
||||
Zeta::is_finite<t>(y) ||
|
||||
@@ -435,7 +432,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_infinity() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_infinity() const Z_NOTHROW
|
||||
{
|
||||
return Zeta::is_infinity<t>(x) ||
|
||||
Zeta::is_infinity<t>(y) ||
|
||||
@@ -443,7 +440,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean has_nan() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool has_nan() const Z_NOTHROW
|
||||
{
|
||||
return Zeta::is_nan<t>(x) ||
|
||||
Zeta::is_nan<t>(y) ||
|
||||
@@ -460,7 +457,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_almost_equal(const XYZ &other) const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_almost_equal(const XYZ &other) const Z_NOTHROW
|
||||
{
|
||||
return Zeta::are_almost_equal<t>(x, other.x) &&
|
||||
Zeta::are_almost_equal<t>(y, other.y) &&
|
||||
@@ -468,7 +465,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_almost_zero() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_almost_zero() const Z_NOTHROW
|
||||
{
|
||||
return Zeta::is_almost_zero<t>(x) &&
|
||||
Zeta::is_almost_zero<t>(y) &&
|
||||
@@ -476,7 +473,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_finite() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_finite() const Z_NOTHROW
|
||||
{
|
||||
return Zeta::is_finite<t>(x) &&
|
||||
Zeta::is_finite<t>(y) &&
|
||||
@@ -484,7 +481,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_infinity() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_infinity() const Z_NOTHROW
|
||||
{
|
||||
return Zeta::is_infinity<t>(x) &&
|
||||
Zeta::is_infinity<t>(y) &&
|
||||
@@ -492,7 +489,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_nan() const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_nan() const Z_NOTHROW
|
||||
{
|
||||
return Zeta::is_nan<t>(x) &&
|
||||
Zeta::is_nan<t>(y) &&
|
||||
@@ -500,7 +497,7 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
}
|
||||
|
||||
|
||||
Z_CT(CPP11) Boolean is_perpendicular(const XYZ &other) const Z_NOTHROW
|
||||
Z_CT(CPP11) Bool is_perpendicular(const XYZ &other) const Z_NOTHROW
|
||||
{return Zeta::absolute<t>(dot_product(other)) <= Type<t>::epsilon();}
|
||||
|
||||
|
||||
@@ -515,8 +512,8 @@ namespace Zeta {template <class t> struct XYZ {
|
||||
|
||||
Z_CT(CPP11) XYZ reciprocal() const Z_NOTHROW
|
||||
{return XYZ(t(1) / x, t(1) / y, t(1) / z);}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
};}
|
||||
|
||||
#endif // Z_classes_XYZ_HPP
|
||||
|
||||
2
projects/Zeta/API/Z/constants/boolean.h
vendored
2
projects/Zeta/API/Z/constants/boolean.h
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_constants_boolean_H
|
||||
|
||||
2
projects/Zeta/API/Z/constants/build.hpp
vendored
2
projects/Zeta/API/Z/constants/build.hpp
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_constants_build_HPP
|
||||
|
||||
9
projects/Zeta/API/Z/constants/numbers.h
vendored
9
projects/Zeta/API/Z/constants/numbers.h
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_constants_numbers_H
|
||||
@@ -962,7 +962,10 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
/* MARK: - Integer numbers */
|
||||
|
||||
#define Z_CARMACK_NUMBER 0x5F3759DF
|
||||
#define Z_LOMONT_NUMBER 0x5F375A86
|
||||
#define Z_CARMACK_NUMBER 0x5F3759DF
|
||||
#define Z_LOMONT_NUMBER 0x5F375A86
|
||||
|
||||
/* Kaprekar's constant */
|
||||
#define Z_KAPREKAR_CONSTANT 6174
|
||||
|
||||
#endif /* Z_constants_numbers_H */
|
||||
|
||||
15
projects/Zeta/API/Z/constants/pointer.h
vendored
15
projects/Zeta/API/Z/constants/pointer.h
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_constants_pointer_H
|
||||
@@ -13,15 +13,12 @@ Released under the terms of the GNU Lesser General Public License v3. */
|
||||
# undef Z_NULL
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
# include <Z/inspection/language.h>
|
||||
|
||||
# if Z_DIALECT_HAS_LITERAL(CPP11, NULLPTR)
|
||||
# define Z_NULL nullptr
|
||||
# else
|
||||
# define Z_NULL 0
|
||||
# endif
|
||||
#include <Z/inspection/language.h>
|
||||
|
||||
#if Z_DIALECT_HAS_LITERAL(CPP11, NULLPTR) || Z_DIALECT_HAS_LITERAL(C23, NULLPTR)
|
||||
# define Z_NULL nullptr
|
||||
#elif defined(__cplusplus)
|
||||
# define Z_NULL 0
|
||||
#else
|
||||
# define Z_NULL ((void *)0)
|
||||
#endif
|
||||
|
||||
2
projects/Zeta/API/Z/formats/archive/TAR.h
vendored
2
projects/Zeta/API/Z/formats/archive/TAR.h
vendored
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_archive_TAR_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_ASCII_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP437_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP737_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP775_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP850_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP852_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP855_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP857_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP858_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP860_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP861_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP862_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP863_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP864_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP865_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP866_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP869_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP872_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_character_set_DOS_CP874_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_data_model_I16LP32_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_data_model_ILP32_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_data_model_ILP64_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_data_model_IP16L32_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_data_model_LLP64_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_data_model_LP32_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_data_model_LP64_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_data_model_SILP64_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_floating_point_Brain_Floating_Point_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_floating_point_IBM_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|__ / | ___|___ ___|/ \
|
||||
/ /__| __| | | / - \
|
||||
/______|_____| |__| /__/ \__\
|
||||
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
|
||||
Copyright (C) 2006-2025 Manuel Sainz de Baranda y Goñi.
|
||||
Released under the terms of the GNU Lesser General Public License v3. */
|
||||
|
||||
#ifndef Z_formats_floating_point_IEEE_754_H
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user