RB_COPY new 2080

Top  Previous  Next

Action

Copy whole stripes or any parts of it, to another stripes memory space at any position.

 

 

Syntax

RB_COPY Source , SourceStart, Target, TargetStart, Count

 

 

Remarks

Source

The index of the source stripe.

SourceStart

The position to start the copy from

Target

The index of the target stripe. This can be the same stripe or another one.

TargetStart

The position to start the copy to.

Count

The number of bytes to copy.

 

 

This routine offers a faster track to copy a whole bunch of color data , if necessary.

 

 

See also

CONFIG RAINBOW , RB_ADDCOLOR, RB_ANDCOLOR, RB_ORCOLOR, RB_SUBCOLOR, RB_CLEARSTRIPE , RB_CLEARCOLORS , RB_FILL , RB_FILLCOLORS , RB_FILLSTRIPE , RB_SELECTCHANNEL, RB_SEND, RB_SETCOLOR , RB_SWAPCOLOR , RB_ROTATELEFT, RB_ROTATERIGHT, RB_SHIFTLEFT, RB_SHIFTRIGHT , RB_CHANGEPIN , RB_SETTABLECOLOR , RB_LOOKUPCOLOR , RB_COLOR

 

 

Example

 

$regfile = "m32adef.dat"
$crystal = 16000000
$hwstack = 40
$swstack = 16
$framesize = 32
 
'(
RB_Copy Rainbow0_ , 5 ,Rainbow1_ ,0   , 3
'                                          ^---- count of leds to copy
'                                    ^---------- Led, start index of target
'                            ^------------------ target stripe or array
'                      ^------------------------ LED, start index of source
'              ^-------------------------------- source stripe or array
')
 
Config Rainbow = 2 , Rb0_len = 8 , Rb0_port = Porta , Rb0_pin = 0 , _
                    Rb1_len = 8 , Rb1_port = Porta , Rb1_pin = 1
 
Dim Color as Dword
 
Const Red = &H000010
Const Green = &H001000
Const Blue = &H100000
Const Yellow = &H001010
 
'color the first 4 LED
Rb_selectchannel 0
Color = Green
Rb_setcolor 0 , Color
 
Color = Red
RB_SetColor 1 , Color
 
Color = Blue
RB_SetColor 2 , Color
 
Color = Yellow
RB_SetColor 3 , Color
RB_Send
wait 1
' copy LED 0 to 3 of stripe 0 to pos 4 to 7
Rb_copy Rainbow0_ , 0 , Rainbow0_ , 4 , 4
Rb_send
Wait 1
 
' copy whole stripe0 to stripe1
RB_Copy Rainbow0_ , 0 , Rainbow1_ , 0 , 8
RB_Clearcolors
RB_SelectChannel(0) : RB_Send
RB_SelectChannel(1) : RB_Send
Wait 1
'copy LED1  of stripe1 to LED7 of stripe0
RB_Copy Rainbow1_ , 1 , Rainbow0_ , 7 , 1
RB_SelectChannel(0) : RB_Send
End