mirror of
https://github.com/jscrane/r65emu.git
synced 2024-11-16 21:10:58 +00:00
25 lines
438 B
C++
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
|
|
}
|