vgbc/memory/mem_device.h
2023-08-29 23:16:09 +02:00

29 lines
444 B
C++

#pragma once
#include <misc/types.h>
class Range {
private:
u16 start;
u16 end;
public:
constexpr Range(u16 start, u16 end)
: start(start), end(end)
{};
inline
bool contains(u16 addr)
{
return addr >= start && addr <= end;
}
};
class Mem_device {
public:
virtual void write8(u16 addr, u8 data) = 0;
virtual u8 read8(u16 addr) = 0;
virtual void write16(u16 addr, u16 data);
virtual u16 read16(u16 addr);
};