mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
38 lines
627 B
C++
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];
|
|
|
|
};
|
|
|
|
}
|