TEXTBK equ $00 ;use timer because the logic below is crap ;this way I don't have to count lines - woo! lda #TEXTLINES*19/16 sta TIM64T TEXTX equ 40 lda #TEXTX ldx #0 jsr PositionObject lda #TEXTX+16 inx stx linesleft stx VDELP0 stx VDELP1 jsr PositionObject sta WSYNC sta HMOVE lda #$06 sta NUSIZ0 sta NUSIZ1 lda #$0E sta COLUP0 sta COLUP1 ldx #22 lda #>Glyph0 SetFont sta charptr+1,X dex dex bpl SetFont ;fuck this shit lda toppos sec sbc #16 bmi ParityTopPad tax TopPad sta WSYNC dex bpl TopPad bmi DoneTopPad ParityTopPad and #1 beq DoneTopPad sta WSYNC DoneTopPad LineLoop ;scroll font lda textline clc adc #1 sec sbc linesleft tax ldy #0 sty GRP0 sty GRP1 sty GRP0 lda Text0,X sta charptr+0,Y lda Text1,X sta charptr+2,Y lda Text2,X sta charptr+4,Y lda Text3,X sta charptr+6,Y lda Text4,X sta charptr+8,Y lda Text5,X sta charptr+10,Y lda Text6,X sta charptr+12,Y lda Text7,X sta charptr+14,Y lda Text8,X sta charptr+16,Y lda Text9,X sta charptr+18,Y lda Text10,X sta charptr+20,Y lda Text11,X sta charptr+22,Y lda linesleft bne TopLineStart ;bottom line lda toppos cmp #22 bcs ToNoBottomLine lda toppos lsr sec sbc #4 bpl BottomTextEndOK lda #$FF BottomTextEndOK sta textend ldy #CHARH-1 bne twelvecharKernelLoop ToNoBottomLine jmp NoBottomLine TopLineStart lda #38 sec sbc toppos beq NoBottomLine cmp #8 bcc TopLinesOK lda #8 TopLinesOK sta temp lda #7 sec sbc temp sta textend lda toppos lsr cmp #7 bcc TopStartOK lda #7 TopStartOK tay twelvecharKernelLoop lda #$80 sta HMP0 sta HMP1 ;cy 66 sta WSYNC sta HMOVE ;right 8 pixels pla pha lda (charptr+2),Y sta GRP0 lda (charptr+6),Y sta GRP1 lda (charptr+10),Y sta GRP0 lda (charptr+14),Y sta GRP1 lda (charptr+18),Y sta GRP0 lda (charptr+22),Y sta GRP1 sta GRP0 pla pha sta HMCLR ;I found a video that explains how this works: sta HMOVE ;http://www.youtube.com/watch?v=9wT_OTml5vE pla pha lda (charptr+0),Y sta GRP0 lda (charptr+4),Y sta GRP1 lda (charptr+8),Y sta GRP0 lda (charptr+12),Y sta GRP1 lda (charptr+16),Y sta GRP0 lda (charptr+20),Y sta GRP1 sta GRP0 dey cpy textend bne twelvecharKernelLoop dec linesleft bmi NoBottomLine jmp LineLoop NoBottomLine sta WSYNC lda #0 sta GRP0 sta GRP1 sta GRP0 WaitForTextEnd lda INTIM bne WaitForTextEnd sta WSYNC sta COLUBK