zemu 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,90 @@
1
+ /* Z Kit - hardware/CPU/architecture/6502.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
+ Registers:
9
+ .-----------------------------------.
10
+ | F E D C B A 9 8 | 7 6 5 4 3 2 1 0 |
11
+ |-----------------------------------|
12
+ | PC | Program Counter
13
+ '-----------------------------------|
14
+ | S | Stack Pointer
15
+ |-----------------|
16
+ | P | Program Status (flags)
17
+ |-----------------|
18
+ | A | Accumulator
19
+ |-----------------|
20
+ | X | X Index
21
+ |-----------------|
22
+ | Y | Y Index
23
+ '-----------------'
24
+
25
+ Status (P register):
26
+ .-----------------.
27
+ | 7 6 5 4 3 2 1 0 |
28
+ | N V - B D I Z C |
29
+ '-|-|-|-|-|-|-|-|-'
30
+ | | | | | | | '-> carry
31
+ | | | | | | '---> zero
32
+ | | | | | '-----> interrupt (IRQ disable)
33
+ | | | | '-------> decimal (use BCD for arithmetics)
34
+ | | | '---------> break
35
+ | | '-----------> (ignored)
36
+ | '-------------> overflow
37
+ '---------------> negative */
38
+
39
+ #ifndef _Z_hardware_CPU_architecture_6502_H_
40
+ #define _Z_hardware_CPU_architecture_6502_H_
41
+
42
+ #include <Z/types/base.h>
43
+
44
+ /* MARK: - Addresses */
45
+
46
+ #define Z_6502_ADDRESS_NMI_POINTER 0xFFFA
47
+ #define Z_6502_ADDRESS_RESET_POINTER 0XFFFC
48
+ #define Z_6502_ADDRESS_IRQ_POINTER 0xFFFE
49
+ #define Z_6502_ADDRESS_BRK_POINTER 0xFFFE
50
+ #define Z_6502_ADDRESS_STACK 0x0100
51
+
52
+ /* MARK: - Values after power on */
53
+
54
+ #define Z_6502_VALUE_AFTER_POWER_ON_PC 0x0000
55
+ #define Z_6502_VALUE_AFTER_POWER_ON_S 0xFD
56
+ #define Z_6502_VALUE_AFTER_POWER_ON_P 0x36
57
+ #define Z_6502_VALUE_AFTER_POWER_ON_A 0x00
58
+ #define Z_6502_VALUE_AFTER_POWER_ON_X 0x00
59
+ #define Z_6502_VALUE_AFTER_POWER_ON_Y 0x00
60
+
61
+ /* MARK: - State storage type */
62
+
63
+ Z_DEFINE_STRICT_STRUCTURE_BEGIN
64
+ zuint16 pc;
65
+ zuint8 s, p, a, x, y;
66
+
67
+ struct {zuint8 irq :1;
68
+ zuint8 nmi :1;
69
+ } internal;
70
+ Z_DEFINE_STRICT_STRUCTURE_END Z6502State;
71
+
72
+ #define Z_6502_STATE_PC( object) (object)->pc
73
+ #define Z_6502_STATE_S( object) (object)->s
74
+ #define Z_6502_STATE_P( object) (object)->p
75
+ #define Z_6502_STATE_A( object) (object)->a
76
+ #define Z_6502_STATE_X( object) (object)->x
77
+ #define Z_6502_STATE_Y( object) (object)->y
78
+ #define Z_6502_STATE_NMI(object) (object)->internal.nmi
79
+ #define Z_6502_STATE_IRQ(object) (object)->internal.irq
80
+
81
+ #define Z_6502_STATE_MEMBER_PC pc
82
+ #define Z_6502_STATE_MEMBER_S s
83
+ #define Z_6502_STATE_MEMBER_P p
84
+ #define Z_6502_STATE_MEMBER_A a
85
+ #define Z_6502_STATE_MEMBER_X x
86
+ #define Z_6502_STATE_MEMBER_Y y
87
+ #define Z_6502_STATE_MEMBER_NMI internal.nmi
88
+ #define Z_6502_STATE_MEMBER_IRQ internal.irq
89
+
90
+ #endif /* _Z_hardware_CPU_architecture_6502_H_ */
@@ -0,0 +1,245 @@
1
+ /* Z Kit - hardware/CPU/architecture/Z80.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
+ Registers:
9
+ .-----------------------------------.
10
+ | F E D C B A 9 8 | 7 6 5 4 3 2 1 0 |
11
+ |-----------------------------------|
12
+ | PC |
13
+ |-----------------------------------|
14
+ | SP |
15
+ |-----------------------------------|
16
+ | A AF F |
17
+ |-----------------------------------|
18
+ | B BC C |
19
+ |-----------------------------------|
20
+ | D DE E |
21
+ |-----------------------------------|
22
+ | H HL L |
23
+ |-----------------------------------|
24
+ | IXH IX IXL |
25
+ |-----------------------------------|
26
+ | IYH IY IYL |
27
+ |-----------------------------------|
28
+ | AF' |
29
+ |-----------------------------------|
30
+ | BC' |
31
+ |-----------------------------------|
32
+ | DE' |
33
+ |-----------------------------------|
34
+ | HL' |
35
+ '-----------------------------------|
36
+ | I |
37
+ |-----------------|
38
+ | R |
39
+ '-----------------'
40
+
41
+ Flags (F register):
42
+ .-----------------.
43
+ | 7 6 5 4 3 2 1 0 |
44
+ | S Z Y H X P N C |
45
+ '-|-|-|-|-|-|-|-|-'
46
+ | | | | | | | '-> carry
47
+ | | | | | | '---> addition / subtraction
48
+ | | | | | '-----> parity / 2-compliment signed overflow
49
+ | | | | '-------> result bit 3 copy (undocumented)
50
+ | | | '---------> half carry
51
+ | | '-----------> result bit 5 copy (undocumented)
52
+ | '-------------> zero
53
+ '---------------> sign */
54
+
55
+ #ifndef _Z_hardware_CPU_architecture_Z80_H_
56
+ #define _Z_hardware_CPU_architecture_Z80_H_
57
+
58
+ #include <Z/types/base.h>
59
+
60
+ /* MARK: - Limits and features */
61
+
62
+ #define Z_Z80_MINIMUM_CYCLES_PER_INSTRUCTION 4
63
+ #define Z_Z80_MAXIMUM_CYCLES_PER_INSTRUCTION 23
64
+ #define Z_Z80_MINIMUM_BITS_INSTRUCTION 8
65
+ #define Z_Z80_MAXIMUM_BITS_INSTRUCTION 32
66
+ #define Z_Z80_BITS_ADDRESS_BUS 16
67
+ #define Z_Z80_BITS_DATA_BUS 8
68
+ #define Z_Z80_BITS_ADDRESSING 16
69
+
70
+ /* MARK: - Addresses */
71
+
72
+ #define Z_Z80_ADDRESS_NMI_POINTER 0x0066
73
+
74
+ /* MARK: - Values after power on */
75
+ /*
76
+ #define Z_Z80_VALUE_AFTER_POWER_ON_PC 0x0000
77
+ #define Z_Z80_VALUE_AFTER_POWER_ON_SP 0x0000
78
+ #define Z_Z80_VALUE_AFTER_POWER_ON_AF 0x0040
79
+ #define Z_Z80_VALUE_AFTER_POWER_ON_BC 0x0000
80
+ #define Z_Z80_VALUE_AFTER_POWER_ON_DE 0x0000
81
+ #define Z_Z80_VALUE_AFTER_POWER_ON_HL 0x0000
82
+ #define Z_Z80_VALUE_AFTER_POWER_ON_IX 0x0000
83
+ #define Z_Z80_VALUE_AFTER_POWER_ON_IY 0xFFFF
84
+ #define Z_Z80_VALUE_AFTER_POWER_ON_AF_ 0x0000
85
+ #define Z_Z80_VALUE_AFTER_POWER_ON_BC_ 0x0000
86
+ #define Z_Z80_VALUE_AFTER_POWER_ON_DE_ 0x0000
87
+ #define Z_Z80_VALUE_AFTER_POWER_ON_HL_ 0x0000
88
+ #define Z_Z80_VALUE_AFTER_POWER_ON_I 0x00
89
+ #define Z_Z80_VALUE_AFTER_POWER_ON_R 0x00
90
+ #define Z_Z80_VALUE_AFTER_POWER_ON_MEMPTR 0x0000
91
+ #define Z_Z80_VALUE_AFTER_POWER_ON_IFF1 0
92
+ #define Z_Z80_VALUE_AFTER_POWER_ON_IFF2 0
93
+ #define Z_Z80_VALUE_AFTER_POWER_ON_IM 1*/
94
+
95
+ #define Z_Z80_VALUE_AFTER_POWER_ON_PC 0x0000
96
+ #define Z_Z80_VALUE_AFTER_POWER_ON_SP 0xFFFF
97
+ #define Z_Z80_VALUE_AFTER_POWER_ON_AF 0xFFFF
98
+ #define Z_Z80_VALUE_AFTER_POWER_ON_BC 0xFFFF
99
+ #define Z_Z80_VALUE_AFTER_POWER_ON_DE 0xFFFF
100
+ #define Z_Z80_VALUE_AFTER_POWER_ON_HL 0xFFFF
101
+ #define Z_Z80_VALUE_AFTER_POWER_ON_IX 0xFFFF
102
+ #define Z_Z80_VALUE_AFTER_POWER_ON_IY 0xFFFF
103
+ #define Z_Z80_VALUE_AFTER_POWER_ON_AF_ 0xFFFF
104
+ #define Z_Z80_VALUE_AFTER_POWER_ON_BC_ 0xFFFF
105
+ #define Z_Z80_VALUE_AFTER_POWER_ON_DE_ 0xFFFF
106
+ #define Z_Z80_VALUE_AFTER_POWER_ON_HL_ 0xFFFF
107
+ #define Z_Z80_VALUE_AFTER_POWER_ON_I 0x00
108
+ #define Z_Z80_VALUE_AFTER_POWER_ON_R 0x00
109
+ #define Z_Z80_VALUE_AFTER_POWER_ON_MEMPTR 0x0000
110
+ #define Z_Z80_VALUE_AFTER_POWER_ON_IFF1 0
111
+ #define Z_Z80_VALUE_AFTER_POWER_ON_IFF2 0
112
+ #define Z_Z80_VALUE_AFTER_POWER_ON_IM 0
113
+
114
+ /* MARK: - Values after reset */
115
+
116
+ #define Z_Z80_VALUE_AFTER_RESET_PC Z_Z80_VALUE_AFTER_POWER_ON_PC
117
+ #define Z_Z80_VALUE_AFTER_RESET_SP Z_Z80_VALUE_AFTER_POWER_ON_SP
118
+ #define Z_Z80_VALUE_AFTER_RESET_AF Z_Z80_VALUE_AFTER_POWER_ON_AF
119
+ #define Z_Z80_VALUE_AFTER_RESET_BC Z_Z80_VALUE_AFTER_POWER_ON_BC
120
+ #define Z_Z80_VALUE_AFTER_RESET_DE Z_Z80_VALUE_AFTER_POWER_ON_DE
121
+ #define Z_Z80_VALUE_AFTER_RESET_HL Z_Z80_VALUE_AFTER_POWER_ON_HL
122
+ #define Z_Z80_VALUE_AFTER_RESET_IX Z_Z80_VALUE_AFTER_POWER_ON_IX
123
+ #define Z_Z80_VALUE_AFTER_RESET_IY Z_Z80_VALUE_AFTER_POWER_ON_IY
124
+ #define Z_Z80_VALUE_AFTER_RESET_AF_ Z_Z80_VALUE_AFTER_POWER_ON_AF_
125
+ #define Z_Z80_VALUE_AFTER_RESET_BC_ Z_Z80_VALUE_AFTER_POWER_ON_BC_
126
+ #define Z_Z80_VALUE_AFTER_RESET_DE_ Z_Z80_VALUE_AFTER_POWER_ON_DE_
127
+ #define Z_Z80_VALUE_AFTER_RESET_HL_ Z_Z80_VALUE_AFTER_POWER_ON_HL_
128
+ #define Z_Z80_VALUE_AFTER_RESET_I Z_Z80_VALUE_AFTER_POWER_ON_I
129
+ #define Z_Z80_VALUE_AFTER_RESET_R Z_Z80_VALUE_AFTER_POWER_ON_R
130
+ #define Z_Z80_VALUE_AFTER_RESET_MEMPTR Z_Z80_VALUE_AFTER_POWER_ON_MEMPTR
131
+ #define Z_Z80_VALUE_AFTER_RESET_IFF1 Z_Z80_VALUE_AFTER_POWER_ON_IFF1
132
+ #define Z_Z80_VALUE_AFTER_RESET_IFF2 Z_Z80_VALUE_AFTER_POWER_ON_IFF2
133
+ #define Z_Z80_VALUE_AFTER_RESET_IM Z_Z80_VALUE_AFTER_POWER_ON_IM
134
+
135
+ /* MARK: - Information for emulation */
136
+
137
+ #define Z_Z80_RESET_IS_EQUAL_TO_POWER_ON TRUE
138
+
139
+ /* MARK: - State storage type */
140
+
141
+ Z_DEFINE_STRICT_STRUCTURE_BEGIN
142
+ zuint16 pc, sp;
143
+ Z16Bit af, bc, de, hl, ix, iy;
144
+ Z16Bit af_, bc_, de_, hl_;
145
+ zuint8 r, i;
146
+
147
+ zuint16 memptr;
148
+
149
+ struct {zuint8 halt :1;
150
+ zuint8 irq :1;
151
+ zuint8 nmi :1;
152
+ zuint8 iff1 :1;
153
+ zuint8 iff2 :1;
154
+ zuint8 ei :1;
155
+ zuint8 im :2;
156
+ } internal;
157
+ Z_DEFINE_STRICT_STRUCTURE_END ZZ80State;
158
+
159
+ #define Z_Z80_STATE_AF( object) (object)->af.value_uint16
160
+ #define Z_Z80_STATE_BC( object) (object)->bc.value_uint16
161
+ #define Z_Z80_STATE_DE( object) (object)->de.value_uint16
162
+ #define Z_Z80_STATE_HL( object) (object)->hl.value_uint16
163
+ #define Z_Z80_STATE_IX( object) (object)->ix.value_uint16
164
+ #define Z_Z80_STATE_IY( object) (object)->iy.value_uint16
165
+ #define Z_Z80_STATE_PC( object) (object)->pc
166
+ #define Z_Z80_STATE_SP( object) (object)->sp
167
+ #define Z_Z80_STATE_AF_( object) (object)->af_.value_uint16
168
+ #define Z_Z80_STATE_BC_( object) (object)->bc_.value_uint16
169
+ #define Z_Z80_STATE_DE_( object) (object)->de_.value_uint16
170
+ #define Z_Z80_STATE_HL_( object) (object)->hl_.value_uint16
171
+ #define Z_Z80_STATE_A( object) (object)->af.values_uint8.index1
172
+ #define Z_Z80_STATE_F( object) (object)->af.values_uint8.index0
173
+ #define Z_Z80_STATE_B( object) (object)->bc.values_uint8.index1
174
+ #define Z_Z80_STATE_C( object) (object)->bc.values_uint8.index0
175
+ #define Z_Z80_STATE_D( object) (object)->de.values_uint8.index1
176
+ #define Z_Z80_STATE_E( object) (object)->de.values_uint8.index0
177
+ #define Z_Z80_STATE_H( object) (object)->hl.values_uint8.index1
178
+ #define Z_Z80_STATE_L( object) (object)->hl.values_uint8.index0
179
+ #define Z_Z80_STATE_IXH( object) (object)->ix.values_uint8.index1
180
+ #define Z_Z80_STATE_IXL( object) (object)->ix.values_uint8.index0
181
+ #define Z_Z80_STATE_IYH( object) (object)->iy.values_uint8.index1
182
+ #define Z_Z80_STATE_IYL( object) (object)->iy.values_uint8.index0
183
+ #define Z_Z80_STATE_A_( object) (object)->af_.values_uint8.index1
184
+ #define Z_Z80_STATE_F_( object) (object)->af_.values_uint8.index0
185
+ #define Z_Z80_STATE_B_( object) (object)->bc_.values_uint8.index1
186
+ #define Z_Z80_STATE_C_( object) (object)->bc_.values_uint8.index0
187
+ #define Z_Z80_STATE_D_( object) (object)->de_.values_uint8.index1
188
+ #define Z_Z80_STATE_E_( object) (object)->de_.values_uint8.index0
189
+ #define Z_Z80_STATE_H_( object) (object)->hl_.values_uint8.index1
190
+ #define Z_Z80_STATE_L_( object) (object)->hl_.values_uint8.index0
191
+ #define Z_Z80_STATE_I( object) (object)->i
192
+ #define Z_Z80_STATE_R( object) (object)->r
193
+ #define Z_Z80_STATE_MEMPTR(object) (object)->memptr
194
+ #define Z_Z80_STATE_HALT( object) (object)->internal.halt
195
+ #define Z_Z80_STATE_IFF1( object) (object)->internal.iff1
196
+ #define Z_Z80_STATE_IFF2( object) (object)->internal.iff2
197
+ #define Z_Z80_STATE_EI( object) (object)->internal.ei
198
+ #define Z_Z80_STATE_IM( object) (object)->internal.im
199
+ #define Z_Z80_STATE_NMI( object) (object)->internal.nmi
200
+ #define Z_Z80_STATE_IRQ( object) (object)->internal.irq
201
+
202
+ #define Z_Z80_STATE_MEMBER_AF af.value_uint16
203
+ #define Z_Z80_STATE_MEMBER_BC bc.value_uint16
204
+ #define Z_Z80_STATE_MEMBER_DE de.value_uint16
205
+ #define Z_Z80_STATE_MEMBER_HL hl.value_uint16
206
+ #define Z_Z80_STATE_MEMBER_IX ix.value_uint16
207
+ #define Z_Z80_STATE_MEMBER_IY iy.value_uint16
208
+ #define Z_Z80_STATE_MEMBER_PC pc
209
+ #define Z_Z80_STATE_MEMBER_SP sp
210
+ #define Z_Z80_STATE_MEMBER_AF_ af_.value_uint16
211
+ #define Z_Z80_STATE_MEMBER_BC_ bc_.value_uint16
212
+ #define Z_Z80_STATE_MEMBER_DE_ de_.value_uint16
213
+ #define Z_Z80_STATE_MEMBER_HL_ hl_.value_uint16
214
+ #define Z_Z80_STATE_MEMBER_A af.values_uint8.index1
215
+ #define Z_Z80_STATE_MEMBER_F af.values_uint8.index0
216
+ #define Z_Z80_STATE_MEMBER_B bc.values_uint8.index1
217
+ #define Z_Z80_STATE_MEMBER_C bc.values_uint8.index0
218
+ #define Z_Z80_STATE_MEMBER_D de.values_uint8.index1
219
+ #define Z_Z80_STATE_MEMBER_E de.values_uint8.index0
220
+ #define Z_Z80_STATE_MEMBER_H hl.values_uint8.index1
221
+ #define Z_Z80_STATE_MEMBER_L hl.values_uint8.index0
222
+ #define Z_Z80_STATE_MEMBER_IXH ix.values_uint8.index1
223
+ #define Z_Z80_STATE_MEMBER_IXL ix.values_uint8.index0
224
+ #define Z_Z80_STATE_MEMBER_IYH iy.values_uint8.index1
225
+ #define Z_Z80_STATE_MEMBER_IYL iy.values_uint8.index0
226
+ #define Z_Z80_STATE_MEMBER_A_ af_.values_uint8.index1
227
+ #define Z_Z80_STATE_MEMBER_F_ af_.values_uint8.index0
228
+ #define Z_Z80_STATE_MEMBER_B_ bc_.values_uint8.index1
229
+ #define Z_Z80_STATE_MEMBER_C_ bc_.values_uint8.index0
230
+ #define Z_Z80_STATE_MEMBER_D_ de_.values_uint8.index1
231
+ #define Z_Z80_STATE_MEMBER_E_ de_.values_uint8.index0
232
+ #define Z_Z80_STATE_MEMBER_H_ hl_.values_uint8.index1
233
+ #define Z_Z80_STATE_MEMBER_L_ hl_.values_uint8.index0
234
+ #define Z_Z80_STATE_MEMBER_I i
235
+ #define Z_Z80_STATE_MEMBER_R r
236
+ #define Z_Z80_STATE_MEMPTR_MEMPTR memptr
237
+ #define Z_Z80_STATE_MEMBER_HALT internal.halt
238
+ #define Z_Z80_STATE_MEMBER_IFF1 internal.iff1
239
+ #define Z_Z80_STATE_MEMBER_IFF2 internal.iff2
240
+ #define Z_Z80_STATE_MEMBER_EI internal.ei
241
+ #define Z_Z80_STATE_MEMBER_IM internal.im
242
+ #define Z_Z80_STATE_MEMBER_NMI internal.nmi
243
+ #define Z_Z80_STATE_MEMBER_IRQ internal.irq
244
+
245
+ #endif /* _Z_hardware_CPU_architecture_Z80_H_ */
@@ -0,0 +1,37 @@
1
+ /* Z Kit - hardware/CPU/architecture/i4004.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_CPU_architecture_i4004_H_
9
+ #define _Z_hardware_CPU_architecture_i4004_H_
10
+
11
+ #include <Z/types/base.h>
12
+
13
+ /* MARK: - Addresses */
14
+
15
+
16
+ /* MARK: - Values after power on */
17
+
18
+
19
+ /* MARK: - Values after reset */
20
+
21
+
22
+ /* MARK: - Information for emulation */
23
+
24
+
25
+ /* MARK: - State storage type */
26
+
27
+ typedef struct {
28
+ zuint16 stack[4];
29
+ zuint8 pc;
30
+ zuint8 p[8];
31
+ zuint8 a;
32
+ zuint8 c;
33
+ } Zi4004State;
34
+
35
+ /* MARK: - State structure macros */
36
+
37
+ #endif /* _Z_hardware_CPU_architecture_i4004_H_ */
@@ -0,0 +1,180 @@
1
+ /* Z Kit - hardware/PSG/General Instrument/AY-3-891x.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
+ Vss (GND) -01-| \_/ |-40- Vcc (+5V)
10
+ N.C. -02-| |-39- TEST 1
11
+ ANALOG CHANNEL B -03-| _ |-38- ANALOG CHANNEL C
12
+ ANALOG CHANNEL A -04-| (_) |-37- DA0
13
+ N.C. -05-| |-36- DA1
14
+ IOB7 -06-| |-35- DA2
15
+ IOB6 -07-| |-34- DA3
16
+ IOB5 -08-| |-33- DA4
17
+ IOB4 -09-| |-32- DA5
18
+ IOB3 -10-| SOUND |-31- DA6
19
+ IOB2 -11-| AY-3-8910 |-30- DA7
20
+ IOB1 -12-| |-29- BC1
21
+ IOB0 -13-| GI |-28- BC2
22
+ IOA7 -14-| |-27- BDIR
23
+ IOA6 -15-| |-26- TEST 2
24
+ IOA5 -16-| _ |-25- A8
25
+ IOA4 -17-| (_) |-24- A9
26
+ IOA3 -18-| |-23- RESET
27
+ IOA2 -19-| |-22- CLOCK
28
+ IOA1 -20-| |-21- IOA0
29
+ '-----------'
30
+
31
+ .----._.----.
32
+ ANALOG CHANNEL C -01-| \_/ |-28- DA0
33
+ TEST 1 -02-| |-27- DA1
34
+ Vcc (+5V) -03-| |-26- DA2
35
+ ANALOG CHANNEL B -04-| |-25- DA3
36
+ ANALOG CHANNEL A -05-| |-24- DA4
37
+ Vss (GND) -06-| SOUND |-23- DA5
38
+ IOA7 -07-| AY-3-8912 |-22- DA6
39
+ IOA6 -08-| |-21- DA7
40
+ IOA5 -09-| GI |-20- BC1
41
+ IOA4 -10-| |-19- BC2
42
+ IOA3 -11-| |-18- BDIR
43
+ IOA2 -12-| |-17- A8
44
+ IOA1 -13-| |-16- RESET
45
+ IOA0 -14-| |-15- CLOCK
46
+ '-----------'
47
+
48
+ .----._.----.
49
+ Vss (GND) -01-| \_/ |-24- CHIP SELECT
50
+ BDIR -02-| |-23- A8
51
+ BC1 -03-| |-22- A9
52
+ DA7 -04-| |-21- RESET
53
+ DA6 -05-| |-20- CLOCK
54
+ DA5 -06-| SOUND |-19- Vss (GND)
55
+ DA4 -07-| AY-3-8913 |-18- ANALOG C
56
+ DA3 -08-| |-17- ANALOG A
57
+ DA2 -09-| GI |-16- NO CONNECT
58
+ DA1 -10-| |-15- ANALOG B
59
+ DA0 -11-| |-14- TEST IN
60
+ TEST OUT -12-| |-13- Vcc
61
+ '-----------'
62
+
63
+ Content
64
+ .-----------------------------------------------.
65
+ Register | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
66
+ .-----------------------------+-----------------------------------------------|
67
+ | R0 | | 8-Bit Fine Tune A |
68
+ |-----| Channel A Tone Period |-----------------------------------------------|
69
+ | R1 | | ///////////////////// | 4-Bit Coarse Tune A |
70
+ |-----+-----------------------+-----------------------------------------------|
71
+ | R2 | | 8-Bit Fine Tune B |
72
+ |-----| Channel B Tone Period |-----------------------------------------------|
73
+ | R3 | | ///////////////////// | 4-Bit Coarse Tune B |
74
+ |-----+-----------------------+-----------------------------------------------|
75
+ | R4 | | 8-Bit Fine Tune C |
76
+ |-----| Channel C Tone Period |-----------------------------------------------|
77
+ | R5 | | ///////////////////// | 4-Bit Coarse Tune C |
78
+ |-----+-----------------------+-----------------------------------------------|
79
+ | R6 | Noise Period | /////////////// | 5-Bit Period Control |
80
+ |-----+-----------------------+-----------------------------------------------|
81
+ | R7 | Enable | IN OUT | Noise | Noise |
82
+ | | |-----------+-----------------+-----------------|
83
+ | | | IOB | IOA | C | B | A | C | B | A |
84
+ |-----+-----------------------+-----------------+-----+-----+-----+-----+-----|
85
+ | R10 | Channel A Amplitude | /////////////// | M | L3 | L2 | L1 | L0 |
86
+ |-----+-----------------------+-----------------+-----+-----+-----+-----+-----|
87
+ | R11 | Channel B Amplitude | /////////////// | M | L3 | L2 | L1 | L0 |
88
+ |-----+-----------------------+-----------------+-----+-----+-----+-----+-----|
89
+ | R12 | Channel C Amplitude | /////////////// | M | L3 | L2 | L1 | L0 |
90
+ |-----+-----------------------+-----------------------------------------------|
91
+ | R13 | | 8-Bit Fine Tune E |
92
+ |-----| Envelope Period |-----------------------------------------------|
93
+ | R14 | | 8-Bit Coarse Tune E |
94
+ |-----+-----------------------+-----------------------------------------------|
95
+ | R15 | Envelope Shape Cycle | ///////////////////// | CONT| ATT | ALT | HOLD|
96
+ |-----+-----------------------+-----------------------------------------------|
97
+ | R16 | I/O Port A Data Store | 8-Bit Parallel I/O on Port A |
98
+ |-----+-----------------------+-----------------------------------------------|
99
+ | R17 | I/O Port B Data Store | 8-Bit Parallel I/O on Port A |
100
+ '----------------------------------------------------------------------------*/
101
+
102
+ #ifndef _Z_hardware_PSG_General_Instrument_AY_3_891x_H_
103
+ #define _Z_hardware_PSG_General_Instrument_AY_3_891x_H_
104
+
105
+ #include <Z/types/base.h>
106
+
107
+ Z_DEFINE_STRICT_STRUCTURE (Z_BIT_FIELD(8, 8) (
108
+ zuint8 unused0 :1,
109
+ zuint8 unused1 :1,
110
+ zuint8 unused2 :1,
111
+ zuint8 m :1,
112
+ zuint8 l3 :1,
113
+ zuint8 l2 :1,
114
+ zuint8 l1 :1,
115
+ zuint8 l0 :1
116
+ )) ZAY3891xAmplitude;
117
+
118
+ Z_DEFINE_STRICT_UNION (
119
+ zuint8 registers[16];
120
+
121
+ struct {zuint8 channel_a_tone_period_fine_tune;
122
+ zuint8 channel_a_tone_period_coarse_tune;
123
+ zuint8 channel_b_tone_period_fine_tune;
124
+ zuint8 channel_b_tone_perid_coarse_tune;
125
+ zuint8 channel_c_tone_period_fine_tune;
126
+ zuint8 channel_c_tone_period_coarse_tune;
127
+ zuint8 noise_period;
128
+
129
+ struct {Z_BIT_FIELD(8, 8) (
130
+ zuint8 iob :1,
131
+ zuint8 ioa :1,
132
+ zuint8 noise_c :1,
133
+ zuint8 noise_b :1,
134
+ zuint8 noise_a :1,
135
+ zuint8 tone_c :1,
136
+ zuint8 tone_b :1,
137
+ zuint8 tone_a :1
138
+ )} enable;
139
+
140
+ ZAY3891xAmplitude channel_a_amplitude;
141
+ ZAY3891xAmplitude channel_b_amplitude;
142
+ ZAY3891xAmplitude channel_c_amplitude;
143
+
144
+ zuint8 envelope_period_fine_tune;
145
+ zuint8 envelope_period_coarse_tune;
146
+
147
+ struct {Z_BIT_FIELD(8, 8) (
148
+ zuint8 unused0 :1,
149
+ zuint8 unused1 :1,
150
+ zuint8 unused2 :1,
151
+ zuint8 unused3 :1,
152
+ zuint8 cont :1,
153
+ zuint8 att :1,
154
+ zuint8 alt :1,
155
+ zuint8 hold :1
156
+ )} envelope_shape_cycle;
157
+
158
+ zuint8 io_port_a_data_store;
159
+ zuint8 io_port_b_data_store;
160
+ } values;
161
+ ) ZAY3891xState;
162
+
163
+ #define Z_AY_3_891X_CHANNEL_A_TONE_PERIOD_FINE_TUNE 0
164
+ #define Z_AY_3_891X_CHANNEL_A_TONE_PERIOD_COARSE_TUNE 1
165
+ #define Z_AY_3_891X_CHANNEL_B_TONE_PERIOD_FINE_TUNE 2
166
+ #define Z_AY_3_891X_CHANNEL_B_TONE_PERID_COARSE_TUNE 3
167
+ #define Z_AY_3_891X_CHANNEL_C_TONE_PERIOD_FINE_TUNE 4
168
+ #define Z_AY_3_891X_CHANNEL_C_TONE_PERIOD_COARSE_TUNE 5
169
+ #define Z_AY_3_891X_NOISE_PERIOD 6
170
+ #define Z_AY_3_891X_ENABLEE 7
171
+ #define Z_AY_3_891X_CHANNEL_A_AMPLITUDE 8
172
+ #define Z_AY_3_891X_CHANNEL_B_AMPLITUDE 9
173
+ #define Z_AY_3_891X_CHANNEL_C_AMPLITUDE 10
174
+ #define Z_AY_3_891X_ENVELOPE_PERIOD_FINE_TUNE 11
175
+ #define Z_AY_3_891X_ENVELOPE_PERIOD_COARSE_TUNE 12
176
+ #define Z_AY_3_891X_ENVELOPE_SHAPE_CYCLE 13
177
+ #define Z_AY_3_891X_IO_PORT_A_DATA_STORE 14
178
+ #define Z_AY_3_891X_IO_PORT_B_DATA_STORE 15
179
+
180
+ #endif /* _Z_hardware_PSG_General_Instrument_AY_3_891x_H_ */