30 lines
473 B
C++
30 lines
473 B
C++
#pragma once
|
|
|
|
#include <misc/types.h>
|
|
#include <memory/device.h>
|
|
|
|
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);
|
|
};
|
|
|
|
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);
|
|
};
|