zemu 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/zemu/config.rb +312 -0
- data/lib/zemu/instance.rb +179 -0
- data/lib/zemu.rb +172 -0
- data/src/debug.c +118 -0
- data/src/debug.h +30 -0
- data/src/external/Z/API/Z/ABIs/generic/allocator.h +36 -0
- data/src/external/Z/API/Z/ABIs/generic/cipher.h +47 -0
- data/src/external/Z/API/Z/ABIs/generic/data codec.h +33 -0
- data/src/external/Z/API/Z/ABIs/generic/emulation.h +103 -0
- data/src/external/Z/API/Z/ABIs/generic/hash function.h +33 -0
- data/src/external/Z/API/Z/ABIs/generic/module.h +33 -0
- data/src/external/Z/API/Z/ABIs/generic/wave codec.h +40 -0
- data/src/external/Z/API/Z/classes/base/InitializerList.hpp +34 -0
- data/src/external/Z/API/Z/classes/base/OpaqueFunctionPointer.hpp +26 -0
- data/src/external/Z/API/Z/classes/base/OpaqueMemberFunctionPointer.hpp +26 -0
- data/src/external/Z/API/Z/classes/base/Pair.hpp +46 -0
- data/src/external/Z/API/Z/classes/base/Range.hpp +111 -0
- data/src/external/Z/API/Z/classes/base/SizedString.hpp +66 -0
- data/src/external/Z/API/Z/classes/base/Status.hpp +89 -0
- data/src/external/Z/API/Z/classes/base/Symbol.hpp +39 -0
- data/src/external/Z/API/Z/classes/base/Tuple.hpp +111 -0
- data/src/external/Z/API/Z/classes/base/Value2D.hpp +389 -0
- data/src/external/Z/API/Z/classes/base/Value3D.hpp +368 -0
- data/src/external/Z/API/Z/classes/buffering/RingBuffer.hpp +93 -0
- data/src/external/Z/API/Z/classes/buffering/TripleBuffer.hpp +68 -0
- data/src/external/Z/API/Z/classes/functional/Functor.hpp +265 -0
- data/src/external/Z/API/Z/classes/functional/MemberFunction.hpp +98 -0
- data/src/external/Z/API/Z/classes/functional/ObjectMemberFunction.hpp +172 -0
- data/src/external/Z/API/Z/classes/functional/ObjectSelector.hpp +219 -0
- data/src/external/Z/API/Z/classes/functional/Selector.hpp +146 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/AABB.hpp +81 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/AABR.hpp +685 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Box.hpp +219 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Circle.hpp +80 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Line2D.hpp +93 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Line3D.hpp +80 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Rectangle.hpp +675 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Sphere.hpp +0 -0
- data/src/external/Z/API/Z/classes/memory/Shared.hpp +90 -0
- data/src/external/Z/API/Z/constants/base.h +35 -0
- data/src/external/Z/API/Z/constants/chemical elements.h +6385 -0
- data/src/external/Z/API/Z/constants/numbers.h +963 -0
- data/src/external/Z/API/Z/constants/version.h +15 -0
- data/src/external/Z/API/Z/formats/character set/ASCII.h +158 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP437.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP737.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP775.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP850.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP852.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP855.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP857.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP858.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP860.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP861.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP862.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP863.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP864.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP865.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP866.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP869.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP872.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP874.h +159 -0
- data/src/external/Z/API/Z/formats/character set/Unicode.h +30119 -0
- data/src/external/Z/API/Z/formats/data model/I16LP32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/ILP32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/ILP64.h +19 -0
- data/src/external/Z/API/Z/formats/data model/IP16L32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/LLP64.h +19 -0
- data/src/external/Z/API/Z/formats/data model/LP32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/LP64.h +19 -0
- data/src/external/Z/API/Z/formats/data model/SILP64.h +19 -0
- data/src/external/Z/API/Z/formats/file system/FAT12.h +61 -0
- data/src/external/Z/API/Z/formats/floating-point/IEEE 754.h +141 -0
- data/src/external/Z/API/Z/formats/floating-point/x87.h +74 -0
- data/src/external/Z/API/Z/formats/image/ICNS.h +39 -0
- data/src/external/Z/API/Z/formats/keymap/Mac OS.h +284 -0
- data/src/external/Z/API/Z/formats/keymap/Z.h +141 -0
- data/src/external/Z/API/Z/formats/multimedia/Creative Voice.h +106 -0
- data/src/external/Z/API/Z/formats/multimedia/Microsoft Wave.h +49 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ACH.h +44 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/FRZ.h +54 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/PRG.h +33 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SEM.h +46 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SIT.h +34 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SNA.h +117 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SNP.h +37 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SP.h +62 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/Z80.h +117 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ZX.h +56 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ZX82.h +70 -0
- data/src/external/Z/API/Z/formats/storage medium image/NES Game Pak/UNIF.h +26 -0
- data/src/external/Z/API/Z/formats/storage medium image/NES Game Pak/iNES.h +76 -0
- data/src/external/Z/API/Z/formats/storage medium image/audio/TAP.h +25 -0
- data/src/external/Z/API/Z/formats/storage medium image/audio/TZX.h +1185 -0
- data/src/external/Z/API/Z/formats/storage medium image/audio/Warajevo TAP.h +32 -0
- data/src/external/Z/API/Z/formats/storage medium image/floppy disk/FDI.h +45 -0
- data/src/external/Z/API/Z/functions/base/Z2D.h +583 -0
- data/src/external/Z/API/Z/functions/base/Z3D.h +712 -0
- data/src/external/Z/API/Z/functions/base/ZRange.h +137 -0
- data/src/external/Z/API/Z/functions/base/all.h +16 -0
- data/src/external/Z/API/Z/functions/base/casting.hpp +37 -0
- data/src/external/Z/API/Z/functions/base/character.h +38 -0
- data/src/external/Z/API/Z/functions/base/constructors.h +326 -0
- data/src/external/Z/API/Z/functions/base/structure.hpp +26 -0
- data/src/external/Z/API/Z/functions/base/type.hpp +60 -0
- data/src/external/Z/API/Z/functions/base/value.h +1901 -0
- data/src/external/Z/API/Z/functions/base/value.hpp +112 -0
- data/src/external/Z/API/Z/functions/buffering/ZRingBuffer.h +85 -0
- data/src/external/Z/API/Z/functions/buffering/ZTripleBuffer.h +65 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/Z2DLine.h +179 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/Z3DLine.h +168 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZAABB.h +361 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZAABR.h +1081 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZBox.h +340 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZCircle.h +142 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZRectangle.h +1267 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZSphere.h +156 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/all.h +18 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/constructors.h +620 -0
- data/src/external/Z/API/Z/functions/time/date.h +29 -0
- data/src/external/Z/API/Z/hardware/CPU/architecture/6502.h +90 -0
- data/src/external/Z/API/Z/hardware/CPU/architecture/Z80.h +245 -0
- data/src/external/Z/API/Z/hardware/CPU/architecture/i4004.h +37 -0
- data/src/external/Z/API/Z/hardware/PSG/General Instrument/AY-3-891x.h +180 -0
- data/src/external/Z/API/Z/hardware/VDC/Ricoh/RP2C0x.h +625 -0
- data/src/external/Z/API/Z/hardware/bus/AGP.h +24 -0
- data/src/external/Z/API/Z/hardware/bus/USB.h +510 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Inves Spectrum +.h +47 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Pentagon.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Scorpion.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum + 128K.h +158 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +.h +82 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +2.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +2A.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +3.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum.h +109 -0
- data/src/external/Z/API/Z/hardware/machine/model/console/Nintendo Entertainment System/NES-001 (NTSC).h +29 -0
- data/src/external/Z/API/Z/hardware/machine/model/console/Nintendo Entertainment System/NES-001 (PAL).h +29 -0
- data/src/external/Z/API/Z/hardware/machine/platform/computer/ZX Spectrum.h +405 -0
- data/src/external/Z/API/Z/hardware/machine/platform/console/Game Boy.h +49 -0
- data/src/external/Z/API/Z/hardware/machine/platform/console/Nintendo Entertainment System.h +350 -0
- data/src/external/Z/API/Z/hardware/storage medium/ROM cartridge/SNES Game Pak.h +238 -0
- data/src/external/Z/API/Z/inspection/C/completion.h +178 -0
- data/src/external/Z/API/Z/inspection/C/modules/C11.h +41 -0
- data/src/external/Z/API/Z/inspection/C/modules/C18.h +13 -0
- data/src/external/Z/API/Z/inspection/C/modules/C89.h +19 -0
- data/src/external/Z/API/Z/inspection/C/modules/C90.h +13 -0
- data/src/external/Z/API/Z/inspection/C/modules/C94.h +15 -0
- data/src/external/Z/API/Z/inspection/C/modules/C99.h +29 -0
- data/src/external/Z/API/Z/inspection/C/modules/KR C.h +19 -0
- data/src/external/Z/API/Z/inspection/C++/completion.h +512 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++03.h +15 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++11.h +80 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++14.h +26 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++17.h +55 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++85.h +11 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++89.h +13 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++98.h +17 -0
- data/src/external/Z/API/Z/inspection/C++.h +78 -0
- data/src/external/Z/API/Z/inspection/C.h +79 -0
- data/src/external/Z/API/Z/inspection/CPU/completion.h +56 -0
- data/src/external/Z/API/Z/inspection/CPU/detection.h +714 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/6502.h +25 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/AArch32.h +32 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/AArch64.h +32 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/Z80.h +26 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/x86-32.h +31 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/x86-64.h +312 -0
- data/src/external/Z/API/Z/inspection/CPU.h +209 -0
- data/src/external/Z/API/Z/inspection/OS/completion.h +36 -0
- data/src/external/Z/API/Z/inspection/OS/detection.h +768 -0
- data/src/external/Z/API/Z/inspection/OS/modules/Linux.h +22 -0
- data/src/external/Z/API/Z/inspection/OS/modules/MS-DOS.h +16 -0
- data/src/external/Z/API/Z/inspection/OS/modules/Mac OS X.h +23 -0
- data/src/external/Z/API/Z/inspection/OS/modules/Windows.h +19 -0
- data/src/external/Z/API/Z/inspection/OS/modules/iPhone OS.h +23 -0
- data/src/external/Z/API/Z/inspection/OS.h +236 -0
- data/src/external/Z/API/Z/inspection/Objective-C/completion.h +8 -0
- data/src/external/Z/API/Z/inspection/Objective-C/modules/Objective-C v1.0.h +11 -0
- data/src/external/Z/API/Z/inspection/Objective-C/modules/Objective-C v2.0.h +15 -0
- data/src/external/Z/API/Z/inspection/Objective-C.h +51 -0
- data/src/external/Z/API/Z/inspection/Z.h +19 -0
- data/src/external/Z/API/Z/inspection/build.h +22 -0
- data/src/external/Z/API/Z/inspection/character set.h +66 -0
- data/src/external/Z/API/Z/inspection/compiler/completion.h +2885 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/Apple LLVM.h +26 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/Clang.h +1664 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/GCC.h +1366 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/SCCZ80.h +473 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/Visual C++.h +606 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/cc65.h +529 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/generic.h +13 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/template.h +650 -0
- data/src/external/Z/API/Z/inspection/compiler.h +299 -0
- data/src/external/Z/API/Z/inspection/data model/completion.h +128 -0
- data/src/external/Z/API/Z/inspection/data model/deduction.h +9 -0
- data/src/external/Z/API/Z/inspection/data model/detection.h +45 -0
- data/src/external/Z/API/Z/inspection/data model.h +362 -0
- data/src/external/Z/API/Z/inspection/floating-point/completion.h +50 -0
- data/src/external/Z/API/Z/inspection/floating-point.h +324 -0
- data/src/external/Z/API/Z/inspection/language.h +163 -0
- data/src/external/Z/API/Z/inspection/platform/detection.h +9 -0
- data/src/external/Z/API/Z/inspection/platform.h +29 -0
- data/src/external/Z/API/Z/keys/C++.h +27 -0
- data/src/external/Z/API/Z/keys/C.h +29 -0
- data/src/external/Z/API/Z/keys/CPU.h +80 -0
- data/src/external/Z/API/Z/keys/OS.h +182 -0
- data/src/external/Z/API/Z/keys/Objective-C.h +17 -0
- data/src/external/Z/API/Z/keys/chemistry.h +26 -0
- data/src/external/Z/API/Z/keys/compiler.h +178 -0
- data/src/external/Z/API/Z/keys/data model.h +32 -0
- data/src/external/Z/API/Z/keys/endianness.h +24 -0
- data/src/external/Z/API/Z/keys/language.h +21 -0
- data/src/external/Z/API/Z/keys/layout.h +20 -0
- data/src/external/Z/API/Z/keys/mathematics/geometry.h +29 -0
- data/src/external/Z/API/Z/keys/mathematics/number.h +21 -0
- data/src/external/Z/API/Z/keys/order.h +18 -0
- data/src/external/Z/API/Z/keys/platform.h +87 -0
- data/src/external/Z/API/Z/keys/program.h +39 -0
- data/src/external/Z/API/Z/keys/science/chemical elements.h +200 -0
- data/src/external/Z/API/Z/keys/science/electricity.h +18 -0
- data/src/external/Z/API/Z/keys/science/magnetism.h +19 -0
- data/src/external/Z/API/Z/keys/status.h +69 -0
- data/src/external/Z/API/Z/keys/text.h +27 -0
- data/src/external/Z/API/Z/keys/value.h +88 -0
- data/src/external/Z/API/Z/macros/arguments.h +25 -0
- data/src/external/Z/API/Z/macros/casting.h +22 -0
- data/src/external/Z/API/Z/macros/character.h +159 -0
- data/src/external/Z/API/Z/macros/date.h +14 -0
- data/src/external/Z/API/Z/macros/key.h +20 -0
- data/src/external/Z/API/Z/macros/language.h +126 -0
- data/src/external/Z/API/Z/macros/language.hpp +81 -0
- data/src/external/Z/API/Z/macros/members.h +86 -0
- data/src/external/Z/API/Z/macros/pasting.h +308 -0
- data/src/external/Z/API/Z/macros/pointer.h +33 -0
- data/src/external/Z/API/Z/macros/repetition.h +283 -0
- data/src/external/Z/API/Z/macros/structure.h +104 -0
- data/src/external/Z/API/Z/macros/templating.h +407 -0
- data/src/external/Z/API/Z/macros/tokens.h +14 -0
- data/src/external/Z/API/Z/macros/type enumeration.h +43 -0
- data/src/external/Z/API/Z/macros/type selection.hpp +76 -0
- data/src/external/Z/API/Z/macros/value.h +489 -0
- data/src/external/Z/API/Z/macros/variadic pasting.h +21 -0
- data/src/external/Z/API/Z/macros/variadic selection.h +56 -0
- data/src/external/Z/API/Z/macros/variadic.h +46 -0
- data/src/external/Z/API/Z/macros/version.h +17 -0
- data/src/external/Z/API/Z/network/3/IP.h +36 -0
- data/src/external/Z/API/Z/network/4/TCP.h +24 -0
- data/src/external/Z/API/Z/network/4/UDP.h +26 -0
- data/src/external/Z/API/Z/network/7/ED2K.h +104 -0
- data/src/external/Z/API/Z/network/7/HTTP.h +100 -0
- data/src/external/Z/API/Z/traits/SelectType.hpp +71 -0
- data/src/external/Z/API/Z/traits/TernaryType.hpp +20 -0
- data/src/external/Z/API/Z/traits/Type.hpp +4516 -0
- data/src/external/Z/API/Z/traits/TypeCount.hpp +52 -0
- data/src/external/Z/API/Z/traits/TypeList.hpp +376 -0
- data/src/external/Z/API/Z/traits/base.hpp +19 -0
- data/src/external/Z/API/Z/traits/filtering.hpp +30 -0
- data/src/external/Z/API/Z/traits/mathematics.hpp +48 -0
- data/src/external/Z/API/Z/types/arguments.h +19 -0
- data/src/external/Z/API/Z/types/base.h +1655 -0
- data/src/external/Z/API/Z/types/base.hpp +169 -0
- data/src/external/Z/API/Z/types/buffering.h +27 -0
- data/src/external/Z/API/Z/types/mathematics.h +135 -0
- data/src/external/Z/API/Z/types/time.h +23 -0
- data/src/external/Z/COPYING.LESSER +165 -0
- data/src/external/Z/development/Qt Creator/Z.pro +253 -0
- data/src/external/Z/distribution/CocoaPods/Zeta.podspec +18 -0
- data/src/external/Z/distribution/Gentoo Linux/Zeta-0.1.ebuild +22 -0
- data/src/external/Z/distribution/Gentoo Linux/metadata.xml +8 -0
- data/src/external/Z/distribution/Homebrew/Zeta.rb +11 -0
- data/src/external/z80/API/emulation/CPU/Z80.h +201 -0
- data/src/external/z80/README.md +229 -0
- data/src/external/z80/building/premake4.lua +33 -0
- data/src/external/z80/development/Xcode/Z80.xcodeproj/project.pbxproj +520 -0
- data/src/external/z80/sources/Z80.c +1660 -0
- data/src/interrupt.c +6 -0
- data/src/interrupt.h +3 -0
- data/src/io.c.erb +115 -0
- data/src/io.h.erb +18 -0
- data/src/main.c +69 -0
- data/src/memory.c.erb +43 -0
- data/src/memory.h.erb +9 -0
- metadata +329 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
/* Z Kit - formats/storage medium image/audio/Warajevo TAP.h
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3.
|
7
|
+
|
8
|
+
.------------------------------------------------------------------.
|
9
|
+
| Extensions: tap |
|
10
|
+
| Endianness: Little |
|
11
|
+
| Created by: Zeljko Juric - Samir Ribic (aka Megaribi) |
|
12
|
+
| Used by: Warajevo [MS-DOS] and some old ZX Spectrum emulators |
|
13
|
+
'-----------------------------------------------------------------*/
|
14
|
+
|
15
|
+
#ifndef _Z_formats_storage_medium_image_audio_Warajevo_TAP_H_
|
16
|
+
#define _Z_formats_storage_medium_image_audio_Warajevo_TAP_H_
|
17
|
+
|
18
|
+
#include <Z/types/base.h>
|
19
|
+
|
20
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
21
|
+
zsint32 first_block_offset;
|
22
|
+
zsint32 last_block_offset;
|
23
|
+
zuint32 eof_marker;
|
24
|
+
) ZWarajevoTAPHeader;
|
25
|
+
|
26
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
27
|
+
zsint32 previous_block_offset;
|
28
|
+
zsint32 next_block_offset;
|
29
|
+
zuint16 data_size;
|
30
|
+
) ZWarajevoTAPBlockHeader;
|
31
|
+
|
32
|
+
#endif /* _Z_formats_storage_medium_image_audio_Warajevo_TAP_H_ */
|
@@ -0,0 +1,45 @@
|
|
1
|
+
/* Z Kit - formats/storage medium image/floppy disk/FDI.h
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_formats_storage_medium_image_floppy_disk_FDI_H_
|
9
|
+
#define _Z_formats_storage_medium_image_floppy_disk_FDI_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
|
13
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
14
|
+
zuint8 signature[3]; /* 'FDI' */
|
15
|
+
zuint8 write_protection;
|
16
|
+
zuint16 cylinder_count;
|
17
|
+
zuint16 head_count;
|
18
|
+
zuint16 disk_description_offset;
|
19
|
+
zuint16 data_offset;
|
20
|
+
zuint16 header_additional_information_size;
|
21
|
+
Z_FLEXIBLE_ARRAY_MEMBER(zuint8 additional_information[];)
|
22
|
+
) ZFDIHeader;
|
23
|
+
|
24
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
25
|
+
zuint8 cylinder;
|
26
|
+
zuint8 head;
|
27
|
+
zuint8 size;
|
28
|
+
|
29
|
+
struct {Z_BIT_FIELD(8, 3) (
|
30
|
+
zuint8 data_deleted: 1,
|
31
|
+
zuint8 zero: 1,
|
32
|
+
zuint8 crc_errors: 6
|
33
|
+
)} flags;
|
34
|
+
|
35
|
+
zuint16 offset;
|
36
|
+
) ZFDISectorEntry;
|
37
|
+
|
38
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
39
|
+
zuint32 data_offset;
|
40
|
+
zuint16 zero; /* Always 0000h */
|
41
|
+
zuint8 sector_count;
|
42
|
+
Z_FLEXIBLE_ARRAY_MEMBER(ZFDISectorEntry sectors_entries[];)
|
43
|
+
) ZFDITrackHeader;
|
44
|
+
|
45
|
+
#endif /* _Z_formats_storage_medium_image_floppy_disk_FDI_H_ */
|
@@ -0,0 +1,583 @@
|
|
1
|
+
/* Z Kit - functions/base/Z2D.h
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_functions_base_Z2D_H_
|
9
|
+
#define _Z_functions_base_Z2D_H_
|
10
|
+
|
11
|
+
#include <Z/functions/base/constructors.h>
|
12
|
+
#include <Z/functions/base/value.h>
|
13
|
+
|
14
|
+
|
15
|
+
/* MARK: - Common implementation */
|
16
|
+
|
17
|
+
|
18
|
+
#define Z_IMPLEMENTATION_COMMON(Type, type) \
|
19
|
+
\
|
20
|
+
static Z_INLINE \
|
21
|
+
Z2D##Type z_2d_##type##_add(Z2D##Type a, Z2D##Type b) \
|
22
|
+
{return z_2d_##type(a.x + b.x, a.y + b.y);} \
|
23
|
+
\
|
24
|
+
\
|
25
|
+
static Z_INLINE \
|
26
|
+
Z2D##Type z_2d_##type##_add_3(Z2D##Type a, Z2D##Type b, Z2D##Type c) \
|
27
|
+
{return z_2d_##type(a.x + b.x + c.x, a.y + b.y + c.y);} \
|
28
|
+
\
|
29
|
+
\
|
30
|
+
static Z_INLINE \
|
31
|
+
Z2D##Type z_2d_##type##_add_4(Z2D##Type a, Z2D##Type b, Z2D##Type c, Z2D##Type d) \
|
32
|
+
{return z_2d_##type(a.x + b.x + c.x + d.x, a.y + b.y + c.y + d.y);} \
|
33
|
+
\
|
34
|
+
\
|
35
|
+
static Z_INLINE \
|
36
|
+
Z2D##Type z_2d_##type##_add_scalar(Z2D##Type object, z##type scalar) \
|
37
|
+
{return z_2d_##type(object.x + scalar, object.y + scalar);} \
|
38
|
+
\
|
39
|
+
\
|
40
|
+
static Z_INLINE \
|
41
|
+
zboolean z_2d_##type##_are_equal(Z2D##Type a, Z2D##Type b) \
|
42
|
+
{return a.x == b.x && a.y == b.y;} \
|
43
|
+
\
|
44
|
+
\
|
45
|
+
static Z_INLINE \
|
46
|
+
Z2D##Type z_2d_##type##_clamp(Z2D##Type object, Z2D##Type minimum, Z2D##Type maximum) \
|
47
|
+
{ \
|
48
|
+
return z_2d_##type \
|
49
|
+
(z_##type##_clamp(object.x, minimum.x, maximum.x), \
|
50
|
+
z_##type##_clamp(object.y, minimum.y, maximum.y)); \
|
51
|
+
} \
|
52
|
+
\
|
53
|
+
\
|
54
|
+
/* Area of the parallelogram between two vectors (OA and OB) */ \
|
55
|
+
static Z_INLINE \
|
56
|
+
z##type z_2d_##type##_cross_product(Z2D##Type a, Z2D##Type b) \
|
57
|
+
{return a.x * b.y - a.y * b.x;} \
|
58
|
+
\
|
59
|
+
\
|
60
|
+
static Z_INLINE \
|
61
|
+
Z2D##Type z_2d_##type##_divide(Z2D##Type a, Z2D##Type b) \
|
62
|
+
{return z_2d_##type(a.x / b.x, a.y / b.y);} \
|
63
|
+
\
|
64
|
+
\
|
65
|
+
static Z_INLINE \
|
66
|
+
Z2D##Type z_2d_##type##_divide_3(Z2D##Type a, Z2D##Type b, Z2D##Type c) \
|
67
|
+
{return z_2d_##type(a.x / b.x / c.x, a.y / b.y / c.x);} \
|
68
|
+
\
|
69
|
+
\
|
70
|
+
static Z_INLINE \
|
71
|
+
Z2D##Type z_2d_##type##_divide_4(Z2D##Type a, Z2D##Type b, Z2D##Type c, Z2D##Type d) \
|
72
|
+
{return z_2d_##type(a.x / b.x / c.x / d.x, a.y / b.y / c.y / d.y);} \
|
73
|
+
\
|
74
|
+
\
|
75
|
+
static Z_INLINE \
|
76
|
+
Z2D##Type z_2d_##type##_divide_by_scalar(Z2D##Type object, z##type scalar) \
|
77
|
+
{return z_2d_##type(object.x / scalar, object.y / scalar);} \
|
78
|
+
\
|
79
|
+
\
|
80
|
+
static Z_INLINE \
|
81
|
+
z##type z_2d_##type##_dot_product(Z2D##Type a, Z2D##Type b) \
|
82
|
+
{return a.x * b.x + a.y * b.y;} \
|
83
|
+
\
|
84
|
+
\
|
85
|
+
static Z_INLINE \
|
86
|
+
Z2D##Type z_2d_##type##_fit(Z2D##Type object, Z2D##Type other) \
|
87
|
+
{ \
|
88
|
+
return object.y / object.x > other.y / other.x \
|
89
|
+
? z_2d_##type(object.x * other.y / object.y, other.y) \
|
90
|
+
: z_2d_##type(other.x, object.y * other.x / object.x); \
|
91
|
+
} \
|
92
|
+
\
|
93
|
+
\
|
94
|
+
static Z_INLINE \
|
95
|
+
Z2D##Type z_2d_##type##_from_scalar(z##type scalar) \
|
96
|
+
{return z_2d_##type(scalar, scalar);} \
|
97
|
+
\
|
98
|
+
\
|
99
|
+
static Z_INLINE \
|
100
|
+
zboolean z_2d_##type##_has_zero(Z2D##Type object) \
|
101
|
+
{return object.x == (z##type)0 || object.y == (z##type)0;} \
|
102
|
+
\
|
103
|
+
\
|
104
|
+
static Z_INLINE \
|
105
|
+
z##type z_2d_##type##_inner_maximum(Z2D##Type object) \
|
106
|
+
{return z_##type##_maximum(object.x, object.y);} \
|
107
|
+
\
|
108
|
+
\
|
109
|
+
static Z_INLINE \
|
110
|
+
z##type z_2d_##type##_inner_middle(Z2D##Type object) \
|
111
|
+
{return (object.x + object.y) / (z##type)2;} \
|
112
|
+
\
|
113
|
+
\
|
114
|
+
static Z_INLINE \
|
115
|
+
z##type z_2d_##type##_inner_minimum(Z2D##Type object) \
|
116
|
+
{return z_##type##_minimum(object.x, object.y);} \
|
117
|
+
\
|
118
|
+
\
|
119
|
+
static Z_INLINE \
|
120
|
+
z##type z_2d_##type##_inner_product(Z2D##Type object) \
|
121
|
+
{return object.x * object.y;} \
|
122
|
+
\
|
123
|
+
\
|
124
|
+
static Z_INLINE \
|
125
|
+
z##type z_2d_##type##_inner_sum(Z2D##Type object) \
|
126
|
+
{return object.x + object.y;} \
|
127
|
+
\
|
128
|
+
\
|
129
|
+
static Z_INLINE \
|
130
|
+
zboolean z_2d_##type##_is_zero(Z2D##Type object) \
|
131
|
+
{return object.x == (z##type)0 && object.y == (z##type)0;} \
|
132
|
+
\
|
133
|
+
\
|
134
|
+
static Z_INLINE \
|
135
|
+
Z2D##Type z_2d_##type##_maximum(Z2D##Type a, Z2D##Type b) \
|
136
|
+
{return z_2d_##type(z_##type##_maximum(a.x, b.x), z_##type##_maximum(a.y, b.y));} \
|
137
|
+
\
|
138
|
+
\
|
139
|
+
static Z_INLINE \
|
140
|
+
Z2D##Type z_2d_##type##_middle(Z2D##Type a, Z2D##Type b) \
|
141
|
+
{return z_2d_##type((a.x + b.x) / (z##type)2, (a.y + b.y) / (z##type)2);} \
|
142
|
+
\
|
143
|
+
\
|
144
|
+
static Z_INLINE \
|
145
|
+
Z2D##Type z_2d_##type##_minimum(Z2D##Type a, Z2D##Type b) \
|
146
|
+
{return z_2d_##type(z_##type##_minimum(a.x, b.x), z_##type##_minimum(a.y, b.y));} \
|
147
|
+
\
|
148
|
+
\
|
149
|
+
static Z_INLINE \
|
150
|
+
Z2D##Type z_2d_##type##_multiply(Z2D##Type a, Z2D##Type b) \
|
151
|
+
{return z_2d_##type(a.x * b.x, a.y * b.y);} \
|
152
|
+
\
|
153
|
+
\
|
154
|
+
static Z_INLINE \
|
155
|
+
Z2D##Type z_2d_##type##_multiply_3(Z2D##Type a, Z2D##Type b, Z2D##Type c) \
|
156
|
+
{return z_2d_##type(a.x * b.x * c.x, a.y * b.y * c.y);} \
|
157
|
+
\
|
158
|
+
\
|
159
|
+
static Z_INLINE \
|
160
|
+
Z2D##Type z_2d_##type##_multiply_4(Z2D##Type a, Z2D##Type b, Z2D##Type c, Z2D##Type d) \
|
161
|
+
{return z_2d_##type(a.x * b.x * c.x * d.x, a.y * b.y * c.y * d.y);} \
|
162
|
+
\
|
163
|
+
\
|
164
|
+
static Z_INLINE \
|
165
|
+
Z2D##Type z_2d_##type##_multiply_by_scalar(Z2D##Type object, z##type scalar) \
|
166
|
+
{return z_2d_##type(object.x * scalar, object.y * scalar);} \
|
167
|
+
\
|
168
|
+
\
|
169
|
+
static Z_INLINE \
|
170
|
+
Z3D##Type z_2d_##type##_nxy(Z2D##Type object, z##type n) \
|
171
|
+
{return z_3d_##type(n, object.x, object.y);} \
|
172
|
+
\
|
173
|
+
\
|
174
|
+
static Z_INLINE \
|
175
|
+
Z3D##Type z_2d_##type##_nyx(Z2D##Type object, z##type n) \
|
176
|
+
{return z_3d_##type(n, object.y, object.x);} \
|
177
|
+
\
|
178
|
+
\
|
179
|
+
static Z_INLINE \
|
180
|
+
Z2D##Type z_2d_##type##_square_clamp(Z2D##Type object, z##type minimum,z##type maximum) \
|
181
|
+
{ \
|
182
|
+
return z_2d_##type \
|
183
|
+
(z_##type##_clamp(object.x, minimum, maximum), \
|
184
|
+
z_##type##_clamp(object.y, minimum, maximum)); \
|
185
|
+
} \
|
186
|
+
\
|
187
|
+
\
|
188
|
+
static Z_INLINE \
|
189
|
+
z##type z_2d_##type##_squared_length(Z2D##Type object) \
|
190
|
+
{return object.x * object.x + object.y * object.y;} \
|
191
|
+
\
|
192
|
+
\
|
193
|
+
static Z_INLINE \
|
194
|
+
Z2D##Type z_2d_##type##_subtract(Z2D##Type a, Z2D##Type b) \
|
195
|
+
{return z_2d_##type(a.x - b.x, a.y - b.y);} \
|
196
|
+
\
|
197
|
+
\
|
198
|
+
static Z_INLINE \
|
199
|
+
Z2D##Type z_2d_##type##_subtract_3(Z2D##Type a, Z2D##Type b, Z2D##Type c) \
|
200
|
+
{return z_2d_##type(a.x - b.x - c.x, a.y - b.y - c.y);} \
|
201
|
+
\
|
202
|
+
\
|
203
|
+
static Z_INLINE \
|
204
|
+
Z2D##Type z_2d_##type##_subtract_4(Z2D##Type a, Z2D##Type b, Z2D##Type c, Z2D##Type d) \
|
205
|
+
{return z_2d_##type(a.x - b.x - c.x - d.x, a.y - b.y - c.y - d.y);} \
|
206
|
+
\
|
207
|
+
\
|
208
|
+
static Z_INLINE \
|
209
|
+
Z2D##Type z_2d_##type##_subtract_scalar(Z2D##Type object, z##type scalar) \
|
210
|
+
{return z_2d_##type(object.x - scalar, object.y - scalar);} \
|
211
|
+
\
|
212
|
+
\
|
213
|
+
static Z_INLINE \
|
214
|
+
void z_2d_##type##_swap(Z2D##Type *a, Z2D##Type *b) \
|
215
|
+
{ \
|
216
|
+
Z2D##Type t = *a; \
|
217
|
+
\
|
218
|
+
*a = *b; *b = t; \
|
219
|
+
} \
|
220
|
+
\
|
221
|
+
\
|
222
|
+
static Z_INLINE \
|
223
|
+
Z3D##Type z_2d_##type##_xny(Z2D##Type object, z##type n) \
|
224
|
+
{return z_3d_##type(object.x, n, object.y);} \
|
225
|
+
\
|
226
|
+
\
|
227
|
+
static Z_INLINE \
|
228
|
+
Z3D##Type z_2d_##type##_xyn(Z2D##Type object, z##type n) \
|
229
|
+
{return z_3d_##type(object.x, object.y, n);} \
|
230
|
+
\
|
231
|
+
\
|
232
|
+
static Z_INLINE \
|
233
|
+
Z3D##Type z_2d_##type##_ynx(Z2D##Type object, z##type n) \
|
234
|
+
{return z_3d_##type(object.y, n, object.x);} \
|
235
|
+
\
|
236
|
+
\
|
237
|
+
static Z_INLINE \
|
238
|
+
Z2D##Type z_2d_##type##_yx(Z2D##Type object) \
|
239
|
+
{return z_2d_##type(object.y, object.x);} \
|
240
|
+
\
|
241
|
+
\
|
242
|
+
static Z_INLINE \
|
243
|
+
Z3D##Type z_2d_##type##_yxn(Z2D##Type object, z##type n) \
|
244
|
+
{return z_3d_##type(object.y, object.x, n);}
|
245
|
+
|
246
|
+
|
247
|
+
#define z_2d_type_add( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _add )
|
248
|
+
#define z_2d_type_add_3( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _add_3 )
|
249
|
+
#define z_2d_type_add_4( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _add_4 )
|
250
|
+
#define z_2d_type_add_scalar( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _add_scalar )
|
251
|
+
#define z_2d_type_are_equal( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _are_equal )
|
252
|
+
#define z_2d_type_clamp( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _clamp )
|
253
|
+
#define z_2d_type_cross_product( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _cross_product )
|
254
|
+
#define z_2d_type_divide( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _divide )
|
255
|
+
#define z_2d_type_divide_3( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _divide_3 )
|
256
|
+
#define z_2d_type_divide_4( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _divide_4 )
|
257
|
+
#define z_2d_type_divide_by_scalar( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _divide_by_scalar )
|
258
|
+
#define z_2d_type_dot_product( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _dot_product )
|
259
|
+
#define z_2d_type_fit( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _fit )
|
260
|
+
#define z_2d_type_from_scalar( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _from_scalar )
|
261
|
+
#define z_2d_type_has_zero( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _has_zero )
|
262
|
+
#define z_2d_type_inner_maximum( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _inner_maximum )
|
263
|
+
#define z_2d_type_inner_middle( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _inner_middle )
|
264
|
+
#define z_2d_type_inner_minimum( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _inner_minimum )
|
265
|
+
#define z_2d_type_inner_product( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _inner_product )
|
266
|
+
#define z_2d_type_inner_sum( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _inner_sum )
|
267
|
+
#define z_2d_type_is_zero( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _is_zero )
|
268
|
+
#define z_2d_type_maximum( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _maximum )
|
269
|
+
#define z_2d_type_middle( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _middle )
|
270
|
+
#define z_2d_type_minimum( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _minimum )
|
271
|
+
#define z_2d_type_multiply( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _multiply )
|
272
|
+
#define z_2d_type_multiply_3( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _multiply_3 )
|
273
|
+
#define z_2d_type_multiply_4( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _multiply_4 )
|
274
|
+
#define z_2d_type_multiply_by_scalar(TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _multiply_by_scalar)
|
275
|
+
#define z_2d_type_nxy( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _nxy )
|
276
|
+
#define z_2d_type_nyx( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _nyx )
|
277
|
+
#define z_2d_type_square_clamp( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _square_clamp )
|
278
|
+
#define z_2d_type_squared_length( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _squared_length )
|
279
|
+
#define z_2d_type_subtract( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _subtract )
|
280
|
+
#define z_2d_type_subtract_3( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _subtract_3 )
|
281
|
+
#define z_2d_type_subtract_4( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _subtract_4 )
|
282
|
+
#define z_2d_type_subtract_scalar( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _subtract_scalar )
|
283
|
+
#define z_2d_type_swap( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _swap )
|
284
|
+
#define z_2d_type_xny( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _xny )
|
285
|
+
#define z_2d_type_xyn( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _xyn )
|
286
|
+
#define z_2d_type_ynx( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _ynx )
|
287
|
+
#define z_2d_type_yx( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _yx )
|
288
|
+
#define z_2d_type_yxn( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _yxn )
|
289
|
+
|
290
|
+
|
291
|
+
/* MARK: - Partial implementation for signed types */
|
292
|
+
|
293
|
+
|
294
|
+
#define Z_IMPLEMENTATION_SIGNED(Type, type) \
|
295
|
+
\
|
296
|
+
static Z_INLINE \
|
297
|
+
Z2D##Type z_2d_##type##_absolute(Z2D##Type object) \
|
298
|
+
{return z_2d_##type(z_##type##_absolute(object.x), z_##type##_absolute(object.y));} \
|
299
|
+
\
|
300
|
+
\
|
301
|
+
static Z_INLINE \
|
302
|
+
zboolean z_2d_##type##_has_negative(Z2D##Type object) \
|
303
|
+
{return object.x < (z##type)0 || object.y < (z##type)0;} \
|
304
|
+
\
|
305
|
+
\
|
306
|
+
static Z_INLINE \
|
307
|
+
zboolean z_2d_##type##_is_negative(Z2D##Type object) \
|
308
|
+
{return object.x < (z##type)0 && object.y < (z##type)0;} \
|
309
|
+
\
|
310
|
+
\
|
311
|
+
static Z_INLINE \
|
312
|
+
Z2D##Type z_2d_##type##_negative(Z2D##Type object) \
|
313
|
+
{return z_2d_##type(-object.x, -object.y);}
|
314
|
+
|
315
|
+
|
316
|
+
#define z_2d_type_absolute( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _absolute )
|
317
|
+
#define z_2d_type_has_negative(TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _has_negative)
|
318
|
+
#define z_2d_type_is_negative( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _is_negative )
|
319
|
+
#define z_2d_type_negative( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _negative )
|
320
|
+
|
321
|
+
|
322
|
+
/* MARK: - Partial implementation for integer types */
|
323
|
+
|
324
|
+
|
325
|
+
#define Z_IMPLEMENTATION_INTEGER(Type, type) \
|
326
|
+
\
|
327
|
+
static Z_INLINE \
|
328
|
+
zboolean z_2d_##type##_are_perpendicular(Z2D##Type a, Z2D##Type b) \
|
329
|
+
{return !z_##type##_absolute(z_2d_##type##_dot_product(a, b));}
|
330
|
+
|
331
|
+
|
332
|
+
#define z_2d_type_are_perpendicular(TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _are_perpendicular)
|
333
|
+
|
334
|
+
|
335
|
+
/* MARK: - Partial implementation for real types */
|
336
|
+
|
337
|
+
|
338
|
+
#define Z_IMPLEMENTATION_REAL(Type, type, epsilon) \
|
339
|
+
\
|
340
|
+
static Z_INLINE \
|
341
|
+
zboolean z_2d_##type##_are_almost_equal(Z2D##Type a, Z2D##Type b) \
|
342
|
+
{return z_##type##_are_almost_equal(a.x, b.x) && z_##type##_are_almost_equal(a.y, b.y);}\
|
343
|
+
\
|
344
|
+
\
|
345
|
+
static Z_INLINE \
|
346
|
+
zboolean z_2d_##type##_are_perpendicular(Z2D##Type a, Z2D##Type b) \
|
347
|
+
{return z_##type##_absolute(z_2d_##type##_dot_product(a, b)) <= epsilon;} \
|
348
|
+
\
|
349
|
+
\
|
350
|
+
static Z_INLINE \
|
351
|
+
Z2D##Type z_2d_##type##_clamp_01(Z2D##Type object) \
|
352
|
+
{return z_2d_##type(z_##type##_clamp_01(object.x), z_##type##_clamp_01(object.y));} \
|
353
|
+
\
|
354
|
+
\
|
355
|
+
static Z_INLINE \
|
356
|
+
zboolean z_2d_##type##_has_almost_zero(Z2D##Type object) \
|
357
|
+
{return z_##type##_is_almost_zero(object.x) || z_##type##_is_almost_zero(object.y);} \
|
358
|
+
\
|
359
|
+
\
|
360
|
+
static Z_INLINE \
|
361
|
+
zboolean z_2d_##type##_has_finite(Z2D##Type object) \
|
362
|
+
{return z_##type##_is_finite(object.x) || z_##type##_is_finite(object.y);} \
|
363
|
+
\
|
364
|
+
\
|
365
|
+
static Z_INLINE \
|
366
|
+
zboolean z_2d_##type##_has_infinity(Z2D##Type object) \
|
367
|
+
{return z_##type##_is_infinity(object.x) || z_##type##_is_infinity(object.y);} \
|
368
|
+
\
|
369
|
+
\
|
370
|
+
static Z_INLINE \
|
371
|
+
zboolean z_2d_##type##_has_nan(Z2D##Type object) \
|
372
|
+
{return z_##type##_is_nan(object.x) || z_##type##_is_nan(object.y);} \
|
373
|
+
\
|
374
|
+
\
|
375
|
+
static Z_INLINE \
|
376
|
+
Z2D##Type z_2d_##type##_inverse_lerp(Z2D##Type a, Z2D##Type b, z##type t) \
|
377
|
+
{ \
|
378
|
+
return z_2d_##type \
|
379
|
+
(z_##type##_inverse_lerp(a.x, b.x, t), z_##type##_inverse_lerp(a.y, b.y, t)); \
|
380
|
+
} \
|
381
|
+
\
|
382
|
+
\
|
383
|
+
static Z_INLINE \
|
384
|
+
zboolean z_2d_##type##_is_almost_zero(Z2D##Type object) \
|
385
|
+
{return z_##type##_is_almost_zero(object.x) && z_##type##_is_almost_zero(object.y);} \
|
386
|
+
\
|
387
|
+
\
|
388
|
+
static Z_INLINE \
|
389
|
+
zboolean z_2d_##type##_is_finite(Z2D##Type object) \
|
390
|
+
{return z_##type##_is_finite(object.x) && z_##type##_is_finite(object.y);} \
|
391
|
+
\
|
392
|
+
\
|
393
|
+
static Z_INLINE \
|
394
|
+
zboolean z_2d_##type##_is_infinity(Z2D##Type object) \
|
395
|
+
{return z_##type##_is_infinity(object.x) && z_##type##_is_infinity(object.y);} \
|
396
|
+
\
|
397
|
+
\
|
398
|
+
static Z_INLINE \
|
399
|
+
zboolean z_2d_##type##_is_nan(Z2D##Type object) \
|
400
|
+
{return z_##type##_is_nan(object.x) && z_##type##_is_nan(object.y);} \
|
401
|
+
\
|
402
|
+
\
|
403
|
+
static Z_INLINE \
|
404
|
+
Z2D##Type z_2d_##type##_lerp(Z2D##Type a, Z2D##Type b, z##type t) \
|
405
|
+
{return z_2d_##type(z_##type##_lerp(a.x, b.x, t), z_##type##_lerp(a.y, b.y, t));} \
|
406
|
+
\
|
407
|
+
\
|
408
|
+
static Z_INLINE \
|
409
|
+
Z2D##Type z_2d_##type##_reciprocal(Z2D##Type object) \
|
410
|
+
{return z_2d_##type(((z##type)1) / object.x, ((z##type)1) / object.y);}
|
411
|
+
|
412
|
+
|
413
|
+
#define z_2d_type_are_almost_equal(TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _are_almost_equal)
|
414
|
+
#define z_2d_type_clamp_01( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _clamp_01 )
|
415
|
+
#define z_2d_type_has_almost_zero( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _has_almost_zero )
|
416
|
+
#define z_2d_type_has_finite( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _has_finite )
|
417
|
+
#define z_2d_type_has_infinity( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _has_infinity )
|
418
|
+
#define z_2d_type_has_nan( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _has_nan )
|
419
|
+
#define z_2d_type_inverse_lerp( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _inverse_lerp )
|
420
|
+
#define z_2d_type_is_almost_zero( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _is_almost_zero )
|
421
|
+
#define z_2d_type_is_finite( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _is_finite )
|
422
|
+
#define z_2d_type_is_infinity( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _is_infinity )
|
423
|
+
#define z_2d_type_is_nan( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _is_nan )
|
424
|
+
#define z_2d_type_lerp( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _lerp )
|
425
|
+
#define z_2d_type_reciprocal( TYPE) Z_INSERT_##TYPE##_fixed_type(z_2d_, _reciprocal )
|
426
|
+
|
427
|
+
|
428
|
+
/* MARK: - Implementation expansions */
|
429
|
+
|
430
|
+
|
431
|
+
Z_IMPLEMENTATION_COMMON (UInt8, uint8 )
|
432
|
+
Z_IMPLEMENTATION_COMMON (SInt8, sint8 )
|
433
|
+
Z_IMPLEMENTATION_SIGNED (SInt8, sint8 )
|
434
|
+
Z_IMPLEMENTATION_INTEGER(SInt8, sint8 )
|
435
|
+
Z_IMPLEMENTATION_COMMON (UInt16, uint16)
|
436
|
+
Z_IMPLEMENTATION_COMMON (SInt16, sint16)
|
437
|
+
Z_IMPLEMENTATION_SIGNED (SInt16, sint16)
|
438
|
+
Z_IMPLEMENTATION_INTEGER(SInt16, sint16)
|
439
|
+
Z_IMPLEMENTATION_COMMON (UInt32, uint32)
|
440
|
+
Z_IMPLEMENTATION_COMMON (SInt32, sint32)
|
441
|
+
Z_IMPLEMENTATION_SIGNED (SInt32, sint32)
|
442
|
+
Z_IMPLEMENTATION_INTEGER(SInt32, sint32)
|
443
|
+
|
444
|
+
#ifdef Z_UINT64
|
445
|
+
Z_IMPLEMENTATION_COMMON(UInt64, uint64)
|
446
|
+
#endif
|
447
|
+
|
448
|
+
#ifdef Z_SINT64
|
449
|
+
Z_IMPLEMENTATION_COMMON (SInt64, sint64)
|
450
|
+
Z_IMPLEMENTATION_SIGNED (SInt64, sint64)
|
451
|
+
Z_IMPLEMENTATION_INTEGER(SInt64, sint64)
|
452
|
+
#endif
|
453
|
+
|
454
|
+
#ifdef Z_UINT128
|
455
|
+
Z_IMPLEMENTATION_COMMON(UInt128, uint128)
|
456
|
+
#endif
|
457
|
+
|
458
|
+
#ifdef Z_SINT128
|
459
|
+
Z_IMPLEMENTATION_COMMON (SInt128, sint128)
|
460
|
+
Z_IMPLEMENTATION_SIGNED (SInt128, sint128)
|
461
|
+
Z_IMPLEMENTATION_INTEGER(SInt128, sint128)
|
462
|
+
#endif
|
463
|
+
|
464
|
+
#ifdef Z_FLOAT16
|
465
|
+
Z_IMPLEMENTATION_COMMON(Float16, float16)
|
466
|
+
Z_IMPLEMENTATION_SIGNED(Float16, float16)
|
467
|
+
Z_IMPLEMENTATION_REAL (Float16, float16, Z_FLOAT16_EPSILON)
|
468
|
+
#endif
|
469
|
+
|
470
|
+
#ifdef Z_FLOAT32
|
471
|
+
Z_IMPLEMENTATION_COMMON(Float32, float32)
|
472
|
+
Z_IMPLEMENTATION_SIGNED(Float32, float32)
|
473
|
+
Z_IMPLEMENTATION_REAL (Float32, float32, Z_FLOAT32_EPSILON)
|
474
|
+
#endif
|
475
|
+
|
476
|
+
#ifdef Z_FLOAT64
|
477
|
+
Z_IMPLEMENTATION_COMMON(Float64, float64)
|
478
|
+
Z_IMPLEMENTATION_SIGNED(Float64, float64)
|
479
|
+
Z_IMPLEMENTATION_REAL (Float64, float64, Z_FLOAT64_EPSILON)
|
480
|
+
#endif
|
481
|
+
|
482
|
+
#ifdef Z_FLOAT128
|
483
|
+
Z_IMPLEMENTATION_COMMON(Float128, float128)
|
484
|
+
Z_IMPLEMENTATION_SIGNED(Float128, float128)
|
485
|
+
Z_IMPLEMENTATION_REAL (Float128, float128, Z_FLOAT128_EPSILON)
|
486
|
+
#endif
|
487
|
+
|
488
|
+
#ifdef Z_FLOAT80_X87
|
489
|
+
Z_IMPLEMENTATION_COMMON(Float80_x87, float80_x87)
|
490
|
+
Z_IMPLEMENTATION_SIGNED(Float80_x87, float80_x87)
|
491
|
+
Z_IMPLEMENTATION_REAL (Float80_x87, float80_x87, Z_FLOAT80_X87_EPSILON)
|
492
|
+
#endif
|
493
|
+
|
494
|
+
#ifdef Z_FLOAT96_X87
|
495
|
+
Z_IMPLEMENTATION_COMMON(Float96_x87, float96_x87)
|
496
|
+
Z_IMPLEMENTATION_SIGNED(Float96_x87, float96_x87)
|
497
|
+
Z_IMPLEMENTATION_REAL (Float96_x87, float96_x87, Z_FLOAT96_X87_EPSILON)
|
498
|
+
#endif
|
499
|
+
|
500
|
+
#ifdef Z_FLOAT128_X87
|
501
|
+
Z_IMPLEMENTATION_COMMON(Float128_x87, float128_x87)
|
502
|
+
Z_IMPLEMENTATION_SIGNED(Float128_x87, float128_x87)
|
503
|
+
Z_IMPLEMENTATION_REAL (Float128_x87, float128_x87, Z_FLOAT128_X87_EPSILON)
|
504
|
+
#endif
|
505
|
+
|
506
|
+
|
507
|
+
/* MARK: - Cleanup */
|
508
|
+
|
509
|
+
|
510
|
+
#undef Z_IMPLEMENTATION_COMMON
|
511
|
+
#undef Z_IMPLEMENTATION_SIGNED
|
512
|
+
#undef Z_IMPLEMENTATION_INTEGER
|
513
|
+
#undef Z_IMPLEMENTATION_REAL
|
514
|
+
|
515
|
+
|
516
|
+
/* MARK: - Default real type definitions */
|
517
|
+
|
518
|
+
|
519
|
+
#ifdef Z_REAL
|
520
|
+
# define z_2d_absolute z_2d_type_absolute (REAL)
|
521
|
+
# define z_2d_add z_2d_type_add (REAL)
|
522
|
+
# define z_2d_add_3 z_2d_type_add_3 (REAL)
|
523
|
+
# define z_2d_add_4 z_2d_type_add_4 (REAL)
|
524
|
+
# define z_2d_add_scalar z_2d_type_add_scalar (REAL)
|
525
|
+
# define z_2d_are_almost_equal z_2d_type_are_almost_equal (REAL)
|
526
|
+
# define z_2d_are_equal z_2d_type_are_equal (REAL)
|
527
|
+
# define z_2d_are_perpendicular z_2d_type_are_perpendicular (REAL)
|
528
|
+
# define z_2d_clamp z_2d_type_clamp (REAL)
|
529
|
+
# define z_2d_clamp_01 z_2d_type_clamp_01 (REAL)
|
530
|
+
# define z_2d_cross_product z_2d_type_cross_product (REAL)
|
531
|
+
# define z_2d_divide z_2d_type_divide (REAL)
|
532
|
+
# define z_2d_divide_3 z_2d_type_divide_3 (REAL)
|
533
|
+
# define z_2d_divide_4 z_2d_type_divide_4 (REAL)
|
534
|
+
# define z_2d_divide_by_scalar z_2d_type_divide_by_scalar (REAL)
|
535
|
+
# define z_2d_dot_product z_2d_type_dot_product (REAL)
|
536
|
+
# define z_2d_fit z_2d_type_fit (REAL)
|
537
|
+
# define z_2d_from_scalar z_2d_type_from_scalar (REAL)
|
538
|
+
# define z_2d_has_almost_zero z_2d_type_has_almost_zero (REAL)
|
539
|
+
# define z_2d_has_finite z_2d_type_has_finite (REAL)
|
540
|
+
# define z_2d_has_infinity z_2d_type_has_infinity (REAL)
|
541
|
+
# define z_2d_has_nan z_2d_type_has_nan (REAL)
|
542
|
+
# define z_2d_has_negative z_2d_type_has_negative (REAL)
|
543
|
+
# define z_2d_has_zero z_2d_type_has_zero (REAL)
|
544
|
+
# define z_2d_inner_maximum z_2d_type_inner_maximum (REAL)
|
545
|
+
# define z_2d_inner_middle z_2d_type_inner_middle (REAL)
|
546
|
+
# define z_2d_inner_minimum z_2d_type_inner_minimum (REAL)
|
547
|
+
# define z_2d_inner_product z_2d_type_inner_product (REAL)
|
548
|
+
# define z_2d_inner_sum z_2d_type_inner_sum (REAL)
|
549
|
+
# define z_2d_inverse_lerp z_2d_type_inverse_lerp (REAL)
|
550
|
+
# define z_2d_is_almost_zero z_2d_type_is_almost_zero (REAL)
|
551
|
+
# define z_2d_is_finite z_2d_type_is_finite (REAL)
|
552
|
+
# define z_2d_is_infinity z_2d_type_is_infinity (REAL)
|
553
|
+
# define z_2d_is_nan z_2d_type_is_nan (REAL)
|
554
|
+
# define z_2d_is_negative z_2d_type_is_negative (REAL)
|
555
|
+
# define z_2d_is_zero z_2d_type_is_zero (REAL)
|
556
|
+
# define z_2d_lerp z_2d_type_lerp (REAL)
|
557
|
+
# define z_2d_maximum z_2d_type_maximum (REAL)
|
558
|
+
# define z_2d_middle z_2d_type_middle (REAL)
|
559
|
+
# define z_2d_minimum z_2d_type_minimum (REAL)
|
560
|
+
# define z_2d_multiply z_2d_type_multiply (REAL)
|
561
|
+
# define z_2d_multiply_3 z_2d_type_multiply_3 (REAL)
|
562
|
+
# define z_2d_multiply_4 z_2d_type_multiply_4 (REAL)
|
563
|
+
# define z_2d_multiply_by_scalar z_2d_type_multiply_by_scalar(REAL)
|
564
|
+
# define z_2d_negative z_2d_type_negative (REAL)
|
565
|
+
# define z_2d_nxy z_2d_type_nxy (REAL)
|
566
|
+
# define z_2d_nyx z_2d_type_nyx (REAL)
|
567
|
+
# define z_2d_reciprocal z_2d_type_reciprocal (REAL)
|
568
|
+
# define z_2d_square_clamp z_2d_type_square_clamp (REAL)
|
569
|
+
# define z_2d_squared_length z_2d_type_squared_length (REAL)
|
570
|
+
# define z_2d_subtract z_2d_type_subtract (REAL)
|
571
|
+
# define z_2d_subtract_3 z_2d_type_subtract_3 (REAL)
|
572
|
+
# define z_2d_subtract_4 z_2d_type_subtract_4 (REAL)
|
573
|
+
# define z_2d_subtract_scalar z_2d_type_subtract_scalar (REAL)
|
574
|
+
# define z_2d_swap z_2d_type_swap (REAL)
|
575
|
+
# define z_2d_xny z_2d_type_xny (REAL)
|
576
|
+
# define z_2d_xyn z_2d_type_xyn (REAL)
|
577
|
+
# define z_2d_ynx z_2d_type_ynx (REAL)
|
578
|
+
# define z_2d_yx z_2d_type_yx (REAL)
|
579
|
+
# define z_2d_yxn z_2d_type_yxn (REAL)
|
580
|
+
#endif
|
581
|
+
|
582
|
+
|
583
|
+
#endif /* _Z_functions_base_Z2D_H_ */
|