Copying a memory block between different pages

More
3 weeks 3 days ago - 3 weeks 3 days ago #237 by ludojoey
Hello!

Is there a way to copy a block of memory from an area belonging to a given page to an area on another page?

I see that the memCpy and areaCpy functions don't allow specifying a different page number for the source and destination.

If not, is there another, faster way to do this than using a loop with peek/poke?
Last edit: 3 weeks 3 days ago by ludojoey.

Please Log in or Create an account to join the conversation.

More
3 weeks 2 days ago - 3 weeks 2 days ago #239 by Franck
If the distance between the addresses is small enough (48Kib-size) you can place the window across the source and destination and copy in a single pass.
Otherwise the general practice is to copy to scratchpad first (blocs of 2KiB max) than from scratchpad to the destination. If larger than 2 KiB, you take the size and divide by 2048 to know how many copies you'll need and loop that many time. This is why the scratchpad is always visible.

 
Last edit: 3 weeks 2 days ago by Franck.
The following user(s) said Thank You: ludojoey

Please Log in or Create an account to join the conversation.

Time to create page: 0.182 seconds
Powered by Kunena Forum