1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-26 10:29:31 +00:00
CLK/Machines/Atari/2600/PIA.hpp
2024-01-16 23:34:46 -05:00

38 lines
627 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(int port) {
return port_values_[port];
}
inline void update_port_input(int port, uint8_t mask, 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];
};
}