1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-09 21:29:53 +00:00
CLK/Machines/Acorn/Archimedes/CMOSRAM.hpp
Thomas Harte 3ba12630ab Quieten.
2024-03-26 12:27:37 -04:00

40 lines
650 B
C++

//
// CMOSRAM.hpp
// Clock Signal
//
// Created by Thomas Harte on 20/03/2024.
// Copyright © 2024 Thomas Harte. All rights reserved.
//
#pragma once
#include "../../../Components/I2C/I2C.hpp"
namespace Archimedes {
struct CMOSRAM: public I2C::Peripheral {
void start(bool is_read) override {
expecting_address_ = !is_read;
}
std::optional<uint8_t> read() override {
return 0;
}
void write(uint8_t value) override {
if(expecting_address_) {
address_ = value;
} else {
printf("Write to %d\n", address_);
++address_;
// TODO: write to RAM.
}
}
private:
bool expecting_address_ = false;
uint8_t address_;
};
}