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
@@ -0,0 +1,405 @@
|
|
1
|
+
/* Z Kit - hardware/machine/platform/computer/ZX Spectrum.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_hardware_machine_platform_computer_ZX_Spectrum_H_
|
9
|
+
#define _Z_hardware_machine_platform_computer_ZX_Spectrum_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
|
13
|
+
/* MARK: - Memory map
|
14
|
+
.-------------------------------------.
|
15
|
+
| Location | Type | Content |
|
16
|
+
|-----------+------+------------------|
|
17
|
+
| 0000-3FFF | ROM | Firmware |
|
18
|
+
|-----------+------+------------------|
|
19
|
+
| 4000-57FF | VRAM | Video Characters |
|
20
|
+
| 5800-5AFF | VRAM | Video Attributes |
|
21
|
+
|-----------+------+------------------|
|
22
|
+
| 5B00-FFFF | RAM | User programs |
|
23
|
+
'------------------------------------*/
|
24
|
+
|
25
|
+
#define Z_ZX_SPECTRUM_ADDRESS_ROM 0x0000
|
26
|
+
#define Z_ZX_SPECTRUM_ADDRESS_RAM 0x4000
|
27
|
+
#define Z_ZX_SPECTRUM_ADDRESS_VIDEO_CHARACTER_RAM 0x4000
|
28
|
+
#define Z_ZX_SPECTRUM_ADDRESS_VIDEO_ATTRIBUTE_RAM 0x5800
|
29
|
+
#define Z_ZX_SPECTRUM_ADDRESS_USER_PROGRAMS 0x5B00
|
30
|
+
|
31
|
+
#define Z_ZX_SPECTRUM_SIZE_VIDEO_RAM 6912
|
32
|
+
#define Z_ZX_SPECTRUM_SIZE_VIDEO_CHARACTER_RAM 6144
|
33
|
+
#define Z_ZX_SPECTRUM_SIZE_VIDEO_ATTRIBUTE_RAM 768
|
34
|
+
|
35
|
+
/* MARK: - Video: Color Attribute
|
36
|
+
.-----------------.
|
37
|
+
| 7 6 5 4 3 2 1 0 |
|
38
|
+
'-|-|-\___/-\___/-'
|
39
|
+
| | | '---> Ink ----------------.
|
40
|
+
| | '---------> Paper --------. |
|
41
|
+
| '-------------> Bright ---. | |
|
42
|
+
'---------------> Flash | | |
|
43
|
+
| | | |
|
44
|
+
.----------------' | | |
|
45
|
+
| .---------' | |
|
46
|
+
| | | |
|
47
|
+
v v v v
|
48
|
+
.---------. .------------. .---------------.
|
49
|
+
| 0 = NO | | 0 = Normal | | 000 = Black |
|
50
|
+
| 1 = YES | | 1 = Bright | | 001 = Blue |
|
51
|
+
'---------' '------------' | 010 = Red |
|
52
|
+
| 011 = Magenta |
|
53
|
+
| 100 = Green |
|
54
|
+
| 101 = Cyan |
|
55
|
+
| 110 = Yellow |
|
56
|
+
| 111 = White |
|
57
|
+
'--------------*/
|
58
|
+
|
59
|
+
#define Z_ZX_SPECTRUM_COLOR_BLACK 0
|
60
|
+
#define Z_ZX_SPECTRUM_COLOR_BLUE 1
|
61
|
+
#define Z_ZX_SPECTRUM_COLOR_RED 2
|
62
|
+
#define Z_ZX_SPECTRUM_COLOR_MAGENTA 3
|
63
|
+
#define Z_ZX_SPECTRUM_COLOR_GREEN 4
|
64
|
+
#define Z_ZX_SPECTRUM_COLOR_CYAN 5
|
65
|
+
#define Z_ZX_SPECTRUM_COLOR_YELLOW 6
|
66
|
+
#define Z_ZX_SPECTRUM_COLOR_WHITE 7
|
67
|
+
|
68
|
+
Z_DEFINE_STRICT_STRUCTURE (Z_BIT_FIELD(8, 4) (
|
69
|
+
zuint8 flash :1,
|
70
|
+
zuint8 bright :1,
|
71
|
+
zuint8 paper :3,
|
72
|
+
zuint8 ink :3
|
73
|
+
)) ZZXSpectrumColorAttribute;
|
74
|
+
|
75
|
+
#define Z_ZX_SPECTRUM_ATTRIBUTE_SQUARE_WIDTH 8
|
76
|
+
#define Z_ZX_SPECTRUM_ATTRIBUTE_SQUARE_HEIGHT 8
|
77
|
+
|
78
|
+
#define Z_ZX_SPECTRUM_BRIGHT_COLOR_PALETTE(RGB) \
|
79
|
+
RGB(0.0, 0.0, 0.0), /* Bright Black */ \
|
80
|
+
RGB(0.0, 0.0, 0.0), /* Bright Black */ \
|
81
|
+
RGB(0.0, 0.0, 1.0), /* Bright Blue */ \
|
82
|
+
RGB(1.0, 0.0, 0.0), /* Bright Red */ \
|
83
|
+
RGB(1.0, 0.0, 1.0), /* Bright Magenta */ \
|
84
|
+
RGB(0.0, 1.0, 0.0), /* Bright Green */ \
|
85
|
+
RGB(0.0, 1.0, 1.0), /* Bright Cyan */ \
|
86
|
+
RGB(1.0, 1.0, 0.0), /* Bright Yellow */ \
|
87
|
+
RGB(1.0, 1.0, 1.0) /* Bright White */
|
88
|
+
|
89
|
+
#define Z_ZX_SPECTRUM_BASIC_COLOR_PALETTE(RGB) \
|
90
|
+
RGB(0.0, 0.0, 0.0 ), /* Black */ \
|
91
|
+
RGB(0.0, 0.0, 0.84), /* Basic Blue */ \
|
92
|
+
RGB(0.84, 0.0, 0.0 ), /* Basic Red */ \
|
93
|
+
RGB(0.84, 0.0, 0.84), /* Basic Magenta */ \
|
94
|
+
RGB(0.0, 0.84, 0.0 ), /* Basic Green */ \
|
95
|
+
RGB(0.0, 0.84, 0.84), /* Basic Cyan */ \
|
96
|
+
RGB(0.84, 0.84, 0.0 ), /* Basic Yellow */ \
|
97
|
+
RGB(0.84, 0.84, 0.84) /* Basic White */
|
98
|
+
|
99
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
100
|
+
zuint8 characters[Z_ZX_SPECTRUM_SIZE_VIDEO_CHARACTER_RAM];
|
101
|
+
ZZXSpectrumColorAttribute attributes[Z_ZX_SPECTRUM_SIZE_VIDEO_ATTRIBUTE_RAM];
|
102
|
+
) ZZXSpectrumVRAM;
|
103
|
+
|
104
|
+
/* MARK: - I/O ports */
|
105
|
+
|
106
|
+
#define Z_ZX_SPECTRUM_IO_PORT_ULA 0x01 /* Read */
|
107
|
+
#define Z_ZX_SPECTRUM_IO_PORT_KEMPSTON_JOYSTICK 0x1F /* Read */
|
108
|
+
#define Z_ZX_SPECTRUM_IO_PORT_FULLER_JOYSTICK 0x7F /* Read */
|
109
|
+
#define Z_ZX_SPECTRUM_IO_PORT_MIKROGEN_JOYSTICK 0xDF /* Read */
|
110
|
+
#define Z_ZX_SPECTRUM_IO_PORT_MULTI_IO 0xFE /* Read / Write */
|
111
|
+
|
112
|
+
#define Z_ZX_SPECTRUM_UNASSIGNED_IO_PORT_INPUT 0xFF
|
113
|
+
|
114
|
+
/* MARK: - ULA I/O port
|
115
|
+
.-----------------.-----------------.
|
116
|
+
| 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 |
|
117
|
+
'-\_____________/-'-\___/-|-|-\___/-'
|
118
|
+
| | | | '---> Border color
|
119
|
+
Keyboard (Read) | | '-------> MIC / tape output
|
120
|
+
| | '---------> EAR output / speaker
|
121
|
+
'-------. '-------------> Unused
|
122
|
+
|
|
123
|
+
V
|
124
|
+
76543210 0 1 2 3 4
|
125
|
+
.--------------------------------------------------.
|
126
|
+
.--------| _______0 | SHIFT | Z | X | C | V |
|
127
|
+
| |----------+-------+-------+-------+-------+-------|
|
128
|
+
| .------| ______0_ | A | S | D | F | G |
|
129
|
+
| | |----------+-------+-------+-------+-------+-------|
|
130
|
+
| | .----| _____0__ | Q | W | E | R | T |
|
131
|
+
| | | |----------+-------+-------+-------+-------+-------|
|
132
|
+
| | | .--| ____0___ | 1 | 2 | 3 | 4 | 5 |
|
133
|
+
| | | | |----------+-------+-------+-------+-------+-------|
|
134
|
+
| | | | | ___0____ | 0 | 9 | 8 | 7 | 6 |-------------.
|
135
|
+
N | | | | |----------+-------+-------+-------+-------+-------| | R
|
136
|
+
O | | | | | __0_____ | P | O | I | U | Y |-----------. | E
|
137
|
+
R | | | | |----------+-------+-------+-------+-------+-------| | | V
|
138
|
+
M | | | | | _0______ | ENTER | L | K | J | H |---------. | | E
|
139
|
+
A | | | | |----------+-------+-------+-------+-------+-------| | | | R
|
140
|
+
L | | | | | 0_______ | SPACE | SY/SH | M | N | B |-------. | | | S
|
141
|
+
| | | | '--------------------------------------------------' | | | | E
|
142
|
+
M | | | | | | | | D
|
143
|
+
A | | | | ____________________________ _______________________ | | | |
|
144
|
+
T | | | | | ___. __ _ __ . __ /\ / | | | | | M
|
145
|
+
R | | | | | __\ || ||__|__|--||| / / / | | | | | A
|
146
|
+
I | | | | | ZX Spectrum / / / | | | | | T
|
147
|
+
X | | | | | / / / | | | | | R
|
148
|
+
| | | | | ______________________/ / /__________________________ | | | | | I
|
149
|
+
| | | | |/_____________________/ / /___________________________\| | | | | I
|
150
|
+
| | | | | _ _ _ _ _ / / / _ _ _ _ _ | | | | | X
|
151
|
+
| | | '--> [1] [2] [3] [4] [5] \/ \[6] [7] [8] [9] [0] <-----------------'
|
152
|
+
| | | | _ _ _ _ _\ \ _ _ _ _ _ | | | |
|
153
|
+
| | '-------> [Q] [W] [E] [R] [T]\ \ [Y] [U] [I] [O] [P] <------------'
|
154
|
+
| | | _ _ _ _ _\ \ _ _ _ _ _____//| | |
|
155
|
+
| '-----------> [A] [S] [D] [F] [G]\ \ [H] [J] [K] [L] [ENTER] <----'
|
156
|
+
| | _____ _ _ _ _ /\ / _ _ _ __ ___////| |
|
157
|
+
'--------> [SHIFT] [Z] [X] [C] [V]/ / / [B] [N] [M] [SS] [SPACE] <--'
|
158
|
+
|_______________________/ / /_____________________////__|
|
159
|
+
(_______________________\/ \___________________________) */
|
160
|
+
|
161
|
+
Z_DEFINE_STRICT_STRUCTURE (Z_BIT_FIELD(8, 4) (
|
162
|
+
zuint8 unused :3,
|
163
|
+
zuint8 mic :1,
|
164
|
+
zuint8 ear :1,
|
165
|
+
zuint8 border_color :3
|
166
|
+
)) ZZXSpectrumULAIO;
|
167
|
+
|
168
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_ENTER 6
|
169
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_SHIFT 0
|
170
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_SPACE 7
|
171
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_0 4
|
172
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_1 3
|
173
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_2 3
|
174
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_3 3
|
175
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_4 3
|
176
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_5 3
|
177
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_6 4
|
178
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_7 4
|
179
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_8 4
|
180
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_9 4
|
181
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_A 1
|
182
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_B 7
|
183
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_C 0
|
184
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_D 1
|
185
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_E 2
|
186
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_F 1
|
187
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_G 1
|
188
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_H 6
|
189
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_I 5
|
190
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_J 6
|
191
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_K 6
|
192
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_L 6
|
193
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_M 7
|
194
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_N 7
|
195
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_O 5
|
196
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_P 5
|
197
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_Q 2
|
198
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_R 2
|
199
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_S 1
|
200
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_T 2
|
201
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_U 5
|
202
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_V 0
|
203
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_W 2
|
204
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_X 0
|
205
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_Y 5
|
206
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_Z 0
|
207
|
+
#define Z_ZX_SPECTRUM_KEY_ROW_SYMBOL_SHIFT 7
|
208
|
+
|
209
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_ENTER 0
|
210
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_SHIFT 0
|
211
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_SPACE 0
|
212
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_0 0
|
213
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_1 0
|
214
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_2 1
|
215
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_3 2
|
216
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_4 3
|
217
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_5 4
|
218
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_6 4
|
219
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_7 3
|
220
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_8 2
|
221
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_9 1
|
222
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_A 0
|
223
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_B 4
|
224
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_C 3
|
225
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_D 2
|
226
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_E 2
|
227
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_F 3
|
228
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_G 4
|
229
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_H 4
|
230
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_I 2
|
231
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_J 3
|
232
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_K 2
|
233
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_L 1
|
234
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_M 2
|
235
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_N 3
|
236
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_O 1
|
237
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_P 0
|
238
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_Q 0
|
239
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_R 3
|
240
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_S 1
|
241
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_T 4
|
242
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_U 3
|
243
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_V 4
|
244
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_W 1
|
245
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_X 2
|
246
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_Y 4
|
247
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_Z 1
|
248
|
+
#define Z_ZX_SPECTRUM_KEY_OFFSET_SYMBOL_SHIFT 1
|
249
|
+
|
250
|
+
/* MARK: - ULA I/O port: input value
|
251
|
+
.-----------------.
|
252
|
+
| 7 6 5 4 3 2 1 0 |
|
253
|
+
'-|-|-\_________/-'
|
254
|
+
| | |
|
255
|
+
| | '------> Key mask
|
256
|
+
| '-------------> EAR input
|
257
|
+
'---------------> 1
|
258
|
+
|
259
|
+
.------------------------------------.
|
260
|
+
| Special keys |
|
261
|
+
|------------------------------------|
|
262
|
+
| DELETE = SHIFT + 0 |
|
263
|
+
| EDIT = SHIFT + 1 |
|
264
|
+
| CAPS LOCK = SHIFT + 2 |
|
265
|
+
| TRUE VIDEO = SHIFT + 3 |
|
266
|
+
| INV VIDEO = SHIFT + 4 |
|
267
|
+
| ↑ = SHIFT + 7 |
|
268
|
+
| ↓ = SHIFT + 6 |
|
269
|
+
| → = SHIFT + 5 |
|
270
|
+
| ← = SHIFT + 8 |
|
271
|
+
| GRAPH = SHIFT + 9 |
|
272
|
+
| BREAK = SHIFT + SPACE |
|
273
|
+
| EXTEND MODE = SHIFT + SYMBOL SHIFT |
|
274
|
+
| . = SYMBOL SHIFT + M |
|
275
|
+
| , = SYMBOL SHIFT + N |
|
276
|
+
| ; = SYMBOL SHIFT + O |
|
277
|
+
| " = SYMBOL SHIFT + P |
|
278
|
+
'-----------------------------------*/
|
279
|
+
|
280
|
+
Z_DEFINE_STRICT_STRUCTURE (Z_BIT_FIELD(8, 3) (
|
281
|
+
zuint8 one :1,
|
282
|
+
zuint8 ear :1,
|
283
|
+
zuint8 key_mask :6
|
284
|
+
)) ZZXSpectrumULAInput;
|
285
|
+
|
286
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_ENTER 0x0F
|
287
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_SHIFT 0x0F
|
288
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_SPACE 0x0F
|
289
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_0 0x0F
|
290
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_1 0x0F
|
291
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_2 0x17
|
292
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_3 0x1B
|
293
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_4 0x1D
|
294
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_5 0x1E
|
295
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_6 0x1E
|
296
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_7 0x1D
|
297
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_8 0x1B
|
298
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_9 0x17
|
299
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_A 0x0F
|
300
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_B 0x1E
|
301
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_C 0x1D
|
302
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_D 0x1B
|
303
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_E 0x1B
|
304
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_F 0x1D
|
305
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_G 0x1E
|
306
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_H 0x1E
|
307
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_I 0x1B
|
308
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_J 0x1D
|
309
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_K 0x1B
|
310
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_L 0x17
|
311
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_M 0x1B
|
312
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_N 0x1D
|
313
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_O 0x17
|
314
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_P 0x0F
|
315
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_Q 0x0F
|
316
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_R 0x1D
|
317
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_S 0x17
|
318
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_T 0x1E
|
319
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_U 0x1D
|
320
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_V 0x1E
|
321
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_W 0x17
|
322
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_X 0x1B
|
323
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_Y 0x1E
|
324
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_Z 0x17
|
325
|
+
#define Z_ZX_SPECTRUM_KEY_MASK_SYMBOL_SHIFT 0x17
|
326
|
+
|
327
|
+
/* MARK: - Firmware ADC
|
328
|
+
.------------------------------------------------------------------------.
|
329
|
+
| |
|
330
|
+
| High _____ _____ _____ |
|
331
|
+
| |Pulse| |Pulse| |Pulse| Square wave |
|
332
|
+
| | |_____| |_____| |______ |
|
333
|
+
| Low Pulse Pulse Pulse |
|
334
|
+
| |
|
335
|
+
| 1) Pilot |
|
336
|
+
| ______________ |
|
337
|
+
| | 2168 | 2168 x 8063 times (if block contains header) |
|
338
|
+
| | |______________ x 3223 times (if block contains data) |
|
339
|
+
| |
|
340
|
+
| 2) Sync |
|
341
|
+
| _____ |
|
342
|
+
| | 667 | 735 |
|
343
|
+
| | |_______ |
|
344
|
+
| |
|
345
|
+
| 3) Pause |
|
346
|
+
| |
|
347
|
+
| 1 second |
|
348
|
+
| ______________________________ |
|
349
|
+
| |
|
350
|
+
'-----------------------------------------------------------------------*/
|
351
|
+
|
352
|
+
#define Z_ZX_SPECTRUM_ADC_PULSES_PER_HEADER_PILOT 8063 /* 5 seconds */
|
353
|
+
#define Z_ZX_SPECTRUM_ADC_PULSES_PER_DATA_PILOT 3223 /* 2 seconds */
|
354
|
+
#define Z_ZX_SPECTRUM_ADC_CYCLES_PER_PILOT_PULSE 2168 /* 807.2 Hz */
|
355
|
+
#define Z_ZX_SPECTRUM_ADC_CYCLES_PER_SYNC_HIGH_PULSE 667 /* 2623.7 Hz */
|
356
|
+
#define Z_ZX_SPECTRUM_ADC_CYCLES_PER_SYNC_LOW_PULSE 735 /* 2381 Hz */
|
357
|
+
#define Z_ZX_SPECTRUM_ADC_CYCLES_PER_BIT_0_PULSE 855 /* 2046.8 Hz */
|
358
|
+
#define Z_ZX_SPECTRUM_ADC_CYCLES_PER_BIT_1_PULSE 1710 /* 1023.4 Hz */
|
359
|
+
#define Z_ZX_SPECTRUM_ADC_CYCLES_PER_TAIL 945
|
360
|
+
#define Z_ZX_SPECTRUM_ADC_CYCLES_PER_PAUSE 3500000
|
361
|
+
#define Z_ZX_SPECTRUM_ADC_CYCLES_PER_HEADER_PILOT 17482752 /* 2168 * 8064 */
|
362
|
+
#define Z_ZX_SPECTRUM_ADC_CYCLES_PER_DATA_PILOT 6989632 /* 2168 * 3224 */
|
363
|
+
|
364
|
+
#define Z_ZX_SPECTRUM_ADC_BLOCK_CONTENT_HEADER 0
|
365
|
+
#define Z_ZX_SPECTRUM_ADC_BLOCK_CONTENT_DATA 255
|
366
|
+
|
367
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
368
|
+
zuint8 type;
|
369
|
+
zuint8 file_name[10];
|
370
|
+
zuint16 data_size;
|
371
|
+
|
372
|
+
union { struct {zuint16 autostart_line;
|
373
|
+
zuint16 size;
|
374
|
+
} program;
|
375
|
+
|
376
|
+
struct {zuint8 unused1;
|
377
|
+
zuint8 variable_name;
|
378
|
+
zuint16 unused2;
|
379
|
+
} array;
|
380
|
+
|
381
|
+
struct {zuint16 start_address;
|
382
|
+
zuint16 unused;
|
383
|
+
} code_file;
|
384
|
+
} parameters;
|
385
|
+
|
386
|
+
zuint8 checksum;
|
387
|
+
) ZZXSpectrumADCBlockHeader;
|
388
|
+
|
389
|
+
#define Z_ZX_SPECTRUM_ADC_BLOCK_TYPE_PROGRAM 0
|
390
|
+
#define Z_ZX_SPECTRUM_ADC_BLOCK_TYPE_NUMBER_ARRAY 1
|
391
|
+
#define Z_ZX_SPECTRUM_ADC_BLOCK_TYPE_CHARACTER_ARRAY 2
|
392
|
+
#define Z_ZX_SPECTRUM_ADC_BLOCK_TYPE_CODE_FILE 3
|
393
|
+
|
394
|
+
/* MARK: - State storage type */
|
395
|
+
|
396
|
+
typedef struct {
|
397
|
+
Z64Bit keyboard;
|
398
|
+
zuint8 flash;
|
399
|
+
|
400
|
+
union { ZZXSpectrumULAIO fields;
|
401
|
+
zuint8 value;
|
402
|
+
} ula_io;
|
403
|
+
} ZZXSpectrumState;
|
404
|
+
|
405
|
+
#endif /* _Z_hardware_machine_platform_computer_ZX_Spectrum_H_ */
|
@@ -0,0 +1,49 @@
|
|
1
|
+
/* Z Kit - hardware/machine/platform/console/Game Boy.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
|
+
| Vendor: Nintendo |
|
10
|
+
| Released: 1989-04-21 (JP) |
|
11
|
+
| 1989-07-31 (North America) |
|
12
|
+
| 1990-09-28 (Europe) |
|
13
|
+
| CPU: Sharp LR35902 @ 4.19 MHz |
|
14
|
+
'--------------------------------------'
|
15
|
+
|
16
|
+
Front view Back view
|
17
|
+
_n__________________ __________________n_
|
18
|
+
|_|________________|_| | | =| |
|
19
|
+
| ________________ | | | | |
|
20
|
+
| | __________ | | | O | | O |
|
21
|
+
| | .| | | | | |____________| |
|
22
|
+
| | | | | | | | | |
|
23
|
+
| | | | | | | | G0502050 | |
|
24
|
+
| | | | | | | | | | | |
|
25
|
+
| | '__________' | | | | |________| | |
|
26
|
+
| '_______________/ | | O| |O |
|
27
|
+
| _ GAME BOY™ | |==|=====.--.=====|==|
|
28
|
+
| _| |_ _ | |==|.----| |----.|==|
|
29
|
+
||_ O _| _ (_) | |==||============||==|
|
30
|
+
| |_| (_) A | |==||============||==|
|
31
|
+
| _ _ B | |==||============||==|
|
32
|
+
| // // | |==||============||==|
|
33
|
+
| \\\\\\ | | || || |
|
34
|
+
| \\\\\\ / \ '|____________|' |
|
35
|
+
'_________..________/ \___________________' */
|
36
|
+
|
37
|
+
#ifndef _Z_hardware_machine_platform_console_Game_Boy_H_
|
38
|
+
#define _Z_hardware_machine_platform_console_Game_Boy_H_
|
39
|
+
|
40
|
+
#include <Z/types/base.h>
|
41
|
+
|
42
|
+
/* MARK: - Screen */
|
43
|
+
|
44
|
+
#define Z_GAME_BOY_SCREEN_FPS 59.7
|
45
|
+
#define Z_GAME_BOY_SCREEN_WIDTH 160
|
46
|
+
#define Z_GAME_BOY_SCREEN_HEIGHT 144
|
47
|
+
#define Z_GAME_BOY_SCREEN_PIXELS 23040 /* 160 * 144 */
|
48
|
+
|
49
|
+
#endif /* _Z_hardware_machine_platform_console_Game_Boy_H_ */
|