2 // Virtual 6821 (PIA) Header file
6 // (C) 2022 Underground Software
17 uint8_t ddra, ddrb; // Data Direction Register A/B
18 uint8_t pa, pb; // Peripheral Interface A/B
19 uint8_t cra, crb; // Control Register A/B
20 uint8_t ora, orb; // Output Register A/B
21 bool ca1, ca2, cb1, cb2; // CA1/2, CB1/2
22 bool irqa1, irqa2, irqb1, irqb2; // Internal state flags
23 bool irqaState, irqbState; // More internal state flags
25 void (* IRQA)(bool); // Address of IRQ A routine
26 void (* IRQB)(bool); // Address of IRQ B routine
29 V6821PIA(); // We have to do this because function pointers
30 // can't have default parameters... :-P
31 V6821PIA(void (* a)(bool), void (* b)(bool));
33 uint8_t Read(uint8_t);
34 void Write(uint8_t, uint8_t);
41 void HandleIRQs(void);