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.
Files changed (285) hide show
  1. checksums.yaml +7 -0
  2. data/lib/zemu/config.rb +312 -0
  3. data/lib/zemu/instance.rb +179 -0
  4. data/lib/zemu.rb +172 -0
  5. data/src/debug.c +118 -0
  6. data/src/debug.h +30 -0
  7. data/src/external/Z/API/Z/ABIs/generic/allocator.h +36 -0
  8. data/src/external/Z/API/Z/ABIs/generic/cipher.h +47 -0
  9. data/src/external/Z/API/Z/ABIs/generic/data codec.h +33 -0
  10. data/src/external/Z/API/Z/ABIs/generic/emulation.h +103 -0
  11. data/src/external/Z/API/Z/ABIs/generic/hash function.h +33 -0
  12. data/src/external/Z/API/Z/ABIs/generic/module.h +33 -0
  13. data/src/external/Z/API/Z/ABIs/generic/wave codec.h +40 -0
  14. data/src/external/Z/API/Z/classes/base/InitializerList.hpp +34 -0
  15. data/src/external/Z/API/Z/classes/base/OpaqueFunctionPointer.hpp +26 -0
  16. data/src/external/Z/API/Z/classes/base/OpaqueMemberFunctionPointer.hpp +26 -0
  17. data/src/external/Z/API/Z/classes/base/Pair.hpp +46 -0
  18. data/src/external/Z/API/Z/classes/base/Range.hpp +111 -0
  19. data/src/external/Z/API/Z/classes/base/SizedString.hpp +66 -0
  20. data/src/external/Z/API/Z/classes/base/Status.hpp +89 -0
  21. data/src/external/Z/API/Z/classes/base/Symbol.hpp +39 -0
  22. data/src/external/Z/API/Z/classes/base/Tuple.hpp +111 -0
  23. data/src/external/Z/API/Z/classes/base/Value2D.hpp +389 -0
  24. data/src/external/Z/API/Z/classes/base/Value3D.hpp +368 -0
  25. data/src/external/Z/API/Z/classes/buffering/RingBuffer.hpp +93 -0
  26. data/src/external/Z/API/Z/classes/buffering/TripleBuffer.hpp +68 -0
  27. data/src/external/Z/API/Z/classes/functional/Functor.hpp +265 -0
  28. data/src/external/Z/API/Z/classes/functional/MemberFunction.hpp +98 -0
  29. data/src/external/Z/API/Z/classes/functional/ObjectMemberFunction.hpp +172 -0
  30. data/src/external/Z/API/Z/classes/functional/ObjectSelector.hpp +219 -0
  31. data/src/external/Z/API/Z/classes/functional/Selector.hpp +146 -0
  32. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/AABB.hpp +81 -0
  33. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/AABR.hpp +685 -0
  34. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Box.hpp +219 -0
  35. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Circle.hpp +80 -0
  36. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Line2D.hpp +93 -0
  37. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Line3D.hpp +80 -0
  38. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Rectangle.hpp +675 -0
  39. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Sphere.hpp +0 -0
  40. data/src/external/Z/API/Z/classes/memory/Shared.hpp +90 -0
  41. data/src/external/Z/API/Z/constants/base.h +35 -0
  42. data/src/external/Z/API/Z/constants/chemical elements.h +6385 -0
  43. data/src/external/Z/API/Z/constants/numbers.h +963 -0
  44. data/src/external/Z/API/Z/constants/version.h +15 -0
  45. data/src/external/Z/API/Z/formats/character set/ASCII.h +158 -0
  46. data/src/external/Z/API/Z/formats/character set/DOS CP437.h +159 -0
  47. data/src/external/Z/API/Z/formats/character set/DOS CP737.h +159 -0
  48. data/src/external/Z/API/Z/formats/character set/DOS CP775.h +159 -0
  49. data/src/external/Z/API/Z/formats/character set/DOS CP850.h +159 -0
  50. data/src/external/Z/API/Z/formats/character set/DOS CP852.h +159 -0
  51. data/src/external/Z/API/Z/formats/character set/DOS CP855.h +159 -0
  52. data/src/external/Z/API/Z/formats/character set/DOS CP857.h +159 -0
  53. data/src/external/Z/API/Z/formats/character set/DOS CP858.h +159 -0
  54. data/src/external/Z/API/Z/formats/character set/DOS CP860.h +159 -0
  55. data/src/external/Z/API/Z/formats/character set/DOS CP861.h +159 -0
  56. data/src/external/Z/API/Z/formats/character set/DOS CP862.h +159 -0
  57. data/src/external/Z/API/Z/formats/character set/DOS CP863.h +159 -0
  58. data/src/external/Z/API/Z/formats/character set/DOS CP864.h +159 -0
  59. data/src/external/Z/API/Z/formats/character set/DOS CP865.h +159 -0
  60. data/src/external/Z/API/Z/formats/character set/DOS CP866.h +159 -0
  61. data/src/external/Z/API/Z/formats/character set/DOS CP869.h +159 -0
  62. data/src/external/Z/API/Z/formats/character set/DOS CP872.h +159 -0
  63. data/src/external/Z/API/Z/formats/character set/DOS CP874.h +159 -0
  64. data/src/external/Z/API/Z/formats/character set/Unicode.h +30119 -0
  65. data/src/external/Z/API/Z/formats/data model/I16LP32.h +19 -0
  66. data/src/external/Z/API/Z/formats/data model/ILP32.h +19 -0
  67. data/src/external/Z/API/Z/formats/data model/ILP64.h +19 -0
  68. data/src/external/Z/API/Z/formats/data model/IP16L32.h +19 -0
  69. data/src/external/Z/API/Z/formats/data model/LLP64.h +19 -0
  70. data/src/external/Z/API/Z/formats/data model/LP32.h +19 -0
  71. data/src/external/Z/API/Z/formats/data model/LP64.h +19 -0
  72. data/src/external/Z/API/Z/formats/data model/SILP64.h +19 -0
  73. data/src/external/Z/API/Z/formats/file system/FAT12.h +61 -0
  74. data/src/external/Z/API/Z/formats/floating-point/IEEE 754.h +141 -0
  75. data/src/external/Z/API/Z/formats/floating-point/x87.h +74 -0
  76. data/src/external/Z/API/Z/formats/image/ICNS.h +39 -0
  77. data/src/external/Z/API/Z/formats/keymap/Mac OS.h +284 -0
  78. data/src/external/Z/API/Z/formats/keymap/Z.h +141 -0
  79. data/src/external/Z/API/Z/formats/multimedia/Creative Voice.h +106 -0
  80. data/src/external/Z/API/Z/formats/multimedia/Microsoft Wave.h +49 -0
  81. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ACH.h +44 -0
  82. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/FRZ.h +54 -0
  83. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/PRG.h +33 -0
  84. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SEM.h +46 -0
  85. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SIT.h +34 -0
  86. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SNA.h +117 -0
  87. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SNP.h +37 -0
  88. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SP.h +62 -0
  89. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/Z80.h +117 -0
  90. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ZX.h +56 -0
  91. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ZX82.h +70 -0
  92. data/src/external/Z/API/Z/formats/storage medium image/NES Game Pak/UNIF.h +26 -0
  93. data/src/external/Z/API/Z/formats/storage medium image/NES Game Pak/iNES.h +76 -0
  94. data/src/external/Z/API/Z/formats/storage medium image/audio/TAP.h +25 -0
  95. data/src/external/Z/API/Z/formats/storage medium image/audio/TZX.h +1185 -0
  96. data/src/external/Z/API/Z/formats/storage medium image/audio/Warajevo TAP.h +32 -0
  97. data/src/external/Z/API/Z/formats/storage medium image/floppy disk/FDI.h +45 -0
  98. data/src/external/Z/API/Z/functions/base/Z2D.h +583 -0
  99. data/src/external/Z/API/Z/functions/base/Z3D.h +712 -0
  100. data/src/external/Z/API/Z/functions/base/ZRange.h +137 -0
  101. data/src/external/Z/API/Z/functions/base/all.h +16 -0
  102. data/src/external/Z/API/Z/functions/base/casting.hpp +37 -0
  103. data/src/external/Z/API/Z/functions/base/character.h +38 -0
  104. data/src/external/Z/API/Z/functions/base/constructors.h +326 -0
  105. data/src/external/Z/API/Z/functions/base/structure.hpp +26 -0
  106. data/src/external/Z/API/Z/functions/base/type.hpp +60 -0
  107. data/src/external/Z/API/Z/functions/base/value.h +1901 -0
  108. data/src/external/Z/API/Z/functions/base/value.hpp +112 -0
  109. data/src/external/Z/API/Z/functions/buffering/ZRingBuffer.h +85 -0
  110. data/src/external/Z/API/Z/functions/buffering/ZTripleBuffer.h +65 -0
  111. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/Z2DLine.h +179 -0
  112. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/Z3DLine.h +168 -0
  113. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZAABB.h +361 -0
  114. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZAABR.h +1081 -0
  115. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZBox.h +340 -0
  116. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZCircle.h +142 -0
  117. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZRectangle.h +1267 -0
  118. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZSphere.h +156 -0
  119. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/all.h +18 -0
  120. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/constructors.h +620 -0
  121. data/src/external/Z/API/Z/functions/time/date.h +29 -0
  122. data/src/external/Z/API/Z/hardware/CPU/architecture/6502.h +90 -0
  123. data/src/external/Z/API/Z/hardware/CPU/architecture/Z80.h +245 -0
  124. data/src/external/Z/API/Z/hardware/CPU/architecture/i4004.h +37 -0
  125. data/src/external/Z/API/Z/hardware/PSG/General Instrument/AY-3-891x.h +180 -0
  126. data/src/external/Z/API/Z/hardware/VDC/Ricoh/RP2C0x.h +625 -0
  127. data/src/external/Z/API/Z/hardware/bus/AGP.h +24 -0
  128. data/src/external/Z/API/Z/hardware/bus/USB.h +510 -0
  129. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Inves Spectrum +.h +47 -0
  130. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Pentagon.h +13 -0
  131. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Scorpion.h +13 -0
  132. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum + 128K.h +158 -0
  133. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +.h +82 -0
  134. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +2.h +13 -0
  135. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +2A.h +13 -0
  136. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +3.h +13 -0
  137. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum.h +109 -0
  138. data/src/external/Z/API/Z/hardware/machine/model/console/Nintendo Entertainment System/NES-001 (NTSC).h +29 -0
  139. data/src/external/Z/API/Z/hardware/machine/model/console/Nintendo Entertainment System/NES-001 (PAL).h +29 -0
  140. data/src/external/Z/API/Z/hardware/machine/platform/computer/ZX Spectrum.h +405 -0
  141. data/src/external/Z/API/Z/hardware/machine/platform/console/Game Boy.h +49 -0
  142. data/src/external/Z/API/Z/hardware/machine/platform/console/Nintendo Entertainment System.h +350 -0
  143. data/src/external/Z/API/Z/hardware/storage medium/ROM cartridge/SNES Game Pak.h +238 -0
  144. data/src/external/Z/API/Z/inspection/C/completion.h +178 -0
  145. data/src/external/Z/API/Z/inspection/C/modules/C11.h +41 -0
  146. data/src/external/Z/API/Z/inspection/C/modules/C18.h +13 -0
  147. data/src/external/Z/API/Z/inspection/C/modules/C89.h +19 -0
  148. data/src/external/Z/API/Z/inspection/C/modules/C90.h +13 -0
  149. data/src/external/Z/API/Z/inspection/C/modules/C94.h +15 -0
  150. data/src/external/Z/API/Z/inspection/C/modules/C99.h +29 -0
  151. data/src/external/Z/API/Z/inspection/C/modules/KR C.h +19 -0
  152. data/src/external/Z/API/Z/inspection/C++/completion.h +512 -0
  153. data/src/external/Z/API/Z/inspection/C++/modules/C++03.h +15 -0
  154. data/src/external/Z/API/Z/inspection/C++/modules/C++11.h +80 -0
  155. data/src/external/Z/API/Z/inspection/C++/modules/C++14.h +26 -0
  156. data/src/external/Z/API/Z/inspection/C++/modules/C++17.h +55 -0
  157. data/src/external/Z/API/Z/inspection/C++/modules/C++85.h +11 -0
  158. data/src/external/Z/API/Z/inspection/C++/modules/C++89.h +13 -0
  159. data/src/external/Z/API/Z/inspection/C++/modules/C++98.h +17 -0
  160. data/src/external/Z/API/Z/inspection/C++.h +78 -0
  161. data/src/external/Z/API/Z/inspection/C.h +79 -0
  162. data/src/external/Z/API/Z/inspection/CPU/completion.h +56 -0
  163. data/src/external/Z/API/Z/inspection/CPU/detection.h +714 -0
  164. data/src/external/Z/API/Z/inspection/CPU/modules/6502.h +25 -0
  165. data/src/external/Z/API/Z/inspection/CPU/modules/AArch32.h +32 -0
  166. data/src/external/Z/API/Z/inspection/CPU/modules/AArch64.h +32 -0
  167. data/src/external/Z/API/Z/inspection/CPU/modules/Z80.h +26 -0
  168. data/src/external/Z/API/Z/inspection/CPU/modules/x86-32.h +31 -0
  169. data/src/external/Z/API/Z/inspection/CPU/modules/x86-64.h +312 -0
  170. data/src/external/Z/API/Z/inspection/CPU.h +209 -0
  171. data/src/external/Z/API/Z/inspection/OS/completion.h +36 -0
  172. data/src/external/Z/API/Z/inspection/OS/detection.h +768 -0
  173. data/src/external/Z/API/Z/inspection/OS/modules/Linux.h +22 -0
  174. data/src/external/Z/API/Z/inspection/OS/modules/MS-DOS.h +16 -0
  175. data/src/external/Z/API/Z/inspection/OS/modules/Mac OS X.h +23 -0
  176. data/src/external/Z/API/Z/inspection/OS/modules/Windows.h +19 -0
  177. data/src/external/Z/API/Z/inspection/OS/modules/iPhone OS.h +23 -0
  178. data/src/external/Z/API/Z/inspection/OS.h +236 -0
  179. data/src/external/Z/API/Z/inspection/Objective-C/completion.h +8 -0
  180. data/src/external/Z/API/Z/inspection/Objective-C/modules/Objective-C v1.0.h +11 -0
  181. data/src/external/Z/API/Z/inspection/Objective-C/modules/Objective-C v2.0.h +15 -0
  182. data/src/external/Z/API/Z/inspection/Objective-C.h +51 -0
  183. data/src/external/Z/API/Z/inspection/Z.h +19 -0
  184. data/src/external/Z/API/Z/inspection/build.h +22 -0
  185. data/src/external/Z/API/Z/inspection/character set.h +66 -0
  186. data/src/external/Z/API/Z/inspection/compiler/completion.h +2885 -0
  187. data/src/external/Z/API/Z/inspection/compiler/modules/Apple LLVM.h +26 -0
  188. data/src/external/Z/API/Z/inspection/compiler/modules/Clang.h +1664 -0
  189. data/src/external/Z/API/Z/inspection/compiler/modules/GCC.h +1366 -0
  190. data/src/external/Z/API/Z/inspection/compiler/modules/SCCZ80.h +473 -0
  191. data/src/external/Z/API/Z/inspection/compiler/modules/Visual C++.h +606 -0
  192. data/src/external/Z/API/Z/inspection/compiler/modules/cc65.h +529 -0
  193. data/src/external/Z/API/Z/inspection/compiler/modules/generic.h +13 -0
  194. data/src/external/Z/API/Z/inspection/compiler/modules/template.h +650 -0
  195. data/src/external/Z/API/Z/inspection/compiler.h +299 -0
  196. data/src/external/Z/API/Z/inspection/data model/completion.h +128 -0
  197. data/src/external/Z/API/Z/inspection/data model/deduction.h +9 -0
  198. data/src/external/Z/API/Z/inspection/data model/detection.h +45 -0
  199. data/src/external/Z/API/Z/inspection/data model.h +362 -0
  200. data/src/external/Z/API/Z/inspection/floating-point/completion.h +50 -0
  201. data/src/external/Z/API/Z/inspection/floating-point.h +324 -0
  202. data/src/external/Z/API/Z/inspection/language.h +163 -0
  203. data/src/external/Z/API/Z/inspection/platform/detection.h +9 -0
  204. data/src/external/Z/API/Z/inspection/platform.h +29 -0
  205. data/src/external/Z/API/Z/keys/C++.h +27 -0
  206. data/src/external/Z/API/Z/keys/C.h +29 -0
  207. data/src/external/Z/API/Z/keys/CPU.h +80 -0
  208. data/src/external/Z/API/Z/keys/OS.h +182 -0
  209. data/src/external/Z/API/Z/keys/Objective-C.h +17 -0
  210. data/src/external/Z/API/Z/keys/chemistry.h +26 -0
  211. data/src/external/Z/API/Z/keys/compiler.h +178 -0
  212. data/src/external/Z/API/Z/keys/data model.h +32 -0
  213. data/src/external/Z/API/Z/keys/endianness.h +24 -0
  214. data/src/external/Z/API/Z/keys/language.h +21 -0
  215. data/src/external/Z/API/Z/keys/layout.h +20 -0
  216. data/src/external/Z/API/Z/keys/mathematics/geometry.h +29 -0
  217. data/src/external/Z/API/Z/keys/mathematics/number.h +21 -0
  218. data/src/external/Z/API/Z/keys/order.h +18 -0
  219. data/src/external/Z/API/Z/keys/platform.h +87 -0
  220. data/src/external/Z/API/Z/keys/program.h +39 -0
  221. data/src/external/Z/API/Z/keys/science/chemical elements.h +200 -0
  222. data/src/external/Z/API/Z/keys/science/electricity.h +18 -0
  223. data/src/external/Z/API/Z/keys/science/magnetism.h +19 -0
  224. data/src/external/Z/API/Z/keys/status.h +69 -0
  225. data/src/external/Z/API/Z/keys/text.h +27 -0
  226. data/src/external/Z/API/Z/keys/value.h +88 -0
  227. data/src/external/Z/API/Z/macros/arguments.h +25 -0
  228. data/src/external/Z/API/Z/macros/casting.h +22 -0
  229. data/src/external/Z/API/Z/macros/character.h +159 -0
  230. data/src/external/Z/API/Z/macros/date.h +14 -0
  231. data/src/external/Z/API/Z/macros/key.h +20 -0
  232. data/src/external/Z/API/Z/macros/language.h +126 -0
  233. data/src/external/Z/API/Z/macros/language.hpp +81 -0
  234. data/src/external/Z/API/Z/macros/members.h +86 -0
  235. data/src/external/Z/API/Z/macros/pasting.h +308 -0
  236. data/src/external/Z/API/Z/macros/pointer.h +33 -0
  237. data/src/external/Z/API/Z/macros/repetition.h +283 -0
  238. data/src/external/Z/API/Z/macros/structure.h +104 -0
  239. data/src/external/Z/API/Z/macros/templating.h +407 -0
  240. data/src/external/Z/API/Z/macros/tokens.h +14 -0
  241. data/src/external/Z/API/Z/macros/type enumeration.h +43 -0
  242. data/src/external/Z/API/Z/macros/type selection.hpp +76 -0
  243. data/src/external/Z/API/Z/macros/value.h +489 -0
  244. data/src/external/Z/API/Z/macros/variadic pasting.h +21 -0
  245. data/src/external/Z/API/Z/macros/variadic selection.h +56 -0
  246. data/src/external/Z/API/Z/macros/variadic.h +46 -0
  247. data/src/external/Z/API/Z/macros/version.h +17 -0
  248. data/src/external/Z/API/Z/network/3/IP.h +36 -0
  249. data/src/external/Z/API/Z/network/4/TCP.h +24 -0
  250. data/src/external/Z/API/Z/network/4/UDP.h +26 -0
  251. data/src/external/Z/API/Z/network/7/ED2K.h +104 -0
  252. data/src/external/Z/API/Z/network/7/HTTP.h +100 -0
  253. data/src/external/Z/API/Z/traits/SelectType.hpp +71 -0
  254. data/src/external/Z/API/Z/traits/TernaryType.hpp +20 -0
  255. data/src/external/Z/API/Z/traits/Type.hpp +4516 -0
  256. data/src/external/Z/API/Z/traits/TypeCount.hpp +52 -0
  257. data/src/external/Z/API/Z/traits/TypeList.hpp +376 -0
  258. data/src/external/Z/API/Z/traits/base.hpp +19 -0
  259. data/src/external/Z/API/Z/traits/filtering.hpp +30 -0
  260. data/src/external/Z/API/Z/traits/mathematics.hpp +48 -0
  261. data/src/external/Z/API/Z/types/arguments.h +19 -0
  262. data/src/external/Z/API/Z/types/base.h +1655 -0
  263. data/src/external/Z/API/Z/types/base.hpp +169 -0
  264. data/src/external/Z/API/Z/types/buffering.h +27 -0
  265. data/src/external/Z/API/Z/types/mathematics.h +135 -0
  266. data/src/external/Z/API/Z/types/time.h +23 -0
  267. data/src/external/Z/COPYING.LESSER +165 -0
  268. data/src/external/Z/development/Qt Creator/Z.pro +253 -0
  269. data/src/external/Z/distribution/CocoaPods/Zeta.podspec +18 -0
  270. data/src/external/Z/distribution/Gentoo Linux/Zeta-0.1.ebuild +22 -0
  271. data/src/external/Z/distribution/Gentoo Linux/metadata.xml +8 -0
  272. data/src/external/Z/distribution/Homebrew/Zeta.rb +11 -0
  273. data/src/external/z80/API/emulation/CPU/Z80.h +201 -0
  274. data/src/external/z80/README.md +229 -0
  275. data/src/external/z80/building/premake4.lua +33 -0
  276. data/src/external/z80/development/Xcode/Z80.xcodeproj/project.pbxproj +520 -0
  277. data/src/external/z80/sources/Z80.c +1660 -0
  278. data/src/interrupt.c +6 -0
  279. data/src/interrupt.h +3 -0
  280. data/src/io.c.erb +115 -0
  281. data/src/io.h.erb +18 -0
  282. data/src/main.c +69 -0
  283. data/src/memory.c.erb +43 -0
  284. data/src/memory.h.erb +9 -0
  285. metadata +329 -0
@@ -0,0 +1,340 @@
1
+ /* Z Kit - functions/mathematics/geometry/euclidean/ZBox.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_mathematics_geometry_euclidean_ZBox_H_
9
+ #define _Z_functions_mathematics_geometry_euclidean_ZBox_H_
10
+
11
+ #include <Z/functions/mathematics/geometry/euclidean/constructors.h>
12
+ #include <Z/functions/base/Z3D.h>
13
+
14
+
15
+ /* MARK: - Common implementation */
16
+
17
+
18
+ #define Z_IMPLEMENTATION_COMMON(Type, type) \
19
+ \
20
+ static Z_INLINE \
21
+ ZAABB##Type z_box_##type##_aabb(ZBox##Type object) \
22
+ { \
23
+ return z_aabb_##type \
24
+ (object.point.x, object.point.y, object.point.z, \
25
+ object.point.x + object.size.x, \
26
+ object.point.y + object.size.y, \
27
+ object.point.z + object.size.z); \
28
+ } \
29
+ \
30
+ \
31
+ static Z_INLINE \
32
+ zboolean z_box_##type##_are_equal(ZBox##Type a, ZBox##Type b) \
33
+ { \
34
+ return z_3d_##type##_are_equal(a.point, b.point) && \
35
+ z_3d_##type##_are_equal(a.size, b.size ); \
36
+ } \
37
+ \
38
+ \
39
+ static Z_INLINE \
40
+ Z3D##Type z_box_##type##_center(ZBox##Type object) \
41
+ { \
42
+ return z_3d_##type \
43
+ (object.point.x + object.size.x / (z##type)2, \
44
+ object.point.y + object.size.y / (z##type)2, \
45
+ object.point.z + object.size.z / (z##type)2); \
46
+ } \
47
+ \
48
+ \
49
+ static Z_INLINE \
50
+ zboolean z_box_##type##_contains(ZBox##Type object, ZBox##Type other) \
51
+ { \
52
+ return other.size.x != (z##type)0 && \
53
+ other.size.y != (z##type)0 && \
54
+ other.size.z != (z##type)0 && \
55
+ other.point.x >= object.point.x && \
56
+ other.point.y >= object.point.y && \
57
+ other.point.z >= object.point.z && \
58
+ other.point.x + other.size.x <= object.point.x + object.size.x && \
59
+ other.point.y + other.size.y <= object.point.y + object.size.y && \
60
+ other.point.z + other.size.z <= object.point.z + object.size.z; \
61
+ } \
62
+ \
63
+ \
64
+ static Z_INLINE \
65
+ zboolean z_box_##type##_contains_aabb(ZBox##Type object, ZAABB##Type aabb) \
66
+ { \
67
+ return aabb.a.x != aabb.b.x && \
68
+ aabb.a.y != aabb.b.y && \
69
+ aabb.a.z != aabb.b.z && \
70
+ aabb.a.x >= object.point.x && \
71
+ aabb.a.y >= object.point.y && \
72
+ aabb.a.z >= object.point.z && \
73
+ aabb.b.x <= object.point.x + object.size.x && \
74
+ aabb.b.y <= object.point.y + object.size.y && \
75
+ aabb.b.z <= object.point.z + object.size.z; \
76
+ } \
77
+ \
78
+ \
79
+ static Z_INLINE \
80
+ zboolean z_box_##type##_contains_point(ZBox##Type object, Z3D##Type point) \
81
+ { \
82
+ return point.x >= object.point.x && \
83
+ point.y >= object.point.y && \
84
+ point.z >= object.point.z && \
85
+ point.x < object.point.x + object.size.x && \
86
+ point.y < object.point.y + object.size.y && \
87
+ point.z < object.point.z + object.size.z; \
88
+ } \
89
+ \
90
+ \
91
+ static Z_INLINE \
92
+ ZBox##Type z_box_##type##_correct(ZBox##Type object) \
93
+ { \
94
+ if (object.size.x < (z##type)0) object.point.x -= (object.size.x = -object.size.x); \
95
+ if (object.size.y < (z##type)0) object.point.y -= (object.size.y = -object.size.y); \
96
+ if (object.size.z < (z##type)0) object.point.z -= (object.size.z = -object.size.z); \
97
+ return object; \
98
+ } \
99
+ \
100
+ \
101
+ static Z_INLINE \
102
+ ZBox##Type z_box_##type##_from_vertices(Z3D##Type a, Z3D##Type b) \
103
+ { \
104
+ Z3D##Type minimum = z_3d_##type##_minimum(a, b); \
105
+ Z3D##Type maximum = z_3d_##type##_maximum(a, b); \
106
+ \
107
+ return z_box_##type \
108
+ (minimum.x, minimum.y, minimum.z, \
109
+ z_##type##_maximum(a.x, b.x) - minimum.x, \
110
+ z_##type##_maximum(a.y, b.y) - minimum.y, \
111
+ z_##type##_maximum(a.z, b.z) - minimum.z); \
112
+ } \
113
+ \
114
+ \
115
+ static Z_INLINE \
116
+ zboolean z_box_##type##_intersect(ZBox##Type a, ZBox##Type b) \
117
+ { \
118
+ return a.size.x != (z##type)0 && \
119
+ a.size.y != (z##type)0 && \
120
+ a.size.z != (z##type)0 && \
121
+ b.size.x != (z##type)0 && \
122
+ b.size.y != (z##type)0 && \
123
+ b.size.z != (z##type)0 && \
124
+ b.point.x + b.size.x > a.point.x && \
125
+ b.point.y + b.size.y > a.point.y && \
126
+ b.point.z + b.size.z > a.point.z && \
127
+ b.point.x < a.point.x + a.size.x && \
128
+ b.point.y < a.point.y + a.size.y && \
129
+ b.point.z < a.point.z + a.size.z; \
130
+ } \
131
+ \
132
+ \
133
+ static Z_INLINE \
134
+ ZBox##Type z_box_##type##_intersection(ZBox##Type a, ZBox##Type b) \
135
+ { \
136
+ z##type x1, x2, y1, y2, z1, z2; \
137
+ \
138
+ return (x1 = z_##type##_maximum(a.point.x, b.point.x)) < \
139
+ (x2 = z_##type##_minimum(a.point.x + a.size.x, b.point.x + b.size.x)) && \
140
+ (y1 = z_##type##_maximum(a.point.y, b.point.y)) < \
141
+ (y2 = z_##type##_minimum(a.point.y + a.size.y, b.point.y + b.size.y)) && \
142
+ (z1 = z_##type##_maximum(a.point.z, b.point.z)) < \
143
+ (z2 = z_##type##_minimum(a.point.z + a.size.z, b.point.z + b.size.z)) \
144
+ \
145
+ ? z_box_##type(x1, y1, z1, x2 - x1, y2 - y1, z2 - z1) \
146
+ : z_box_##type##_zero; \
147
+ } \
148
+ \
149
+ \
150
+ static Z_INLINE \
151
+ zboolean z_box_##type##_is_zero(ZBox##Type object) \
152
+ {return z_3d_##type##_is_zero(object.point) && z_3d_##type##_is_zero(object.size);} \
153
+ \
154
+ \
155
+ static Z_INLINE \
156
+ void z_box_##type##_swap(ZBox##Type *a, ZBox##Type *b) \
157
+ { \
158
+ ZBox##Type t = *a; \
159
+ \
160
+ *a = *b; *b = t; \
161
+ } \
162
+ \
163
+ \
164
+ static Z_INLINE \
165
+ ZBox##Type z_box_##type##_union(ZBox##Type a, ZBox##Type b) \
166
+ { \
167
+ ZBox##Type result; \
168
+ \
169
+ result.point = z_3d_##type##_minimum(a.point, b.point); \
170
+ \
171
+ result.size.x = \
172
+ z_##type##_maximum(a.point.x + a.size.x, b.point.x + b.size.x) - result.point.x; \
173
+ \
174
+ result.size.y = \
175
+ z_##type##_maximum(a.point.y + a.size.y, b.point.y + b.size.y) - result.point.y; \
176
+ \
177
+ result.size.z = \
178
+ z_##type##_maximum(a.point.z + a.size.z, b.point.z + b.size.z) - result.point.z; \
179
+ \
180
+ return result; \
181
+ }
182
+
183
+
184
+ #define z_box_type_aabb( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _aabb )
185
+ #define z_box_type_are_equal( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _are_equal )
186
+ #define z_box_type_center( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _center )
187
+ #define z_box_type_contains( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _contains )
188
+ #define z_box_type_contains_aabb( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _contains_aabb )
189
+ #define z_box_type_contains_point(TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _contains_point)
190
+ #define z_box_type_correct( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _correct )
191
+ #define z_box_type_from_vertices( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _from_vertices )
192
+ #define z_box_type_intersect( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _intersect )
193
+ #define z_box_type_intersection( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _intersection )
194
+ #define z_box_type_is_zero( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _is_zero )
195
+ #define z_box_type_swap( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _swap )
196
+ #define z_box_type_union( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _union )
197
+
198
+
199
+ /* MARK: - Partial implementation for real types */
200
+
201
+
202
+ #define Z_IMPLEMENTATION_REAL(Type, type) \
203
+ \
204
+ static Z_INLINE \
205
+ Z3D##Type z_box_##type##_absolute_point_to_unit(ZBox##Type object, Z3D##Type point) \
206
+ { \
207
+ return z_3d_##type \
208
+ ((point.x - object.point.x) / object.size.x, \
209
+ (point.y - object.point.y) / object.size.y, \
210
+ (point.z - object.point.z) / object.size.z); \
211
+ } \
212
+ \
213
+ \
214
+ static Z_INLINE \
215
+ zboolean z_box_##type##_contains_sphere(ZBox##Type object, ZSphere##Type sphere) \
216
+ { \
217
+ return sphere.radius != (z##type)0 && \
218
+ sphere.point.x - sphere.radius >= object.point.x && \
219
+ sphere.point.y - sphere.radius >= object.point.y && \
220
+ sphere.point.z - sphere.radius >= object.point.z && \
221
+ sphere.point.x + sphere.radius <= object.point.x + object.size.x && \
222
+ sphere.point.y + sphere.radius <= object.point.y + object.size.y && \
223
+ sphere.point.z + sphere.radius <= object.point.z + object.size.z; \
224
+ } \
225
+ \
226
+ \
227
+ static Z_INLINE \
228
+ ZSphere##Type z_box_##type##_inner_sphere(ZBox##Type object) \
229
+ { \
230
+ ZSphere##Type result; \
231
+ \
232
+ result.point = z_box_##type##_center(object); \
233
+ \
234
+ result.radius = \
235
+ z_##type##_minimum(z_##type##_minimum(object.size.x, object.size.y), object.size.z) \
236
+ / (z##type)2; \
237
+ \
238
+ return result; \
239
+ } \
240
+ \
241
+ \
242
+ static Z_INLINE \
243
+ Z3D##Type z_box_##type##_unit_point_to_absolute(ZBox##Type object, Z3D##Type point) \
244
+ { \
245
+ return z_3d_##type \
246
+ (point.x * object.size.x + object.point.x, \
247
+ point.y * object.size.y + object.point.y, \
248
+ point.z * object.size.z + object.point.z); \
249
+ }
250
+
251
+
252
+ #define z_box_type_absolute_point_to_unit(TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _absolute_point_to_unit)
253
+ #define z_box_type_contains_sphere( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _contains_sphere )
254
+ #define z_box_type_inner_sphere( TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _inner_sphere )
255
+ #define z_box_type_unit_point_to_absolute(TYPE) Z_INSERT_##TYPE##_fixed_type(z_box_, _unit_point_to_absolute)
256
+
257
+
258
+ /* MARK: - Implementation expansions */
259
+
260
+
261
+ Z_IMPLEMENTATION_COMMON(SInt8, sint8 )
262
+ Z_IMPLEMENTATION_COMMON(SInt16, sint16)
263
+ Z_IMPLEMENTATION_COMMON(SInt32, sint32)
264
+
265
+ #ifdef Z_SINT64
266
+ Z_IMPLEMENTATION_COMMON(SInt64, sint64)
267
+ #endif
268
+
269
+ #ifdef Z_SINT128
270
+ Z_IMPLEMENTATION_COMMON(SInt128, sint128)
271
+ #endif
272
+
273
+ #ifdef Z_FLOAT16
274
+ Z_IMPLEMENTATION_COMMON(Float16, float16)
275
+ Z_IMPLEMENTATION_REAL (Float16, float16)
276
+ #endif
277
+
278
+ #ifdef Z_FLOAT32
279
+ Z_IMPLEMENTATION_COMMON(Float32, float32)
280
+ Z_IMPLEMENTATION_REAL (Float32, float32)
281
+ #endif
282
+
283
+ #ifdef Z_FLOAT64
284
+ Z_IMPLEMENTATION_COMMON(Float64, float64)
285
+ Z_IMPLEMENTATION_REAL (Float64, float64)
286
+ #endif
287
+
288
+ #ifdef Z_FLOAT128
289
+ Z_IMPLEMENTATION_COMMON(Float128, float128)
290
+ Z_IMPLEMENTATION_REAL (Float128, float128)
291
+ #endif
292
+
293
+ #ifdef Z_FLOAT80_X87
294
+ Z_IMPLEMENTATION_COMMON(Float80_x87, float80_x87)
295
+ Z_IMPLEMENTATION_REAL (Float80_x87, float80_x87)
296
+ #endif
297
+
298
+ #ifdef Z_FLOAT96_X87
299
+ Z_IMPLEMENTATION_COMMON(Float96_x87, float96_x87)
300
+ Z_IMPLEMENTATION_REAL (Float96_x87, float96_x87)
301
+ #endif
302
+
303
+ #ifdef Z_FLOAT128_X87
304
+ Z_IMPLEMENTATION_COMMON(Float128_x87, float128_x87)
305
+ Z_IMPLEMENTATION_REAL (Float128_x87, float128_x87)
306
+ #endif
307
+
308
+
309
+ /* MARK: - Cleanup */
310
+
311
+
312
+ #undef Z_IMPLEMENTATION_COMMON
313
+ #undef Z_IMPLEMENTATION_REAL
314
+
315
+
316
+ /* MARK: - Default real type definitions */
317
+
318
+
319
+ #ifdef Z_REAL
320
+ # define z_box_aabb z_box_type_aabb (REAL)
321
+ # define z_box_absolute_point_to_unit z_box_type_absolute_point_to_unit(REAL)
322
+ # define z_box_are_equal z_box_type_are_equal (REAL)
323
+ # define z_box_center z_box_type_center (REAL)
324
+ # define z_box_contains z_box_type_contains (REAL)
325
+ # define z_box_contains_aabb z_box_type_contains_aabb (REAL)
326
+ # define z_box_contains_point z_box_type_contains_point (REAL)
327
+ # define z_box_contains_sphere z_box_type_contains_sphere (REAL)
328
+ # define z_box_correct z_box_type_correct (REAL)
329
+ # define z_box_from_vertices z_box_type_from_vertices (REAL)
330
+ # define z_box_inner_sphere z_box_type_inner_sphere (REAL)
331
+ # define z_box_intersect z_box_type_intersect (REAL)
332
+ # define z_box_intersection z_box_type_intersection (REAL)
333
+ # define z_box_is_zero z_box_type_is_zero (REAL)
334
+ # define z_box_swap z_box_type_swap (REAL)
335
+ # define z_box_union z_box_type_union (REAL)
336
+ # define z_box_unit_point_to_absolute z_box_type_unit_point_to_absolute(REAL)
337
+ #endif
338
+
339
+
340
+ #endif /* _Z_functions_mathematics_geometry_euclidean_ZBox_H_ */
@@ -0,0 +1,142 @@
1
+ /* Z Kit - functions/mathematics/geometry/euclidean/ZCircle.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_mathematics_geometry_euclidean_ZCircle_H_
9
+ #define _Z_functions_mathematics_geometry_euclidean_ZCircle_H_
10
+
11
+ #include <Z/functions/mathematics/geometry/euclidean/constructors.h>
12
+ #include <Z/functions/base/Z2D.h>
13
+ #include <Z/constants/numbers.h>
14
+
15
+
16
+ /* MARK: - Implementation */
17
+
18
+
19
+ #define Z_IMPLEMENTATION(Type, type, _) \
20
+ \
21
+ static Z_INLINE \
22
+ zboolean z_circle_##type##_are_equal(ZCircle##Type a, ZCircle##Type b) \
23
+ {return a.radius == b.radius && z_2d_##type##_are_equal(a.point, b.point);} \
24
+ \
25
+ \
26
+ static Z_INLINE \
27
+ ZAABR##Type z_circle_##type##_inner_aabr(ZCircle##Type object) \
28
+ { \
29
+ z##type half_size = object.radius / _(Z_SQUARE_ROOT_2); \
30
+ \
31
+ return z_aabr_##type \
32
+ (object.point.x - half_size, object.point.y - half_size, \
33
+ object.point.x + half_size, object.point.x + half_size); \
34
+ } \
35
+ \
36
+ \
37
+ static Z_INLINE \
38
+ ZRectangle##Type z_circle_##type##_inner_rectangle(ZCircle##Type object) \
39
+ { \
40
+ z##type half_size = object.radius / _(Z_SQUARE_ROOT_2); \
41
+ z##type size = half_size * _(2.0); \
42
+ \
43
+ return z_rectangle_##type \
44
+ (object.point.x - half_size, object.point.y - half_size, size, size); \
45
+ } \
46
+ \
47
+ \
48
+ static Z_INLINE \
49
+ zboolean z_circle_##type##_is_zero(ZCircle##Type object) \
50
+ {return object.radius == _(0.0) && z_2d_##type##_is_zero(object.point);} \
51
+ \
52
+ \
53
+ static Z_INLINE \
54
+ ZAABR##Type z_circle_##type##_outer_aabr(ZCircle##Type object) \
55
+ { \
56
+ return z_aabr_##type \
57
+ (object.point.x - object.radius, object.point.y - object.radius, \
58
+ object.point.x + object.radius, object.point.y + object.radius); \
59
+ } \
60
+ \
61
+ \
62
+ static Z_INLINE \
63
+ ZRectangle##Type z_circle_##type##_outer_rectangle(ZCircle##Type object) \
64
+ { \
65
+ z##type size = object.radius * _(2.0); \
66
+ \
67
+ return z_rectangle_##type \
68
+ (object.point.x - object.radius, object.point.y - object.radius, size, size); \
69
+ } \
70
+ \
71
+ \
72
+ static Z_INLINE \
73
+ void z_circle_##type##_swap(ZCircle##Type *a, ZCircle##Type *b) \
74
+ { \
75
+ ZCircle##Type t = *a; \
76
+ \
77
+ *a = *b; *b = t; \
78
+ }
79
+
80
+
81
+ #define z_circle_type_are_equal( TYPE) Z_INSERT_##TYPE##_fixed_type(z_circle_, _are_equal )
82
+ #define z_circle_type_inner_aabr( TYPE) Z_INSERT_##TYPE##_fixed_type(z_circle_, _inner_aabr )
83
+ #define z_circle_type_inner_rectangle(TYPE) Z_INSERT_##TYPE##_fixed_type(z_circle_, _inner_rectangle)
84
+ #define z_circle_type_is_zero( TYPE) Z_INSERT_##TYPE##_fixed_type(z_circle_, _is_zero )
85
+ #define z_circle_type_outer_aabr( TYPE) Z_INSERT_##TYPE##_fixed_type(z_circle_, _outer_aabr )
86
+ #define z_circle_type_outer_rectangle(TYPE) Z_INSERT_##TYPE##_fixed_type(z_circle_, _outer_rectangle)
87
+ #define z_circle_type_swap( TYPE) Z_INSERT_##TYPE##_fixed_type(z_circle_, _swap )
88
+
89
+
90
+ /* MARK: - Implementation expansions */
91
+
92
+
93
+ #ifdef Z_FLOAT16
94
+ Z_IMPLEMENTATION(Float16, float16, Z_FLOAT16)
95
+ #endif
96
+
97
+ #ifdef Z_FLOAT32
98
+ Z_IMPLEMENTATION(Float32, float32, Z_FLOAT32)
99
+ #endif
100
+
101
+ #ifdef Z_FLOAT64
102
+ Z_IMPLEMENTATION(Float64, float64, Z_FLOAT64)
103
+ #endif
104
+
105
+ #ifdef Z_FLOAT128
106
+ Z_IMPLEMENTATION(Float128, float128, Z_FLOAT128)
107
+ #endif
108
+
109
+ #ifdef Z_FLOAT80_X87
110
+ Z_IMPLEMENTATION(Float80_x87, float80_x87, Z_FLOAT80_X87)
111
+ #endif
112
+
113
+ #ifdef Z_FLOAT96_X87
114
+ Z_IMPLEMENTATION(Float96_x87, float96_x87, Z_FLOAT96_X87)
115
+ #endif
116
+
117
+ #ifdef Z_FLOAT128_X87
118
+ Z_IMPLEMENTATION(Float128_x87, float128_x87, Z_FLOAT128_X87)
119
+ #endif
120
+
121
+
122
+ /* MARK: - Cleanup */
123
+
124
+
125
+ #undef Z_IMPLEMENTATION
126
+
127
+
128
+ /* MARK: - Default real type definitions */
129
+
130
+
131
+ #ifdef Z_REAL
132
+ # define z_circle_are_equal z_circle_type_are_equal (REAL)
133
+ # define z_circle_inner_aabr z_circle_type_inner_aabr (REAL)
134
+ # define z_circle_inner_rectangle z_circle_type_inner_rectangle(REAL)
135
+ # define z_circle_is_zero z_circle_type_is_zero (REAL)
136
+ # define z_circle_outer_aabr z_circle_type_outer_aabr (REAL)
137
+ # define z_circle_outer_rectangle z_circle_type_outer_rectangle(REAL)
138
+ # define z_circle_swap z_circle_type_swap (REAL)
139
+ #endif
140
+
141
+
142
+ #endif /* _Z_functions_mathematics_geometry_euclidean_ZCircle_H_ */