1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-12-22 18:29:20 +00:00
r65emu/ram.h

18 lines
410 B
C
Raw Normal View History

2014-11-10 14:16:45 +00:00
#ifndef __RAM_H__
#define __RAM_H__
2014-10-18 11:33:48 +00:00
2014-10-21 18:41:44 +00:00
class ram: public Memory::Device {
2014-10-18 11:33:48 +00:00
public:
virtual void operator= (byte c) { _mem[_acc] = c; }
virtual operator byte () { return _mem[_acc]; }
2014-10-18 11:33:48 +00:00
virtual void checkpoint(Stream &s) { s.write(_mem, sizeof(_mem)); }
virtual void restore(Stream &s) { s.readBytes((char *)_mem, sizeof(_mem)); }
2014-10-18 11:33:48 +00:00
ram (): Memory::Device(sizeof(_mem)) {}
2014-10-18 11:33:48 +00:00
private:
byte _mem[1024];
2014-10-18 11:33:48 +00:00
};
#endif