2023-08-30 22:16:57 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <misc/types.h>
|
2023-08-30 22:34:45 +02:00
|
|
|
#include <memory/device.h>
|
2023-08-30 22:16:57 +02:00
|
|
|
|
|
|
|
class BoundRegister : public Mem_device {
|
|
|
|
private:
|
|
|
|
u8& reg;
|
|
|
|
public:
|
|
|
|
inline
|
|
|
|
BoundRegister(u8& reg)
|
|
|
|
: reg(reg)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual void write8(u16 addr, u8 data);
|
|
|
|
virtual u8 read8(u16 addr);
|
|
|
|
};
|
2023-09-01 23:19:02 +02:00
|
|
|
|
|
|
|
class ConstRegister : public Mem_device {
|
|
|
|
private:
|
|
|
|
u8 value;
|
|
|
|
public:
|
|
|
|
inline
|
|
|
|
ConstRegister(u8 value)
|
|
|
|
: value(value)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual void write8(u16 addr, u8 data);
|
|
|
|
virtual u8 read8(u16 addr);
|
|
|
|
};
|