zemu 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/src/debug.c
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
#include "debug.h"
|
2
|
+
|
3
|
+
RunState zemu_debug_state = UNDEFINED;
|
4
|
+
|
5
|
+
/* Currently, the number of breakpoints is defined statically.
|
6
|
+
* Perhaps in future there will be an unlimited number.
|
7
|
+
*/
|
8
|
+
zuint16 breakpoints[ZEMU_DEBUG_MAX_BREAKPOINTS];
|
9
|
+
unsigned int breakpoint_count = 0;
|
10
|
+
|
11
|
+
zusize zemu_debug_continue(Z80 * instance)
|
12
|
+
{
|
13
|
+
/* Return if we've halted. */
|
14
|
+
if (zemu_debug_state == HALTED) return 0;
|
15
|
+
|
16
|
+
zusize cycles = 0;
|
17
|
+
|
18
|
+
zemu_debug_state = RUNNING;
|
19
|
+
|
20
|
+
while (zemu_debug_state == RUNNING)
|
21
|
+
{
|
22
|
+
cycles += zemu_debug_step(instance);
|
23
|
+
|
24
|
+
/* See if the Program Counter now matches any address
|
25
|
+
* in the breakpoint array.
|
26
|
+
*/
|
27
|
+
for (unsigned int b = 0; b < breakpoint_count; b++)
|
28
|
+
{
|
29
|
+
if (instance->state.pc == breakpoints[b])
|
30
|
+
{
|
31
|
+
zemu_debug_state = BREAK;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
return cycles;
|
37
|
+
}
|
38
|
+
|
39
|
+
zusize zemu_debug_step(Z80 * instance)
|
40
|
+
{
|
41
|
+
/* Will run for at least one cycle. */
|
42
|
+
zusize cycles = z80_run(instance, 1);
|
43
|
+
|
44
|
+
return cycles;
|
45
|
+
}
|
46
|
+
|
47
|
+
void zemu_debug_halt(void * context, zboolean state)
|
48
|
+
{
|
49
|
+
if (state)
|
50
|
+
{
|
51
|
+
zemu_debug_state = HALTED;
|
52
|
+
}
|
53
|
+
else
|
54
|
+
{
|
55
|
+
zemu_debug_state = RUNNING;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
void zemu_debug_set_breakpoint(zuint16 address)
|
60
|
+
{
|
61
|
+
breakpoints[breakpoint_count] = address;
|
62
|
+
breakpoint_count++;
|
63
|
+
}
|
64
|
+
|
65
|
+
zuint16 zemu_debug_register(Z80 * instance, zuint16 r)
|
66
|
+
{
|
67
|
+
switch (r)
|
68
|
+
{
|
69
|
+
/* Special purpose registers. */
|
70
|
+
case 0: return instance->state.pc;
|
71
|
+
case 1: return instance->state.sp;
|
72
|
+
case 2: return instance->state.iy.value_uint16;
|
73
|
+
case 3: return instance->state.ix.value_uint16;
|
74
|
+
|
75
|
+
/* Main register set, 8-bit format. */
|
76
|
+
case 4: return instance->state.af.values_uint8.index1;
|
77
|
+
case 5: return instance->state.af.values_uint8.index0;
|
78
|
+
|
79
|
+
case 6: return instance->state.bc.values_uint8.index1;
|
80
|
+
case 7: return instance->state.bc.values_uint8.index0;
|
81
|
+
|
82
|
+
case 8: return instance->state.de.values_uint8.index1;
|
83
|
+
case 9: return instance->state.de.values_uint8.index0;
|
84
|
+
|
85
|
+
case 10: return instance->state.hl.values_uint8.index1;
|
86
|
+
case 11: return instance->state.hl.values_uint8.index0;
|
87
|
+
|
88
|
+
/* Alternate register set, 8-bit format. */
|
89
|
+
case 12: return instance->state.af_.values_uint8.index1;
|
90
|
+
case 13: return instance->state.af_.values_uint8.index0;
|
91
|
+
|
92
|
+
case 14: return instance->state.bc_.values_uint8.index1;
|
93
|
+
case 15: return instance->state.bc_.values_uint8.index0;
|
94
|
+
|
95
|
+
case 16: return instance->state.de_.values_uint8.index1;
|
96
|
+
case 17: return instance->state.de_.values_uint8.index0;
|
97
|
+
|
98
|
+
case 18: return instance->state.hl_.values_uint8.index1;
|
99
|
+
case 19: return instance->state.hl_.values_uint8.index0;
|
100
|
+
|
101
|
+
default: return 0xFFFF;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
zboolean zemu_debug_halted(void)
|
106
|
+
{
|
107
|
+
return (zemu_debug_state == HALTED);
|
108
|
+
}
|
109
|
+
|
110
|
+
zboolean zemu_debug_break(void)
|
111
|
+
{
|
112
|
+
return (zemu_debug_state == BREAK);
|
113
|
+
}
|
114
|
+
|
115
|
+
zuint8 zemu_debug_get_memory(zuint16 address)
|
116
|
+
{
|
117
|
+
return zemu_memory_peek(address);
|
118
|
+
}
|
data/src/debug.h
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
#include "emulation/CPU/Z80.h"
|
2
|
+
|
3
|
+
#include <stdio.h>
|
4
|
+
|
5
|
+
#include "memory.h"
|
6
|
+
|
7
|
+
/* Define number of breakpoints, if not done so already. */
|
8
|
+
#ifndef ZEMU_DEBUG_MAX_BREAKPOINTS
|
9
|
+
#define ZEMU_DEBUG_MAX_BREAKPOINTS 256
|
10
|
+
#endif
|
11
|
+
|
12
|
+
typedef enum RunState
|
13
|
+
{
|
14
|
+
RUNNING,
|
15
|
+
HALTED,
|
16
|
+
BREAK,
|
17
|
+
UNDEFINED
|
18
|
+
} RunState;
|
19
|
+
|
20
|
+
zusize zemu_debug_continue(Z80 * instance);
|
21
|
+
|
22
|
+
zusize zemu_debug_step(Z80 * instance);
|
23
|
+
|
24
|
+
void zemu_debug_halt(void * context, zboolean state);
|
25
|
+
|
26
|
+
zboolean zemu_debug_halted(void);
|
27
|
+
|
28
|
+
void zemu_debug_set_breakpoint(zuint16 address);
|
29
|
+
|
30
|
+
zuint16 zemu_debug_register(Z80 * instance, zuint16 r);
|
@@ -0,0 +1,36 @@
|
|
1
|
+
/* Z Kit - ABIs/generic/allocator.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_ABIs_generic_allocator_H_
|
9
|
+
#define _Z_ABIs_generic_allocator_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
|
13
|
+
typedef void* (* ZAllocate) (void* context,
|
14
|
+
zusize size,
|
15
|
+
zusize alignment);
|
16
|
+
|
17
|
+
typedef void* (* ZAllocateClean)(void* context,
|
18
|
+
zusize size,
|
19
|
+
zusize alignment);
|
20
|
+
|
21
|
+
typedef void* (* ZReallocate) (void* context,
|
22
|
+
void* block,
|
23
|
+
zusize new_size,
|
24
|
+
zusize alignment);
|
25
|
+
|
26
|
+
typedef void (* ZDeallocate) (void* context,
|
27
|
+
void* block);
|
28
|
+
|
29
|
+
typedef struct {
|
30
|
+
ZAllocate allocate;
|
31
|
+
ZAllocateClean allocate_clean;
|
32
|
+
ZReallocate reallocate;
|
33
|
+
ZDeallocate deallocate;
|
34
|
+
} ZAllocatorABI;
|
35
|
+
|
36
|
+
#endif /* _Z_ABIs_generic_allocator_H_ */
|
@@ -0,0 +1,47 @@
|
|
1
|
+
/* Z Kit - ABIs/generic/cipher.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_ABIs_generic_cipher_H_
|
9
|
+
#define _Z_ABIs_generic_cipher_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
|
13
|
+
#define Z_CIPHER_FEATURE_SEQUENTIAL 1
|
14
|
+
|
15
|
+
typedef ZStatus (* ZCipherTestKey) (void const* key,
|
16
|
+
zusize key_size);
|
17
|
+
|
18
|
+
typedef void (* ZCipherSetKey) (void* context,
|
19
|
+
void const* key,
|
20
|
+
zusize key_size);
|
21
|
+
|
22
|
+
typedef void (* ZCipherProcess) (void* context,
|
23
|
+
void const* block,
|
24
|
+
zusize block_size,
|
25
|
+
void* output);
|
26
|
+
|
27
|
+
typedef zusize (* ZCipherOutputSize)(void* context,
|
28
|
+
void const* block,
|
29
|
+
zusize block_size);
|
30
|
+
|
31
|
+
typedef struct {
|
32
|
+
ZCipherTestKey test_key;
|
33
|
+
ZCipherSetKey set_key;
|
34
|
+
ZCipherProcess encipher;
|
35
|
+
ZCipherProcess decipher;
|
36
|
+
ZCipherOutputSize enciphering_size;
|
37
|
+
ZCipherOutputSize deciphering_size;
|
38
|
+
zusize instance_size;
|
39
|
+
zusize key_minimum_size;
|
40
|
+
zusize key_maximum_size;
|
41
|
+
zusize key_word_size;
|
42
|
+
zusize enciphering_word_size;
|
43
|
+
zusize deciphering_word_size;
|
44
|
+
zuint8 features;
|
45
|
+
} ZCipherABI;
|
46
|
+
|
47
|
+
#endif /* _Z_ABIs_generic_cipher_H_ */
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/* Z Kit - ABIs/generic/data codec.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_ABIs_generic_data_codec_H_
|
9
|
+
#define _Z_ABIs_generic_data_codec_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
|
13
|
+
typedef zusize (* ZDataCodecProcess) (void const* block,
|
14
|
+
zusize block_size,
|
15
|
+
void* output);
|
16
|
+
|
17
|
+
typedef zusize (* ZDataCodecOutputSize)(void const* block,
|
18
|
+
zusize block_size);
|
19
|
+
|
20
|
+
typedef ZStatus (* ZDataCodecValidate) (void const* block,
|
21
|
+
zusize block_size,
|
22
|
+
zusize* error_offset);
|
23
|
+
|
24
|
+
typedef struct {
|
25
|
+
ZDataCodecProcess encode;
|
26
|
+
ZDataCodecProcess decode;
|
27
|
+
ZDataCodecOutputSize encoding_size;
|
28
|
+
ZDataCodecOutputSize decoding_size;
|
29
|
+
ZDataCodecValidate validate_encoding;
|
30
|
+
zboolean sequential;
|
31
|
+
} ZDataCodecABI;
|
32
|
+
|
33
|
+
#endif /* _Z_ABIs_generic_data_codec_H_ */
|
@@ -0,0 +1,103 @@
|
|
1
|
+
/* Z Kit - ABIs/generic/emulation.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_ABIs_generic_emulation_H_
|
9
|
+
#define _Z_ABIs_generic_emulation_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
#include <Z/macros/key.h>
|
13
|
+
|
14
|
+
#define Z_EMULATOR_FUNCTION_POWER 0
|
15
|
+
#define Z_EMULATOR_FUNCTION_RESET 1
|
16
|
+
#define Z_EMULATOR_FUNCTION_RUN 2
|
17
|
+
#define Z_EMULATOR_FUNCTION_RUN_ONE_SCANLINE
|
18
|
+
#define Z_EMULATOR_FUNCTION_RUN_ONE_FRAME
|
19
|
+
#define Z_EMULATOR_FUNCTION_WILL_READ_STATE 3
|
20
|
+
#define Z_EMULATOR_FUNCTION_DID_WRITE_STATE 4
|
21
|
+
#define Z_EMULATOR_FUNCTION_HALT 8
|
22
|
+
#define Z_EMULATOR_FUNCTION_NMI 4
|
23
|
+
#define Z_EMULATOR_FUNCTION_IRQ 5
|
24
|
+
#define Z_EMULATOR_FUNCTION_IRQ_DATA 9
|
25
|
+
#define Z_EMULATOR_FUNCTION_READ_8BIT 6
|
26
|
+
#define Z_EMULATOR_FUNCTION_READ_16BIT
|
27
|
+
#define Z_EMULATOR_FUNCTION_READ_32BIT
|
28
|
+
#define Z_EMULATOR_FUNCTION_READ_64BIT
|
29
|
+
#define Z_EMULATOR_FUNCTION_READ_128BIT
|
30
|
+
#define Z_EMULATOR_FUNCTION_READ_256BIT
|
31
|
+
#define Z_EMULATOR_FUNCTION_READ_512BIT
|
32
|
+
#define Z_EMULATOR_FUNCTION_READ_1024BIT
|
33
|
+
#define Z_EMULATOR_FUNCTION_WRITE_8BIT 20
|
34
|
+
#define Z_EMULATOR_FUNCTION_WRITE_16BIT
|
35
|
+
#define Z_EMULATOR_FUNCTION_WRITE_32BIT
|
36
|
+
#define Z_EMULATOR_FUNCTION_WRITE_64BIT
|
37
|
+
#define Z_EMULATOR_FUNCTION_WRITE_128BIT
|
38
|
+
#define Z_EMULATOR_FUNCTION_WRITE_256BIT
|
39
|
+
#define Z_EMULATOR_FUNCTION_WRITE_512BIT
|
40
|
+
#define Z_EMULATOR_FUNCTION_WRITE_1024BIT
|
41
|
+
#define Z_EMULATOR_FUNCTION_IN_8BIT 30
|
42
|
+
#define Z_EMULATOR_FUNCTION_IN_16BIT
|
43
|
+
#define Z_EMULATOR_FUNCTION_IN_32BIT
|
44
|
+
#define Z_EMULATOR_FUNCTION_IN_64BIT
|
45
|
+
#define Z_EMULATOR_FUNCTION_IN_128BIT
|
46
|
+
#define Z_EMULATOR_FUNCTION_IN_256BIT
|
47
|
+
#define Z_EMULATOR_FUNCTION_IN_512BIT
|
48
|
+
#define Z_EMULATOR_FUNCTION_IN_1024BIT
|
49
|
+
#define Z_EMULATOR_FUNCTION_OUT_8BIT 40
|
50
|
+
#define Z_EMULATOR_FUNCTION_OUT_16BIT
|
51
|
+
#define Z_EMULATOR_FUNCTION_OUT_32BIT
|
52
|
+
#define Z_EMULATOR_FUNCTION_OUT_64BIT
|
53
|
+
#define Z_EMULATOR_FUNCTION_OUT_128BIT
|
54
|
+
#define Z_EMULATOR_FUNCTION_OUT_256BIT
|
55
|
+
#define Z_EMULATOR_FUNCTION_OUT_512BIT
|
56
|
+
#define Z_EMULATOR_FUNCTION_OUT_1024BIT
|
57
|
+
|
58
|
+
#define Z_KEY_BITS_EMULATOR_FUNCTION 8
|
59
|
+
|
60
|
+
typedef void (* ZEmulatorPower )(void* object, zboolean state );
|
61
|
+
typedef zusize (* ZEmulatorRun )(void* object, zusize cycles);
|
62
|
+
typedef void (* ZEmulatorWillReadState)(void* object);
|
63
|
+
typedef void (* ZEmulatorDidWriteState)(void* object);
|
64
|
+
|
65
|
+
typedef struct {
|
66
|
+
zuintptr id;
|
67
|
+
|
68
|
+
struct {zusize cycles;
|
69
|
+
/* ... */
|
70
|
+
} context;
|
71
|
+
} ZEmulatorComponent;
|
72
|
+
|
73
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
74
|
+
zchar const* domain_identifier;
|
75
|
+
zchar const* unit_identifier;
|
76
|
+
) ZEmulatorDependency;
|
77
|
+
|
78
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
79
|
+
ZKey(EMULATOR_FUNCTION) key;
|
80
|
+
ZPointer component;
|
81
|
+
) ZEmulatorExport;
|
82
|
+
|
83
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
84
|
+
ZKey(EMULATOR_FUNCTION) key;
|
85
|
+
zusize offset;
|
86
|
+
) ZEmulatorInstanceImport;
|
87
|
+
|
88
|
+
typedef ZEmulatorExport ZCPUEmulatorExport;
|
89
|
+
typedef ZEmulatorInstanceImport ZCPUEmulatorInstanceImport;
|
90
|
+
|
91
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
92
|
+
zusize dependency_count;
|
93
|
+
ZEmulatorDependency const* dependencies;
|
94
|
+
zusize export_count;
|
95
|
+
ZEmulatorExport const* exports;
|
96
|
+
zusize instance_size;
|
97
|
+
zusize instance_state_offset;
|
98
|
+
zusize instance_state_size;
|
99
|
+
zusize instance_import_count;
|
100
|
+
ZEmulatorInstanceImport const* instance_imports;
|
101
|
+
) ZCPUEmulatorABI;
|
102
|
+
|
103
|
+
#endif /* _Z_ABIs_generic_emulation_H_ */
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/* Z Kit - ABIs/generic/hash function.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_ABIs_generic_hash_function_H_
|
9
|
+
#define _Z_ABIs_generic_hash_function_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
|
13
|
+
void (* ZHashFunctionInitialize)(void* context);
|
14
|
+
|
15
|
+
void (* ZHashFunctionUpdate) (void* context,
|
16
|
+
void* block,
|
17
|
+
zusize block_size);
|
18
|
+
|
19
|
+
void (* ZHashFunctionFinalize) (void* context);
|
20
|
+
|
21
|
+
void* (* ZHashFunctionResult) (void const* context,
|
22
|
+
zusize* result_size);
|
23
|
+
|
24
|
+
typedef struct {
|
25
|
+
ZHashFunctionInitialize initialize;
|
26
|
+
ZHashFunctionUpdate update;
|
27
|
+
ZHashFunctionFinalize finalize;
|
28
|
+
ZHashFunctionResult result;
|
29
|
+
zusize context_size;
|
30
|
+
zusize result_size;
|
31
|
+
} ZHashFunctionABI;
|
32
|
+
|
33
|
+
#endif /* _Z_ABIs_generic_hash_function_H_ */
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/* Z Kit - ABIs/generic/module.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_ABIs_generic_module_H_
|
9
|
+
#define _Z_ABIs_generic_module_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
#include <Z/macros/version.h>
|
13
|
+
|
14
|
+
typedef struct {
|
15
|
+
zchar const* identifier;
|
16
|
+
zchar const* name;
|
17
|
+
zuint64 version;
|
18
|
+
void const* abi;
|
19
|
+
} ZModuleUnit;
|
20
|
+
|
21
|
+
typedef struct {
|
22
|
+
zchar const* identifier;
|
23
|
+
zuint64 abi_version;
|
24
|
+
zusize unit_count;
|
25
|
+
ZModuleUnit const* units;
|
26
|
+
} ZModuleDomain;
|
27
|
+
|
28
|
+
typedef struct {
|
29
|
+
zusize domain_count;
|
30
|
+
ZModuleDomain const* domains;
|
31
|
+
} ZModuleABI;
|
32
|
+
|
33
|
+
#endif /* _Z_ABIs_generic_module_H_ */
|
@@ -0,0 +1,40 @@
|
|
1
|
+
/* Z Kit - ABIs/generic/wave codec.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_ABIs_generic_wave_codec_H_
|
9
|
+
#define _Z_ABIs_generic_wave_codec_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
#include <Z/macros/key.h>
|
13
|
+
#include <Z/keys/value.h>
|
14
|
+
|
15
|
+
#define Z_WAVE_CODEC_STATE_CAN_DISCARD_INPUT
|
16
|
+
#define Z_WAVE_CODEC_STATE_CAN_DISCARD_OUTPUT
|
17
|
+
|
18
|
+
#define Z_KEY_BITS_WAVE_CODEC_STATE 8
|
19
|
+
#define Z_KEY_LAST_WAVE_CODEC_STATE Z_WAVE_CODEC_STATE_CAN_DISCARD_OUTPUT
|
20
|
+
|
21
|
+
typedef struct {
|
22
|
+
void* input;
|
23
|
+
void* output;
|
24
|
+
zuint32 resolution;
|
25
|
+
zuint16 channel_count;
|
26
|
+
ZKey(VALUE_TYPE) sample_fixed_type;
|
27
|
+
ZKey(WAVE_CODEC_STATE) state;
|
28
|
+
ZStatus status;
|
29
|
+
} ZWaveCodecSC;
|
30
|
+
|
31
|
+
typedef zusize (* ZWaveCodecProcess)(ZWaveCodecSC *sc, zusize sample_count);
|
32
|
+
|
33
|
+
typedef struct {
|
34
|
+
ZWaveCodecProcess encode;
|
35
|
+
ZWaveCodecProcess decode;
|
36
|
+
zusize encoding_context_size;
|
37
|
+
zusize decoding_context_size;
|
38
|
+
} ZWaveCodecABI;
|
39
|
+
|
40
|
+
#endif /* _Z_ABIs_generic_wave_codec_H_ */
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/* Z Kit - classes/base/InitializerList.hpp
|
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_classes_base_InitializerList_HPP_
|
9
|
+
#define _Z_classes_base_InitializerList_HPP_
|
10
|
+
|
11
|
+
#include <Z/types/base.hpp>
|
12
|
+
|
13
|
+
|
14
|
+
namespace Zeta {template <class T> class InitializerList {
|
15
|
+
|
16
|
+
private:
|
17
|
+
const T* _begin;
|
18
|
+
USize _size;
|
19
|
+
|
20
|
+
public:
|
21
|
+
|
22
|
+
Z_INLINE InitializerList()
|
23
|
+
: _begin(NULL), _size(0) {}
|
24
|
+
|
25
|
+
Z_INLINE InitializerList(const T *begin, USize size)
|
26
|
+
: _begin(begin), _size(size) {}
|
27
|
+
|
28
|
+
Z_INLINE USize size () const {return _size;}
|
29
|
+
Z_INLINE const T *begin() const {return _begin;}
|
30
|
+
Z_INLINE const T *end () const {return _begin + _size;}
|
31
|
+
};}
|
32
|
+
|
33
|
+
|
34
|
+
#endif // _Z_classes_base_InitializerList_HPP_
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/* Z Kit - classes/base/OpaqueFunctionPointer.hpp
|
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_classes_base_OpaqueFunctionPointer_HPP_
|
9
|
+
#define _Z_classes_base_OpaqueFunctionPointer_HPP_
|
10
|
+
|
11
|
+
#include <Z/macros/language.hpp>
|
12
|
+
|
13
|
+
|
14
|
+
namespace Zeta {struct OpaqueFunctionPointer {
|
15
|
+
void (* function)();
|
16
|
+
|
17
|
+
template <class T>
|
18
|
+
Z_INLINE OpaqueFunctionPointer(T function)
|
19
|
+
: function((void (*)())function) {}
|
20
|
+
|
21
|
+
template <class T>
|
22
|
+
Z_INLINE operator T() const {return (T)function;}
|
23
|
+
};}
|
24
|
+
|
25
|
+
|
26
|
+
#endif // _Z_classes_base_OpaqueFunctionPointer_HPP_
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/* Z Kit - classes/base/OpaqueMemberFunctionPointer.hpp
|
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_classes_base_OpaqueMemberFunctionPointer_HPP_
|
9
|
+
#define _Z_classes_base_OpaqueMemberFunctionPointer_HPP_
|
10
|
+
|
11
|
+
#include <Z/types/base.hpp>
|
12
|
+
|
13
|
+
|
14
|
+
namespace Zeta {struct OpaqueMemberFunctionPointer {
|
15
|
+
void (NaT::* function)();
|
16
|
+
|
17
|
+
template <class M>
|
18
|
+
Z_INLINE OpaqueMemberFunctionPointer(M function)
|
19
|
+
: function((void (NaT::*)())function) {}
|
20
|
+
|
21
|
+
template <class M>
|
22
|
+
Z_INLINE operator M() const {return (M)function;}
|
23
|
+
};}
|
24
|
+
|
25
|
+
|
26
|
+
#endif // _Z_classes_base_OpaqueMemberFunctionPointer_HPP_
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/* Z Kit - classes/base/Pair.hpp
|
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_classes_base_Pair_HPP_
|
9
|
+
#define _Z_classes_base_Pair_HPP_
|
10
|
+
|
11
|
+
#include <Z/functions/base/value.hpp>
|
12
|
+
|
13
|
+
|
14
|
+
namespace Zeta {template <class T1, class T2> struct Pair {
|
15
|
+
typedef T1 First;
|
16
|
+
typedef T2 Second;
|
17
|
+
|
18
|
+
T1 first;
|
19
|
+
T2 second;
|
20
|
+
|
21
|
+
Z_INLINE Pair() Z_DEFAULTED({})
|
22
|
+
|
23
|
+
Z_CT(CPP11) Pair(
|
24
|
+
typename Type<T1>::to_forwardable first,
|
25
|
+
typename Type<T2>::to_forwardable second
|
26
|
+
) : first(first), second(second) {}
|
27
|
+
|
28
|
+
|
29
|
+
Z_CT(CPP11) Boolean operator ==(const Pair &pair) const
|
30
|
+
{return first == pair.first && second == pair.second;}
|
31
|
+
|
32
|
+
|
33
|
+
Z_CT(CPP11) Boolean operator !=(const Pair &pair) const
|
34
|
+
{return first != pair.first || second != pair.second;}
|
35
|
+
|
36
|
+
|
37
|
+
Z_INLINE void swap(Pair &pair)
|
38
|
+
{
|
39
|
+
Zeta::swap<typename Type<Pair>::to_opaque>
|
40
|
+
((typename Type<Pair>::to_opaque *)this,
|
41
|
+
(typename Type<Pair>::to_opaque *)&pair);
|
42
|
+
}
|
43
|
+
};}
|
44
|
+
|
45
|
+
|
46
|
+
#endif // _Z_classes_base_Pair_HPP_
|