1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-11 15:49:38 +00:00
CLK/Machines/Atari/2600/PIA.hpp

35 lines
634 B
C++

//
// PIA.h
// Clock Signal
//
// Created by Thomas Harte on 03/12/2016.
// Copyright 2016 Thomas Harte. All rights reserved.
//
#pragma once
#include <cstdint>
#include "../../../Components/6532/6532.hpp"
namespace Atari2600 {
class PIA: public MOS::MOS6532<PIA> {
public:
inline uint8_t get_port_input(const int port) {
return port_values_[port];
}
inline void update_port_input(const int port, const uint8_t mask, const bool set) {
if(set) port_values_[port] &= ~mask; else port_values_[port] |= mask;
set_port_did_change(port);
}
PIA() : port_values_{0xff, 0xff} {}
private:
uint8_t port_values_[2];
};
}