1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-11-19 11:31:16 +00:00
r65emu/memory.cpp
Stephen Crane e0633e6450 cleanup
2014-10-31 17:44:37 +00:00

24 lines
412 B
C++

#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;
void Memory::begin() {
put(nd, 0);
nd._pages = 1; // hack for checkpointing
}