mirror of
https://github.com/jscrane/r65emu.git
synced 2024-10-10 10:23:49 +00:00
25 lines
392 B
C++
25 lines
392 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;
|
||
|
|
||
|
Memory::Memory() {
|
||
|
put(nd, 0);
|
||
|
}
|
||
|
|
||
|
|