lda #$00 sta SCROLLPOS ... Mainloop: jsr Get5Bit ... Get5Bit: ldy SCROLLPOS lda scrolltext,y // Do magic // if necessary increase Y and store in SCROLLPOS .. rts scrolltext: (5-bit data packed into 8-bit bytes here)
get5bits: lda #$00 sta TMPBYTE1 ldy #$05 !loop: lda BITCOUNT bne !skip+ ldx SCROLLPOS lda scrolltext,x sta TMPBYTE2 inx stx SCROLLPOS lda #$08 sta BITCOUNT !skip: asl TMPBYTE2 rol TMPBYTE1 dec BITCOUNT dey bne !loop- lda TMPBYTE1 rts
get5bits: lda #$00 ldy #$05 !loop: asl TMPBYTE2 rol dec BITCOUNT bne !skip+ pha ldx SCROLLPOS lda scrolltext,x sta TMPBYTE2 inc SCROLLPOS lda #$08 sta BITCOUNT pla !skip: dey bne !loop- rts
get5bits: lda #%00001000 !loop: asl TMPBYTE2 dec BITCOUNT bne !skip+ ldx SCROLLPOS ldy scrolltext,x sty TMPBYTE2 inc SCROLLPOS ldy #$08 sty BITCOUNT !skip: rol bcc !loop- rts
*= $0326 packedbytes equ $B9 .word start .word $F6ED data=*-1 .byte $5D,$B5,$25,$25,$D5,$DB,$FF,$79,$5B,$FD,$21,$3B,$51,$85,$3B,$E7 .byte $77,$77,$3B,$23,$FF,$CD,$BB,$BB,$CF,$57,$55,$DF,$77,$55,$A9,$FF .byte $E7,$67,$31,$A1,$ED,$09,$1B,$E5,$F7,$FF,$F5,$D5,$F7,$CD,$9F,$69 .byte $49,$59,$65,$21,$9B,$01,$67,$BB,$3F,$4D,$A5,$91,$29,$6E,$03,$F3 .byte $19,$9B,$69,$AD,$A9,$0B,$3F,$12,$1B,$1B,$3D,$57,$F7,$D7,$4F,$1F .byte $8F,$2E,$41,$11,$AB,$6D,$FE,$AB,$A7,$31,$63,$6E,$CD,$57,$71,$95 .byte $74,$47,$0C,$F4,$91,$84,$FB,$82,$84,$CC,$29,$E9,$D9,$8C,$79,$4B .byte $75,$61,$41,$1E,$33,$BB,$3E,$16,$F3,$F2,$45,$61,$44,$3C,$28,$7A .byte $B9,$2C,$EB,$CC,$83,$83,$E0,$94,$75,$FD,$F6,$14,$7C,$12,$26,$07 .byte $48,$AA,$ED,$F4,$A6,$E1,$FF,$E7,$4F,$4F,$D7,$75,$D4,$88,$80,$29 .byte $5A,$AA,$FF,$72,$02,$80,$2E,$99,$89,$96,$D0,$58,$F9,$C3,$C8,$FF .byte $00,$FF,$FF,$FF,$FF,$00,$FF,$FF,$FF start LDX #packedbytes SEI loop LDA #$07 ; #$87/#$07 slow/fast waitr CMP $D012 BNE waitr SBC #$01 AND #$87 STA $d016 BCS waitr ; BMI/BCS slow/fast copychar LDA $05E1,Y STA $05E0,Y LDA #$0F ; Selectable color STA $D9E0,Y INY BNE copychar LDA #$08 inner ASL data,x BCC zero INC data,x zero ROL DEX BNE skipreset LDX #packedbytes skipreset BCC inner ADC #$00 CMP #$1E BNE skipdot LDA #$2E STA $D021 skipdot STA $0607 BNE loop