15#include "SubComponent.h"
19class PIA6821 :
public SubComponent {
22 friend class ParCable;
24 Descriptions descriptions = {{
27 .description =
"PIA 6821"
64 PIA6821(C64 &ref, Drive &drvref);
66 PIA6821& operator= (
const PIA6821& other) {
92 void serialize(T& worker)
109 } SERIALIZERS(serialize);
118 const Descriptions &getDescriptions()
const override {
return descriptions; }
127 void setCA1External(
bool value);
128 void setCA2External(
bool value);
129 void setCB1External(
bool value);
130 void setCB2External(
bool value);
132 void toggleCA1External() { setCA1External(!ca1); }
133 void toggleCA2External() { setCA1External(!ca2); }
134 void toggleCB1External() { setCA1External(!cb1); }
135 void toggleCB2External() { setCA1External(!cb2); }
137 void pulseCA1External() { toggleCA1External(); toggleCA1External(); }
141 void setCA2Internal(
bool value);
142 void setCB2Internal(
bool value);
144 u8 ca2Control()
const {
return (cra >> 3) & 0b111; }
145 u8 cb2Control()
const {
return (crb >> 3) & 0b111; }
146 bool ca2IsInput()
const {
return GET_BIT(cra, 5); }
147 bool cb2IsInput()
const {
return GET_BIT(crb, 5); }
149 bool isActiveTransitionCA1(
bool oldValue,
bool newValue)
const;
150 bool isActiveTransitionCA2(
bool oldValue,
bool newValue)
const;
151 bool isActiveTransitionCB1(
bool oldValue,
bool newValue)
const;
152 bool isActiveTransitionCB2(
bool oldValue,
bool newValue)
const;
155 virtual void ca2HasChangedTo(
bool value) { };
156 virtual void cb2HasChangedTo(
bool value) { };
157 virtual void irqAHasOccurred()
const { };
158 virtual void irqBHasOccurred()
const { };
168 u8 peek(
bool rs1,
bool rs0);
169 u8 spypeek(
bool rs1,
bool rs0)
const {
return 0; }
172 void poke(
bool rs1,
bool rs0, u8 value);
177 virtual u8 updatePA();
178 virtual u8 updatePB();
185class PiaDolphin final :
public PIA6821 {
189 using PIA6821::PIA6821;
193 void ca2HasChangedTo(
bool value)
override;
194 void cb2HasChangedTo(
bool value)
override;
195 void irqAHasOccurred()
const override;
196 void irqBHasOccurred()
const override;
197 u8 updatePA()
override;
198 u8 updatePB()
override;
203 u8 spypeek(u16 addr)
const;
204 void poke(u16 addr, u8 value);
VirtualC64 project namespace.
Definition CmdQueue.cpp:16