1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-12-20 21:29:48 +00:00
r65emu/memory.cpp
2018-08-14 06:10:37 +01:00

25 lines
438 B
C++

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