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,625 @@
|
|
1
|
+
/* Z Kit - hardware/VDC/Ricoh/RP2C0x.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
|
+
R/W -01-| \_/ |-40- VCC
|
10
|
+
D0 -02-| |-39- ALE
|
11
|
+
D1 -03-| _ |-38- AD0
|
12
|
+
D2 -04-| (_) |-37- AD1
|
13
|
+
D3 -05-| |-36- AD2
|
14
|
+
D4 -06-| |-35- AD3
|
15
|
+
D5 -07-| |-34- AD4
|
16
|
+
D6 -08-| |-33- AD5
|
17
|
+
D7 -09-| |-32- AD6
|
18
|
+
A2 -10-| |-31- AD7
|
19
|
+
A1 -11-| RP2C02 |-30- A8
|
20
|
+
A0 -12-| |-29- A9
|
21
|
+
/CS -13-| |-28- A10
|
22
|
+
EXT0 -14-| |-27- A11
|
23
|
+
EXT1 -15-| |-26- A12
|
24
|
+
EXT2 -16-| _ |-25- A13
|
25
|
+
EXT3 -17-| (_) |-24- /R
|
26
|
+
CLK -18-| |-23- /W
|
27
|
+
/VBL -19-| |-22- /SYNC
|
28
|
+
VEE -20-| |-21- VOUT
|
29
|
+
'-----------' */
|
30
|
+
|
31
|
+
|
32
|
+
/* .--------------------------.
|
33
|
+
| Default background color |
|
34
|
+
| .--------------------------.
|
35
|
+
| | Sprites with priority 1 |
|
36
|
+
| | .--------------------------.
|
37
|
+
| | | Background |
|
38
|
+
| | | .--------------------------.
|
39
|
+
| | | | Sprites with priority 0 |
|
40
|
+
'---| | | |
|
41
|
+
| | | | |
|
42
|
+
| '---| | |
|
43
|
+
| | | | |
|
44
|
+
| | '---| |
|
45
|
+
| | | | |
|
46
|
+
| | | '--------------------------'
|
47
|
+
| | | |
|
48
|
+
'---|---|---|---> Stored at 3F00h
|
49
|
+
| '---|---> The ones with priority = 1
|
50
|
+
| '---> The ones with priority = 0
|
51
|
+
'----------->
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
| Scanline | 341 |
|
56
|
+
| Frame | 89342 |
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
Sprite Rendering
|
68
|
+
|
69
|
+
.--------.
|
70
|
+
| Sprite |
|
71
|
+
'--------'
|
72
|
+
|| .------------------.
|
73
|
+
.------''-----. | Control Register |
|
74
|
+
|.-----------.| '------------------'
|
75
|
+
_||_ _||_ _||_
|
76
|
+
\ / \ / \ /
|
77
|
+
\/ \/ \/
|
78
|
+
.---------. .---------. .---------.
|
79
|
+
| Palette | | Pattern | | Pattern |
|
80
|
+
| | | index | | table |
|
81
|
+
|---------| '---------' '---------'
|
82
|
+
| 1 | 0 | || ||
|
83
|
+
'---------' |'-----------'|
|
84
|
+
| | '------..-----'
|
85
|
+
| | _||_
|
86
|
+
| | \ /
|
87
|
+
| | \/
|
88
|
+
| | .---------.
|
89
|
+
| | | Pattern |
|
90
|
+
| | '---------'
|
91
|
+
| | ||
|
92
|
+
| | .-----''-----.
|
93
|
+
| | |.----------.|
|
94
|
+
| | _||_ _||_
|
95
|
+
| | \ / \ /
|
96
|
+
| | \/ \/
|
97
|
+
| | .--------. .--------.
|
98
|
+
| | | Tile 0 | | Tile 1 |
|
99
|
+
| | '--------' '--------'
|
100
|
+
| | .------' |
|
101
|
+
| | | .--------------'
|
102
|
+
| | | |
|
103
|
+
v v v v
|
104
|
+
.---------------.
|
105
|
+
| 3 | 2 | 1 | 0 |
|
106
|
+
|---------------|
|
107
|
+
| Color Index |
|
108
|
+
| (4 bit) |
|
109
|
+
'---------------'
|
110
|
+
.------------.
|
111
|
+
| Name table |
|
112
|
+
'------------'
|
113
|
+
||
|
114
|
+
|'---------------------.
|
115
|
+
|.--------------------.|
|
116
|
+
_||_ _||_
|
117
|
+
\ / \ /
|
118
|
+
\/ \/
|
119
|
+
.-----------------. .---------------.
|
120
|
+
| Attribute table | | Pattern table |
|
121
|
+
'-----------------' '---------------'
|
122
|
+
_||_ _||_
|
123
|
+
\ / \ /
|
124
|
+
\/ \/
|
125
|
+
.-----------. .----------.
|
126
|
+
| Attribute | | Pattern |
|
127
|
+
'-----------' '----------'
|
128
|
+
| | ||
|
129
|
+
| | .-----''-----.
|
130
|
+
| | |.----------.|
|
131
|
+
| | _||_ _||_
|
132
|
+
| | \ / \ /
|
133
|
+
| | \/ \/
|
134
|
+
| | .--------. .--------.
|
135
|
+
| | | Tile 0 | | Tile 1 |
|
136
|
+
.----' | '--------' '--------'
|
137
|
+
| .----' | |
|
138
|
+
| | .--------------' |
|
139
|
+
| | | .----------------------'
|
140
|
+
| | | |
|
141
|
+
v v v v
|
142
|
+
.---------------.
|
143
|
+
| 3 | 2 | 1 | 0 |
|
144
|
+
|---------------|
|
145
|
+
| Color Index |
|
146
|
+
| (4 bit) |
|
147
|
+
'---------------'
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<--- 4 bit --->
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
1. Draw background
|
167
|
+
2. Draw sprites
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
.--------------------------------.
|
172
|
+
| For each |
|
173
|
+
| Index from Name Table |
|
174
|
+
| and its asotiated |
|
175
|
+
| Attribute from Attribute Table |
|
176
|
+
'--------------------------------'
|
177
|
+
_| |_
|
178
|
+
\ /
|
179
|
+
\ /
|
180
|
+
\/
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
*/
|
185
|
+
|
186
|
+
#ifndef _Z_hardware_VDC_Ricoh_RP2C0x_H_
|
187
|
+
#define _Z_hardware_VDC_Ricoh_RP2C0x_H_
|
188
|
+
|
189
|
+
#include <Z/types/base.h>
|
190
|
+
|
191
|
+
typedef struct {
|
192
|
+
zuint8 y;
|
193
|
+
zuint8 tile_index;
|
194
|
+
zuint8 attributes;
|
195
|
+
zuint8 x;
|
196
|
+
} ZRP2C0xSprite;
|
197
|
+
|
198
|
+
typedef struct {
|
199
|
+
/* Registers */
|
200
|
+
zuint8 control; /* Read / Write */
|
201
|
+
zuint8 mask; /* Read / Write */
|
202
|
+
zuint8 status; /* Read */
|
203
|
+
zuint8 oam_address; /* Write */
|
204
|
+
zuint8 oam_data; /* Read / Write */
|
205
|
+
zuint8 scroll; /* Write */
|
206
|
+
zuint8 address; /* Write */
|
207
|
+
zuint8 data; /* Read / Write */
|
208
|
+
|
209
|
+
/* On-Die Memory */
|
210
|
+
ZRP2C0xSprite oam[64]; /* Not accesible */
|
211
|
+
zuint8 palettes[28]; /* Not accesible */
|
212
|
+
|
213
|
+
} ZRP2C0xState;
|
214
|
+
|
215
|
+
#define Z_RP2C0X_STATE_REGISTER_OFFSET_CONTROL 0
|
216
|
+
#define Z_RP2C0X_STATE_REGISTER_OFFSET_MASK 1
|
217
|
+
#define Z_RP2C0X_STATE_REGISTER_OFFSET_STATUS 2
|
218
|
+
#define Z_RP2C0X_STATE_REGISTER_OFFSET_OAM_ADDRESS 3
|
219
|
+
#define Z_RP2C0X_STATE_REGISTER_OFFSET_OAM_DATA 4
|
220
|
+
#define Z_RP2C0X_STATE_REGISTER_OFFSET_SCROLL 5
|
221
|
+
#define Z_RP2C0X_STATE_REGISTER_OFFSET_ADDRESS 6
|
222
|
+
#define Z_RP2C0X_STATE_REGISTER_OFFSET_DATA 7
|
223
|
+
|
224
|
+
#define Z_RP2C0X_STATE_REGISTER_SIZE_CONTROL 1
|
225
|
+
#define Z_RP2C0X_STATE_REGISTER_SIZE_MASK 1
|
226
|
+
#define Z_RP2C0X_STATE_REGISTER_SIZE_STATUS 1
|
227
|
+
#define Z_RP2C0X_STATE_REGISTER_SIZE_OAM_ADDRESS 1
|
228
|
+
#define Z_RP2C0X_STATE_REGISTER_SIZE_OAM_DATA 1
|
229
|
+
#define Z_RP2C0X_STATE_REGISTER_SIZE_SCROLL 1
|
230
|
+
#define Z_RP2C0X_STATE_REGISTER_SIZE_ADDRESS 1
|
231
|
+
#define Z_RP2C0X_STATE_REGISTER_SIZE_DATA 1
|
232
|
+
|
233
|
+
/* Control Register
|
234
|
+
.-----------------.
|
235
|
+
| 7 6 5 4 3 2 1 0 |
|
236
|
+
'-|-|-|-|-|-|-\_/-'
|
237
|
+
| | | | | | '--> name table ---------------------------------------.
|
238
|
+
| | | | | '-----> address increment --------------. |
|
239
|
+
| | | | '-------> sprite patten table ---------. | |
|
240
|
+
| | | '---------> background pattern_table --. | | |
|
241
|
+
| | '-----------> use 8x16 sprites --------. | | | |
|
242
|
+
| '-------------> mode ------------------. | | | | |
|
243
|
+
'---------------> emit nmi on vblank --. | | | | | |
|
244
|
+
| | | | | | |
|
245
|
+
.-------------------------------------' | | | | | |
|
246
|
+
| .----------------------' | | | | |
|
247
|
+
| .------------|------------------------' | | | |
|
248
|
+
| | | .-------------' | | |
|
249
|
+
| | | | .-----------' | |
|
250
|
+
| | | | | | |
|
251
|
+
| | | | | | |
|
252
|
+
v v v v v v v
|
253
|
+
.---------. .------------. .-----------. .---------------. .------------.
|
254
|
+
| 0 = NO | | 0 = Master | | 0 = 0000h | | 0 = +1 (X++) | | 00 = 2000h |
|
255
|
+
| 1 = YES | | 1 = Slave | | 1 = 1000h | | 1 = +32 (Y++) | | 01 = 2400h |
|
256
|
+
'---------' '------------' '-----------' '---------------' | 10 = 2800h |
|
257
|
+
| 11 = 2C00h |
|
258
|
+
'------------' */
|
259
|
+
|
260
|
+
Z_DEFINE_STRICT_STRUCTURE (Z_BIT_FIELD(8, 7) (
|
261
|
+
zuint8 emit_nmi_on_vblank :2,
|
262
|
+
zuint8 mode :1,
|
263
|
+
zuint8 use_8x16_sprites :1,
|
264
|
+
zuint8 background_pattern_table :1,
|
265
|
+
zuint8 sprite_pattern_table :1,
|
266
|
+
zuint8 address_increment :1,
|
267
|
+
zuint8 name_table :1
|
268
|
+
)) RP2C0xControlRegister;
|
269
|
+
|
270
|
+
|
271
|
+
#define Z_RP2C0X_CONTROL_OPTION_NAMETABLE_0 0
|
272
|
+
#define Z_RP2C0X_CONTROL_OPTION_NAMETABLE_1 1
|
273
|
+
#define Z_RP2C0X_CONTROL_OPTION_NAMETABLE_2 2
|
274
|
+
#define Z_RP2C0X_CONTROL_OPTION_NAMETABLE_3 3
|
275
|
+
|
276
|
+
|
277
|
+
#define Z_RP2C0X_CONTROL_GET_NAME_TABLE(v) (0x2000 | ((((zuint16)(v)) & 3) << 10))
|
278
|
+
#define Z_RP2C0X_CONTROL_GET_ADDRESS_INCREMENT(v) (Z_BIT_2(v) ? 32 : 1)
|
279
|
+
#define Z_RP2C0X_CONTROL_GET_SPRITE_PATTERN_TABLE(v) Z_BIT_3(v)
|
280
|
+
#define Z_RP2C0X_CONTROL_GET_BACKGROUND_PATTERN_TABLE(v) Z_BIT_4(v)
|
281
|
+
#define Z_RP2C0X_CONTROL_GET_USE_8X16_SPRITES(v) Z_BIT_5(v)
|
282
|
+
#define Z_RP2C0X_CONTROL_GET_PPU_MODE(v) Z_BIT_6(v)
|
283
|
+
#define Z_RP2C0X_CONTROL_GET_EMIT_NMI_ON_VBLANK(v) Z_BIT_7(v)
|
284
|
+
|
285
|
+
/* Mask Register
|
286
|
+
.-----------------.
|
287
|
+
| 7 6 5 4 3 2 1 0 |
|
288
|
+
'-|-|-|-|-|-|-|-|-'
|
289
|
+
| | | | | | | '-> use_grayscale
|
290
|
+
| | | | | | '---> disable_background_clipping
|
291
|
+
| | | | | '-----> disable_sprite_clipping
|
292
|
+
| | | | '-------> enable_background
|
293
|
+
| | | '---------> enable_sprites
|
294
|
+
| | '-----------> intensify_red
|
295
|
+
| '-------------> intensify_green
|
296
|
+
'---------------> intensify_blue */
|
297
|
+
|
298
|
+
Z_DEFINE_STRICT_STRUCTURE (Z_BIT_FIELD(8, 8) (
|
299
|
+
zuint8 intensify_blue :1,
|
300
|
+
zuint8 intensify_green :1,
|
301
|
+
zuint8 intensify_red :1,
|
302
|
+
zuint8 enable_sprites :1,
|
303
|
+
zuint8 enable_background :1,
|
304
|
+
zuint8 disable_sprite_clipping :1,
|
305
|
+
zuint8 disable_background_clipping :1,
|
306
|
+
zuint8 use_grayscale :1
|
307
|
+
)) RP2C0xMaskRegister;
|
308
|
+
|
309
|
+
#define Z_RP2C0X_MASK_OPTION_USE_GRAYSCALE 1
|
310
|
+
#define Z_RP2C0X_MASK_OPTION_DISABLE_BACKGROUND_CLIPPING 2
|
311
|
+
#define Z_RP2C0X_MASK_OPTION_DISABLE_SPRITE_CLIPPING 4
|
312
|
+
#define Z_RP2C0X_MASK_OPTION_ENABLE_BACKGROUND 8
|
313
|
+
#define Z_RP2C0X_MASK_OPTION_ENABLE_SPRITES 16
|
314
|
+
#define Z_RP2C0X_MASK_OPTION_INTENSITY_RED 32
|
315
|
+
#define Z_RP2C0X_MASK_OPTION_INTENSITY_GREEN 64
|
316
|
+
#define Z_RP2C0X_MASK_OPTION_INTENSITY_BLUE 128
|
317
|
+
|
318
|
+
#define Z_RP2C0X_MASK_GET_USE_GRAYSCALE(v) Z_BIT_0(v)
|
319
|
+
#define Z_RP2C0X_MASK_GET_DISABLE_BACKGROUND_CLIPPING(v) Z_BIT_1(v)
|
320
|
+
#define Z_RP2C0X_MASK_GET_DISABLE_SPRITE_CLIPPING(v) Z_BIT_2(v)
|
321
|
+
#define Z_RP2C0X_MASK_GET_ENABLE_BACKGROUND(v) Z_BIT_3(v)
|
322
|
+
#define Z_RP2C0X_MASK_GET_ENABLE_SPRITES(v) Z_BIT_4(v)
|
323
|
+
#define Z_RP2C0X_MASK_GET_INTENSIFY_RED(v) Z_BIT_5(v)
|
324
|
+
#define Z_RP2C0X_MASK_GET_INTENSIFY_GREEN(v) Z_BIT_6(v)
|
325
|
+
#define Z_RP2C0X_MASK_GET_INTENSIFY_BLUE(v) Z_BIT_7(v)
|
326
|
+
|
327
|
+
/* Status Register
|
328
|
+
.-----------------.
|
329
|
+
| 7 6 5 4 3 2 1 0 |
|
330
|
+
'-|-|-|-\_______/-'
|
331
|
+
| | | '-----> unused
|
332
|
+
| | '-----------> sprite_overflow
|
333
|
+
| '-------------> sprite_hit
|
334
|
+
'---------------> vblank
|
335
|
+
|
336
|
+
Reading resets the 1st/2nd-write flipflop (used by register scroll and 2006h).
|
337
|
+
Reading resets Bit 7, can be used to acknowledge NMIs, Bit 7 is also automatically reset at the end of VBlank, so manual acknowledge is normally not required (unless one wants to free the NMI signal for external NMI inputs).
|
338
|
+
|
339
|
+
*/
|
340
|
+
|
341
|
+
Z_DEFINE_STRICT_STRUCTURE (Z_BIT_FIELD(8, 4) (
|
342
|
+
zuint8 vblank :1,
|
343
|
+
zuint8 sprite_hit :1,
|
344
|
+
zuint8 sprite_overflow :1,
|
345
|
+
zuint8 unused :5
|
346
|
+
)) RP2C0xStatusRegister;
|
347
|
+
|
348
|
+
|
349
|
+
#define Z_RP2C0X_STATUS_GET_SPRITE_OVERFLOW(v) Z_BIT_5(v)
|
350
|
+
#define Z_RP2C0X_STATUS_GET_SPRITE_HIT(v) Z_BIT_6(v)
|
351
|
+
#define Z_RP2C0X_STATUS_GET_VBLANK(v) Z_BIT_7(v)
|
352
|
+
|
353
|
+
/* Sprite
|
354
|
+
|
355
|
+
Y Coordinate
|
356
|
+
.-----------------.
|
357
|
+
| 7 6 5 4 3 2 1 0 |
|
358
|
+
'-----------------'
|
359
|
+
|
360
|
+
Tile Index
|
361
|
+
.-----------------.
|
362
|
+
| 7 6 5 4 3 2 1 0 |
|
363
|
+
'-\___________/-|-'
|
364
|
+
| |
|
365
|
+
| '-> patern_table
|
366
|
+
'---------> pattern_index
|
367
|
+
|
368
|
+
Attributes
|
369
|
+
.-----------------.
|
370
|
+
| 7 6 5 4 3 2 1 0 |
|
371
|
+
'-|-|-|-\___/-\_/-'
|
372
|
+
| | | | '--> palette ----------------.
|
373
|
+
| | | '-------> Unused |
|
374
|
+
| | '-----------> priority -----------. |
|
375
|
+
| '-------------> horizontal_flip --. | |
|
376
|
+
'---------------> vertical_flip --. | | |
|
377
|
+
| | | |
|
378
|
+
.--------------------------------' | | |
|
379
|
+
| .------------------------------' | |
|
380
|
+
| | .--------------' |
|
381
|
+
| | | |
|
382
|
+
v v v v
|
383
|
+
.---------. .----------------------. .--------.
|
384
|
+
| 0 = NO | | 0 = over background | | 00 = 4 |
|
385
|
+
| 1 = YES | | 1 = under background | | 01 = 5 |
|
386
|
+
'---------' '----------------------' | 10 = 6 |
|
387
|
+
| 11 = 7 |
|
388
|
+
'--------'
|
389
|
+
.-------------------------------.
|
390
|
+
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | X Coordinate
|
391
|
+
'-------------------------------' */
|
392
|
+
|
393
|
+
#define Z_RP2C0X_SPRITE_GET_X(p)
|
394
|
+
#define Z_RP2C0X_SPRITE_GET_Y(p)
|
395
|
+
#define Z_RP2C0X_SPRITE_GET_TILE_BANK(p)
|
396
|
+
#define Z_RP2C0X_SPRITE_GET_TILE_NUMBER(p)
|
397
|
+
#define Z_RP2C0X_SPRITE_GET_TILE_BANK(p)
|
398
|
+
#define Z_RP2C0X_SPRITE_GET_PALETTE(p)
|
399
|
+
#define Z_RP2C0X_SPRITE_GET_PRIORITY(P) ((p)->attributes & 4)
|
400
|
+
#define Z_RP2C0X_SPRITE_GET_HORIZONTAL_FLIP(p) ((p)->attributes & 2)
|
401
|
+
#define Z_RP2C0X_SPRITE_GET_VERTICAL_FLIP(p) ((p)->attributes & 1)
|
402
|
+
|
403
|
+
/* Palette
|
404
|
+
.-----------------.
|
405
|
+
| 7 6 5 4 3 2 1 0 |
|
406
|
+
'-\_/-\_/-\_____/-'
|
407
|
+
| | '----> hue
|
408
|
+
| '----------> value
|
409
|
+
'--------------> unused (0 when read) */
|
410
|
+
|
411
|
+
/* Color
|
412
|
+
.-----------------------------.
|
413
|
+
| Blue % | Green % | Red % |
|
414
|
+
.-----+---------+---------+---------|
|
415
|
+
| 001 | 74.3 | 91.5 | 123.9 |
|
416
|
+
| 010 | 88.2 | 108.6 | 79.4 |
|
417
|
+
| 011 | 65.3 | 98 | 101.9 |
|
418
|
+
| 100 | 127.7 | 102.6 | 90.5 |
|
419
|
+
| 101 | 97.9 | 90.8 | 102.3 |
|
420
|
+
| 110 | 100.1 | 98.7 | 74.1 |
|
421
|
+
| 111 | 75 | 75 | 75 |
|
422
|
+
'-----------------------------------' */
|
423
|
+
|
424
|
+
/* External Memory Structure
|
425
|
+
.------------------------------------------------.
|
426
|
+
| Address | Size | Content |
|
427
|
+
|-------------+-------+--------------------------|
|
428
|
+
| 0000 - 0FFF | 4096 | Pattern table #0 |
|
429
|
+
| 1000 - 1FFF | 4096 | Pattern table #1 |
|
430
|
+
|-------------+-------+--------------------------|
|
431
|
+
| 2000 - 23BF | 960 | Name table #0 |
|
432
|
+
| 23C0 - 23FF | 64 | Attribute table #0 |
|
433
|
+
| 2400 - 27BF | 960 | Name table #1 |
|
434
|
+
| 27C0 - 27FF | 64 | Attribute table #1 |
|
435
|
+
| 2800 - 2BBF | 960 | Name table #2 |
|
436
|
+
| 2BC0 - 2BFF | 64 | Attribute table #2 |
|
437
|
+
| 2C00 - 2FBF | 960 | Name table #3 |
|
438
|
+
| 2FC0 - 2FFF | 64 | Attribute table #3 |
|
439
|
+
|-------------+-------+--------------------------|
|
440
|
+
| 3000 - 3EFF | 3839 | Name Table Mirror *1 |
|
441
|
+
|-------------+-------+--------------------------|
|
442
|
+
| 3F00 | 1 | Default background color |
|
443
|
+
| 3F01 - 3F03 | 2 | Background palette #0 |
|
444
|
+
| 3F04 | 1 | Unused |
|
445
|
+
| 3F05 - 3F07 | 2 | Background palette #1 |
|
446
|
+
| 3F08 | 1 | Unused |
|
447
|
+
| 3F09 - 3F0B | 2 | Background palette #2 |
|
448
|
+
| 3F0C | 1 | Unused |
|
449
|
+
| 3F0D - 3F0F | 2 | Background palette #3 |
|
450
|
+
|-------------+-------+--------------------------|
|
451
|
+
| 3F10 | 1 | Mirror of 3F00h |
|
452
|
+
| 3F11 - 3F13 | 2 | Sprite palette #0 |
|
453
|
+
| 3F14 | 1 | Mirror of 3F04h |
|
454
|
+
| 3F15 - 3F17 | 2 | Sprite palette #1 |
|
455
|
+
| 3F18 | 1 | Mirror of 3F08h |
|
456
|
+
| 3F19 - 3F1B | 2 | Sprite palette #2 |
|
457
|
+
| 3F1C | 1 | Mirror of 3F0Ch |
|
458
|
+
| 3F1D - 3F1F | 2 | Sprite palette #3 |
|
459
|
+
|-------------+-------+--------------------------|
|
460
|
+
| 3F00 - 3FFF | 20 | Palette *2 |
|
461
|
+
| 4000 - FFFF | 49152 | Mirrors of Above *3 |
|
462
|
+
'------------------------------------------------'
|
463
|
+
|
464
|
+
Pattern Table:
|
465
|
+
|
466
|
+
|
467
|
+
Tile table: 256 tiles
|
468
|
+
Attribute table:
|
469
|
+
|
470
|
+
|
471
|
+
Name table:
|
472
|
+
Used to select tiles for the background. Each element is a tile index.
|
473
|
+
|
474
|
+
Attribute table:
|
475
|
+
|
476
|
+
|
477
|
+
*/
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
typedef struct {
|
483
|
+
zuint indexes[32 * 30];
|
484
|
+
zuint attributes[];
|
485
|
+
} ZRP2C0xNameTable;
|
486
|
+
|
487
|
+
|
488
|
+
#define Z_RP2C0X_ADDRESS_PATTERN_TABLE_0 0x0000
|
489
|
+
#define Z_RP2C0X_ADDRESS_PATTERN_TABLE_1 0x1000
|
490
|
+
#define Z_RP2C0X_ADDRESS_NAME_TABLE_0 0x2000
|
491
|
+
#define Z_RP2C0X_ADDRESS_NAME_TABLE_1 0x2400
|
492
|
+
#define Z_RP2C0X_ADDRESS_NAME_TABLE_2 0x2800
|
493
|
+
#define Z_RP2C0X_ADDRESS_NAME_TABLE_3 0x2C00
|
494
|
+
#define Z_RP2C0X_ADDRESS_ATTRIBUTE_TABLE_0 0x23C0
|
495
|
+
#define Z_RP2C0X_ADDRESS_ATTRIBUTE_TABLE_1 0x27C0
|
496
|
+
#define Z_RP2C0X_ADDRESS_ATTRIBUTE_TABLE_2 0x2BC0
|
497
|
+
#define Z_RP2C0X_ADDRESS_ATTRIBUTE_TABLE_3 0x2FC0
|
498
|
+
|
499
|
+
#define Z_RP2C0X_ADDRESS_DEFAULT_BACKGROUND_COLOR 0x3F00
|
500
|
+
#define Z_RP2C0X_ADDRESS_BACKGROUND_PALETTE_0 0x3F01
|
501
|
+
#define Z_RP2C0X_ADDRESS_BACKGROUND_PALETTE_1 0x3F05
|
502
|
+
#define Z_RP2C0X_ADDRESS_BACKGROUND_PALETTE_2 0x3F09
|
503
|
+
#define Z_RP2C0X_ADDRESS_BACKGROUND_PALETTE_3 0x3F0D
|
504
|
+
#define Z_RP2C0X_ADDRESS_SPRITE_PALETTE_0 0x3F11
|
505
|
+
#define Z_RP2C0X_ADDRESS_SPRITE_PALETTE_1 0x3F15
|
506
|
+
#define Z_RP2C0X_ADDRESS_SPRITE_PALETTE_2 0x3F19
|
507
|
+
#define Z_RP2C0X_ADDRESS_SPRITE_PALETTE_3 0x3F1D
|
508
|
+
|
509
|
+
#define Z_RP2C0X_TILE_SIZE 8
|
510
|
+
#define Z_RP2C0X_PATTERN_SIZE Z_RP2C0X_TILE_SIZE * 2
|
511
|
+
#define Z_RP2C0X_PATTERN_TABLE_SIZE Z_RP2C0X_PATTERN_SIZE * 256
|
512
|
+
#define Z_RP2C0X_NAME_TABLE_SIZE Z_UINT8_SIZE * 32 * 30
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
/* Tile 8x8
|
517
|
+
<--------------- 8 bit -------------->
|
518
|
+
.---------------------------------------.
|
519
|
+
A | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|
520
|
+
| |----+----+----+----+----+----+----+----|
|
521
|
+
| | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
|
522
|
+
| |----+----+----+----+----+----+----+----|
|
523
|
+
| | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
|
524
|
+
| |----+----+----+----+----+----+----+----|
|
525
|
+
| | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
|
526
|
+
8 byte | |----+----+----+----+----+----+----+----|
|
527
|
+
| | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
|
528
|
+
| |----+----+----+----+----+----+----+----|
|
529
|
+
| | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
|
530
|
+
| |----+----+----+----+----+----+----+----|
|
531
|
+
| | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
|
532
|
+
| |----+----+----+----+----+----+----+----|
|
533
|
+
V | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
|
534
|
+
'---------------------------------------' */
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
|
540
|
+
/*
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
<----------------- 512 ----------------->
|
550
|
+
|
551
|
+
(0,0) (255,0) (256,0) (511,0)
|
552
|
+
+-------------+ +-------------+
|
553
|
+
|2000 20FF| |2000 20FF|
|
554
|
+
| | | |
|
555
|
+
| | | |
|
556
|
+
| | | |
|
557
|
+
|2300 23FF| |2300 23FF|
|
558
|
+
+-------------+ +-------------+
|
559
|
+
(0,240) (255,255) (0,240) (255,255)5)
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
*/
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
#define Z_RP2C0X_ADDRESS_TILE_SET_0
|
569
|
+
#define Z_RP2C0X_ADDRESS_TILE_SET_1
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
typedef struct {
|
577
|
+
zuint8 tile_0[8];
|
578
|
+
zuint8 tile_1[8];
|
579
|
+
} ZRP2C0xPattern;
|
580
|
+
|
581
|
+
typedef struct {
|
582
|
+
} ZRP2C0xPatternTable;
|
583
|
+
|
584
|
+
/*
|
585
|
+
typedef struct {
|
586
|
+
} ZRP2C0xNameTable;*/
|
587
|
+
|
588
|
+
|
589
|
+
#define Z_RP2C0X_TILE_GET_PIXEL(tile, index) \
|
590
|
+
(tile[(index) / 8] >> (7 - ((index) % 8)) & 1)
|
591
|
+
|
592
|
+
#define Z_RP2C0X_PATTERN_GET_PIXEL(pattern, index) \
|
593
|
+
Z_RP2C0X_TILE_GET_PIXEL(pattern->plane_a, index) | \
|
594
|
+
(Z_RP2C0X_TILE_GET_PIXEL(pattern->plane_b, index) << 1)
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
/*
|
608
|
+
typedef struct {
|
609
|
+
|
610
|
+
} ZRP2C0xNameTable;*/
|
611
|
+
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
|
621
|
+
#define Z_RP2C0X_MASK_GET_GRAYSCALE_MODE
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
#endif /* _Z_hardware_VDC_Ricoh_RP2C0x_H_ */
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/* Z Kit - hardware/bus/AGP.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_bus_AGP_H_
|
9
|
+
#define _Z_hardware_bus_AGP_H_
|
10
|
+
|
11
|
+
#define Z_AGP_COMMAND_READ 0x0
|
12
|
+
#define Z_AGP_COMMAND_READ_HIGH_PRIORITY 0x1
|
13
|
+
/* Reserved 0x2 - 0x3 */
|
14
|
+
#define Z_AGP_COMMAND_WRITE 0x4
|
15
|
+
#define Z_AGP_COMMAND_WRITE_HIGH_PRIORITY 0x5
|
16
|
+
/* Reserved 0x6 - 0x7 */
|
17
|
+
#define Z_AGP_COMMAND_LONG_READ 0x8
|
18
|
+
#define Z_AGP_COMMAND_LONG_READ_HIGH_PRIORITY 0x9
|
19
|
+
#define Z_AGP_COMMAND_FLUSH 0xA
|
20
|
+
/* Reserved 0xB */
|
21
|
+
#define Z_AGP_COMMAND_FENCE 0xC
|
22
|
+
/* Reserved 0xD - 0xF */
|
23
|
+
|
24
|
+
#endif /* _Z_hardware_bus_AGP_H_ */
|