title: "RightBitShift" description: TRSE built-in method (from IDE help)
RightBitShift
Systems: MOS6502
Parameters: a, n
RightBitShift( [address], [number] );
- [address] - memory address of the characters to shift
- [number] - number of full character data to shift
Description
Shifts N ( parameter 2 ) characters (N*8 bytes) 1 bit to the right.
Useful for having "scrolling" characters on screen, like lava and water etc.
Example
// Assume that you have a character set at $2000 at bank 1
copycharsetfromrom( ^$2000 );
setcharsetlocation( $2000 );
clearscreen( $20, ^$0400 );
poke( ^$0400 + ^40 * ^4, 4, 1 ); // Print "A"
poke( ^$0400 + ^40 * ^4, 5, 2 ); // Print "B"
poke( ^$0400 + ^40 * ^4, 6, 3 ); // Print "C"
while ( 1 = 1 ) do
begin
RightBitShift( ^$2000+^8*^1, 3 ); // Will shift the characters "ABC"
waitforraster( 200 ); // wait one raster cycle;
end;