putfx01
movlw fx01%256 ; fx table 1 address lo |B0
movwf ptrl ; |B0
movlw fx01/256 ; fx table 1 address hi |B0
movwf ptrh ; |B0
movlw fx01cnt ; fx table 1 length |B0
movwf count ; |B0
sendrgb
call getdata ; get RGB pattern byte |B0
movwf pattern ; b0 = GRN, b1 = RED, b2 = BLU |B0
movlw 0x00 ; |B0
btfsc pattern,0 ; |B0
movlw 0xFF ; |B0
btfsc SSP1STAT,BF ; busy? no, skip, else |B0
goto $-1 ; loop (wait) |B0
movwf SSP1BUF ; send GRN byte |B0
incf ptrl,F ; bump pattern index |B0
skpnz ; " |B0
incf ptrh,F ; " |B0
movlw 0x00 ; |B0
btfsc pattern,1 ; |B0
movlw 0xFF ; |B0
btfsc SSP1STAT,BF ; busy? no, skip, else |B0
goto $-1 ; loop (wait) |B0
movwf SSP1BUF ; send RED byte |B0
movlw 0x00 ; |B0
btfsc pattern,2 ; |B0
movlw 0xFF ; |B0
btfsc SSP1STAT,BF ; busy? no, skip, else |B0
goto $-1 ; loop (wait) |B0
movwf SSP1BUF ; send BLU byte |B0
decfsz count,F ; last byte? yes, skip, else |B0
goto sendrgb ; branch (send next fx data) |B0
return ; done |B0
getdata
movf ptrh,W ; |B0
movwf PCLATH ; |B0
movf ptrl,W ; |B0
movwf PCL ; jump |B0
fx01
dt 0,3,7,7,3,0,6,1,2,3,6,1,1,2,4,5
fx01cnt equ $-fx01 ; length fx01 table