From 82367a2246e9f24ca0502b2d076a4e0bf5891e07 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 16 Aug 2017 09:14:56 -0400 Subject: [PATCH] Added documentation. --- Components/AY38910/AY38910.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Components/AY38910/AY38910.hpp b/Components/AY38910/AY38910.hpp index 9bc7eef5b..963c9071f 100644 --- a/Components/AY38910/AY38910.hpp +++ b/Components/AY38910/AY38910.hpp @@ -14,14 +14,36 @@ namespace GI { namespace AY38910 { +/*! + A port handler provides all input for an AY's two 8-bit ports, and may optionally receive + active notification of changes in output. + + Machines with an AY without ports or with nothing wired to them need not supply a port handler. + Machines that use the AY ports as output but for which polling for changes is acceptable can + instead use AY38910.get_port_output. +*/ class PortHandler { public: + /*! + Requests the current input on an AY port. + + @param port_b @c true if the input being queried is Port B. @c false if it is Port A. + */ virtual uint8_t get_port_input(bool port_b) { return 0xff; } + + /*! + Requests the current input on an AY port. + + @param port_b @c true if the input being queried is Port B. @c false if it is Port A. + */ virtual void set_port_output(bool port_b, uint8_t value) {} }; +/*! + Names the control lines used as input to the AY, which uses CP1600 bus semantics. +*/ enum ControlLines { BC1 = (1 << 0), BC2 = (1 << 1),