mirror of
https://github.com/TomHarte/CLK.git
synced 2025-04-29 10:37:42 +00:00
Switch to more efficient copy.
This commit is contained in:
parent
2510064218
commit
205518ba75
@ -132,9 +132,9 @@ template<Model model> class ConcreteMachine:
|
|||||||
// If this is a 48k or 16k machine, remap source data from its original
|
// 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.
|
// linear form to whatever the banks end up being; otherwise copy as is.
|
||||||
if(model <= Model::FortyEightK) {
|
if(model <= Model::FortyEightK) {
|
||||||
for(size_t c = 0; c < 48*1024 && c < state->ram.size(); c++) {
|
const size_t num_banks = std::min(size_t(48*1024), state->ram.size()) >> 14;
|
||||||
const auto address = c + 0x4000;
|
for(size_t c = 0; c < num_banks; c++) {
|
||||||
write_pointers_[address >> 14][address] = state->ram[c];
|
memcpy(&write_pointers_[c + 1][(c+1) * 0x4000], &state->ram[c * 0x4000], 0x4000);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
memcpy(ram_.data(), state->ram.data(), std::min(ram_.size(), state->ram.size()));
|
memcpy(ram_.data(), state->ram.data(), std::min(ram_.size(), state->ram.size()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user