1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-11-19 11:31:16 +00:00
r65emu/memory.cpp

23 lines
366 B
C++
Raw Normal View History

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