1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-10-10 10:23:49 +00:00
r65emu/memory.cpp

25 lines
392 B
C++
Raw Normal View History

2014-10-18 11:33:48 +00:00
#include "memory.h"
void Memory::put (Device &dev, address b) {
Device **d = _pages + b/page_size;
int size = dev.pages();
while (size--)
*d++ = &dev;
dev.base(b);
}
class NullDevice: public Memory::Device {
public:
NullDevice(): Memory::Device(65536) {}
void operator= (byte b) {}
operator byte() { return 0; }
} nd;
Memory::Memory() {
put(nd, 0);
}