Skip to content

title: "MemCpyUnroll" description: TRSE built-in method (from IDE help)


MemCpyUnroll

Systems: MOS6502
Parameters: a,b,a,b


MemCpyUnroll( [address1 source], [byte1 offset], [address2 destination], [byte2 total] );

  • [address1 source] - Source address to copy from
  • [byte1 offset] - offset to start copying from
  • [address2 destination] - destination address to copy to
  • [byte2 total] - number of bytes to copy

Description

unroll is mega fast compared to the other memcpy commands but it consumes memory

In assembler does something like this

B[0] := A[0]; B[1] := A[1]; B[2] := A[2];

Example

// copies 16 bytes = from color memory to some user-defined pointer MemCpy(^$D800, 0, my_ptr, 16);

Notes:

Make sure that the Source and the Destinatin pointers are initialised as Integers

You can't use expressions in the command

s: pointer of integer; d: pointer of integer; s:=1154; d:=1153; MemCpyUnroll(s, 0, d, 20);