mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Ensures 16/48kb snapshots are properly copied into place.
This commit is contained in:
parent
9b65d56ed0
commit
2bbf8bc9fa
@ -127,7 +127,17 @@ template<Model model> class ConcreteMachine:
|
||||
if(target.state) {
|
||||
const auto state = static_cast<State *>(target.state.get());
|
||||
state->z80.apply(z80_);
|
||||
memcpy(ram_.data(), state->ram.data(), std::min(ram_.size(), state->ram.size()));
|
||||
|
||||
// If this is a 48k or 16k machine, remap source data from its original
|
||||
// linear form to whatever the banks end up being; otherwise copy as is.
|
||||
if(model <= Model::FortyEightK) {
|
||||
for(size_t c = 0; c < 48*1024 && c < state->ram.size(); c++) {
|
||||
const auto address = c + 0x4000;
|
||||
write_pointers_[address >> 14][address] = state->ram[c];
|
||||
}
|
||||
} else {
|
||||
memcpy(ram_.data(), state->ram.data(), std::min(ram_.size(), state->ram.size()));
|
||||
}
|
||||
|
||||
LOG("TODO: apply rest of state");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user