Initial git setup

This commit is contained in:
Philip Smart
2026-03-24 22:22:37 +00:00
commit 21375f667b
445 changed files with 103481 additions and 0 deletions

7
.gitattributes vendored Normal file
View File

@@ -0,0 +1,7 @@
* linguist-vendored
*.asm linguist-vendored=false
*.c linguist-vendored=false
*.cpp linguist-vendored=false
*.pl linguist-vendored=false
*.sh linguist-vendored=false
*.vhd linguist-vendored=false

156
.gitignore vendored Normal file
View File

@@ -0,0 +1,156 @@
*.o.cmd
*.bin
**/build/**
c5_pin_model_dump.txt
_config.yml
.dm
*.dmp
docs
*.done
*.elf
.gradle
*.jdi
*.log
*.lss
Manuals/
*.map
.metadata
/.nb-gradle/
nohup.out
*.o
**/old/**
*/*/old/
*/old/
old/
old/**
**/output/**
*.out.sdc
*.pin
*.pold/*
../RC6502-Apple-1-Replica/
../RP2040USB2Serial/
../build_examples.sh
../build_p6502.sh.old
../build_pZ80.sh.old
../build_projects.sh
../build_zxspectrum.sh
../c
../cmake/
../cronrun.sh
../external/
../hello_uart.c
../memviewer/
../pico-examples/
../pico-extras/
../pico-sdk.983960/
../pico-sdk/
../pico_setup_on_rpi_linux.sh
Hunter-Adams-RP2040-Demos/
arduino-esp32.old/
circle/
hello_world/
old.tzpuPico/
p6502.old/
pico-emu-utils/
pico_extras_import_optional.cmake
pico_sdk_import.cmake
projects_auto_set_url.cmake
tusb_config.h
tzpuPico.claude1_fspi/
tzpuPico/.clang-format
tzpuPico/BASIC_2Z009.dsk
tzpuPico/BASIC_5Z008A.qd
tzpuPico/BASIC_5Z008A_RFS.qd
tzpuPico/MZ-2Z009-RFS.dsk
tzpuPico/MZ-2Z009.dsk
tzpuPico/MZ-2Z009E.dsk
tzpuPico/arduino-esp32/
tzpuPico/config.json
tzpuPico/esp32.ba/
tzpuPico/esp32/archive/
tzpuPico/esp32/filepack_3.23.tar.gz
tzpuPico/esp32/idf/
tzpuPico/esp32/idfcomponents/
tzpuPico/esp32/managed_components/
tzpuPico/esp32/release/
tzpuPico/esp32/versions/
tzpuPico/esp32/webfs/
tzpuPico/esp_littlefs/
tzpuPico/fw/
tzpuPico/gdb.txt
tzpuPico/memviewer/
tzpuPico/openocd_gdb_init.gdb
tzpuPico/src.bak/
tzpuPico/src/drivers/Sharp/QD.txt
tzpuPico/src/include/M6502.h
tzpuPico/src/include/M6502CPU.h
tzpuPico/src/model/Base6502/
tzpuPico/src/model/ESP-Bridge/
tzpuPico/src/model/SharpMZ/
tzpuPico/uf2/
versions/
zxspectrum.bad/
zxspectrum/
../tinyusb.orig/
../tinyusb/
.gitignore.swp
RC6502-Apple-1-Replica/
RP2040USB2Serial/
build_examples.sh
build_p6502.sh.old
build_pZ80.sh.old
build_projects.sh
build_zxspectrum.sh
c
cmake/
cronrun.sh
external/
hello_uart.c
memviewer/
pico-examples/
pico-extras/
pico-sdk.983960/
pico-sdk/
pico_setup_on_rpi_linux.sh
projects/CMakeLists.txt
projects/tzpuPico/.clang-format
projects/tzpuPico/.gdb.txt.swo
projects/tzpuPico/BASIC_2Z009.dsk
projects/tzpuPico/BASIC_5Z008A.qd
projects/tzpuPico/BASIC_5Z008A_RFS.qd
projects/tzpuPico/MZ-2Z009-RFS.dsk
projects/tzpuPico/MZ-2Z009.dsk
projects/tzpuPico/MZ-2Z009E.dsk
projects/tzpuPico/arduino-esp32/
projects/tzpuPico/config.json
projects/tzpuPico/esp32.ba/
projects/tzpuPico/esp32/archive/
projects/tzpuPico/esp32/filepack_3.23.tar.gz
projects/tzpuPico/esp32/idf/
projects/tzpuPico/esp32/idfcomponents/
projects/tzpuPico/esp32/managed_components/
projects/tzpuPico/esp32/release/
projects/tzpuPico/esp32/webfs/
projects/tzpuPico/esp_littlefs/
projects/tzpuPico/fw/
projects/tzpuPico/gdb.txt
projects/tzpuPico/memviewer/
projects/tzpuPico/openocd_gdb_init.gdb
projects/tzpuPico/pico_extras_import.cmake
projects/tzpuPico/src.bak/
projects/tzpuPico/src/M6502.c
projects/tzpuPico/src/M6502.pio
projects/tzpuPico/src/M6502CPU.c
projects/tzpuPico/src/drivers/Sharp/QD.txt
projects/tzpuPico/src/include/M6502.h
projects/tzpuPico/src/include/M6502CPU.h
projects/tzpuPico/src/model/Base6502/
projects/tzpuPico/src/model/ESP-Bridge/
projects/tzpuPico/src/model/SharpMZ/
projects/tzpuPico/uf2/
tinyusb.orig/
tinyusb/
projects/tzpuPico/esp32/main/include/assert.h
projects/tzpuPico/esp32/main/include/flash_ram.h
projects/tzpuPico/esp32/version.txt

125
build_tzpuPico.sh Executable file
View File

@@ -0,0 +1,125 @@
#!/bin/bash
export PICO_PATH=/dvlp/Projects/pico/
export PICO_SDK_PATH=${PICO_PATH}/pico-sdk/
export PICO_SDK_EXAMPLE_PATH=${PICO_PATH}/pico-examples/
export PICO_SDK_PROJECTS_PATH=${PICO_PATH}/projects/
export PICO_SDK_PROJECTS_PATH_PICO=${PICO_PATH}/projects/tzpuPico
export PICO_SDK_PROJECTS_PATH_PICOESP32=${PICO_PATH}/projects/tzpuPico/esp32
export NAS_DST=/srv2/build/
echo "****************************************************************************"
echo "* Building tzpuPico $1 "
echo "****************************************************************************"
echo ""
#echo "Reverting tiny_usb..."
#cd $PICO_SDK_PATH/lib/
#rm -fr tinyusb
#cp -pr tinyusb.orig tinyusb
OLDVERSION=$(cat ${PICO_SDK_PROJECTS_PATH_PICO}/version.txt)
NEWVERSION=$(perl -e "$(echo "print $(cat ${PICO_SDK_PROJECTS_PATH_PICO}/version.txt)+0.001")")
echo "Building tzpuPico..."
cd ${PICO_SDK_PROJECTS_PATH_PICO}/
echo "Backing up version (${OLDVERSION}) to ${PICO_SDK_PROJECTS_PATH}/versions/pz80_${OLDVERSION}_$(date +'%y%m%d%H%M').tar.gz..."
tar -cvzf ${PICO_SDK_PROJECTS_PATH}/versions/pz80_${OLDVERSION}_$(date +'%y%m%d%H%M').tar.gz \
src pico_sdk_import.cmake pico_extras_import.cmake version.txt CMakeLists.txt
if [[ $? != 0 ]]; then
echo "Backup failure!"
cd ${PICO_PATH}
exit 1
fi
# Ensure our versions of board etc are in the SDK.
cp ${PICO_PATH}/picoZ80.h.tmpl ${PICO_SDK_PATH}/src/boards/include/boards/picoZ80.h
# Prepare build directory.
rm -fr build
mkdir -p build
cd build
#cmake -DPICO_BOARD=pimoroni_pga2350 -DPICO_PLATFORM=rp2350-arm-s -DPICO_COPY_TO_RAM=0 ..
if [[ "$1" == "DEBUG" ]]; then
cmake -DCMAKE_BUILD_TYPE=Debug -DPICO_COPY_TO_RAM=0 -DPICO_PLATFORM=rp2350-arm-s -DPICO_BOARD=picoZ80 ..
else
cmake -DPICO_COPY_TO_RAM=0 -DPICO_PLATFORM=rp2350-arm-s -DPICO_BOARD=picoZ80 ..
fi
if [[ $? != 0 ]]; then
echo "CMAKE failure!"
cd ${PICO_PATH}
exit 2
fi
make clean
#make VERBOSE=1 -j4
make -j4
if [[ $? != 0 ]]; then
echo "Build failure!"
cd ${PICO_PATH}
exit 3
fi
# Update to next version as this version has built without error.
echo ${NEWVERSION} > ${PICO_SDK_PROJECTS_PATH_PICO}/version.txt
cd ..
echo "Copying binaries to project dir..."
echo ""
mkdir -p ${PICO_SDK_PROJECTS_PATH_PICO}/fw/uf2/
mkdir -p ${PICO_SDK_PROJECTS_PATH_PICO}/fw/bin/
for f in $(find ${PICO_SDK_PROJECTS_PATH_PICO}/src/model/* -maxdepth 0 -type d)
do
FILE=$(basename $f)
#VERSION=$(cat ${f}/version.txt)
VERSION=$(perl -e "$(echo "print $(cat ${f}/version.txt)-0.001")")
echo "Target: ${FILE}"
if [ -f ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}.uf2 ]; then
cp ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}.uf2 ${PICO_SDK_PROJECTS_PATH_PICO}/fw/uf2/${FILE}_${VERSION}.uf2
fi
if [ -f ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}.bin ]; then
cp ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}.bin ${PICO_SDK_PROJECTS_PATH_PICO}/fw/bin/${FILE}_${VERSION}.bin
else
for vf in $(ls -1 ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}*.bin 2>/dev/null)
do
VARIANTNAME=$(basename ${vf} .bin | sed "s/${FILE}_//g")
cp ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}_${VARIANTNAME}.bin ${PICO_SDK_PROJECTS_PATH_PICO}/fw/bin/${FILE}_${VARIANTNAME}_${VERSION}.bin
done
fi
# if [ -f ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}.uf2 ]; then
# ${PICO_SDK_PROJECTS_PATH_PICO}/build/_deps/picotool/picotool info -a ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}.uf2
# fi
if [ -f ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}.uf2 ]; then
cp ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}.uf2 ${NAS_DST}/${FILE}_${VERSION}.uf2
fi
if [ -f ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}.bin ]; then
cp ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}.bin ${NAS_DST}/${FILE}_${VERSION}.bin
else
for vf in $(ls -1 ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}*.bin 2>/dev/null)
do
VARIANTNAME=$(basename ${vf} .bin | sed "s/${FILE}_//g")
cp ${PICO_SDK_PROJECTS_PATH_PICO}/build/bin/model/${FILE}/${FILE}_${VARIANTNAME}.bin ${NAS_DST}/${FILE}_${VARIANTNAME}_${VERSION}.bin
done
fi
done
ls -lart ${PICO_SDK_PROJECTS_PATH_PICO}/fw/uf2/ ${PICO_SDK_PROJECTS_PATH_PICO}/fw/bin/
cp ${PICO_SDK_PROJECTS_PATH_PICO}/fw/uf2/* /srv2/build/
cp ${PICO_SDK_PROJECTS_PATH_PICO}/fw/bin/* /srv2/build/
mkdir -p ${PICO_SDK_PROJECTS_PATH_PICO}/fw/uf2.bak
mkdir -p ${PICO_SDK_PROJECTS_PATH_PICO}/fw/bin.bak
mv ${PICO_SDK_PROJECTS_PATH_PICO}/fw/uf2/* ${PICO_SDK_PROJECTS_PATH_PICO}/fw/uf2.bak/
mv ${PICO_SDK_PROJECTS_PATH_PICO}/fw/bin/* ${PICO_SDK_PROJECTS_PATH_PICO}/fw/bin.bak/
if [[ "$1" = "ALL" ]]; then
cd ${PICO_SDK_PROJECTS_PATH_PICOESP32}/
docker run --rm --privileged --volume /dev:/dev --volume /sys:/sys:ro --volume /dev/bus/usb:/dev/bus/usb -v $PWD:/project -w /project -it espressif/idf:release-v5.4 idf.py clean build
fi
# Save the esp32 backups too, out of the main dev tree.
mv ${PICO_SDK_PROJECTS_PATH_PICOESP32}/versions/* ${PICO_SDK_PROJECTS_PATH}/versions/
rsync -ah ${PICO_SDK_PROJECTS_PATH}/versions/ /srv2/dvlp/versions/ 2>/dev/null
echo ""
echo "****************************************************************************"
echo "* End of tzpuPico build... *"
echo "****************************************************************************"

53
get_and_build_sdk.sh Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/bash
export PICO_PATH=/dvlp/Projects/pico/
export PICO_SDK_PATH=${PICO_PATH}/pico-sdk/
export PICO_SDK_EXAMPLE_PATH=${PICO_PATH}/pico-examples/
export PICO_SDK_PROJECTS_PATH=${PICO_PATH}/projects/
cd ${PICO_PATH}
#git clone https://github.com/raspberrypi/pico-sdk.git --branch master
mv pico-sdk pico-sdk.$$
git clone https://github.com/raspberrypi/pico-sdk.git --branch develop
mkdir -p $PICO_SDK_PATH/lib/
cd $PICO_SDK_PATH/lib/
#mv tinyusb tinyusb.orig.$$.2
#git clone https://github.com/fruit-bat/tinyusb.git
#cd tinyusb
#git checkout hid_micro_parser
# Use a known version of tinyusb, the pico build tools will use this.
#cp -r ${PICO_PATH}/tinyusb.orig ${PICO_SDK_PATH}/lib/tinyusb.orig
cd ${PICO_SDK_PATH}
git submodule update --init
git pull
git submodule update
cd ${PICO_PATH}
git clone https://github.com/raspberrypi/pico-examples.git --branch master
cd ${PICO_SDK_EXAMPLE_PATH}
git submodule update --init
git pull
git submodule update
cd ${PICO_SDK_PATH}
rm -fr build
mkdir -p build
cd build
cmake -DPICO_BOARD=pimoroni_pga2350 -DPICO_PLATFORM=rp2350-arm-s -DPICO_SDK_PATH=${PICO_SDK_PATH} ..
make
#cd ${PICO_SDK_EXAMPLE_PATH}
#mkdir -p build
#cd build
#cmake -DPICO_BOARD=pico2 -DPICO_PLATFORM=rp2350-arm-s -DPICO_SDK_PATH=${PICO_SDK_PATH}..
#make
#cd ..
#cd ${PICO_SDK_PROJECTS_PATH}
#mkdir -p build
#cd build
#cmake ..
#make
#cd ..

99
picoZ80.h.tmpl vendored Normal file
View File

@@ -0,0 +1,99 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// This header may be included by other board headers as "boards/pimoroni_pga2350.h"
#ifndef _BOARDS_PICOZ80_H
#define _BOARDS_PICOZ80_H
pico_board_cmake_set(PICO_PLATFORM, rp2350)
// For board detection
#define PICOZ80
#define PICOZ80_16MB
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- BOARD SPECIFIC ---
#define PICOZ80_PSRAM_CS_PIN 47
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
// --- LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 25
#endif
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 16
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 17
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
//#define PICO_NO_RAM_VECTOR_TABLE 1
//#define PICO_TIME_DEFAULT_ALARM_POOL_DISABLED 1
//#define PICO_TIME_DEFAULT_ALARM_POOL_HARDWARE_ALARM_NUM 4
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 4
#endif
pico_board_cmake_set_default(PICO_FLASH_SIZE_BYTES, (16 * 1024 * 1024))
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
// no PICO_SMPS_MODE_PIN
// no PICO_VBUS_PIN
// no PICO_VSYS_PIN
pico_board_cmake_set_default(PICO_RP2350_A2_SUPPORTED, 1)
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
#endif

18
projects/Z80/.editorconfig vendored Normal file
View File

@@ -0,0 +1,18 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 8
indent_style = tab
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.rc]
charset = utf-8-bom
[*.{cff,yml}]
indent_size = 2
indent_style = space

5
projects/Z80/.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
buy_me_a_coffee: redcode
github: redcode
ko_fi: redcode
liberapay: redcode
patreon: redcode

View File

@@ -0,0 +1,11 @@
_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.
By submitting this 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.

View File

@@ -0,0 +1,95 @@
name: Build and test library
on:
push:
paths:
- '.github/workflows/build-and-test-library.yml'
- 'API/**'
- 'CMake/FindZeta.cmake'
- 'sources/*.c'
- 'sources/*.rc.in'
- 'support/*.sha3-512'
- 'CMakeLists.txt'
pull_request:
paths:
- '.github/workflows/build-and-test-library.yml'
- 'API/**'
- 'CMake/FindZeta.cmake'
- 'sources/*.c'
- 'sources/*.rc.in'
- 'support/*.sha3-512'
- 'CMakeLists.txt'
env:
ZETA_TARBALL_URL: 'http://zxe.io/software/Zeta/download/Zeta-latest.tar.xz'
BUILD_SHARED_LIBS: YES
CMAKE_BUILD_TYPE: Release
Z80_FETCH_TEST_FILES: YES
Z80_NOSTDLIB_FLAGS: Auto
Z80_WITH_CMAKE_SUPPORT: NO
Z80_WITH_HTML_DOCUMENTATION: NO
Z80_WITH_PDF_DOCUMENTATION: NO
Z80_WITH_PKGCONFIG_SUPPORT: NO
Z80_WITH_STANDARD_DOCUMENTS: NO
Z80_WITH_TESTS: YES
Z80_WITH_EXECUTE: YES
Z80_WITH_FULL_IM0: YES
Z80_WITH_IM0_RETX_NOTIFICATIONS: YES
Z80_WITH_Q: YES
Z80_WITH_SPECIAL_RESET: YES
Z80_WITH_UNOFFICIAL_RETI: NO
Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG: YES
jobs:
build-and-test-library:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- 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
- 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
- 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}}"
- name: Build
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

View File

@@ -0,0 +1,70 @@
name: Build documentation
on:
push:
paths:
- '.github/workflows/build-documentation.yml'
- 'API/**'
- 'CMake/**'
- 'documentation/**'
- 'CMakeLists.txt'
pull_request:
paths:
- '.github/workflows/build-documentation.yml'
- 'API/**'
- 'CMake/**'
- 'documentation/**'
- 'CMakeLists.txt'
env:
ZETA_TARBALL_URL: 'http://zxe.io/software/Zeta/download/Zeta-latest.tar.xz'
BUILD_SHARED_LIBS: NO
CMAKE_BUILD_TYPE: Release
Z80_FETCH_TEST_FILES: NO
Z80_WITH_CMAKE_SUPPORT: 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
jobs:
build-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get -y install doxygen
sudo apt-get -y install texlive-full
pip install --user sphinx
pip install --user breathe
- 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
- 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}}"
- name: Build HTML documentation
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

5
projects/Z80/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.directory
.DS_Store
Thumbs.db
/build/
/CMakeLists.txt.user

4
projects/Z80/.vimrc vendored Normal file
View File

@@ -0,0 +1,4 @@
set noexpandtab
set shiftwidth=8
set tabstop=8
autocmd BufWritePre * %s/\s\+$//e

904
projects/Z80/API/Z80.h vendored Normal file
View File

@@ -0,0 +1,904 @@
/* Z80 API
______ ______ ______
/\___ \/\ __ \\ __ \
____ \/__/ /\_\ __ \\ \/\ \ ________________________________________________
| /\_____\\_____\\_____\ |
| Zilog \/_____//_____//_____/ CPU Emulator |
| Copyright (C) 1999-2024 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 |
| the Free Software Foundation, either version 3 of the License, or (at your |
| option) any later version. |
| |
| This emulator is distributed in the hope that it will be useful, but |
| WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
| License for more details. |
| |
| You should have received a copy of the GNU Lesser General Public License |
| along with this emulator. If not, see <http://www.gnu.org/licenses/>. |
| |
'=============================================================================*/
#ifndef Z80_H
/** @file Z80.h
* @brief Zilog Z80 CPU emulator.
*
* @details The Z80 library implements a fast, small and accurate emulator
* 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
* @author Manuel Sainz de Baranda y Goñi */
#ifdef Z80_DEPENDENCIES_HEADER
# define Z80_H
# include Z80_DEPENDENCIES_HEADER
# undef Z80_H
#else
# include <Z/macros/language.h>
# include <Z/types/bitwise.h>
#endif
#ifndef Z80_API
# if defined(Z80_STATIC) || defined(__DOXYGEN__)
# define Z80_API
# else
# define Z80_API Z_API_IMPORT
# endif
#endif
/** @brief Major version number of the Z80 library. */
#define Z80_LIBRARY_VERSION_MAJOR 0
/** @brief Minor version number of the Z80 library. */
#define Z80_LIBRARY_VERSION_MINOR 2
/** @brief Micro version number of the Z80 library. */
#define Z80_LIBRARY_VERSION_MICRO 0
/** @brief String literal with the version number of the Z80 library. */
#define Z80_LIBRARY_VERSION_STRING "0.2"
/** @brief Maximum number of clock cycles that <tt>@ref z80_run</tt> and
* <tt>@ref z80_execute</tt> can emulate. */
#define Z80_MAXIMUM_CYCLES (Z_USIZE_MAXIMUM - Z_USIZE(30))
/** @brief Maximum number of clock cycles that <tt>@ref z80_run</tt> will
* emulate if instructed to execute 1 clock cycle.
*
* This is the number of clock cycles it takes to execute the longest
* instruction through interrupt mode 0, not counting the M-cycle used to fetch
* a @c 0xDD or @c 0xFD prefix. For <tt>@ref z80_execute</tt>, subtract 4 clock
* cycles from this value. */
#define Z80_MAXIMUM_CYCLES_PER_STEP 25
/** @brief Minimum number of clock cycles that <tt>@ref z80_run</tt> or
* <tt>@ref z80_execute</tt> will emulate if instructed to execute 1 clock
* cycle. */
#define Z80_MINIMUM_CYCLES_PER_STEP 4
/** @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
#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. */
#define Z80_HF 16 /**< @brief Bitmask of the Z80 H flag. */
#define Z80_XF 8 /**< @brief Bitmask of the Z80 X flag. */
#define Z80_PF 4 /**< @brief Bitmask of the Z80 P/V flag. */
#define Z80_NF 2 /**< @brief Bitmask of the Z80 N flag. */
#define Z80_CF 1 /**< @brief Bitmask of the Z80 C flag. */
typedef struct Z80 Z80;
/** @brief Defines a pointer to a <tt>@ref Z80</tt> callback function invoked to
* perform a read operation.
*
* @param context The <tt>@ref Z80::context</tt> of the calling object.
* @param address The memory address or I/O port to read from.
* @return The byte read. */
typedef zuint8 (* Z80Read)(void *context, zuint16 address);
/** @brief Defines a pointer to a <tt>@ref Z80</tt> callback function invoked to
* perform a write operation.
*
* @param context The <tt>@ref Z80::context</tt> of the calling object.
* @param address The memory address or I/O port to write to.
* @param value The byte to write. */
typedef void (* Z80Write)(void *context, zuint16 address, zuint8 value);
/** @brief Defines a pointer to a <tt>@ref Z80</tt> callback function invoked to
* notify a signal change on the HALT line.
*
* @param context The <tt>@ref Z80::context</tt> of the calling object.
* @param signal A code specifying the type of signal change. */
typedef void (* Z80Halt)(void *context, zuint8 signal);
/** @brief Defines a pointer to a <tt>@ref Z80</tt> callback function invoked to
* notify an event.
*
* @param context The <tt>@ref Z80::context</tt> of the calling object. */
typedef void (* Z80Notify)(void *context);
/** @brief Defines a pointer to a <tt>@ref Z80</tt> callback function invoked to
* delegate the emulation of an illegal instruction.
*
* @param cpu The calling object.
* @param opcode The illegal opcode.
* @return The number of clock cycles consumed by the instruction. */
typedef zuint8 (* Z80Illegal)(Z80 *cpu, zuint8 opcode);
/** @struct Z80 Z80.h
*
* @brief A Z80 CPU emulator.
*
* A @c Z80 object contains the state of an emulated Z80 CPU, pointers to
* callback functions that interconnect the emulator with the external logic
* and a context that is passed to these functions.
*
* Because no constructor function is provided, it is mandatory to directly
* initialize all callback pointers and <tt>@ref Z80::options</tt> before using
* an object of this type. Optional callbacks must be set to @c Z_NULL when not
* in use. */
struct Z80 {
/** @brief Number of clock cycles already executed. */
zusize cycles;
/** @brief Maximum number of clock cycles to be executed. */
zusize cycle_limit;
/** @brief Pointer to pass as the first argument to all callback
* functions.
*
* This member is intended to hold a reference to the context to which
* the object belongs. It is safe not to initialize it when this is not
* necessary. */
void *context;
/** @brief Invoked to perform an opcode fetch.
*
* This callback indicates the beginning of an opcode fetch M-cycle.
* The function must return the byte located at the memory address
* specified by the second argument. */
Z80Read fetch_opcode;
/** @brief Invoked to perform a memory read on instruction data.
*
* This callback indicates the beginning of a memory read M-cycle
* during which the CPU fetches one byte of instruction data (i.e., one
* byte of the instruction that is neither a prefix nor an opcode). The
* function must return the byte located at the memory address
* specified by the second argument. */
Z80Read fetch;
/** @brief Invoked to perform a memory read.
*
* This callback indicates the beginning of a memory read M-cycle. The
* function must return the byte located at the memory address
* specified by the second argument. */
Z80Read read;
/** @brief Invoked to perform a memory write.
*
* This callback indicates the beginning of a memory write M-cycle. The
* function must write the third argument into the memory location
* specified by the second argument. */
Z80Write write;
/** @brief Invoked to perform an I/O port read.
*
* This callback indicates the beginning of an I/O read M-cycle. The
* function must return the byte read from the I/O port specified by
* the second argument. */
Z80Read in;
/** @brief Invoked to perform an I/O port write.
*
* This callback indicates the beginning of an I/O write M-cycle. The
* function must write the third argument to the I/O port specified by
* the second argument. */
Z80Write out;
/** @brief Invoked to notify a signal change on the HALT line.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. Its invocation is always deferred until the next emulation step
* so that the emulator can abort the signal change if any invalidating
* condition occurs, such as the acceptance of an interrupt during the
* execution of a @c halt instruction.
*
* The second parameter of the function specifies the type of signal
* change and can only contain a boolean value if the Z80 library has
* not been built with special RESET support:
*
* - @c 1 indicates that the HALT line is going low during the last
* clock cycle of a @c halt instruction, which means that the CPU
* is entering the HALT state.
*
* - @c 0 indicates that the HALT line is going high during the last
* clock cycle of an internal NOP executed during the HALT state,
* i.e., the CPU is exiting the HALT state due to an interrupt or
* normal RESET.
*
* If the library has been built with special RESET support, the values
* <tt>@ref Z80_HALT_EXIT_EARLY</tt> and <tt>@ref Z80_HALT_CANCEL</tt>
* are also possible for the second parameter. */
Z80Halt halt;
/** @brief Invoked to perform an opcode fetch that corresponds to an
* internal NOP.
*
* This callback indicates the beginning of an opcode fetch M-cycle of
* 4 clock cycles that is generated in the following two cases:
*
* - During the HALT state, the CPU repeatedly executes an internal NOP
* that fetches the next opcode after the @c halt instruction without
* incrementing the PC register. This opcode is read again and again
* until an exit condition occurs (i.e., NMI, INT or RESET).
*
* - After detecting a special RESET signal, the CPU completes the
* ongoing instruction or interrupt response and then zeroes the PC
* register during the first clock cycle of the next M1 cycle. If no
* interrupt has been accepted at the end of the instruction or
* interrupt response, the CPU produces an internal NOP to allow for
* the fetch-execute overlap to take place, during which it fetches
* the next opcode and zeroes PC.
*
* This callback is optional but note that setting it to @c Z_NULL is
* equivalent to enabling <tt>@ref Z80_OPTION_HALT_SKIP</tt>. */
Z80Read nop;
/** @brief Invoked to perform an opcode fetch that corresponds to a
* non-maskable interrupt acknowledge M-cycle.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It indicates the beginning of an NMI acknowledge M-cycle. The
* value returned by the function is ignored. */
Z80Read nmia;
/** @brief Invoked to perform a data bus read that corresponds to a
* maskable interrupt acknowledge M-cycle.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It indicates the beginning of an INT acknowledge M-cycle. The
* function must return the byte that the interrupting I/O device
* supplies to the CPU via the data bus during this M-cycle.
*
* When this callback is @c Z_NULL, the emulator assumes that the value
* read from the data bus is @c 0xFF. */
Z80Read inta;
/** @brief Invoked to perform a memory read on instruction data during a
* maskable interrupt response in mode 0.
*
* The role of this callback is analogous to that of
* <tt>@ref Z80::fetch</tt>, but it is specific to the INT response in
* mode 0. Ideally, the function should return a byte of instruction
* data that the interrupting I/O device supplies to the CPU via the
* data bus, but depending on the emulated hardware, the device may not
* be able to do this during a memory read M-cycle because the memory
* is addressed instead, in which case the function must return the
* byte located at the memory address specified by the second
* parameter.
*
* This callback will only be invoked if <tt>@ref Z80::inta</tt> is not
* @c Z_NULL and returns an opcode that implies subsequent memory read
* M-cycles to fetch the non-opcode bytes of the instruction, so it is
* safe not to initialize it or set it to @c Z_NULL if such a scenario
* is not possible. */
Z80Read int_fetch;
/** @brief Invoked to notify that an <tt>ld i,a</tt> instruction has
* been fetched.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It is invoked before executing the instruction. */
Z80Notify ld_i_a;
/** @brief Invoked to notify that an <tt>ld r,a</tt> instruction has
* been fetched.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It is invoked before executing the instruction. */
Z80Notify ld_r_a;
/** @brief Invoked to notify that a @c reti instruction has been
* fetched.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It is invoked before executing the instruction. */
Z80Notify reti;
/** @brief Invoked to notify that a @c retn instruction has been
* fetched.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It is invoked before executing the instruction. */
Z80Notify retn;
/** @brief Invoked when a trap is fetched.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use, in which case the opcode of the trap will be executed normally.
* The function receives the memory address of the trap as the second
* parameter and must return the opcode to be executed instead of the
* trap. If the function returns a trap (i.e., <tt>@ref Z80_HOOK</tt>),
* the emulator will do nothing, so the trap will be fetched again
* unless the function has modified <tt>@ref Z80::pc</tt> or replaced
* the trap in memory with another opcode. Also note that returning a
* trap does not revert the increment of <tt>@ref Z80::r</tt> performed
* before each opcode fetch. */
Z80Read hook;
/** @brief Invoked to delegate the execution of an illegal instruction.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. Only those instructions with the @c 0xED prefix that behave the
* same as two consecutive @c nop instructions are considered illegal.
* The function receives the illegal opcode as the second parameter and
* must return the number of clock cycles taken by the instruction.
*
* At the time of invoking this callback, and relative to the start of
* the instruction, only <tt>@ref Z80::r</tt> has been incremented
* (twice), so <tt>@ref Z80::pc</tt> still contains the memory address
* of the @c 0xED prefix. */
Z80Illegal illegal;
/** @brief Temporary storage used for instruction fetch. */
ZInt32 data;
ZInt16 ix_iy[2]; /**< @brief Index registers, IX and IY. */
ZInt16 pc; /**< @brief Register PC (program counter). */
ZInt16 sp; /**< @brief Register SP (stack pointer). */
/** @brief Temporary index register.
*
* All instructions with the @c 0xDD prefix behave exactly the same as
* their counterparts with the @c 0xFD prefix, differing only in the
* index register: the former use IX, whereas the latter use IY. When
* one of these prefixes is fetched, the corresponding index register
* is copied into this member; the instruction logic is then executed
* and finally this member is copied back into the index register. */
ZInt16 xy;
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 de_; /**< @brief Register pair DE'. */
ZInt16 hl_; /**< @brief Register pair HL'. */
zuint8 r; /**< @brief Register R (memory refresh). */
zuint8 i; /**< @brief Register I (interrupt vector base). */
/** @brief Backup of bit 7 of the R register.
*
* The Z80 CPU increments the R register during each M1 cycle without
* altering its most significant bit, commonly known as R7. However,
* the emulator only performs normal full-byte increments for speed
* reasons, which eventually corrupts R7.
*
* Before entering the execution loop, both <tt>@ref z80_execute</tt>
* and <tt>@ref z80_run</tt> copy <tt>@ref Z80::r</tt> into this member
* to preserve the value of R7, so that they can restore it before
* returning. The emulation of the <tt>ld r, a</tt> instruction also
* updates the value of this member. */
zuint8 r7;
/** @brief Maskable interrupt mode.
*
* Contains the number of the maskable interrupt mode in use: @c 0,
* @c 1 or @c 2. */
zuint8 im;
/** @brief Requests pending to be responded. */
zuint8 request;
/** @brief Type of unfinished operation to be resumed. */
zuint8 resume;
zuint8 iff1; /**< @brief Interrupt enable flip-flop #1 (IFF1). */
zuint8 iff2; /**< @brief Interrupt enable flip-flop #2 (IFF2). */
zuint8 q; /**< @brief Pseudo-register Q. */
/** @brief Emulation options.
*
* This member specifies the different emulation options that are
* enabled. It is mandatory to initialize it before using the emulator.
* Setting it to @c 0 disables all options. */
zuint8 options;
/** @brief State of the INT line.
*
* The value of this member is @c 1 if the INT line is low; otherwise,
* @c 0. */
zuint8 int_line;
/** @brief State of the HALT line.
*
* The value of this member is @c 1 if the HALT line is low; otherwise,
* @c 0. The emulator updates this member before invoking
* <tt>@ref Z80::halt</tt>, not after. */
zuint8 halt_line;
};
/** @brief <tt>@ref Z80::options</tt> bitmask that enables emulation of the
* <tt>out (c),255</tt> instruction, specific to the Zilog Z80 CMOS. */
#define Z80_OPTION_OUT_VC_255 1
/** @brief <tt>@ref Z80::options</tt> bitmask that enables emulation 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
* <tt>ld a,{i|r}</tt> instructions. */
#define Z80_OPTION_LD_A_IR_BUG 2
/** @brief <tt>@ref Z80::options</tt> bitmask that enables the HALTskip
* optimization. */
#define Z80_OPTION_HALT_SKIP 4
/** @brief <tt>@ref Z80::options</tt> bitmask that enables the XQ factor in the
* emulation of the @c ccf and @c scf instructions. */
#define Z80_OPTION_XQ 8
/** @brief <tt>@ref Z80::options</tt> bitmask that enables notifications for any
* @c reti or @c retn instruction executed during the interrupt mode 0
* response. */
#define Z80_OPTION_IM0_RETX_NOTIFICATIONS 16
/** @brief <tt>@ref Z80::options</tt> bitmask that enables the YQ factor in the
* emulation of the @c ccf and @c scf instructions. */
#define Z80_OPTION_YQ 32
/** @brief <tt>@ref Z80::options</tt> bitmask that enables full emulation of the
* Zilog NMOS models. */
#define Z80_MODEL_ZILOG_NMOS \
(Z80_OPTION_LD_A_IR_BUG | Z80_OPTION_XQ | Z80_OPTION_YQ)
/** @brief <tt>@ref Z80::options</tt> bitmask that enables full emulation of the
* Zilog CMOS models. */
#define Z80_MODEL_ZILOG_CMOS \
(Z80_OPTION_OUT_VC_255 | Z80_OPTION_XQ | Z80_OPTION_YQ)
/** @brief <tt>@ref Z80::options</tt> bitmask that enables full emulation of the
* NEC NMOS models. */
#define Z80_MODEL_NEC_NMOS \
Z80_OPTION_LD_A_IR_BUG
/** @brief <tt>@ref Z80::options</tt> bitmask that enables full emulation of the
* ST CMOS models. */
#define Z80_MODEL_ST_CMOS \
(Z80_OPTION_OUT_VC_255 | Z80_OPTION_LD_A_IR_BUG | Z80_OPTION_YQ)
/** @brief <tt>@ref Z80::request</tt> bitmask that prevents the NMI signal from
* being accepted. */
#define Z80_REQUEST_REJECT_NMI 2
/** @brief <tt>@ref Z80::request</tt> bitmask indicating that an NMI signal has
* been received. */
#define Z80_REQUEST_NMI 4
/** @brief <tt>@ref Z80::request</tt> bitmask indicating that the INT line is
* low and interrupts are enabled. */
#define Z80_REQUEST_INT 8
/** @brief <tt>@ref Z80::request</tt> bitmask indicating that a special RESET
* signal has been received. */
#define Z80_REQUEST_SPECIAL_RESET 16
/** @brief <tt>@ref Z80::resume</tt> value indicating that the emulator ran out
* of clock cycles during the HALT state. */
#define Z80_RESUME_HALT 1
/** @brief <tt>@ref Z80::resume</tt> value indicating that the emulator ran out
* of clock cycles by fetching a prefix @c 0xDD or @c 0xFD. */
#define Z80_RESUME_XY 2
/** @brief <tt>@ref Z80::resume</tt> value indicating that the emulator ran out
* of clock cycles by fetching a prefix @c 0xDD or @c 0xFD, during a maskable
* interrupt response in mode 0. */
#define Z80_RESUME_IM0_XY 3
/** @brief Value of the second parameter of <tt>@ref Z80::halt</tt> when the
* HALT line goes high due to a special RESET signal. */
#define Z80_HALT_EXIT_EARLY 2
/** @brief Value of the second paratemer of <tt>@ref Z80::halt</tt> when the
* HALT line goes low and then high due to a special RESET signal during the
* execution of a @c halt instruction. */
#define Z80_HALT_CANCEL 3
/** @brief Accesses the MEMPTR register of a <tt>@ref Z80</tt> @p object. */
#define Z80_MEMPTR(object) (object).memptr.uint16_value
/** @brief Accesses the PC register of a <tt>@ref Z80</tt> @p object. */
#define Z80_PC(object) (object).pc.uint16_value
/** @brief Accesses the SP register of a <tt>@ref Z80</tt> @p object. */
#define Z80_SP(object) (object).sp.uint16_value
/** @brief Accesses the temporary index register of a <tt>@ref Z80</tt> @p
* object */
#define Z80_XY(object) (object).xy.uint16_value
/** @brief Accesses the IX register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IX(object) (object).ix_iy[0].uint16_value
/** @brief Accesses the IY register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IY(object) (object).ix_iy[1].uint16_value
/** @brief Accesses the AF register of a <tt>@ref Z80</tt> @p object. */
#define Z80_AF(object) (object).af.uint16_value
/** @brief Accesses the BC register of a <tt>@ref Z80</tt> @p object. */
#define Z80_BC(object) (object).bc.uint16_value
/** @brief Accesses the DE register of a <tt>@ref Z80</tt> @p object. */
#define Z80_DE(object) (object).de.uint16_value
/** @brief Accesses the HL register of a <tt>@ref Z80</tt> @p object. */
#define Z80_HL(object) (object).hl.uint16_value
/** @brief Accesses the AF' register of a <tt>@ref Z80</tt> @p object. */
#define Z80_AF_(object) (object).af_.uint16_value
/** @brief Accesses the BC' register of a <tt>@ref Z80</tt> @p object. */
#define Z80_BC_(object) (object).bc_.uint16_value
/** @brief Accesses the DE' register of a <tt>@ref Z80</tt> @p object. */
#define Z80_DE_(object) (object).de_.uint16_value
/** @brief Accesses the HL' register of a <tt>@ref Z80</tt> @p object. */
#define Z80_HL_(object) (object).hl_.uint16_value
/** @brief Accesses the most significant byte of the MEMPTR register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_MEMPTRH(object) (object).memptr.uint8_values.at_1
/** @brief Accesses the least significant byte of the MEMPTR register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_MEMPTRL(object) (object).memptr.uint8_values.at_0
/** @brief Accesses the most significant byte of the PC register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_PCH(object) (object).pc.uint8_values.at_1
/** @brief Accesses the least significant byte of the PC register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_PCL(object) (object).pc.uint8_values.at_0
/** @brief Accesses the most significant byte of the SP register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_SPH(object) (object).sp.uint8_values.at_1
/** @brief Accesses the least significant byte of the SP register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_SPL(object) (object).sp.uint8_values.at_0
/** @brief Accesses the most significant byte of the temporary index register
* of a <tt>@ref Z80</tt> @p object. */
#define Z80_XYH(object) (object).xy.uint8_values.at_1
/** @brief Accesses the least significant byte of the temporary index register
* of a <tt>@ref Z80</tt> @p object. */
#define Z80_XYL(object) (object).xy.uint8_values.at_0
/** @brief Accesses the IXH register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IXH(object) (object).ix_iy[0].uint8_values.at_1
/** @brief Accesses the IXL register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IXL(object) (object).ix_iy[0].uint8_values.at_0
/** @brief Accesses the IYH register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IYH(object) (object).ix_iy[1].uint8_values.at_1
/** @brief Accesses the IYL register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IYL(object) (object).ix_iy[1].uint8_values.at_0
/** @brief Accesses the A register of a <tt>@ref Z80</tt> @p object. */
#define Z80_A(object) (object).af.uint8_values.at_1
/** @brief Accesses the F register of a <tt>@ref Z80</tt> @p object. */
#define Z80_F(object) (object).af.uint8_values.at_0
/** @brief Accesses the B register of a <tt>@ref Z80</tt> @p object. */
#define Z80_B(object) (object).bc.uint8_values.at_1
/** @brief Accesses the C register of a <tt>@ref Z80</tt> @p object. */
#define Z80_C(object) (object).bc.uint8_values.at_0
/** @brief Accesses the D register of a <tt>@ref Z80</tt> @p object. */
#define Z80_D(object) (object).de.uint8_values.at_1
/** @brief Accesses the E register of a <tt>@ref Z80</tt> @p object. */
#define Z80_E(object) (object).de.uint8_values.at_0
/** @brief Accesses the H register of a <tt>@ref Z80</tt> @p object. */
#define Z80_H(object) (object).hl.uint8_values.at_1
/** @brief Accesses the L register of a <tt>@ref Z80</tt> @p object. */
#define Z80_L(object) (object).hl.uint8_values.at_0
/** @brief Accesses the most significant byte of the AF' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_A_(object) (object).af_.uint8_values.at_1
/** @brief Accesses the least significant byte of the AF' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_F_(object) (object).af_.uint8_values.at_0
/** @brief Accesses the most significant byte of the BC' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_B_(object) (object).bc_.uint8_values.at_1
/** @brief Accesses the least significant byte of the BC' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_C_(object) (object).bc_.uint8_values.at_0
/** @brief Accesses the most significant byte of the DE' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_D_(object) (object).de_.uint8_values.at_1
/** @brief Accesses the least significant byte of the DE' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_E_(object) (object).de_.uint8_values.at_0
/** @brief Accesses the most significant byte of the HL' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_H_(object) (object).hl_.uint8_values.at_1
/** @brief Accesses the least significant byte of the HL' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_L_(object) (object).hl_.uint8_values.at_0
#define Z80_WZ Z80_MEMPTR /**< @brief Same as <tt>@ref Z80_MEMPTR</tt>. */
#define Z80_WZH Z80_MEMPTRH /**< @brief Same as <tt>@ref Z80_MEMPTRH</tt>. */
#define Z80_WZL Z80_MEMPTRL /**< @brief Same as <tt>@ref Z80_MEMPTRL</tt>. */
Z_EXTERN_C_BEGIN
/** @brief Sets the power state of a <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called.
* @param state
* @c Z_TRUE = power on;
* @c Z_FALSE = power off. */
Z80_API void z80_power(Z80 *self, zboolean state);
/** @brief Performs an instantaneous normal RESET on a <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called. */
Z80_API void z80_instant_reset(Z80 *self);
/** @brief Sends a special RESET signal to a <tt>@ref Z80</tt>.
*
* @sa
* - http://www.primrosebank.net/computers/z80/z80_special_reset.htm
* - US Patent 4486827
*
* @param self Pointer to the object on which the function is called. */
Z80_API void z80_special_reset(Z80 *self);
/** @brief Sets the state of the INT line of a <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called.
* @param state
* @c Z_TRUE = set line low;
* @c Z_FALSE = set line high. */
Z80_API void z80_int(Z80 *self, zboolean state);
/** @brief Triggers the NMI line of a <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called. */
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.
*
* @param self Pointer to the object on which the function is called.
* @param cycles Number of clock cycles to be emulated.
* @return The actual number of clock cycles emulated. */
Z80_API zusize z80_execute(Z80 *self, zusize cycles);
/** @brief Runs a <tt>@ref Z80</tt> for a given number of clock @p cycles.
*
* @param self Pointer to the object on which the function is called.
* @param cycles Number of clock cycles to be emulated.
* @return The actual number of clock cycles emulated. */
Z80_API zusize z80_run(Z80 *self, zusize cycles);
/** @brief Ends the emulation loop of <tt>@ref z80_execute</tt> or
* <tt>@ref z80_run</tt>.
*
* 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.
*
* @param self Pointer to the object on which the function is called. */
static inline void z80_break(Z80 *self)
{self->cycle_limit = 0;}
/** @brief Gets the full value of the R register of a <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called.
* @return The value of the R register. */
static inline zuint8 z80_r(Z80 const *self)
{return (self->r & 127) | (self->r7 & 128);}
/** @brief Obtains the refresh address of the M1 cycle being executed by a
* <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called.
* @return The refresh address. */
static inline zuint16 z80_refresh_address(Z80 const *self)
{
return Z_CAST(zuint16)(
((zuint16)self->i << 8) |
((self->r - 1) & 127) |
(self->r7 & 128));
}
/** @brief Obtains the clock cycle, relative to the start of the instruction, at
* which the I/O read M-cycle being executed by a <tt>@ref Z80</tt> begins.
*
* @param self Pointer to the object on which the function is called.
* @return The clock cycle at which the I/O read M-cycle begins. */
static inline zuint8 z80_in_cycle(Z80 const *self)
{
return Z_CAST(zuint8)(self->data.uint8_array[0] == 0xDB
? /* in a,(BYTE) : 4+3 */
7
: /* in J,(c) / in (c) : 4+4 */
8
+ /* ini / ind / inir / indr : 4+5 */
(self->data.uint8_array[1] >> 7));
}
/** @brief Obtains the clock cycle, relative to the start of the instruction, at
* which the I/O write M-cycle being executed by a <tt>@ref Z80</tt> begins.
*
* @param self Pointer to the object on which the function is called.
* @return The clock cycle at which the I/O write M-cycle begins. */
static inline zuint8 z80_out_cycle(Z80 const *self)
{
return Z_CAST(zuint8)(self->data.uint8_array[0] == 0xD3
? /* out (BYTE),a : 4+3 */
7
: /* out (c),J / out (c),0 : 4+4 */
8
+ /* outi / outd / otir / otdr : 4+5+3 */
((self->data.uint8_array[1] >> 7) << 2));
}
Z_EXTERN_C_END
#endif /* Z80_H */

904
projects/Z80/API/Z80.h.bak vendored Normal file
View File

@@ -0,0 +1,904 @@
/* Z80 API
______ ______ ______
/\___ \/\ __ \\ __ \
____ \/__/ /\_\ __ \\ \/\ \ ________________________________________________
| /\_____\\_____\\_____\ |
| Zilog \/_____//_____//_____/ CPU Emulator |
| Copyright (C) 1999-2024 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 |
| the Free Software Foundation, either version 3 of the License, or (at your |
| option) any later version. |
| |
| This emulator is distributed in the hope that it will be useful, but |
| WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
| License for more details. |
| |
| You should have received a copy of the GNU Lesser General Public License |
| along with this emulator. If not, see <http://www.gnu.org/licenses/>. |
| |
'=============================================================================*/
#ifndef Z80_H
/** @file Z80.h
* @brief Zilog Z80 CPU emulator.
*
* @details The Z80 library implements a fast, small and accurate emulator
* 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
* @author Manuel Sainz de Baranda y Goñi */
#ifdef Z80_DEPENDENCIES_HEADER
# define Z80_H
# include Z80_DEPENDENCIES_HEADER
# undef Z80_H
#else
# include <Z/macros/language.h>
# include <Z/types/bitwise.h>
#endif
#ifndef Z80_API
# if defined(Z80_STATIC) || defined(__DOXYGEN__)
# define Z80_API
# else
# define Z80_API Z_API_IMPORT
# endif
#endif
/** @brief Major version number of the Z80 library. */
#define Z80_LIBRARY_VERSION_MAJOR 0
/** @brief Minor version number of the Z80 library. */
#define Z80_LIBRARY_VERSION_MINOR 2
/** @brief Micro version number of the Z80 library. */
#define Z80_LIBRARY_VERSION_MICRO 0
/** @brief String literal with the version number of the Z80 library. */
#define Z80_LIBRARY_VERSION_STRING "0.2"
/** @brief Maximum number of clock cycles that <tt>@ref z80_run</tt> and
* <tt>@ref z80_execute</tt> can emulate. */
#define Z80_MAXIMUM_CYCLES (Z_USIZE_MAXIMUM - Z_USIZE(30))
/** @brief Maximum number of clock cycles that <tt>@ref z80_run</tt> will
* emulate if instructed to execute 1 clock cycle.
*
* This is the number of clock cycles it takes to execute the longest
* instruction through interrupt mode 0, not counting the M-cycle used to fetch
* a @c 0xDD or @c 0xFD prefix. For <tt>@ref z80_execute</tt>, subtract 4 clock
* cycles from this value. */
#define Z80_MAXIMUM_CYCLES_PER_STEP 25
/** @brief Minimum number of clock cycles that <tt>@ref z80_run</tt> or
* <tt>@ref z80_execute</tt> will emulate if instructed to execute 1 clock
* cycle. */
#define Z80_MINIMUM_CYCLES_PER_STEP 4
/** @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
#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. */
#define Z80_HF 16 /**< @brief Bitmask of the Z80 H flag. */
#define Z80_XF 8 /**< @brief Bitmask of the Z80 X flag. */
#define Z80_PF 4 /**< @brief Bitmask of the Z80 P/V flag. */
#define Z80_NF 2 /**< @brief Bitmask of the Z80 N flag. */
#define Z80_CF 1 /**< @brief Bitmask of the Z80 C flag. */
typedef struct Z80 Z80;
/** @brief Defines a pointer to a <tt>@ref Z80</tt> callback function invoked to
* perform a read operation.
*
* @param context The <tt>@ref Z80::context</tt> of the calling object.
* @param address The memory address or I/O port to read from.
* @return The byte read. */
typedef zuint8 (* Z80Read)(void *context, zuint16 address);
/** @brief Defines a pointer to a <tt>@ref Z80</tt> callback function invoked to
* perform a write operation.
*
* @param context The <tt>@ref Z80::context</tt> of the calling object.
* @param address The memory address or I/O port to write to.
* @param value The byte to write. */
typedef void (* Z80Write)(void *context, zuint16 address, zuint8 value);
/** @brief Defines a pointer to a <tt>@ref Z80</tt> callback function invoked to
* notify a signal change on the HALT line.
*
* @param context The <tt>@ref Z80::context</tt> of the calling object.
* @param signal A code specifying the type of signal change. */
typedef void (* Z80Halt)(void *context, zuint8 signal);
/** @brief Defines a pointer to a <tt>@ref Z80</tt> callback function invoked to
* notify an event.
*
* @param context The <tt>@ref Z80::context</tt> of the calling object. */
typedef void (* Z80Notify)(void *context);
/** @brief Defines a pointer to a <tt>@ref Z80</tt> callback function invoked to
* delegate the emulation of an illegal instruction.
*
* @param cpu The calling object.
* @param opcode The illegal opcode.
* @return The number of clock cycles consumed by the instruction. */
typedef zuint8 (* Z80Illegal)(Z80 *cpu, zuint8 opcode);
/** @struct Z80 Z80.h
*
* @brief A Z80 CPU emulator.
*
* A @c Z80 object contains the state of an emulated Z80 CPU, pointers to
* callback functions that interconnect the emulator with the external logic
* and a context that is passed to these functions.
*
* Because no constructor function is provided, it is mandatory to directly
* initialize all callback pointers and <tt>@ref Z80::options</tt> before using
* an object of this type. Optional callbacks must be set to @c Z_NULL when not
* in use. */
struct Z80 {
/** @brief Number of clock cycles already executed. */
zusize cycles;
/** @brief Maximum number of clock cycles to be executed. */
zusize cycle_limit;
/** @brief Pointer to pass as the first argument to all callback
* functions.
*
* This member is intended to hold a reference to the context to which
* the object belongs. It is safe not to initialize it when this is not
* necessary. */
void *context;
/** @brief Invoked to perform an opcode fetch.
*
* This callback indicates the beginning of an opcode fetch M-cycle.
* The function must return the byte located at the memory address
* specified by the second argument. */
Z80Read fetch_opcode;
/** @brief Invoked to perform a memory read on instruction data.
*
* This callback indicates the beginning of a memory read M-cycle
* during which the CPU fetches one byte of instruction data (i.e., one
* byte of the instruction that is neither a prefix nor an opcode). The
* function must return the byte located at the memory address
* specified by the second argument. */
Z80Read fetch;
/** @brief Invoked to perform a memory read.
*
* This callback indicates the beginning of a memory read M-cycle. The
* function must return the byte located at the memory address
* specified by the second argument. */
Z80Read read;
/** @brief Invoked to perform a memory write.
*
* This callback indicates the beginning of a memory write M-cycle. The
* function must write the third argument into the memory location
* specified by the second argument. */
Z80Write write;
/** @brief Invoked to perform an I/O port read.
*
* This callback indicates the beginning of an I/O read M-cycle. The
* function must return the byte read from the I/O port specified by
* the second argument. */
Z80Read in;
/** @brief Invoked to perform an I/O port write.
*
* This callback indicates the beginning of an I/O write M-cycle. The
* function must write the third argument to the I/O port specified by
* the second argument. */
Z80Write out;
/** @brief Invoked to notify a signal change on the HALT line.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. Its invocation is always deferred until the next emulation step
* so that the emulator can abort the signal change if any invalidating
* condition occurs, such as the acceptance of an interrupt during the
* execution of a @c halt instruction.
*
* The second parameter of the function specifies the type of signal
* change and can only contain a boolean value if the Z80 library has
* not been built with special RESET support:
*
* - @c 1 indicates that the HALT line is going low during the last
* clock cycle of a @c halt instruction, which means that the CPU
* is entering the HALT state.
*
* - @c 0 indicates that the HALT line is going high during the last
* clock cycle of an internal NOP executed during the HALT state,
* i.e., the CPU is exiting the HALT state due to an interrupt or
* normal RESET.
*
* If the library has been built with special RESET support, the values
* <tt>@ref Z80_HALT_EXIT_EARLY</tt> and <tt>@ref Z80_HALT_CANCEL</tt>
* are also possible for the second parameter. */
Z80Halt halt;
/** @brief Invoked to perform an opcode fetch that corresponds to an
* internal NOP.
*
* This callback indicates the beginning of an opcode fetch M-cycle of
* 4 clock cycles that is generated in the following two cases:
*
* - During the HALT state, the CPU repeatedly executes an internal NOP
* that fetches the next opcode after the @c halt instruction without
* incrementing the PC register. This opcode is read again and again
* until an exit condition occurs (i.e., NMI, INT or RESET).
*
* - After detecting a special RESET signal, the CPU completes the
* ongoing instruction or interrupt response and then zeroes the PC
* register during the first clock cycle of the next M1 cycle. If no
* interrupt has been accepted at the end of the instruction or
* interrupt response, the CPU produces an internal NOP to allow for
* the fetch-execute overlap to take place, during which it fetches
* the next opcode and zeroes PC.
*
* This callback is optional but note that setting it to @c Z_NULL is
* equivalent to enabling <tt>@ref Z80_OPTION_HALT_SKIP</tt>. */
Z80Read nop;
/** @brief Invoked to perform an opcode fetch that corresponds to a
* non-maskable interrupt acknowledge M-cycle.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It indicates the beginning of an NMI acknowledge M-cycle. The
* value returned by the function is ignored. */
Z80Read nmia;
/** @brief Invoked to perform a data bus read that corresponds to a
* maskable interrupt acknowledge M-cycle.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It indicates the beginning of an INT acknowledge M-cycle. The
* function must return the byte that the interrupting I/O device
* supplies to the CPU via the data bus during this M-cycle.
*
* When this callback is @c Z_NULL, the emulator assumes that the value
* read from the data bus is @c 0xFF. */
Z80Read inta;
/** @brief Invoked to perform a memory read on instruction data during a
* maskable interrupt response in mode 0.
*
* The role of this callback is analogous to that of
* <tt>@ref Z80::fetch</tt>, but it is specific to the INT response in
* mode 0. Ideally, the function should return a byte of instruction
* data that the interrupting I/O device supplies to the CPU via the
* data bus, but depending on the emulated hardware, the device may not
* be able to do this during a memory read M-cycle because the memory
* is addressed instead, in which case the function must return the
* byte located at the memory address specified by the second
* parameter.
*
* This callback will only be invoked if <tt>@ref Z80::inta</tt> is not
* @c Z_NULL and returns an opcode that implies subsequent memory read
* M-cycles to fetch the non-opcode bytes of the instruction, so it is
* safe not to initialize it or set it to @c Z_NULL if such a scenario
* is not possible. */
Z80Read int_fetch;
/** @brief Invoked to notify that an <tt>ld i,a</tt> instruction has
* been fetched.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It is invoked before executing the instruction. */
Z80Notify ld_i_a;
/** @brief Invoked to notify that an <tt>ld r,a</tt> instruction has
* been fetched.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It is invoked before executing the instruction. */
Z80Notify ld_r_a;
/** @brief Invoked to notify that a @c reti instruction has been
* fetched.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It is invoked before executing the instruction. */
Z80Notify reti;
/** @brief Invoked to notify that a @c retn instruction has been
* fetched.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. It is invoked before executing the instruction. */
Z80Notify retn;
/** @brief Invoked when a trap is fetched.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use, in which case the opcode of the trap will be executed normally.
* The function receives the memory address of the trap as the second
* parameter and must return the opcode to be executed instead of the
* trap. If the function returns a trap (i.e., <tt>@ref Z80_HOOK</tt>),
* the emulator will do nothing, so the trap will be fetched again
* unless the function has modified <tt>@ref Z80::pc</tt> or replaced
* the trap in memory with another opcode. Also note that returning a
* trap does not revert the increment of <tt>@ref Z80::r</tt> performed
* before each opcode fetch. */
Z80Read hook;
/** @brief Invoked to delegate the execution of an illegal instruction.
*
* This callback is optional and must be set to @c Z_NULL when not in
* use. Only those instructions with the @c 0xED prefix that behave the
* same as two consecutive @c nop instructions are considered illegal.
* The function receives the illegal opcode as the second parameter and
* must return the number of clock cycles taken by the instruction.
*
* At the time of invoking this callback, and relative to the start of
* the instruction, only <tt>@ref Z80::r</tt> has been incremented
* (twice), so <tt>@ref Z80::pc</tt> still contains the memory address
* of the @c 0xED prefix. */
Z80Illegal illegal;
/** @brief Temporary storage used for instruction fetch. */
ZInt32 data;
ZInt16 ix_iy[2]; /**< @brief Index registers, IX and IY. */
ZInt16 pc; /**< @brief Register PC (program counter). */
ZInt16 sp; /**< @brief Register SP (stack pointer). */
/** @brief Temporary index register.
*
* All instructions with the @c 0xDD prefix behave exactly the same as
* their counterparts with the @c 0xFD prefix, differing only in the
* index register: the former use IX, whereas the latter use IY. When
* one of these prefixes is fetched, the corresponding index register
* is copied into this member; the instruction logic is then executed
* and finally this member is copied back into the index register. */
ZInt16 xy;
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 de_; /**< @brief Register pair DE'. */
ZInt16 hl_; /**< @brief Register pair HL'. */
zuint8 r; /**< @brief Register R (memory refresh). */
zuint8 i; /**< @brief Register I (interrupt vector base). */
/** @brief Backup of bit 7 of the R register.
*
* The Z80 CPU increments the R register during each M1 cycle without
* altering its most significant bit, commonly known as R7. However,
* the emulator only performs normal full-byte increments for speed
* reasons, which eventually corrupts R7.
*
* Before entering the execution loop, both <tt>@ref z80_execute</tt>
* and <tt>@ref z80_run</tt> copy <tt>@ref Z80::r</tt> into this member
* to preserve the value of R7, so that they can restore it before
* returning. The emulation of the <tt>ld r, a</tt> instruction also
* updates the value of this member. */
zuint8 r7;
/** @brief Maskable interrupt mode.
*
* Contains the number of the maskable interrupt mode in use: @c 0,
* @c 1 or @c 2. */
zuint8 im;
/** @brief Requests pending to be responded. */
zuint8 request;
/** @brief Type of unfinished operation to be resumed. */
zuint8 resume;
zuint8 iff1; /**< @brief Interrupt enable flip-flop #1 (IFF1). */
zuint8 iff2; /**< @brief Interrupt enable flip-flop #2 (IFF2). */
zuint8 q; /**< @brief Pseudo-register Q. */
/** @brief Emulation options.
*
* This member specifies the different emulation options that are
* enabled. It is mandatory to initialize it before using the emulator.
* Setting it to @c 0 disables all options. */
zuint8 options;
/** @brief State of the INT line.
*
* The value of this member is @c 1 if the INT line is low; otherwise,
* @c 0. */
zuint8 int_line;
/** @brief State of the HALT line.
*
* The value of this member is @c 1 if the HALT line is low; otherwise,
* @c 0. The emulator updates this member before invoking
* <tt>@ref Z80::halt</tt>, not after. */
zuint8 halt_line;
};
/** @brief <tt>@ref Z80::options</tt> bitmask that enables emulation of the
* <tt>out (c),255</tt> instruction, specific to the Zilog Z80 CMOS. */
#define Z80_OPTION_OUT_VC_255 1
/** @brief <tt>@ref Z80::options</tt> bitmask that enables emulation 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
* <tt>ld a,{i|r}</tt> instructions. */
#define Z80_OPTION_LD_A_IR_BUG 2
/** @brief <tt>@ref Z80::options</tt> bitmask that enables the HALTskip
* optimization. */
#define Z80_OPTION_HALT_SKIP 4
/** @brief <tt>@ref Z80::options</tt> bitmask that enables the XQ factor in the
* emulation of the @c ccf and @c scf instructions. */
#define Z80_OPTION_XQ 8
/** @brief <tt>@ref Z80::options</tt> bitmask that enables notifications for any
* @c reti or @c retn instruction executed during the interrupt mode 0
* response. */
#define Z80_OPTION_IM0_RETX_NOTIFICATIONS 16
/** @brief <tt>@ref Z80::options</tt> bitmask that enables the YQ factor in the
* emulation of the @c ccf and @c scf instructions. */
#define Z80_OPTION_YQ 32
/** @brief <tt>@ref Z80::options</tt> bitmask that enables full emulation of the
* Zilog NMOS models. */
#define Z80_MODEL_ZILOG_NMOS \
(Z80_OPTION_LD_A_IR_BUG | Z80_OPTION_XQ | Z80_OPTION_YQ)
/** @brief <tt>@ref Z80::options</tt> bitmask that enables full emulation of the
* Zilog CMOS models. */
#define Z80_MODEL_ZILOG_CMOS \
(Z80_OPTION_OUT_VC_255 | Z80_OPTION_XQ | Z80_OPTION_YQ)
/** @brief <tt>@ref Z80::options</tt> bitmask that enables full emulation of the
* NEC NMOS models. */
#define Z80_MODEL_NEC_NMOS \
Z80_OPTION_LD_A_IR_BUG
/** @brief <tt>@ref Z80::options</tt> bitmask that enables full emulation of the
* ST CMOS models. */
#define Z80_MODEL_ST_CMOS \
(Z80_OPTION_OUT_VC_255 | Z80_OPTION_LD_A_IR_BUG | Z80_OPTION_YQ)
/** @brief <tt>@ref Z80::request</tt> bitmask that prevents the NMI signal from
* being accepted. */
#define Z80_REQUEST_REJECT_NMI 2
/** @brief <tt>@ref Z80::request</tt> bitmask indicating that an NMI signal has
* been received. */
#define Z80_REQUEST_NMI 4
/** @brief <tt>@ref Z80::request</tt> bitmask indicating that the INT line is
* low and interrupts are enabled. */
#define Z80_REQUEST_INT 8
/** @brief <tt>@ref Z80::request</tt> bitmask indicating that a special RESET
* signal has been received. */
#define Z80_REQUEST_SPECIAL_RESET 16
/** @brief <tt>@ref Z80::resume</tt> value indicating that the emulator ran out
* of clock cycles during the HALT state. */
#define Z80_RESUME_HALT 1
/** @brief <tt>@ref Z80::resume</tt> value indicating that the emulator ran out
* of clock cycles by fetching a prefix @c 0xDD or @c 0xFD. */
#define Z80_RESUME_XY 2
/** @brief <tt>@ref Z80::resume</tt> value indicating that the emulator ran out
* of clock cycles by fetching a prefix @c 0xDD or @c 0xFD, during a maskable
* interrupt response in mode 0. */
#define Z80_RESUME_IM0_XY 3
/** @brief Value of the second parameter of <tt>@ref Z80::halt</tt> when the
* HALT line goes high due to a special RESET signal. */
#define Z80_HALT_EXIT_EARLY 2
/** @brief Value of the second paratemer of <tt>@ref Z80::halt</tt> when the
* HALT line goes low and then high due to a special RESET signal during the
* execution of a @c halt instruction. */
#define Z80_HALT_CANCEL 3
/** @brief Accesses the MEMPTR register of a <tt>@ref Z80</tt> @p object. */
#define Z80_MEMPTR(object) (object).memptr.uint16_value
/** @brief Accesses the PC register of a <tt>@ref Z80</tt> @p object. */
#define Z80_PC(object) (object).pc.uint16_value
/** @brief Accesses the SP register of a <tt>@ref Z80</tt> @p object. */
#define Z80_SP(object) (object).sp.uint16_value
/** @brief Accesses the temporary index register of a <tt>@ref Z80</tt> @p
* object */
#define Z80_XY(object) (object).xy.uint16_value
/** @brief Accesses the IX register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IX(object) (object).ix_iy[0].uint16_value
/** @brief Accesses the IY register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IY(object) (object).ix_iy[1].uint16_value
/** @brief Accesses the AF register of a <tt>@ref Z80</tt> @p object. */
#define Z80_AF(object) (object).af.uint16_value
/** @brief Accesses the BC register of a <tt>@ref Z80</tt> @p object. */
#define Z80_BC(object) (object).bc.uint16_value
/** @brief Accesses the DE register of a <tt>@ref Z80</tt> @p object. */
#define Z80_DE(object) (object).de.uint16_value
/** @brief Accesses the HL register of a <tt>@ref Z80</tt> @p object. */
#define Z80_HL(object) (object).hl.uint16_value
/** @brief Accesses the AF' register of a <tt>@ref Z80</tt> @p object. */
#define Z80_AF_(object) (object).af_.uint16_value
/** @brief Accesses the BC' register of a <tt>@ref Z80</tt> @p object. */
#define Z80_BC_(object) (object).bc_.uint16_value
/** @brief Accesses the DE' register of a <tt>@ref Z80</tt> @p object. */
#define Z80_DE_(object) (object).de_.uint16_value
/** @brief Accesses the HL' register of a <tt>@ref Z80</tt> @p object. */
#define Z80_HL_(object) (object).hl_.uint16_value
/** @brief Accesses the most significant byte of the MEMPTR register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_MEMPTRH(object) (object).memptr.uint8_values.at_1
/** @brief Accesses the least significant byte of the MEMPTR register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_MEMPTRL(object) (object).memptr.uint8_values.at_0
/** @brief Accesses the most significant byte of the PC register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_PCH(object) (object).pc.uint8_values.at_1
/** @brief Accesses the least significant byte of the PC register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_PCL(object) (object).pc.uint8_values.at_0
/** @brief Accesses the most significant byte of the SP register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_SPH(object) (object).sp.uint8_values.at_1
/** @brief Accesses the least significant byte of the SP register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_SPL(object) (object).sp.uint8_values.at_0
/** @brief Accesses the most significant byte of the temporary index register
* of a <tt>@ref Z80</tt> @p object. */
#define Z80_XYH(object) (object).xy.uint8_values.at_1
/** @brief Accesses the least significant byte of the temporary index register
* of a <tt>@ref Z80</tt> @p object. */
#define Z80_XYL(object) (object).xy.uint8_values.at_0
/** @brief Accesses the IXH register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IXH(object) (object).ix_iy[0].uint8_values.at_1
/** @brief Accesses the IXL register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IXL(object) (object).ix_iy[0].uint8_values.at_0
/** @brief Accesses the IYH register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IYH(object) (object).ix_iy[1].uint8_values.at_1
/** @brief Accesses the IYL register of a <tt>@ref Z80</tt> @p object. */
#define Z80_IYL(object) (object).ix_iy[1].uint8_values.at_0
/** @brief Accesses the A register of a <tt>@ref Z80</tt> @p object. */
#define Z80_A(object) (object).af.uint8_values.at_1
/** @brief Accesses the F register of a <tt>@ref Z80</tt> @p object. */
#define Z80_F(object) (object).af.uint8_values.at_0
/** @brief Accesses the B register of a <tt>@ref Z80</tt> @p object. */
#define Z80_B(object) (object).bc.uint8_values.at_1
/** @brief Accesses the C register of a <tt>@ref Z80</tt> @p object. */
#define Z80_C(object) (object).bc.uint8_values.at_0
/** @brief Accesses the D register of a <tt>@ref Z80</tt> @p object. */
#define Z80_D(object) (object).de.uint8_values.at_1
/** @brief Accesses the E register of a <tt>@ref Z80</tt> @p object. */
#define Z80_E(object) (object).de.uint8_values.at_0
/** @brief Accesses the H register of a <tt>@ref Z80</tt> @p object. */
#define Z80_H(object) (object).hl.uint8_values.at_1
/** @brief Accesses the L register of a <tt>@ref Z80</tt> @p object. */
#define Z80_L(object) (object).hl.uint8_values.at_0
/** @brief Accesses the most significant byte of the AF' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_A_(object) (object).af_.uint8_values.at_1
/** @brief Accesses the least significant byte of the AF' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_F_(object) (object).af_.uint8_values.at_0
/** @brief Accesses the most significant byte of the BC' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_B_(object) (object).bc_.uint8_values.at_1
/** @brief Accesses the least significant byte of the BC' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_C_(object) (object).bc_.uint8_values.at_0
/** @brief Accesses the most significant byte of the DE' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_D_(object) (object).de_.uint8_values.at_1
/** @brief Accesses the least significant byte of the DE' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_E_(object) (object).de_.uint8_values.at_0
/** @brief Accesses the most significant byte of the HL' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_H_(object) (object).hl_.uint8_values.at_1
/** @brief Accesses the least significant byte of the HL' register of a
* <tt>@ref Z80</tt> @p object. */
#define Z80_L_(object) (object).hl_.uint8_values.at_0
#define Z80_WZ Z80_MEMPTR /**< @brief Same as <tt>@ref Z80_MEMPTR</tt>. */
#define Z80_WZH Z80_MEMPTRH /**< @brief Same as <tt>@ref Z80_MEMPTRH</tt>. */
#define Z80_WZL Z80_MEMPTRL /**< @brief Same as <tt>@ref Z80_MEMPTRL</tt>. */
Z_EXTERN_C_BEGIN
/** @brief Sets the power state of a <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called.
* @param state
* @c Z_TRUE = power on;
* @c Z_FALSE = power off. */
Z80_API void z80_power(Z80 *self, zboolean state);
/** @brief Performs an instantaneous normal RESET on a <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called. */
Z80_API void z80_instant_reset(Z80 *self);
/** @brief Sends a special RESET signal to a <tt>@ref Z80</tt>.
*
* @sa
* - http://www.primrosebank.net/computers/z80/z80_special_reset.htm
* - US Patent 4486827
*
* @param self Pointer to the object on which the function is called. */
Z80_API void z80_special_reset(Z80 *self);
/** @brief Sets the state of the INT line of a <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called.
* @param state
* @c Z_TRUE = set line low;
* @c Z_FALSE = set line high. */
Z80_API void z80_int(Z80 *self, zboolean state);
/** @brief Triggers the NMI line of a <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called. */
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.
*
* @param self Pointer to the object on which the function is called.
* @param cycles Number of clock cycles to be emulated.
* @return The actual number of clock cycles emulated. */
Z80_API zusize z80_execute(Z80 *self, zusize cycles);
/** @brief Runs a <tt>@ref Z80</tt> for a given number of clock @p cycles.
*
* @param self Pointer to the object on which the function is called.
* @param cycles Number of clock cycles to be emulated.
* @return The actual number of clock cycles emulated. */
Z80_API zusize z80_run(Z80 *self, zusize cycles);
/** @brief Ends the emulation loop of <tt>@ref z80_execute</tt> or
* <tt>@ref z80_run</tt>.
*
* 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.
*
* @param self Pointer to the object on which the function is called. */
static Z_ALWAYS_INLINE void z80_break(Z80 *self)
{self->cycle_limit = 0;}
/** @brief Gets the full value of the R register of a <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called.
* @return The value of the R register. */
static Z_ALWAYS_INLINE zuint8 z80_r(Z80 const *self)
{return (self->r & 127) | (self->r7 & 128);}
/** @brief Obtains the refresh address of the M1 cycle being executed by a
* <tt>@ref Z80</tt>.
*
* @param self Pointer to the object on which the function is called.
* @return The refresh address. */
static Z_ALWAYS_INLINE zuint16 z80_refresh_address(Z80 const *self)
{
return Z_CAST(zuint16)(
((zuint16)self->i << 8) |
((self->r - 1) & 127) |
(self->r7 & 128));
}
/** @brief Obtains the clock cycle, relative to the start of the instruction, at
* which the I/O read M-cycle being executed by a <tt>@ref Z80</tt> begins.
*
* @param self Pointer to the object on which the function is called.
* @return The clock cycle at which the I/O read M-cycle begins. */
static Z_ALWAYS_INLINE zuint8 z80_in_cycle(Z80 const *self)
{
return Z_CAST(zuint8)(self->data.uint8_array[0] == 0xDB
? /* in a,(BYTE) : 4+3 */
7
: /* in J,(c) / in (c) : 4+4 */
8
+ /* ini / ind / inir / indr : 4+5 */
(self->data.uint8_array[1] >> 7));
}
/** @brief Obtains the clock cycle, relative to the start of the instruction, at
* which the I/O write M-cycle being executed by a <tt>@ref Z80</tt> begins.
*
* @param self Pointer to the object on which the function is called.
* @return The clock cycle at which the I/O write M-cycle begins. */
static Z_ALWAYS_INLINE zuint8 z80_out_cycle(Z80 const *self)
{
return Z_CAST(zuint8)(self->data.uint8_array[0] == 0xD3
? /* out (BYTE),a : 4+3 */
7
: /* out (c),J / out (c),0 : 4+4 */
8
+ /* outi / outd / otir / otdr : 4+5+3 */
((self->data.uint8_array[1] >> 7) << 2));
}
Z_EXTERN_C_END
#endif /* Z80_H */

6
projects/Z80/AUTHORS vendored Normal file
View File

@@ -0,0 +1,6 @@
Original author:
Sainz de Baranda y Goñi, Manuel <manuel@zxe.io>
Contributors:
Ortega Sosa, Sofía <agaxia@zxe.io>
Vučenović, Zoran <zoran_vucenovic@yahoo.com>

22
projects/Z80/CITATION.cff vendored Normal file
View File

@@ -0,0 +1,22 @@
abstract: Zilog Z80 CPU emulator.
authors:
- family-names: 'Sainz de Baranda y Goñi'
given-names: Manuel
orcid: 'https://orcid.org/0000-0001-6326-3519'
email: 'manuel@zxe.io'
website: 'https://zxe.io'
cff-version: '1.2.0'
date-released: '2024-04-18'
keywords:
- CPU
- LLE
- Z80
- Zilog
- emulator
license: LGPL-3.0-or-later
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'
url: 'https://zxe.io/software/Z80'

31
projects/Z80/CMake/FindBreathe.cmake vendored Normal file
View File

@@ -0,0 +1,31 @@
# FindBreathe.cmake
# Copyright (C) 2021-2023 Manuel Sainz de Baranda y Goñi.
# This "find module" is DISTRIBUTED AS PUBLIC DOMAIN. No restrictions apply.
include(FindPackageHandleStandardArgs)
find_program(
BREATHE_APIDOC_EXECUTABLE
NAMES breathe-apidoc
DOC "Breathe extension for Sphinx")
if(BREATHE_APIDOC_EXECUTABLE)
execute_process(
COMMAND "${BREATHE_APIDOC_EXECUTABLE}" --version
OUTPUT_VARIABLE _output)
if("${_output}" MATCHES ".* ([^\n]+)\n")
set(BREATHE_APIDOC_VERSION "${CMAKE_MATCH_1}")
endif()
unset(_output)
endif()
find_package_handle_standard_args(
Breathe
REQUIRED_VARS BREATHE_APIDOC_EXECUTABLE
VERSION_VAR BREATHE_APIDOC_VERSION)
mark_as_advanced(BREATHE_APIDOC_EXECUTABLE)
# FindBreathe.cmake EOF

31
projects/Z80/CMake/FindSphinx.cmake vendored Normal file
View File

@@ -0,0 +1,31 @@
# FindSphinx.cmake
# Copyright (C) 2021-2023 Manuel Sainz de Baranda y Goñi.
# This "find module" is DISTRIBUTED AS PUBLIC DOMAIN. No restrictions apply.
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)
mark_as_advanced(SPHINX_BUILD_EXECUTABLE)
# FindSphinx.cmake EOF

108
projects/Z80/CMake/FindZeta.cmake vendored Normal file
View File

@@ -0,0 +1,108 @@
# Zeta - FindZeta.cmake
# ______ ______________ ___
# |__ / | ___|___ ___|/ \
# / /__| __| | | / - \
# /______|_____| |__| /__/ \__\
# Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
# This "find module" is DISTRIBUTED AS PUBLIC DOMAIN. No restrictions apply.
include(FindPackageHandleStandardArgs)
if(NOT DEFINED Zeta_FIND_RELATIVE OR Zeta_FIND_RELATIVE)
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()
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" _)
if(_ MATCHES ".*Z_LIBRARY_VERSION_STRING \"([^\n]*)\".*")
set(Zeta_VERSION ${CMAKE_MATCH_1})
if(Zeta_VERSION MATCHES "^([0-9]+)\\.([0-9]+)")
set(Zeta_VERSION_MAJOR ${CMAKE_MATCH_1})
set(Zeta_VERSION_MINOR ${CMAKE_MATCH_2})
if(Zeta_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
set(Zeta_VERSION_PATCH ${CMAKE_MATCH_3})
else()
set(Zeta_VERSION_PATCH 0)
endif()
endif()
endif()
unset(_)
endif()
find_package_handle_standard_args(
Zeta
FOUND_VAR Zeta_FOUND
REQUIRED_VARS Zeta_INCLUDE_DIR Zeta_VERSION
VERSION_VAR Zeta_VERSION)
if(Zeta_FOUND AND NOT TARGET Zeta)
add_library(Zeta INTERFACE IMPORTED)
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_LESS 3.11)
set_property(
TARGET Zeta
PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${Zeta_INCLUDE_DIR}")
else()
target_include_directories(Zeta INTERFACE "${Zeta_INCLUDE_DIR}")
endif()
endif()
mark_as_advanced(Zeta_INCLUDE_DIR)
# FindZeta.cmake EOF

435
projects/Z80/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,435 @@
# Z80 - CMakeLists.txt
# ______ ______ ______
# /\___ \/\ __ \\ __ \
# \/__/ /\_\ __ \\ \/\ \
# /\_____\\_____\\_____\
# Zilog \/_____//_____//_____/ CPU Emulator
# Copyright (C) 1999-2024 Manuel Sainz de Baranda y Goñi.
# Released under the terms of the GNU Lesser General Public License v3.
cmake_minimum_required(
# 3.14: install(TARGETS ARCHIVE [DESTINATION])
VERSION 3.14...${CMAKE_VERSION})
if( CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR AND
NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES
)
set(CMAKE_BUILD_TYPE Release)
endif()
add_compile_options(-Wall
-Wno-format # int != int32_t as far as the compiler is concerned because gcc has int32_t as long int
-Wno-unused-function # we have some for the docs that aren't called
-Ofast
)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/API/Z80.h" _)
string(REGEX MATCH ".*Z80_LIBRARY_VERSION_STRING \"([^\n]*)\".*" _ ${_})
project(Z80
VERSION ${CMAKE_MATCH_1}
LANGUAGES C
DESCRIPTION "Zilog Z80 CPU emulator"
HOMEPAGE_URL "https://zxe.io/software/Z80")
unset(_)
message("${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}: \
Directory or URL of the depot containing the test files.")
option(${PROJECT_NAME}_FETCH_TEST_FILES
"${PROJECT_NAME}: \
Copy or download the test files from the depot to the build directory."
NO)
set(${PROJECT_NAME}_INSTALL_CMAKEDIR
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE STRING
"${PROJECT_NAME}: \
Directory in which to install the CMake config-file package.")
set(${PROJECT_NAME}_INSTALL_PKGCONFIGDIR
"${CMAKE_INSTALL_LIBDIR}/pkgconfig" CACHE STRING
"${PROJECT_NAME}: \
Directory in which to install the pkg-config file.")
set(${PROJECT_NAME}_NOSTDLIB_FLAGS
"Auto" CACHE STRING
"${PROJECT_NAME}: \
Linker flags used to avoid linking against system libraries.")
option(${PROJECT_NAME}_OBJECT_LIBS
"${PROJECT_NAME}: \
Build the emulator as an object library."
NO)
set(${PROJECT_NAME}_SPHINX_HTML_THEME
"" CACHE STRING
"${PROJECT_NAME}: \
Sphinx theme for the documentation in HTML format.")
option(${PROJECT_NAME}_WITH_CMAKE_SUPPORT
"${PROJECT_NAME}: \
Generate and install the CMake config-file package."
NO)
option(${PROJECT_NAME}_WITH_HTML_DOCUMENTATION
"${PROJECT_NAME}: \
Build and install the documentation in HTML format."
NO)
option(${PROJECT_NAME}_WITH_PDF_DOCUMENTATION
"${PROJECT_NAME}: \
Build and install the documentation in PDF format."
NO)
option(${PROJECT_NAME}_WITH_PKGCONFIG_SUPPORT
"${PROJECT_NAME}: \
Generate and install the pkg-config file."
NO)
option(${PROJECT_NAME}_WITH_STANDARD_DOCUMENTS
"${PROJECT_NAME}: \
Install the standard text documents distributed with the package: \
AUTHORS, COPYING, COPYING.LESSER, HISTORY, README and THANKS."
NO)
option(${PROJECT_NAME}_WITH_TESTS
"${PROJECT_NAME}: \
Build the testing tool."
NO)
option(${PROJECT_NAME}_WITH_EXECUTE
"${PROJECT_NAME}: \
Build the implementation of the `z80_execute` function."
NO)
option(${PROJECT_NAME}_WITH_FULL_IM0
"${PROJECT_NAME}: \
Build the full implementation of the interrupt mode 0 rather than the \
reduced one."
NO)
option(${PROJECT_NAME}_WITH_IM0_RETX_NOTIFICATIONS
"${PROJECT_NAME}: \
Enable optional notifications for any `reti` or `retn` instruction \
executed during the interrupt mode 0 response."
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)."
NO)
option(${PROJECT_NAME}_WITH_Q
"${PROJECT_NAME}: \
Build the implementation of Q."
NO)
option(${PROJECT_NAME}_WITH_SPECIAL_RESET
"${PROJECT_NAME}: \
Build the implementation of the special RESET."
NO)
option(${PROJECT_NAME}_WITH_UNOFFICIAL_RETI
"${PROJECT_NAME}: \
Configure the undocumented instructions ED5Dh, ED6Dh and ED7Dh as `reti` \
instead of `retn`."
NO)
option(${PROJECT_NAME}_WITH_ZILOG_NMOS_LD_A_IR_BUG
"${PROJECT_NAME}: \
Build the implementation of the bug affecting the Zilog Z80 NMOS, which \
causes the P/V flag to be reset when a maskable interrupt is accepted \
during the execution of the `ld a,{i|r}` instructions."
NO)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
find_package(Zeta REQUIRED)
if(${PROJECT_NAME}_OBJECT_LIBS)
add_library(${PROJECT_NAME} OBJECT)
else()
if(DEFINED ${PROJECT_NAME}_SHARED_LIBS)
set(BUILD_SHARED_LIBS ${${PROJECT_NAME}_SHARED_LIBS})
endif()
add_library(${PROJECT_NAME})
endif()
target_sources(
${PROJECT_NAME} PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/API/Z80.h"
"${CMAKE_CURRENT_SOURCE_DIR}/sources/Z80.c")
set_target_properties(
${PROJECT_NAME} PROPERTIES
C_STANDARD 99
C_STANDARD_REQUIRED NO
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
DEBUG_POSTFIX "-debug"
PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/API/Z80.h")
target_link_libraries(${PROJECT_NAME} PUBLIC Zeta)
target_include_directories(
${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/API>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
if(${PROJECT_NAME}_OBJECT_LIBS OR NOT BUILD_SHARED_LIBS)
target_compile_definitions(${PROJECT_NAME} PUBLIC Z80_STATIC)
else()
if(WIN32)
if(PROJECT_VERSION_PATCH STREQUAL "")
set(PROJECT_VERSION_PATCH 0)
endif()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/sources/Z80.rc.in"
"${CMAKE_CURRENT_BINARY_DIR}/Z80.rc"
@ONLY)
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_link_options(${PROJECT_NAME} PRIVATE "/NODEFAULTLIB")
elseif(APPLE)
if(CMAKE_C_COMPILER_ID MATCHES "^(AppleClang|Clang|GNU)$")
target_link_options(${PROJECT_NAME} PRIVATE "LINKER:-dead_strip_dylibs")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "^(ARMClang|Clang|GNU|Intel|TinyCC|XL|XLClang)$")
target_link_options(${PROJECT_NAME} PRIVATE "-nostdlib")
elseif(CMAKE_C_COMPILER_ID MATCHES "PGI")
target_link_options(${PROJECT_NAME} PRIVATE "-Mnostdlib")
elseif(CMAKE_C_COMPILER_ID MATCHES "SunPro")
target_link_options(${PROJECT_NAME} PRIVATE "-xnolib")
endif()
elseif(NOT ${PROJECT_NAME}_NOSTDLIB_FLAGS STREQUAL "")
target_link_options(${PROJECT_NAME} PRIVATE ${${PROJECT_NAME}_NOSTDLIB_FLAGS})
endif()
endif()
target_compile_definitions(
${PROJECT_NAME} PRIVATE
$<$<BOOL:${${PROJECT_NAME}_WITH_EXECUTE}>:Z80_WITH_EXECUTE>
$<$<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_Q}>:Z80_WITH_Q>
$<$<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>)
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}_Targets
RUNTIME COMPONENT ${PROJECT_NAME}_Runtime
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
COMPONENT ${PROJECT_NAME}_Runtime
NAMELINK_COMPONENT ${PROJECT_NAME}_Development
ARCHIVE COMPONENT ${PROJECT_NAME}_Development
PUBLIC_HEADER
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(${PROJECT_NAME}_WITH_CMAKE_SUPPORT)
if(BUILD_SHARED_LIBS)
set(_type Shared)
else()
set(_type Static)
endif()
install(EXPORT ${PROJECT_NAME}_Targets
DESTINATION "${${PROJECT_NAME}_INSTALL_CMAKEDIR}"
FILE ${PROJECT_NAME}${_type}Targets.cmake
COMPONENT ${PROJECT_NAME}_Development)
unset(_type)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/support/${PROJECT_NAME}Config.cmake.in"
"${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"
DESTINATION "${${PROJECT_NAME}_INSTALL_CMAKEDIR}"
COMPONENT ${PROJECT_NAME}_Development)
endif()
if(${PROJECT_NAME}_WITH_PKGCONFIG_SUPPORT)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/support/${PROJECT_NAME}.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
@ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION "${${PROJECT_NAME}_INSTALL_PKGCONFIGDIR}"
COMPONENT ${PROJECT_NAME}_Development)
endif()
endif()
if(${PROJECT_NAME}_WITH_STANDARD_DOCUMENTS)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS"
"${CMAKE_CURRENT_SOURCE_DIR}/COPYING"
"${CMAKE_CURRENT_SOURCE_DIR}/COPYING.LESSER"
"${CMAKE_CURRENT_SOURCE_DIR}/HISTORY"
"${CMAKE_CURRENT_SOURCE_DIR}/README"
"${CMAKE_CURRENT_SOURCE_DIR}/THANKS"
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
COMPONENT ${PROJECT_NAME}_Runtime)
endif()
if(${PROJECT_NAME}_WITH_HTML_DOCUMENTATION OR ${PROJECT_NAME}_WITH_PDF_DOCUMENTATION)
add_subdirectory(documentation)
endif()
if(${PROJECT_NAME}_WITH_TESTS)
include(CTest)
find_package(ZLIB QUIET)
find_package(libzip QUIET)
add_executable(test-${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/sources/test-Z80.c")
target_link_libraries(test-${PROJECT_NAME} PRIVATE ${PROJECT_NAME})
if(ZLIB_FOUND AND libzip_FOUND)
target_link_libraries(test-${PROJECT_NAME} PRIVATE ZLIB::ZLIB libzip::zip)
target_compile_definitions(test-${PROJECT_NAME} PRIVATE TEST_Z80_WITH_ARCHIVE_EXTRACTION)
endif()
if(${PROJECT_NAME}_WITH_EXECUTE)
target_compile_definitions(test-${PROJECT_NAME} PRIVATE TEST_Z80_WITH_EXECUTE)
endif()
if(${PROJECT_NAME}_FETCH_TEST_FILES)
function(_fetch_files _file_list _location _destination_dir)
file(STRINGS "${_file_list}" _lines)
if(_location MATCHES ".*://.*")
set(_message_action "Downloading")
else()
set(_message_action "Copying")
get_filename_component(_location "${_location}" ABSOLUTE)
set(_location "file://${_location}")
endif()
foreach(_line ${_lines})
string(STRIP "${_line}" _line)
string(SUBSTRING "${_line}" 0 128 _file_hash)
string(SUBSTRING "${_line}" 130 -1 _file_path)
get_filename_component(_file_name "${_file_path}" NAME)
set(_file_url "${_location}/${_file_path}")
string(REPLACE " " "%20" _file_url "${_file_url}")
string(REPLACE "!" "%21" _file_url "${_file_url}")
string(REPLACE "(" "%28" _file_url "${_file_url}")
string(REPLACE ")" "%29" _file_url "${_file_url}")
string(REPLACE "," "%2C" _file_url "${_file_url}")
string(REPLACE "[" "%5B" _file_url "${_file_url}")
string(REPLACE "]" "%5D" _file_url "${_file_url}")
message(STATUS "${_message_action} \"${_file_name}\"")
file( DOWNLOAD
"${_file_url}"
"${_destination_dir}/${_file_path}"
EXPECTED_HASH SHA3_512=${_file_hash})
if( NOT "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_LESS 3.18 AND
(NOT ZLIB_FOUND OR NOT libzip_FOUND)
)
get_filename_component(_file_extension "${_file_name}" LAST_EXT)
if(_file_extension STREQUAL ".gz" OR _file_extension STREQUAL ".zip")
get_filename_component(_subdirectory "${_file_path}" DIRECTORY)
if(_file_extension STREQUAL ".gz")
set(_extract_pattern "*zex*.com")
else()
set(_extract_pattern "*.tap")
endif()
file( ARCHIVE_EXTRACT
INPUT "${_destination_dir}/${_file_path}"
DESTINATION "${_destination_dir}/${_subdirectory}"
PATTERNS "${_extract_pattern}"
VERBOSE)
endif()
endif()
endforeach()
endfunction()
_fetch_files(
"${CMAKE_CURRENT_SOURCE_DIR}/support/firmware.sha3-512"
"${${PROJECT_NAME}_DEPOT_LOCATION}/firmware"
"${CMAKE_CURRENT_BINARY_DIR}/depot/firmware")
_fetch_files(
"${CMAKE_CURRENT_SOURCE_DIR}/support/software.sha3-512"
"${${PROJECT_NAME}_DEPOT_LOCATION}/software"
"${CMAKE_CURRENT_BINARY_DIR}/depot/software")
if( "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_LESS 3.18 AND
(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/**/`")
endif()
endif()
if(${PROJECT_NAME}_FETCH_TEST_FILES OR ${PROJECT_NAME}_DEPOT_LOCATION MATCHES ".*://.*")
set(_depot_dir "${CMAKE_CURRENT_BINARY_DIR}/depot")
else()
set(_depot_dir "${${PROJECT_NAME}_DEPOT_LOCATION}")
endif()
add_test(
NAME test-${PROJECT_NAME}
COMMAND test-${PROJECT_NAME}
--path "${_depot_dir}/firmware"
--path "${_depot_dir}/software/POSIX"
--path "${_depot_dir}/software/ZX Spectrum"
--all
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
unset(_depot_dir)
endif()
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
message("${PROJECT_NAME} END")
endif()
# CMakeLists.txt EOF

674
projects/Z80/COPYING vendored Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

165
projects/Z80/COPYING.LESSER vendored Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

111
projects/Z80/HISTORY vendored Normal file
View File

@@ -0,0 +1,111 @@
Z80 v0.2-pre (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 license from GPL to LGPL (by popular request).
2. Moved the public header from <emulation/CPU/Z80.h> to <Z80.h>.
3. Removed the Xcode project.
4. Switched the build system from Premake to CMake.
5. Switched to Zeta v0.1.
6. Added pkg-config support.
7. Added the following files to the project: .vimrc, CITATION.cff, file_id.diz
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,
accessing the 16-bit registers and other purposes.
12. 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
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
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`
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
operations during internal NOP M-cycles.
20. 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`
callback, which replaces `Z80::int_data`.
22. 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:
`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
`Z80::hook` callback.
25. 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,
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 `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 (2018-11-10)
=====================
Initial public release.

339
projects/Z80/README vendored Normal file
View File

@@ -0,0 +1,339 @@
________________ ________________ _________________
| /\ | || |
|_______ / / | ____ || ____ |
\_____/ / / | |____| || |___/| |
/ / / | || | | | |
/ / / | ____ || | | | |
/ /_/_____| |____| || |__|_| |
/ || || |
/_______________||________________||________________|
\________________\\______________//________________/
______________________________________________________________________________
| |
| Zilog Z80 CPU Emulator |
| version 0.2 |
| |
| Copyright (C) 1999-2024 Manuel Sainz de Baranda y Goñi |
| Released under the terms of the GNU Lesser General Public License v3 |
| |
| https://zxe.io/software/Z80 |
| |
'=============================================================================='
1. Introduction
================
The Z80 library implements a fast, small and accurate emulator of the Zilog Z80.
It emulates all that is known to date about this CPU, including the undocumented
behaviors, MEMPTR, Q and the special RESET. It also has the honor of having been
the first open-source project to provide full emulation of the interrupt mode 0.
The source code is written in ANSI C for maximum portability and is extensively
commented. The aim has been to write a well-structured, easy-to-understand piece
of software; something solid and elegant that can stand the test of time with no
need for major changes.
2. 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.
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 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, the
findings made after decades of research on the Z80 and electronic simulations.
And, of course, the emulator passes the most exhaustive tests written to date,
such as Frank D. Cringle's "Z80 Instruction Set Exerciser", Mark Woodmass' "Z80
Test Suite", Patrik Rak's "Zilog Z80 CPU Test Suite" and Peter Helcmanovsky's
"Z80 Block Flags Test", to name a few.
3. Installation
================
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
standard library.
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:
$ cmake -LAH
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:
-DBUILD_SHARED_LIBS=(YES|NO)
Generate shared libraries rather than static libraries.
The default is `NO`.
-DCMAKE_BUILD_TYPE=(Debug|Release|RelWithDebInfo|MinSizeRel)
Choose the type of build (configuration) to generate.
The default is `Release`.
-DCMAKE_INSTALL_PREFIX="<path>"
Specify the installation prefix.
The default is `/usr/local` (on UNIX and UNIX-like operating systems).
Package-specific options are prefixed with `Z80_` and can be divided into two
groups. The first one controls aspects not related to the source code of the
library:
-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).
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.
The default is `NO`.
-DZ80_INSTALL_CMAKEDIR="<path>"
Specify the directory in which to install the CMake config-file package.
The default is `"${CMAKE_INSTALL_LIBDIR}/cmake/Z80"`.
-DZ80_INSTALL_PKGCONFIGDIR="<path>"
Specify the directory in which to install the pkg-config file.
The default is `"${CMAKE_INSTALL_LIBDIR}/pkgconfig"`.
-DZ80_NOSTDLIB_FLAGS=(Auto|"[<flag>[;<flag>...]]")
Specify the linker flags used to avoid linking against system libraries.
The default is `Auto` (autoconfigure flags). If you get linker errors,
set this option to `""`.
-DZ80_OBJECT_LIBS=(YES|NO)
Build the emulator as an object library.
This option takes precedence over `BUILD_SHARED_LIBS` and
`Z80_SHARED_LIBS`. If enabled, the build system will ignore
`Z80_WITH_CMAKE_SUPPORT` and `Z80_WITH_PKGCONFIG_SUPPORT`, as no
libraries or support files will be installed.
The default is `NO`.
-DZ80_SHARED_LIBS=(YES|NO)
Build the emulator as a shared library, rather than static.
This option takes precedence over `BUILD_SHARED_LIBS`.
Not defined by default.
-DZ80_SPHINX_HTML_THEME="[<name>]"
Specify the Sphinx theme for the documentation in HTML format.
The default is `""` (use the default theme).
-DZ80_WITH_CMAKE_SUPPORT=(YES|NO)
Generate and install the CMake config-file package.
The default is `NO`.
-DZ80_WITH_HTML_DOCUMENTATION=(YES|NO)
Build and install the documentation in HTML format.
It requires Doxygen, Sphinx and Breathe.
The default is `NO`.
-DZ80_WITH_PDF_DOCUMENTATION=(YES|NO)
Build and install the documentation in PDF format.
It requires Doxygen, Sphinx, Breathe, and LaTeX with PDF support.
The default is `NO`.
-DZ80_WITH_PKGCONFIG_SUPPORT=(YES|NO)
Generate and install the pkg-config file.
The default is `NO`.
-DZ80_WITH_STANDARD_DOCUMENTS=(YES|NO)
Install the standard text documents distributed with the package:
AUTHORS, COPYING, COPYING.LESSER, HISTORY, README and THANKS.
The default is `NO`.
-DZ80_WITH_TESTS=(YES|NO)
Build the testing tool.
The default is `NO`.
The second group of package-specific options configures the source code of the
library by predefining macros that enable optional features:
-DZ80_WITH_EXECUTE=(YES|NO)
Build the implementation of the `z80_execute` function.
The default is `NO`.
-DZ80_WITH_FULL_IM0=(YES|NO)
Build the full implementation of the interrupt mode 0 rather than the
reduced one.
The default is `NO`.
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=(YES|NO)
Enable optional notifications for any `reti` or `retn` instruction
executed during the interrupt mode 0 response.
The default is `NO`.
-DZ80_WITH_Q=(YES|NO)
Build the implementation of Q.
The default is `NO`.
-DZ80_WITH_SPECIAL_RESET=(YES|NO)
Build the implementation of the special RESET.
The default is `NO`.
-DZ80_WITH_UNOFFICIAL_RETI=(YES|NO)
Configure the undocumented instructions ED5Dh, ED6Dh and ED7Dh as `reti`
instead of `retn`.
The default is `NO`.
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=(YES|NO)
Build the implementation of the bug affecting the Zilog Z80 NMOS, which
causes the P/V flag to be reset when a maskable interrupt is accepted
during the execution of the `ld a,{i|r}` instructions.
The default is `NO`.
Package maintainers are encouraged to use at least the following options for the
shared library:
-DZ80_WITH_EXECUTE=YES
-DZ80_WITH_FULL_IM0=YES
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=YES
-DZ80_WITH_Q=YES
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=YES
Finally, once the build system is configured according to your needs, build and
install the package:
$ cmake --build . [--config (Debug|Release|RelWithDebInfo|MinSizeRel)]
# cmake --install . [--config <configuration>] [--strip]
The `--config` option is only necessary for those CMake generators that ignore
`CMAKE_BUILD_TYPE` (e.g., Xcode and Visual Studio). Use `--strip` to remove
debugging information and non-public symbols when installing non-debug builds of
the shared library.
4. Integration
===============
4.1. As an external dependency in CMake-based projects
The Z80 library includes a config-file package for integration into CMake-based
projects that must be installed for development. Use `find_package` to find the
`Z80` package. This creates the `Z80` imported library target, which carries the
necessary transitive link dependencies. Optionally, the linking method can be
selected by specifying either the `Shared` or `Static` component.
Example:
find_package(Z80 REQUIRED Shared)
target_link_libraries(your-target Z80)
When not specified as a component, the linking method is selected according to
`Z80_SHARED_LIBS`. If this option is not defined, the config-file uses the type
of library that is installed on the system and, if it finds both the shared and
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).
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.
Example:
set(Z80_SHARED_LIBS NO CACHE BOOL "")
set(Z80_WITH_Q YES CACHE BOOL "")
set(Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG YES CACHE BOOL "")
add_subdirectory(dependencies/Z80)
target_link_libraries(your-target Z80)
It is important to set the `Z80_SHARED_LIBS` option. Otherwise, CMake will build
the library type indicated by `BUILD_SHARED_LIBS`, which may not be the desired
one.
4.3. Non-CMake-based projects
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"
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.
#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>`.
#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:
#define Z80_WITH_EXECUTE
#define Z80_WITH_FULL_IM0
#define Z80_WITH_IM0_RETX_NOTIFICATIONS
#define Z80_WITH_Q
#define Z80_WITH_SPECIAL_RESET
#define Z80_WITH_UNOFFICIAL_RETI
#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.
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
details).
5. License
===========
This library is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this library. If not, see <http://www.gnu.org/licenses/>.
________________________________________________________________________________
Last update: 2023-12-31 README EOF

881
projects/Z80/README.md vendored Normal file
View File

@@ -0,0 +1,881 @@
# Zilog Z80 CPU Emulator
[![](https://zxe.io/software/Z80/assets/images/documentation-badge.svg)](https://zxe.io/software/Z80/documentation/latest)
[![](https://github.com/redcode/Z80/actions/workflows/build-and-test-library.yml/badge.svg)](https://github.com/redcode/Z80/actions/workflows/build-and-test-library.yml)
[![](https://github.com/redcode/Z80/actions/workflows/build-documentation.yml/badge.svg)](https://github.com/redcode/Z80/actions/workflows/build-documentation.yml)
[![](https://zxe.io/software/Z80/assets/images/chat-badge.svg)](https://zxe.io/software/Z80/chat)
![](https://zxe.io/software/Z80/assets/images/mentioned-in-awesome-badge.svg)
## Introduction
<img src="https://zxe.io/software/Z80/assets/images/Z80.svg" 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.
The source code is written in [ANSI C](https://en.wikipedia.org/wiki/ANSI_C) for maximum portability and is extensively commented. The aim has been to write a well-structured, easy-to-understand piece of software; something solid and elegant that can [stand the test of time](https://web.archive.org/web/20231101002815/https://josem.co/the-beauty-of-finished-software/) with no need for major changes.
## 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).
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.
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:
### <span id="major_test_suites">[Zilog Z80 CPU Test Suite](https://github.com/raxoft/z80test), by [Patrik Rak](https://github.com/raxoft)</span>
This set of programs is intended to help the emulator authors to reach the desired level of the CPU emulation authenticity. Each of the included programs performs an exhaustive computation using each of the tested Z80 instructions, compares the results with values obtained from a real [Sinclair ZX Spectrum 48K](https://en.wikipedia.org/wiki/ZX_Spectrum) with Zilog Z80 CPU, and reports any deviations detected.
<details>
<summary>Results (v1.0)</summary>
<table>
<tr>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20210401091605id_/http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80full.tap</b>
</a>
<br>
<sup>Tests all flags and registers.</sup>
</td>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20210401091605id_/http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80doc.tap</b>
</a>
<br>
<sup>Tests all registers, but only officially documented flags.</sup>
</td>
</tr>
<tr>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.0%20%282012-12-08%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20Full.gif">
</td>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.0%20%282012-12-08%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20Doc.gif">
</td>
</tr>
<tr>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20210401091605id_/http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80flags.tap</b>
</a>
<br>
<sup>Tests all flags, ignores registers.</sup>
</td>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20210401091605id_/http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80docflags.tap</b>
</a>
<br>
<sup>Tests documented flags only, ignores registers.</sup>
</td>
</tr>
<tr>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.0%20%282012-12-08%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20Flags.gif">
</td>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.0%20%282012-12-08%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20Doc%20Flags.gif">
</td>
</tr>
<tr>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20210401091605id_/http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80ccf.tap</b>
</a>
<br>
<sup>Tests all flags after executing <code>ccf</code> after each instruction tested.</sup>
</td>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20210401091605id_/http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80memptr.tap</b>
</a>
<br>
<sup>Tests all flags after executing <code>bit&nbsp;N,(hl)</code> after each instruction tested.</sup>
</td>
</tr>
<tr>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.0%20%282012-12-08%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20CCF.gif">
</td>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.0%20%282012-12-08%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20MEMPTR.gif">
</td>
</tr>
</table>
</details>
<details>
<summary>Results (v1.2a)</summary>
<table>
<tr>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20231202140745id_/http://zxds.raxoft.cz/taps/misc/z80test-1.2a.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80full.tap</b>
</a>
<br>
<sup>Tests all flags and registers.</sup>
</td>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20231202140745id_/http://zxds.raxoft.cz/taps/misc/z80test-1.2a.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80doc.tap</b>
</a>
<br>
<sup>Tests all registers, but only officially documented flags.</sup>
</td>
</tr>
<tr>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.2a%20%282023-12-02%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20Full.gif">
</td>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.2a%20%282023-12-02%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20Doc.gif">
</td>
</tr>
<tr>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20231202140745id_/http://zxds.raxoft.cz/taps/misc/z80test-1.2a.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80flags.tap</b>
</a>
<br>
<sup>Tests all flags, ignores registers.</sup>
</td>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20231202140745id_/http://zxds.raxoft.cz/taps/misc/z80test-1.2a.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80docflags.tap</b>
</a>
<br>
<sup>Tests documented flags only, ignores registers.</sup>
</td>
</tr>
<tr>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.2a%20%282023-12-02%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20Flags.gif">
</td>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.2a%20%282023-12-02%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20Doc%20Flags.gif">
</td>
</tr>
<tr>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20231202140745id_/http://zxds.raxoft.cz/taps/misc/z80test-1.2a.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80ccf.tap</b>
</a>
<br>
<sup>Tests all flags after executing <code>ccf</code> after each instruction tested.</sup>
</td>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20231202140745id_/http://zxds.raxoft.cz/taps/misc/z80test-1.2a.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80memptr.tap</b>
</a>
<br>
<sup>Tests all flags after executing <code>bit&nbsp;N,(hl)</code> after each instruction tested.</sup>
</td>
</tr>
<tr>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.2a%20%282023-12-02%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20CCF.gif">
</td>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Zilog%20Z80%20CPU%20Test%20Suite%20v1.2a%20%282023-12-02%29%28Rak,%20Patrik%29%20-%20Zilog%20-%20MEMPTR.gif">
</td>
</tr>
</table>
</details>
### Z80 Test Suite, by Mark Woodmass
This suite performs a series of tests to verify the MEMPTR documents <sup>_([English](https://zx-pk.ru/attachment.php?attachmentid=2989), [Russian](https://zx-pk.ru/attachment.php?attachmentid=2984))_</sup>, which are spot on, as well as a brief run through several of the `CBh/DDh/FDh` opcode ranges. The test results in the program are compared against those from a [NEC D780C-1](https://www.cpu-world.com/CPUs/Z80/NEC-D780C-1.html) CPU, but Simon Conway kindly tested several other Z80 clones, confirming the same results.
<details>
<summary>Results</summary>
<table>
<tr>
<td align="center" valign="top" colspan="2">
<a href="https://web.archive.org/web/20130511214919id_/http://homepage.ntlworld.com/mark.woodmass/z80tests.tap">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>z80tests.tap</b>
</a>
</td>
</tr>
<tr>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Z80%20Test%20Suite%20%282008%29%28Woodmass,%20Mark%29%20-%20Flags.gif">
</td>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Z80%20Test%20Suite%20%282008%29%28Woodmass,%20Mark%29%20-%20MEMPTR.gif">
</td>
</tr>
</table>
</details>
### Z80 Instruction Set Exerciser, by Frank D. Cringle
Frank Cringle's _Z80 Instruction Set Exerciser_ attempts to execute every Z80 opcode, putting them through a cycle of tests and comparing the results to actual results from running the code on a real Z80. The exerciser is supplied with Frank's [Yaze](ftp://ftp.ping.de/pub/misc/emulators/yaze-1.10.tar.gz) (Yet Another Z80 Emulator). It is often difficult to track down, so [Jonathan Graham Harston](https://mdfs.net/User/JGH) put it together [here](https://mdfs.net/Software/Z80/Exerciser), as well as [some conversions](https://mdfs.net/Software/Z80/Exerciser/Spectrum). The latest release of Yaze is available at [Andreas Gerlich's website](https://www.mathematik.uni-ulm.de/users/ag/yaze-ag).
<details>
<summary>Results (Jonathan Graham Harston's version)</summary>
<table>
<tr>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20200806155334id_/http://mdfs.net/Software/Z80/Exerciser/Spectrum/zexdoc.tap">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>zexdoc.tap</b>
</a>
<br>
<sup>Tests officially documented flag effects.</sup>
</td>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20181216034526id_/http://mdfs.net/Software/Z80/Exerciser/Spectrum/zexall.tap">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>zexall.tap</b>
</a>
<br>
<sup>Tests all flag changes.</sup>
</td>
</tr>
<tr>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Z80%20Documented%20Instruction%20Set%20Exerciser%20for%20Spectrum%20%282018%29%28Harston,%20Jonathan%20Graham%29.gif">
</td>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Z80%20Full%20Instruction%20Set%20Exerciser%20for%20Spectrum%20%282018%29%28Harston,%20Jonathan%20Graham%29.gif">
</td>
</tr>
</table>
</details>
<details>
<summary>Results (Jan Bobrowski's version)</summary>
<table>
<tr>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20120527195857id_/http://wizard.ae.krakow.pl:80/~jb/qaop/t/zexfix.tap">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>zexfix.tap</b>
</a>
<br>
<sup>Tests all flag changes.</sup>
</td>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20120527200327id_/http://wizard.ae.krakow.pl:80/~jb/qaop/t/zexbit.tap">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>zexbit.tap</b>
</a>
<br>
<sup>Tests all flag changes of the <code>bit</code> instructions.</sup>
</td>
</tr>
<tr>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Z80%20Full%20Instruction%20Set%20Exerciser%20for%20Spectrum%20%282009%29%28Bobrowski,%20Jan%29.gif">
</td>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Z80%20Full%20Instruction%20Set%20Exerciser%20for%20Spectrum%20%282011%29%28Bobrowski,%20Jan%29%28Narrowed%20to%20BIT%20Instructions%29.gif">
</td>
</tr>
</table>
</details>
<details>
<summary>Results (Patrik Rak's version)</summary>
<table>
<tr>
<td align="center" valign="top">
<a href="https://web.archive.org/web/20221202204406id_/http://zxds.raxoft.cz/taps/misc/zexall2.zip">
<img src="https://zxe.io/software/Z80/assets/images/tap.svg" width="96"><br>
<b>zexall2.tap</b>
</a>
</td>
</tr>
<tr>
<td align="center" valign="top">
<img src="https://zxe.io/software/Z80/tests/screenshots/ZX%20Spectrum/Z80%20Instruction%20Set%20Exerciser%20for%20Spectrum%202%20v0.1%20%282012-11-27%29%28Rak,%20Patrik%29%20-%20Zilog.gif">
</td>
</tr>
</table>
</details>
## 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
First, add the `zxe` repository and update the package index:
```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
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).
Once the prerequisites are met, create a directory and run `cmake` from there to prepare the build system:
```shell
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:
```shell
cmake -LAH
```
If in doubt, read the [CMake documentation](https://cmake.org/documentation/) for more information on configuration options. The following are some of the most relevant standard options of CMake:
* <span id="cmake_option_build_shared_libs">**<code>-D[BUILD_SHARED_LIBS](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html)=(YES|NO)</code>**</span>
Generate shared libraries rather than static libraries.
The default is `NO`.
* <span id="cmake_option_cmake_build_type">**<code>-D[CMAKE_BUILD_TYPE](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html)=(Debug|Release|RelWithDebInfo|MinSizeRel)</code>**</span>
Choose the type of build (configuration) to generate.
The default is `Release`.
* <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).
<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)).
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.
The default is `NO`.
* <span id="cmake_option_z80_install_cmakedir">**`-DZ80_INSTALL_CMAKEDIR="<path>"`**</span>
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).
The default is <code>"${[CMAKE_INSTALL_LIBDIR](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html)}/cmake/Z80"</code>.
* <span id="cmake_option_z80_install_pkgconfigdir">**`-DZ80_INSTALL_PKGCONFIGDIR="<path>"`**</span>
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).
The default is <code>"${[CMAKE_INSTALL_LIBDIR](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html)}/pkgconfig"</code>.
* <span id="cmake_option_z80_nostdlib_flags">**`-DZ80_NOSTDLIB_FLAGS=(Auto|"[<flag>[;<flag>...]]")`**</span>
Specify the linker flags used to avoid linking against system libraries.
The default is `Auto` (autoconfigure flags). If you get linker errors, set this option to `""`.
* <span id="cmake_option_z80_object_libs">**`-DZ80_OBJECT_LIBS=(YES|NO)`**</span>
Build the emulator as an [object library](https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#object-libraries).
This option takes precedence over [`BUILD_SHARED_LIBS`](#cmake_option_build_shared_libs) and [`Z80_SHARED_LIBS`](#cmake_option_z80_shared_libs). If enabled, the build system will ignore [`Z80_WITH_CMAKE_SUPPORT`](#cmake_option_z80_with_cmake_support) and [`Z80_WITH_PKGCONFIG_SUPPORT`](#cmake_option_z80_with_pkgconfig_support), as no libraries or support files will be installed.
The default is `NO`.
* <span id="cmake_option_z80_shared_libs">**`-DZ80_SHARED_LIBS=(YES|NO)`**</span>
Build the emulator as a shared library, rather than static.
This option takes precedence over [`BUILD_SHARED_LIBS`](#cmake_option_build_shared_libs).
Not defined by default.
* <span id="cmake_option_z80_sphinx_html_theme">**`-DZ80_SPHINX_HTML_THEME="[<name>]"`**</span>
Specify the Sphinx theme for the documentation in HTML format.
The default is `""` (use the default theme).
* <span id="cmake_option_z80_with_cmake_support">**`-DZ80_WITH_CMAKE_SUPPORT=(YES|NO)`**</span>
Generate and install the CMake [config-file package](https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#config-file-packages).
The default is `NO`.
* <span id="cmake_option_z80_with_html_documentation">**`-DZ80_WITH_HTML_DOCUMENTATION=(YES|NO)`**</span>
Build and install the documentation in HTML format.
It requires Doxygen, Sphinx and Breathe.
The default is `NO`.
* <span id="cmake_option_z80_with_pdf_documentation">**`-DZ80_WITH_PDF_DOCUMENTATION=(YES|NO)`**</span>
Build and install the documentation in PDF format.
It requires Doxygen, Sphinx, Breathe, and LaTeX with PDF support.
The default is `NO`.
* <span id="cmake_option_z80_with_pkgconfig_support">**`-DZ80_WITH_PKGCONFIG_SUPPORT=(YES|NO)`**</span>
Generate and install the [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config) [file](https://people.freedesktop.org/~dbn/pkg-config-guide.html).
The default is `NO`.
* <span id="cmake_option_z80_with_standard_documents">**`-DZ80_WITH_STANDARD_DOCUMENTS=(YES|NO)`**</span>
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).
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.
The default is `NO`.
* <span id="cmake_option_z80_with_full_im0">**`-DZ80_WITH_FULL_IM0=(YES|NO)`**</span>
Build the full implementation of the interrupt mode 0 rather than the reduced one.
The default is `NO`.
* <span id="cmake_option_z80_with_im0_retx_notifications">**`-DZ80_WITH_IM0_RETX_NOTIFICATIONS=(YES|NO)`**</span>
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_q">**`-DZ80_WITH_Q=(YES|NO)`**</span>
Build the implementation of [Q](https://worldofspectrum.org/forums/discussion/41704).
The default is `NO`.
* <span id="cmake_option_z80_with_special_reset">**`-DZ80_WITH_SPECIAL_RESET=(YES|NO)`**</span>
Build the implementation of the [special RESET](http://www.primrosebank.net/computers/z80/z80_special_reset.htm).
The default is `NO`.
* <span id="cmake_option_z80_with_unofficial_reti">**`-DZ80_WITH_UNOFFICIAL_RETI=(YES|NO)`**</span>
Configure the undocumented instructions `ED5Dh`, `ED6Dh` and `ED7Dh` as `reti` instead of `retn`.
The default is `NO`.
* <span id="cmake_option_z80_with_zilog_nmos_ld_a_ir_bug">**`-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=(YES|NO)`**</span>
Build the implementation of the bug affecting the Zilog Z80 NMOS, which causes the P/V flag to be reset when a maskable interrupt is accepted during the execution of the <code>ld&nbsp;a,{i|r}</code> instructions.
The default is `NO`.
Package maintainers are encouraged to use at least the following options for the shared library:
```
-DZ80_WITH_EXECUTE=YES
-DZ80_WITH_FULL_IM0=YES
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=YES
-DZ80_WITH_Q=YES
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=YES
```
Finally, once the build system is configured according to your needs, build and install the package:
```shell
cmake --build . [--config (Debug|Release|RelWithDebInfo|MinSizeRel)]
cmake --install . [--config <configuration>] [--strip]
```
The [`--config`](https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-build-config) option is only necessary for those [CMake generators](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) that ignore [`CMAKE_BUILD_TYPE`](#cmake_option_cmake_build_type) (e.g., Xcode and Visual Studio). Use [`--strip`](https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-install-strip) to remove debugging information and non-public symbols when installing non-debug builds of the shared library.
### TL;DR
Use the following to build the emulator as a shared library and install it along with the development files into `$HOME/.local`:
```shell
mkdir work && cd work
git clone https://github.com/redcode/Zeta.git
git clone https://github.com/redcode/Z80.git
cd Zeta
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
-DZeta_WITH_CMAKE_SUPPORT=YES \
-DZeta_WITH_PKGCONFIG_SUPPORT=YES \
..
cmake --install . --config Release
cd ../../Z80
mkdir build && cd build
cmake \
-DBUILD_SHARED_LIBS=YES \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
-DZ80_WITH_CMAKE_SUPPORT=YES \
-DZ80_WITH_PKGCONFIG_SUPPORT=YES \
-DZ80_WITH_EXECUTE=YES \
-DZ80_WITH_FULL_IM0=YES \
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=YES \
-DZ80_WITH_Q=YES \
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=YES \
..
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>
## 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).
Once you have built the package, type the following to run all tests:
```shell
./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&nbsp;-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:
```shell
ctest --verbose --build-config (Debug|Release|RelWithDebInfo|MinSizeRel)
```
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).
### TL;DR
Use the following to build and test the emulator:
```shell
mkdir work && cd work
git clone https://github.com/redcode/Zeta.git
git clone https://github.com/redcode/Z80.git
cd Z80
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DZ80_FETCH_TEST_FILES=YES \
-DZ80_WITH_TESTS=YES \
-DZ80_WITH_EXECUTE=YES \
-DZ80_WITH_FULL_IM0=YES \
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=YES \
-DZ80_WITH_Q=YES \
-DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=YES \
..
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) &nbsp;&nbsp; [<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>
## Integration
### As an external dependency in CMake-based projects
The Z80 library [includes](#cmake_option_z80_with_cmake_support) a [config-file package](https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#config-file-packages) for integration into CMake-based projects that must be installed for development. Use [`find_package`](https://cmake.org/cmake/help/latest/command/find_package.html) to find the `Z80` package. This creates the `Z80` imported library target, which carries the necessary transitive link dependencies. Optionally, the linking method can be selected by specifying either the `Shared` or `Static` component.
Example:
```cmake
find_package(Z80 REQUIRED Shared)
target_link_libraries(your-target Z80)
```
When not specified as a component, the linking method is selected according to [`Z80_SHARED_LIBS`](#cmake_option_z80_shared_libs). If this option is not defined, the config-file uses the type of library that is installed on the system and, if it finds both the shared and the static versions, [`BUILD_SHARED_LIBS`](#cmake_option_build_shared_libs) determines which one to link against.
### 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)).
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.
Example:
```cmake
set(Z80_SHARED_LIBS NO CACHE BOOL "")
set(Z80_WITH_Q YES CACHE BOOL "")
set(Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG YES CACHE BOOL "")
add_subdirectory(dependencies/Z80)
target_link_libraries(your-target Z80)
```
It is important to set the [`Z80_SHARED_LIBS`](#cmake_option_z80_shared_libs) option. Otherwise, CMake will build the library type indicated by [`BUILD_SHARED_LIBS`](#cmake_option_build_shared_libs), which may not be the desired one.
### Non-CMake-based projects
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>
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.
* <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>`.
* <span id="macro_z80_with_local_header">**`#define Z80_WITH_LOCAL_HEADER`**</span>
Tells `Z80.c` to <code>#include&nbsp;"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):
* **<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_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.
> [!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).
## 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)
* **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)
* **[Google Capture the Flag (2021)](https://capturetheflag.withgoogle.com)** <sub>_by [Google](https://www.google.com)_</sub> ⟩ [GitHub](https://github.com/google/google-ctf)
* **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)
* **[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)
* **Zemu** <sub>_by [Jay Valentine](https://jayvalentine.github.io/)_</sub> ⟩ [GitHub](https://github.com/jayvalentine/zemu) · [RubyGems](https://rubygems.org/gems/zemu)
## Thanks
Many thanks to the following individuals (in alphabetical order):
* **Akimov, Vadim (lvd)**
* For testing the library on many different platforms and CPU architectures.
* **azesmbog** <sup>:trophy:</sup>
1. For validating tests on real hardware. <sup>[1](#r1)</sup>
2. For discovering the unstable behavior of the `ccf/scf` instructions.
3. 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>
* **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>
* **boo_boo** <sup>:trophy:</sup>
* For cracking the behavior of the MEMPTR register. <sup>[6](#r6), [7](#r7), [8](#r8), [9](#r9)</sup>
* **Brady, Stuart**
* For his research on the behavior of the `ccf/scf` instructions. <sup>[10](#r10)</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>
4. For helping me to test different undocumented behaviors of the Zilog Z80.
* **Bystrov, Dmitry (Alone Coder)**
* For validating tests on real hardware. <sup>[4](#r4)</sup>
* **Chandler, Richard**
1. For his corrections to the documentation.
2. For validating tests on real hardware. <sup>[13](#r13)</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>
* **Conway, Simon (BadBeard)**
* For validating the _"Z80 Test Suite"_ on several Z80 clones. <sup>[14](#r14)</sup>
* **Cooke, Simon** <sup>:trophy:</sup>
* For discovering how the <code>out&nbsp;(c),0</code> instruction behaves on the Zilog Z80 CMOS. <sup>[15](#r15)</sup>
* **Cringle, Frank D.**
* For writing the _"Z80 Instruction Set Exerciser"_. <sup>[16](#r16)</sup>
* **Devic, Goran**
* For his research on undocumented behaviors of the Z80 CPU. <sup>[17](#r17)</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>
* **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>
* **Greenway, Ian**
* For testing the behavior of the `ccf/scf` instructions on real hardware. <sup>[10](#r10), [22](#r22)</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>
* **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.
* **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>
* **ICEknight**
* For validating tests on real hardware.
* **Kladov, Vladimir** <sup>:trophy:</sup>
* For cracking the behavior of the MEMPTR register. <sup>[6](#r6), [7](#r7), [8](#r8), [9](#r9)</sup>
* **Krook, Magnus**
* For validating tests on real hardware. <sup>[29](#r29)</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>
* **Nair, Arjun**
* For validating tests on real hardware. <sup>[27](#r27)</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.
* **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>
* **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>
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>
* **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. <sup>[34](#r34), [35](#r35)</sup>
* **Sevillano Mancilla, Marta (TheMartian)**
* For validating tests on real hardware. <sup>[13](#r13)</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>
* **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>
* **Wilkinson, Oli (evolutional)**
* For validating tests on real hardware. <sup>[27](#r27)</sup>
* **Wlodek**
* For testing the behavior of the MEMPTR register on real Z80 chips. <sup>[6](#r6), [7](#r7), [8](#r8), [9](#r9)</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.
* **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>
* **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
* 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://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>
* 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>
* 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>
* http://z80.info/interrup.htm
19. <span id="r19">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>
* 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>
* http://zxds.raxoft.cz/taps/misc/zexall2.zip
32. <span id="r32">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>
* 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"_.
* http://www.msxnet.org/tech/Z80/z80.zip
## License
Copyright © 1999-2024 Manuel Sainz de Baranda y Goñi.
<img src="https://zxe.io/software/Z80/assets/images/lgplv3.svg" 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.
**This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE**. See the GNU Lesser General Public License for more details.
You should have received a [copy](COPYING.LESSER) of the GNU Lesser General Public License along with this library. If not, see <https://www.gnu.org/licenses/>.
## Special licensing
Projects where the terms of the GNU Lesser General Public License prevent the use of this library, or require unwanted publication of the source code of commercial products, may [apply for a special license](mailto:manuel@zxe.io?subject=Z80).

203
projects/Z80/THANKS vendored Normal file
View File

@@ -0,0 +1,203 @@
Many thanks to the following individuals (in alphabetical order):
* Akimov, Vadim (lvd)
For testing the library on many different platforms and CPU architectures.
* azesmbog
1. For validating tests on real hardware [1].
2. For 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 [2,3].
2. For his research on the behavior of the `ccf/scf` instructions [3].
* Beliansky, Anatoly (Tolik_Trek)
For validating tests on real hardware [4].
* Bobrowski, Jan
For fixing the "Z80 Full Instruction Set Exerciser for Spectrum" [5].
* boo_boo
For cracking the behavior of the MEMPTR register [6,7,8,9].
* Brady, Stuart
For his research on the behavior of the `ccf/scf` instructions [10].
* 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].
4. For helping me to test different undocumented behaviors of the Zilog Z80.
* Bystrov, Dmitry (Alone Coder)
For validating tests on real hardware [4].
* Chandler, Richard
1. For his corrections to the documentation.
2. For validating tests on real hardware [13].
* Chunin, Roman (CHRV)
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
* Conway, Simon (BadBeard)
For validating the "Z80 Test Suite" on several Z80 clones [14].
* Cooke, Simon
For discovering how the `out (c),0` instruction behaves on the Zilog Z80
CMOS [15].
* Cringle, Frank D.
For writing the "Z80 Instruction Set Exerciser" [16].
* Devic, Goran
For his research on undocumented behaviors of the Z80 CPU [17].
* 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].
* 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].
* Greenway, Ian
For testing the behavior of the `ccf/scf` instructions on real hardware [10,
22].
* 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].
* 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.
* 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].
* ICEknight
For validating tests on real hardware.
* Kladov, Vladimir
For cracking the behavior of the MEMPTR register [6,7,8,9].
* Krook, Magnus
For validating tests on real hardware [29].
* 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].
* Nair, Arjun
For validating tests on real hardware [27].
* 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 [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].
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].
* 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 [34,35].
* Sevillano Mancilla, Marta (TheMartian)
For validating tests on real hardware [13].
* Stevenson, Dave
1. For testing the special RESET on real hardware [11].
2. For conducting low-level tests on real hardware [36].
* 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].
* Wilkinson, Oli (evolutional)
For validating tests on real hardware [27].
* Wlodek
For testing the behavior of the MEMPTR register on real Z80 chips [6,7,8,9].
* Woodmass, Mark (Woody)
1. For his invaluable contributions to the emuscene.
2. For writing the "Z80 Test Suite" [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.
* Young, Sean
1. For his research work.
2. For his technical documents about the Zilog Z80 [19,30,40].
* ZXGuesser
For validating tests on real hardware.
References
==========
1. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83384#p83384
2. https://stardot.org.uk/forums/viewtopic.php?t=15464
* https://stardot.org.uk/forums/viewtopic.php?p=211042#p211042
* https://stardot.org.uk/forums/viewtopic.php?p=212021#p212021
3. Banks, David (2018-08-21). "Undocumented Z80 Flags" rev. 1.0.
* https://github.com/hoglet67/Z80Decoder/wiki/Undocumented-Flags
* https://stardot.org.uk/forums/download/file.php?id=39831
4. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83041#p83041
5. http://wizard.ae.krakow.pl/~jb/qaop/tests.html
6. https://zxpress.ru/zxnet/zxnet.pc/5909
7. https://zx-pk.ru/threads/2506-komanda-bit-n-(hl).html
8. https://zx-pk.ru/threads/2586-prosba-realshchikam-ot-emulyatorshchikov.html
9. boo_boo; Kladov, Vladimir (2006-03-29). "MEMPTR, Esoteric Register of the
Zilog Z80 CPU".
* 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".
* 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.
* 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".
* http://z80.info/interrup.htm
19. 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
Undocumented Opcodes" v0.11 (revised).
* https://mdfs.net/Docs/Comp/Z80/OpList
24. 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
28. https://github.com/MrKWatkins/ZXSpectrumNextTests
29. https://spectrumcomputing.co.uk/forums/viewtopic.php?p=83157#p83157
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. https://worldofspectrum.org/forums/discussion/41704
* http://zxds.raxoft.cz/taps/misc/zexall2.zip
32. https://worldofspectrum.org/forums/discussion/41834
* http://zxds.raxoft.cz/taps/misc/z80test-1.0.zip
* https://github.com/raxoft/z80test
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".
* 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".
* http://www.msxnet.org/tech/Z80/z80.zip

View File

@@ -0,0 +1,181 @@
=============
API reference
=============
.. code-block:: c
#include <Z80.h>
Types
=====
Callback pointers
-----------------
.. doxygentypedef:: Z80Read
.. doxygentypedef:: Z80Write
.. doxygentypedef:: Z80Halt
.. doxygentypedef:: Z80Notify
.. doxygentypedef:: Z80Illegal
Emulator object
---------------
.. doxygenstruct:: Z80
:members:
Functions
=========
Powering the CPU
----------------
.. doxygenfunction:: z80_power
Running the emulation
---------------------
.. doxygenfunction:: z80_execute
.. doxygenfunction:: z80_run
Stopping the emulation
----------------------
.. doxygenfunction:: z80_break
Requesting interrupts
---------------------
.. doxygenfunction:: z80_int
.. doxygenfunction:: z80_nmi
.. doxygenfunction:: z80_instant_reset
.. doxygenfunction:: z80_special_reset
Obtaining information
---------------------
.. doxygenfunction:: z80_in_cycle
.. doxygenfunction:: z80_out_cycle
.. doxygenfunction:: z80_r
.. doxygenfunction:: z80_refresh_address
Macros
======
Library version
---------------
.. doxygendefine:: Z80_LIBRARY_VERSION_MAJOR
.. doxygendefine:: Z80_LIBRARY_VERSION_MINOR
.. doxygendefine:: Z80_LIBRARY_VERSION_MICRO
.. doxygendefine:: Z80_LIBRARY_VERSION_STRING
Limits
------
.. doxygendefine:: Z80_MAXIMUM_CYCLES
.. doxygendefine:: Z80_MAXIMUM_CYCLES_PER_STEP
.. doxygendefine:: Z80_MINIMUM_CYCLES_PER_STEP
Opcodes
-------
.. doxygendefine:: Z80_HOOK
Flags
-----
.. doxygendefine:: Z80_SF
.. doxygendefine:: Z80_ZF
.. doxygendefine:: Z80_YF
.. doxygendefine:: Z80_HF
.. doxygendefine:: Z80_XF
.. doxygendefine:: Z80_PF
.. doxygendefine:: Z80_NF
.. doxygendefine:: Z80_CF
Configuration
-------------
.. doxygendefine:: Z80_OPTION_HALT_SKIP
.. doxygendefine:: Z80_OPTION_IM0_RETX_NOTIFICATIONS
.. doxygendefine:: Z80_OPTION_LD_A_IR_BUG
.. doxygendefine:: Z80_OPTION_OUT_VC_255
.. doxygendefine:: Z80_OPTION_XQ
.. doxygendefine:: Z80_OPTION_YQ
.. doxygendefine:: Z80_MODEL_ZILOG_NMOS
.. doxygendefine:: Z80_MODEL_ZILOG_CMOS
.. doxygendefine:: Z80_MODEL_NEC_NMOS
.. doxygendefine:: Z80_MODEL_ST_CMOS
Requests
--------
.. doxygendefine:: Z80_REQUEST_INT
.. doxygendefine:: Z80_REQUEST_NMI
.. doxygendefine:: Z80_REQUEST_REJECT_NMI
.. doxygendefine:: Z80_REQUEST_SPECIAL_RESET
Resume codes
------------
Sometimes the emulator runs out of clock cycles while performing long tasks that can exceed :c:macro:`Z80_MAXIMUM_CYCLES_PER_STEP`. In these cases, the emulation stops and :c:data:`Z80::resume<Z80.resume>` is set to one of the following values:
.. doxygendefine:: Z80_RESUME_HALT
.. doxygendefine:: Z80_RESUME_XY
.. doxygendefine:: Z80_RESUME_IM0_XY
HALT state codes
----------------
.. doxygendefine:: Z80_HALT_EXIT_EARLY
.. doxygendefine:: Z80_HALT_CANCEL
Register accessors
------------------
.. doxygendefine:: Z80_MEMPTR
.. doxygendefine:: Z80_WZ
.. doxygendefine:: Z80_PC
.. doxygendefine:: Z80_SP
.. doxygendefine:: Z80_XY
.. doxygendefine:: Z80_IX
.. doxygendefine:: Z80_IY
.. doxygendefine:: Z80_AF
.. doxygendefine:: Z80_BC
.. doxygendefine:: Z80_DE
.. doxygendefine:: Z80_HL
.. doxygendefine:: Z80_AF_
.. doxygendefine:: Z80_BC_
.. doxygendefine:: Z80_DE_
.. doxygendefine:: Z80_HL_
.. doxygendefine:: Z80_MEMPTRH
.. doxygendefine:: Z80_MEMPTRL
.. doxygendefine:: Z80_WZH
.. doxygendefine:: Z80_WZL
.. doxygendefine:: Z80_PCH
.. doxygendefine:: Z80_PCL
.. doxygendefine:: Z80_SPH
.. doxygendefine:: Z80_SPL
.. doxygendefine:: Z80_XYH
.. doxygendefine:: Z80_XYL
.. doxygendefine:: Z80_IXH
.. doxygendefine:: Z80_IXL
.. doxygendefine:: Z80_IYH
.. doxygendefine:: Z80_IYL
.. doxygendefine:: Z80_A
.. doxygendefine:: Z80_F
.. doxygendefine:: Z80_B
.. doxygendefine:: Z80_C
.. doxygendefine:: Z80_D
.. doxygendefine:: Z80_E
.. doxygendefine:: Z80_H
.. doxygendefine:: Z80_L
.. doxygendefine:: Z80_A_
.. doxygendefine:: Z80_F_
.. doxygendefine:: Z80_B_
.. doxygendefine:: Z80_C_
.. doxygendefine:: Z80_D_
.. doxygendefine:: Z80_E_
.. doxygendefine:: Z80_H_
.. doxygendefine:: Z80_L_

View File

@@ -0,0 +1,128 @@
# Z80 - documentation/CMakeLists.txt
# ______ ______ ______
# /\___ \/\ __ \\ __ \
# \/__/ /\_\ __ \\ \/\ \
# /\_____\\_____\\_____\
# Zilog \/_____//_____//_____/ CPU Emulator
# Copyright (C) 1999-2024 Manuel Sainz de Baranda y Goñi.
# Released under the terms of the GNU Lesser General Public License v3.
find_package(Doxygen REQUIRED)
find_package(Sphinx REQUIRED)
find_package(Breathe REQUIRED)
set(_api_xml_output "${CMAKE_CURRENT_BINARY_DIR}/API-XML")
set(DOXYGEN_BRIEF_MEMBER_DESC YES )
set(DOXYGEN_ENABLE_PREPROCESSING YES )
set(DOXYGEN_EXPAND_ONLY_PREDEF NO )
set(DOXYGEN_FILE_PATTERNS "*.h" )
set(DOXYGEN_FULL_PATH_NAMES YES )
set(DOXYGEN_GENERATE_DOCBOOK NO )
set(DOXYGEN_GENERATE_HTML NO )
set(DOXYGEN_GENERATE_LATEX NO )
set(DOXYGEN_GENERATE_MAN NO )
set(DOXYGEN_GENERATE_RTF NO )
set(DOXYGEN_GENERATE_XML YES )
set(DOXYGEN_INLINE_INFO YES )
set(DOXYGEN_INPUT_ENCODING "UTF-8" )
set(DOXYGEN_MACRO_EXPANSION YES )
set(DOXYGEN_MARKDOWN_SUPPORT YES )
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES )
set(DOXYGEN_PREDEFINED "Z_ALWAYS_INLINE=inline" )
set(DOXYGEN_REPEAT_BRIEF YES )
set(DOXYGEN_SEARCH_INCLUDES YES )
set(DOXYGEN_SHOW_INCLUDE_FILES YES )
set(DOXYGEN_SKIP_FUNCTION_MACROS NO )
set(DOXYGEN_STRIP_FROM_PATH "${PROJECT_SOURCE_DIR}/API")
set(DOXYGEN_WARN_IF_DOC_ERROR YES )
set(DOXYGEN_WARN_IF_UNDOCUMENTED YES )
set(DOXYGEN_WARNINGS YES )
set(DOXYGEN_XML_OUTPUT "API-XML" )
set(DOXYGEN_XML_PROGRAMLISTING YES )
get_target_property(DOXYGEN_INCLUDE_PATH Zeta INTERFACE_INCLUDE_DIRECTORIES)
doxygen_add_docs(
${PROJECT_NAME}-API-XML
"${PROJECT_SOURCE_DIR}/API"
ALL
COMMENT "Extracting API reference from ${PROJECT_NAME}")
if(${PROJECT_NAME}_WITH_HTML_DOCUMENTATION)
set(_html_documentation_output "${CMAKE_CURRENT_BINARY_DIR}/HTML")
if(${PROJECT_NAME}_SPHINX_HTML_THEME STREQUAL "")
set(_html_theme_option "")
else()
set(_html_theme_option "-Dhtml_theme=${${PROJECT_NAME}_SPHINX_HTML_THEME}")
endif()
add_custom_command(
OUTPUT "${_html_documentation_output}"
COMMAND "${SPHINX_BUILD_EXECUTABLE}"
-b html
${_html_theme_option}
-Dbreathe_projects.${PROJECT_NAME}="${_api_xml_output}"
"${CMAKE_CURRENT_SOURCE_DIR}"
"${_html_documentation_output}"
DEPENDS ${PROJECT_NAME}-API-XML
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Generating documentation in HTML format for ${PROJECT_NAME}")
add_custom_target(
${PROJECT_NAME}-Documentation-HTML ALL
DEPENDS "${_html_documentation_output}")
add_dependencies(${PROJECT_NAME}-Documentation-HTML ${PROJECT_NAME}-API-XML)
install(DIRECTORY "${_html_documentation_output}/"
DESTINATION "${CMAKE_INSTALL_DOCDIR}/documentation"
COMPONENT ${PROJECT_NAME}_Documentation)
endif()
if(${PROJECT_NAME}_WITH_PDF_DOCUMENTATION)
find_package(LATEX REQUIRED COMPONENTS PDFLATEX)
set(_latex_documentation_output "${CMAKE_CURRENT_BINARY_DIR}/LaTeX")
add_custom_command(
OUTPUT "${_latex_documentation_output}"
COMMAND "${SPHINX_BUILD_EXECUTABLE}"
-b latex
-Dbreathe_projects.${PROJECT_NAME}="${_api_xml_output}"
"${CMAKE_CURRENT_SOURCE_DIR}"
"${_latex_documentation_output}"
DEPENDS ${PROJECT_NAME}-API-XML
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Generating documentation in LaTeX format for ${PROJECT_NAME}")
add_custom_target(
${PROJECT_NAME}-Documentation-LaTeX ALL
DEPENDS "${_latex_documentation_output}")
add_dependencies(${PROJECT_NAME}-Documentation-LaTeX ${PROJECT_NAME}-API-XML)
string(TOLOWER ${PROJECT_NAME} _pdf_documentation_output)
set(_pdf_documentation_output "${_latex_documentation_output}/${_pdf_documentation_output}.pdf")
add_custom_command(
OUTPUT "${_pdf_documentation_output}"
COMMAND "${CMAKE_MAKE_PROGRAM}"
MAIN_DEPENDENCY "${_latex_documentation_output}"
WORKING_DIRECTORY "${_latex_documentation_output}"
COMMENT "Generating documentation in PDF format for ${PROJECT_NAME}")
add_custom_target(
${PROJECT_NAME}-Documentation-PDF ALL
DEPENDS "${_pdf_documentation_output}")
add_dependencies(${PROJECT_NAME}-Documentation-PDF ${PROJECT_NAME}-Documentation-LaTeX)
install(FILES "${_pdf_documentation_output}"
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
RENAME "${PROJECT_NAME} v${PROJECT_VERSION}.pdf"
COMPONENT ${PROJECT_NAME}_Documentation)
endif()
# documentation/CMakeLists.txt EOF

View File

@@ -0,0 +1,223 @@
============
Installation
============
.. only:: html
.. |br| raw:: html
<br />
.. only:: latex
.. |nl| raw:: latex
\newline
.. |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
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>`_.
Configure
=========
Once the prerequisites are met, create a directory and run ``cmake`` from there to prepare the build system:
.. code-block:: sh
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:
.. code-block:: sh
cmake -LAH
If in doubt, read the `CMake documentation <https://cmake.org/documentation/>`_ for more information on configuration options. The following are some of the most relevant standard options of CMake:
.. option:: -DBUILD_SHARED_LIBS=(YES|NO)
Generate shared libraries rather than static libraries. |br| |nl|
The default is ``NO``.
.. option:: -DCMAKE_BUILD_TYPE=(Debug|Release|RelWithDebInfo|MinSizeRel)
Choose the type of build (configuration) to generate. |br| |nl|
The default is ``Release``.
.. option:: -DCMAKE_INSTALL_PREFIX="<path>"
Specify the installation prefix. |br| |nl|
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).
.. _cmake_package_options:
Package-specific options are prefixed with ``Z80_`` and can be divided into two groups. The first one controls aspects not related to the source code of the library:
.. option:: -DZ80_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|
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|
The default is ``NO``.
.. option:: -DZ80_INSTALL_CMAKEDIR="<path>"
Specify the directory in which to install the CMake `config-file package <https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#config-file-packages>`_. |br| |nl|
The default is ``"${CMAKE_INSTALL_LIBDIR}/cmake/Z80"``.
.. option:: -DZ80_INSTALL_PKGCONFIGDIR="<path>"
Specify the directory in which to install the `pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config>`_ `file <https://people.freedesktop.org/~dbn/pkg-config-guide.html>`_. |br| |nl|
The default is ``"${CMAKE_INSTALL_LIBDIR}/pkgconfig"``.
.. option:: -DZ80_NOSTDLIB_FLAGS=(Auto|"[<flag>[;<flag>...]]")
Specify the linker flags used to avoid linking against system libraries. |br| |nl|
The default is ``Auto`` (autoconfigure flags). If you get linker errors, set this option to ``""``.
.. option:: -DZ80_OBJECT_LIBS=(YES|NO)
Build the emulator as an `object library <https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#object-libraries>`_. |br| |nl|
This option takes precedence over :option:`BUILD_SHARED_LIBS<-DBUILD_SHARED_LIBS>` and :option:`Z80_SHARED_LIBS<-DZ80_SHARED_LIBS>`. If enabled, the build system will ignore :option:`Z80_WITH_CMAKE_SUPPORT<-DZ80_WITH_CMAKE_SUPPORT>` and :option:`Z80_WITH_PKGCONFIG_SUPPORT<-DZ80_WITH_PKGCONFIG_SUPPORT>`, as no libraries or support files will be installed. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_SHARED_LIBS=(YES|NO)
Build the emulator as a shared library, rather than static. |br| |nl|
This option takes precedence over :option:`BUILD_SHARED_LIBS<-DBUILD_SHARED_LIBS>`. |br| |nl|
Not defined by default.
.. option:: -DZ80_SPHINX_HTML_THEME="[<name>]"
Specify the Sphinx theme for the documentation in HTML format. |br| |nl|
The default is ``""`` (use the default theme).
.. option:: -DZ80_WITH_CMAKE_SUPPORT=(YES|NO)
Generate and install the CMake `config-file package <https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#config-file-packages>`_. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_HTML_DOCUMENTATION=(YES|NO)
Build and install the documentation in HTML format. |br| |nl|
It requires Doxygen, Sphinx and Breathe. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_PDF_DOCUMENTATION=(YES|NO)
Build and install the documentation in PDF format. |br| |nl|
It requires Doxygen, Sphinx, Breathe, and LaTeX with PDF support. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_PKGCONFIG_SUPPORT=(YES|NO)
Generate and install the `pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config>`_ `file <https://people.freedesktop.org/~dbn/pkg-config-guide.html>`_. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_STANDARD_DOCUMENTS=(YES|NO)
Install the standard text documents distributed with the package: :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)
Build the :doc:`testing tool <Tests>`. |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>`:
.. option:: -DZ80_WITH_EXECUTE=(YES|NO)
Build the implementation of the :c:func:`z80_execute` function. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_FULL_IM0=(YES|NO)
Build the full implementation of the interrupt mode 0 rather than the reduced one. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_IM0_RETX_NOTIFICATIONS=(YES|NO)
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_Q=(YES|NO)
Build the implementation of `Q <https://worldofspectrum.org/forums/discussion/41704>`_. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_SPECIAL_RESET=(YES|NO)
Build the implementation of the `special RESET <http://www.primrosebank.net/computers/z80/z80_special_reset.htm>`_. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_UNOFFICIAL_RETI=(YES|NO)
Configure the undocumented instructions ``ED5Dh``, ``ED6Dh`` and ``ED7Dh`` as ``reti`` instead of ``retn``. |br| |nl|
The default is ``NO``.
.. option:: -DZ80_WITH_ZILOG_NMOS_LD_A_IR_BUG=(YES|NO)
Build the implementation of the bug affecting the Zilog Z80 NMOS, which causes the P/V flag to be reset when a maskable interrupt is accepted during the execution of the ``ld a,{i|r}`` instructions. |br| |nl|
The default is ``NO``.
Package maintainers are encouraged to use at least the following options for the shared library:
.. code-block:: sh
-DZ80_WITH_EXECUTE=YES
-DZ80_WITH_FULL_IM0=YES
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=YES
-DZ80_WITH_Q=YES
-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:
.. code-block:: sh
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:
.. option:: Z80_Runtime
* Shared library.
* Symbolic link for the compatibility version of the shared library.
* Standard text documents.
.. option:: Z80_Development
* Static library.
* Unversioned symbolic link of the shared library.
* Public header.
* CMake config-file package.
* pkg-config file.
.. option:: Z80_Documentation
* Documentation in HTML format.
* Documentation in PDF format.

View File

@@ -0,0 +1,105 @@
===========
Integration
===========
.. |BUILD_SHARED_LIBS| replace:: ``BUILD_SHARED_LIBS``
.. _BUILD_SHARED_LIBS: https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
.. |find_package| replace:: ``find_package``
.. _find_package: https://cmake.org/cmake/help/latest/command/find_package.html
.. |add_subdirectory| replace:: ``add_subdirectory``
.. _add_subdirectory: https://cmake.org/cmake/help/latest/command/add_subdirectory.html
As an external dependency in CMake-based projects
=================================================
The Z80 library includes a `config-file package <https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#config-file-packages>`_ for integration into CMake-based projects that must be installed for development. Use |find_package|_ to find the ``Z80`` package. This creates the ``Z80`` imported library target, which carries the necessary transitive link dependencies. Optionally, the linking method can be selected by specifying either the ``Shared`` or ``Static`` component.
Example:
.. code-block:: cmake
find_package(Z80 REQUIRED Shared)
target_link_libraries(your-target Z80)
When not specified as a component, the linking method is selected according to :option:`Z80_SHARED_LIBS<-DZ80_SHARED_LIBS>`. If this option is not defined, the config-file uses the type of library that is installed on the system and, if it finds both the shared and the static versions, |BUILD_SHARED_LIBS|_ determines which one to link against.
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>`_).
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.
Example:
.. code-block:: cmake
set(Z80_SHARED_LIBS NO CACHE BOOL "")
set(Z80_WITH_Q YES CACHE BOOL "")
set(Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG YES CACHE BOOL "")
add_subdirectory(dependencies/Z80)
target_link_libraries(your-target Z80)
It is important to set the :option:`Z80_SHARED_LIBS<-DZ80_SHARED_LIBS>` option. Otherwise, CMake will build the library type indicated by |BUILD_SHARED_LIBS|_, which may not be the desired one.
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
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>`_:
* 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``.
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.
.. c:macro:: Z80_STATIC
Restricts the visibility of public symbols.
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>``.
.. 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>`:
.. c:macro:: Z80_WITH_EXECUTE
Enables the implementation of the :c:func:`z80_execute` function.
.. c:macro:: Z80_WITH_FULL_IM0
Enables the full implementation of the interrupt mode 0.
.. c:macro:: Z80_WITH_IM0_RETX_NOTIFICATIONS
Enables optional notifications for any ``reti`` or ``retn`` instruction executed during the interrupt mode 0 response.
.. c:macro:: Z80_WITH_Q
Enables the implementation of `Q <https://worldofspectrum.org/forums/discussion/41704>`_.
.. c:macro:: Z80_WITH_SPECIAL_RESET
Enables the implementation of the `special RESET <http://www.primrosebank.net/computers/z80/z80_special_reset.htm>`_.
.. c:macro:: Z80_WITH_UNOFFICIAL_RETI
Configures the undocumented instructions ``ED5Dh``, ``ED6Dh`` and ``ED7Dh`` as ``reti`` instead of ``retn``.
.. c:macro:: Z80_WITH_ZILOG_NMOS_LD_A_IR_BUG
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.

View File

@@ -0,0 +1,92 @@
============
Introduction
============
The Z80 library 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.
Limitations
===========
Granularity
-----------
Fetch/execute overlapping
-------------------------
Real Z80 CPUs overlap some operations of certain instructions with the fetch phase of the next instruction or interrupt response. For example, the effective modification of registers A and F. The library does not emulate this feature for speed reasons and only guarantees register coherence at the instruction level, not at the T-state level.
Normal RESET
------------
BUSREQ and WAIT
---------------
Optional features
=================
:c:func:`z80_execute`
---------------------
This function performs a partial emulation of the Z80 CPU that ignores interrupts and the special RESET. It is somewhat faster than :c:func:`z80_run`, since the emulation loop does not have to check each iteration for pending interrupts before executing the instruction.
Not enabling the implementation of this function allows a slight reduction in the size of the library, but it is usually marginal.
Package maintainers should enable the implementation of the :c:func:`z80_execute` function.
Interrupt mode 0
----------------
The interrupt mode 0 executes an instruction supplied to the CPU via the data bus. Real Z80 chips can execute any instruction, even illegal ones, and also long sequences of ``DDh/FDh`` prefixes, although most existing hardware only uses a few instructions from the control transfer groups.
The Z80 library includes two different implementations of this interrupt mode: full, which emulates everything; and reduced, which emulates only the ``jp WORD``, ``call WORD`` and ``rst N`` instructions.
Enabling the full implementation of the interrupt mode 0 can increase the size of the library by 1 or 2 KB approximately (depending on the target ISA and the executable format).
Package maintainers should enable the full implementation of the interrupt mode 0.
Notifications of ``reti`` and ``retn`` in the interrupt mode 0
--------------------------------------------------------------
The Z80 emulator notifies the fetch of the instructions ``reti`` and ``retn`` through the callbacks :c:data:`Z80::reti<Z80.reti>` and :c:data:`Z80::retn<Z80.retn>`. This simplifies the emulation of chips such as the Zilog Z80 CTC, which monitors the appearance of the ``reti`` instruction on the data bus to evaluate whether the CPU is returning from an ISR.
It is presumed that the Z80 CTC is not capable of detecting ``reti`` when executed through interrupt mode 0. Furthermore, there is no known hardware that supplies these instructions to the CPU during the interrupt response. However, the notifications of ``reti`` and ``retn`` in the interrupt mode 0 have no impact on speed, the increase in the size of the library is minimal, and they can be disabled at runtime anyway.
Package maintainers should enable notifications of ``reti`` and ``retn`` in the interrupt mode 0, just in case.
Q
-
Q is an abstraction of certain ALU latches related to flag computation. The state of Q affects the undocumented flags X and Y in the ``ccf`` and ``scf`` instructions of Z80 CPUs from Zilog and other manufacturers.
Enabling the implementation of this feature adds code to update the value of Q in each instruction and interrupt response, which slightly increases the size of the library and, depending on the target ISA and the specific microarchitecture of the host CPU, can result in a performance loss of up to 2.4%.
Package maintainers should, however, enable the implementation of Q, as it is necessary for the emulator to pass all tests.
Special RESET
-------------
The special RESET is a little-known pseudo-interrupt described in U.S. Patent No. `4,486,827 <https://zxe.io/depot/patents/US4486827.pdf>`_. It was first `documented <http://www.primrosebank.net/computers/z80/z80_special_reset.htm>`_ in detail by Tony Brewer. It is not of particular interest for the emulation of commercial systems, as no machine is known to make use of it except for a few development boards such as the Zilog In-Circuit Emulator (ICE).
Enabling the implementation of the special RESET is discouraged because it adds extra operations that slightly affect the speed of interrupt responses and the resumption of the HALT state.
Package maintainers **should not enable** the implementation of the special RESET.
Unofficial ``reti`` opcodes
---------------------------
The ``retn`` instruction has 8 different opcodes: 1 documented, 6 undocumented and ``reti``, which is just the specific ``retn`` opcode whose execution is monitored by the Z80 CTC chip to know whether the CPU is returning from an ISR.
Some Z80 CPU emulators assign the 4 opcodes whose bit 3 is ``0`` to ``retn``, and the other 4 to ``reti``. However, as far as is known, the Z80 CTC and other similar circuits only monitor the execution of the two-byte instruction ``ED4Dh`` (i.e. the instruction that the official documentation designates as ``reti``).
Enabling unofficial ``reti`` opcodes will configure the instructions ``ED5Dh``, ``ED6Dh`` and ``ED7Dh`` as ``reti``, causing their execution to be notified through the :c:data:`Z80::reti<Z80.reti>` callback rather than :c:data:`Z80::retn<Z80.retn>`.
Package maintainers should **never enable** unofficial ``reti`` opcodes.
Zilog NMOS bug of the ``ld a,i`` and ``ld a,r`` instructions
------------------------------------------------------------
The Z80 CPU models that use NMOS technology have a bug that causes the P/V flag to be reset when a maskable interrupt is accepted during the execution of these instructions. This affects processors manufactured by Zilog, second sources, NEC and can also be found in CMOS models from SGS-Thomson (and possibly other companies).
Enabling the implementation of this bug adds code in the maskable interrupt response to check whether or not the previous instruction was ``ld a,i`` or ``ld a,r``, thus making the interrupt response slightly slower.
Package maintainers should, however, enable the implementation of this bug, as there is firmware and software that depend on it.

11
projects/Z80/documentation/License.rst vendored Normal file
View File

@@ -0,0 +1,11 @@
=======
License
=======
Copyright © 1999-2024 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.
**This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE**. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library. If not, see <https://www.gnu.org/licenses/>.

20
projects/Z80/documentation/Makefile vendored Normal file
View File

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

3
projects/Z80/documentation/Tests.rst vendored Normal file
View File

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

532
projects/Z80/documentation/Thanks.rst vendored Normal file
View File

@@ -0,0 +1,532 @@
======
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

131
projects/Z80/documentation/Usage.rst vendored Normal file
View File

@@ -0,0 +1,131 @@
=====
Usage
=====
.. code-block:: c
#include <Z/constants/pointer.h> /* Z_NULL */
#include <Z80.h>
#define CYCLES_PER_FRAME 69888
#define CYCLES_AT_INT 24
#define CYCLES_PER_INT 32
#define ROM_SIZE 0x4000 /* 16 KiB */
#define MEMORY_SIZE 0x8000 /* 32 KiB */
typedef struct {
void* context;
zuint8 (* read)(void *context);
void (* write)(void *context, zuint8 value);
zuint16 assigned_port;
} Device;
typedef struct {
zusize cycles;
zuint8 memory[65536];
Z80 cpu;
Device* devices;
zusize device_count;
} Machine;
Device *machine_find_device(Machine *self, zuint16 port)
{
zusize index = 0;
for (; index < device_count; index++)
if (self->devices[index]->assigned_port == port)
return &self->devices[index];
return Z_NULL;
}
static zuint8 machine_cpu_read(Machine *self, zuint16 address)
{
return address < MEMORY_SIZE ? self->memory[address] : 0xFF;
}
static void machine_cpu_write(Machine *self, zuint16 address, zuint8 value)
{
if (address >= ROM_SIZE && address < MEMORY_SIZE)
self->memory[address] = value;
}
static zuint8 machine_cpu_in(Machine *self, zuint16 port)
{
Device *device = machine_find_device(self, port);
return device != Z_NULL ? device->read(device->context) : 0xFF;
}
static void machine_cpu_out(Machine *self, zuint16 port, zuint8 value)
{
Device *device = machine_find_device(self, port);
if (device != Z_NULL) device->write(device->context, value);
}
void machine_initialize(Machine *self)
{
self->cpu.context = self;
self->cpu.fetch_opcode =
self->cpu.fetch =
self->cpu.nop =
self->cpu.read = (Z80Read )machine_cpu_read;
self->cpu.write = (Z80Write)machine_cpu_write;
self->cpu.in = (Z80Read )machine_cpu_in;
self->cpu.out = (Z80Write)machine_cpu_out;
self->cpu.halt = Z_NULL;
self->cpu.nmia = Z_NULL;
self->cpu.inta = Z_NULL;
self->cpu.int_fetch = Z_NULL;
self->cpu.ld_i_a = Z_NULL;
self->cpu.ld_r_a = Z_NULL;
self->cpu.reti = Z_NULL;
self->cpu.retn = Z_NULL;
self->cpu.hook = Z_NULL;
self->cpu.illegal = Z_NULL;
self->cpu.options = Z80_MODEL_ZILOG_NMOS;
/* Create and initialize devices... */
}
void machine_power(Machine *self, zboolean state)
{
if (state)
{
self->cycles = 0;
memset(self->memory, 0, 65536);
}
z80_power(&self->cpu, state);
}
void machine_reset(Machine *self)
{
z80_instant_reset(&self->cpu);
}
void machine_run_frame(Machine *self)
{
/* CPU cycles before the INT signal */
self->cycles += z80_execute(&self->cpu, CYCLES_AT_INT - self->cycles);
/* CPU cycles during the INT signal */
z80_int(&self->cpu, Z_TRUE);
self->cycles += z80_run(&self->cpu, (CYCLES_AT_INT + CYCLES_PER_INT) - self->cycles);
z80_int(&self->cpu, Z_FALSE);
/* CPU cycles after the INT signal */
self->cycles += z80_execute(&self->cpu, CYCLES_PER_FRAME - self->cycles);
self->cycles -= CYCLES_PER_FRAME;
}

View File

@@ -0,0 +1,75 @@
===============
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.

56
projects/Z80/documentation/conf.py vendored Normal file
View File

@@ -0,0 +1,56 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'Z80'
copyright = 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.
#
#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']

34
projects/Z80/documentation/index.rst vendored Normal file
View File

@@ -0,0 +1,34 @@
.. Z80 documentation master file, created by
sphinx-quickstart on Wed Feb 24 06:49:20 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
===
Z80
===
.. 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
genindex
search

35
projects/Z80/documentation/make.bat vendored Normal file
View File

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

5
projects/Z80/file_id.diz vendored Normal file
View File

@@ -0,0 +1,5 @@
Z80 v0.2 - Fast, small and accurate emulator
of the Zilog Z80. Version 0.2 implements all
that is known to date about this CPU, passes
all test suites and is carefully designed to
fit most use cases.

2766
projects/Z80/sources/Z80.c Normal file

File diff suppressed because it is too large Load Diff

2766
projects/Z80/sources/Z80.c.bak vendored Normal file

File diff suppressed because it is too large Load Diff

287
projects/Z80/sources/Z80.pas vendored Normal file
View File

@@ -0,0 +1,287 @@
(* ______ ______ ______
/\___ \/\ __ \\ __ \
____ \/__/ /\_\ __ \\ \/\ \ ______________________________________
| /\_____\\_____\\_____\ |
| Zilog \/_____//_____//_____/ CPU Emulator - Pascal Binding |
| Copyright (C) 2022-2023 Zoran Vučenović. |
| |
| Permission to use, copy, modify, and/or distribute this software |
| for any purpose with or without fee is hereby granted. |
| |
| THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL |
| THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR |
| CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
| LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
| NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
| CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| |
'===================================================================*)
unit Z80;
{$mode ObjFPC}{$H+}
{$J-}
{$inline on}
{$PackRecords C}
interface
uses
SysUtils,
dynlibs;
const
DefaultZ80LibPath =
{$if defined(mswindows)}
'Z80.dll';
{$elseif defined(darwin)}
'libZ80.dylib';
{$elseif defined(unix)}
'libZ80.so';
{$else}
'';
{$endif}
Z80_MAXIMUM_CYCLES = SizeUInt(SizeUInt(SizeUInt.MaxValue) - 30);
Z80_MAXIMUM_CYCLES_PER_STEP = 23;
Z80_HOOK = $64;
Z80_SF = 128;
Z80_ZF = 64;
Z80_YF = 32;
Z80_HF = 16;
Z80_XF = 8;
Z80_PF = 4;
Z80_NF = 2;
Z80_CF = 1;
type
PZ80 = ^TZ80;
TZ80RegisterPair = packed record
case Integer of
0: (word: UInt16);
{$ifdef endian_little}
1: (bytes: packed record low: UInt8; high: UInt8 end);
{$else}
1: (bytes: packed record high: UInt8; low: UInt8 end);
{$endif}
end;
Z80Read = function(context: Pointer; address: UInt16): UInt8; cdecl;
Z80Write = procedure(context: Pointer; address: UInt16; value: UInt8); cdecl;
Z80Halt = procedure(context: Pointer; state: UInt8); cdecl;
Z80Notify = procedure(context: Pointer); cdecl;
Z80Illegal = function(cpu: PZ80; opcode: UInt8): UInt8; cdecl;
TZ80 = record
cycles: SizeUInt;
cycle_limit: SizeUInt;
context: Pointer;
fetch_opcode: Z80Read;
fetch: Z80Read;
read: Z80Read;
write: Z80Write;
input: Z80Read;
output: Z80Write;
halt: Z80Halt;
nop: Z80Read;
nmia: Z80Read;
inta: Z80Read;
int_fetch: Z80Read;
ld_i_a: Z80Notify;
ld_r_a: Z80Notify;
reti: Z80Notify;
retn: Z80Notify;
hook: Z80Read;
illegal: Z80Illegal;
data: array [0..3] of UInt8;
ix_iy: array [0..1] of TZ80RegisterPair;
pc: TZ80RegisterPair;
sp: TZ80RegisterPair;
xy: TZ80RegisterPair;
memptr: TZ80RegisterPair;
af: TZ80RegisterPair;
bc: TZ80RegisterPair;
de: TZ80RegisterPair;
hl: TZ80RegisterPair;
af_: TZ80RegisterPair;
bc_: TZ80RegisterPair;
de_: TZ80RegisterPair;
hl_: TZ80RegisterPair;
r: UInt8;
i: UInt8;
r7: UInt8;
im: UInt8;
request: UInt8;
resume: UInt8;
iff1: UInt8;
iff2: UInt8;
q: UInt8;
options: UInt8;
int_line: UInt8;
halt_line: UInt8;
end;
const
Z80_OPTION_OUT_VC_255 = 1;
Z80_OPTION_LD_A_IR_BUG = 2;
Z80_OPTION_HALT_SKIP = 4;
Z80_OPTION_XQ = 8;
Z80_OPTION_IM0_RETX_NOTIFICATIONS = 16;
Z80_OPTION_YQ = 32;
Z80_MODEL_ZILOG_NMOS = (Z80_OPTION_LD_A_IR_BUG or Z80_OPTION_XQ or Z80_OPTION_YQ);
Z80_MODEL_ZILOG_CMOS = (Z80_OPTION_OUT_VC_255 or Z80_OPTION_XQ or Z80_OPTION_YQ);
Z80_MODEL_NEC_NMOS = Z80_OPTION_LD_A_IR_BUG;
Z80_MODEL_ST_CMOS = (Z80_OPTION_OUT_VC_255 or Z80_OPTION_LD_A_IR_BUG or Z80_OPTION_YQ);
Z80_REQUEST_REJECT_NMI = 2;
Z80_REQUEST_NMI = 4;
Z80_REQUEST_INT = 8;
Z80_REQUEST_SPECIAL_RESET = 16;
Z80_RESUME_HALT = 1;
Z80_RESUME_XY = 2;
Z80_RESUME_IM0_XY = 3;
Z80_HALT_EXIT = 0;
Z80_HALT_ENTER = 1;
Z80_HALT_EXIT_EARLY = 2;
Z80_HALT_CANCEL = 3;
var
z80_power: procedure(self: PZ80; state: ByteBool); cdecl;
z80_instant_reset: procedure(self: PZ80); cdecl;
z80_special_reset: procedure(self: PZ80); cdecl;
z80_int: procedure(self: PZ80; state: ByteBool); cdecl;
z80_nmi: procedure(self: PZ80); cdecl;
z80_execute: function(self: PZ80; cycles: SizeUInt): SizeUInt; cdecl;
z80_run: function(self: PZ80; cycles: SizeUInt): SizeUInt; cdecl;
function z80_r(const self: PZ80): UInt8; inline;
function z80_refresh_address(const self: PZ80): UInt16; inline;
function z80_in_cycle(const self: PZ80): UInt8; inline;
function z80_out_cycle(const self: PZ80): UInt8; inline;
function IsLibraryLoaded: Boolean;
function LoadLibrary(const LibPath: String = ''): Boolean;
function UnloadLibrary: Boolean;
implementation
procedure z80_break(self: PZ80);
begin
self^.cycle_limit := 0;
end;
function z80_r(const self: PZ80): UInt8;
begin
Result := (self^.r and 127) or (Self^.r7 and 128);
end;
function z80_refresh_address(const self: PZ80): UInt16;
begin
Result := UInt16(self^.i) shl 8;
Result := Result or ((self^.r - 1) and 127) or (self^.r7 and 128);
end;
function z80_in_cycle(const self: PZ80): UInt8;
begin
if self^.data[0] = $DB then begin
Result := 7;
end else begin
Result := 8 + (self^.data[1] shr 7);
end;
end;
function z80_out_cycle(const self: PZ80): UInt8;
begin
if self^.data[0] = $D3 then begin
Result := 7;
end else begin
Result := 8 + ((self^.data[1] shr 7) shl 2);
end;
end;
var
LibHandle: TLibHandle;
function IsLibraryLoaded: Boolean;
begin
Result := LibHandle <> NilHandle;
end;
function LoadLibrary(const LibPath: String): Boolean;
var
LibName: String;
begin
if LibHandle = NilHandle then begin
Result := False;
if LibPath = '' then begin
LibName := DefaultZ80LibPath;
end else begin
LibName := LibPath;
end;
LibHandle := SafeLoadLibrary(LibName);
if LibHandle = NilHandle then Exit;
Pointer(z80_power) := GetProcAddress(LibHandle, 'z80_power');
Pointer(z80_instant_reset) := GetProcAddress(LibHandle, 'z80_instant_reset');
Pointer(z80_special_reset) := GetProcAddress(LibHandle, 'z80_special_reset');
Pointer(z80_int) := GetProcAddress(LibHandle, 'z80_int');
Pointer(z80_nmi) := GetProcAddress(LibHandle, 'z80_nmi');
Pointer(z80_execute) := GetProcAddress(LibHandle, 'z80_execute');
Pointer(z80_run) := GetProcAddress(LibHandle, 'z80_run');
end;
Result := True;
end;
function UnloadLibrary: Boolean;
begin
if IsLibraryLoaded then begin
if not dynlibs.UnloadLibrary(LibHandle) then Exit(False);
LibHandle := NilHandle;
end;
z80_power := nil;
z80_instant_reset := nil;
z80_special_reset := nil;
z80_int := nil;
z80_nmi := nil;
z80_execute := nil;
z80_run := nil;
Result := True;
end;
procedure Init;
begin
LibHandle := NilHandle;
UnloadLibrary;
end;
initialization
Init;
finalization
UnloadLibrary;
end.

34
projects/Z80/sources/Z80.rc.in vendored Normal file
View File

@@ -0,0 +1,34 @@
/* IMPORTANT: This file MUST be saved using the "UTF-8 with BOM" encoding. */
1 VERSIONINFO
FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0
PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0
FILEFLAGSMASK 0x3FL
#ifdef NDEBUG
FILEFLAGS 0x0L
#else
FILEFLAGS 0x1L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "Manuel Sainz de Baranda y Goñi"
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 "OriginalFilename", "@PROJECT_NAME@.dll"
VALUE "ProductName", "@PROJECT_NAME@"
VALUE "ProductVersion", "@PROJECT_VERSION@"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

File diff suppressed because it is too large Load Diff

13
projects/Z80/support/Z80.pc.in vendored Normal file
View File

@@ -0,0 +1,13 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: @PROJECT_NAME@
Description: @PROJECT_DESCRIPTION@.
URL: @PROJECT_HOMEPAGE_URL@
Version: @PROJECT_VERSION@
Requires: Zeta
Cflags: -I${includedir}
Cflags.private: -DZ80_STATIC
Libs: -L${libdir} -l@PROJECT_NAME@

66
projects/Z80/support/Z80Config.cmake.in vendored Normal file
View File

@@ -0,0 +1,66 @@
cmake_minimum_required(
# 3.3: IN_LIST
VERSION 3.3...${CMAKE_VERSION})
set(@PROJECT_NAME@_known_components Static Shared)
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)
set(@PROJECT_NAME@_component_${@PROJECT_NAME@_component} YES)
else()
set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"`${@PROJECT_NAME@_component}` is not a valid component.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif()
endforeach()
if(@PROJECT_NAME@_component_Static AND @PROJECT_NAME@_component_Shared)
set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"`Static` and `Shared` are mutually exclusive.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif()
set(@PROJECT_NAME@_Static_targets "${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@StaticTargets.cmake")
set(@PROJECT_NAME@_Shared_targets "${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@SharedTargets.cmake")
macro(@PROJECT_NAME@_load_targets type)
if(NOT EXISTS "${@PROJECT_NAME@_${type}_targets}")
set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"`${type}` libraries were requested but not found.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif()
include(CMakeFindDependencyMacro)
find_dependency(Zeta)
include("${@PROJECT_NAME@_${type}_targets}")
endmacro()
if(@PROJECT_NAME@_component_Static)
@PROJECT_NAME@_load_targets(Static)
elseif(@PROJECT_NAME@_component_Shared)
@PROJECT_NAME@_load_targets(Shared)
elseif(DEFINED @PROJECT_NAME@_SHARED_LIBS AND @PROJECT_NAME@_SHARED_LIBS)
@PROJECT_NAME@_load_targets(Shared)
elseif(DEFINED @PROJECT_NAME@_SHARED_LIBS AND NOT @PROJECT_NAME@_SHARED_LIBS)
@PROJECT_NAME@_load_targets(Static)
elseif(BUILD_SHARED_LIBS)
if(EXISTS "${@PROJECT_NAME@_Shared_targets}")
@PROJECT_NAME@_load_targets(Shared)
else()
@PROJECT_NAME@_load_targets(Static)
endif()
else()
if(EXISTS "${@PROJECT_NAME@_Static_targets}")
@PROJECT_NAME@_load_targets(Static)
else()
@PROJECT_NAME@_load_targets(Shared)
endif()
endif()

View File

@@ -0,0 +1 @@
B425AFB300DC7F0671E4DDAF3F13BF962D3D06FB717B8709E10F489A213E142C8D57B6973CB509A0C62F94793D476E993983276F9E10ADA705BAE5381D7A2A9B ZX Spectrum.rom

10
projects/Z80/support/software.sha3-512 vendored Normal file
View File

@@ -0,0 +1,10 @@
CBC8F24E2696D04471F1137E5BA4D6F95B798A0B97BD811C1B2E1C362292D151BE5DB524547E4B2B6C1A248434D3FF479B5D7FB1A5C150CD7213B10794686C38 POSIX/Yaze v1.10 (1998-01-28)(Cringle, Frank D.)(Sources)[!].tar.gz
75A482EDBDEF7016FF7F9BAC8E29630B8D74A57266A7662037CDAB5CE790C7942C0E779F7C9C5C57D3A6DAF2E6293F6AD3CF40B441ED5A10B3A5CB25909F33E1 ZX Spectrum/Z80 Documented Instruction Set Exerciser for Spectrum (2018)(Harston, Jonathan Graham)[!].tap
1AA2DB065843B4A36471A2E0F8DDB61B7BD857450E867068B27829690F327C942F2552C028A397D9A7DDE7BED24D2F9782731633A9111F3F9D5612FC53088D4B ZX Spectrum/Z80 Full Instruction Set Exerciser for Spectrum (2009)(Bobrowski, Jan)[!].tap
A77946868B7DD90E7B21ACF9566399EA1929899DB3C67224A203D2BA587239A846D992E974205B2FF3398E19B5168954891FEC3E020008BBF039F540CF6F63EB ZX Spectrum/Z80 Full Instruction Set Exerciser for Spectrum (2011)(Bobrowski, Jan)(Narrowed to BIT Instructions)[!].tap
BAA29B8D799F59C4B7D485AA9CC7152172623EC4C827372F4E12CF0AB18BB7F7E7AD449BC59615F5CDD1D9908FDAB0A61158E0C543B036D27557B0D27225613D ZX Spectrum/Z80 Full Instruction Set Exerciser for Spectrum (2017-0x)(Harston, Jonathan Graham)[!].tap
5A4E247865DE5945C271A954BE7FF47E356E2002F90B6B3B3C214DCD7D1C057DB1F3F1BD11AC37EC1EA37EC5A551C3A1A0CFB20FC0BA8760646046AA594C07C3 ZX Spectrum/Z80 Full Instruction Set Exerciser for Spectrum (2018)(Harston, Jonathan Graham)[!].tap
4667E8CF1E4171842101EAC56BBB6893059E37B4B52ECA22A9C7A4DB1DB668439FA1E8BD77EFE6E9496EC7CD7B1F420BA45672D52A045E1E09C7425D9850E85A ZX Spectrum/Z80 Instruction Set Exerciser for Spectrum 2 v0.1 (2012-11-27)(Rak, Patrik)[!].zip
BB1DCE3187FBF5EA871FE41EB76AE7E0C94D08136FF4D8E756E2624DA589AAE69CAD074EB43CBFB9E2B9E0D2CC505343D9804EDCDE3CEA1FB1881DCBF5C865B0 ZX Spectrum/Z80 Test Suite (2008)(Woodmass, Mark)[!].tap
13F24211FDC8053204DC8C6224A5FE99063AEC840C9A9A0225DC1CDB20FE0C119EB570F50A5373D2F2CC22FEDB96286721DA67DBC8A9ABA8EBDE14E539EE2C43 ZX Spectrum/Zilog Z80 CPU Test Suite v1.0 (2012-12-08)(Rak, Patrik)[!].zip
DD58528572CA0BF2F0FCA6191F339A091D78CBD1A73A4FEE74726F99A6B686A27E75F9882E178015116F4AF28C7E3FF2D4557484F53D6963FE95F47F4653DC28 ZX Spectrum/Zilog Z80 CPU Test Suite v1.2a (2023-12-02)(Rak, Patrik)[!].zip

15
projects/Zeta/.editorconfig vendored Normal file
View File

@@ -0,0 +1,15 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 8
indent_style = tab
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{cff,yml}]
indent_size = 2
indent_style = space

5
projects/Zeta/.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
buy_me_a_coffee: redcode
github: redcode
ko_fi: redcode
liberapay: redcode
patreon: redcode

View File

@@ -0,0 +1,11 @@
_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.
By submitting this PR, you agree to the following:
> You hereby assign copyright in this PR's code to the original author of the Zeta 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.

5
projects/Zeta/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.directory
.DS_Store
Thumbs.db
/build/
/CMakeLists.txt.user

4
projects/Zeta/.vimrc vendored Normal file
View File

@@ -0,0 +1,4 @@
set noexpandtab
set shiftwidth=8
set tabstop=8
autocmd BufWritePre * %s/\s\+$//e

14
projects/Zeta/API/Z/classes/Empty.hpp vendored Normal file
View File

@@ -0,0 +1,14 @@
/* Zeta API - Z/classes/Empty.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Empty_HPP
#define Z_classes_Empty_HPP
namespace Zeta {struct Empty {};}
#endif // Z_classes_Empty_HPP

185
projects/Zeta/API/Z/classes/Functor.hpp vendored Normal file
View File

@@ -0,0 +1,185 @@
/* Zeta API - Z/classes/Functor.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Functor_HPP
#define Z_classes_Functor_HPP
#include <Z/classes/ObjectMemberFunction.hpp>
#if Z_HAS(ObjectMemberFunction)
# ifdef Z_WITH_OBJECTIVE_C_RUNTIME
# include <Z/classes/ObjectSelector.hpp>
# include <Z/traits/casting.hpp>
# endif
# 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 *);
Call call;
Destroy destroy;
union { r (* function)(p...);
struct {r (NaT::* function)(p...);
NaT *object;
} object_member_function;
# if Z_HAS(ObjectSelector)
struct {SEL selector;
id object;
} object_selector;
# endif
} target;
struct Callers {
static Z_INLINE Call function() Z_NOTHROW
{
return [](const Functor *functor, typename Type<p>::to_forwardable... arguments) -> r
{return functor->target.function(arguments...);};
}
static Z_INLINE Call object_member_function() Z_NOTHROW
{
return [](const Functor *functor, typename Type<p>::to_forwardable... arguments) -> r
{
return (functor->target.object_member_function.object->*
functor->target.object_member_function.function)
(arguments...);
};
}
# if Z_HAS(ObjectSelector)
static Z_INLINE Call object_selector() Z_NOTHROW
{
return [](const Functor *functor, typename Type<p>::to_forwardable... arguments)
{
return (cast<r (*)(id, SEL, p...)>(ObjectiveC::send<r>()))(
functor->target.object_selector.object,
functor->target.object_selector.selector,
arguments...);
};
}
# endif
};
public:
Z_CT(CPP11) Functor() Z_NOTHROW
: call(Z_NULL), destroy(Z_NULL) {}
# ifdef Z_NULLPTR
Z_CT(CPP11) Functor(NullPtr) Z_NOTHROW
: call(Z_NULL), destroy(Z_NULL) {}
# endif
Z_INLINE Functor(r (* function)(p...)) Z_NOTHROW
: call(Callers::function()), destroy(Z_NULL)
{target.function = function;}
template <class o, class m, class e = typename TypeIf<
(Type<o>::is_void || Type<o>::is_class) &&
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value
>::type>
Z_INLINE Functor(o *object, m function) Z_NOTHROW
: call(Callers::object_member_function()), destroy(Z_NULL)
{
target.object_member_function.function = reinterpret_cast<r (NaT::*)(p...)>(function);
target.object_member_function.object = reinterpret_cast<NaT *>(const_cast<typename Type<o>::to_unqualified *>(object));
}
template <class o, class m, class e = typename TypeIf<
Type<o>::is_class &&
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value
>::type>
Z_INLINE Functor(const o &object, m function) Z_NOTHROW
: call(Callers::object_member_function()), destroy(Z_NULL)
{
target.object_member_function.function = reinterpret_cast<r (NaT::*)(p...)>(function);
target.object_member_function.object = reinterpret_cast<NaT *>(const_cast<typename Type<o>::to_unqualified *>(&object));
}
Z_INLINE Functor(const ObjectMemberFunction<r(p...)> &object_member_function) Z_NOTHROW
: call(Callers::object_member_function()), destroy(Z_NULL)
{
target.object_member_function.function = object_member_function.function;
target.object_member_function.object = object_member_function.object;
}
# if Z_HAS(TypeIsConvertible)
template <class o, class e = typename TypeIf<
Type<o>::is_class &&
TypeIsConvertible<o, r(*)(p...)>::value
>::type>
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)
{
target.object_selector.selector = selector;
target.object_selector.object = object;
}
Z_INLINE Functor(const ObjectSelector<r(p...)> &object_selector) Z_NOTHROW
: call(Callers::object_selector()), destroy(Z_NULL)
{
target.object_selector.selector = object_selector.selector;
target.object_selector.object = object_selector.object;
}
# endif
Z_INLINE ~Functor()
{if (destroy) destroy(this);}
Z_CT(CPP11) operator Boolean() 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

View File

@@ -0,0 +1,45 @@
/* Zeta API - Z/classes/InitializerList.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_InitializerList_HPP
#define Z_classes_InitializerList_HPP
#include <Z/inspection/language.h>
#if Z_DIALECT_HAS(CPP11, INITIALIZER_LIST)
# include <Z/constants/pointer.h>
# include <Z/macros/language.hpp>
# include <Z/types/integral.hpp>
# define Z_HAS_InitializerList 1
namespace Zeta {template <class t> class InitializerList {
public:
typedef t value_type;
typedef const t& reference;
typedef const t& const_reference;
typedef USize size_type;
typedef const t* iterator;
typedef const t* const_iterator;
private:
const t* _data;
USize _size;
public:
Z_CT(CPP11) InitializerList() Z_NOTHROW
: _data(Z_NULL), _size(0) {}
Z_CT(CPP11) USize size () const Z_NOTHROW {return _size;}
Z_CT(CPP11) const t* begin() const Z_NOTHROW {return _data;}
Z_CT(CPP11) const t* end () const Z_NOTHROW {return _data + _size;}
};}
#endif
#endif // Z_classes_InitializerList_HPP

View File

@@ -0,0 +1,38 @@
/* Zeta API - Z/classes/Iterator.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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;
Z_CT(CPP11) Iterator(t &data_source_, typename t::size_type index_)
: data_source(data_source_), index(index_) {}
friend Z_CT(CPP11) Boolean operator !=(const Iterator &lhs, const Iterator &rhs) Z_NOTHROW
{return lhs.index != rhs.index;}
Z_CT(CPP11) const typename t::element_type &operator *() const Z_NOTHROW
{return data_source[index];}
Z_INLINE Iterator const &operator ++() Z_NOTHROW
{
index++;
return *this;
}
};}
#endif // Z_classes_Iterator_HPP

View File

@@ -0,0 +1,85 @@
/* Zeta API - Z/classes/MemberFunction.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_MemberFunction_HPP
#define Z_classes_MemberFunction_HPP
#include <Z/inspection/language.h>
#if Z_DIALECT_HAS(CPP98, SFINAE) && \
Z_DIALECT_HAS(CPP11, VARIADIC_TEMPLATE) && \
Z_DIALECT_HAS(CPP11, DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATE)
# define Z_HAS_MemberFunction 1
# include <Z/constants/pointer.h>
# include <Z/traits/type.hpp>
namespace Zeta {
template <class f> struct MemberFunction;
template <class r, class... p> struct MemberFunction<r(p...)> {
r (NaT::* function)(p...);
Z_INLINE MemberFunction() Z_NOTHROW
Z_DEFAULTED({})
# ifdef Z_NULLPTR
Z_CT(CPP11) MemberFunction(NullPtr) Z_NOTHROW
: function(nullptr) {};
# endif
template <class m, class e = typename TypeIf<
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value
>::type>
Z_INLINE MemberFunction(m function) Z_NOTHROW
: function(reinterpret_cast<r (NaT::*)(p...)>(function)) {}
Z_CT(CPP11) operator Boolean() const Z_NOTHROW
{return function != Z_NULL;}
template <class m, class e = typename TypeIf<
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value
>::type>
Z_INLINE operator m() const Z_NOTHROW
{return reinterpret_cast<m>(function);}
template <class m>
Z_INLINE typename TypeIf<
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value,
MemberFunction &>::type
operator =(m rhs) Z_NOTHROW
{
function = reinterpret_cast<r (NaT::*)(p...)>(rhs);
return *this;
}
template <class o>
Z_INLINE r operator ()(o *object, typename Type<p>::to_forwardable... arguments) const
{return (reinterpret_cast<NaT *>(object)->*function)(arguments...);}
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
#endif // Z_classes_MemberFunction_HPP

30
projects/Zeta/API/Z/classes/NaT.hpp vendored Normal file
View File

@@ -0,0 +1,30 @@
/* Zeta API - Z/classes/NaT.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_NaT_HPP
#define Z_classes_NaT_HPP
#include <Z/macros/language.hpp>
namespace Zeta {struct NaT Z_FINAL {
# if Z_DIALECT_HAS(CPP11, DELETED_FUNCTION)
NaT() = delete;
NaT(const NaT &) = delete;
~NaT() = delete;
NaT &operator =(const NaT &) = delete;
# if Z_DIALECT_HAS(CPP11, RVALUE_REFERENCE)
NaT(NaT &&) = delete;
NaT &operator =(NaT &&) = delete;
# endif
# endif
};}
#endif // Z_classes_NaT_HPP

View File

@@ -0,0 +1,148 @@
/* Zeta API - Z/classes/ObjectMemberFunction.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_ObjectMemberFunction_HPP
#define Z_classes_ObjectMemberFunction_HPP
#include <Z/inspection/Z.h>
#include <Z/classes/MemberFunction.hpp>
#if Z_HAS(MemberFunction)
# define Z_HAS_ObjectMemberFunction 1
namespace Zeta {
template <class f> struct ObjectMemberFunction;
template <class r, class... p>
struct ObjectMemberFunction<r(p...)> : MemberFunction<r(p...)> {
NaT *object;
Z_INLINE ObjectMemberFunction() Z_NOTHROW
Z_DEFAULTED({})
# if Z_DIALECT_HAS(CPP11, INHERITING_CONSTRUCTORS)
using MemberFunction<r(p...)>::MemberFunction;
# else
template <class m, class e = typename TypeIf<
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value
>::type>
Z_INLINE ObjectMemberFunction(m function) Z_NOTHROW
: MemberFunction<r(p...)>(function) {}
# endif
# ifdef Z_NULLPTR
Z_CT(CPP11) ObjectMemberFunction(NullPtr) Z_NOTHROW
: MemberFunction<r(p...)>(nullptr), object(nullptr) {};
# endif
template <class o, class m, class e = typename TypeIf<
(Type<o>::is_void_pointer ||
(Type<o>::is_pointer &&
Type<o>::flow::pointee_type::is_class)) &&
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value
>::type>
Z_INLINE ObjectMemberFunction(o object, m function) Z_NOTHROW
: MemberFunction<r(p...)>(function), object(reinterpret_cast<NaT *>(object)) {}
template <class o, class m, class e = typename TypeIf<
Type<o>::is_class &&
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value
>::type>
Z_INLINE ObjectMemberFunction(const o &object, m function) Z_NOTHROW
: MemberFunction<r(p...)>(function), object(reinterpret_cast<NaT *>(&object)) {}
template <class o, class e = typename TypeIf<Type<o>::is_class>::type>
Z_INLINE operator o *() const Z_NOTHROW
{return reinterpret_cast<o *>(object);}
template <class o>
Z_INLINE typename TypeIf<Type<o>::is_class, ObjectMemberFunction &>::type
operator =(o *rhs) Z_NOTHROW
{
object = reinterpret_cast<NaT *>(rhs);
return *this;
}
template <class o>
Z_INLINE typename TypeIf<Type<o>::is_class, ObjectMemberFunction &>::type
operator =(const o &rhs) Z_NOTHROW
{
object = reinterpret_cast<NaT *>(&rhs);
return *this;
}
template <class m>
Z_INLINE typename TypeIf<
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value,
ObjectMemberFunction &>::type
operator =(m rhs) Z_NOTHROW
{
this->function = reinterpret_cast<r (NaT::*)(p...)>(rhs);
return *this;
}
Z_INLINE r operator ()(typename Type<p>::to_forwardable... arguments) const
{return (object->*this->function)(arguments...);}
template <class o>
Z_INLINE r operator ()(o *object, typename Type<p>::to_forwardable... arguments) const
{return (reinterpret_cast<NaT *>(object)->*this->function)(arguments...);}
template <class o>
Z_INLINE r operator ()(const o &object, typename Type<p>::to_forwardable... arguments) const
{return (reinterpret_cast<NaT *>(&object)->*this->function)(arguments...);}
template <class o, class m>
Z_INLINE typename TypeIf<
(Type<o>::is_void || Type<o>::is_class) &&
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value,
ObjectMemberFunction &>::type
set(o *object, m function) Z_NOTHROW
{
this->function = reinterpret_cast<r (NaT::*)(p...)>(function);
this->object = reinterpret_cast<NaT *>(&object);
return *this;
}
template <class o, class m>
Z_INLINE typename TypeIf<
Type<o>::is_class &&
Type<m>::is_member_function_pointer &&
TypeIsSame<typename Type<m>::flow::to_function::end::to_unqualified, r(p...)>::value,
ObjectMemberFunction &>::type
set(const o &object, m function) Z_NOTHROW
{
this->function = reinterpret_cast<r (NaT::*)(p...)>(function);
this->object = const_cast<NaT *>(reinterpret_cast<const NaT *>(&object));
return *this;
}
};
}
#endif
#endif // Z_classes_ObjectMemberFunction_HPP

View File

@@ -0,0 +1,94 @@
/* Zeta API - Z/classes/ObjectSelector.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_ObjectSelector_HPP
#define Z_classes_ObjectSelector_HPP
#include <Z/inspection/Z.h>
#include <Z/classes/Selector.hpp>
#if Z_HAS(Selector)
# define Z_HAS_ObjectSelector 1
namespace Zeta {
template <class f> struct ObjectSelector;
template <class r, class... p>
struct ObjectSelector<r(p...)> {
typedef r (* Send )(id, SEL, p...);
typedef r (* SendSuper)(struct objc_super *, SEL, p...);
SEL selector;
id object;
Z_INLINE ObjectSelector() Z_NOTHROW
Z_DEFAULTED({})
Z_INLINE ObjectSelector(id object_, SEL selector_) Z_NOTHROW
: object(object_), selector(selector_) {}
Z_INLINE operator id() const Z_NOTHROW
{return object;}
Z_INLINE operator SEL() const Z_NOTHROW
{return selector;}
Z_INLINE ObjectSelector &operator =(SEL rhs) Z_NOTHROW
{selector = rhs; return *this;}
Z_INLINE ObjectSelector &operator =(id rhs) Z_NOTHROW
{object = rhs; return *this;}
Z_INLINE r operator ()(typename Type<p>::to_forwardable... arguments) const Z_NOTHROW
{return (Send(ObjectiveC::send<r>()))(object, selector, arguments...);}
Z_INLINE r operator ()(id object_, typename Type<p>::to_forwardable... arguments) const Z_NOTHROW
{return (Send(ObjectiveC::send<r>()))(object_, selector, arguments...);}
Z_INLINE r super(typename Type<p>::to_forwardable... arguments) const Z_NOTHROW
{
struct objc_super object_super {object, class_getSuperclass(object_getClass(object))};
return (SendSuper(objc_msgSendSuper))(&object_super, this->selector, arguments...);
}
Z_INLINE r super(id object, typename Type<p>::to_forwardable... arguments) const Z_NOTHROW
{
struct objc_super object_super {object, class_getSuperclass(object_getClass(object))};
return (SendSuper(objc_msgSendSuper))(&object_super, this->selector, arguments...);
}
Z_INLINE r super(const struct objc_super &object_super, typename Type<p>::to_forwardable... arguments) const Z_NOTHROW
{
return (SendSuper(ObjectiveC::send_super<r>()))
(const_cast<struct objc_super *>(&object_super), selector, arguments...);
}
Z_INLINE ObjectSelector &set(id object, SEL selector) Z_NOTHROW
{
this->selector = selector;
this->object = object;
return *this;
}
};
}
#endif
#endif // Z_classes_ObjectSelector_HPP

View File

@@ -0,0 +1,30 @@
/* Zeta API - Z/classes/OpaqueMemberFunctionPointer.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_OpaqueMemberFunctionPointer_HPP
#define Z_classes_OpaqueMemberFunctionPointer_HPP
#include <Z/classes/NaT.hpp>
namespace Zeta {struct OpaqueMemberFunctionPointer {
void (NaT::* value)();
template <class m>
Z_INLINE OpaqueMemberFunctionPointer(m pointer) Z_NOTHROW
: value(reinterpret_cast<void (NaT::*)()>(pointer)) {}
template <class m>
Z_INLINE operator m() const Z_NOTHROW
{return reinterpret_cast<m>(value);}
};}
#endif // Z_classes_OpaqueMemberFunctionPointer_HPP

48
projects/Zeta/API/Z/classes/Pair.hpp vendored Normal file
View File

@@ -0,0 +1,48 @@
/* Zeta API - Z/classes/Pair.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Pair_HPP
#define Z_classes_Pair_HPP
#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;
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
{return first == pair.first && second == pair.second;}
Z_CT(CPP11) Boolean operator !=(const Pair &pair) const
{return first != pair.first || second != pair.second;}
/*Z_INLINE void swap(Pair &pair)
{
Zeta::swap<typename Type<Pair>::to_opaque>(
reinterpret_cast<typename Type<Pair>::to_opaque *>(this),
reinterpret_cast<typename Type<Pair>::to_opaque *>(&pair));
}*/
};}
#endif // Z_classes_Pair_HPP

135
projects/Zeta/API/Z/classes/Range.hpp vendored Normal file
View File

@@ -0,0 +1,135 @@
/* Zeta API - Z/classes/Range.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Range_HPP
#define Z_classes_Range_HPP
#include <Z/functions/math.hpp>
#if defined(Z_WITH_FOUNDATION) && Z_LANGUAGE_INCLUDES(OBJECTIVE_CPP)
# import <Foundation/NSRange.h>
#endif
namespace Zeta {template <class t> struct Range {
t index, size;
Z_INLINE Range() Z_NOTHROW
Z_DEFAULTED({})
Z_CT(CPP11) Range(t size_) Z_NOTHROW
: index(0), size(size_) {}
Z_CT(CPP11) Range(t index_, t size_) Z_NOTHROW
: index(index_), size(size_) {}
Z_CT(CPP11) operator Boolean() const Z_NOTHROW
{return !!size;}
friend Z_CT(CPP11) Boolean 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
{return lhs.index != rhs.index || lhs.size != rhs.size;}
friend Z_CT(CPP14) Range operator &(const Range &lhs, const Range &rhs) Z_NOTHROW
{
t index = (lhs.index > rhs.index) ? lhs.index : rhs.index;
t end = minimum<t>(lhs.end(), rhs.end());
return end > index ? Range(index, end - index) : Range(0);
}
friend Z_CT(CPP14) Range operator |(const Range &lhs, const Range &rhs) Z_NOTHROW
{
t index = (lhs.index < rhs.index) ? lhs.index : rhs.index;
t lhs_end = lhs.end();
t rhs_end = rhs.end();
return Range(index, ((lhs_end > rhs_end) ? lhs_end : rhs_end) - index);
}
friend Z_CT(CPP11) Range operator +(const Range &lhs, t rhs) Z_NOTHROW
{return Range(lhs.index, lhs.size + rhs);}
friend Z_CT(CPP11) Range operator +(t lhs, const Range &rhs) Z_NOTHROW
{return Range(rhs.index, rhs.size + lhs);}
friend Z_CT(CPP11) Range operator -(const Range &lhs, t rhs) Z_NOTHROW
{return Range(lhs.index, lhs.size - rhs);}
Z_CT(CPP11) Range operator >>(t rhs) const Z_NOTHROW {return Range(index + rhs, size);}
Z_CT(CPP11) Range operator <<(t rhs) const Z_NOTHROW {return Range(index - rhs, size);}
Z_INLINE Range &operator &=(const Range &rhs) Z_NOTHROW {return *this = *this & rhs;}
Z_INLINE Range &operator |=(const Range &rhs) Z_NOTHROW {return *this = *this | rhs;}
Z_INLINE Range &operator +=(t rhs) Z_NOTHROW {return *this = *this + rhs;}
Z_INLINE Range &operator -=(t rhs) Z_NOTHROW {return *this = *this - rhs;}
Z_INLINE Range &operator >>=(t rhs) Z_NOTHROW {return *this = *this >> rhs;}
Z_INLINE Range &operator <<=(t rhs) Z_NOTHROW {return *this = *this << rhs;}
Z_CT(CPP11) t operator [](t index_) const Z_NOTHROW {return index + index_;}
Z_CT(CPP11) Boolean contains(const Range &other) const Z_NOTHROW
{return other.index >= index && other.end() <= end();}
Z_CT(CPP11) Boolean contains(t index_) const Z_NOTHROW
{return index_ >= index && index_ < end();}
Z_CT(CPP11) t end() const Z_NOTHROW
{return index + size;}
Z_CT(CPP11) Boolean intersects(const Range &other) const Z_NOTHROW
{return index < other.end() && other.index < end();}
Z_CT(CPP11) Boolean 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
{
NSRange result = {NSUInteger(index), NSUInteger(size)};
return result;
}
# endif
# endif
};}
#endif // Z_classes_Range_HPP

View File

@@ -0,0 +1,736 @@
/* Zeta API - Z/classes/Rectangle.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Rectangle_HPP
#define Z_classes_Rectangle_HPP
#include <Z/classes/XY.hpp>
#ifdef Z_WITH_COCOS2D_X
# include "cocos2d.h"
#endif
#ifdef Z_WITH_CORE_FOUNDATION
# include <CoreGraphics/CGGeometry.h>
#endif
#if defined(Z_WITH_FOUNDATION) && Z_LANGUAGE_INCLUDES(OBJECTIVE_CPP)
# import <Foundation/NSGeometry.h>
#endif
#ifdef Z_WITH_QT
# include <QRect>
#endif
namespace Zeta {template <class t> struct Rectangle {
XY<t> point, size;
Z_INLINE Rectangle() Z_NOTHROW
Z_DEFAULTED({})
Z_CT(CPP11) Rectangle(const XY<t> &point_, const XY<t> &size_) Z_NOTHROW
: point(point_), size(size_) {}
Z_CT(CPP11) Rectangle(const XY<t> &point_, t size_x, t size_y) Z_NOTHROW
: point(point_), size(size_x, size_y) {}
Z_CT(CPP11) Rectangle(const XY<t> &point_, t size_xy) Z_NOTHROW
: point(point_), size(size_xy) {}
Z_CT(CPP11) Rectangle(t point_x, t point_y, const XY<t> &size_) Z_NOTHROW
: point(point_x, point_y), size(size_) {}
Z_CT(CPP11) Rectangle(t point_x, t point_y, t size_x, t size_y) Z_NOTHROW
: point(point_x, point_y), size(size_x, size_y) {}
Z_CT(CPP11) Rectangle(t point_x, t point_y, t size_xy) Z_NOTHROW
: point(point_x, point_y), size(size_xy) {}
Z_CT(CPP11) Rectangle(t point_xy, const XY<t> &size_) Z_NOTHROW
: point(point_xy), size(size_) {}
Z_CT(CPP11) Rectangle(const XY<t> &size_) Z_NOTHROW
: point(t(0)), size(size_) {}
Z_CT(CPP11) Rectangle(t size_x, t size_y) Z_NOTHROW
: point(t(0)), size(size_x, size_y) {}
Z_CT(CPP11) Rectangle(t size_xy) Z_NOTHROW
: point(t(0)), size(size_xy) {}
# if Z_DIALECT_HAS(CPP98, SFINAE) && \
Z_DIALECT_HAS(CPP11, DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATE)
template <class other_t, class e = typename TypeIf<!TypeIsSame<t, other_t>::value>::type>
Z_CT(CPP11) Rectangle(const Rectangle<other_t> &other) Z_NOTHROW
: point(other.point), size(other.size) {}
# endif
static Z_CT(CPP14) Rectangle from_vertices(const XY<t> &a, const XY<t> &b) Z_NOTHROW
{
XY<t> minimum = a.minimum(b);
return Rectangle(minimum, a.maximum(b) - minimum);
}
Z_CT(CPP11) operator Boolean() const Z_NOTHROW
{return point || size;}
friend Z_CT(CPP11) Boolean 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
{return lhs.point != rhs.point || lhs.size != rhs.size;}
friend Z_CT(CPP14) Rectangle operator &(const Rectangle &lhs, const Rectangle &rhs) Z_NOTHROW
{
t x1, x2, y1, y2;
return (x1 = maximum<t>(lhs.point.x, rhs.point.x)) <
(x2 = minimum<t>(lhs.point.x + lhs.size.x, rhs.point.x + rhs.size.x)) &&
(y1 = maximum<t>(lhs.point.y, rhs.point.y)) <
(y2 = minimum<t>(lhs.point.y + lhs.size.y, rhs.point.y + rhs.size.y))
? Rectangle(x1, y1, x2 - x1, y2 - y1)
: Rectangle(t(0));
}
friend Z_CT(CPP14) Rectangle operator |(const Rectangle &lhs, const Rectangle &rhs) Z_NOTHROW
{
Rectangle result;
result.point = lhs.point.minimum(rhs.point);
result.size = (lhs.point + lhs.size).maximum(rhs.point + rhs.size) - result.point;
return result;
}
friend Z_CT(CPP11) Rectangle operator +(const Rectangle &lhs, const XY<t> &rhs) Z_NOTHROW
{return Rectangle(lhs.point, lhs.size + rhs);}
friend Z_CT(CPP11) Rectangle operator +(const XY<t> &lhs, const Rectangle &rhs) Z_NOTHROW
{return Rectangle(rhs.point, rhs.size + lhs);}
friend Z_CT(CPP11) Rectangle operator +(const Rectangle &lhs, t rhs) Z_NOTHROW
{return Rectangle(lhs.point, lhs.size + rhs);}
friend Z_CT(CPP11) Rectangle operator +(t lhs, const Rectangle &rhs) Z_NOTHROW
{return Rectangle(rhs.point, rhs.size + lhs);}
friend Z_CT(CPP11) Rectangle operator -(const Rectangle &lhs, const XY<t> &rhs) Z_NOTHROW
{return Rectangle(lhs.point, lhs.size - rhs);}
friend Z_CT(CPP11) Rectangle operator -(const Rectangle &lhs, t rhs) Z_NOTHROW
{return Rectangle(lhs.point, lhs.size - rhs);}
friend Z_CT(CPP11) Rectangle operator *(const Rectangle &lhs, const XY<t> &rhs) Z_NOTHROW
{return Rectangle(lhs.point, lhs.size * rhs);}
friend Z_CT(CPP11) Rectangle operator *(const XY<t> &lhs, const Rectangle &rhs) Z_NOTHROW
{return Rectangle(rhs.point, rhs.size * lhs);}
friend Z_CT(CPP11) Rectangle operator *(const Rectangle &lhs, t rhs) Z_NOTHROW
{return Rectangle(lhs.point, lhs.size * rhs);}
friend Z_CT(CPP11) Rectangle operator *(t lhs, const Rectangle &rhs) Z_NOTHROW
{return Rectangle(rhs.point, rhs.size * lhs);}
friend Z_CT(CPP11) Rectangle operator /(const Rectangle &lhs, const XY<t> &rhs) Z_NOTHROW
{return Rectangle(lhs.point, lhs.size / rhs);}
friend Z_CT(CPP11) Rectangle operator /(const Rectangle &lhs, t rhs) Z_NOTHROW
{return Rectangle(lhs.point, lhs.size / rhs);}
Z_INLINE Rectangle &operator &=(const Rectangle &rhs) Z_NOTHROW {return *this = *this & rhs;}
Z_INLINE Rectangle &operator |=(const Rectangle &rhs) Z_NOTHROW {return *this = *this | rhs;}
Z_INLINE Rectangle &operator +=(const XY<t> &rhs) Z_NOTHROW {return *this = *this + rhs;}
Z_INLINE Rectangle &operator -=(const XY<t> &rhs) Z_NOTHROW {return *this = *this - rhs;}
Z_INLINE Rectangle &operator *=(const XY<t> &rhs) Z_NOTHROW {return *this = *this * rhs;}
Z_INLINE Rectangle &operator /=(const XY<t> &rhs) Z_NOTHROW {return *this = *this / rhs;}
Z_INLINE Rectangle &operator +=(t rhs) Z_NOTHROW {return *this = *this + rhs;}
Z_INLINE Rectangle &operator -=(t rhs) Z_NOTHROW {return *this = *this - rhs;}
Z_INLINE Rectangle &operator *=(t rhs) Z_NOTHROW {return *this = *this * rhs;}
Z_INLINE Rectangle &operator /=(t rhs) Z_NOTHROW {return *this = *this / rhs;}
Z_CT(CPP11) XY<t> bottom() const Z_NOTHROW
{return XY<t>(point.x + size.x / t(2), point.y);}
Z_CT(CPP11) XY<t> bottom(t (* round)(t)) const Z_NOTHROW
{return XY<t>(round(point.x + size.x / t(2)), point.y);}
Z_CT(CPP11) Rectangle bottom(const XY<t> &size_) const Z_NOTHROW
{return Rectangle(point.x + (size.x - size_.x) / t(2), point.y, size_);}
Z_CT(CPP11) Rectangle bottom(const XY<t> &size_, t (* round)(t)) const Z_NOTHROW
{return Rectangle(round(point.x + (size.x - size_.x) / t(2)), point.y, size_);}
Z_CT(CPP11) XY<t> bottom_left() const Z_NOTHROW
{return point;}
Z_CT(CPP11) Rectangle bottom_left(const XY<t> &size_) const Z_NOTHROW
{return Rectangle(point, size_);}
Z_CT(CPP11) XY<t> bottom_right() const Z_NOTHROW
{return XY<t>(point.x + size.x, point.y);}
Z_CT(CPP11) Rectangle bottom_right(const XY<t> &size_) const Z_NOTHROW
{return Rectangle(point.x + size.x - size_.x, point.y, size_);}
Z_CT(CPP11) XY<t> center() const Z_NOTHROW
{return point + size / t(2);}
Z_CT(CPP11) XY<t> center(t (* round)(t)) const Z_NOTHROW
{return XY<t>(round(point.x + size.x / t(2)), round(point.y + size.y / t(2)));}
Z_CT(CPP11) Rectangle center(const XY<t> &size_) const Z_NOTHROW
{return Rectangle(point + (size - size_) / t(2), size_);}
Z_CT(CPP11) Rectangle center(const XY<t> &size_, t (* round)(t)) const Z_NOTHROW
{
return Rectangle(
round(point.x + (size.x - size_.x) / t(2)),
round(point.y + (size.y - size_.y) / t(2)),
size);
}
Z_CT(CPP11) XY<t> left() const Z_NOTHROW
{return XY<t>(point.x, point.y + size.y / t(2));}
Z_CT(CPP11) XY<t> left(t (* round)(t)) const Z_NOTHROW
{return XY<t>(point.x, round(point.y + size.y / t(2)));}
Z_CT(CPP11) Rectangle left(const XY<t> &size_) const Z_NOTHROW
{return Rectangle(point.x, point.y + (size.y - size_.y) / t(2), size_);}
Z_CT(CPP11) Rectangle left(const XY<t> &size_, t (* round)(t)) const Z_NOTHROW
{return Rectangle(point.x, round(point.y + (size.y - size_.y) / t(2)), size_);}
Z_CT(CPP11) XY<t> right() const Z_NOTHROW
{return XY<t>(point.x + size.x, point.y + size.y / t(2));}
Z_CT(CPP11) XY<t> right(t (* round)(t)) const Z_NOTHROW
{return XY<t>(point.x + size.x, round(point.y + size.y / t(2)));}
Z_CT(CPP11) Rectangle right(const XY<t> &size_) const Z_NOTHROW
{
return Rectangle(
point.x + size.x - size_.x,
point.y + (size.y - size_.y) / t(2),
size_);
}
Z_CT(CPP11) Rectangle right(const XY<t> &size_, t (* round)(t)) const Z_NOTHROW
{
return Rectangle(
point.x + size.x - size_.x,
round(point.y + (size.y - size_.y) / t(2)),
size_);
}
Z_CT(CPP11) XY<t> top() const Z_NOTHROW
{return XY<t>(point.x + size.x / t(2), point.y + size.y);}
Z_CT(CPP11) XY<t> top(t (* round)(t)) const Z_NOTHROW
{return XY<t>(round(point.x + size.x / t(2)), point.y + size.y);}
Z_CT(CPP11) Rectangle top(const XY<t> &size_) const Z_NOTHROW
{
return Rectangle(
point.x + (size.x - size_.x) / t(2),
point.y + size.y - size_.y,
size_);
}
Z_CT(CPP11) Rectangle top(const XY<t> &size_, t (* round)(t)) const Z_NOTHROW
{
return Rectangle(
round(point.x + (size.x - size_.x) / t(2)),
point.y + size.y - size_.y,
size_);
}
Z_CT(CPP11) XY<t> top_left() const Z_NOTHROW
{return XY<t>(point.x, point.y + size.y);}
Z_CT(CPP11) Rectangle top_left(const XY<t> &size_) const Z_NOTHROW
{return Rectangle(point.x, point.y + size.y - size_.y, size_);}
Z_CT(CPP11) XY<t> top_right() const Z_NOTHROW
{return point + size;}
Z_CT(CPP11) Rectangle top_right(const XY<t> &size_) const Z_NOTHROW
{return Rectangle(point + size - size_, size_);}
Z_CT(CPP11) Rectangle bottom_half() const Z_NOTHROW
{return Rectangle(point, size.x, size.y / t(2));}
Z_CT(CPP11) Rectangle bottom_left_quarter() const Z_NOTHROW
{return Rectangle(point, size / t(2));}
Z_CT(CPP11) Boolean contains(const Rectangle &other) const Z_NOTHROW
{
return !other.size.has_zero() &&
other.point >= point &&
other.point + other.size <= point + size;
}
Z_CT(CPP11) Boolean contains(const XY<t> &point_) const Z_NOTHROW
{return point_ >= point && point_ < point + size;}
Z_INLINE Rectangle &correct() Z_NOTHROW
{
if (size.x < t(0)) point.x -= (size.x = -size.x);
if (size.y < t(0)) point.y -= (size.y = -size.y);
return *this;
}
Z_CT(CPP14) Rectangle fit_bottom(const XY<t> &size_) const Z_NOTHROW
{
XY<t> fitting_size = size_.fit(size);
return Rectangle(point.x + (size.x - fitting_size.x) / t(2), point.y, fitting_size);
}
Z_CT(CPP11) Rectangle fit_bottom_left(const XY<t> &size_) const Z_NOTHROW
{return Rectangle(point, size_.fit(size));}
Z_CT(CPP14) Rectangle fit_bottom_right(const XY<t> &size_) const Z_NOTHROW
{
XY<t> fitting_size = size_.fit(size);
return Rectangle(point.x + size.x - fitting_size.x, point.y, fitting_size);
}
Z_CT(CPP14) Rectangle fit(const XY<t> &size_) const Z_NOTHROW
{
XY<t> fitting_size = size_.fit(size);
return Rectangle(point + (size - fitting_size) / t(2), fitting_size);
}
Z_CT(CPP14) Rectangle fit_left(const XY<t> &size_) const Z_NOTHROW
{
XY<t> fitting_size = size_.fit(size);
return Rectangle(point.x, point.y + (size.y - fitting_size.y) / t(2), fitting_size);
}
Z_CT(CPP14) Rectangle fit_right(const XY<t> &size_) const Z_NOTHROW
{
XY<t> fitting_size = size_.fit(size);
return Rectangle(
point.x + size.x - fitting_size.x,
point.y + (size.y - fitting_size.y) / t(2),
fitting_size);
}
Z_CT(CPP14) Rectangle fit_top(const XY<t> &size_) const Z_NOTHROW
{
XY<t> fitting_size = size_.fit(size);
return Rectangle(
point.x + (size.x - fitting_size.x) / t(2),
point.y + size.y - fitting_size.y,
fitting_size);
}
Z_CT(CPP14) Rectangle fit_top_left(const XY<t> &size_) const Z_NOTHROW
{
XY<t> fitting_size = size_.fit(size);
return Rectangle(point.x, point.y + size.y - fitting_size.y, fitting_size);
}
Z_CT(CPP14) Rectangle fit_top_right(const XY<t> &size_) const Z_NOTHROW
{
XY<t> fitting_size = size_.fit(size);
return Rectangle(point + size - fitting_size, fitting_size);
}
Z_CT(CPP11) Rectangle grow_from_bottom_center(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x - delta.x / t(2), point.y, size + delta);}
Z_CT(CPP11) Rectangle grow_from_bottom_left(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point, size + delta);}
Z_CT(CPP11) Rectangle grow_from_bottom_right(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x - delta.x, point.y, size + delta);}
Z_CT(CPP11) Rectangle grow_from_center(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point - delta / t(2), size + delta);}
Z_CT(CPP11) Rectangle grow_from_center_left(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x, point.y - delta.y / t(2), size + delta);}
Z_CT(CPP11) Rectangle grow_from_center_right(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x - delta.x, point.y - delta.y / t(2), size + delta);}
Z_CT(CPP11) Rectangle grow_from_top_center(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x - delta.x / t(2), point.y - delta.y, size + delta);}
Z_CT(CPP11) Rectangle grow_from_top_left(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x, point.y - delta.y, size + delta);}
Z_CT(CPP11) Rectangle grow_from_top_right(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point - delta, size + delta);}
Z_CT(CPP11) Rectangle grow_in_x_from_center(t delta) const Z_NOTHROW
{return Rectangle(point.x - delta / t(2), point.y, size.x + delta, size.y);}
Z_CT(CPP11) Rectangle grow_in_x_from_left(t delta) const Z_NOTHROW
{return Rectangle(point, size.x + delta, size.y);}
Z_CT(CPP11) Rectangle grow_in_x_from_right(t delta) const Z_NOTHROW
{return Rectangle(point.x - delta, point.y, size.x + delta, size.y);}
Z_CT(CPP11) Rectangle grow_in_y_from_bottom(t delta) const Z_NOTHROW
{return Rectangle(point, size.x, size.y + delta);}
Z_CT(CPP11) Rectangle grow_in_y_from_center(t delta) const Z_NOTHROW
{return Rectangle(point.x, point.y - delta / t(2), size.x, size.y + delta);}
Z_CT(CPP11) Rectangle grow_in_y_from_top(t delta) const Z_NOTHROW
{return Rectangle(point.x, point.y - delta, size.x, size.y + delta);}
Z_CT(CPP11) Boolean intersects(const Rectangle &other) const Z_NOTHROW
{
return !size.has_zero() &&
!other.size.has_zero() &&
other.point + other.size > point &&
other.point < point + size;
}
Z_CT(CPP11) Boolean is_zero() const Z_NOTHROW
{return point.is_zero() && size.is_zero();}
Z_CT(CPP11) Rectangle left_half () const Z_NOTHROW
{return Rectangle(point, size.x / t(2), size.y);}
Z_CT(CPP11) t maximum_x() const Z_NOTHROW {return point.x + size.x;}
Z_CT(CPP11) t maximum_y() const Z_NOTHROW {return point.y + size.y;}
Z_CT(CPP11) t middle_x () const Z_NOTHROW {return point.x + size.x / t(2);}
Z_CT(CPP11) t middle_y () const Z_NOTHROW {return point.y + size.y / t(2);}
Z_CT(CPP11) t minimum_x() const Z_NOTHROW {return point.x;}
Z_CT(CPP11) t minimum_y() const Z_NOTHROW {return point.y;}
Z_CT(CPP11) Rectangle shrink_from_bottom_center(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x + delta.x / t(2), point.y, size - delta);}
Z_CT(CPP11) Rectangle shrink_from_bottom_left(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point, size - delta);}
Z_CT(CPP11) Rectangle shrink_from_bottom_right(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x + delta.x, point.y, size - delta);}
Z_CT(CPP11) Rectangle shrink_from_center(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point + delta / t(2), size - delta);}
Z_CT(CPP11) Rectangle shrink_from_center_left(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x, point.y + delta.y / t(2), size - delta);}
Z_CT(CPP11) Rectangle shrink_from_center_right(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x + delta.x, point.y + delta.y / t(2), size - delta);}
Z_CT(CPP11) Rectangle shrink_from_top_center(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x + delta.x / t(2), point.y + delta.y, size - delta);}
Z_CT(CPP11) Rectangle shrink_from_top_left(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point.x, point.y + delta.y, size - delta);}
Z_CT(CPP11) Rectangle shrink_from_top_right(const XY<t> &delta) const Z_NOTHROW
{return Rectangle(point + delta, size - delta);}
Z_CT(CPP11) Rectangle shrink_in_x_from_center(t delta) const Z_NOTHROW
{return Rectangle(point.x + delta / t(2), point.y, size.x - delta, size.y);}
Z_CT(CPP11) Rectangle shrink_in_x_from_left(t delta) const Z_NOTHROW
{return Rectangle(point, size.x - delta, size.y);}
Z_CT(CPP11) Rectangle shrink_in_x_from_right(t delta) const Z_NOTHROW
{return Rectangle(point.x + delta, point.y, size.x - delta, size.y);}
Z_CT(CPP11) Rectangle shrink_in_y_from_bottom(t delta) const Z_NOTHROW
{return Rectangle(point, size.x, size.y - delta);}
Z_CT(CPP11) Rectangle shrink_in_y_from_center(t delta) const Z_NOTHROW
{return Rectangle(point.x, point.y + delta / t(2), size.x, size.y - delta);}
Z_CT(CPP11) Rectangle shrink_in_y_from_top(t delta) const Z_NOTHROW
{return Rectangle(point.x, point.y + delta, size.x, size.y - delta);}
Z_CT(CPP11) XY<t> absolute_point_to_unit(const XY<t> &point_) const Z_NOTHROW
{return (point_ - point) / size;}
Z_CT(CPP11) Rectangle bottom_right_quarter() const Z_NOTHROW
{return Rectangle(point.x + size.x / t(2), point.y, size / t(2));}
Z_CT(CPP11) Rectangle right_half() const Z_NOTHROW
{return Rectangle(point.x + size.x / t(2), point.y, size.x / t(2), size.y);}
Z_CT(CPP11) Rectangle top_half() const Z_NOTHROW
{return Rectangle(point.x, point.y + size.y / t(2), size.x, size.y / t(2));}
Z_CT(CPP11) Rectangle top_left_quarter() const Z_NOTHROW
{return Rectangle(point.x, point.y + size.y / t(2), size / t(2));}
Z_CT(CPP11) Rectangle top_right_quarter() const Z_NOTHROW
{return Rectangle(point + size / t(2), size / t(2));}
Z_CT(CPP11) XY<t> unit_point_to_absolute(const XY<t> &point_) const Z_NOTHROW
{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 \
: point(rectangle.origin), size(rectangle.size) {} \
\
\
Z_CT(CPP11) Rectangle(const Prefix##Point &point_) Z_NOTHROW \
: point(t(0)), size(point_) {} \
\
\
Z_CT(CPP11) Rectangle(const Prefix##Size &size_) Z_NOTHROW \
: point(t(0)), size(size_) {}
# if Z_DIALECT_HAS(CPP11, COPY_LIST_INITIALIZATION)
# define Z_z_APPLE_OPERATORS(Prefix) \
\
Z_CT(CPP11) operator Prefix##Rect() const Z_NOTHROW \
{ \
return {{CGFloat(point.x), CGFloat(point.y)}, \
{CGFloat(size.x), CGFloat(size.y)}}; \
}
# else
# define Z_z_APPLE_OPERATORS(Prefix) \
\
Z_CT(CPP14) operator Prefix##Rect() const Z_NOTHROW \
{ \
Prefix##Rect result = { \
{CGFloat(point.x), CGFloat(point.y)}, \
{CGFloat(size.x), CGFloat(size.y)}}; \
\
return result; \
}
# endif
# ifdef Z_WITH_CORE_FOUNDATION
Z_z_APPLE_CONSTRUCTORS(CG)
Z_z_APPLE_OPERATORS (CG)
# endif
# if defined(Z_WITH_FOUNDATION) && \
Z_LANGUAGE_INCLUDES(OBJECTIVE_CPP) && \
(!defined(Z_WITH_CORE_FOUNDATION) || \
!defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) || \
!NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
Z_z_APPLE_CONSTRUCTORS(NS)
Z_z_APPLE_OPERATORS (NS)
# endif
# 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()) {}
Z_CT(CPP11) Rectangle(const QPoint &point_) Z_NOTHROW
: point(t(0)), size(point) {}
Z_CT(CPP11) Rectangle(const QSize &size_) Z_NOTHROW
: point(t(0)), size(size_) {}
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

View File

@@ -0,0 +1,39 @@
/* Zeta API - Z/classes/Reference.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Reference_HPP
#define Z_classes_Reference_HPP
#include <Z/macros/language.hpp>
namespace Zeta {template <class t> struct Reference {
typedef t type;
t *value;
Z_CT(CPP11) Reference(t &value_) Z_NOTHROW
: value(&value_) {}
# if Z_DIALECT_HAS(CPP11, DELETED_FUNCTION)
Z_CT(CPP11) Reference(t &&value_) = delete;
# endif
Z_CT(CPP11) operator t &() const Z_NOTHROW
{return *value;}
Z_CT(CPP11) t &get() const Z_NOTHROW
{return *value;}
};}
#endif // Z_classes_Span_HPP

128
projects/Zeta/API/Z/classes/Selector.hpp vendored Normal file
View File

@@ -0,0 +1,128 @@
/* Zeta API - Z/classes/Selector.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Selector_HPP
#define Z_classes_Selector_HPP
#include <Z/inspection/language.h>
#if Z_DIALECT_HAS(CPP98, SFINAE) && \
Z_DIALECT_HAS(CPP11, VARIADIC_TEMPLATE) && \
Z_DIALECT_HAS(CPP11, DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATE)
# include <Z/traits/type.hpp>
# include <Z/functions/Objective-C.hpp>
# if Z_DIALECT_HAS(CPP11, RVALUE_REFERENCE)
# include <Z/functions/casting.hpp>
# endif
# 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...);
typedef r (* SendSuper)(objc_super *, SEL, p...);
SEL selector;
Z_INLINE Selector()
Z_DEFAULTED({})
Z_INLINE Selector(SEL selector_)
: selector(selector_) {}
Z_INLINE operator SEL() const Z_NOTHROW
{return selector;}
Z_INLINE r operator ()(id object, typename Type<p>::to_forwardable... arguments) const Z_NOTHROW
{
return (Send(ObjectiveC::send<r>()))
(object, selector, arguments...);
}
Z_INLINE r super(id object, typename Type<p>::to_forwardable... arguments) const Z_NOTHROW
{
objc_super object_super = {object, class_getSuperclass(object_getClass(object))};
return (SendSuper(ObjectiveC::send_super<r>()))
(&object_super, selector, arguments...);
}
Z_INLINE r super(const objc_super &object_super, typename Type<p>::to_forwardable... arguments) const Z_NOTHROW
{
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..., ...)> {
typedef r (* Send )(id, SEL, p..., ...);
typedef r (* SendSuper)(objc_super *, SEL, p..., ...);
SEL selector;
Z_INLINE Selector()
Z_DEFAULTED({})
Z_INLINE Selector(SEL selector)
: selector(selector) {}
Z_INLINE operator SEL() const Z_NOTHROW
{return selector;}
template <class... pp>
Z_INLINE r operator ()(id object, pp&&... arguments) const Z_NOTHROW
{
return (Send(ObjectiveC::send<r>()))
(object, selector, forwardable<pp>(arguments)...);
}
template <class... pp>
Z_INLINE r super(id object, pp&&... arguments) const Z_NOTHROW
{
objc_super object_super = {object, class_getSuperclass(object_getClass(object))};
return (SendSuper(ObjectiveC::send_super<r>()))
(&object_super, selector, forwardable<pp>(arguments)...);
}
template <class... pp>
Z_INLINE r super(const objc_super &object_super, pp&&... arguments) const Z_NOTHROW
{
return (SendSuper(ObjectiveC::send_super<r>()))
(const_cast<objc_super *>(&object_super), selector, forwardable<pp>(arguments)...);
}
};
# endif
}
#endif
#endif // Z_classes_Selector_HPP

177
projects/Zeta/API/Z/classes/Shared.hpp vendored Normal file
View File

@@ -0,0 +1,177 @@
/* Zeta API - Z/classes/Shared.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Shared_HPP
#define Z_classes_Shared_HPP
#include <Z/constants/pointer.h>
#include <Z/macros/language.hpp>
#include <Z/types/integral.hpp>
#include <Z/types/pointer.hpp>
namespace Zeta {template <class t> struct Shared {
struct Owned {
t* data;
USize owner_count;
Z_INLINE Owned(t *data) Z_NOTHROW
: data(data), owner_count(1) {}
Z_INLINE ~Owned()
{delete data;}
};
Owned *owned;
Z_CT(CPP11) Shared() Z_NOTHROW
: owned(Z_NULL) {}
Z_INLINE Shared(const Shared &other) Z_NOTHROW
{if ((owned = other.owned)) owned->owner_count++;}
Z_INLINE Shared(t *data) Z_NOTHROW
{owned = data ? new Owned(data) : Z_NULL;}
Z_INLINE ~Shared()
{if (owned && !--owned->owner_count) delete owned;}
Z_INLINE operator Boolean() const Z_NOTHROW
{return Boolean(owned);}
Z_INLINE Shared &operator =(const Shared &rhs)
{
if (owned != rhs.owned)
{
if (owned && !--owned->owner_count) delete owned;
if ((owned = rhs.owned)) owned->owner_count++;
}
return *this;
}
Z_INLINE Shared &operator =(t *rhs)
{
if (owned)
{
if (owned->data == rhs) return *this;
if (!--owned->owner_count) delete owned;
}
owned = rhs ? new Owned(rhs) : Z_NULL;
return *this;
}
friend Z_INLINE Boolean 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
{return lhs.owned != rhs.owned;}
Z_INLINE t &operator *() const Z_NOTHROW
{return *owned->data;}
Z_INLINE t *operator ->() const Z_NOTHROW
{return owned->data;}
Z_INLINE t *get() const Z_NOTHROW
{return owned ? owned->data : Z_NULL;}
Z_INLINE USize owner_count() const Z_NOTHROW
{return owned->owner_count;}
Z_INLINE void reset()
{
if (owned && !--owned->owner_count) delete owned;
owned = Z_NULL;
}
Z_INLINE void swap(Shared &other) Z_NOTHROW
{
Owned *ex = owned;
owned = other.owned;
other.owned = ex;
}
# ifdef Z_NULLPTR
Z_CT(CPP11) Shared(NullPtr) Z_NOTHROW
: owned(nullptr) {}
Z_INLINE Shared &operator =(NullPtr)
{
if (owned && !--owned->owner_count) delete owned;
owned = nullptr;
return *this;
}
friend Z_INLINE Boolean operator ==(const Shared &lhs, NullPtr) Z_NOTHROW
{return !lhs.owned;}
friend Z_INLINE Boolean operator ==(NullPtr, const Shared &rhs) Z_NOTHROW
{return !rhs.owned;}
friend Z_INLINE Boolean operator !=(const Shared &lhs, NullPtr) Z_NOTHROW
{return !!lhs.owned;}
friend Z_INLINE Boolean 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;}
Z_INLINE Shared &operator =(Shared &&rhs)
{
if (owned != rhs.owned)
{
if (owned && !--owned->owner_count) delete owned;
owned = rhs.owned;
rhs.owned = Z_NULL;
}
return *this;
}
# endif
};}
#endif // Z_classes_Shared_HPP

View File

@@ -0,0 +1,55 @@
/* Zeta API - Z/classes/SizedString.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_SizedString_HPP
#define Z_classes_SizedString_HPP
#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];
Z_CT(CPP11) SizedString(const t (&string)[s]) Z_NOTHROW
: data{string[i]..., 0} {}
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) {}
Z_CT(CPP11) SizedString(const StringView<t> &string_view) Z_NOTHROW
: ZetaDetail::SizedString<t, s>(string_view) {}
Z_CT(CPP11) operator const t *() const Z_NOTHROW
{return this->data;}
Z_CT(CPP11) const t &operator [](USize index) const Z_NOTHROW
{return this->data[index];}
};}
#endif // Z_classes_SizedString_HPP

78
projects/Zeta/API/Z/classes/Span.hpp vendored Normal file
View File

@@ -0,0 +1,78 @@
/* Zeta API - Z/classes/Span.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Span_HPP
#define Z_classes_Span_HPP
#include <Z/constants/pointer.h>
#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;
typedef PtrDiff difference_type;
typedef t element_type;
// typedef Iterator<Span> iterator;
typedef t* pointer;
typedef t& reference;
// typedef Iterator<t*> reverse_iterator;
typedef USize size_type;
typedef typename Type<t>::remove_const_volatile value_type;
t* data;
USize size;
Z_CT(CPP11) Span(t *first, USize size_) Z_NOTHROW
: data(first), size(size_) {}
Z_CT(CPP11) Span(t *first, t *last) Z_NOTHROW
: data(first), size(last - first) {}
Z_CT(CPP11) t &operator [](USize index) const Z_NOTHROW
{return data[index];}
Z_CT(CPP11) t &first() const Z_NOTHROW
{return data[0];}
Z_CT(CPP11) t &last() const Z_NOTHROW
{return data[size - 1];}
Z_CT(CPP11) Span head(USize head_size) const Z_NOTHROW
{return Span(data, head_size);}
Z_CT(CPP11) Span tail(USize tail_size) const Z_NOTHROW
{return Span(&data[size - tail_size], tail_size);}
Z_CT(CPP11) Span range(USize range_index, USize range_size) const Z_NOTHROW
{return Span(&data[range_index], range_size);}
Z_CT(CPP11) Span range(const Range<USize> &range) const Z_NOTHROW
{return Span(&data[range.index], range.size);}
/* Z_CT(CPP11) Iterator<Span> begin() const Z_NOTHROW
{return Iterator<Span>(*this, 0);}
Z_CT(CPP11) Iterator<Span> end() const Z_NOTHROW
{return Iterator<Span>(*this, size);}*/
};}
#endif // Z_classes_Span_HPP

60
projects/Zeta/API/Z/classes/Strid.hpp vendored Normal file
View File

@@ -0,0 +1,60 @@
/* Zeta API - Z/classes/Strid.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Strid_HPP
#define Z_classes_Strid_HPP
#include <Z/functions/hash.hpp>
namespace Zeta {struct Strid {
UInt64 hash;
Z_INLINE Strid() Z_NOTHROW
Z_DEFAULTED({})
Z_CT(CPP11) Strid(UInt64 hash_) Z_NOTHROW
: hash(hash_) {}
Z_CT(CPP14) Strid(const Char *string) Z_NOTHROW
: hash(fnv1a_64(string)) {}
Z_CT(CPP11) operator UInt64() const Z_NOTHROW
{return hash;}
friend Z_CT(CPP11) Boolean 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
{return lhs.hash == rhs;}
friend Z_CT(CPP11) Boolean 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
{return lhs.hash != rhs.hash;}
friend Z_CT(CPP11) Boolean 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
{return lhs != rhs.hash;}
};}
#endif // Z_classes_Strid_HPP

View File

@@ -0,0 +1,112 @@
/* Zeta API - Z/classes/StringView.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_StringView_HPP
#define Z_classes_StringView_HPP
#include <Z/constants/pointer.h>
#include <Z/macros/language.hpp>
#include <Z/types/integral.hpp>
#include <Z/classes/Iterator.hpp>
#ifdef Z_WITH_STDCPP
# include <cstring>
#endif
namespace Zeta {template <class t = Char> struct StringView {
// typedef Iterator<t*> const_iterator;
// typedef Iterator<t*> const_reverse_iterator;
typedef const t* const_pointer;
typedef const t& const_reference;
typedef PtrDiff difference_type;
// typedef Iterator<t*> iterator;
typedef t* pointer;
typedef t& reference;
// typedef Iterator<t*> reverse_iterator;
typedef USize size_type;
typedef t value_type;
const t* data;
USize size;
Z_CT(CPP11) StringView() Z_NOTHROW
: data(Z_NULL), size(0) {}
Z_CT(CPP11) StringView(const t *data_, USize size_) Z_NOTHROW
: data(data_), size(size_) {}
template <USize s>
Z_CT(CPP11) StringView(const t (&data_)[s]) Z_NOTHROW
: data(data_), size(s - 1) {}
Z_CT(CPP11) const t &operator [](USize index) const Z_NOTHROW
{return data[index];}
/* Z_CT(CPP11) iterator begin() const Z_NOTHROW
{}
Z_CT(CPP11) iterator end() const Z_NOTHROW
{}*/
# ifdef Z_WITH_STDCPP
friend Z_INLINE Boolean 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
{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
{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
{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
{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
{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
{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
{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
{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
{return rhs.size * sizeof(t) != std::strlen(lhs) || std::memcmp(rhs.data, lhs, rhs.size * sizeof(t));}
# endif
};}
#endif // Z_classes_StringView_HPP

View File

@@ -0,0 +1,107 @@
/* Zeta API - Z/classes/TripleBuffer.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_TripleBuffer_HPP
#define Z_classes_TripleBuffer_HPP
#include <Z/constants/pointer.h>
#include <Z/macros/language.hpp>
#include <Z/types/buffer.h>
#include <Z/types/integral.hpp>
#include <Z/functions/atomic.h>
namespace Zeta {struct TripleBuffer : ZTripleBuffer {
Z_INLINE TripleBuffer() Z_NOTHROW
Z_DEFAULTED({})
Z_INLINE TripleBuffer(void *slot_0, void *slot_1, void *slot_2) Z_NOTHROW
{initialize(slot_0, slot_1, slot_2);}
Z_INLINE void initialize(void *slot_0, void *slot_1, void *slot_2) Z_NOTHROW
{
slots[0] = slot_0;
slots[1] = slot_1;
slots[2] = slot_2;
f = 6;
}
/// @brief Marks the current consumption slot as consumed.
///
/// @return A pointer to the new consumption slot.
Z_INLINE void *consume() Z_NOTHROW
{
UChar fi, fo;
do {
if (!((fi = f) & 64)) return Z_NULL;
fo = UChar((fi & 48) | ((fi & 12) >> 2) | ((fi & 3) << 2));
}
while (!z_T_atomic_set_if_equal(UCHAR)(&f, fi, fo));
return slots[fo & 3];
}
/// @brief Gets a pointer to the current consumption slot.
///
/// @return A pointer to the current consumption slot.
Z_CT(CPP11) void *consumption() const Z_NOTHROW
{return slots[f & 3];}
/// @brief Gets the index of the current consumption slot.
///
/// @return The index of the current consumption slot.
Z_CT(CPP11) UChar consumption_index() const Z_NOTHROW
{return f & 3;}
/// @brief Marks the the current production slot as produced.
///
/// @return A pointer to the new production slot.
Z_INLINE void *produce() Z_NOTHROW
{
UChar fi, fo;
do {
fi = f;
fo = UChar(64 | ((fi & 48) >> 2) | ((fi & 12) << 2) | (fi & 3));
}
while (!z_T_atomic_set_if_equal(UCHAR)(&f, fi, fo));
return slots[(fo & 48) >> 4];
}
/// @brief Gets a pointer to the production slot.
///
/// @return A pointer to the current production slot.
Z_CT(CPP11) void *production() const Z_NOTHROW
{return slots[(f & 48) >> 4];}
/// @brief Gets the index of the current production slot.
///
/// @return The index of the current production slot.
Z_CT(CPP11) UChar production_index() const Z_NOTHROW
{return (f & 48) >> 4;}
};}
#endif // Z_classes_TripleBuffer_HPP

143
projects/Zeta/API/Z/classes/Tuple.hpp vendored Normal file
View File

@@ -0,0 +1,143 @@
/* Zeta API - Z/classes/Tuple.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_Tuple_HPP
#define Z_classes_Tuple_HPP
#include <Z/inspection/language.h>
#if Z_DIALECT_HAS(CPP11, EXTENDED_VARIADIC_TEMPLATE_TEMPLATE_PARAMETERS) /* ¿No es necesario, basta con VARIADIC_TEMPLATE? */
# include <Z/traits/type.hpp>
# 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({})
Z_CT(CPP11) Element(
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)};
public:
typedef ZetaDetail::Tuple::Element<typename TypeListRotateRight<
typename TypeListRemoveTail<TypeList<t...>, tail_size>::type, 1
>::type> Element;
typedef typename Element::type type;
};
# if !Z_DIALECT_HAS(CPP11, INHERITING_CONSTRUCTORS)
using Super::Super;
# else
Z_INLINE Tuple()
Z_DEFAULTED({})
Z_CT(CPP11) Tuple(typename Type<t>::to_forwardable... values)
: Super(values...) {}
# endif
template <UInt index>
Z_INLINE typename At<index>::type &at() Z_NOTHROW
{return At<index>::Element::value;}
template <UInt index>
Z_CT(CPP11) typename Type<typename At<index>::type>::to_forwardable get() const Z_NOTHROW
{return At<index>::Element::value;}
template <UInt index>
Z_INLINE Tuple &set(typename Type<typename At<index>::type>::to_forwardable value)
{
At<index>::Element::value = value;
return *this;
}
};}
# if defined(Z_WITH_STD) && \
Z_DIALECT_HAS(CPP17, STRUCTURED_BINDING) && \
defined(__has_include) && \
__has_include(<tuple>)
# include <tuple>
# define Z_z_IMPLEMENTATION(qualifiers) \
\
template <class... t> \
struct std::tuple_size<qualifiers Zeta::Tuple<t...> > { \
enum {value = sizeof...(t)}; \
}; \
\
template <std::size_t i, class... t> \
struct std::tuple_element<i, qualifiers Zeta::Tuple<t...> > { \
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)
Z_z_IMPLEMENTATION( volatile)
# undef Z_z_IMPLEMENTATION
# endif
#endif
#endif // Z_classes_Tuple_HPP

501
projects/Zeta/API/Z/classes/XY.hpp vendored Normal file
View File

@@ -0,0 +1,501 @@
/* Zeta API - Z/classes/XY.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_XY_HPP
#define Z_classes_XY_HPP
#include <Z/functions/math.hpp>
#ifdef Z_WITH_CORE_FOUNDATION
# include <CoreGraphics/CGGeometry.h>
#endif
#if defined(Z_WITH_FOUNDATION) && Z_LANGUAGE_INCLUDES(OBJECTIVE_CPP)
# import <Foundation/NSGeometry.h>
#endif
#ifdef Z_WITH_COCOS2D_X
# include "cocos2d.h"
#endif
#ifdef Z_WITH_QT
# include <QPoint>
# include <QSize>
# include <QRect>
#endif
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_) {}
Z_CT(CPP11) XY(t xy) Z_NOTHROW
: x(xy), y(xy) {}
Z_CT(CPP11) XY(const XYZ<t> &xy) Z_NOTHROW
: x(xy.x), y(xy.y) {}
# if Z_DIALECT_HAS(CPP98, SFINAE) && \
Z_DIALECT_HAS(CPP11, DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATE)
template <class other_t, class e = typename TypeIf<!TypeIsSame<t, other_t>::value>::type>
Z_CT(CPP11) XY(const XY<other_t> &other) Z_NOTHROW
: x(t(other.x)), y(t(other.y)) {}
# endif
Z_CT(CPP11) operator Boolean() const Z_NOTHROW
{return x != t(0) || y != t(0);}
friend Z_CT(CPP11) Boolean 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
{return lhs.x != rhs.x || lhs.y != rhs.y;}
friend Z_CT(CPP11) Boolean 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
{return lhs.x <= rhs.x && lhs.y <= rhs.y;}
friend Z_CT(CPP11) Boolean 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
{return lhs.x < rhs.x && lhs.y < rhs.y;}
friend Z_CT(CPP11) XY operator +(const XY &lhs, const XY &rhs) Z_NOTHROW
{return XY(lhs.x + rhs.x, lhs.y + rhs.y);}
friend Z_CT(CPP11) XY operator -(const XY &lhs, const XY &rhs) Z_NOTHROW
{return XY(lhs.x - rhs.x, lhs.y - rhs.y);}
friend Z_CT(CPP11) XY operator *(const XY &lhs, const XY &rhs) Z_NOTHROW
{return XY(lhs.x * rhs.x, lhs.y * rhs.y);}
friend Z_CT(CPP11) XY operator /(const XY &lhs, const XY &rhs) Z_NOTHROW
{return XY(lhs.x / rhs.x, lhs.y / rhs.y);}
friend Z_CT(CPP11) Boolean 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
{return lhs.x != rhs || lhs.y != rhs;}
friend Z_CT(CPP11) Boolean 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
{return lhs.x <= rhs && lhs.y <= rhs;}
friend Z_CT(CPP11) Boolean 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
{return lhs.x < rhs && lhs.y < rhs;}
friend Z_CT(CPP11) XY operator +(const XY &lhs, t rhs) Z_NOTHROW
{return XY(lhs.x + rhs, lhs.y + rhs);}
friend Z_CT(CPP11) XY operator -(const XY &lhs, t rhs) Z_NOTHROW
{return XY(lhs.x - rhs, lhs.y - rhs);}
friend Z_CT(CPP11) XY operator *(const XY &lhs, t rhs) Z_NOTHROW
{return XY(lhs.x * rhs, lhs.y * rhs);}
friend Z_CT(CPP11) XY operator /(const XY &lhs, t rhs) Z_NOTHROW
{return XY(lhs.x / rhs, lhs.y / rhs);}
friend Z_CT(CPP11) Boolean 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
{return lhs != rhs.x || lhs != rhs.y;}
friend Z_CT(CPP11) Boolean 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
{return lhs <= rhs.x && lhs <= rhs.y;}
friend Z_CT(CPP11) Boolean 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
{return lhs < rhs.x && lhs < rhs.y;}
friend Z_CT(CPP11) XY operator +(t lhs, const XY &rhs) Z_NOTHROW
{return XY(lhs + rhs.x, lhs + rhs.y);}
friend Z_CT(CPP11) XY operator *(t lhs, const XY &rhs) Z_NOTHROW
{return XY(lhs * rhs.x, lhs * rhs.y);}
Z_INLINE XY &operator +=(const XY &rhs) Z_NOTHROW {return *this = *this + rhs;}
Z_INLINE XY &operator -=(const XY &rhs) Z_NOTHROW {return *this = *this - rhs;}
Z_INLINE XY &operator *=(const XY &rhs) Z_NOTHROW {return *this = *this * rhs;}
Z_INLINE XY &operator /=(const XY &rhs) Z_NOTHROW {return *this = *this / rhs;}
Z_INLINE XY &operator +=(t rhs) Z_NOTHROW {return *this = *this + rhs;}
Z_INLINE XY &operator -=(t rhs) Z_NOTHROW {return *this = *this - rhs;}
Z_INLINE XY &operator *=(t rhs) Z_NOTHROW {return *this = *this * rhs;}
Z_INLINE XY &operator /=(t rhs) Z_NOTHROW {return *this = *this / rhs;}
Z_INLINE t operator [](UInt index) const Z_NOTHROW {return ((t *)this)[index];}
Z_INLINE t &operator [](UInt index) Z_NOTHROW {return ((t *)this)[index];}
Z_CT(CPP11) XY yx () const Z_NOTHROW {return XY(y, x);}
Z_CT(CPP11) XYZ<t> nxy(t n) const Z_NOTHROW {return XYZ<t>(n, x, y);}
Z_CT(CPP11) XYZ<t> nyx(t n) const Z_NOTHROW {return XYZ<t>(n, y, x);}
Z_CT(CPP11) XYZ<t> xny(t n) const Z_NOTHROW {return XYZ<t>(x, n, y);}
Z_CT(CPP11) XYZ<t> xyn(t n) const Z_NOTHROW {return XYZ<t>(x, y, n);}
Z_CT(CPP11) XYZ<t> ynx(t n) const Z_NOTHROW {return XYZ<t>(y, n, x);}
Z_CT(CPP11) XYZ<t> yxn(t n) const Z_NOTHROW {return XYZ<t>(y, x, n);}
Z_INLINE XY apply(t (* function)(t)) const Z_NOTHROW
{return XY(function(x), function(y));}
Z_CT(CPP11) XY clamp(const XY &minimum, const XY &maximum) const Z_NOTHROW
{
return XY(
Zeta::clamp<t>(x, minimum.x, maximum.x),
Zeta::clamp<t>(y, minimum.y, maximum.y));
}
Z_CT(CPP11) XY clamp(t minimum, t maximum) const Z_NOTHROW
{
return XY(
Zeta::clamp<t>(x, minimum, maximum),
Zeta::clamp<t>(y, minimum, maximum));
}
Z_CT(CPP11) t cross_product(const XY &other) const Z_NOTHROW
{return x * other.y - y * other.x;}
Z_CT(CPP11) t dot_product(const XY &other) const Z_NOTHROW
{return x * other.x + y * other.y;}
Z_CT(CPP11) XY fit(const XY &other) const Z_NOTHROW
{
return y / x > other.y / other.x
? XY(x * other.y / y, other.y)
: XY(other.x, y * other.x / x);
}
Z_CT(CPP11) Boolean has_zero() const Z_NOTHROW
{return x == t(0) || y == t(0);}
Z_CT(CPP11) t inner_maximum() const Z_NOTHROW
{return Zeta::maximum<t>(x, y);}
Z_CT(CPP11) t inner_middle() const Z_NOTHROW
{return (x + y) / t(2);}
Z_CT(CPP11) t inner_minimum() const Z_NOTHROW
{return Zeta::minimum<t>(x, y);}
Z_CT(CPP11) t inner_product() const Z_NOTHROW
{return x * y;}
Z_CT(CPP11) t inner_sum() const Z_NOTHROW
{return x + y;}
Z_CT(CPP11) Boolean is_zero() const Z_NOTHROW
{return x == t(0) && y == t(0);}
Z_CT(CPP11) XY maximum(const XY &other) const Z_NOTHROW
{return XY(Zeta::maximum<t>(x, other.x), Zeta::maximum<t>(y, other.y));}
Z_CT(CPP11) XY middle(const XY &other) const Z_NOTHROW
{return XY((x + other.x) / t(2), (y + other.y) / t(2));}
Z_CT(CPP11) XY minimum(const XY &other) const Z_NOTHROW
{return XY(Zeta::minimum<t>(x, other.x), Zeta::minimum<t>(y, other.y));}
Z_CT(CPP11) t squared_length() const Z_NOTHROW
{return x * x + y * y;}
// 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
{return x < t(0) || y < t(0);}
Z_CT(CPP11) Boolean is_negative() const Z_NOTHROW
{return x < t(0) && y < t(0);}
Z_CT(CPP11) XY negative() const Z_NOTHROW
{return XY(-x, -y);}
// MARK: - Integer
// Z_CT(CPP11) Boolean 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
{return Zeta::is_almost_zero<t>(x) || Zeta::is_almost_zero<t>(y);}
Z_CT(CPP11) Boolean 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
{return Zeta::is_infinity<t>(x) || Zeta::is_infinity<t>(y);}
Z_CT(CPP11) Boolean has_nan() const Z_NOTHROW
{return Zeta::is_nan<t>(x) || Zeta::is_nan<t>(y);}
Z_CT(CPP11) XY inverse_lerp(const XY &other, t v) const Z_NOTHROW
{
return XY(
Zeta::inverse_lerp<t>(x, other.x, v),
Zeta::inverse_lerp<t>(y, other.y, v));
}
Z_CT(CPP11) Boolean 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
{return Zeta::is_almost_zero<t>(x) && Zeta::is_almost_zero<t>(y);}
Z_CT(CPP11) Boolean 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
{return Zeta::is_infinity<t>(x) && Zeta::is_infinity<t>(y);}
Z_CT(CPP11) Boolean 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
{return Zeta::absolute<t>(dot_product(other)) <= Type<t>::epsilon();}
Z_CT(CPP11) XY lerp(const XY &other, t v) const Z_NOTHROW
{
return XY(
Zeta::lerp<t>(x, other.x, v),
Zeta::lerp<t>(y, other.y, v));
}
Z_CT(CPP11) XY reciprocal() const Z_NOTHROW
{return XY(t(1) / x, t(1) / y);}
# 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 \
: x(t(point.x)), y(t(point.y)) {} \
\
\
Z_CT(CPP11) XY(const Prefix##Size &size) Z_NOTHROW \
: x(t(size.width)), y(t(size.height)) {}
# if Z_DIALECT_HAS(CPP11, COPY_LIST_INITIALIZATION)
# define Z_z_APPLE_OPERATORS(Prefix) \
\
Z_CT(CPP11) operator Prefix##Point() const Z_NOTHROW \
{return {CGFloat(x), CGFloat(y)};} \
\
\
Z_CT(CPP11) operator Prefix##Size() const Z_NOTHROW \
{return {CGFloat(x), CGFloat(y)};} \
\
\
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) \
\
Z_CT(CPP14) operator Prefix##Point() const Z_NOTHROW \
{ \
Prefix##Point result = {CGFloat(x), CGFloat(y)}; \
return result; \
} \
\
\
Z_CT(CPP14) operator Prefix##Size() const Z_NOTHROW \
{ \
Prefix##Size result = {CGFloat(x), CGFloat(y)}; \
return result; \
} \
\
\
Z_CT(CPP14) operator Prefix##Rect() const Z_NOTHROW \
{ \
Prefix##Rect result = {CGFloat(0), CGFloat(0), CGFloat(x), CGFloat(y)}; \
return result; \
}
# endif
# ifdef Z_WITH_CORE_FOUNDATION
Z_z_APPLE_CONSTRUCTORS(CG)
Z_z_APPLE_OPERATORS (CG)
# endif
# if defined(Z_WITH_FOUNDATION) && \
Z_LANGUAGE_INCLUDES(OBJECTIVE_CPP) && \
(!defined(Z_WITH_CORE_FOUNDATION) || \
!defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) || \
!NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
Z_z_APPLE_CONSTRUCTORS(NS)
Z_z_APPLE_OPERATORS (NS)
# endif
# 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) {}
Z_CT(CPP11) XY(const cocos2d::Size &size) Z_NOTHROW
: x(size.width), y(size.height) {}
Z_INLINE operator cocos2d::Vec2() const Z_NOTHROW
{return cocos2d::Vec2(float(x), float(y));}
Z_INLINE operator cocos2d::Size() const Z_NOTHROW
{return cocos2d::Size(float(x), float(y));}
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())) {}
Z_CT(CPP11) XY(const QSize &size) Z_NOTHROW
: x(t(size.width())), y(t(size.height())) {}
Z_CT(CPP11) operator QPoint() const Z_NOTHROW
{return QPoint(int(x), int(y));}
Z_CT(CPP11) operator QSize() const Z_NOTHROW
{return QSize(int(x), int(y));}
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
#endif // Z_classes_XY_HPP

522
projects/Zeta/API/Z/classes/XYZ.hpp vendored Normal file
View File

@@ -0,0 +1,522 @@
/* Zeta API - Z/classes/XYZ.hpp
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_classes_XYZ_HPP
#define Z_classes_XYZ_HPP
#ifndef Z_classes_XY_HPP
# 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_) {}
Z_CT(CPP11) XYZ(t x_, t y_) Z_NOTHROW
: x(x_), y(y_), z(t(0)) {}
Z_CT(CPP11) XYZ(t xyz) Z_NOTHROW
: x(xyz), y(xyz) {}
Z_CT(CPP11) XYZ(const XY<t> &xy) Z_NOTHROW
: x(xy.x), y(xy.y), z(t(0)) {}
Z_CT(CPP11) XYZ(const XY<t> &xy, t z_) Z_NOTHROW
: x(xy.x), y(xy.y), z(z_) {}
Z_CT(CPP11) XYZ(t x_, const XY<t> &yz) Z_NOTHROW
: x(x_), y(yz.x), z(yz.y) {}
# if Z_DIALECT_HAS(CPP98, SFINAE) && \
Z_DIALECT_HAS(CPP11, DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATE)
template <class other_t, class e = typename TypeIf<!TypeIsSame<t, other_t>::value>::type>
Z_CT(CPP11) XYZ(const XYZ<other_t> &other) Z_NOTHROW
: x(t(other.x)), y(t(other.y), x(t(other.z))) {}
# endif
Z_CT(CPP11) operator Boolean() 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
{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
{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
{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
{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
{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
{return lhs.x < rhs.x && lhs.y < rhs.y && lhs.z < rhs.z;}
friend Z_CT(CPP11) XYZ operator +(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
{return XYZ(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z);}
friend Z_CT(CPP11) XYZ operator -(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
{return XYZ(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z);}
friend Z_CT(CPP11) XYZ operator *(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
{return XYZ(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z);}
friend Z_CT(CPP11) XYZ operator /(const XYZ &lhs, const XYZ &rhs) Z_NOTHROW
{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
{return lhs.x == rhs && lhs.y == rhs && lhs.z == rhs;}
friend Z_CT(CPP11) Boolean 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
{return lhs.x >= rhs && lhs.y >= rhs && lhs.z >= rhs;}
friend Z_CT(CPP11) Boolean 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
{return lhs.x > rhs && lhs.y > rhs && lhs.z > rhs;}
friend Z_CT(CPP11) Boolean operator <(const XYZ &lhs, t rhs) Z_NOTHROW
{return lhs.x < rhs && lhs.y < rhs && lhs.z < rhs;}
friend Z_CT(CPP11) XYZ operator +(const XYZ &lhs, t rhs) Z_NOTHROW
{return XYZ(lhs.x + rhs, lhs.y + rhs, lhs.z + rhs);}
friend Z_CT(CPP11) XYZ operator -(const XYZ &lhs, t rhs) Z_NOTHROW
{return XYZ(lhs.x - rhs, lhs.y - rhs, lhs.z - rhs);}
friend Z_CT(CPP11) XYZ operator *(const XYZ &lhs, t rhs) Z_NOTHROW
{return XYZ(lhs.x * rhs, lhs.y * rhs, lhs.z * rhs);}
friend Z_CT(CPP11) XYZ operator /(const XYZ &lhs, t rhs) Z_NOTHROW
{return XYZ(lhs.x / rhs, lhs.y / rhs, lhs.z / rhs);}
friend Z_CT(CPP11) Boolean 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
{return lhs != rhs.x || lhs != rhs.y || lhs != rhs.y;}
friend Z_CT(CPP11) Boolean 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
{return lhs <= rhs.x && lhs <= rhs.y && lhs <= rhs.z;}
friend Z_CT(CPP11) Boolean 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
{return lhs < rhs.x && lhs < rhs.y && lhs < rhs.z;}
friend Z_CT(CPP11) XYZ operator +(t lhs, const XYZ &rhs) Z_NOTHROW
{return XYZ(lhs + rhs.x, lhs + rhs.y, lhs + rhs.z);}
friend Z_CT(CPP11) XYZ operator *(t lhs, const XYZ &rhs) Z_NOTHROW
{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
{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
{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
{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
{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
{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
{return lhs.x < rhs.x && lhs.y < rhs.y && lhs.z < t(0);}
friend Z_CT(CPP11) XYZ operator +(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
{return XYZ(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z);}
friend Z_CT(CPP11) XYZ operator -(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
{return XYZ(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z);}
friend Z_CT(CPP11) XYZ operator *(const XYZ &lhs, const XY<t> &rhs) Z_NOTHROW
{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
{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
{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
{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
{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
{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
{return lhs.x < rhs.x && lhs.y < rhs.y && t(0) < rhs.z;}
friend Z_CT(CPP11) XYZ operator +(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
{return XYZ(lhs.x + rhs.x, lhs.y + rhs.y, rhs.z);}
friend Z_CT(CPP11) XYZ operator *(const XY<t> &lhs, const XYZ &rhs) Z_NOTHROW
{return XYZ(lhs.x + rhs.x, lhs.y + rhs.y, rhs.z, t(0));}
Z_INLINE XYZ &operator +=(const XYZ &rhs) Z_NOTHROW {return *this = *this + rhs;}
Z_INLINE XYZ &operator -=(const XYZ &rhs) Z_NOTHROW {return *this = *this - rhs;}
Z_INLINE XYZ &operator *=(const XYZ &rhs) Z_NOTHROW {return *this = *this * rhs;}
Z_INLINE XYZ &operator /=(const XYZ &rhs) Z_NOTHROW {return *this = *this / rhs;}
Z_INLINE XYZ &operator +=(t rhs) Z_NOTHROW {return *this = *this + rhs;}
Z_INLINE XYZ &operator -=(t rhs) Z_NOTHROW {return *this = *this - rhs;}
Z_INLINE XYZ &operator *=(t rhs) Z_NOTHROW {return *this = *this * rhs;}
Z_INLINE XYZ &operator /=(t rhs) Z_NOTHROW {return *this = *this / rhs;}
Z_INLINE XY<t> &operator +=(XY<t> rhs) Z_NOTHROW {return *this = *this + rhs;}
Z_INLINE XY<t> &operator -=(XY<t> rhs) Z_NOTHROW {return *this = *this - rhs;}
Z_INLINE XY<t> &operator *=(XY<t> rhs) Z_NOTHROW {return *this = *this * rhs;}
Z_INLINE t operator [](UInt index) const Z_NOTHROW {return ((t *)this)[index];}
Z_INLINE t &operator [](UInt index) Z_NOTHROW {return ((t *)this)[index];}
Z_CT(CPP11) XY<t> xy () const Z_NOTHROW {return XY<t>(x, y);}
Z_CT(CPP11) XY<t> xz () const Z_NOTHROW {return XY<t>(x, z);}
Z_CT(CPP11) XY<t> yx () const Z_NOTHROW {return XY<t>(y, x);}
Z_CT(CPP11) XY<t> yz () const Z_NOTHROW {return XY<t>(y, z);}
Z_CT(CPP11) XY<t> zx () const Z_NOTHROW {return XY<t>(z, x);}
Z_CT(CPP11) XY<t> zy () const Z_NOTHROW {return XY<t>(z, y);}
Z_CT(CPP11) XYZ xzy() const Z_NOTHROW {return XYZ(x, z, y);}
Z_CT(CPP11) XYZ yxz() const Z_NOTHROW {return XYZ(y, x, z);}
Z_CT(CPP11) XYZ yzx() const Z_NOTHROW {return XYZ(y, z, x);}
Z_CT(CPP11) XYZ zxy() const Z_NOTHROW {return XYZ(z, x, y);}
Z_CT(CPP11) XYZ zyx() const Z_NOTHROW {return XYZ(z, y, x);}
Z_INLINE XYZ apply(t (* function)(t)) const Z_NOTHROW
{return XYZ(function(x), function(y), function(z));}
Z_CT(CPP11) XYZ clamp(const XYZ &minimum, const XYZ &maximum) const Z_NOTHROW
{
return XYZ(
Zeta::clamp<t>(x, minimum.x, maximum.x),
Zeta::clamp<t>(y, minimum.y, maximum.y),
Zeta::clamp<t>(z, minimum.z, maximum.z));
}
Z_CT(CPP11) XYZ clamp(t minimum, t maximum) const Z_NOTHROW
{
return XYZ(
Zeta::clamp<t>(x, minimum, maximum),
Zeta::clamp<t>(y, minimum, maximum),
Zeta::clamp<t>(z, minimum, maximum));
}
Z_CT(CPP11) XYZ cross_product(const XYZ &other) const Z_NOTHROW
{
return XYZ(
y * other.z - z * other.y,
z * other.x - x * other.z,
x * other.y - y * other.x);
}
Z_CT(CPP11) t dot_product(const XYZ &other) const Z_NOTHROW
{return x * other.x + y * other.y + z * other.z;}
Z_CT(CPP11) XYZ fit(const XYZ &other) const Z_NOTHROW
{return XYZ(t(0));} /* TODO */
Z_CT(CPP11) Boolean has_zero() const Z_NOTHROW
{return x == t(0) || y == t(0) || z == t(0);}
Z_CT(CPP11) t inner_maximum() const Z_NOTHROW
{return Zeta::maximum<t>(Zeta::maximum<t>(x, y), z);}
Z_CT(CPP11) t inner_middle() const Z_NOTHROW
{return (x + y + z) / t(3);}
Z_CT(CPP11) t inner_minimum() const Z_NOTHROW
{return Zeta::minimum<t>(Zeta::minimum<t>(x, y), z);}
Z_CT(CPP11) t inner_product() const Z_NOTHROW
{return x * y * z;}
Z_CT(CPP11) t inner_sum() const Z_NOTHROW
{return x + y + z;}
Z_CT(CPP11) Boolean is_zero() const Z_NOTHROW
{return x == t(0) && y == t(0) && z == t(0);}
Z_CT(CPP11) XYZ maximum(const XYZ &other) const Z_NOTHROW
{
return XYZ(
Zeta::maximum<t>(x, other.x),
Zeta::maximum<t>(y, other.y),
Zeta::maximum<t>(z, other.z));
}
Z_CT(CPP11) XYZ middle(const XYZ &other) const Z_NOTHROW
{
return XYZ(
(x + other.x) / t(2),
(y + other.y) / t(2),
(z + other.z) / t(2));
}
Z_CT(CPP11) XYZ minimum(const XYZ &other) const Z_NOTHROW
{
return XYZ(
Zeta::minimum<t>(x, other.x),
Zeta::minimum<t>(y, other.y),
Zeta::minimum<t>(z, other.z));
}
/*Z_INLINE XYZ rotate_as_axes(XYZ<SInt8> rotation) const Z_NOTHROW
{
XYZ result = *this;
if ((rotation.x % 4) & 1) Zeta::swap<t>(&result.y, &result.z);
if ((rotation.y % 4) & 1) Zeta::swap<t>(&result.x, &result.z);
if ((rotation.z % 4) & 1) Zeta::swap<t>(&result.x, &result.y);
return result;
}*/
Z_CT(CPP11) t squared_length() const Z_NOTHROW
{return x * x + y * y + z * z;}
// MARK: - Signed
Z_CT(CPP11) XYZ absolute() const Z_NOTHROW
{
return XYZ(
Zeta::absolute<t>(x),
Zeta::absolute<t>(y),
Zeta::absolute<t>(z));
}
Z_CT(CPP11) Boolean has_negative() const Z_NOTHROW
{return x < t(0) || y < t(0) || z < t(0);}
Z_CT(CPP11) Boolean is_negative() const Z_NOTHROW
{return x < t(0) && y < t(0) && z < t(0);}
Z_CT(CPP11) XYZ negative() const Z_NOTHROW
{return XYZ(-x, -y, -z);}
// MARK: - Integer
//Z_CT(CPP11) Boolean 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(
Zeta::clamp_01<t>(x),
Zeta::clamp_01<t>(y),
Zeta::clamp_01<t>(z));
}
Z_CT(CPP11) Boolean has_almost_zero() const Z_NOTHROW
{
return Zeta::is_almost_zero<t>(x) ||
Zeta::is_almost_zero<t>(y) ||
Zeta::is_almost_zero<t>(z);
}
Z_CT(CPP11) Boolean has_finite() const Z_NOTHROW
{
return Zeta::is_finite<t>(x) ||
Zeta::is_finite<t>(y) ||
Zeta::is_finite<t>(z);
}
Z_CT(CPP11) Boolean has_infinity() const Z_NOTHROW
{
return Zeta::is_infinity<t>(x) ||
Zeta::is_infinity<t>(y) ||
Zeta::is_infinity<t>(z);
}
Z_CT(CPP11) Boolean has_nan() const Z_NOTHROW
{
return Zeta::is_nan<t>(x) ||
Zeta::is_nan<t>(y) ||
Zeta::is_nan<t>(z);
}
Z_CT(CPP11) XYZ inverse_lerp(const XYZ &other, t v) const Z_NOTHROW
{
return XYZ(
Zeta::inverse_lerp<t>(x, other.x, v),
Zeta::inverse_lerp<t>(y, other.y, v),
Zeta::inverse_lerp<t>(z, other.z, v));
}
Z_CT(CPP11) Boolean 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) &&
Zeta::are_almost_equal<t>(z, other.z);
}
Z_CT(CPP11) Boolean is_almost_zero() const Z_NOTHROW
{
return Zeta::is_almost_zero<t>(x) &&
Zeta::is_almost_zero<t>(y) &&
Zeta::is_almost_zero<t>(z);
}
Z_CT(CPP11) Boolean is_finite() const Z_NOTHROW
{
return Zeta::is_finite<t>(x) &&
Zeta::is_finite<t>(y) &&
Zeta::is_finite<t>(z);
}
Z_CT(CPP11) Boolean is_infinity() const Z_NOTHROW
{
return Zeta::is_infinity<t>(x) &&
Zeta::is_infinity<t>(y) &&
Zeta::is_infinity<t>(z);
}
Z_CT(CPP11) Boolean is_nan() const Z_NOTHROW
{
return Zeta::is_nan<t>(x) &&
Zeta::is_nan<t>(y) &&
Zeta::is_nan<t>(z);
}
Z_CT(CPP11) Boolean is_perpendicular(const XYZ &other) const Z_NOTHROW
{return Zeta::absolute<t>(dot_product(other)) <= Type<t>::epsilon();}
Z_CT(CPP11) XYZ lerp(const XYZ &other, t v) const Z_NOTHROW
{
return XYZ(
Zeta::lerp<t>(x, other.x, v),
Zeta::lerp<t>(y, other.y, v),
Zeta::lerp<t>(z, other.z, v));
}
Z_CT(CPP11) XYZ reciprocal() const Z_NOTHROW
{return XYZ(t(1) / x, t(1) / y, t(1) / z);}
};
}
#endif // Z_classes_XYZ_HPP

32
projects/Zeta/API/Z/constants/boolean.h vendored Normal file
View File

@@ -0,0 +1,32 @@
/* Zeta API - Z/constants/boolean.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_constants_boolean_H
#define Z_constants_boolean_H
#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif
#ifdef Z_TRUE
# undef Z_TRUE
#endif
#define Z_TRUE 1
#ifdef Z_FALSE
# undef Z_FALSE
#endif
#define Z_FALSE 0
#endif /* Z_constants_boolean_H */

47
projects/Zeta/API/Z/constants/build.hpp vendored Normal file
View File

@@ -0,0 +1,47 @@
/* Zeta API - Z/constants/build.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_constants_build_HPP
#define Z_constants_build_HPP
#include <Z/inspection/language.h>
#if Z_DIALECT_HAS_SPECIFIER(CPP11, CONSTEXPR)
namespace Zeta {enum {
build_year = (__DATE__[7] - '0') * 1000 + (__DATE__[ 8] - '0') * 100 +
(__DATE__[9] - '0') * 10 + (__DATE__[10] - '0'),
build_month = __DATE__[0] == 'J'
? (__DATE__[1] == 'a'
? 1
: (__DATE__[2] == 'n' ? 6 : 7))
: (__DATE__[0] == 'F'
? 2
: (__DATE__[0] == 'M'
? (__DATE__[2] == 'r' ? 3 : 5)
: (__DATE__[0] == 'A'
? (__DATE__[1] == 'p' ? 4 : 8)
: (__DATE__[0] == 'S'
? 9
: (__DATE__[0] == 'O'
? 10
: (__DATE__[0] == 'N' ? 11 : 12)))))),
build_day = (__DATE__[4] == ' '
? 0
: __DATE__[4] - '0') * 10 + (__DATE__[5] - '0'),
build_hour = (__TIME__[0] - '0') * 10 + (__TIME__[1] - '0'),
build_minutes = (__TIME__[3] - '0') * 10 + (__TIME__[4] - '0'),
build_seconds = (__TIME__[6] - '0') * 10 + (__TIME__[7] - '0')
};}
#endif
#endif /* Z_constants_build_HPP */

968
projects/Zeta/API/Z/constants/numbers.h vendored Normal file
View File

@@ -0,0 +1,968 @@
/* Zeta API - Z/constants/numbers.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_constants_numbers_H
#define Z_constants_numbers_H
/* MARK: - Irrational numbers */
#define Z_ALPHA /* α ~ Feigenbaum's α Constant */ 2.\
5029078750958928222839028732182157863812713767271499773361920567\
7923546317959020670329964974643383412959523186999585472394218237\
7785445179272863314993372578112163594879503744781260997380598671\
2397117373289276654044010306698313834600094139322364490657889951\
2205843172507873377463087853424285351988587500042358246918740820\
4281700901714823051821621619413199856066129382742649709844084470\
1008054549677936760888126446406885181552709324007542506497157047\
0475419932831783645332562415378693957125097066387979492654623137\
6745918909813116752434221110130913127837160951158341230841503716\
4997020224681219644081216686527458043026245782561067150138521821\
6449532543349873487413352795815351016583605455763513276501810781\
1948369459574850237398235452625632779475397269902012891516645793\
9420198920248803394051699686551494477396533876979741232354061781\
9896112494095990353128997733611849847377946108428833293833903950\
9008914086351525626803381414669279913310743349705143545201344643\
4264752001621384610729922641994332772918977769053802596851
#define Z_DELTA /* δ ~ Feigenbaum's δ Constant */ 4.\
6692016091029906718532038204662016172581855774757686327456513430\
0413433021131473713868974402394801381716598485518981513440862714\
2027932522312442988890890859944935463236713411532481714219947455\
6443658237932020095610583305754586176522220703854106467494942849\
8145339172620056875566595233987560382563722564800409510712838906\
1184470277585428541980111344017500242858538249833571552205223608\
7250291678860362674527213399057131606875345083433934446103706309\
4520191158769724322735898389037949462572512890979489867683346116\
2688911656312347446057517953912204556247280709520219819909455858\
1946136877445617396074115614074243754435499204869180982648652368\
4387027996490173977934251347238087371362116018601281861020563818\
1835409759847796417390032893617143215987824078977661439139576403\
7760537119096932066998361984288981837003229412030210655743295550\
3888458497370347275321219257069584140746618419819610061296401614\
8771294441590140546794180019813325337859249336588307045999993837\
5411726563553016862529032210862320550634510679399023341675
#define Z_DELTA_S /* δs ~ Silver Ratio */ 2.\
4142135623730950488016887242096980785696718753769480731766797379\
9073247846210703885038753432764157
#define Z_E /* e ~ Euler's Number */ 2.\
7182818284590452353602874713526624977572470936999595749669676277\
2407663035354759457138217852516642742746639193200305992181741359\
6629043572900334295260595630738132328627943490763233829880753195\
2510190115738341879307021540891499348841675092447614606680822648\
0016847741185374234544243710753907774499206955170276183860626133\
1384583000752044933826560297606737113200709328709127443747047230\
6969772093101416928368190255151086574637721112523897844250569536\
9677078544996996794686445490598793163688923009879312773617821542\
4999229576351482208269895193668033182528869398496465105820939239\
8294887933203625094431173012381970684161403970198376793206832823\
7646480429531180232878250981945581530175671736133206981125099618\
1881593041690351598888519345807273866738589422879228499892086805\
8257492796104841984443634632449684875602336248270419786232090021\
6099023530436994184914631409343173814364054625315209618369088870\
7016768396424378140592714563549061303107208510383750510115747704\
1718986106873969655212671546889570350354021234078498193343210681
#define Z_G /* G ~ Catalan's Constant */ 0.\
9159655941772190150546035149323841107741493742816721342664981196\
21763019776254769479356512926115106248574
#define Z_GAMMA /* γ ~ EulerMascheroni Constant */ 0.\
5772156649015328606065120900824024310421593359399235988057672348\
8486772677766467093694706329174674951463144724980708248096050401\
4486542836224173997644923536253500333742937337737673942792595258\
2470949160087352039481656708532331517766115286211995015079847937\
4508570574002992135478614669402960432542151905877553526733139925\
4012967420513754139549111685102807984234877587205038431093997361\
3725530608893312676001724795378367592713515772261027349291394079\
8430103417771778088154957066107501016191663340152278935867965497\
2520362128792265559536696281763887927268013243101047650596370394\
7394957638906572967929601009015125195950922243501409349871228247\
9497471956469763185066761290638110518241974448678363808617494551\
6989279230187739107294578155431600500218284409605377243420328547\
8367015177394398700302370339518328690001558193988042707411542227\
8197165230110735658339673487176504919418123000406546931429992977\
7956930310050308630341856980323108369164002589297089098548682577\
73642882539549258736295961332985747393023734388470703702844129
#define Z_OMEGA /* Ω ~ W(1) */ 0.\
5671432904097838729999686622103555497538157871865125081351310792\
2304579308668456669321944696175229455763802497286678978545235846\
5940072995608516439289994614311571492959803594376698474635606134\
2268461356989570453977624855707865877337063566333012384304556354\
2978608509015429081920856055752374819658465950807273089050157336\
1831596070667108039283918360149499646349348448317465915933636893\
3680971490856983717510093546792166747552889731475588925030572822\
4604865124854109688318448770433467727016574464765200627013360494\
8057883875774914635983034808686985627342099151198306130250270223\
7292838727216542426572698430693890685874829642167823425504200307\
1966795220895590936913343950051154949542716768789494702443830337\
8784002606637609098563645828787818795338304237475555696975428665\
6135480540090110477123732473016808842009334259193374301935466235\
3076567270975761218841385994442828002635250684447525596225061138\
7848128978427693880472920268889238516484753423844953902789609971\
1060547842212061361983111973376227976096491011771088137407049732
#define Z_P2 /* P₂ ~ Universal Parabolic Constant */ 2.\
2955871493926380740342980491894903875978322036385834839299753466\
4410966268413312668409442623789761559175
#define Z_PHI /* φ ~ Divine Proportion, Golden Ratio */ 1.\
6180339887498948482045868343656381177203091798057628621354486227\
0526046281890244970720720418939113748475408807538689175212663386\
2223536931793180060766726354433389086595939582905638322661319928\
2902678806752087668925017116962070322210432162695486262963136144\
3814975870122034080588795445474924618569536486444924104432077134\
4947049565846788509874339442212544877066478091588460749988712400\
7652170575179788341662562494075890697040002812104276217711177780\
5315317141011704666599146697987317613560067087480710131795236894\
2752194843530567830022878569978297783478458782289110976250030269\
6156170025046433824377648610283831268330372429267526311653392473\
1671112115881863851331620384005222165791286675294654906811317159\
9343235973494985090409476213222981017261070596116456299098162905\
5520852479035240602017279974717534277759277862561943208275051312\
1815628551222480939471234145170223735805772786160086883829523045\
9264787801788992199027077690389532196819861514378031499741106926\
0886742962267575605231727775203536139362107673893764556060605921
#define Z_PI /* π */ 3.\
1415926535897932384626433832795028841971693993751058209749445923\
0781640628620899862803482534211706798214808651328230664709384460\
9550582231725359408128481117450284102701938521105559644622948954\
9303819644288109756659334461284756482337867831652712019091456485\
6692346034861045432664821339360726024914127372458700660631558817\
4881520920962829254091715364367892590360011330530548820466521384\
1469519415116094330572703657595919530921861173819326117931051185\
4807446237996274956735188575272489122793818301194912983367336244\
0656643086021394946395224737190702179860943702770539217176293176\
7523846748184676694051320005681271452635608277857713427577896091\
7363717872146844090122495343014654958537105079227968925892354201\
9956112129021960864034418159813629774771309960518707211349999998\
3729780499510597317328160963185950244594553469083026425223082533\
4468503526193118817101000313783875288658753320838142061717766914\
7303598253490428755468731159562863882353787593751957781857780532\
1712268066130019278766111959092164201989380952572010654858632788
#define Z_RHO /* ρ ~ Plastic Number */ 1.\
3247179572447460259609088544780973407344040569017333645340150503\
0282785124554759405469934798178728032991092099474220742510890263\
9045897795594314757096723471754166839038867418751736931584253549\
9082466223545337273504589879909568150627745509802486213012169894\
1575245745486250756265246103689389048399322699520749759628288685\
5690815070451369610985335257728158603344114192782827376529603299\
3584674231028483241695239006108543338218508398101808957353870473\
9313439673137676460210316527688939639353259439924831031095839537\
7519426028877409271862033892820161525553218270947061305676123988\
9204637306571962977716886308761533248001117680731166845322774315\
6628996072663835722103634707098383715980223371021309824684908631\
2969366344392445007154150429000819030670589845339053468872874066\
1957756261670617642889193912308379183117162296038861476358807306\
3150974837675824592702890131950955155601228003859576154017842151\
7618
#define Z_TAU /* τ ~ ProuhetThueMorse Constant */ 0.\
412454033640107597783361
#define Z_ZETA_3 /* ζ(3) ~ Apéry's Constant */ 1.\
2020569031595942853997381615114499907649862923404988817922715553\
4183820578631309018645587360933525814619915779526071941849199599\
8673283213776396837207900161453941782949360066719191575522242494\
2439615639096641032911590957809655146512799184051057152559880154\
3710978110203982753256678760352233698494166181105701471577863949\
9737523785277937030956025701853182790003076547107563048843320869\
7115737423807934450316076253177145354444118311781822497185263570\
9182448998796203508335756172022603393785870328131267807990054177\
3486911525370656237057440966221712902627320732361492242913040528\
5553723410330775777980642420243048828152100091460265382206962715\
5202082274335001015294801198690117625951676366998171835575234880\
7037195557423472940835952088616662025728537558130792825864872821\
7370556619689895266201877681062920081779233813587682842641243243\
1480282173674506720693507626895304345939375032966363775750624733\
2399234828831077339052768020075798435679371150509005027366047114\
0085335034364672248565315181177661810922279191022488396800266606
#define Z_APERY_CONSTANT Z_ZETA_3
/* Bernstein's Constant */
#define Z_BERNSTEIN_CONSTANT 0.\
28016949902386913303643649123067200004248213981236
/* Cahen's constant */
#define Z_CAHEN_CONSTANT 0.\
6434105462883380261822543077575647632865878602682395059870309203\
0749277646183261084844089555046343195405372900995969467846947098\
1802430097780147073963456948247668586823491596555581306050580602\
6256306777475500425607601960884398861769982603193090004364305280\
6567338111342478976190975546079525373761160043883391348037160666\
7849974184079776825402840257413825951159592097430630557408812114\
4696101394340462070490073318995421946198637524805100624978738532\
6841116944408820095760047244297718746082273520598185316636923727\
6790472958772175441607432838562778155230454121621791172401531531\
8883239557424569302059076729469550847427091071937146523382004276\
6671376387740391112213044251840172373010457848486880087124078290\
1457449877274770249676563130590862156100889975149986642474501700\
5581154212587814616117557775789114686770822872829465693504467164\
0959525956030861979618867444196869756004609746414038853402815847\
5936540509205782123128626092476347619412226683926102068711744992\
8500177376751575327731991603831036751803975694669235336301908766
/* Conway's Constant */
#define Z_CONWAY_CONSTANT 1.\
3035772690342963912570991121525518907307025046594048757548613906\
2855088785246155712681576686442522555347139304709490268396284989\
3551554347375824856691088977770216576006666613618195758149971416\
2117477679231324299325720143046277132953880169252753163112124160\
2789744556311221192891765945442844221050348398443048435036597886\
1636568696122933005217967812127420727428338418585389780462975362\
1113325713155961142841646364930650685182742924915750807604716554\
8732899031406796262775210982301850098048676804171127036928277045\
5569925410472532552960023967416151761300757699523941470920962729\
7796525283812895292399842146646970063628087185984737643242596375\
3778614871491804177943882564549629612672676317034139989238683800\
1749933916383255041973874337640464423096341637734299996402795347\
7812315036938111361969193101105512224328065334872949851635350180\
0086189800442695696203908949639604105938945262628974848057200498\
9520589408315451152746418415125180247302001937967778366214066091\
1047529322875883638588769569619942051649976764376226646605546524
/* CopelandErdős Constant */
#define Z_COPELAND_ERDOS_CONSTANT 0.\
2357111317192329313741434753596167717379838997101103107109113127\
1311371391491511571631671731791811911931971992112232272292332392\
4125125726326927127728128329330731131331733133734734935335936737\
3379383389397401409419421431433439443449457461463467479487491499\
5035095215235415475575635695715775875935996016076136176196316416\
4364765365966167367768369170170971972773373974375175776176977378\
7797809811821823827829839853857859863877881883887907911919929937\
9419479539679719779839919971009101310191021103110331039104910511\
0611063106910871091109310971103110911171123112911511153116311711\
1811187119312011213121712231229123112371249125912771279128312891\
2911297130113031307131913211327136113671373138113991409142314271\
4291433143914471451145314591471148114831487148914931499151115231\
5311543154915531559156715711579158315971601160716091613161916211\
6271637165716631667166916931697169917091721172317331741174717531\
7591777178317871789180118111823183118471861186718711873187718791\
8891901190719131931193319491951197319791987199319971999200320112
/* Dubois-Raymond Constant */
#define Z_DUBOIS_RAYMOND_CONSTANT 0.\
1945280494653251136152137302875039065901577852759236620435639112\
6128689803952888169215624253956089738687658063273943306194230184\
6390636687239196106699038887450061447803705376851195665473775341\
0432909101348239341042021104911276174378712312707073399640646659\
4403538165050966894987036499348004765165375766040941184234739651\
4956779385722841561961636382301294169998230606424642604839452569\
4123319935614068634305323678131896475911139214742172930676438469\
3349287600077498007403753598564668470942599861444131812798597054\
7933095739935752164198846632305117558156194995005256891703382249\
3319463428079109321077886242460055967658105859758658736348984146\
7259992527092431598567842973511456278699178055257489684072513882\
2403821492552091058527972095893841735642638248904856731252070117\
6210793704693341271357851963226482022753143890006555463250692416\
7265132318157078023594405882897139317429953835226355968647936199\
7993536655407480626554885296765049525164840537710545438813154286\
2425019139361380724333725282493692938578755281217194719835697214
/* FransénRobinson Constant */
#define Z_FRANSEN_ROBINSON_CONSTANT 2.\
8077702420285193652215011865577729323080859209301982912200548095\
9710088912190166551018530816819663814187416434292647678607356834\
7830897012446742487764751667549180849932709220052990094447342952\
0658351475152131155061828050485818763476748076712998234216343271\
32839553888361830581061735321115429359987705
/* Froda Constant */
#define Z_FRODA_CONSTANT 6.\
5808859910179209708515424038864864915730774383480740051215126610\
3130504039582040980102991492610759196856156668455125548138339170\
3289202458856954899842363505373271623341799384794496221955199521\
9817257192218388867595645961802004143922594049488307254920458946\
8453227772258857709537332768570509596095271117425536510662899569\
7277185088450012821602790991199992049536662057550853887690385613\
7002632531317153051100200863766096686558637839580581513980142957\
7334256389687241990566392949483335138446018013413478388302980462\
1310697071249342564168139126312706622063772884318204059466632628\
8699565585079898698033973449949718559489634828335307265242104748\
2135319342734258054306012628140042042969387544936469490135496070\
6954953488235435685881195896105422830179666394139001710669418514\
8764432569707997421913960662789237104829140068449429415344843421\
6682628035399961925125252573981078131758341309762667123525922193\
5544343127146165493705806126785444366179457823420514254471624604\
1373218142284623260713740224396531435039076042586205557463472653
/* Gauss-Kuzmin-Wirsing Constant */
#define Z_GAUSS_KUZMIN_WIRSING_CONSTANT 0.\
3036630028987326585974481219015562331108773522536578951882454814\
6722699529424691098434081193436363681109827226371061693847461485\
9745801316065265381818237879132446139896476429740950446293759490\
4870297728772511058335175922044472408659119650778105589295791867\
1475292565364259184412178423449205725529426910040657788006767324\
30364396401389692767134073782286711534915435462112848419717968
/* Glaisher-Kinkelin Constant */
#define Z_GLAISHER_KINKELIN_CONSTANT 1.\
2824271291006226368753425688697917277676889273250011920637400217\
4040630885882646112973649195820237439420646120399000748933157791\
3627752804041590725738617275221433432714343978733506791525736685\
6907876561146686449997784962754518174312394652761282138081802192\
6451685154614391990108357373070350490388812341881367497813305093\
7708336822224941158748373480643999788300701255670012869941577054\
3205392758540581731588155481762970384743250467775147374600031616\
0230466132963429915580958792933634388728870198895346072523318470\
2489001091776941712153569193674967261270398013526526688689782188\
9740172937584075016747211489528881599666874316451389030696264559\
8704695437402530996068008424474175540614901894441393861960891296\
8217352879862988434220366989900606980888785849587494085307347117\
0901326675675033105234052210541417677615630819191999718523704776\
1312315374135304725819814797451761027540834943143849652341394533\
7306583232567395495760169225642773692635882169215987077585827469\
575162841550648585890834128227556209758
/* GolombDickman Constant */
#define Z_GOLOMB_DICKMAN_CONSTANT 0.\
6243299885435508709929363831008372441796426201805292869735519024\
9563808885511325446246027619553986886914041039406274314156555911\
8325420596284465847978987572474465109280189639441135184902499148\
4947232561121165840654419399681097868927028519012517369465
/* Khinchin-Lévy Constant */
#define Z_KHINCHIN_LEVY_CONSTANT 1.\
1865691104156254528217229759472371205683565364720543359542542986\
5280963205625444330034830110848687594663926374717514798866899462\
8858792892048589683500305263953652862648543238996756950630481767\
7137897971160075137260514827163656857323386723372834729020622716\
7397717492785936707669402534024864255657756897536580928012999629\
8097683768221776246950334807687137738646291848495287534547268657\
5981454718758041876163312814165488785235808196886092272054841330\
0497613271141838825016107202035985960092613178946519602806110533\
1471179799737169111649605099218023355663781315651819442304413647\
1107321421137880088845327720664931005413077138234468810688679034\
4040265903168814806991853006483510887007401837153184162772458809\
9463237501503333492577302701015075319588656808653915811854702488\
5109994793687122151974779482404010825711270498595566342029575930\
5048539691167157693662265797795733855688822243559909166408814653\
6378563759581862456361968781886906440464238011566830343822036684\
767237417945240901293641495989710341133651272953540904463262571
/* Lehmer's Constant */
#define Z_LEHMER_CONSTANT 0.\
5926327182016361971040786049957014690842754071971610710995626081\
5824735236416000851066478429710125705118718346542386963492602972\
0676068278560798719794374872514034030005836924869155386406146603\
4856682341215484563644664283093780498006899118318496569617201211\
3759470623436986514577152028677342172295805168234444776889445080\
5416320615585123236230643791702235207816036696392763427125248854\
5674262839723419486114155544111865660734792387798043466342553169\
2753922997364863485871218333767125332765552976528666126066185788\
7136229494030890319843139079584054789895099470074892500536563296\
9001766440856359838520947830182186895213784898496770578735653738\
5497593520672298603936207528576177510978795686629351912784453933\
5684548746146679936886718357439373791659084376165704157947507762\
0030956011574042760302493993921496419367417172065429695390317552\
6951535843439567271915190168880981717597249067581873559990538542\
6905758956901623071748479727018609084969996895767596082849838196\
9270404195036511309800972643309599823665
/* Lemniscate Constant */
#define Z_LEMNISCATE_CONSTANT 2.\
6220575542921198104648395898911194136827549514316231628168217038\
0079058707041425023029553296142909344613575267178321805560895690\
1393935694701119434775235840422641497164906951936899979932146072\
3831213908102062218974296008565545397723053695497102888883255264\
8702132901209754083312856851172975222921429669243051396845645553\
9432881415381331735108409226312132476667633414509988603429421479\
2247144879639078725641895218110272525166299643333846606793336350\
9313980852623773940914262648984803480457254147704617542125634212\
9955863129980224054609012091499139897885645312480971101149665075\
0605420938417238869000402747853896254830305803039463247832195583\
2552297303719134191898359219991422953667256910686113093813498072\
5552913015093730332611087045814240765781886530766932476940761626\
7216362495494800667609613881223224769255910187057757436146489128\
7983268666203073137331356210761263637924578580178136410536130609\
3563472025022592312041202668270457723044608378953311357002940577\
442011806826257962983642671092116198595
/* Lévy's Constant */
#define Z_LEVY_CONSTANT 3.\
2758229187218111597876818824538438636084755259823741494051989241\
9072321564496035518127754047917452949269852624340163332818980851\
1503417099708230466465646703708071290224186139594237720129817924\
2510876976149300288068249261705940412908086970544412349223798884\
4270897269164098355358548048374785828762526918445007643383703876\
7418844594203517000037321222306241936013409165748043544702217325\
9938222983822632339151552857798612046849447252148722901480936120\
8904543420920995199781624005150390513815387714754291393073946178\
0455278382777274148472215134988266729112154482704520186334876500\
1974618041826296536528801168151105751350871152301630294274883364\
6260993628966063363776317216508834801936111756326698411146757164\
6737885366090624367033259688737535781426541959925075527820545637\
1594070177616321153570559233923794384292709017743923016374406041\
2678496160747830990299680560833690479092323361110349271473790052\
5389549165714734199722931676646307641198327646538816962046346297\
332994286181358520050377154266892424005731518557308952871781294
/* Magata's Constant */
#define Z_MAGATA_CONSTANT 3.\
4070691656272561422194582628271806535540344380150321161910338275\
729699387
/* Mills' Constant */
#define Z_MILLS_CONSTANT 1.\
3063778838630806904686144926026057129167845851567136443680537599\
66434
/* Alfréd Rényi's Parking Constant */
#define Z_PARKING_CONSTANT 0.\
7475979202534114351787309438301781730247862640742283766042291634\
2516788160295440431243085036931411115
/* Porter's Constant */
#define Z_PORTER_CONSTANT 1.\
4670780794339754728977984847072299534499033224148877773996858176\
1660674432904480843036932751117401521266484679045379512110834380\
0963912989965561898768045389373100175492129255790244549548891509\
825064836565770339644748288818978123102459699275573160698353198
/* Wilbraham-Gibbs Constant */
#define Z_WILBRAHAM_GIBBS_CONSTANT 1.\
8519370519824661703610533701579913633458097289811549098047837818\
7698189016634835853271033650295475770168436164800715700937245079\
9901963934227232241416503636507478802775776040700542538704594703\
7548070012549126196000327078575312602462781280151598692712625156\
6580378191706570498191117142153830172868690950027668919698378356\
4878693375929431917536185883987328136153711174160053365028598892\
8906414670095488877382247112955736673406636533206353917604135172\
0391124030289113514513183861349292577441824075264760309052792077\
8214856022187181490425447150146363584277794711774661377560583998\
0813601589774035700341407559120370214113987005974964457642432794\
5717202979146195145875005521298368008394022754407873371890776002\
3337859174819734615441535401375520206534953637077479723223530762\
7711101354680926841172462714308267187960091741576168508046447756\
2945596278463818094505702063151083460862967611583842446423313950\
2651856882443995288504068180671418260092625808323715322324469000\
4091924289785349238396416174935955727240494968269552946845809079
/* MARK: - Irrational numbers (square roots) */
#define Z_SQUARE_ROOT_2 /* Pythagoras's Constant */ 1.\
4142135623730950488016887242096980785696718753769480731766797379\
9073247846210703885038753432764157273501384623091229702492483605\
5850737212644121497099935831413222665927505592755799950501152782\
0605714701095599716059702745345968620147285174186408891986095523\
2923048430871432145083976260362799525140798968725339654633180882\
9640620615258352395054745750287759961729835575220337531857011354\
3746034084988471603868999706990048150305440277903164542478230684\
9293691862158057846311159666871301301561856898723723528850926486\
1249497715421833420428568606014682472077143585487415565706967765\
3720226485447015858801620758474922657226002085584466521458398893\
9443709265918003113882464681570826301005948587040031864803421948\
9727829064104507263688131373985525611732204024509122770022694112\
7573627280495738108967504018369868368450725799364729060762996941\
3804756548237289971803268024744206292691248590521810044598421505\
9112024944134172853147810580360337107730918286931471017111168391\
6581726889419758716582152128229518488472089694633862891562882765
#define Z_SQUARE_ROOT_3 /* Theodorus' Constant */ 1.\
7320508075688772935274463415058723669428052538103806280558069794\
5193301690880003708114618675724857567562614141540670302996994509\
4998952478811655512094373648528093231902305582067974820101084674\
9232650153123432669033228866506722546689218379712270471316603678\
6158801904998653737985938946765034750657605075661834812960610094\
7602187190325083145829523959832997789824508288714463832917347224\
1639845878553976679580638183536661108431737808943783161020883055\
2490167002352071114428869599095636579708716849807289949329648428\
3020786408603988738697537582317317831395992983007838702877053913\
3695633121037072640192491067682311992883756411414220167427521023\
7299427083105989845947598766428889779614783795839022885485290357\
6033852808064381972344661059689722872865264153822664698420021195\
4841552784411812865345070351916500166892944154808460712771439997\
6292683462957743836189511012714863874697654598245178855097537901\
3880664961911962222957110555242923723192197738262561631468842032\
8537166829386496119170497388363954959381457576718533736331259108
#define Z_SQUARE_ROOT_5 2.\
2360679774997896964091736687312762354406183596115257242708972454\
1052092563780489941441440837878227496950817615077378350425326772\
4447073863586360121533452708866778173191879165811276645322639856\
5805357613504175337850034233924140644420864325390972525926272288\
7629951740244068161177590890949849237139072972889848208864154268\
9894099131693577019748678884425089754132956183176921499977424801\
5304341150359576683325124988151781394080005624208552435422355561\
0630634282023409333198293395974635227120134174961420263590473788\
5504389687061135660045757139956595566956917564578221952500060539\
2312340050092867648755297220567662536660744858535052623306784946\
3342224231763727702663240768010444331582573350589309813622634319\
8686471946989970180818952426445962034522141192232912598196325811\
1041704958070481204034559949435068555518555725123886416550102624\
3631257102444961878942468290340447471611545572320173767659046091\
8529575603577984398054155380779064393639723028756062999482213852\
1773485924535151210463455550407072278724215347787529112121211843
#define Z_SQUARE_ROOT_6 2.\
4494897427831780981972840747058913919659474806566701284326925672\
5096037745731502653985943310464023481859460122661418912485886545\
9837757341625783951237278552828912747527676571247630105270911770\
2234813106789866908536324433525456040338088089393745855678465747\
2436130414427027021617420183830008158980783801308970072869399363\
0837158094400800443738687549164514653939145012044726448133316293\
5109447418135132854950444661717266314254976483181245040115660453\
6459009343586167931983665666266909131906535863766105258156179366\
2361791102946720883545755128835529898324100558690205006415466124\
1173533994104310579928984673395325527873604182965517183039103678\
0038362316629732330282904977391047426360070512637697546888677006\
4099295592571732846450288809151442574630260295296323707552503422\
7559915454262812980030646720799424253022878426205340679478600465\
9693997993559754061671358654653456248208256276886369280941306372\
4335088648015724846337232447379545488144384793363700919741014778\
5232875591063159846078310367009535324726423167141887586237415065
#define Z_SQUARE_ROOT_7 2.\
6457513110645905905016157536392604257102591830824501803683344592\
0106882323028362776039288647454361061506457833849746309574352988\
8627214784427390555880107722717150729728323892299689594865087260\
7009780542037238280237159411003419391160015785255963059457410351\
5239680271640737379907404158151990440347431945367139973059700505\
1399692237545616097119027378154991633288287704000657570674651963\
4977520837938181146130908764737865956243305799479812816323070548\
3650107715617946361191553454536477494820593090494849834033989002\
1047861667332795036939246225717053716492578754832290732492671346\
9802989499080377482511092278955688979198088148340908316852513353\
5829539172211770714414974576907081989444441458972284741400303502\
3532037194870738262931851936409083228059646278376102195979419708\
9096354695861341181793067816213608491016778353212556334634900218\
9814604225592950366956241869273732771502208752309966469813203212\
8189454785680209506359624466285500761905041393504474371234885223\
3277362510045059621080672334698120004300514490251206257311759115
#define Z_SQUARE_ROOT_8 2.\
8284271247461900976033774484193961571393437507538961463533594759\
8146495692421407770077506865528314547002769246182459404984967211\
1701474425288242994199871662826445331855011185511599901002305564\
1211429402191199432119405490691937240294570348372817783972191046\
5846096861742864290167952520725599050281597937450679309266361765\
9281241230516704790109491500575519923459671150440675063714022708\
7492068169976943207737999413980096300610880555806329084956461369\
8587383724316115692622319333742602603123713797447447057701852972\
2498995430843666840857137212029364944154287170974831131413935530\
7440452970894031717603241516949845314452004171168933042916797787\
8887418531836006227764929363141652602011897174080063729606843897\
9455658128209014527376262747971051223464408049018245540045388225\
5147254560991476217935008036739736736901451598729458121525993882\
7609513096474579943606536049488412585382497181043620089196843011\
8224049888268345706295621160720674215461836573862942034222336783\
3163453778839517433164304256459036976944179389267725783125765531
#define Z_SQUARE_ROOT_10 3.\
1622776601683793319988935444327185337195551393252168268575048527\
9259443863923822134424810837930029518734728415284005514854885603\
0453880014690519596700153903344921657179259940659150153474113339\
4841240853169295770904715764610443692578790620378086099418283717\
1154840632855299911859682456420332696160469131433612894979189026\
6529543612676178781350061388186278580463683134952478031143769334\
6719738195131856784032312417954022183080458728446146002535775797\
0282864402902440797789603454398916334922265261206779265167603104\
8436697793756926155720500369894909469421850007358348844643882731\
1092891090423480542356534039072740197865437259396417260013069900\
0095578446310962679069441833613018130289454170331580773162638639\
5193793704654765220632063686587197822049312426053454111609356979\
8281324522970007988835237595853285792513629646865114976752171234\
5955923803937562512536985519495532509994703884399033646616547064\
7234999796132343403021857052187836676345789510732982875157945215\
7716521396263244383990184845609357626020316768042407958946934247
#define Z_SQUARE_ROOT_11 3.\
3166247903553998491149327366706866839270885455893535970586821461\
1648464260904384670884339912829065090701255784952745659227543978\
4857547479779324933044728847302873974828655682577394444612098044\
4771931123571441329715210988326604957100372485207381068208074875\
8396589499452515931529840068271971051828955724842455676637002050\
8129842236770597842039737427437130311226448688072317190977752062\
9616099310799036448345876084690325051455517093627372268267160321\
0207901919996927385750204334035187564780307139686203097819560584\
3725362410405466369580534808247443172811968386717118059036597033\
7448997202863169540371541080201902845827165665889629545544234863\
9548140847137804628618335608388738384826935918833704592147012515\
8427710904925025882797138714982167119273365512547126431962404617\
2648548926892536495944124838553075458386858642464148905256510508\
2976405813698950347726301882000479106251003209582933018375612614\
1859454774457145379132752736187749409863990889436652633890856923\
9596152811690656996164370695457708259448190021400820246857635105
#define Z_SQUARE_ROOT_12 3.\
4641016151377545870548926830117447338856105076207612561116139589\
0386603381760007416229237351449715135125228283081340605993989018\
9997904957623311024188747297056186463804611164135949640202169349\
8465300306246865338066457733013445093378436759424540942633207357\
2317603809997307475971877893530069501315210151323669625921220189\
5204374380650166291659047919665995579649016577428927665834694448\
3279691757107953359161276367073322216863475617887566322041766110\
4980334004704142228857739198191273159417433699614579898659296856\
6041572817207977477395075164634635662791985966015677405754107826\
7391266242074145280384982135364623985767512822828440334855042047\
4598854166211979691895197532857779559229567591678045770970580715\
2067705616128763944689322119379445745730528307645329396840042390\
9683105568823625730690140703833000333785888309616921425542879995\
2585366925915487672379022025429727749395309196490357710195075802\
7761329923823924445914221110485847446384395476525123262937684065\
7074333658772992238340994776727909918762915153437067472662518217
#define Z_SQUARE_ROOT_13 3.\
6055512754639892931192212674704959462512965738452462127104530562\
2716694829301044520461908201849071767351418202406354037603067826\
4697807705163017166892709757742690564274152633233830394962346944\
7962732299962880032688564272130721127331690722052975017855588384\
4481465386892107539539248256331024468283663873252869681018926331\
3049835539921621174410861805701512768903102881214399483179868380\
9191329034353620627951223336511358206979573836238526577606890679\
2609603184500630561512640198380725552254880439995068063909609144\
6317976289163564544719685392169068915669891846759739035394769849\
9962247909644289010644441276675481640212983715961814894472819793\
8173214447846457811396497056952460736874807030279572211614048803\
2881716595571961517619126745071133538732853360545103521380556650\
2555494587073292081260347734391582994367395751429587741287176131\
4898328491367481982288670670500887357298564518320813595755837452\
8748997770498225074491739486122149917346314129778530567936583385\
9084923735540651072975297023582252157988378502698942824546906255
#define Z_SQUARE_ROOT_14 3.\
7416573867739413855837487323165493017560198077787269463037454673\
2003515630693902797680989519437957150099108872775197754550656536\
8164242592660042052551835117407401124474858631911100015230402627\
9990638550213390300377330889721284945398105001694377593170299544\
7319506049992643849467871984350198478834312631025757959589728144\
9423640188510302034929081127343124602795306338103482722099939933\
1632325073523166184196678410645529042707896011422412228117857535\
3666229821592216114192712401401062892124966991333243644395454349\
5761495087928623919979989096898963145846865535325529594557326107\
0496315592433061044542370501975004465989191778372841899586982015\
8709794801887759510441696284709199101022413286189989722195565414\
2721715251914875629353000674583453673567421640048791525684582413\
4590381859339872060995709667653664064804204506068932544077875384\
0945992448071804734066289369704503299185073788343176149673387719\
4520482494319253841618179781624882985315814656755067051262017785\
5028030354711313419236714908509541918604246710579888794708646720
#define Z_SQUARE_ROOT_15 3.\
8729833462074168851792653997823996108329217052915908265875737661\
1348309193697903351928737685867351791630220686094964701318954043\
9163649615679891746121203511068754791013493581283919531228889292\
5658464170280625091931734126598648184554646285513159402626176726\
4050864630045057781063197288093978192518830035530153001074835443\
8098719014432460775585023104811717090606284157397581582901013330\
3274447305580667026371791243800477125912479424727638166001355365\
2722953567945703078465466105357724026016703376374906204296078718\
7206146764349685215198853426648827511094432134918227578894674852\
0940721921133583223212180500077532431298433832388736330198673631\
2508581503502850494110642412413006178631087545427595823501050197\
6880877132399945421214298433563187193571267457433965110883897630\
1514122678489583087574339802329960288316221061594612915860282464\
6477150647269610878726287509531568836209909087170850054933375711\
4169765329150875277299737911463436952970866868642440087090506787\
5857643721298543747329634589332214829062724155722750086355049105
#define Z_SQUARE_ROOT_17 4.\
1231056256176605498214098559740770251471992253736204343986335730\
9495434633762159358786365081068429668454404093921414161530142084\
0415868363079548145746906977677023266436240863087790567572385708\
2255213807325630838603091427498046719135293221479787181678157964\
7590608056549697390076672138368921210670892102900552026497699722\
7788461399259924591373145657819254743622377232515783073400662476\
8914608949933141024362794433862805526374750609050808692574826754\
0375757692746463166635103309681712291987419586443197105470595848\
5725931943603620656058152613585046428067872150064104914222367522\
2434867372580470377712749985665712185704321003036026065064871546\
9069828154684645956450344184993059763950907861995904333420778303\
6732466105002383305603648597891517738125149725101393295630516977\
3961561344837040214695495172837747751283320867754324793019645038\
5894596773652195702235648129282323237309165004475570946016572174\
9143175547451122718361635317492475624065195560022755934398822460\
4515186239457694121228445234277642559126704332598083584929486998
#define Z_SQUARE_ROOT_18 4.\
2426406871192851464050661726290942357090156261308442195300392139\
7219743538632111655116260298292471820504153869273689107477450816\
7552211637932364491299807494239667997782516778267399851503458346\
1817144103286799148179108236037905860441855522559226675958286569\
8769145292614296435251928781088398575422396906176018963899542648\
8921861845775057185164237250863279885189506725661012595571034063\
1238102254965414811606999120970144450916320833709493627434692054\
7881075586474173538933479000613903904685570696171170586552779458\
3748493146265500261285705818044047416231430756462246697120903296\
1160679456341047576404862275424767971678006256753399564375196681\
8331127797754009341647394044712478903017845761120095594410265846\
9183487192313521791064394121956576835196612073527368310068082338\
2720881841487214326902512055109605105352177398094187182288990824\
1414269644711869915409804074232618878073745771565430133795264517\
7336074832402518559443431741081011323192754860794413051333505174\
9745180668259276149746456384688555465416269083901588674688648297
#define Z_SQUARE_ROOT_19 4.\
3588989435406735522369819838596156591370039252324449368903441381\
5955732820315808565615915585194452690565862129827421362958399278\
3826117012156560836417469900977752918879405890061996715663120740\
2231024023243567359810484091999315007271878765601001355045664223\
6597215798755072654740213348140339529383325316877083080148213289\
2551238612636799418213993270206440885128549665158595212562962839\
7050658074438389410005683926884800608708853847459490888521365568\
2897687595213123671741821514292631858005215674427058607461711815\
5313027391249683899068318958451783502733357016401652084179746424\
9119887199195969203059693282567695404609647987775117895043783641\
5092493623204442923896243349974708299840429604797134370576918442\
5627972643810658724900993631178508595844998222091790883188614272\
7181833978529354535768671044286487630521371921331655648231766597\
9345008389213635130240253829821964016254338391921650785627655996\
5090650060052816150475689600376677031529536405227933016338897672\
3371709651582983076636407988920374740815704060472903563584299215
#define Z_SQUARE_ROOT_20 0.4\
4721359549995793928183473374625524708812367192230514485417944908\
2104185127560979882882881675756454993901635230154756700850653544\
8894147727172720243066905417733556346383758331622553290645279713\
1610715227008350675700068467848281288841728650781945051852544577\
5259903480488136322355181781899698474278145945779696417728308537\
9788198263387154039497357768850179508265912366353842999954849603\
0608682300719153366650249976303562788160011248417104870844711122\
1261268564046818666396586791949270454240268349922840527180947577\
1008779374122271320091514279913191133913835129156443905000121078\
4624680100185735297510594441135325073321489717070105246613569892\
6684448463527455405326481536020888663165146701178619627245268639\
7372943893979940361637904852891924069044282384465825196392651622\
2083409916140962408069119898870137111037111450247772833100205248\
7262514204889923757884936580680894943223091144640347535318092183\
7059151207155968796108310761558128787279446057512125998964427704\
3546971849070302420926911100814144557448430695575058224242423686
#define Z_SQUARE_ROOT_21 4.\
5825756949558400065880471937280084889844565767679719026072421239\
0686842554777088660436155949344503267760090539758574087331189917\
0755601963573863362344755370281722824427798191940596904914344920\
0907589407063891768364965598654748231477641506627774586518102302\
3617481540081394241092573936592199391754224118467149808042185260\
7864914105576957812554767761302518635256936196112241897810062910\
4930136394500794769783448686170875778719949754100133598746930349\
7232710675634826547407841963209655321589895494373754264061908665\
0298094580890976956617810617911595220000768142485134230665143669\
5554446605650313382719148849087683899267628798139136482473790088\
8189170796483375176737417000297190682904936268171676523400834394\
2339309104876265524351270370284614919106272664101521171992383656\
8917367993395211009062164895819102794521088994407788913640625972\
4578658417328751486109851757581404328234441664632974490001787377\
2961869702397214029105976389008894920760202937832728984606379406\
5965444919348178013459962365934780900907742704128997390722047147
#define Z_SQUARE_ROOT_22 4.\
6904157598234295545656301135444662805882283534117371536057018910\
1702463275323972148211559606154313535459589666150860748165195244\
0782925621666958709181664447500641262161250754928188331862529999\
9547606735605004577761471186401246176232605036362090494527493856\
8281756795270303532693227571317120606062561691541530323494743550\
5309200200713172534601558297417528194918298027430089141037481791\
4120990984295018191164831945523178805176328354177778500806080498\
3518565354318050021673153166262609016615771045384513239925669691\
2783671255846108434988804201553172568680512142690822589008911929\
7301919366967756643487865411179999979426852739982780774547630300\
0579761472344263648399737905839299334981849660115492759940947126\
7706320024001816123943437823342252060261602573061333660063214842\
6550799462989785932504639612108923454456269629026365378382391889\
5594959128764376806042909687553399184617386068557664784079261917\
5504341699503617915696514044517092560612721096824920432766881292\
5020851744085369494907976490160054424569362473428698311315235875
#define Z_SQUARE_ROOT_23 4.\
7958315233127195415974380641626939199967070419041293464853091144\
4825723590746408249219144643691886061747456324573686513392890392\
1230265488845783794334079664727569671653494343978434561416798721\
3151199128895631880449641132459392571845949603945392600435614646\
0202152486503532934363086274731937668011877025054737708513330390\
3772090443266178015016833535830415070486401794767454104791880465\
7855465617661756852445057646538971125395858740433006194113747360\
9109976350633040762876386724156939220008934770208711136596906907\
1990861472258832971773823771307619381379694156308798460488452356\
9769990440305484325289322905572397161711567767993108038428496669\
0265902454607543365705389368190995394922917929701618373910486985\
6969068133822070893274626509746898482482517803749584860075661414\
0813637335815377083815895114543027468556805151334525399288480358\
2656451880775953716880018678299314916241332339317904053586692241\
7622541983641096572858498556893157253685192802209028187428956944\
4281562508597976297795059510410340787752350836307895023173926977
#define Z_SQUARE_ROOT_24 4.\
8989794855663561963945681494117827839318949613133402568653851345\
0192075491463005307971886620928046963718920245322837824971773091\
9675514683251567902474557105657825495055353142495260210541823540\
4469626213579733817072648867050912080676176178787491711356931494\
4872260828854054043234840367660016317961567602617940145738798726\
1674316188801600887477375098329029307878290024089452896266632587\
0218894836270265709900889323434532628509952966362490080231320907\
2918018687172335863967331332533818263813071727532210516312358732\
4723582205893441767091510257671059796648201117380410012830932248\
2347067988208621159857969346790651055747208365931034366078207356\
0076724633259464660565809954782094852720141025275395093777354012\
8198591185143465692900577618302885149260520590592647415105006845\
5119830908525625960061293441598848506045756852410681358957200931\
9387995987119508123342717309306912496416512553772738561882612744\
8670177296031449692674464894759090976288769586727401839482029557\
0465751182126319692156620734019070649452846334283775172474830130
#define Z_SQUARE_ROOT_26 5.\
0990195135927848300282241090227819895637709460995964075849708044\
2593363206222419558834885109393200836119025824103991066143177934\
1121536299802772626119936813352008233924081586515180609436925028\
7447030884686971127028666876703708002538306916010980296796499813\
3725782012085081891373043872791237919529532543918015594903365133\
4616416621229877754192034707329287784925030350480663776842369164\
2206608812846886072692694659774903784270665608067219846088576469\
8177000874159382968970286250298437303308342881274293440653810033\
7555839668996596880738823334427411886019717837418375236363862704\
9538870426232971817793074424158421655398904669052096083958472252\
7934332766274069417122115976356457683023641465745914071502665841\
3008179744209425479832568063295040590668891451247346186873076700\
8181285605275121624649596800874882281186312691873623153426977207\
0381441088553192015422188300606801606467615769284725052746178827\
1991760051314186821205851032521784571148355455157794144107701300\
0658025436220535414630301094467472349730560558777566650504471075
#define Z_SQUARE_ROOT_27 5.\
1961524227066318805823390245176171008284157614311418841674209383\
5579905072640011124343856027174572702687842424622010908990983528\
4996857436434966536283120945584279695706916746203924460303254024\
7697950459370298007099686599520167640067655139136811413949811035\
8476405714995961213957816840295104251972815226985504438881830284\
2806561570975249437488571879498993369473524866143391498752041672\
4919537635661930038741914550609983325295213426831349483062649165\
7470501007056213343286608797286909739126150549421869847988945284\
9062359225811966216092612746951953494187978949023516108631161740\
1086899363111217920577473203046935978651269234242660502282563071\
1898281249317969537842796299286669338844351387517068656455871072\
8101558424193145917033983179069168618595792461467994095260063586\
4524658353235438596035211055749500500678832464425382138314319992\
8878050388873231508568533038144591624092963794735536565292613704\
1641994885735886668871331665728771169576593214787684894406526098\
5611500488159488357511492165091864878144372730155601208993777326
#define Z_SQUARE_ROOT_28 5.\
2915026221291811810032315072785208514205183661649003607366689184\
0213764646056725552078577294908722123012915667699492619148705977\
7254429568854781111760215445434301459456647784599379189730174521\
4019561084074476560474318822006838782320031570511926118914820703\
0479360543281474759814808316303980880694863890734279946119401010\
2799384475091232194238054756309983266576575408001315141349303926\
9955041675876362292261817529475731912486611598959625632646141096\
7300215431235892722383106909072954989641186180989699668067978004\
2095723334665590073878492451434107432985157509664581464985342693\
9605978998160754965022184557911377958396176296681816633705026707\
1659078344423541428829949153814163978888882917944569482800607004\
7064074389741476525863703872818166456119292556752204391958839417\
8192709391722682363586135632427216982033556706425112669269800437\
9629208451185900733912483738547465543004417504619932939626406425\
6378909571360419012719248932571001523810082787008948742469770446\
6554725020090119242161344669396240008601028980502412514623518230
#define Z_SQUARE_ROOT_29 5.\
3851648071345040312507104915403295562951201616447888376803886700\
1664596282765869287663378167983548441870482179394576060768862140\
1981555626953216728208924528671722526185214681235990013052448016\
2903887045278269438713694073940103168871959102567772596508381141\
9495584193980826348969417532613403641636123108887427654955512364\
7940365882555182273444125300757917124198604125931023584561198054\
4795418813126253107293509901068873371670605812467416799303885413\
8123742479087954547432014922688011360464232071011737861539855585\
7102081717617603810395080111264836278444280815314492214121131843\
6341076396213737228822837938481149242915346920084913077991373969\
7089097190833461405997944064288657397292411152297722381325560371\
7907312501357326363233051587278665098784329901442053725629656985\
9172449839218439790049969327370087099206683073256802774244092317\
5715419607139287353485337048180789528095729186886136682895069025\
3666940455803261056985599438152074440985243814914009730255209859\
5681681929637748409740639130952795240525758914068872104537046989
#define Z_SQUARE_ROOT_E 1.\
64872127070012814684865078781416357165377610071014801157507
#define Z_SQUARE_ROOT_PI 1.\
7724538509055160272981674833411451827975494561223871282138077898\
5291128459103218137495065673854466541622682362428257066623615286\
5724422602525093709602787068462037698653105122849925173028950826\
2289320953792679628001746390153514797205167001901852340185854469\
7449491264031392177552590621640541933250090639840761373347747515\
3433667989789365851836408795451165161738760059067393431791332809\
8548462481849020546548521956132515616474675150427387610561079961\
2710721006037204448367236529661370809432349883166842421384570960\
9120420427785778068694766570005218305685125413396636944654181510\
7166938833219429293570622688652244205421499480499207564863988748\
3850593064021821402928581123306497894520362114907896228738940324\
5978198513134871266512506293260044656382109675026812496930595420\
4615607619522173915250702077927580990543329006622230676144696612\
4818874306997883520506146444385418530797357425717918563595974995\
9952263849242203889103966406447293972841345043002140564233433039\
26175613417633632001703765416347632066927654181283576249032690
/* MARK: - Irrational numbers (cube roots) */
#define Z_CUBE_ROOT_2 1.\
2599210498948731647672106072782283505702514647015079800819751121\
5529967651395948372939656243625509415431025603561566525939902404\
0613737228459110304269355246960642616625000977474526565480306867\
1854055186892458725167641993737096950983827831613991551293136953\
6618394746344857657030311909589598474110598116290705359081647801\
1473521325484771297880242208582053257972526662202669005665608199\
4715628176405060664826773572670419486207621442965694205079319172\
4414809204482328401274703219642820812019057141889964599983175038\
0188868959420205592202115472997384880260736369741788779215798467\
5099539630078260959624203483238660139857363433909737126527995991\
9699683779131681681544288502796515292781076797140020406056748039\
3856125171835700690798499634197629147404483454026971547622851317\
8020643878047649322579052898467085805286258130005429388560720609\
7472230406313572349364584065759169169167270601244028967000010690\
8103531385290270041508423233623988938649678219414983802707295717\
6812879001445746227147702348357151905506722084818485009287239209
#define Z_CUBE_ROOT_3 1.\
4422495703074083823216383107801095883918692534993505775464161945\
4168759682999733985475547970564525668683508085448954996642542394\
6110259714868950157185237227090332023847598445061085540027260088\
1454988727513673553524678660747156884392233189182017038998238223\
3212961663550852626734913350166545489578817585527417559336313187\
4146720060463846664756937436419755574942490682081094267123590626\
5763689646373616178216558425874823856595235871903196104071395306\
0281028535084436380351945501338091522239078498975091939480365311\
9674345706233811941118355657692483200123107015915332930042827066\
6394443820480019012241818057851180278635499201489352352796818010\
9006236835327970373724614565173415353390990467105304156937690305\
1494958995216166591166333801954227266482814311818441716553576688\
1832140589503272799127928026983572135676304667631409826930968622\
4764941404644842887133087994684187000204561876902750330462036656\
4440717909119698039747478883802670722844748159482087239611601227\
1067171066612781813201108139530097227226661910705939909901191206
/* MARK: - Irrational numbers (other roots) */
#define Z_12TH_ROOT_2 1.\
0594630943592952645618252949463417007792043174941856285592084314\
5876164606325572238376837686394556900774076432638281736624173752\
0827851039644723985114271115432990470239714933804165425687642097\
6329379895947129709947064800938991173847686705520689400326781575\
1383303231319955390959014587484595500681806521772802362810455571\
3869553201754802640057179595879584537567829830020977379250053687\
4403398881937606323435254399006328830846125529480888721482330441\
4074184893108198509249979986687035709497917584337029863023761262\
5173981919008919366931298054535197982705358773565786048226460447\
3090968624372596272293682528044863570700171131799931049836732088\
9886403556920267157664120910549625751449398108864973818515174409\
2025177988784831666892332928201939743642078982338822600070557879\
0103964696887044937701555993149379866153352257152374614051434715\
9095506342399653920121443555462612297570882130516983593531956991\
7044
/* MARK: - Integer numbers */
#define Z_CARMACK_NUMBER 0x5F3759DF
#define Z_LOMONT_NUMBER 0x5F375A86
#endif /* Z_constants_numbers_H */

29
projects/Zeta/API/Z/constants/pointer.h vendored Normal file
View File

@@ -0,0 +1,29 @@
/* Zeta API - Z/constants/pointer.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 Manuel Sainz de Baranda y Goñi.
Released under the terms of the GNU Lesser General Public License v3. */
#ifndef Z_constants_pointer_H
#define Z_constants_pointer_H
#ifdef Z_NULL
# 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
#else
# define Z_NULL ((void *)0)
#endif
#endif /* Z_constants_pointer_H */

View File

@@ -0,0 +1,59 @@
/* Zeta API - Z/formats/archive/TAR.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_archive_TAR_H
#include <Z/macros/language.h>
#include <Z/types/integral.h>
/* http://www.gnu.org/software/tar/manual/html_node/Standard.html */
#define Z_TAR_BLOCK_SIZE 512
typedef Z_PACKED_STRUCTURE_BEGIN { /* byte offset */
zuint8 name[100]; /* 0 */
zuint8 mode[8]; /* 100 */
zuint8 uid[8]; /* 108 */
zuint8 gid[8]; /* 116 */
zuint8 size[12]; /* 124 */
zuint8 mtime[12]; /* 136 */
zuint8 checksum[8]; /* 148 */
zuint8 item_type; /* 156 */
zuint8 link_name[100]; /* 157 */
zuint8 magic[6]; /* 257 */
zuint8 version[2]; /* 263 */
zuint8 uname[32]; /* 265 */
zuint8 gname[32]; /* 297 */
zuint8 device_major[8]; /* 329 */
zuint8 device_minor[8]; /* 337 */
zuint8 prefix[155]; /* 345 */
/* 500 */
} Z_PACKED_STRUCTURE_END Z_TARPOSIXHeader;
typedef Z_TARPOSIXHeader Z_TARHeader;
#define Z_TAR_ITEM_TYPE_OLD_REGULAR_FILE 0
#define Z_TAR_ITEM_TYPE_REGULAR_FILE 0x30
#define Z_TAR_ITEM_TYPE_LINK 0x31
#define Z_TAR_ITEM_TYPE_SYMBOLIC_LINK 0x32
#define Z_TAR_ITEM_TYPE_CHARACTER_DEVICE 0x33
#define Z_TAR_ITEM_TYPE_BLOCK_DEVICE 0x34
#define Z_TAR_ITEM_TYPE_DIRECTORY 0x35
#define Z_TAR_ITEM_TYPE_FIFO 0x36
#define Z_TAR_ITEM_TYPE_CONTIGUOUS_FILE 0x37
#define Z_TAR_ITEM_TYPE_GNU_DIRECTORY_DUMP 'D' /* file names from dumped directory */
#define Z_TAR_ITEM_TYPE_GNU_LONG_LINK 'K' /* long link name */
#define Z_TAR_ITEM_TYPE_GNU_LONG_NAME 'L' /* long file name */
#define Z_TAR_ITEM_TYPE_GNU_MULTIVOLUME 'M' /* continuation of file from another volume */
#define Z_TAR_ITEM_TYPE_GNU_NAMES 'N' /* file name that does not fit into main hdr */
#define Z_TAR_ITEM_TYPE_GNU_SPARSE 'S' /* sparse file */
#define Z_TAR_ITEM_TYPE_GNU_VOLUME_HEADER 'V' /* tape/volume header */
#endif /* Z_formats_archive_TAR_H */

View File

@@ -0,0 +1,141 @@
/* Zeta API - Z/formats/character_set/ASCII.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_ASCII_H
#define Z_ASCII_NULL 0x00
#define Z_ASCII_START_OF_HEADING 0x01
#define Z_ASCII_START_OF_TEXT 0x02
#define Z_ASCII_END_OF_TEXT 0x03
#define Z_ASCII_END_OF_TRANSMISSION 0x04
#define Z_ASCII_ENQUIRY 0x05
#define Z_ASCII_ACKNOWLEDGE 0x06
#define Z_ASCII_BELL 0x07
#define Z_ASCII_BACKSPACE 0x08
#define Z_ASCII_CHARACTER_TABULATION 0x09
#define Z_ASCII_LINE_FEED 0x0A
#define Z_ASCII_LINE_TABULATION 0x0B
#define Z_ASCII_FORM_FEED 0x0C
#define Z_ASCII_CARRIAGE_RETURN 0x0D
#define Z_ASCII_SHIFT_OUT 0x0E
#define Z_ASCII_SHIFT_IN 0x0F
#define Z_ASCII_DATA_LINK_ESCAPE 0x10
#define Z_ASCII_DEVICE_CONTROL_ONE 0x11
#define Z_ASCII_DEVICE_CONTROL_TWO 0x12
#define Z_ASCII_DEVICE_CONTROL_THREE 0x13
#define Z_ASCII_DEVICE_CONTROL_FOUR 0x14
#define Z_ASCII_NEGATIVE_ACKNOWLEDGE 0x15
#define Z_ASCII_SYNCHRONOUS_IDLE 0x16
#define Z_ASCII_END_OF_TRANSMISSION_BLOCK 0x17
#define Z_ASCII_CANCEL 0x18
#define Z_ASCII_END_OF_MEDIUM 0x19
#define Z_ASCII_SUBSTITUTE 0x1A
#define Z_ASCII_ESCAPE 0x1B
#define Z_ASCII_INFO_SEPARATOR_FOUR 0x1C
#define Z_ASCII_INFO_SEPARATOR_THREE 0x1D
#define Z_ASCII_INFO_SEPARATOR_TWO 0x1E
#define Z_ASCII_INFO_SEPARATOR_ONE 0x1F
#define Z_ASCII_SPACE 0x20
#define Z_ASCII_EXCLAMATION_MARK 0x21
#define Z_ASCII_QUOTATION_MARK 0x22
#define Z_ASCII_NUMBER_SIGN 0x23
#define Z_ASCII_DOLLAR_SIGN 0x24
#define Z_ASCII_PERCENT_SIGN 0x25
#define Z_ASCII_AMPERSAND 0x26
#define Z_ASCII_APOSTROPHE 0x27
#define Z_ASCII_LEFT_PARENTHESIS 0x28
#define Z_ASCII_RIGHT_PARENTHESIS 0x29
#define Z_ASCII_ASTERISK 0x2A
#define Z_ASCII_PLUS_SIGN 0x2B
#define Z_ASCII_COMMA 0x2C
#define Z_ASCII_HYPHEN_MINUS 0x2D
#define Z_ASCII_FULL_STOP 0x2E
#define Z_ASCII_SOLIDUS 0x2F
#define Z_ASCII_DIGIT_ZERO 0x30
#define Z_ASCII_DIGIT_ONE 0x31
#define Z_ASCII_DIGIT_TWO 0x32
#define Z_ASCII_DIGIT_THREE 0x33
#define Z_ASCII_DIGIT_FOUR 0x34
#define Z_ASCII_DIGIT_FIVE 0x35
#define Z_ASCII_DIGIT_SIX 0x36
#define Z_ASCII_DIGIT_SEVEN 0x37
#define Z_ASCII_DIGIT_EIGHT 0x38
#define Z_ASCII_DIGIT_NINE 0x39
#define Z_ASCII_COLON 0x3A
#define Z_ASCII_SEMICOLON 0x3B
#define Z_ASCII_LESS_THAN_SIGN 0x3C
#define Z_ASCII_EQUALS_SIGN 0x3D
#define Z_ASCII_GREATER_THAN_SIGN 0x3E
#define Z_ASCII_QUESTION_MARK 0x3F
#define Z_ASCII_COMMERCIAL_AT 0x40
#define Z_ASCII_LATIN_CAPITAL_LETTER_A 0x41
#define Z_ASCII_LATIN_CAPITAL_LETTER_B 0x42
#define Z_ASCII_LATIN_CAPITAL_LETTER_C 0x43
#define Z_ASCII_LATIN_CAPITAL_LETTER_D 0x44
#define Z_ASCII_LATIN_CAPITAL_LETTER_E 0x45
#define Z_ASCII_LATIN_CAPITAL_LETTER_F 0x46
#define Z_ASCII_LATIN_CAPITAL_LETTER_G 0x47
#define Z_ASCII_LATIN_CAPITAL_LETTER_H 0x48
#define Z_ASCII_LATIN_CAPITAL_LETTER_I 0x49
#define Z_ASCII_LATIN_CAPITAL_LETTER_J 0x4A
#define Z_ASCII_LATIN_CAPITAL_LETTER_K 0x4B
#define Z_ASCII_LATIN_CAPITAL_LETTER_L 0x4C
#define Z_ASCII_LATIN_CAPITAL_LETTER_M 0x4D
#define Z_ASCII_LATIN_CAPITAL_LETTER_N 0x4E
#define Z_ASCII_LATIN_CAPITAL_LETTER_O 0x4F
#define Z_ASCII_LATIN_CAPITAL_LETTER_P 0x50
#define Z_ASCII_LATIN_CAPITAL_LETTER_Q 0x51
#define Z_ASCII_LATIN_CAPITAL_LETTER_R 0x52
#define Z_ASCII_LATIN_CAPITAL_LETTER_S 0x53
#define Z_ASCII_LATIN_CAPITAL_LETTER_T 0x54
#define Z_ASCII_LATIN_CAPITAL_LETTER_U 0x55
#define Z_ASCII_LATIN_CAPITAL_LETTER_V 0x56
#define Z_ASCII_LATIN_CAPITAL_LETTER_W 0x57
#define Z_ASCII_LATIN_CAPITAL_LETTER_X 0x58
#define Z_ASCII_LATIN_CAPITAL_LETTER_Y 0x59
#define Z_ASCII_LATIN_CAPITAL_LETTER_Z 0x5A
#define Z_ASCII_LEFT_SQUARE_BRACKET 0x5B
#define Z_ASCII_REVERSE_SOLIDUS 0x5C
#define Z_ASCII_RIGHT_SQUARE_BRACKET 0x5D
#define Z_ASCII_CIRCUMFLEX_ACCENT 0x5E
#define Z_ASCII_LOW_LINE 0x5F
#define Z_ASCII_GRAVE_ACCENT 0x60
#define Z_ASCII_LATIN_SMALL_LETTER_A 0x61
#define Z_ASCII_LATIN_SMALL_LETTER_B 0x62
#define Z_ASCII_LATIN_SMALL_LETTER_C 0x63
#define Z_ASCII_LATIN_SMALL_LETTER_D 0x64
#define Z_ASCII_LATIN_SMALL_LETTER_E 0x65
#define Z_ASCII_LATIN_SMALL_LETTER_F 0x66
#define Z_ASCII_LATIN_SMALL_LETTER_G 0x67
#define Z_ASCII_LATIN_SMALL_LETTER_H 0x68
#define Z_ASCII_LATIN_SMALL_LETTER_I 0x69
#define Z_ASCII_LATIN_SMALL_LETTER_J 0x6A
#define Z_ASCII_LATIN_SMALL_LETTER_K 0x6B
#define Z_ASCII_LATIN_SMALL_LETTER_L 0x6C
#define Z_ASCII_LATIN_SMALL_LETTER_M 0x6D
#define Z_ASCII_LATIN_SMALL_LETTER_N 0x6E
#define Z_ASCII_LATIN_SMALL_LETTER_O 0x6F
#define Z_ASCII_LATIN_SMALL_LETTER_P 0x70
#define Z_ASCII_LATIN_SMALL_LETTER_Q 0x71
#define Z_ASCII_LATIN_SMALL_LETTER_R 0x72
#define Z_ASCII_LATIN_SMALL_LETTER_S 0x73
#define Z_ASCII_LATIN_SMALL_LETTER_T 0x74
#define Z_ASCII_LATIN_SMALL_LETTER_U 0x75
#define Z_ASCII_LATIN_SMALL_LETTER_V 0x76
#define Z_ASCII_LATIN_SMALL_LETTER_W 0x77
#define Z_ASCII_LATIN_SMALL_LETTER_X 0x78
#define Z_ASCII_LATIN_SMALL_LETTER_Y 0x79
#define Z_ASCII_LATIN_SMALL_LETTER_Z 0x7A
#define Z_ASCII_LEFT_CURLY_BRACKET 0x7B
#define Z_ASCII_VERTICAL_LINE 0x7C
#define Z_ASCII_RIGHT_CURLY_BRACKET 0x7D
#define Z_ASCII_TILDE 0x7E
#define Z_ASCII_DELETE 0x7F
#endif /* Z_formats_character_set_ASCII_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP437.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP437_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP437_LATIN_CAPITAL_LETTER_C_WITH_CEDILLA 0x80
#define Z_DOS_CP437_LATIN_SMALL_LETTER_U_WITH_DIAERESIS 0x81
#define Z_DOS_CP437_LATIN_SMALL_LETTER_E_WITH_ACUTE 0x82
#define Z_DOS_CP437_LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX 0x83
#define Z_DOS_CP437_LATIN_SMALL_LETTER_A_WITH_DIAERESIS 0x84
#define Z_DOS_CP437_LATIN_SMALL_LETTER_A_WITH_GRAVE 0x85
#define Z_DOS_CP437_LATIN_SMALL_LETTER_A_WITH_RING_ABOVE 0x86
#define Z_DOS_CP437_LATIN_SMALL_LETTER_C_WITH_CEDILLA 0x87
#define Z_DOS_CP437_LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX 0x88
#define Z_DOS_CP437_LATIN_SMALL_LETTER_E_WITH_DIAERESIS 0x89
#define Z_DOS_CP437_LATIN_SMALL_LETTER_E_WITH_GRAVE 0x8A
#define Z_DOS_CP437_LATIN_SMALL_LETTER_I_WITH_DIAERESIS 0x8B
#define Z_DOS_CP437_LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX 0x8C
#define Z_DOS_CP437_LATIN_SMALL_LETTER_I_WITH_GRAVE 0x8D
#define Z_DOS_CP437_LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS 0x8E
#define Z_DOS_CP437_LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE 0x8F
#define Z_DOS_CP437_LATIN_CAPITAL_LETTER_E_WITH_ACUTE 0x90
#define Z_DOS_CP437_LATIN_SMALL_LETTER_AE 0x91
#define Z_DOS_CP437_LATIN_CAPITAL_LETTER_AE 0x92
#define Z_DOS_CP437_LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX 0x93
#define Z_DOS_CP437_LATIN_SMALL_LETTER_O_WITH_DIAERESIS 0x94
#define Z_DOS_CP437_LATIN_SMALL_LETTER_O_WITH_GRAVE 0x95
#define Z_DOS_CP437_LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX 0x96
#define Z_DOS_CP437_LATIN_SMALL_LETTER_U_WITH_GRAVE 0x97
#define Z_DOS_CP437_LATIN_SMALL_LETTER_Y_WITH_DIAERESIS 0x98
#define Z_DOS_CP437_LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS 0x99
#define Z_DOS_CP437_LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS 0x9A
#define Z_DOS_CP437_CENT_SIGN 0x9B
#define Z_DOS_CP437_POUND_SIGN 0x9C
#define Z_DOS_CP437_YEN_SIGN 0x9D
#define Z_DOS_CP437_PESETA_SIGN 0x9E
#define Z_DOS_CP437_LATIN_SMALL_LETTER_F_WITH_HOOK 0x9F
#define Z_DOS_CP437_LATIN_SMALL_LETTER_A_WITH_ACUTE 0xA0
#define Z_DOS_CP437_LATIN_SMALL_LETTER_I_WITH_ACUTE 0xA1
#define Z_DOS_CP437_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP437_LATIN_SMALL_LETTER_U_WITH_ACUTE 0xA3
#define Z_DOS_CP437_LATIN_SMALL_LETTER_N_WITH_TILDE 0xA4
#define Z_DOS_CP437_LATIN_CAPITAL_LETTER_N_WITH_TILDE 0xA5
#define Z_DOS_CP437_FEMININE_ORDINAL_INDICATOR 0xA6
#define Z_DOS_CP437_MASCULINE_ORDINAL_INDICATOR 0xA7
#define Z_DOS_CP437_INVERTED_QUESTION_MARK 0xA8
#define Z_DOS_CP437_REVERSED_NOT_SIGN 0xA9
#define Z_DOS_CP437_NOT_SIGN 0xAA
#define Z_DOS_CP437_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP437_VULGAR_FRACTION_ONE_QUARTER 0xAC
#define Z_DOS_CP437_INVERTED_EXCLAMATION_MARK 0xAD
#define Z_DOS_CP437_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP437_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP437_LIGHT_SHADE 0xB0
#define Z_DOS_CP437_MEDIUM_SHADE 0xB1
#define Z_DOS_CP437_DARK_SHADE 0xB2
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP437_BOX_DRAWINGS_VERTICAL_SINGLE_AND_LEFT_DOUBLE 0xB5
#define Z_DOS_CP437_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_LEFT_SINGLE 0xB6
#define Z_DOS_CP437_BOX_DRAWINGS_DOWN_DOUBLE_AND_LEFT_SINGLE 0xB7
#define Z_DOS_CP437_BOX_DRAWINGS_DOWN_SINGLE_AND_LEFT_DOUBLE 0xB8
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP437_BOX_DRAWINGS_UP_DOUBLE_AND_LEFT_SINGLE 0xBD
#define Z_DOS_CP437_BOX_DRAWINGS_UP_SINGLE_AND_LEFT_DOUBLE 0xBE
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP437_BOX_DRAWINGS_VERTICAL_SINGLE_AND_RIGHT_DOUBLE 0xC6
#define Z_DOS_CP437_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_RIGHT_SINGLE 0xC7
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP437_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP437_BOX_DRAWINGS_UP_SINGLE_AND_HORIZONTAL_DOUBLE 0xCF
#define Z_DOS_CP437_BOX_DRAWINGS_UP_DOUBLE_AND_HORIZONTAL_SINGLE 0xD0
#define Z_DOS_CP437_BOX_DRAWINGS_DOWN_SINGLE_AND_HORIZONTAL_DOUBLE 0xD1
#define Z_DOS_CP437_BOX_DRAWINGS_DOWN_DOUBLE_AND_HORIZONTAL_SINGLE 0xD2
#define Z_DOS_CP437_BOX_DRAWINGS_UP_DOUBLE_AND_RIGHT_SINGLE 0xD3
#define Z_DOS_CP437_BOX_DRAWINGS_UP_SINGLE_AND_RIGHT_DOUBLE 0xD4
#define Z_DOS_CP437_BOX_DRAWINGS_DOWN_SINGLE_AND_RIGHT_DOUBLE 0xD5
#define Z_DOS_CP437_BOX_DRAWINGS_DOWN_DOUBLE_AND_RIGHT_SINGLE 0xD6
#define Z_DOS_CP437_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_HORIZONTAL_SINGLE 0xD7
#define Z_DOS_CP437_BOX_DRAWINGS_VERTICAL_SINGLE_AND_HORIZONTAL_DOUBLE 0xD8
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP437_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP437_FULL_BLOCK 0xDB
#define Z_DOS_CP437_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP437_LEFT_HALF_BLOCK 0xDD
#define Z_DOS_CP437_RIGHT_HALF_BLOCK 0xDE
#define Z_DOS_CP437_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP437_GREEK_SMALL_LETTER_ALPHA 0xE0
#define Z_DOS_CP437_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP437_GREEK_CAPITAL_LETTER_GAMMA 0xE2
#define Z_DOS_CP437_GREEK_SMALL_LETTER_PI 0xE3
#define Z_DOS_CP437_GREEK_CAPITAL_LETTER_SIGMA 0xE4
#define Z_DOS_CP437_GREEK_SMALL_LETTER_SIGMA 0xE5
#define Z_DOS_CP437_MICRO_SIGN 0xE6
#define Z_DOS_CP437_GREEK_SMALL_LETTER_TAU 0xE7
#define Z_DOS_CP437_GREEK_CAPITAL_LETTER_PHI 0xE8
#define Z_DOS_CP437_GREEK_CAPITAL_LETTER_THETA 0xE9
#define Z_DOS_CP437_GREEK_CAPITAL_LETTER_OMEGA 0xEA
#define Z_DOS_CP437_GREEK_SMALL_LETTER_DELTA 0xEB
#define Z_DOS_CP437_INFINITY 0xEC
#define Z_DOS_CP437_GREEK_SMALL_LETTER_PHI 0xED
#define Z_DOS_CP437_GREEK_SMALL_LETTER_EPSILON 0xEE
#define Z_DOS_CP437_INTERSECTION 0xEF
#define Z_DOS_CP437_IDENTICAL_TO 0xF0
#define Z_DOS_CP437_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP437_GREATER_THAN_OR_EQUAL_TO 0xF2
#define Z_DOS_CP437_LESS_THAN_OR_EQUAL_TO 0xF3
#define Z_DOS_CP437_TOP_HALF_INTEGRAL 0xF4
#define Z_DOS_CP437_BOTTOM_HALF_INTEGRAL 0xF5
#define Z_DOS_CP437_DIVISION_SIGN 0xF6
#define Z_DOS_CP437_ALMOST_EQUAL_TO 0xF7
#define Z_DOS_CP437_DEGREE_SIGN 0xF8
#define Z_DOS_CP437_BULLET_OPERATOR 0xF9
#define Z_DOS_CP437_MIDDLE_DOT 0xFA
#define Z_DOS_CP437_SQUARE_ROOT 0xFB
#define Z_DOS_CP437_SUPERSCRIPT_LATIN_SMALL_LETTER_N 0xFC
#define Z_DOS_CP437_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP437_BLACK_SQUARE 0xFE
#define Z_DOS_CP437_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP437_TO_UNICODE(_) \
_(00C7), _(00FC), _(00E9), _(00E2), _(00E4), _(00E0), _(00E5), _(00E7), \
_(00EA), _(00EB), _(00E8), _(00EF), _(00EE), _(00EC), _(00C4), _(00C5), \
_(00C9), _(00E6), _(00C6), _(00F4), _(00F6), _(00F2), _(00FB), _(00F9), \
_(00FF), _(00D6), _(00DC), _(00A2), _(00A3), _(00A5), _(20A7), _(0192), \
_(00E1), _(00ED), _(00F3), _(00FA), _(00F1), _(00D1), _(00AA), _(00BA), \
_(00BF), _(2310), _(00AC), _(00BD), _(00BC), _(00A1), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(2561), _(2562), _(2556), \
_(2555), _(2563), _(2551), _(2557), _(255D), _(255C), _(255B), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(255E), _(255F), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(2567), \
_(2568), _(2564), _(2565), _(2559), _(2558), _(2552), _(2553), _(256B), \
_(256A), _(2518), _(250C), _(2588), _(2584), _(258C), _(2590), _(2580), \
_(03B1), _(00DF), _(0393), _(03C0), _(03A3), _(03C3), _(00B5), _(03C4), \
_(03A6), _(0398), _(03A9), _(03B4), _(221E), _(03C6), _(03B5), _(2229), \
_(2261), _(00B1), _(2265), _(2264), _(2320), _(2321), _(00F7), _(2248), \
_(00B0), _(2219), _(00B7), _(221A), _(207F), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP437_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP737.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP737_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_ALPHA 0x80
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_BETA 0x81
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_GAMMA 0x82
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_DELTA 0x83
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_EPSILON 0x84
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_ZETA 0x85
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_ETA 0x86
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_THETA 0x87
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_IOTA 0x88
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_KAPPA 0x89
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_LAMDA 0x8A
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_MU 0x8B
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_NU 0x8C
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_XI 0x8D
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_OMICRON 0x8E
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_PI 0x8F
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_RHO 0x90
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_SIGMA 0x91
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_TAU 0x92
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_UPSILON 0x93
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_PHI 0x94
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_CHI 0x95
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_PSI 0x96
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_OMEGA 0x97
#define Z_DOS_CP737_GREEK_SMALL_LETTER_ALPHA 0x98
#define Z_DOS_CP737_GREEK_SMALL_LETTER_BETA 0x99
#define Z_DOS_CP737_GREEK_SMALL_LETTER_GAMMA 0x9A
#define Z_DOS_CP737_GREEK_SMALL_LETTER_DELTA 0x9B
#define Z_DOS_CP737_GREEK_SMALL_LETTER_EPSILON 0x9C
#define Z_DOS_CP737_GREEK_SMALL_LETTER_ZETA 0x9D
#define Z_DOS_CP737_GREEK_SMALL_LETTER_ETA 0x9E
#define Z_DOS_CP737_GREEK_SMALL_LETTER_THETA 0x9F
#define Z_DOS_CP737_GREEK_SMALL_LETTER_IOTA 0xA0
#define Z_DOS_CP737_GREEK_SMALL_LETTER_KAPPA 0xA1
#define Z_DOS_CP737_GREEK_SMALL_LETTER_LAMDA 0xA2
#define Z_DOS_CP737_GREEK_SMALL_LETTER_MU 0xA3
#define Z_DOS_CP737_GREEK_SMALL_LETTER_NU 0xA4
#define Z_DOS_CP737_GREEK_SMALL_LETTER_XI 0xA5
#define Z_DOS_CP737_GREEK_SMALL_LETTER_OMICRON 0xA6
#define Z_DOS_CP737_GREEK_SMALL_LETTER_PI 0xA7
#define Z_DOS_CP737_GREEK_SMALL_LETTER_RHO 0xA8
#define Z_DOS_CP737_GREEK_SMALL_LETTER_SIGMA 0xA9
#define Z_DOS_CP737_GREEK_SMALL_LETTER_FINAL_SIGMA 0xAA
#define Z_DOS_CP737_GREEK_SMALL_LETTER_TAU 0xAB
#define Z_DOS_CP737_GREEK_SMALL_LETTER_UPSILON 0xAC
#define Z_DOS_CP737_GREEK_SMALL_LETTER_PHI 0xAD
#define Z_DOS_CP737_GREEK_SMALL_LETTER_CHI 0xAE
#define Z_DOS_CP737_GREEK_SMALL_LETTER_PSI 0xAF
#define Z_DOS_CP737_LIGHT_SHADE 0xB0
#define Z_DOS_CP737_MEDIUM_SHADE 0xB1
#define Z_DOS_CP737_DARK_SHADE 0xB2
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP737_BOX_DRAWINGS_VERTICAL_SINGLE_AND_LEFT_DOUBLE 0xB5
#define Z_DOS_CP737_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_LEFT_SINGLE 0xB6
#define Z_DOS_CP737_BOX_DRAWINGS_DOWN_DOUBLE_AND_LEFT_SINGLE 0xB7
#define Z_DOS_CP737_BOX_DRAWINGS_DOWN_SINGLE_AND_LEFT_DOUBLE 0xB8
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP737_BOX_DRAWINGS_UP_DOUBLE_AND_LEFT_SINGLE 0xBD
#define Z_DOS_CP737_BOX_DRAWINGS_UP_SINGLE_AND_LEFT_DOUBLE 0xBE
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP737_BOX_DRAWINGS_VERTICAL_SINGLE_AND_RIGHT_DOUBLE 0xC6
#define Z_DOS_CP737_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_RIGHT_SINGLE 0xC7
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP737_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP737_BOX_DRAWINGS_UP_SINGLE_AND_HORIZONTAL_DOUBLE 0xCF
#define Z_DOS_CP737_BOX_DRAWINGS_UP_DOUBLE_AND_HORIZONTAL_SINGLE 0xD0
#define Z_DOS_CP737_BOX_DRAWINGS_DOWN_SINGLE_AND_HORIZONTAL_DOUBLE 0xD1
#define Z_DOS_CP737_BOX_DRAWINGS_DOWN_DOUBLE_AND_HORIZONTAL_SINGLE 0xD2
#define Z_DOS_CP737_BOX_DRAWINGS_UP_DOUBLE_AND_RIGHT_SINGLE 0xD3
#define Z_DOS_CP737_BOX_DRAWINGS_UP_SINGLE_AND_RIGHT_DOUBLE 0xD4
#define Z_DOS_CP737_BOX_DRAWINGS_DOWN_SINGLE_AND_RIGHT_DOUBLE 0xD5
#define Z_DOS_CP737_BOX_DRAWINGS_DOWN_DOUBLE_AND_RIGHT_SINGLE 0xD6
#define Z_DOS_CP737_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_HORIZONTAL_SINGLE 0xD7
#define Z_DOS_CP737_BOX_DRAWINGS_VERTICAL_SINGLE_AND_HORIZONTAL_DOUBLE 0xD8
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP737_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP737_FULL_BLOCK 0xDB
#define Z_DOS_CP737_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP737_LEFT_HALF_BLOCK 0xDD
#define Z_DOS_CP737_RIGHT_HALF_BLOCK 0xDE
#define Z_DOS_CP737_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP737_GREEK_SMALL_LETTER_OMEGA 0xE0
#define Z_DOS_CP737_GREEK_SMALL_LETTER_ALPHA_WITH_TONOS 0xE1
#define Z_DOS_CP737_GREEK_SMALL_LETTER_EPSILON_WITH_TONOS 0xE2
#define Z_DOS_CP737_GREEK_SMALL_LETTER_ETA_WITH_TONOS 0xE3
#define Z_DOS_CP737_GREEK_SMALL_LETTER_IOTA_WITH_DIALYTIKA 0xE4
#define Z_DOS_CP737_GREEK_SMALL_LETTER_IOTA_WITH_TONOS 0xE5
#define Z_DOS_CP737_GREEK_SMALL_LETTER_OMICRON_WITH_TONOS 0xE6
#define Z_DOS_CP737_GREEK_SMALL_LETTER_UPSILON_WITH_TONOS 0xE7
#define Z_DOS_CP737_GREEK_SMALL_LETTER_UPSILON_WITH_DIALYTIKA 0xE8
#define Z_DOS_CP737_GREEK_SMALL_LETTER_OMEGA_WITH_TONOS 0xE9
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_ALPHA_WITH_TONOS 0xEA
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_EPSILON_WITH_TONOS 0xEB
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_ETA_WITH_TONOS 0xEC
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_IOTA_WITH_TONOS 0xED
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_OMICRON_WITH_TONOS 0xEE
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_UPSILON_WITH_TONOS 0xEF
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_OMEGA_WITH_TONOS 0xF0
#define Z_DOS_CP737_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP737_GREATER_THAN_OR_EQUAL_TO 0xF2
#define Z_DOS_CP737_LESS_THAN_OR_EQUAL_TO 0xF3
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_IOTA_WITH_DIALYTIKA 0xF4
#define Z_DOS_CP737_GREEK_CAPITAL_LETTER_UPSILON_WITH_DIALYTIKA 0xF5
#define Z_DOS_CP737_DIVISION_SIGN 0xF6
#define Z_DOS_CP737_ALMOST_EQUAL_TO 0xF7
#define Z_DOS_CP737_DEGREE_SIGN 0xF8
#define Z_DOS_CP737_BULLET_OPERATOR 0xF9
#define Z_DOS_CP737_MIDDLE_DOT 0xFA
#define Z_DOS_CP737_SQUARE_ROOT 0xFB
#define Z_DOS_CP737_SUPERSCRIPT_LATIN_SMALL_LETTER_N 0xFC
#define Z_DOS_CP737_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP737_BLACK_SQUARE 0xFE
#define Z_DOS_CP737_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP737_TO_UNICODE(_) \
_(0391), _(0392), _(0393), _(0394), _(0395), _(0396), _(0397), _(0398), \
_(0399), _(039A), _(039B), _(039C), _(039D), _(039E), _(039F), _(03A0), \
_(03A1), _(03A3), _(03A4), _(03A5), _(03A6), _(03A7), _(03A8), _(03A9), \
_(03B1), _(03B2), _(03B3), _(03B4), _(03B5), _(03B6), _(03B7), _(03B8), \
_(03B9), _(03BA), _(03BB), _(03BC), _(03BD), _(03BE), _(03BF), _(03C0), \
_(03C1), _(03C3), _(03C2), _(03C4), _(03C5), _(03C6), _(03C7), _(03C8), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(2561), _(2562), _(2556), \
_(2555), _(2563), _(2551), _(2557), _(255D), _(255C), _(255B), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(255E), _(255F), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(2567), \
_(2568), _(2564), _(2565), _(2559), _(2558), _(2552), _(2553), _(256B), \
_(256A), _(2518), _(250C), _(2588), _(2584), _(258C), _(2590), _(2580), \
_(03C9), _(03AC), _(03AD), _(03AE), _(03CA), _(03AF), _(03CC), _(03CD), \
_(03CB), _(03CE), _(0386), _(0388), _(0389), _(038A), _(038C), _(038E), \
_(038F), _(00B1), _(2265), _(2264), _(03AA), _(03AB), _(00F7), _(2248), \
_(00B0), _(2219), _(00B7), _(221A), _(207F), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP737_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP775.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP775_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_C_WITH_ACUTE 0x80
#define Z_DOS_CP775_LATIN_SMALL_LETTER_U_WITH_DIAERESIS 0x81
#define Z_DOS_CP775_LATIN_SMALL_LETTER_E_WITH_ACUTE 0x82
#define Z_DOS_CP775_LATIN_SMALL_LETTER_A_WITH_MACRON 0x83
#define Z_DOS_CP775_LATIN_SMALL_LETTER_A_WITH_DIAERESIS 0x84
#define Z_DOS_CP775_LATIN_SMALL_LETTER_G_WITH_CEDILLA 0x85
#define Z_DOS_CP775_LATIN_SMALL_LETTER_A_WITH_RING_ABOVE 0x86
#define Z_DOS_CP775_LATIN_SMALL_LETTER_C_WITH_ACUTE 0x87
#define Z_DOS_CP775_LATIN_SMALL_LETTER_L_WITH_STROKE 0x88
#define Z_DOS_CP775_LATIN_SMALL_LETTER_E_WITH_MACRON 0x89
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_R_WITH_CEDILLA 0x8A
#define Z_DOS_CP775_LATIN_SMALL_LETTER_R_WITH_CEDILLA 0x8B
#define Z_DOS_CP775_LATIN_SMALL_LETTER_I_WITH_MACRON 0x8C
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_Z_WITH_ACUTE 0x8D
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS 0x8E
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE 0x8F
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_E_WITH_ACUTE 0x90
#define Z_DOS_CP775_LATIN_SMALL_LETTER_AE 0x91
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_AE 0x92
#define Z_DOS_CP775_LATIN_SMALL_LETTER_O_WITH_MACRON 0x93
#define Z_DOS_CP775_LATIN_SMALL_LETTER_O_WITH_DIAERESIS 0x94
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_G_WITH_CEDILLA 0x95
#define Z_DOS_CP775_CENT_SIGN 0x96
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_S_WITH_ACUTE 0x97
#define Z_DOS_CP775_LATIN_SMALL_LETTER_S_WITH_ACUTE 0x98
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS 0x99
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS 0x9A
#define Z_DOS_CP775_LATIN_SMALL_LETTER_O_WITH_STROKE 0x9B
#define Z_DOS_CP775_POUND_SIGN 0x9C
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_O_WITH_STROKE 0x9D
#define Z_DOS_CP775_MULTIPLICATION_SIGN 0x9E
#define Z_DOS_CP775_CURRENCY_SIGN 0x9F
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_A_WITH_MACRON 0xA0
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_I_WITH_MACRON 0xA1
#define Z_DOS_CP775_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_Z_WITH_DOT_ABOVE 0xA3
#define Z_DOS_CP775_LATIN_SMALL_LETTER_Z_WITH_DOT_ABOVE 0xA4
#define Z_DOS_CP775_LATIN_SMALL_LETTER_Z_WITH_ACUTE 0xA5
#define Z_DOS_CP775_RIGHT_DOUBLE_QUOTATION_MARK 0xA6
#define Z_DOS_CP775_BROKEN_BAR 0xA7
#define Z_DOS_CP775_COPYRIGHT_SIGN 0xA8
#define Z_DOS_CP775_REGISTERED_SIGN 0xA9
#define Z_DOS_CP775_NOT_SIGN 0xAA
#define Z_DOS_CP775_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP775_VULGAR_FRACTION_ONE_QUARTER 0xAC
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_L_WITH_STROKE 0xAD
#define Z_DOS_CP775_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP775_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP775_LIGHT_SHADE 0xB0
#define Z_DOS_CP775_MEDIUM_SHADE 0xB1
#define Z_DOS_CP775_DARK_SHADE 0xB2
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_A_WITH_OGONEK 0xB5
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_C_WITH_CARON 0xB6
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_E_WITH_OGONEK 0xB7
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_E_WITH_DOT_ABOVE 0xB8
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_I_WITH_OGONEK 0xBD
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_S_WITH_CARON 0xBE
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_U_WITH_OGONEK 0xC6
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_U_WITH_MACRON 0xC7
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP775_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_Z_WITH_CARON 0xCF
#define Z_DOS_CP775_LATIN_SMALL_LETTER_A_WITH_OGONEK 0xD0
#define Z_DOS_CP775_LATIN_SMALL_LETTER_C_WITH_CARON 0xD1
#define Z_DOS_CP775_LATIN_SMALL_LETTER_E_WITH_OGONEK 0xD2
#define Z_DOS_CP775_LATIN_SMALL_LETTER_E_WITH_DOT_ABOVE 0xD3
#define Z_DOS_CP775_LATIN_SMALL_LETTER_I_WITH_OGONEK 0xD4
#define Z_DOS_CP775_LATIN_SMALL_LETTER_S_WITH_CARON 0xD5
#define Z_DOS_CP775_LATIN_SMALL_LETTER_U_WITH_OGONEK 0xD6
#define Z_DOS_CP775_LATIN_SMALL_LETTER_U_WITH_MACRON 0xD7
#define Z_DOS_CP775_LATIN_SMALL_LETTER_Z_WITH_CARON 0xD8
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP775_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP775_FULL_BLOCK 0xDB
#define Z_DOS_CP775_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP775_LEFT_HALF_BLOCK 0xDD
#define Z_DOS_CP775_RIGHT_HALF_BLOCK 0xDE
#define Z_DOS_CP775_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_O_WITH_ACUTE 0xE0
#define Z_DOS_CP775_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_O_WITH_MACRON 0xE2
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_N_WITH_ACUTE 0xE3
#define Z_DOS_CP775_LATIN_SMALL_LETTER_O_WITH_TILDE 0xE4
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_O_WITH_TILDE 0xE5
#define Z_DOS_CP775_MICRO_SIGN 0xE6
#define Z_DOS_CP775_LATIN_SMALL_LETTER_N_WITH_ACUTE 0xE7
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_K_WITH_CEDILLA 0xE8
#define Z_DOS_CP775_LATIN_SMALL_LETTER_K_WITH_CEDILLA 0xE9
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_L_WITH_CEDILLA 0xEA
#define Z_DOS_CP775_LATIN_SMALL_LETTER_L_WITH_CEDILLA 0xEB
#define Z_DOS_CP775_LATIN_SMALL_LETTER_N_WITH_CEDILLA 0xEC
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_E_WITH_MACRON 0xED
#define Z_DOS_CP775_LATIN_CAPITAL_LETTER_N_WITH_CEDILLA 0xEE
#define Z_DOS_CP775_RIGHT_SINGLE_QUOTATION_MARK 0xEF
#define Z_DOS_CP775_SOFT_HYPHEN 0xF0
#define Z_DOS_CP775_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP775_LEFT_DOUBLE_QUOTATION_MARK 0xF2
#define Z_DOS_CP775_VULGAR_FRACTION_THREE_QUARTERS 0xF3
#define Z_DOS_CP775_PILCROW_SIGN 0xF4
#define Z_DOS_CP775_SECTION_SIGN 0xF5
#define Z_DOS_CP775_DIVISION_SIGN 0xF6
#define Z_DOS_CP775_DOUBLE_LOW_9_QUOTATION_MARK 0xF7
#define Z_DOS_CP775_DEGREE_SIGN 0xF8
#define Z_DOS_CP775_BULLET_OPERATOR 0xF9
#define Z_DOS_CP775_MIDDLE_DOT 0xFA
#define Z_DOS_CP775_SUPERSCRIPT_ONE 0xFB
#define Z_DOS_CP775_SUPERSCRIPT_THREE 0xFC
#define Z_DOS_CP775_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP775_BLACK_SQUARE 0xFE
#define Z_DOS_CP775_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP775_TO_UNICODE(_) \
_(0106), _(00FC), _(00E9), _(0101), _(00E4), _(0123), _(00E5), _(0107), \
_(0142), _(0113), _(0156), _(0157), _(012B), _(0179), _(00C4), _(00C5), \
_(00C9), _(00E6), _(00C6), _(014D), _(00F6), _(0122), _(00A2), _(015A), \
_(015B), _(00D6), _(00DC), _(00F8), _(00A3), _(00D8), _(00D7), _(00A4), \
_(0100), _(012A), _(00F3), _(017B), _(017C), _(017A), _(201D), _(00A6), \
_(00A9), _(00AE), _(00AC), _(00BD), _(00BC), _(0141), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(0104), _(010C), _(0118), \
_(0116), _(2563), _(2551), _(2557), _(255D), _(012E), _(0160), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(0172), _(016A), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(017D), \
_(0105), _(010D), _(0119), _(0117), _(012F), _(0161), _(0173), _(016B), \
_(017E), _(2518), _(250C), _(2588), _(2584), _(258C), _(2590), _(2580), \
_(00D3), _(00DF), _(014C), _(0143), _(00F5), _(00D5), _(00B5), _(0144), \
_(0136), _(0137), _(013B), _(013C), _(0146), _(0112), _(0145), _(2019), \
_(00AD), _(00B1), _(201C), _(00BE), _(00B6), _(00A7), _(00F7), _(201E), \
_(00B0), _(2219), _(00B7), _(00B9), _(00B3), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP775_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP850.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP850_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_C_WITH_CEDILLA 0x80
#define Z_DOS_CP850_LATIN_SMALL_LETTER_U_WITH_DIAERESIS 0x81
#define Z_DOS_CP850_LATIN_SMALL_LETTER_E_WITH_ACUTE 0x82
#define Z_DOS_CP850_LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX 0x83
#define Z_DOS_CP850_LATIN_SMALL_LETTER_A_WITH_DIAERESIS 0x84
#define Z_DOS_CP850_LATIN_SMALL_LETTER_A_WITH_GRAVE 0x85
#define Z_DOS_CP850_LATIN_SMALL_LETTER_A_WITH_RING_ABOVE 0x86
#define Z_DOS_CP850_LATIN_SMALL_LETTER_C_WITH_CEDILLA 0x87
#define Z_DOS_CP850_LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX 0x88
#define Z_DOS_CP850_LATIN_SMALL_LETTER_E_WITH_DIAERESIS 0x89
#define Z_DOS_CP850_LATIN_SMALL_LETTER_E_WITH_GRAVE 0x8A
#define Z_DOS_CP850_LATIN_SMALL_LETTER_I_WITH_DIAERESIS 0x8B
#define Z_DOS_CP850_LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX 0x8C
#define Z_DOS_CP850_LATIN_SMALL_LETTER_I_WITH_GRAVE 0x8D
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS 0x8E
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE 0x8F
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_E_WITH_ACUTE 0x90
#define Z_DOS_CP850_LATIN_SMALL_LETTER_AE 0x91
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_AE 0x92
#define Z_DOS_CP850_LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX 0x93
#define Z_DOS_CP850_LATIN_SMALL_LETTER_O_WITH_DIAERESIS 0x94
#define Z_DOS_CP850_LATIN_SMALL_LETTER_O_WITH_GRAVE 0x95
#define Z_DOS_CP850_LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX 0x96
#define Z_DOS_CP850_LATIN_SMALL_LETTER_U_WITH_GRAVE 0x97
#define Z_DOS_CP850_LATIN_SMALL_LETTER_Y_WITH_DIAERESIS 0x98
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS 0x99
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS 0x9A
#define Z_DOS_CP850_LATIN_SMALL_LETTER_O_WITH_STROKE 0x9B
#define Z_DOS_CP850_POUND_SIGN 0x9C
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_O_WITH_STROKE 0x9D
#define Z_DOS_CP850_MULTIPLICATION_SIGN 0x9E
#define Z_DOS_CP850_LATIN_SMALL_LETTER_F_WITH_HOOK 0x9F
#define Z_DOS_CP850_LATIN_SMALL_LETTER_A_WITH_ACUTE 0xA0
#define Z_DOS_CP850_LATIN_SMALL_LETTER_I_WITH_ACUTE 0xA1
#define Z_DOS_CP850_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP850_LATIN_SMALL_LETTER_U_WITH_ACUTE 0xA3
#define Z_DOS_CP850_LATIN_SMALL_LETTER_N_WITH_TILDE 0xA4
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_N_WITH_TILDE 0xA5
#define Z_DOS_CP850_FEMININE_ORDINAL_INDICATOR 0xA6
#define Z_DOS_CP850_MASCULINE_ORDINAL_INDICATOR 0xA7
#define Z_DOS_CP850_INVERTED_QUESTION_MARK 0xA8
#define Z_DOS_CP850_REGISTERED_SIGN 0xA9
#define Z_DOS_CP850_NOT_SIGN 0xAA
#define Z_DOS_CP850_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP850_VULGAR_FRACTION_ONE_QUARTER 0xAC
#define Z_DOS_CP850_INVERTED_EXCLAMATION_MARK 0xAD
#define Z_DOS_CP850_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP850_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP850_LIGHT_SHADE 0xB0
#define Z_DOS_CP850_MEDIUM_SHADE 0xB1
#define Z_DOS_CP850_DARK_SHADE 0xB2
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_A_WITH_ACUTE 0xB5
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX 0xB6
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_A_WITH_GRAVE 0xB7
#define Z_DOS_CP850_COPYRIGHT_SIGN 0xB8
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP850_CENT_SIGN 0xBD
#define Z_DOS_CP850_YEN_SIGN 0xBE
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP850_LATIN_SMALL_LETTER_A_WITH_TILDE 0xC6
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_A_WITH_TILDE 0xC7
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP850_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP850_CURRENCY_SIGN 0xCF
#define Z_DOS_CP850_LATIN_SMALL_LETTER_ETH 0xD0
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_ETH 0xD1
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX 0xD2
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS 0xD3
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_E_WITH_GRAVE 0xD4
#define Z_DOS_CP850_LATIN_SMALL_LETTER_DOTLESS_I 0xD5
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_I_WITH_ACUTE 0xD6
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX 0xD7
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS 0xD8
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP850_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP850_FULL_BLOCK 0xDB
#define Z_DOS_CP850_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP850_BROKEN_BAR 0xDD
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_I_WITH_GRAVE 0xDE
#define Z_DOS_CP850_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_O_WITH_ACUTE 0xE0
#define Z_DOS_CP850_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX 0xE2
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_O_WITH_GRAVE 0xE3
#define Z_DOS_CP850_LATIN_SMALL_LETTER_O_WITH_TILDE 0xE4
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_O_WITH_TILDE 0xE5
#define Z_DOS_CP850_MICRO_SIGN 0xE6
#define Z_DOS_CP850_LATIN_SMALL_LETTER_THORN 0xE7
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_THORN 0xE8
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_U_WITH_ACUTE 0xE9
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX 0xEA
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_U_WITH_GRAVE 0xEB
#define Z_DOS_CP850_LATIN_SMALL_LETTER_Y_WITH_ACUTE 0xEC
#define Z_DOS_CP850_LATIN_CAPITAL_LETTER_Y_WITH_ACUTE 0xED
#define Z_DOS_CP850_MACRON 0xEE
#define Z_DOS_CP850_ACUTE_ACCENT 0xEF
#define Z_DOS_CP850_SOFT_HYPHEN 0xF0
#define Z_DOS_CP850_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP850_DOUBLE_LOW_LINE 0xF2
#define Z_DOS_CP850_VULGAR_FRACTION_THREE_QUARTERS 0xF3
#define Z_DOS_CP850_PILCROW_SIGN 0xF4
#define Z_DOS_CP850_SECTION_SIGN 0xF5
#define Z_DOS_CP850_DIVISION_SIGN 0xF6
#define Z_DOS_CP850_CEDILLA 0xF7
#define Z_DOS_CP850_DEGREE_SIGN 0xF8
#define Z_DOS_CP850_DIAERESIS 0xF9
#define Z_DOS_CP850_MIDDLE_DOT 0xFA
#define Z_DOS_CP850_SUPERSCRIPT_ONE 0xFB
#define Z_DOS_CP850_SUPERSCRIPT_THREE 0xFC
#define Z_DOS_CP850_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP850_BLACK_SQUARE 0xFE
#define Z_DOS_CP850_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP850_TO_UNICODE(_) \
_(00C7), _(00FC), _(00E9), _(00E2), _(00E4), _(00E0), _(00E5), _(00E7), \
_(00EA), _(00EB), _(00E8), _(00EF), _(00EE), _(00EC), _(00C4), _(00C5), \
_(00C9), _(00E6), _(00C6), _(00F4), _(00F6), _(00F2), _(00FB), _(00F9), \
_(00FF), _(00D6), _(00DC), _(00F8), _(00A3), _(00D8), _(00D7), _(0192), \
_(00E1), _(00ED), _(00F3), _(00FA), _(00F1), _(00D1), _(00AA), _(00BA), \
_(00BF), _(00AE), _(00AC), _(00BD), _(00BC), _(00A1), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(00C1), _(00C2), _(00C0), \
_(00A9), _(2563), _(2551), _(2557), _(255D), _(00A2), _(00A5), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(00E3), _(00C3), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(00A4), \
_(00F0), _(00D0), _(00CA), _(00CB), _(00C8), _(0131), _(00CD), _(00CE), \
_(00CF), _(2518), _(250C), _(2588), _(2584), _(00A6), _(00CC), _(2580), \
_(00D3), _(00DF), _(00D4), _(00D2), _(00F5), _(00D5), _(00B5), _(00FE), \
_(00DE), _(00DA), _(00DB), _(00D9), _(00FD), _(00DD), _(00AF), _(00B4), \
_(00AD), _(00B1), _(2017), _(00BE), _(00B6), _(00A7), _(00F7), _(00B8), \
_(00B0), _(00A8), _(00B7), _(00B9), _(00B3), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP850_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP852.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP852_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_C_WITH_CEDILLA 0x80
#define Z_DOS_CP852_LATIN_SMALL_LETTER_U_WITH_DIAERESIS 0x81
#define Z_DOS_CP852_LATIN_SMALL_LETTER_E_WITH_ACUTE 0x82
#define Z_DOS_CP852_LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX 0x83
#define Z_DOS_CP852_LATIN_SMALL_LETTER_A_WITH_DIAERESIS 0x84
#define Z_DOS_CP852_LATIN_SMALL_LETTER_U_WITH_RING_ABOVE 0x85
#define Z_DOS_CP852_LATIN_SMALL_LETTER_C_WITH_ACUTE 0x86
#define Z_DOS_CP852_LATIN_SMALL_LETTER_C_WITH_CEDILLA 0x87
#define Z_DOS_CP852_LATIN_SMALL_LETTER_L_WITH_STROKE 0x88
#define Z_DOS_CP852_LATIN_SMALL_LETTER_E_WITH_DIAERESIS 0x89
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_O_WITH_DOUBLE_ACUTE 0x8A
#define Z_DOS_CP852_LATIN_SMALL_LETTER_O_WITH_DOUBLE_ACUTE 0x8B
#define Z_DOS_CP852_LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX 0x8C
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_Z_WITH_ACUTE 0x8D
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS 0x8E
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_C_WITH_ACUTE 0x8F
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_E_WITH_ACUTE 0x90
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_L_WITH_ACUTE 0x91
#define Z_DOS_CP852_LATIN_SMALL_LETTER_L_WITH_ACUTE 0x92
#define Z_DOS_CP852_LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX 0x93
#define Z_DOS_CP852_LATIN_SMALL_LETTER_O_WITH_DIAERESIS 0x94
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_L_WITH_CARON 0x95
#define Z_DOS_CP852_LATIN_SMALL_LETTER_L_WITH_CARON 0x96
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_S_WITH_ACUTE 0x97
#define Z_DOS_CP852_LATIN_SMALL_LETTER_S_WITH_ACUTE 0x98
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS 0x99
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS 0x9A
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_T_WITH_CARON 0x9B
#define Z_DOS_CP852_LATIN_SMALL_LETTER_T_WITH_CARON 0x9C
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_L_WITH_STROKE 0x9D
#define Z_DOS_CP852_MULTIPLICATION_SIGN 0x9E
#define Z_DOS_CP852_LATIN_SMALL_LETTER_C_WITH_CARON 0x9F
#define Z_DOS_CP852_LATIN_SMALL_LETTER_A_WITH_ACUTE 0xA0
#define Z_DOS_CP852_LATIN_SMALL_LETTER_I_WITH_ACUTE 0xA1
#define Z_DOS_CP852_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP852_LATIN_SMALL_LETTER_U_WITH_ACUTE 0xA3
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_A_WITH_OGONEK 0xA4
#define Z_DOS_CP852_LATIN_SMALL_LETTER_A_WITH_OGONEK 0xA5
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_Z_WITH_CARON 0xA6
#define Z_DOS_CP852_LATIN_SMALL_LETTER_Z_WITH_CARON 0xA7
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_E_WITH_OGONEK 0xA8
#define Z_DOS_CP852_LATIN_SMALL_LETTER_E_WITH_OGONEK 0xA9
#define Z_DOS_CP852_NOT_SIGN 0xAA
#define Z_DOS_CP852_LATIN_SMALL_LETTER_Z_WITH_ACUTE 0xAB
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_C_WITH_CARON 0xAC
#define Z_DOS_CP852_LATIN_SMALL_LETTER_S_WITH_CEDILLA 0xAD
#define Z_DOS_CP852_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP852_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP852_LIGHT_SHADE 0xB0
#define Z_DOS_CP852_MEDIUM_SHADE 0xB1
#define Z_DOS_CP852_DARK_SHADE 0xB2
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_A_WITH_ACUTE 0xB5
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX 0xB6
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_E_WITH_CARON 0xB7
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_S_WITH_CEDILLA 0xB8
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_Z_WITH_DOT_ABOVE 0xBD
#define Z_DOS_CP852_LATIN_SMALL_LETTER_Z_WITH_DOT_ABOVE 0xBE
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_A_WITH_BREVE 0xC6
#define Z_DOS_CP852_LATIN_SMALL_LETTER_A_WITH_BREVE 0xC7
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP852_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP852_CURRENCY_SIGN 0xCF
#define Z_DOS_CP852_LATIN_SMALL_LETTER_D_WITH_STROKE 0xD0
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_D_WITH_STROKE 0xD1
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_D_WITH_CARON 0xD2
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS 0xD3
#define Z_DOS_CP852_LATIN_SMALL_LETTER_D_WITH_CARON 0xD4
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_N_WITH_CARON 0xD5
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_I_WITH_ACUTE 0xD6
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX 0xD7
#define Z_DOS_CP852_LATIN_SMALL_LETTER_E_WITH_CARON 0xD8
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP852_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP852_FULL_BLOCK 0xDB
#define Z_DOS_CP852_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_T_WITH_CEDILLA 0xDD
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_U_WITH_RING_ABOVE 0xDE
#define Z_DOS_CP852_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_O_WITH_ACUTE 0xE0
#define Z_DOS_CP852_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX 0xE2
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_N_WITH_ACUTE 0xE3
#define Z_DOS_CP852_LATIN_SMALL_LETTER_N_WITH_ACUTE 0xE4
#define Z_DOS_CP852_LATIN_SMALL_LETTER_N_WITH_CARON 0xE5
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_S_WITH_CARON 0xE6
#define Z_DOS_CP852_LATIN_SMALL_LETTER_S_WITH_CARON 0xE7
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_R_WITH_ACUTE 0xE8
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_U_WITH_ACUTE 0xE9
#define Z_DOS_CP852_LATIN_SMALL_LETTER_R_WITH_ACUTE 0xEA
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_U_WITH_DOUBLE_ACUTE 0xEB
#define Z_DOS_CP852_LATIN_SMALL_LETTER_Y_WITH_ACUTE 0xEC
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_Y_WITH_ACUTE 0xED
#define Z_DOS_CP852_LATIN_SMALL_LETTER_T_WITH_CEDILLA 0xEE
#define Z_DOS_CP852_ACUTE_ACCENT 0xEF
#define Z_DOS_CP852_SOFT_HYPHEN 0xF0
#define Z_DOS_CP852_DOUBLE_ACUTE_ACCENT 0xF1
#define Z_DOS_CP852_OGONEK 0xF2
#define Z_DOS_CP852_CARON 0xF3
#define Z_DOS_CP852_BREVE 0xF4
#define Z_DOS_CP852_SECTION_SIGN 0xF5
#define Z_DOS_CP852_DIVISION_SIGN 0xF6
#define Z_DOS_CP852_CEDILLA 0xF7
#define Z_DOS_CP852_DEGREE_SIGN 0xF8
#define Z_DOS_CP852_DIAERESIS 0xF9
#define Z_DOS_CP852_DOT_ABOVE 0xFA
#define Z_DOS_CP852_LATIN_SMALL_LETTER_U_WITH_DOUBLE_ACUTE 0xFB
#define Z_DOS_CP852_LATIN_CAPITAL_LETTER_R_WITH_CARON 0xFC
#define Z_DOS_CP852_LATIN_SMALL_LETTER_R_WITH_CARON 0xFD
#define Z_DOS_CP852_BLACK_SQUARE 0xFE
#define Z_DOS_CP852_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP852_TO_UNICODE(_) \
_(00C7), _(00FC), _(00E9), _(00E2), _(00E4), _(016F), _(0107), _(00E7), \
_(0142), _(00EB), _(0150), _(0151), _(00EE), _(0179), _(00C4), _(0106), \
_(00C9), _(0139), _(013A), _(00F4), _(00F6), _(013D), _(013E), _(015A), \
_(015B), _(00D6), _(00DC), _(0164), _(0165), _(0141), _(00D7), _(010D), \
_(00E1), _(00ED), _(00F3), _(00FA), _(0104), _(0105), _(017D), _(017E), \
_(0118), _(0119), _(00AC), _(017A), _(010C), _(015F), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(00C1), _(00C2), _(011A), \
_(015E), _(2563), _(2551), _(2557), _(255D), _(017B), _(017C), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(0102), _(0103), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(00A4), \
_(0111), _(0110), _(010E), _(00CB), _(010F), _(0147), _(00CD), _(00CE), \
_(011B), _(2518), _(250C), _(2588), _(2584), _(0162), _(016E), _(2580), \
_(00D3), _(00DF), _(00D4), _(0143), _(0144), _(0148), _(0160), _(0161), \
_(0154), _(00DA), _(0155), _(0170), _(00FD), _(00DD), _(0163), _(00B4), \
_(00AD), _(02DD), _(02DB), _(02C7), _(02D8), _(00A7), _(00F7), _(00B8), \
_(00B0), _(00A8), _(02D9), _(0171), _(0158), _(0159), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP852_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP855.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP855_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_DJE 0x80
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_DJE 0x81
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_GJE 0x82
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_GJE 0x83
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_IO 0x84
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_IO 0x85
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_UKRAINIAN_IE 0x86
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_UKRAINIAN_IE 0x87
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_DZE 0x88
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_DZE 0x89
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_BYELORUSSIAN_UKRAINIAN_I 0x8A
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_BYELORUSSIAN_UKRAINIAN_I 0x8B
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_YI 0x8C
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_YI 0x8D
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_JE 0x8E
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_JE 0x8F
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_LJE 0x90
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_LJE 0x91
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_NJE 0x92
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_NJE 0x93
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_TSHE 0x94
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_TSHE 0x95
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_KJE 0x96
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_KJE 0x97
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_SHORT_U 0x98
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_SHORT_U 0x99
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_DZHE 0x9A
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_DZHE 0x9B
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_YU 0x9C
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_YU 0x9D
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_HARD_SIGN 0x9E
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_HARD_SIGN 0x9F
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_A 0xA0
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_A 0xA1
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_BE 0xA2
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_BE 0xA3
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_TSE 0xA4
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_TSE 0xA5
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_DE 0xA6
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_DE 0xA7
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_IE 0xA8
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_IE 0xA9
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_EF 0xAA
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_EF 0xAB
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_GHE 0xAC
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_GHE 0xAD
#define Z_DOS_CP855_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP855_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP855_LIGHT_SHADE 0xB0
#define Z_DOS_CP855_MEDIUM_SHADE 0xB1
#define Z_DOS_CP855_DARK_SHADE 0xB2
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_HA 0xB5
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_HA 0xB6
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_I 0xB7
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_I 0xB8
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_SHORT_I 0xBD
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_SHORT_I 0xBE
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_KA 0xC6
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_KA 0xC7
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP855_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP855_CURRENCY_SIGN 0xCF
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_EL 0xD0
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_EL 0xD1
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_EM 0xD2
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_EM 0xD3
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_EN 0xD4
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_EN 0xD5
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_O 0xD6
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_O 0xD7
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_PE 0xD8
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP855_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP855_FULL_BLOCK 0xDB
#define Z_DOS_CP855_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_PE 0xDD
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_YA 0xDE
#define Z_DOS_CP855_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_YA 0xE0
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_ER 0xE1
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_ER 0xE2
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_ES 0xE3
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_ES 0xE4
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_TE 0xE5
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_TE 0xE6
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_U 0xE7
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_U 0xE8
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_ZHE 0xE9
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_ZHE 0xEA
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_VE 0xEB
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_VE 0xEC
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_SOFT_SIGN 0xED
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_SOFT_SIGN 0xEE
#define Z_DOS_CP855_NUMERO_SIGN 0xEF
#define Z_DOS_CP855_SOFT_HYPHEN 0xF0
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_YERU 0xF1
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_YERU 0xF2
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_ZE 0xF3
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_ZE 0xF4
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_SHA 0xF5
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_SHA 0xF6
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_E 0xF7
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_E 0xF8
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_SHCHA 0xF9
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_SHCHA 0xFA
#define Z_DOS_CP855_CYRILLIC_SMALL_LETTER_CHE 0xFB
#define Z_DOS_CP855_CYRILLIC_CAPITAL_LETTER_CHE 0xFC
#define Z_DOS_CP855_SECTION_SIGN 0xFD
#define Z_DOS_CP855_BLACK_SQUARE 0xFE
#define Z_DOS_CP855_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP855_TO_UNICODE(_) \
_(0452), _(0402), _(0453), _(0403), _(0451), _(0401), _(0454), _(0404), \
_(0455), _(0405), _(0456), _(0406), _(0457), _(0407), _(0458), _(0408), \
_(0459), _(0409), _(045A), _(040A), _(045B), _(040B), _(045C), _(040C), \
_(045E), _(040E), _(045F), _(040F), _(044E), _(042E), _(044A), _(042A), \
_(0430), _(0410), _(0431), _(0411), _(0446), _(0426), _(0434), _(0414), \
_(0435), _(0415), _(0444), _(0424), _(0433), _(0413), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(0445), _(0425), _(0438), \
_(0418), _(2563), _(2551), _(2557), _(255D), _(0439), _(0419), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(043A), _(041A), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(00A4), \
_(043B), _(041B), _(043C), _(041C), _(043D), _(041D), _(043E), _(041E), \
_(043F), _(2518), _(250C), _(2588), _(2584), _(041F), _(044F), _(2580), \
_(042F), _(0440), _(0420), _(0441), _(0421), _(0442), _(0422), _(0443), \
_(0423), _(0436), _(0416), _(0432), _(0412), _(044C), _(042C), _(2116), \
_(00AD), _(044B), _(042B), _(0437), _(0417), _(0448), _(0428), _(044D), \
_(042D), _(0449), _(0429), _(0447), _(0427), _(00A7), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP855_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP857.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP857_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_C_WITH_CEDILLA 0x80
#define Z_DOS_CP857_LATIN_SMALL_LETTER_U_WITH_DIAERESIS 0x81
#define Z_DOS_CP857_LATIN_SMALL_LETTER_E_WITH_ACUTE 0x82
#define Z_DOS_CP857_LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX 0x83
#define Z_DOS_CP857_LATIN_SMALL_LETTER_A_WITH_DIAERESIS 0x84
#define Z_DOS_CP857_LATIN_SMALL_LETTER_A_WITH_GRAVE 0x85
#define Z_DOS_CP857_LATIN_SMALL_LETTER_A_WITH_RING_ABOVE 0x86
#define Z_DOS_CP857_LATIN_SMALL_LETTER_C_WITH_CEDILLA 0x87
#define Z_DOS_CP857_LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX 0x88
#define Z_DOS_CP857_LATIN_SMALL_LETTER_E_WITH_DIAERESIS 0x89
#define Z_DOS_CP857_LATIN_SMALL_LETTER_E_WITH_GRAVE 0x8A
#define Z_DOS_CP857_LATIN_SMALL_LETTER_I_WITH_DIAERESIS 0x8B
#define Z_DOS_CP857_LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX 0x8C
#define Z_DOS_CP857_LATIN_SMALL_LETTER_DOTLESS_I 0x8D
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS 0x8E
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE 0x8F
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_E_WITH_ACUTE 0x90
#define Z_DOS_CP857_LATIN_SMALL_LETTER_AE 0x91
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_AE 0x92
#define Z_DOS_CP857_LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX 0x93
#define Z_DOS_CP857_LATIN_SMALL_LETTER_O_WITH_DIAERESIS 0x94
#define Z_DOS_CP857_LATIN_SMALL_LETTER_O_WITH_GRAVE 0x95
#define Z_DOS_CP857_LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX 0x96
#define Z_DOS_CP857_LATIN_SMALL_LETTER_U_WITH_GRAVE 0x97
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE 0x98
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS 0x99
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS 0x9A
#define Z_DOS_CP857_LATIN_SMALL_LETTER_O_WITH_STROKE 0x9B
#define Z_DOS_CP857_POUND_SIGN 0x9C
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_O_WITH_STROKE 0x9D
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_S_WITH_CEDILLA 0x9E
#define Z_DOS_CP857_LATIN_SMALL_LETTER_S_WITH_CEDILLA 0x9F
#define Z_DOS_CP857_LATIN_SMALL_LETTER_A_WITH_ACUTE 0xA0
#define Z_DOS_CP857_LATIN_SMALL_LETTER_I_WITH_ACUTE 0xA1
#define Z_DOS_CP857_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP857_LATIN_SMALL_LETTER_U_WITH_ACUTE 0xA3
#define Z_DOS_CP857_LATIN_SMALL_LETTER_N_WITH_TILDE 0xA4
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_N_WITH_TILDE 0xA5
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_G_WITH_BREVE 0xA6
#define Z_DOS_CP857_LATIN_SMALL_LETTER_G_WITH_BREVE 0xA7
#define Z_DOS_CP857_INVERTED_QUESTION_MARK 0xA8
#define Z_DOS_CP857_REGISTERED_SIGN 0xA9
#define Z_DOS_CP857_NOT_SIGN 0xAA
#define Z_DOS_CP857_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP857_VULGAR_FRACTION_ONE_QUARTER 0xAC
#define Z_DOS_CP857_INVERTED_EXCLAMATION_MARK 0xAD
#define Z_DOS_CP857_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP857_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP857_LIGHT_SHADE 0xB0
#define Z_DOS_CP857_MEDIUM_SHADE 0xB1
#define Z_DOS_CP857_DARK_SHADE 0xB2
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_A_WITH_ACUTE 0xB5
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX 0xB6
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_A_WITH_GRAVE 0xB7
#define Z_DOS_CP857_COPYRIGHT_SIGN 0xB8
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP857_CENT_SIGN 0xBD
#define Z_DOS_CP857_YEN_SIGN 0xBE
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP857_LATIN_SMALL_LETTER_A_WITH_TILDE 0xC6
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_A_WITH_TILDE 0xC7
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP857_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP857_CURRENCY_SIGN 0xCF
#define Z_DOS_CP857_MASCULINE_ORDINAL_INDICATOR 0xD0
#define Z_DOS_CP857_FEMININE_ORDINAL_INDICATOR 0xD1
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX 0xD2
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS 0xD3
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_E_WITH_GRAVE 0xD4
/* D5h undefined */
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_I_WITH_ACUTE 0xD6
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX 0xD7
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS 0xD8
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP857_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP857_FULL_BLOCK 0xDB
#define Z_DOS_CP857_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP857_BROKEN_BAR 0xDD
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_I_WITH_GRAVE 0xDE
#define Z_DOS_CP857_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_O_WITH_ACUTE 0xE0
#define Z_DOS_CP857_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX 0xE2
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_O_WITH_GRAVE 0xE3
#define Z_DOS_CP857_LATIN_SMALL_LETTER_O_WITH_TILDE 0xE4
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_O_WITH_TILDE 0xE5
#define Z_DOS_CP857_MICRO_SIGN 0xE6
/* E7h undefined */
#define Z_DOS_CP857_MULTIPLICATION_SIGN 0xE8
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_U_WITH_ACUTE 0xE9
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX 0xEA
#define Z_DOS_CP857_LATIN_CAPITAL_LETTER_U_WITH_GRAVE 0xEB
#define Z_DOS_CP857_LATIN_SMALL_LETTER_I_WITH_GRAVE 0xEC
#define Z_DOS_CP857_LATIN_SMALL_LETTER_Y_WITH_DIAERESIS 0xED
#define Z_DOS_CP857_MACRON 0xEE
#define Z_DOS_CP857_ACUTE_ACCENT 0xEF
#define Z_DOS_CP857_SOFT_HYPHEN 0xF0
#define Z_DOS_CP857_PLUS_MINUS_SIGN 0xF1
/* F2h undefined */
#define Z_DOS_CP857_VULGAR_FRACTION_THREE_QUARTERS 0xF3
#define Z_DOS_CP857_PILCROW_SIGN 0xF4
#define Z_DOS_CP857_SECTION_SIGN 0xF5
#define Z_DOS_CP857_DIVISION_SIGN 0xF6
#define Z_DOS_CP857_CEDILLA 0xF7
#define Z_DOS_CP857_DEGREE_SIGN 0xF8
#define Z_DOS_CP857_DIAERESIS 0xF9
#define Z_DOS_CP857_MIDDLE_DOT 0xFA
#define Z_DOS_CP857_SUPERSCRIPT_ONE 0xFB
#define Z_DOS_CP857_SUPERSCRIPT_THREE 0xFC
#define Z_DOS_CP857_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP857_BLACK_SQUARE 0xFE
#define Z_DOS_CP857_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP857_TO_UNICODE(_, undefined) \
_(00C7), _(00FC), _(00E9), _(00E2), _(00E4), _(00E0), _(00E5), _(00E7), \
_(00EA), _(00EB), _(00E8), _(00EF), _(00EE), _(0131), _(00C4), _(00C5), \
_(00C9), _(00E6), _(00C6), _(00F4), _(00F6), _(00F2), _(00FB), _(00F9), \
_(0130), _(00D6), _(00DC), _(00F8), _(00A3), _(00D8), _(015E), _(015F), \
_(00E1), _(00ED), _(00F3), _(00FA), _(00F1), _(00D1), _(011E), _(011F), \
_(00BF), _(00AE), _(00AC), _(00BD), _(00BC), _(00A1), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(00C1), _(00C2), _(00C0), \
_(00A9), _(2563), _(2551), _(2557), _(255D), _(00A2), _(00A5), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(00E3), _(00C3), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(00A4), \
_(00BA), _(00AA), _(00CA), _(00CB), _(00C8), undefined, _(00CD), _(00CE), \
_(00CF), _(2518), _(250C), _(2588), _(2584), _(00A6), _(00CC), _(2580), \
_(00D3), _(00DF), _(00D4), _(00D2), _(00F5), _(00D5), _(00B5), undefined, \
_(00D7), _(00DA), _(00DB), _(00D9), _(00EC), _(00FF), _(00AF), _(00B4), \
_(00AD), _(00B1), undefined, _(00BE), _(00B6), _(00A7), _(00F7), _(00B8), \
_(00B0), _(00A8), _(00B7), _(00B9), _(00B3), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP857_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP858.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP858_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_C_WITH_CEDILLA 0x80
#define Z_DOS_CP858_LATIN_SMALL_LETTER_U_WITH_DIAERESIS 0x81
#define Z_DOS_CP858_LATIN_SMALL_LETTER_E_WITH_ACUTE 0x82
#define Z_DOS_CP858_LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX 0x83
#define Z_DOS_CP858_LATIN_SMALL_LETTER_A_WITH_DIAERESIS 0x84
#define Z_DOS_CP858_LATIN_SMALL_LETTER_A_WITH_GRAVE 0x85
#define Z_DOS_CP858_LATIN_SMALL_LETTER_A_WITH_RING_ABOVE 0x86
#define Z_DOS_CP858_LATIN_SMALL_LETTER_C_WITH_CEDILLA 0x87
#define Z_DOS_CP858_LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX 0x88
#define Z_DOS_CP858_LATIN_SMALL_LETTER_E_WITH_DIAERESIS 0x89
#define Z_DOS_CP858_LATIN_SMALL_LETTER_E_WITH_GRAVE 0x8A
#define Z_DOS_CP858_LATIN_SMALL_LETTER_I_WITH_DIAERESIS 0x8B
#define Z_DOS_CP858_LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX 0x8C
#define Z_DOS_CP858_LATIN_SMALL_LETTER_I_WITH_GRAVE 0x8D
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS 0x8E
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE 0x8F
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_E_WITH_ACUTE 0x90
#define Z_DOS_CP858_LATIN_SMALL_LETTER_AE 0x91
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_AE 0x92
#define Z_DOS_CP858_LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX 0x93
#define Z_DOS_CP858_LATIN_SMALL_LETTER_O_WITH_DIAERESIS 0x94
#define Z_DOS_CP858_LATIN_SMALL_LETTER_O_WITH_GRAVE 0x95
#define Z_DOS_CP858_LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX 0x96
#define Z_DOS_CP858_LATIN_SMALL_LETTER_U_WITH_GRAVE 0x97
#define Z_DOS_CP858_LATIN_SMALL_LETTER_Y_WITH_DIAERESIS 0x98
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS 0x99
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS 0x9A
#define Z_DOS_CP858_LATIN_SMALL_LETTER_O_WITH_STROKE 0x9B
#define Z_DOS_CP858_POUND_SIGN 0x9C
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_O_WITH_STROKE 0x9D
#define Z_DOS_CP858_MULTIPLICATION_SIGN 0x9E
#define Z_DOS_CP858_LATIN_SMALL_LETTER_F_WITH_HOOK 0x9F
#define Z_DOS_CP858_LATIN_SMALL_LETTER_A_WITH_ACUTE 0xA0
#define Z_DOS_CP858_LATIN_SMALL_LETTER_I_WITH_ACUTE 0xA1
#define Z_DOS_CP858_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP858_LATIN_SMALL_LETTER_U_WITH_ACUTE 0xA3
#define Z_DOS_CP858_LATIN_SMALL_LETTER_N_WITH_TILDE 0xA4
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_N_WITH_TILDE 0xA5
#define Z_DOS_CP858_FEMININE_ORDINAL_INDICATOR 0xA6
#define Z_DOS_CP858_MASCULINE_ORDINAL_INDICATOR 0xA7
#define Z_DOS_CP858_INVERTED_QUESTION_MARK 0xA8
#define Z_DOS_CP858_REGISTERED_SIGN 0xA9
#define Z_DOS_CP858_NOT_SIGN 0xAA
#define Z_DOS_CP858_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP858_VULGAR_FRACTION_ONE_QUARTER 0xAC
#define Z_DOS_CP858_INVERTED_EXCLAMATION_MARK 0xAD
#define Z_DOS_CP858_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP858_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP858_LIGHT_SHADE 0xB0
#define Z_DOS_CP858_MEDIUM_SHADE 0xB1
#define Z_DOS_CP858_DARK_SHADE 0xB2
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_A_WITH_ACUTE 0xB5
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX 0xB6
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_A_WITH_GRAVE 0xB7
#define Z_DOS_CP858_COPYRIGHT_SIGN 0xB8
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP858_CENT_SIGN 0xBD
#define Z_DOS_CP858_YEN_SIGN 0xBE
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP858_LATIN_SMALL_LETTER_A_WITH_TILDE 0xC6
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_A_WITH_TILDE 0xC7
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP858_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP858_CURRENCY_SIGN 0xCF
#define Z_DOS_CP858_LATIN_SMALL_LETTER_ETH 0xD0
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_ETH 0xD1
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX 0xD2
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS 0xD3
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_E_WITH_GRAVE 0xD4
#define Z_DOS_CP858_EURO_SIGN 0xD5
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_I_WITH_ACUTE 0xD6
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX 0xD7
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS 0xD8
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP858_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP858_FULL_BLOCK 0xDB
#define Z_DOS_CP858_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP858_BROKEN_BAR 0xDD
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_I_WITH_GRAVE 0xDE
#define Z_DOS_CP858_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_O_WITH_ACUTE 0xE0
#define Z_DOS_CP858_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX 0xE2
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_O_WITH_GRAVE 0xE3
#define Z_DOS_CP858_LATIN_SMALL_LETTER_O_WITH_TILDE 0xE4
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_O_WITH_TILDE 0xE5
#define Z_DOS_CP858_MICRO_SIGN 0xE6
#define Z_DOS_CP858_LATIN_SMALL_LETTER_THORN 0xE7
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_THORN 0xE8
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_U_WITH_ACUTE 0xE9
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX 0xEA
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_U_WITH_GRAVE 0xEB
#define Z_DOS_CP858_LATIN_SMALL_LETTER_Y_WITH_ACUTE 0xEC
#define Z_DOS_CP858_LATIN_CAPITAL_LETTER_Y_WITH_ACUTE 0xED
#define Z_DOS_CP858_MACRON 0xEE
#define Z_DOS_CP858_ACUTE_ACCENT 0xEF
#define Z_DOS_CP858_SOFT_HYPHEN 0xF0
#define Z_DOS_CP858_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP858_DOUBLE_LOW_LINE 0xF2
#define Z_DOS_CP858_VULGAR_FRACTION_THREE_QUARTERS 0xF3
#define Z_DOS_CP858_PILCROW_SIGN 0xF4
#define Z_DOS_CP858_SECTION_SIGN 0xF5
#define Z_DOS_CP858_DIVISION_SIGN 0xF6
#define Z_DOS_CP858_CEDILLA 0xF7
#define Z_DOS_CP858_DEGREE_SIGN 0xF8
#define Z_DOS_CP858_DIAERESIS 0xF9
#define Z_DOS_CP858_MIDDLE_DOT 0xFA
#define Z_DOS_CP858_SUPERSCRIPT_ONE 0xFB
#define Z_DOS_CP858_SUPERSCRIPT_THREE 0xFC
#define Z_DOS_CP858_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP858_BLACK_SQUARE 0xFE
#define Z_DOS_CP858_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP858_TO_UNICODE(_) \
_(00C7), _(00FC), _(00E9), _(00E2), _(00E4), _(00E0), _(00E5), _(00E7), \
_(00EA), _(00EB), _(00E8), _(00EF), _(00EE), _(00EC), _(00C4), _(00C5), \
_(00C9), _(00E6), _(00C6), _(00F4), _(00F6), _(00F2), _(00FB), _(00F9), \
_(00FF), _(00D6), _(00DC), _(00F8), _(00A3), _(00D8), _(00D7), _(0192), \
_(00E1), _(00ED), _(00F3), _(00FA), _(00F1), _(00D1), _(00AA), _(00BA), \
_(00BF), _(00AE), _(00AC), _(00BD), _(00BC), _(00A1), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(00C1), _(00C2), _(00C0), \
_(00A9), _(2563), _(2551), _(2557), _(255D), _(00A2), _(00A5), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(00E3), _(00C3), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(00A4), \
_(00F0), _(00D0), _(00CA), _(00CB), _(00C8), _(20AC), _(00CD), _(00CE), \
_(00CF), _(2518), _(250C), _(2588), _(2584), _(00A6), _(00CC), _(2580), \
_(00D3), _(00DF), _(00D4), _(00D2), _(00F5), _(00D5), _(00B5), _(00FE), \
_(00DE), _(00DA), _(00DB), _(00D9), _(00FD), _(00DD), _(00AF), _(00B4), \
_(00AD), _(00B1), _(2017), _(00BE), _(00B6), _(00A7), _(00F7), _(00B8), \
_(00B0), _(00A8), _(00B7), _(00B9), _(00B3), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP858_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP860.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP860_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_C_WITH_CEDILLA 0x80
#define Z_DOS_CP860_LATIN_SMALL_LETTER_U_WITH_DIAERESIS 0x81
#define Z_DOS_CP860_LATIN_SMALL_LETTER_E_WITH_ACUTE 0x82
#define Z_DOS_CP860_LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX 0x83
#define Z_DOS_CP860_LATIN_SMALL_LETTER_A_WITH_TILDE 0x84
#define Z_DOS_CP860_LATIN_SMALL_LETTER_A_WITH_GRAVE 0x85
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_A_WITH_ACUTE 0x86
#define Z_DOS_CP860_LATIN_SMALL_LETTER_C_WITH_CEDILLA 0x87
#define Z_DOS_CP860_LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX 0x88
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX 0x89
#define Z_DOS_CP860_LATIN_SMALL_LETTER_E_WITH_GRAVE 0x8A
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_I_WITH_ACUTE 0x8B
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX 0x8C
#define Z_DOS_CP860_LATIN_SMALL_LETTER_I_WITH_GRAVE 0x8D
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_A_WITH_TILDE 0x8E
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX 0x8F
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_E_WITH_ACUTE 0x90
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_A_WITH_GRAVE 0x91
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_E_WITH_GRAVE 0x92
#define Z_DOS_CP860_LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX 0x93
#define Z_DOS_CP860_LATIN_SMALL_LETTER_O_WITH_TILDE 0x94
#define Z_DOS_CP860_LATIN_SMALL_LETTER_O_WITH_GRAVE 0x95
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_U_WITH_ACUTE 0x96
#define Z_DOS_CP860_LATIN_SMALL_LETTER_U_WITH_GRAVE 0x97
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_I_WITH_GRAVE 0x98
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_O_WITH_TILDE 0x99
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS 0x9A
#define Z_DOS_CP860_CENT_SIGN 0x9B
#define Z_DOS_CP860_POUND_SIGN 0x9C
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_U_WITH_GRAVE 0x9D
#define Z_DOS_CP860_PESETA_SIGN 0x9E
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_O_WITH_ACUTE 0x9F
#define Z_DOS_CP860_LATIN_SMALL_LETTER_A_WITH_ACUTE 0xA0
#define Z_DOS_CP860_LATIN_SMALL_LETTER_I_WITH_ACUTE 0xA1
#define Z_DOS_CP860_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP860_LATIN_SMALL_LETTER_U_WITH_ACUTE 0xA3
#define Z_DOS_CP860_LATIN_SMALL_LETTER_N_WITH_TILDE 0xA4
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_N_WITH_TILDE 0xA5
#define Z_DOS_CP860_FEMININE_ORDINAL_INDICATOR 0xA6
#define Z_DOS_CP860_MASCULINE_ORDINAL_INDICATOR 0xA7
#define Z_DOS_CP860_INVERTED_QUESTION_MARK 0xA8
#define Z_DOS_CP860_LATIN_CAPITAL_LETTER_O_WITH_GRAVE 0xA9
#define Z_DOS_CP860_NOT_SIGN 0xAA
#define Z_DOS_CP860_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP860_VULGAR_FRACTION_ONE_QUARTER 0xAC
#define Z_DOS_CP860_INVERTED_EXCLAMATION_MARK 0xAD
#define Z_DOS_CP860_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP860_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP860_LIGHT_SHADE 0xB0
#define Z_DOS_CP860_MEDIUM_SHADE 0xB1
#define Z_DOS_CP860_DARK_SHADE 0xB2
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP860_BOX_DRAWINGS_VERTICAL_SINGLE_AND_LEFT_DOUBLE 0xB5
#define Z_DOS_CP860_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_LEFT_SINGLE 0xB6
#define Z_DOS_CP860_BOX_DRAWINGS_DOWN_DOUBLE_AND_LEFT_SINGLE 0xB7
#define Z_DOS_CP860_BOX_DRAWINGS_DOWN_SINGLE_AND_LEFT_DOUBLE 0xB8
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP860_BOX_DRAWINGS_UP_DOUBLE_AND_LEFT_SINGLE 0xBD
#define Z_DOS_CP860_BOX_DRAWINGS_UP_SINGLE_AND_LEFT_DOUBLE 0xBE
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP860_BOX_DRAWINGS_VERTICAL_SINGLE_AND_RIGHT_DOUBLE 0xC6
#define Z_DOS_CP860_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_RIGHT_SINGLE 0xC7
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP860_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP860_BOX_DRAWINGS_UP_SINGLE_AND_HORIZONTAL_DOUBLE 0xCF
#define Z_DOS_CP860_BOX_DRAWINGS_UP_DOUBLE_AND_HORIZONTAL_SINGLE 0xD0
#define Z_DOS_CP860_BOX_DRAWINGS_DOWN_SINGLE_AND_HORIZONTAL_DOUBLE 0xD1
#define Z_DOS_CP860_BOX_DRAWINGS_DOWN_DOUBLE_AND_HORIZONTAL_SINGLE 0xD2
#define Z_DOS_CP860_BOX_DRAWINGS_UP_DOUBLE_AND_RIGHT_SINGLE 0xD3
#define Z_DOS_CP860_BOX_DRAWINGS_UP_SINGLE_AND_RIGHT_DOUBLE 0xD4
#define Z_DOS_CP860_BOX_DRAWINGS_DOWN_SINGLE_AND_RIGHT_DOUBLE 0xD5
#define Z_DOS_CP860_BOX_DRAWINGS_DOWN_DOUBLE_AND_RIGHT_SINGLE 0xD6
#define Z_DOS_CP860_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_HORIZONTAL_SINGLE 0xD7
#define Z_DOS_CP860_BOX_DRAWINGS_VERTICAL_SINGLE_AND_HORIZONTAL_DOUBLE 0xD8
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP860_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP860_FULL_BLOCK 0xDB
#define Z_DOS_CP860_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP860_LEFT_HALF_BLOCK 0xDD
#define Z_DOS_CP860_RIGHT_HALF_BLOCK 0xDE
#define Z_DOS_CP860_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP860_GREEK_SMALL_LETTER_ALPHA 0xE0
#define Z_DOS_CP860_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP860_GREEK_CAPITAL_LETTER_GAMMA 0xE2
#define Z_DOS_CP860_GREEK_SMALL_LETTER_PI 0xE3
#define Z_DOS_CP860_GREEK_CAPITAL_LETTER_SIGMA 0xE4
#define Z_DOS_CP860_GREEK_SMALL_LETTER_SIGMA 0xE5
#define Z_DOS_CP860_MICRO_SIGN 0xE6
#define Z_DOS_CP860_GREEK_SMALL_LETTER_TAU 0xE7
#define Z_DOS_CP860_GREEK_CAPITAL_LETTER_PHI 0xE8
#define Z_DOS_CP860_GREEK_CAPITAL_LETTER_THETA 0xE9
#define Z_DOS_CP860_GREEK_CAPITAL_LETTER_OMEGA 0xEA
#define Z_DOS_CP860_GREEK_SMALL_LETTER_DELTA 0xEB
#define Z_DOS_CP860_INFINITY 0xEC
#define Z_DOS_CP860_GREEK_SMALL_LETTER_PHI 0xED
#define Z_DOS_CP860_GREEK_SMALL_LETTER_EPSILON 0xEE
#define Z_DOS_CP860_INTERSECTION 0xEF
#define Z_DOS_CP860_IDENTICAL_TO 0xF0
#define Z_DOS_CP860_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP860_GREATER_THAN_OR_EQUAL_TO 0xF2
#define Z_DOS_CP860_LESS_THAN_OR_EQUAL_TO 0xF3
#define Z_DOS_CP860_TOP_HALF_INTEGRAL 0xF4
#define Z_DOS_CP860_BOTTOM_HALF_INTEGRAL 0xF5
#define Z_DOS_CP860_DIVISION_SIGN 0xF6
#define Z_DOS_CP860_ALMOST_EQUAL_TO 0xF7
#define Z_DOS_CP860_DEGREE_SIGN 0xF8
#define Z_DOS_CP860_BULLET_OPERATOR 0xF9
#define Z_DOS_CP860_MIDDLE_DOT 0xFA
#define Z_DOS_CP860_SQUARE_ROOT 0xFB
#define Z_DOS_CP860_SUPERSCRIPT_LATIN_SMALL_LETTER_N 0xFC
#define Z_DOS_CP860_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP860_BLACK_SQUARE 0xFE
#define Z_DOS_CP860_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP860_TO_UNICODE(_) \
_(00C7), _(00FC), _(00E9), _(00E2), _(00E3), _(00E0), _(00C1), _(00E7), \
_(00EA), _(00CA), _(00E8), _(00CD), _(00D4), _(00EC), _(00C3), _(00C2), \
_(00C9), _(00C0), _(00C8), _(00F4), _(00F5), _(00F2), _(00DA), _(00F9), \
_(00CC), _(00D5), _(00DC), _(00A2), _(00A3), _(00D9), _(20A7), _(00D3), \
_(00E1), _(00ED), _(00F3), _(00FA), _(00F1), _(00D1), _(00AA), _(00BA), \
_(00BF), _(00D2), _(00AC), _(00BD), _(00BC), _(00A1), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(2561), _(2562), _(2556), \
_(2555), _(2563), _(2551), _(2557), _(255D), _(255C), _(255B), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(255E), _(255F), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(2567), \
_(2568), _(2564), _(2565), _(2559), _(2558), _(2552), _(2553), _(256B), \
_(256A), _(2518), _(250C), _(2588), _(2584), _(258C), _(2590), _(2580), \
_(03B1), _(00DF), _(0393), _(03C0), _(03A3), _(03C3), _(00B5), _(03C4), \
_(03A6), _(0398), _(03A9), _(03B4), _(221E), _(03C6), _(03B5), _(2229), \
_(2261), _(00B1), _(2265), _(2264), _(2320), _(2321), _(00F7), _(2248), \
_(00B0), _(2219), _(00B7), _(221A), _(207F), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP860_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP861.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP861_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_C_WITH_CEDILLA 0x80
#define Z_DOS_CP861_LATIN_SMALL_LETTER_U_WITH_DIAERESIS 0x81
#define Z_DOS_CP861_LATIN_SMALL_LETTER_E_WITH_ACUTE 0x82
#define Z_DOS_CP861_LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX 0x83
#define Z_DOS_CP861_LATIN_SMALL_LETTER_A_WITH_DIAERESIS 0x84
#define Z_DOS_CP861_LATIN_SMALL_LETTER_A_WITH_GRAVE 0x85
#define Z_DOS_CP861_LATIN_SMALL_LETTER_A_WITH_RING_ABOVE 0x86
#define Z_DOS_CP861_LATIN_SMALL_LETTER_C_WITH_CEDILLA 0x87
#define Z_DOS_CP861_LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX 0x88
#define Z_DOS_CP861_LATIN_SMALL_LETTER_E_WITH_DIAERESIS 0x89
#define Z_DOS_CP861_LATIN_SMALL_LETTER_E_WITH_GRAVE 0x8A
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_ETH 0x8B
#define Z_DOS_CP861_LATIN_SMALL_LETTER_ETH 0x8C
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_THORN 0x8D
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS 0x8E
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE 0x8F
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_E_WITH_ACUTE 0x90
#define Z_DOS_CP861_LATIN_SMALL_LETTER_AE 0x91
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_AE 0x92
#define Z_DOS_CP861_LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX 0x93
#define Z_DOS_CP861_LATIN_SMALL_LETTER_O_WITH_DIAERESIS 0x94
#define Z_DOS_CP861_LATIN_SMALL_LETTER_THORN 0x95
#define Z_DOS_CP861_LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX 0x96
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_Y_WITH_ACUTE 0x97
#define Z_DOS_CP861_LATIN_SMALL_LETTER_Y_WITH_ACUTE 0x98
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS 0x99
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS 0x9A
#define Z_DOS_CP861_LATIN_SMALL_LETTER_O_WITH_STROKE 0x9B
#define Z_DOS_CP861_POUND_SIGN 0x9C
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_O_WITH_STROKE 0x9D
#define Z_DOS_CP861_PESETA_SIGN 0x9E
#define Z_DOS_CP861_LATIN_SMALL_LETTER_F_WITH_HOOK 0x9F
#define Z_DOS_CP861_LATIN_SMALL_LETTER_A_WITH_ACUTE 0xA0
#define Z_DOS_CP861_LATIN_SMALL_LETTER_I_WITH_ACUTE 0xA1
#define Z_DOS_CP861_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP861_LATIN_SMALL_LETTER_U_WITH_ACUTE 0xA3
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_A_WITH_ACUTE 0xA4
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_I_WITH_ACUTE 0xA5
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_O_WITH_ACUTE 0xA6
#define Z_DOS_CP861_LATIN_CAPITAL_LETTER_U_WITH_ACUTE 0xA7
#define Z_DOS_CP861_INVERTED_QUESTION_MARK 0xA8
#define Z_DOS_CP861_REVERSED_NOT_SIGN 0xA9
#define Z_DOS_CP861_NOT_SIGN 0xAA
#define Z_DOS_CP861_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP861_VULGAR_FRACTION_ONE_QUARTER 0xAC
#define Z_DOS_CP861_INVERTED_EXCLAMATION_MARK 0xAD
#define Z_DOS_CP861_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP861_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP861_LIGHT_SHADE 0xB0
#define Z_DOS_CP861_MEDIUM_SHADE 0xB1
#define Z_DOS_CP861_DARK_SHADE 0xB2
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP861_BOX_DRAWINGS_VERTICAL_SINGLE_AND_LEFT_DOUBLE 0xB5
#define Z_DOS_CP861_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_LEFT_SINGLE 0xB6
#define Z_DOS_CP861_BOX_DRAWINGS_DOWN_DOUBLE_AND_LEFT_SINGLE 0xB7
#define Z_DOS_CP861_BOX_DRAWINGS_DOWN_SINGLE_AND_LEFT_DOUBLE 0xB8
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP861_BOX_DRAWINGS_UP_DOUBLE_AND_LEFT_SINGLE 0xBD
#define Z_DOS_CP861_BOX_DRAWINGS_UP_SINGLE_AND_LEFT_DOUBLE 0xBE
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP861_BOX_DRAWINGS_VERTICAL_SINGLE_AND_RIGHT_DOUBLE 0xC6
#define Z_DOS_CP861_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_RIGHT_SINGLE 0xC7
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP861_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP861_BOX_DRAWINGS_UP_SINGLE_AND_HORIZONTAL_DOUBLE 0xCF
#define Z_DOS_CP861_BOX_DRAWINGS_UP_DOUBLE_AND_HORIZONTAL_SINGLE 0xD0
#define Z_DOS_CP861_BOX_DRAWINGS_DOWN_SINGLE_AND_HORIZONTAL_DOUBLE 0xD1
#define Z_DOS_CP861_BOX_DRAWINGS_DOWN_DOUBLE_AND_HORIZONTAL_SINGLE 0xD2
#define Z_DOS_CP861_BOX_DRAWINGS_UP_DOUBLE_AND_RIGHT_SINGLE 0xD3
#define Z_DOS_CP861_BOX_DRAWINGS_UP_SINGLE_AND_RIGHT_DOUBLE 0xD4
#define Z_DOS_CP861_BOX_DRAWINGS_DOWN_SINGLE_AND_RIGHT_DOUBLE 0xD5
#define Z_DOS_CP861_BOX_DRAWINGS_DOWN_DOUBLE_AND_RIGHT_SINGLE 0xD6
#define Z_DOS_CP861_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_HORIZONTAL_SINGLE 0xD7
#define Z_DOS_CP861_BOX_DRAWINGS_VERTICAL_SINGLE_AND_HORIZONTAL_DOUBLE 0xD8
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP861_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP861_FULL_BLOCK 0xDB
#define Z_DOS_CP861_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP861_LEFT_HALF_BLOCK 0xDD
#define Z_DOS_CP861_RIGHT_HALF_BLOCK 0xDE
#define Z_DOS_CP861_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP861_GREEK_SMALL_LETTER_ALPHA 0xE0
#define Z_DOS_CP861_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP861_GREEK_CAPITAL_LETTER_GAMMA 0xE2
#define Z_DOS_CP861_GREEK_SMALL_LETTER_PI 0xE3
#define Z_DOS_CP861_GREEK_CAPITAL_LETTER_SIGMA 0xE4
#define Z_DOS_CP861_GREEK_SMALL_LETTER_SIGMA 0xE5
#define Z_DOS_CP861_MICRO_SIGN 0xE6
#define Z_DOS_CP861_GREEK_SMALL_LETTER_TAU 0xE7
#define Z_DOS_CP861_GREEK_CAPITAL_LETTER_PHI 0xE8
#define Z_DOS_CP861_GREEK_CAPITAL_LETTER_THETA 0xE9
#define Z_DOS_CP861_GREEK_CAPITAL_LETTER_OMEGA 0xEA
#define Z_DOS_CP861_GREEK_SMALL_LETTER_DELTA 0xEB
#define Z_DOS_CP861_INFINITY 0xEC
#define Z_DOS_CP861_GREEK_SMALL_LETTER_PHI 0xED
#define Z_DOS_CP861_GREEK_SMALL_LETTER_EPSILON 0xEE
#define Z_DOS_CP861_INTERSECTION 0xEF
#define Z_DOS_CP861_IDENTICAL_TO 0xF0
#define Z_DOS_CP861_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP861_GREATER_THAN_OR_EQUAL_TO 0xF2
#define Z_DOS_CP861_LESS_THAN_OR_EQUAL_TO 0xF3
#define Z_DOS_CP861_TOP_HALF_INTEGRAL 0xF4
#define Z_DOS_CP861_BOTTOM_HALF_INTEGRAL 0xF5
#define Z_DOS_CP861_DIVISION_SIGN 0xF6
#define Z_DOS_CP861_ALMOST_EQUAL_TO 0xF7
#define Z_DOS_CP861_DEGREE_SIGN 0xF8
#define Z_DOS_CP861_BULLET_OPERATOR 0xF9
#define Z_DOS_CP861_MIDDLE_DOT 0xFA
#define Z_DOS_CP861_SQUARE_ROOT 0xFB
#define Z_DOS_CP861_SUPERSCRIPT_LATIN_SMALL_LETTER_N 0xFC
#define Z_DOS_CP861_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP861_BLACK_SQUARE 0xFE
#define Z_DOS_CP861_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP861_TO_UNICODE(_) \
_(00C7), _(00FC), _(00E9), _(00E2), _(00E4), _(00E0), _(00E5), _(00E7), \
_(00EA), _(00EB), _(00E8), _(00D0), _(00F0), _(00DE), _(00C4), _(00C5), \
_(00C9), _(00E6), _(00C6), _(00F4), _(00F6), _(00FE), _(00FB), _(00DD), \
_(00FD), _(00D6), _(00DC), _(00F8), _(00A3), _(00D8), _(20A7), _(0192), \
_(00E1), _(00ED), _(00F3), _(00FA), _(00C1), _(00CD), _(00D3), _(00DA), \
_(00BF), _(2310), _(00AC), _(00BD), _(00BC), _(00A1), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(2561), _(2562), _(2556), \
_(2555), _(2563), _(2551), _(2557), _(255D), _(255C), _(255B), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(255E), _(255F), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(2567), \
_(2568), _(2564), _(2565), _(2559), _(2558), _(2552), _(2553), _(256B), \
_(256A), _(2518), _(250C), _(2588), _(2584), _(258C), _(2590), _(2580), \
_(03B1), _(00DF), _(0393), _(03C0), _(03A3), _(03C3), _(00B5), _(03C4), \
_(03A6), _(0398), _(03A9), _(03B4), _(221E), _(03C6), _(03B5), _(2229), \
_(2261), _(00B1), _(2265), _(2264), _(2320), _(2321), _(00F7), _(2248), \
_(00B0), _(2219), _(00B7), _(221A), _(207F), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP861_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP862.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP862_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP862_HEBREW_LETTER_ALEF 0x80
#define Z_DOS_CP862_HEBREW_LETTER_BET 0x81
#define Z_DOS_CP862_HEBREW_LETTER_GIMEL 0x82
#define Z_DOS_CP862_HEBREW_LETTER_DALET 0x83
#define Z_DOS_CP862_HEBREW_LETTER_HE 0x84
#define Z_DOS_CP862_HEBREW_LETTER_VAV 0x85
#define Z_DOS_CP862_HEBREW_LETTER_ZAYIN 0x86
#define Z_DOS_CP862_HEBREW_LETTER_HET 0x87
#define Z_DOS_CP862_HEBREW_LETTER_TET 0x88
#define Z_DOS_CP862_HEBREW_LETTER_YOD 0x89
#define Z_DOS_CP862_HEBREW_LETTER_FINAL_KAF 0x8A
#define Z_DOS_CP862_HEBREW_LETTER_KAF 0x8B
#define Z_DOS_CP862_HEBREW_LETTER_LAMED 0x8C
#define Z_DOS_CP862_HEBREW_LETTER_FINAL_MEM 0x8D
#define Z_DOS_CP862_HEBREW_LETTER_MEM 0x8E
#define Z_DOS_CP862_HEBREW_LETTER_FINAL_NUN 0x8F
#define Z_DOS_CP862_HEBREW_LETTER_NUN 0x90
#define Z_DOS_CP862_HEBREW_LETTER_SAMEKH 0x91
#define Z_DOS_CP862_HEBREW_LETTER_AYIN 0x92
#define Z_DOS_CP862_HEBREW_LETTER_FINAL_PE 0x93
#define Z_DOS_CP862_HEBREW_LETTER_PE 0x94
#define Z_DOS_CP862_HEBREW_LETTER_FINAL_TSADI 0x95
#define Z_DOS_CP862_HEBREW_LETTER_TSADI 0x96
#define Z_DOS_CP862_HEBREW_LETTER_QOF 0x97
#define Z_DOS_CP862_HEBREW_LETTER_RESH 0x98
#define Z_DOS_CP862_HEBREW_LETTER_SHIN 0x99
#define Z_DOS_CP862_HEBREW_LETTER_TAV 0x9A
#define Z_DOS_CP862_CENT_SIGN 0x9B
#define Z_DOS_CP862_POUND_SIGN 0x9C
#define Z_DOS_CP862_YEN_SIGN 0x9D
#define Z_DOS_CP862_PESETA_SIGN 0x9E
#define Z_DOS_CP862_LATIN_SMALL_LETTER_F_WITH_HOOK 0x9F
#define Z_DOS_CP862_LATIN_SMALL_LETTER_A_WITH_ACUTE 0xA0
#define Z_DOS_CP862_LATIN_SMALL_LETTER_I_WITH_ACUTE 0xA1
#define Z_DOS_CP862_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP862_LATIN_SMALL_LETTER_U_WITH_ACUTE 0xA3
#define Z_DOS_CP862_LATIN_SMALL_LETTER_N_WITH_TILDE 0xA4
#define Z_DOS_CP862_LATIN_CAPITAL_LETTER_N_WITH_TILDE 0xA5
#define Z_DOS_CP862_FEMININE_ORDINAL_INDICATOR 0xA6
#define Z_DOS_CP862_MASCULINE_ORDINAL_INDICATOR 0xA7
#define Z_DOS_CP862_INVERTED_QUESTION_MARK 0xA8
#define Z_DOS_CP862_REVERSED_NOT_SIGN 0xA9
#define Z_DOS_CP862_NOT_SIGN 0xAA
#define Z_DOS_CP862_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP862_VULGAR_FRACTION_ONE_QUARTER 0xAC
#define Z_DOS_CP862_INVERTED_EXCLAMATION_MARK 0xAD
#define Z_DOS_CP862_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP862_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP862_LIGHT_SHADE 0xB0
#define Z_DOS_CP862_MEDIUM_SHADE 0xB1
#define Z_DOS_CP862_DARK_SHADE 0xB2
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP862_BOX_DRAWINGS_VERTICAL_SINGLE_AND_LEFT_DOUBLE 0xB5
#define Z_DOS_CP862_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_LEFT_SINGLE 0xB6
#define Z_DOS_CP862_BOX_DRAWINGS_DOWN_DOUBLE_AND_LEFT_SINGLE 0xB7
#define Z_DOS_CP862_BOX_DRAWINGS_DOWN_SINGLE_AND_LEFT_DOUBLE 0xB8
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP862_BOX_DRAWINGS_UP_DOUBLE_AND_LEFT_SINGLE 0xBD
#define Z_DOS_CP862_BOX_DRAWINGS_UP_SINGLE_AND_LEFT_DOUBLE 0xBE
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP862_BOX_DRAWINGS_VERTICAL_SINGLE_AND_RIGHT_DOUBLE 0xC6
#define Z_DOS_CP862_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_RIGHT_SINGLE 0xC7
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP862_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP862_BOX_DRAWINGS_UP_SINGLE_AND_HORIZONTAL_DOUBLE 0xCF
#define Z_DOS_CP862_BOX_DRAWINGS_UP_DOUBLE_AND_HORIZONTAL_SINGLE 0xD0
#define Z_DOS_CP862_BOX_DRAWINGS_DOWN_SINGLE_AND_HORIZONTAL_DOUBLE 0xD1
#define Z_DOS_CP862_BOX_DRAWINGS_DOWN_DOUBLE_AND_HORIZONTAL_SINGLE 0xD2
#define Z_DOS_CP862_BOX_DRAWINGS_UP_DOUBLE_AND_RIGHT_SINGLE 0xD3
#define Z_DOS_CP862_BOX_DRAWINGS_UP_SINGLE_AND_RIGHT_DOUBLE 0xD4
#define Z_DOS_CP862_BOX_DRAWINGS_DOWN_SINGLE_AND_RIGHT_DOUBLE 0xD5
#define Z_DOS_CP862_BOX_DRAWINGS_DOWN_DOUBLE_AND_RIGHT_SINGLE 0xD6
#define Z_DOS_CP862_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_HORIZONTAL_SINGLE 0xD7
#define Z_DOS_CP862_BOX_DRAWINGS_VERTICAL_SINGLE_AND_HORIZONTAL_DOUBLE 0xD8
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP862_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP862_FULL_BLOCK 0xDB
#define Z_DOS_CP862_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP862_LEFT_HALF_BLOCK 0xDD
#define Z_DOS_CP862_RIGHT_HALF_BLOCK 0xDE
#define Z_DOS_CP862_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP862_GREEK_SMALL_LETTER_ALPHA 0xE0
#define Z_DOS_CP862_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP862_GREEK_CAPITAL_LETTER_GAMMA 0xE2
#define Z_DOS_CP862_GREEK_SMALL_LETTER_PI 0xE3
#define Z_DOS_CP862_GREEK_CAPITAL_LETTER_SIGMA 0xE4
#define Z_DOS_CP862_GREEK_SMALL_LETTER_SIGMA 0xE5
#define Z_DOS_CP862_MICRO_SIGN 0xE6
#define Z_DOS_CP862_GREEK_SMALL_LETTER_TAU 0xE7
#define Z_DOS_CP862_GREEK_CAPITAL_LETTER_PHI 0xE8
#define Z_DOS_CP862_GREEK_CAPITAL_LETTER_THETA 0xE9
#define Z_DOS_CP862_GREEK_CAPITAL_LETTER_OMEGA 0xEA
#define Z_DOS_CP862_GREEK_SMALL_LETTER_DELTA 0xEB
#define Z_DOS_CP862_INFINITY 0xEC
#define Z_DOS_CP862_GREEK_SMALL_LETTER_PHI 0xED
#define Z_DOS_CP862_GREEK_SMALL_LETTER_EPSILON 0xEE
#define Z_DOS_CP862_INTERSECTION 0xEF
#define Z_DOS_CP862_IDENTICAL_TO 0xF0
#define Z_DOS_CP862_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP862_GREATER_THAN_OR_EQUAL_TO 0xF2
#define Z_DOS_CP862_LESS_THAN_OR_EQUAL_TO 0xF3
#define Z_DOS_CP862_TOP_HALF_INTEGRAL 0xF4
#define Z_DOS_CP862_BOTTOM_HALF_INTEGRAL 0xF5
#define Z_DOS_CP862_DIVISION_SIGN 0xF6
#define Z_DOS_CP862_ALMOST_EQUAL_TO 0xF7
#define Z_DOS_CP862_DEGREE_SIGN 0xF8
#define Z_DOS_CP862_BULLET_OPERATOR 0xF9
#define Z_DOS_CP862_MIDDLE_DOT 0xFA
#define Z_DOS_CP862_SQUARE_ROOT 0xFB
#define Z_DOS_CP862_SUPERSCRIPT_LATIN_SMALL_LETTER_N 0xFC
#define Z_DOS_CP862_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP862_BLACK_SQUARE 0xFE
#define Z_DOS_CP862_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP862_TO_UNICODE(_) \
_(05D0), _(05D1), _(05D2), _(05D3), _(05D4), _(05D5), _(05D6), _(05D7), \
_(05D8), _(05D9), _(05DA), _(05DB), _(05DC), _(05DD), _(05DE), _(05DF), \
_(05E0), _(05E1), _(05E2), _(05E3), _(05E4), _(05E5), _(05E6), _(05E7), \
_(05E8), _(05E9), _(05EA), _(00A2), _(00A3), _(00A5), _(20A7), _(0192), \
_(00E1), _(00ED), _(00F3), _(00FA), _(00F1), _(00D1), _(00AA), _(00BA), \
_(00BF), _(2310), _(00AC), _(00BD), _(00BC), _(00A1), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(2561), _(2562), _(2556), \
_(2555), _(2563), _(2551), _(2557), _(255D), _(255C), _(255B), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(255E), _(255F), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(2567), \
_(2568), _(2564), _(2565), _(2559), _(2558), _(2552), _(2553), _(256B), \
_(256A), _(2518), _(250C), _(2588), _(2584), _(258C), _(2590), _(2580), \
_(03B1), _(00DF), _(0393), _(03C0), _(03A3), _(03C3), _(00B5), _(03C4), \
_(03A6), _(0398), _(03A9), _(03B4), _(221E), _(03C6), _(03B5), _(2229), \
_(2261), _(00B1), _(2265), _(2264), _(2320), _(2321), _(00F7), _(2248), \
_(00B0), _(2219), _(00B7), _(221A), _(207F), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP862_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP863.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP863_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_C_WITH_CEDILLA 0x80
#define Z_DOS_CP863_LATIN_SMALL_LETTER_U_WITH_DIAERESIS 0x81
#define Z_DOS_CP863_LATIN_SMALL_LETTER_E_WITH_ACUTE 0x82
#define Z_DOS_CP863_LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX 0x83
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX 0x84
#define Z_DOS_CP863_LATIN_SMALL_LETTER_A_WITH_GRAVE 0x85
#define Z_DOS_CP863_PILCROW_SIGN 0x86
#define Z_DOS_CP863_LATIN_SMALL_LETTER_C_WITH_CEDILLA 0x87
#define Z_DOS_CP863_LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX 0x88
#define Z_DOS_CP863_LATIN_SMALL_LETTER_E_WITH_DIAERESIS 0x89
#define Z_DOS_CP863_LATIN_SMALL_LETTER_E_WITH_GRAVE 0x8A
#define Z_DOS_CP863_LATIN_SMALL_LETTER_I_WITH_DIAERESIS 0x8B
#define Z_DOS_CP863_LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX 0x8C
#define Z_DOS_CP863_DOUBLE_LOW_LINE 0x8D
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_A_WITH_GRAVE 0x8E
#define Z_DOS_CP863_SECTION_SIGN 0x8F
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_E_WITH_ACUTE 0x90
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_E_WITH_GRAVE 0x91
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX 0x92
#define Z_DOS_CP863_LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX 0x93
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS 0x94
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS 0x95
#define Z_DOS_CP863_LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX 0x96
#define Z_DOS_CP863_LATIN_SMALL_LETTER_U_WITH_GRAVE 0x97
#define Z_DOS_CP863_CURRENCY_SIGN 0x98
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX 0x99
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS 0x9A
#define Z_DOS_CP863_CENT_SIGN 0x9B
#define Z_DOS_CP863_POUND_SIGN 0x9C
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_U_WITH_GRAVE 0x9D
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX 0x9E
#define Z_DOS_CP863_LATIN_SMALL_LETTER_F_WITH_HOOK 0x9F
#define Z_DOS_CP863_BROKEN_BAR 0xA0
#define Z_DOS_CP863_ACUTE_ACCENT 0xA1
#define Z_DOS_CP863_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP863_LATIN_SMALL_LETTER_U_WITH_ACUTE 0xA3
#define Z_DOS_CP863_DIAERESIS 0xA4
#define Z_DOS_CP863_CEDILLA 0xA5
#define Z_DOS_CP863_SUPERSCRIPT_THREE 0xA6
#define Z_DOS_CP863_MACRON 0xA7
#define Z_DOS_CP863_LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX 0xA8
#define Z_DOS_CP863_REVERSED_NOT_SIGN 0xA9
#define Z_DOS_CP863_NOT_SIGN 0xAA
#define Z_DOS_CP863_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP863_VULGAR_FRACTION_ONE_QUARTER 0xAC
#define Z_DOS_CP863_VULGAR_FRACTION_THREE_QUARTERS 0xAD
#define Z_DOS_CP863_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP863_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP863_LIGHT_SHADE 0xB0
#define Z_DOS_CP863_MEDIUM_SHADE 0xB1
#define Z_DOS_CP863_DARK_SHADE 0xB2
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP863_BOX_DRAWINGS_VERTICAL_SINGLE_AND_LEFT_DOUBLE 0xB5
#define Z_DOS_CP863_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_LEFT_SINGLE 0xB6
#define Z_DOS_CP863_BOX_DRAWINGS_DOWN_DOUBLE_AND_LEFT_SINGLE 0xB7
#define Z_DOS_CP863_BOX_DRAWINGS_DOWN_SINGLE_AND_LEFT_DOUBLE 0xB8
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP863_BOX_DRAWINGS_UP_DOUBLE_AND_LEFT_SINGLE 0xBD
#define Z_DOS_CP863_BOX_DRAWINGS_UP_SINGLE_AND_LEFT_DOUBLE 0xBE
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP863_BOX_DRAWINGS_VERTICAL_SINGLE_AND_RIGHT_DOUBLE 0xC6
#define Z_DOS_CP863_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_RIGHT_SINGLE 0xC7
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP863_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP863_BOX_DRAWINGS_UP_SINGLE_AND_HORIZONTAL_DOUBLE 0xCF
#define Z_DOS_CP863_BOX_DRAWINGS_UP_DOUBLE_AND_HORIZONTAL_SINGLE 0xD0
#define Z_DOS_CP863_BOX_DRAWINGS_DOWN_SINGLE_AND_HORIZONTAL_DOUBLE 0xD1
#define Z_DOS_CP863_BOX_DRAWINGS_DOWN_DOUBLE_AND_HORIZONTAL_SINGLE 0xD2
#define Z_DOS_CP863_BOX_DRAWINGS_UP_DOUBLE_AND_RIGHT_SINGLE 0xD3
#define Z_DOS_CP863_BOX_DRAWINGS_UP_SINGLE_AND_RIGHT_DOUBLE 0xD4
#define Z_DOS_CP863_BOX_DRAWINGS_DOWN_SINGLE_AND_RIGHT_DOUBLE 0xD5
#define Z_DOS_CP863_BOX_DRAWINGS_DOWN_DOUBLE_AND_RIGHT_SINGLE 0xD6
#define Z_DOS_CP863_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_HORIZONTAL_SINGLE 0xD7
#define Z_DOS_CP863_BOX_DRAWINGS_VERTICAL_SINGLE_AND_HORIZONTAL_DOUBLE 0xD8
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP863_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP863_FULL_BLOCK 0xDB
#define Z_DOS_CP863_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP863_LEFT_HALF_BLOCK 0xDD
#define Z_DOS_CP863_RIGHT_HALF_BLOCK 0xDE
#define Z_DOS_CP863_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP863_GREEK_SMALL_LETTER_ALPHA 0xE0
#define Z_DOS_CP863_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP863_GREEK_CAPITAL_LETTER_GAMMA 0xE2
#define Z_DOS_CP863_GREEK_SMALL_LETTER_PI 0xE3
#define Z_DOS_CP863_GREEK_CAPITAL_LETTER_SIGMA 0xE4
#define Z_DOS_CP863_GREEK_SMALL_LETTER_SIGMA 0xE5
#define Z_DOS_CP863_MICRO_SIGN 0xE6
#define Z_DOS_CP863_GREEK_SMALL_LETTER_TAU 0xE7
#define Z_DOS_CP863_GREEK_CAPITAL_LETTER_PHI 0xE8
#define Z_DOS_CP863_GREEK_CAPITAL_LETTER_THETA 0xE9
#define Z_DOS_CP863_GREEK_CAPITAL_LETTER_OMEGA 0xEA
#define Z_DOS_CP863_GREEK_SMALL_LETTER_DELTA 0xEB
#define Z_DOS_CP863_INFINITY 0xEC
#define Z_DOS_CP863_GREEK_SMALL_LETTER_PHI 0xED
#define Z_DOS_CP863_GREEK_SMALL_LETTER_EPSILON 0xEE
#define Z_DOS_CP863_INTERSECTION 0xEF
#define Z_DOS_CP863_IDENTICAL_TO 0xF0
#define Z_DOS_CP863_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP863_GREATER_THAN_OR_EQUAL_TO 0xF2
#define Z_DOS_CP863_LESS_THAN_OR_EQUAL_TO 0xF3
#define Z_DOS_CP863_TOP_HALF_INTEGRAL 0xF4
#define Z_DOS_CP863_BOTTOM_HALF_INTEGRAL 0xF5
#define Z_DOS_CP863_DIVISION_SIGN 0xF6
#define Z_DOS_CP863_ALMOST_EQUAL_TO 0xF7
#define Z_DOS_CP863_DEGREE_SIGN 0xF8
#define Z_DOS_CP863_BULLET_OPERATOR 0xF9
#define Z_DOS_CP863_MIDDLE_DOT 0xFA
#define Z_DOS_CP863_SQUARE_ROOT 0xFB
#define Z_DOS_CP863_SUPERSCRIPT_LATIN_SMALL_LETTER_N 0xFC
#define Z_DOS_CP863_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP863_BLACK_SQUARE 0xFE
#define Z_DOS_CP863_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP863_TO_UNICODE(_) \
_(00C7), _(00FC), _(00E9), _(00E2), _(00C2), _(00E0), _(00B6), _(00E7), \
_(00EA), _(00EB), _(00E8), _(00EF), _(00EE), _(2017), _(00C0), _(00A7), \
_(00C9), _(00C8), _(00CA), _(00F4), _(00CB), _(00CF), _(00FB), _(00F9), \
_(00A4), _(00D4), _(00DC), _(00A2), _(00A3), _(00D9), _(00DB), _(0192), \
_(00A6), _(00B4), _(00F3), _(00FA), _(00A8), _(00B8), _(00B3), _(00AF), \
_(00CE), _(2310), _(00AC), _(00BD), _(00BC), _(00BE), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(2561), _(2562), _(2556), \
_(2555), _(2563), _(2551), _(2557), _(255D), _(255C), _(255B), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(255E), _(255F), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(2567), \
_(2568), _(2564), _(2565), _(2559), _(2558), _(2552), _(2553), _(256B), \
_(256A), _(2518), _(250C), _(2588), _(2584), _(258C), _(2590), _(2580), \
_(03B1), _(00DF), _(0393), _(03C0), _(03A3), _(03C3), _(00B5), _(03C4), \
_(03A6), _(0398), _(03A9), _(03B4), _(221E), _(03C6), _(03B5), _(2229), \
_(2261), _(00B1), _(2265), _(2264), _(2320), _(2321), _(00F7), _(2248), \
_(00B0), _(2219), _(00B7), _(221A), _(207F), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP863_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP864.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP864_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP864_DEGREE_SIGN 0x80
#define Z_DOS_CP864_MIDDLE_DOT 0x81
#define Z_DOS_CP864_BULLET_OPERATOR 0x82
#define Z_DOS_CP864_SQUARE_ROOT 0x83
#define Z_DOS_CP864_MEDIUM_SHADE 0x84
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_HORIZONTAL 0x85
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_VERTICAL 0x86
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0x87
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0x88
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0x89
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0x8A
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0x8B
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0x8C
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0x8D
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0x8E
#define Z_DOS_CP864_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0x8F
#define Z_DOS_CP864_GREEK_SMALL_LETTER_BETA 0x90
#define Z_DOS_CP864_INFINITY 0x91
#define Z_DOS_CP864_GREEK_SMALL_LETTER_PHI 0x92
#define Z_DOS_CP864_PLUS_MINUS_SIGN 0x93
#define Z_DOS_CP864_VULGAR_FRACTION_ONE_HALF 0x94
#define Z_DOS_CP864_VULGAR_FRACTION_ONE_QUARTER 0x95
#define Z_DOS_CP864_ALMOST_EQUAL_TO 0x96
#define Z_DOS_CP864_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0x97
#define Z_DOS_CP864_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0x98
#define Z_DOS_CP864_ARABIC_LIGATURE_LAM_WITH_ALEF_WITH_HAMZA_ABOVE_ISOLATED_FORM 0x99
#define Z_DOS_CP864_ARABIC_LIGATURE_LAM_WITH_ALEF_WITH_HAMZA_ABOVE_FINAL_FORM 0x9A
/* 9Bh undefined */
/* 9Ch undefined */
#define Z_DOS_CP864_ARABIC_LIGATURE_LAM_WITH_ALEF_ISOLATED_FORM 0x9D
#define Z_DOS_CP864_ARABIC_LIGATURE_LAM_WITH_ALEF_FINAL_FORM 0x9E
/* 9Fh undefined */
#define Z_DOS_CP864_NO_BREAK_SPACE 0xA0
#define Z_DOS_CP864_SOFT_HYPHEN 0xA1
#define Z_DOS_CP864_ARABIC_LETTER_ALEF_WITH_MADDA_ABOVE_FINAL_FORM 0xA2
#define Z_DOS_CP864_POUND_SIGN 0xA3
#define Z_DOS_CP864_CURRENCY_SIGN 0xA4
#define Z_DOS_CP864_ARABIC_LETTER_ALEF_WITH_HAMZA_ABOVE_FINAL_FORM 0xA5
/* A6h undefined */
/* A7h undefined */
#define Z_DOS_CP864_ARABIC_LETTER_ALEF_FINAL_FORM 0xA8
#define Z_DOS_CP864_ARABIC_LETTER_BEH_ISOLATED_FORM 0xA9
#define Z_DOS_CP864_ARABIC_LETTER_TEH_ISOLATED_FORM 0xAA
#define Z_DOS_CP864_ARABIC_LETTER_THEH_ISOLATED_FORM 0xAB
#define Z_DOS_CP864_ARABIC_COMMA 0xAC
#define Z_DOS_CP864_ARABIC_LETTER_JEEM_ISOLATED_FORM 0xAD
#define Z_DOS_CP864_ARABIC_LETTER_HAH_ISOLATED_FORM 0xAE
#define Z_DOS_CP864_ARABIC_LETTER_KHAH_ISOLATED_FORM 0xAF
#define Z_DOS_CP864_ARABIC_INDIC_DIGIT_ZERO 0xB0
#define Z_DOS_CP864_ARABIC_INDIC_DIGIT_ONE 0xB1
#define Z_DOS_CP864_ARABIC_INDIC_DIGIT_TWO 0xB2
#define Z_DOS_CP864_ARABIC_INDIC_DIGIT_THREE 0xB3
#define Z_DOS_CP864_ARABIC_INDIC_DIGIT_FOUR 0xB4
#define Z_DOS_CP864_ARABIC_INDIC_DIGIT_FIVE 0xB5
#define Z_DOS_CP864_ARABIC_INDIC_DIGIT_SIX 0xB6
#define Z_DOS_CP864_ARABIC_INDIC_DIGIT_SEVEN 0xB7
#define Z_DOS_CP864_ARABIC_INDIC_DIGIT_EIGHT 0xB8
#define Z_DOS_CP864_ARABIC_INDIC_DIGIT_NINE 0xB9
#define Z_DOS_CP864_ARABIC_LETTER_FEH_ISOLATED_FORM 0xBA
#define Z_DOS_CP864_ARABIC_SEMICOLON 0xBB
#define Z_DOS_CP864_ARABIC_LETTER_SEEN_ISOLATED_FORM 0xBC
#define Z_DOS_CP864_ARABIC_LETTER_SHEEN_ISOLATED_FORM 0xBD
#define Z_DOS_CP864_ARABIC_LETTER_SAD_ISOLATED_FORM 0xBE
#define Z_DOS_CP864_ARABIC_QUESTION_MARK 0xBF
#define Z_DOS_CP864_CENT_SIGN 0xC0
#define Z_DOS_CP864_ARABIC_LETTER_HAMZA_ISOLATED_FORM 0xC1
#define Z_DOS_CP864_ARABIC_LETTER_ALEF_WITH_MADDA_ABOVE_ISOLATED_FORM 0xC2
#define Z_DOS_CP864_ARABIC_LETTER_ALEF_WITH_HAMZA_ABOVE_ISOLATED_FORM 0xC3
#define Z_DOS_CP864_ARABIC_LETTER_WAW_WITH_HAMZA_ABOVE_ISOLATED_FORM 0xC4
#define Z_DOS_CP864_ARABIC_LETTER_AIN_FINAL_FORM 0xC5
#define Z_DOS_CP864_ARABIC_LETTER_YEH_WITH_HAMZA_ABOVE_INITIAL_FORM 0xC6
#define Z_DOS_CP864_ARABIC_LETTER_ALEF_ISOLATED_FORM 0xC7
#define Z_DOS_CP864_ARABIC_LETTER_BEH_INITIAL_FORM 0xC8
#define Z_DOS_CP864_ARABIC_LETTER_TEH_MARBUTA_ISOLATED_FORM 0xC9
#define Z_DOS_CP864_ARABIC_LETTER_TEH_INITIAL_FORM 0xCA
#define Z_DOS_CP864_ARABIC_LETTER_THEH_INITIAL_FORM 0xCB
#define Z_DOS_CP864_ARABIC_LETTER_JEEM_INITIAL_FORM 0xCC
#define Z_DOS_CP864_ARABIC_LETTER_HAH_INITIAL_FORM 0xCD
#define Z_DOS_CP864_ARABIC_LETTER_KHAH_INITIAL_FORM 0xCE
#define Z_DOS_CP864_ARABIC_LETTER_DAL_ISOLATED_FORM 0xCF
#define Z_DOS_CP864_ARABIC_LETTER_THAL_ISOLATED_FORM 0xD0
#define Z_DOS_CP864_ARABIC_LETTER_REH_ISOLATED_FORM 0xD1
#define Z_DOS_CP864_ARABIC_LETTER_ZAIN_ISOLATED_FORM 0xD2
#define Z_DOS_CP864_ARABIC_LETTER_SEEN_INITIAL_FORM 0xD3
#define Z_DOS_CP864_ARABIC_LETTER_SHEEN_INITIAL_FORM 0xD4
#define Z_DOS_CP864_ARABIC_LETTER_SAD_INITIAL_FORM 0xD5
#define Z_DOS_CP864_ARABIC_LETTER_DAD_INITIAL_FORM 0xD6
#define Z_DOS_CP864_ARABIC_LETTER_TAH_ISOLATED_FORM 0xD7
#define Z_DOS_CP864_ARABIC_LETTER_ZAH_ISOLATED_FORM 0xD8
#define Z_DOS_CP864_ARABIC_LETTER_AIN_INITIAL_FORM 0xD9
#define Z_DOS_CP864_ARABIC_LETTER_GHAIN_INITIAL_FORM 0xDA
#define Z_DOS_CP864_BROKEN_BAR 0xDB
#define Z_DOS_CP864_NOT_SIGN 0xDC
#define Z_DOS_CP864_DIVISION_SIGN 0xDD
#define Z_DOS_CP864_MULTIPLICATION_SIGN 0xDE
#define Z_DOS_CP864_ARABIC_LETTER_AIN_ISOLATED_FORM 0xDF
#define Z_DOS_CP864_ARABIC_TATWEEL 0xE0
#define Z_DOS_CP864_ARABIC_LETTER_FEH_INITIAL_FORM 0xE1
#define Z_DOS_CP864_ARABIC_LETTER_QAF_INITIAL_FORM 0xE2
#define Z_DOS_CP864_ARABIC_LETTER_KAF_INITIAL_FORM 0xE3
#define Z_DOS_CP864_ARABIC_LETTER_LAM_INITIAL_FORM 0xE4
#define Z_DOS_CP864_ARABIC_LETTER_MEEM_INITIAL_FORM 0xE5
#define Z_DOS_CP864_ARABIC_LETTER_NOON_INITIAL_FORM 0xE6
#define Z_DOS_CP864_ARABIC_LETTER_HEH_INITIAL_FORM 0xE7
#define Z_DOS_CP864_ARABIC_LETTER_WAW_ISOLATED_FORM 0xE8
#define Z_DOS_CP864_ARABIC_LETTER_ALEF_MAKSURA_ISOLATED_FORM 0xE9
#define Z_DOS_CP864_ARABIC_LETTER_YEH_INITIAL_FORM 0xEA
#define Z_DOS_CP864_ARABIC_LETTER_DAD_ISOLATED_FORM 0xEB
#define Z_DOS_CP864_ARABIC_LETTER_AIN_MEDIAL_FORM 0xEC
#define Z_DOS_CP864_ARABIC_LETTER_GHAIN_FINAL_FORM 0xED
#define Z_DOS_CP864_ARABIC_LETTER_GHAIN_ISOLATED_FORM 0xEE
#define Z_DOS_CP864_ARABIC_LETTER_MEEM_ISOLATED_FORM 0xEF
#define Z_DOS_CP864_ARABIC_SHADDA_MEDIAL_FORM 0xF0
#define Z_DOS_CP864_ARABIC_SHADDA 0xF1
#define Z_DOS_CP864_ARABIC_LETTER_NOON_ISOLATED_FORM 0xF2
#define Z_DOS_CP864_ARABIC_LETTER_HEH_ISOLATED_FORM 0xF3
#define Z_DOS_CP864_ARABIC_LETTER_HEH_MEDIAL_FORM 0xF4
#define Z_DOS_CP864_ARABIC_LETTER_ALEF_MAKSURA_FINAL_FORM 0xF5
#define Z_DOS_CP864_ARABIC_LETTER_YEH_FINAL_FORM 0xF6
#define Z_DOS_CP864_ARABIC_LETTER_GHAIN_MEDIAL_FORM 0xF7
#define Z_DOS_CP864_ARABIC_LETTER_QAF_ISOLATED_FORM 0xF8
#define Z_DOS_CP864_ARABIC_LIGATURE_LAM_WITH_ALEF_WITH_MADDA_ABOVE_ISOLATED_FORM 0xF9
#define Z_DOS_CP864_ARABIC_LIGATURE_LAM_WITH_ALEF_WITH_MADDA_ABOVE_FINAL_FORM 0xFA
#define Z_DOS_CP864_ARABIC_LETTER_LAM_ISOLATED_FORM 0xFB
#define Z_DOS_CP864_ARABIC_LETTER_KAF_ISOLATED_FORM 0xFC
#define Z_DOS_CP864_ARABIC_LETTER_YEH_ISOLATED_FORM 0xFD
#define Z_DOS_CP864_BLACK_SQUARE 0xFE
/* FFh undefined */
#define Z_ARRAY_CONTENT_DOS_CP864_TO_UNICODE(_, undefined) \
_(00B0), _(00B7), _(2219), _(221A), _(2592), _(2500), _(2502), _(253C), \
_(2524), _(252C), _(251C), _(2534), _(2510), _(250C), _(2514), _(2518), \
_(03B2), _(221E), _(03C6), _(00B1), _(00BD), _(00BC), _(2248), _(00AB), \
_(00BB), _(FEF7), _(FEF8), undefined, undefined, _(FEFB), _(FEFC), undefined, \
_(00A0), _(00AD), _(FE82), _(00A3), _(00A4), _(FE84), undefined, undefined, \
_(FE8E), _(FE8F), _(FE95), _(FE99), _(060C), _(FE9D), _(FEA1), _(FEA5), \
_(0660), _(0661), _(0662), _(0663), _(0664), _(0665), _(0666), _(0667), \
_(0668), _(0669), _(FED1), _(061B), _(FEB1), _(FEB5), _(FEB9), _(061F), \
_(00A2), _(FE80), _(FE81), _(FE83), _(FE85), _(FECA), _(FE8B), _(FE8D), \
_(FE91), _(FE93), _(FE97), _(FE9B), _(FE9F), _(FEA3), _(FEA7), _(FEA9), \
_(FEAB), _(FEAD), _(FEAF), _(FEB3), _(FEB7), _(FEBB), _(FEBF), _(FEC1), \
_(FEC5), _(FECB), _(FECF), _(00A6), _(00AC), _(00F7), _(00D7), _(FEC9), \
_(0640), _(FED3), _(FED7), _(FEDB), _(FEDF), _(FEE3), _(FEE7), _(FEEB), \
_(FEED), _(FEEF), _(FEF3), _(FEBD), _(FECC), _(FECE), _(FECD), _(FEE1), \
_(FE7D), _(0651), _(FEE5), _(FEE9), _(FEEC), _(FEF0), _(FEF2), _(FED0), \
_(FED5), _(FEF5), _(FEF6), _(FEDD), _(FED9), _(FEF1), _(25A0), undefined
#endif /* Z_formats_character_set_DOS_CP864_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP865.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP865_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP865_LATIN_CAPITAL_LETTER_C_WITH_CEDILLA 0x80
#define Z_DOS_CP865_LATIN_SMALL_LETTER_U_WITH_DIAERESIS 0x81
#define Z_DOS_CP865_LATIN_SMALL_LETTER_E_WITH_ACUTE 0x82
#define Z_DOS_CP865_LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX 0x83
#define Z_DOS_CP865_LATIN_SMALL_LETTER_A_WITH_DIAERESIS 0x84
#define Z_DOS_CP865_LATIN_SMALL_LETTER_A_WITH_GRAVE 0x85
#define Z_DOS_CP865_LATIN_SMALL_LETTER_A_WITH_RING_ABOVE 0x86
#define Z_DOS_CP865_LATIN_SMALL_LETTER_C_WITH_CEDILLA 0x87
#define Z_DOS_CP865_LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX 0x88
#define Z_DOS_CP865_LATIN_SMALL_LETTER_E_WITH_DIAERESIS 0x89
#define Z_DOS_CP865_LATIN_SMALL_LETTER_E_WITH_GRAVE 0x8A
#define Z_DOS_CP865_LATIN_SMALL_LETTER_I_WITH_DIAERESIS 0x8B
#define Z_DOS_CP865_LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX 0x8C
#define Z_DOS_CP865_LATIN_SMALL_LETTER_I_WITH_GRAVE 0x8D
#define Z_DOS_CP865_LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS 0x8E
#define Z_DOS_CP865_LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE 0x8F
#define Z_DOS_CP865_LATIN_CAPITAL_LETTER_E_WITH_ACUTE 0x90
#define Z_DOS_CP865_LATIN_SMALL_LETTER_AE 0x91
#define Z_DOS_CP865_LATIN_CAPITAL_LETTER_AE 0x92
#define Z_DOS_CP865_LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX 0x93
#define Z_DOS_CP865_LATIN_SMALL_LETTER_O_WITH_DIAERESIS 0x94
#define Z_DOS_CP865_LATIN_SMALL_LETTER_O_WITH_GRAVE 0x95
#define Z_DOS_CP865_LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX 0x96
#define Z_DOS_CP865_LATIN_SMALL_LETTER_U_WITH_GRAVE 0x97
#define Z_DOS_CP865_LATIN_SMALL_LETTER_Y_WITH_DIAERESIS 0x98
#define Z_DOS_CP865_LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS 0x99
#define Z_DOS_CP865_LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS 0x9A
#define Z_DOS_CP865_LATIN_SMALL_LETTER_O_WITH_STROKE 0x9B
#define Z_DOS_CP865_POUND_SIGN 0x9C
#define Z_DOS_CP865_LATIN_CAPITAL_LETTER_O_WITH_STROKE 0x9D
#define Z_DOS_CP865_PESETA_SIGN 0x9E
#define Z_DOS_CP865_LATIN_SMALL_LETTER_F_WITH_HOOK 0x9F
#define Z_DOS_CP865_LATIN_SMALL_LETTER_A_WITH_ACUTE 0xA0
#define Z_DOS_CP865_LATIN_SMALL_LETTER_I_WITH_ACUTE 0xA1
#define Z_DOS_CP865_LATIN_SMALL_LETTER_O_WITH_ACUTE 0xA2
#define Z_DOS_CP865_LATIN_SMALL_LETTER_U_WITH_ACUTE 0xA3
#define Z_DOS_CP865_LATIN_SMALL_LETTER_N_WITH_TILDE 0xA4
#define Z_DOS_CP865_LATIN_CAPITAL_LETTER_N_WITH_TILDE 0xA5
#define Z_DOS_CP865_FEMININE_ORDINAL_INDICATOR 0xA6
#define Z_DOS_CP865_MASCULINE_ORDINAL_INDICATOR 0xA7
#define Z_DOS_CP865_INVERTED_QUESTION_MARK 0xA8
#define Z_DOS_CP865_REVERSED_NOT_SIGN 0xA9
#define Z_DOS_CP865_NOT_SIGN 0xAA
#define Z_DOS_CP865_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP865_VULGAR_FRACTION_ONE_QUARTER 0xAC
#define Z_DOS_CP865_INVERTED_EXCLAMATION_MARK 0xAD
#define Z_DOS_CP865_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP865_CURRENCY_SIGN 0xAF
#define Z_DOS_CP865_LIGHT_SHADE 0xB0
#define Z_DOS_CP865_MEDIUM_SHADE 0xB1
#define Z_DOS_CP865_DARK_SHADE 0xB2
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP865_BOX_DRAWINGS_VERTICAL_SINGLE_AND_LEFT_DOUBLE 0xB5
#define Z_DOS_CP865_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_LEFT_SINGLE 0xB6
#define Z_DOS_CP865_BOX_DRAWINGS_DOWN_DOUBLE_AND_LEFT_SINGLE 0xB7
#define Z_DOS_CP865_BOX_DRAWINGS_DOWN_SINGLE_AND_LEFT_DOUBLE 0xB8
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP865_BOX_DRAWINGS_UP_DOUBLE_AND_LEFT_SINGLE 0xBD
#define Z_DOS_CP865_BOX_DRAWINGS_UP_SINGLE_AND_LEFT_DOUBLE 0xBE
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP865_BOX_DRAWINGS_VERTICAL_SINGLE_AND_RIGHT_DOUBLE 0xC6
#define Z_DOS_CP865_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_RIGHT_SINGLE 0xC7
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP865_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP865_BOX_DRAWINGS_UP_SINGLE_AND_HORIZONTAL_DOUBLE 0xCF
#define Z_DOS_CP865_BOX_DRAWINGS_UP_DOUBLE_AND_HORIZONTAL_SINGLE 0xD0
#define Z_DOS_CP865_BOX_DRAWINGS_DOWN_SINGLE_AND_HORIZONTAL_DOUBLE 0xD1
#define Z_DOS_CP865_BOX_DRAWINGS_DOWN_DOUBLE_AND_HORIZONTAL_SINGLE 0xD2
#define Z_DOS_CP865_BOX_DRAWINGS_UP_DOUBLE_AND_RIGHT_SINGLE 0xD3
#define Z_DOS_CP865_BOX_DRAWINGS_UP_SINGLE_AND_RIGHT_DOUBLE 0xD4
#define Z_DOS_CP865_BOX_DRAWINGS_DOWN_SINGLE_AND_RIGHT_DOUBLE 0xD5
#define Z_DOS_CP865_BOX_DRAWINGS_DOWN_DOUBLE_AND_RIGHT_SINGLE 0xD6
#define Z_DOS_CP865_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_HORIZONTAL_SINGLE 0xD7
#define Z_DOS_CP865_BOX_DRAWINGS_VERTICAL_SINGLE_AND_HORIZONTAL_DOUBLE 0xD8
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP865_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP865_FULL_BLOCK 0xDB
#define Z_DOS_CP865_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP865_LEFT_HALF_BLOCK 0xDD
#define Z_DOS_CP865_RIGHT_HALF_BLOCK 0xDE
#define Z_DOS_CP865_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP865_GREEK_SMALL_LETTER_ALPHA 0xE0
#define Z_DOS_CP865_LATIN_SMALL_LETTER_SHARP_S 0xE1
#define Z_DOS_CP865_GREEK_CAPITAL_LETTER_GAMMA 0xE2
#define Z_DOS_CP865_GREEK_SMALL_LETTER_PI 0xE3
#define Z_DOS_CP865_GREEK_CAPITAL_LETTER_SIGMA 0xE4
#define Z_DOS_CP865_GREEK_SMALL_LETTER_SIGMA 0xE5
#define Z_DOS_CP865_MICRO_SIGN 0xE6
#define Z_DOS_CP865_GREEK_SMALL_LETTER_TAU 0xE7
#define Z_DOS_CP865_GREEK_CAPITAL_LETTER_PHI 0xE8
#define Z_DOS_CP865_GREEK_CAPITAL_LETTER_THETA 0xE9
#define Z_DOS_CP865_GREEK_CAPITAL_LETTER_OMEGA 0xEA
#define Z_DOS_CP865_GREEK_SMALL_LETTER_DELTA 0xEB
#define Z_DOS_CP865_INFINITY 0xEC
#define Z_DOS_CP865_GREEK_SMALL_LETTER_PHI 0xED
#define Z_DOS_CP865_GREEK_SMALL_LETTER_EPSILON 0xEE
#define Z_DOS_CP865_INTERSECTION 0xEF
#define Z_DOS_CP865_IDENTICAL_TO 0xF0
#define Z_DOS_CP865_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP865_GREATER_THAN_OR_EQUAL_TO 0xF2
#define Z_DOS_CP865_LESS_THAN_OR_EQUAL_TO 0xF3
#define Z_DOS_CP865_TOP_HALF_INTEGRAL 0xF4
#define Z_DOS_CP865_BOTTOM_HALF_INTEGRAL 0xF5
#define Z_DOS_CP865_DIVISION_SIGN 0xF6
#define Z_DOS_CP865_ALMOST_EQUAL_TO 0xF7
#define Z_DOS_CP865_DEGREE_SIGN 0xF8
#define Z_DOS_CP865_BULLET_OPERATOR 0xF9
#define Z_DOS_CP865_MIDDLE_DOT 0xFA
#define Z_DOS_CP865_SQUARE_ROOT 0xFB
#define Z_DOS_CP865_SUPERSCRIPT_LATIN_SMALL_LETTER_N 0xFC
#define Z_DOS_CP865_SUPERSCRIPT_TWO 0xFD
#define Z_DOS_CP865_BLACK_SQUARE 0xFE
#define Z_DOS_CP865_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP865_TO_UNICODE(_) \
_(00C7), _(00FC), _(00E9), _(00E2), _(00E4), _(00E0), _(00E5), _(00E7), \
_(00EA), _(00EB), _(00E8), _(00EF), _(00EE), _(00EC), _(00C4), _(00C5), \
_(00C9), _(00E6), _(00C6), _(00F4), _(00F6), _(00F2), _(00FB), _(00F9), \
_(00FF), _(00D6), _(00DC), _(00F8), _(00A3), _(00D8), _(20A7), _(0192), \
_(00E1), _(00ED), _(00F3), _(00FA), _(00F1), _(00D1), _(00AA), _(00BA), \
_(00BF), _(2310), _(00AC), _(00BD), _(00BC), _(00A1), _(00AB), _(00A4), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(2561), _(2562), _(2556), \
_(2555), _(2563), _(2551), _(2557), _(255D), _(255C), _(255B), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(255E), _(255F), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(2567), \
_(2568), _(2564), _(2565), _(2559), _(2558), _(2552), _(2553), _(256B), \
_(256A), _(2518), _(250C), _(2588), _(2584), _(258C), _(2590), _(2580), \
_(03B1), _(00DF), _(0393), _(03C0), _(03A3), _(03C3), _(00B5), _(03C4), \
_(03A6), _(0398), _(03A9), _(03B4), _(221E), _(03C6), _(03B5), _(2229), \
_(2261), _(00B1), _(2265), _(2264), _(2320), _(2321), _(00F7), _(2248), \
_(00B0), _(2219), _(00B7), _(221A), _(207F), _(00B2), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP865_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP866.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP866_H
/* From 00h to 7Fh like ASCII */
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_A 0x80
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_BE 0x81
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_VE 0x82
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_GHE 0x83
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_DE 0x84
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_IE 0x85
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_ZHE 0x86
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_ZE 0x87
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_I 0x88
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_SHORT_I 0x89
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_KA 0x8A
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_EL 0x8B
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_EM 0x8C
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_EN 0x8D
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_O 0x8E
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_PE 0x8F
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_ER 0x90
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_ES 0x91
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_TE 0x92
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_U 0x93
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_EF 0x94
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_HA 0x95
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_TSE 0x96
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_CHE 0x97
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_SHA 0x98
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_SHCHA 0x99
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_HARD_SIGN 0x9A
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_YERU 0x9B
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_SOFT_SIGN 0x9C
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_E 0x9D
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_YU 0x9E
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_YA 0x9F
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_A 0xA0
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_BE 0xA1
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_VE 0xA2
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_GHE 0xA3
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_DE 0xA4
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_IE 0xA5
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_ZHE 0xA6
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_ZE 0xA7
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_I 0xA8
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_SHORT_I 0xA9
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_KA 0xAA
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_EL 0xAB
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_EM 0xAC
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_EN 0xAD
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_O 0xAE
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_PE 0xAF
#define Z_DOS_CP866_LIGHT_SHADE 0xB0
#define Z_DOS_CP866_MEDIUM_SHADE 0xB1
#define Z_DOS_CP866_DARK_SHADE 0xB2
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP866_BOX_DRAWINGS_VERTICAL_SINGLE_AND_LEFT_DOUBLE 0xB5
#define Z_DOS_CP866_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_LEFT_SINGLE 0xB6
#define Z_DOS_CP866_BOX_DRAWINGS_DOWN_DOUBLE_AND_LEFT_SINGLE 0xB7
#define Z_DOS_CP866_BOX_DRAWINGS_DOWN_SINGLE_AND_LEFT_DOUBLE 0xB8
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP866_BOX_DRAWINGS_UP_DOUBLE_AND_LEFT_SINGLE 0xBD
#define Z_DOS_CP866_BOX_DRAWINGS_UP_SINGLE_AND_LEFT_DOUBLE 0xBE
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP866_BOX_DRAWINGS_VERTICAL_SINGLE_AND_RIGHT_DOUBLE 0xC6
#define Z_DOS_CP866_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_RIGHT_SINGLE 0xC7
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP866_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP866_BOX_DRAWINGS_UP_SINGLE_AND_HORIZONTAL_DOUBLE 0xCF
#define Z_DOS_CP866_BOX_DRAWINGS_UP_DOUBLE_AND_HORIZONTAL_SINGLE 0xD0
#define Z_DOS_CP866_BOX_DRAWINGS_DOWN_SINGLE_AND_HORIZONTAL_DOUBLE 0xD1
#define Z_DOS_CP866_BOX_DRAWINGS_DOWN_DOUBLE_AND_HORIZONTAL_SINGLE 0xD2
#define Z_DOS_CP866_BOX_DRAWINGS_UP_DOUBLE_AND_RIGHT_SINGLE 0xD3
#define Z_DOS_CP866_BOX_DRAWINGS_UP_SINGLE_AND_RIGHT_DOUBLE 0xD4
#define Z_DOS_CP866_BOX_DRAWINGS_DOWN_SINGLE_AND_RIGHT_DOUBLE 0xD5
#define Z_DOS_CP866_BOX_DRAWINGS_DOWN_DOUBLE_AND_RIGHT_SINGLE 0xD6
#define Z_DOS_CP866_BOX_DRAWINGS_VERTICAL_DOUBLE_AND_HORIZONTAL_SINGLE 0xD7
#define Z_DOS_CP866_BOX_DRAWINGS_VERTICAL_SINGLE_AND_HORIZONTAL_DOUBLE 0xD8
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP866_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP866_FULL_BLOCK 0xDB
#define Z_DOS_CP866_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP866_LEFT_HALF_BLOCK 0xDD
#define Z_DOS_CP866_RIGHT_HALF_BLOCK 0xDE
#define Z_DOS_CP866_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_ER 0xE0
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_ES 0xE1
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_TE 0xE2
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_U 0xE3
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_EF 0xE4
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_HA 0xE5
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_TSE 0xE6
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_CHE 0xE7
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_SHA 0xE8
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_SHCHA 0xE9
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_HARD_SIGN 0xEA
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_YERU 0xEB
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_SOFT_SIGN 0xEC
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_E 0xED
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_YU 0xEE
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_YA 0xEF
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_IO 0xF0
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_IO 0xF1
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_UKRAINIAN_IE 0xF2
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_UKRAINIAN_IE 0xF3
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_YI 0xF4
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_YI 0xF5
#define Z_DOS_CP866_CYRILLIC_CAPITAL_LETTER_SHORT_U 0xF6
#define Z_DOS_CP866_CYRILLIC_SMALL_LETTER_SHORT_U 0xF7
#define Z_DOS_CP866_DEGREE_SIGN 0xF8
#define Z_DOS_CP866_BULLET_OPERATOR 0xF9
#define Z_DOS_CP866_MIDDLE_DOT 0xFA
#define Z_DOS_CP866_SQUARE_ROOT 0xFB
#define Z_DOS_CP866_NUMERO_SIGN 0xFC
#define Z_DOS_CP866_CURRENCY_SIGN 0xFD
#define Z_DOS_CP866_BLACK_SQUARE 0xFE
#define Z_DOS_CP866_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP866_TO_UNICODE(_) \
_(0410), _(0411), _(0412), _(0413), _(0414), _(0415), _(0416), _(0417), \
_(0418), _(0419), _(041A), _(041B), _(041C), _(041D), _(041E), _(041F), \
_(0420), _(0421), _(0422), _(0423), _(0424), _(0425), _(0426), _(0427), \
_(0428), _(0429), _(042A), _(042B), _(042C), _(042D), _(042E), _(042F), \
_(0430), _(0431), _(0432), _(0433), _(0434), _(0435), _(0436), _(0437), \
_(0438), _(0439), _(043A), _(043B), _(043C), _(043D), _(043E), _(043F), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(2561), _(2562), _(2556), \
_(2555), _(2563), _(2551), _(2557), _(255D), _(255C), _(255B), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(255E), _(255F), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(2567), \
_(2568), _(2564), _(2565), _(2559), _(2558), _(2552), _(2553), _(256B), \
_(256A), _(2518), _(250C), _(2588), _(2584), _(258C), _(2590), _(2580), \
_(0440), _(0441), _(0442), _(0443), _(0444), _(0445), _(0446), _(0447), \
_(0448), _(0449), _(044A), _(044B), _(044C), _(044D), _(044E), _(044F), \
_(0401), _(0451), _(0404), _(0454), _(0407), _(0457), _(040E), _(045E), \
_(00B0), _(2219), _(00B7), _(221A), _(2116), _(00A4), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP866_H */

View File

@@ -0,0 +1,160 @@
/* Zeta API - Z/formats/character_set/DOS_CP869.h
______ ______________ ___
|__ / | ___|___ ___|/ \
/ /__| __| | | / - \
/______|_____| |__| /__/ \__\
Copyright (C) 2006-2024 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
#define Z_formats_character_set_DOS_CP869_H
/* From 00h to 7Fh like ASCII */
/* 80h undefined */
/* 81h undefined */
/* 82h undefined */
/* 83h undefined */
/* 84h undefined */
/* 85h undefined */
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_ALPHA_WITH_TONOS 0x86
/* 87h undefined */
#define Z_DOS_CP869_MIDDLE_DOT 0x88
#define Z_DOS_CP869_NOT_SIGN 0x89
#define Z_DOS_CP869_BROKEN_BAR 0x8A
#define Z_DOS_CP869_LEFT_SINGLE_QUOTATION_MARK 0x8B
#define Z_DOS_CP869_RIGHT_SINGLE_QUOTATION_MARK 0x8C
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_EPSILON_WITH_TONOS 0x8D
#define Z_DOS_CP869_HORIZONTAL_BAR 0x8E
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_ETA_WITH_TONOS 0x8F
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_IOTA_WITH_TONOS 0x90
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_IOTA_WITH_DIALYTIKA 0x91
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_OMICRON_WITH_TONOS 0x92
/* 93h undefined */
/* 94h undefined */
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_UPSILON_WITH_TONOS 0x95
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_UPSILON_WITH_DIALYTIKA 0x96
#define Z_DOS_CP869_COPYRIGHT_SIGN 0x97
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_OMEGA_WITH_TONOS 0x98
#define Z_DOS_CP869_SUPERSCRIPT_TWO 0x99
#define Z_DOS_CP869_SUPERSCRIPT_THREE 0x9A
#define Z_DOS_CP869_GREEK_SMALL_LETTER_ALPHA_WITH_TONOS 0x9B
#define Z_DOS_CP869_POUND_SIGN 0x9C
#define Z_DOS_CP869_GREEK_SMALL_LETTER_EPSILON_WITH_TONOS 0x9D
#define Z_DOS_CP869_GREEK_SMALL_LETTER_ETA_WITH_TONOS 0x9E
#define Z_DOS_CP869_GREEK_SMALL_LETTER_IOTA_WITH_TONOS 0x9F
#define Z_DOS_CP869_GREEK_SMALL_LETTER_IOTA_WITH_DIALYTIKA 0xA0
#define Z_DOS_CP869_GREEK_SMALL_LETTER_IOTA_WITH_DIALYTIKA_AND_TONOS 0xA1
#define Z_DOS_CP869_GREEK_SMALL_LETTER_OMICRON_WITH_TONOS 0xA2
#define Z_DOS_CP869_GREEK_SMALL_LETTER_UPSILON_WITH_TONOS 0xA3
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_ALPHA 0xA4
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_BETA 0xA5
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_GAMMA 0xA6
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_DELTA 0xA7
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_EPSILON 0xA8
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_ZETA 0xA9
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_ETA 0xAA
#define Z_DOS_CP869_VULGAR_FRACTION_ONE_HALF 0xAB
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_THETA 0xAC
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_IOTA 0xAD
#define Z_DOS_CP869_LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAE
#define Z_DOS_CP869_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK 0xAF
#define Z_DOS_CP869_LIGHT_SHADE 0xB0
#define Z_DOS_CP869_MEDIUM_SHADE 0xB1
#define Z_DOS_CP869_DARK_SHADE 0xB2
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_VERTICAL 0xB3
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_VERTICAL_AND_LEFT 0xB4
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_KAPPA 0xB5
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_LAMDA 0xB6
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_MU 0xB7
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_NU 0xB8
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_LEFT 0xB9
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_VERTICAL 0xBA
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_DOWN_AND_LEFT 0xBB
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_UP_AND_LEFT 0xBC
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_XI 0xBD
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_OMICRON 0xBE
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT 0xBF
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT 0xC0
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_UP_AND_HORIZONTAL 0xC1
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_DOWN_AND_HORIZONTAL 0xC2
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_VERTICAL_AND_RIGHT 0xC3
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_HORIZONTAL 0xC4
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_VERTICAL_AND_HORIZONTAL 0xC5
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_PI 0xC6
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_RHO 0xC7
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_UP_AND_RIGHT 0xC8
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_DOWN_AND_RIGHT 0xC9
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_UP_AND_HORIZONTAL 0xCA
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_DOWN_AND_HORIZONTAL 0xCB
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_RIGHT 0xCC
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_HORIZONTAL 0xCD
#define Z_DOS_CP869_BOX_DRAWINGS_DOUBLE_VERTICAL_AND_HORIZONTAL 0xCE
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_SIGMA 0xCF
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_TAU 0xD0
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_UPSILON 0xD1
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_PHI 0xD2
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_CHI 0xD3
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_PSI 0xD4
#define Z_DOS_CP869_GREEK_CAPITAL_LETTER_OMEGA 0xD5
#define Z_DOS_CP869_GREEK_SMALL_LETTER_ALPHA 0xD6
#define Z_DOS_CP869_GREEK_SMALL_LETTER_BETA 0xD7
#define Z_DOS_CP869_GREEK_SMALL_LETTER_GAMMA 0xD8
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_UP_AND_LEFT 0xD9
#define Z_DOS_CP869_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT 0xDA
#define Z_DOS_CP869_FULL_BLOCK 0xDB
#define Z_DOS_CP869_LOWER_HALF_BLOCK 0xDC
#define Z_DOS_CP869_GREEK_SMALL_LETTER_DELTA 0xDD
#define Z_DOS_CP869_GREEK_SMALL_LETTER_EPSILON 0xDE
#define Z_DOS_CP869_UPPER_HALF_BLOCK 0xDF
#define Z_DOS_CP869_GREEK_SMALL_LETTER_ZETA 0xE0
#define Z_DOS_CP869_GREEK_SMALL_LETTER_ETA 0xE1
#define Z_DOS_CP869_GREEK_SMALL_LETTER_THETA 0xE2
#define Z_DOS_CP869_GREEK_SMALL_LETTER_IOTA 0xE3
#define Z_DOS_CP869_GREEK_SMALL_LETTER_KAPPA 0xE4
#define Z_DOS_CP869_GREEK_SMALL_LETTER_LAMDA 0xE5
#define Z_DOS_CP869_GREEK_SMALL_LETTER_MU 0xE6
#define Z_DOS_CP869_GREEK_SMALL_LETTER_NU 0xE7
#define Z_DOS_CP869_GREEK_SMALL_LETTER_XI 0xE8
#define Z_DOS_CP869_GREEK_SMALL_LETTER_OMICRON 0xE9
#define Z_DOS_CP869_GREEK_SMALL_LETTER_PI 0xEA
#define Z_DOS_CP869_GREEK_SMALL_LETTER_RHO 0xEB
#define Z_DOS_CP869_GREEK_SMALL_LETTER_SIGMA 0xEC
#define Z_DOS_CP869_GREEK_SMALL_LETTER_FINAL_SIGMA 0xED
#define Z_DOS_CP869_GREEK_SMALL_LETTER_TAU 0xEE
#define Z_DOS_CP869_GREEK_TONOS 0xEF
#define Z_DOS_CP869_SOFT_HYPHEN 0xF0
#define Z_DOS_CP869_PLUS_MINUS_SIGN 0xF1
#define Z_DOS_CP869_GREEK_SMALL_LETTER_UPSILON 0xF2
#define Z_DOS_CP869_GREEK_SMALL_LETTER_PHI 0xF3
#define Z_DOS_CP869_GREEK_SMALL_LETTER_CHI 0xF4
#define Z_DOS_CP869_SECTION_SIGN 0xF5
#define Z_DOS_CP869_GREEK_SMALL_LETTER_PSI 0xF6
#define Z_DOS_CP869_GREEK_DIALYTIKA_TONOS 0xF7
#define Z_DOS_CP869_DEGREE_SIGN 0xF8
#define Z_DOS_CP869_DIAERESIS 0xF9
#define Z_DOS_CP869_GREEK_SMALL_LETTER_OMEGA 0xFA
#define Z_DOS_CP869_GREEK_SMALL_LETTER_UPSILON_WITH_DIALYTIKA 0xFB
#define Z_DOS_CP869_GREEK_SMALL_LETTER_UPSILON_WITH_DIALYTIKA_AND_TONOS 0xFC
#define Z_DOS_CP869_GREEK_SMALL_LETTER_OMEGA_WITH_TONOS 0xFD
#define Z_DOS_CP869_BLACK_SQUARE 0xFE
#define Z_DOS_CP869_NO_BREAK_SPACE 0xFF
#define Z_ARRAY_CONTENT_DOS_CP869_TO_UNICODE(_, undefined) \
undefined, undefined, undefined, undefined, undefined, undefined, _(0386), undefined, \
_(00B7), _(00AC), _(00A6), _(2018), _(2019), _(0388), _(2015), _(0389), \
_(038A), _(03AA), _(038C), undefined, undefined, _(038E), _(03AB), _(00A9), \
_(038F), _(00B2), _(00B3), _(03AC), _(00A3), _(03AD), _(03AE), _(03AF), \
_(03CA), _(0390), _(03CC), _(03CD), _(0391), _(0392), _(0393), _(0394), \
_(0395), _(0396), _(0397), _(00BD), _(0398), _(0399), _(00AB), _(00BB), \
_(2591), _(2592), _(2593), _(2502), _(2524), _(039A), _(039B), _(039C), \
_(039D), _(2563), _(2551), _(2557), _(255D), _(039E), _(039F), _(2510), \
_(2514), _(2534), _(252C), _(251C), _(2500), _(253C), _(03A0), _(03A1), \
_(255A), _(2554), _(2569), _(2566), _(2560), _(2550), _(256C), _(03A3), \
_(03A4), _(03A5), _(03A6), _(03A7), _(03A8), _(03A9), _(03B1), _(03B2), \
_(03B3), _(2518), _(250C), _(2588), _(2584), _(03B4), _(03B5), _(2580), \
_(03B6), _(03B7), _(03B8), _(03B9), _(03BA), _(03BB), _(03BC), _(03BD), \
_(03BE), _(03BF), _(03C0), _(03C1), _(03C3), _(03C2), _(03C4), _(0384), \
_(00AD), _(00B1), _(03C5), _(03C6), _(03C7), _(00A7), _(03C8), _(0385), \
_(00B0), _(00A8), _(03C9), _(03CB), _(03B0), _(03CE), _(25A0), _(00A0)
#endif /* Z_formats_character_set_DOS_CP869_H */

Some files were not shown because too many files have changed in this diff Show More