1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-12-27 05:32:04 +00:00
This commit is contained in:
Stephen Crane 2014-10-31 17:44:37 +00:00
parent 848a91c68c
commit e0633e6450
2 changed files with 5 additions and 10 deletions

View File

@ -44,11 +44,8 @@ void hardware_checkpoint(Stream &s) {
unsigned ds = 0; unsigned ds = 0;
for (unsigned i = 0; i < 0x10000; i += ds) { for (unsigned i = 0; i < 0x10000; i += ds) {
Memory::Device *dev = memory.get(i); Memory::Device *dev = memory.get(i);
if (dev) {
dev->checkpoint(s); dev->checkpoint(s);
ds = dev->pages() * Memory::page_size; ds = dev->pages() * Memory::page_size;
} else
ds = Memory::page_size;
} }
_cpu->checkpoint(s); _cpu->checkpoint(s);
} }
@ -57,11 +54,8 @@ void hardware_restore(Stream &s) {
unsigned ds = 0; unsigned ds = 0;
for (unsigned i = 0; i < 0x10000; i += ds) { for (unsigned i = 0; i < 0x10000; i += ds) {
Memory::Device *dev = memory.get(i); Memory::Device *dev = memory.get(i);
if (dev) {
dev->restore(s); dev->restore(s);
ds = dev->pages() * Memory::page_size; ds = dev->pages() * Memory::page_size;
} else
ds = Memory::page_size;
} }
_cpu->restore(s); _cpu->restore(s);
} }

View File

@ -19,4 +19,5 @@ public:
void Memory::begin() { void Memory::begin() {
put(nd, 0); put(nd, 0);
nd._pages = 1; // hack for checkpointing
} }