Prev: $2F8C Up: Map Next: $3012
$2FB6: Move a column of screen tiles left or right
Used by the routines at $3072 and $3113.
Input
($4E,$4F) Source screen bitmap address
($50,$51) Source colour information address
($52,$53) Destination screen bitmap address
($54) Source colour information index
($55) Destination colour information index
$2FB6 LDX #$15 There are 21 screen rows to shift.
$2FB8 LDY #$00 Initialise the index.
$2FBA LDA ($4E),Y Copy the eight bytes of the source tile to the destination tile.
$2FBC STA ($52),Y
$2FBE INY
$2FBF LDA ($4E),Y
$2FC1 STA ($52),Y
$2FC3 INY
$2FC4 LDA ($4E),Y
$2FC6 STA ($52),Y
$2FC8 INY
$2FC9 LDA ($4E),Y
$2FCB STA ($52),Y
$2FCD INY
$2FCE LDA ($4E),Y
$2FD0 STA ($52),Y
$2FD2 INY
$2FD3 LDA ($4E),Y
$2FD5 STA ($52),Y
$2FD7 INY
$2FD8 LDA ($4E),Y
$2FDA STA ($52),Y
$2FDC INY
$2FDD LDA ($4E),Y
$2FDF STA ($52),Y
$2FE1 LDY $54 Copy the colour information of the source tile to the destination tile.
$2FE3 LDA ($50),Y
$2FE5 LDY $55
$2FE7 STA ($50),Y
$2FE9 LDA $4E Add 320 (40x8) to the source screen bitmap address at $4E. Now it points at the adjacent tile in the row below.
$2FEB INC $4F
$2FED CLC
$2FEE ADC #$40
$2FF0 BCC $2FF4
$2FF2 INC $4F
$2FF4 STA $4E
$2FF6 LDA $52 Add 320 (40x8) to the destination screen bitmap address at $52. Now it points at the adjacent tile in the row below.
$2FF8 INC $53
$2FFA CLC
$2FFB ADC #$40
$2FFD BCC $3001
$2FFF INC $53
$3001 STA $52
$3003 LDA $50 Add 40 to the source colour information address at $50. Now it points at the adjacent tile in the row below.
$3005 CLC
$3006 ADC #$28
$3008 BCC $300C
$300A INC $51
$300C STA $50
$300E DEX Next screen row.
$300F BNE $2FB8 Branch back until all 21 rows are done.
$3011 RTS
Prev: $2F8C Up: Map Next: $3012