21 lines
354 B
C
21 lines
354 B
C
|
#pragma once
|
||
|
|
||
|
#include "mem_device.h"
|
||
|
|
||
|
class RAM : public Mem_device {
|
||
|
private:
|
||
|
u8* memory;
|
||
|
u16 size;
|
||
|
bool readonly;
|
||
|
|
||
|
public:
|
||
|
RAM(u16 size);
|
||
|
RAM(u8* memory, u16 size, bool readonly = false);
|
||
|
|
||
|
virtual void write8(u16 addr, u8 data);
|
||
|
virtual u8 read8(u16 addr);
|
||
|
|
||
|
virtual void write16(u16 addr, u16 data);
|
||
|
virtual u16 read16(u16 addr);
|
||
|
};
|